const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D5_qkcvx.js","assets/sha3--8JbGYfk.js","assets/utils-CqP-FaiV.js","assets/clsx.m-DHulAg21.js","assets/index-Clsy6Hc8.js","assets/events-DQ172AOg.js","assets/index-B8lqC164.js","assets/index-Bgc9HhbY.js","assets/index-T8pJAHMX.js","assets/index.es-B-kD0bVs.js"])))=>i.map(i=>d[i]);
var VGe=Object.defineProperty;var hde=e=>{throw TypeError(e)};var WGe=(e,t,n)=>t in e?VGe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Un=(e,t,n)=>WGe(e,typeof t!="symbol"?t+"":t,n),az=(e,t,n)=>t.has(e)||hde("Cannot "+n);var $e=(e,t,n)=>(az(e,t,"read from private field"),n?n.call(e):t.get(e)),Ln=(e,t,n)=>t.has(e)?hde("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ht=(e,t,n,r)=>(az(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),yr=(e,t,n)=>(az(e,t,"access private method"),n);var eb=(e,t,n,r)=>({set _(s){Ht(e,t,s,n)},get _(){return $e(e,t,r)}});function INe(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();var ju=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ji(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t2n(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}var oz={exports:{}},c7={},lz={exports:{}},Di={};/**
 * @license React
 * react.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var pde;function qGe(){if(pde)return Di;pde=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.iterator;function x(ae){return ae===null||typeof ae!="object"?null:(ae=f&&ae[f]||ae["@@iterator"],typeof ae=="function"?ae:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,w={};function C(ae,fe,Ae){this.props=ae,this.context=fe,this.refs=w,this.updater=Ae||g}C.prototype.isReactComponent={},C.prototype.setState=function(ae,fe){if(typeof ae!="object"&&typeof ae!="function"&&ae!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,ae,fe,"setState")},C.prototype.forceUpdate=function(ae){this.updater.enqueueForceUpdate(this,ae,"forceUpdate")};function N(){}N.prototype=C.prototype;function I(ae,fe,Ae){this.props=ae,this.context=fe,this.refs=w,this.updater=Ae||g}var P=I.prototype=new N;P.constructor=I,v(P,C.prototype),P.isPureReactComponent=!0;var R=Array.isArray,F=Object.prototype.hasOwnProperty,U={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function z(ae,fe,Ae){var ce,ye={},Ne=null,be=null;if(fe!=null)for(ce in fe.ref!==void 0&&(be=fe.ref),fe.key!==void 0&&(Ne=""+fe.key),fe)F.call(fe,ce)&&!L.hasOwnProperty(ce)&&(ye[ce]=fe[ce]);var je=arguments.length-2;if(je===1)ye.children=Ae;else if(1<je){for(var Ie=Array(je),Re=0;Re<je;Re++)Ie[Re]=arguments[Re+2];ye.children=Ie}if(ae&&ae.defaultProps)for(ce in je=ae.defaultProps,je)ye[ce]===void 0&&(ye[ce]=je[ce]);return{$$typeof:e,type:ae,key:Ne,ref:be,props:ye,_owner:U.current}}function X(ae,fe){return{$$typeof:e,type:ae.type,key:fe,ref:ae.ref,props:ae.props,_owner:ae._owner}}function ne(ae){return typeof ae=="object"&&ae!==null&&ae.$$typeof===e}function J(ae){var fe={"=":"=0",":":"=2"};return"$"+ae.replace(/[=:]/g,function(Ae){return fe[Ae]})}var Z=/\/+/g;function re(ae,fe){return typeof ae=="object"&&ae!==null&&ae.key!=null?J(""+ae.key):fe.toString(36)}function he(ae,fe,Ae,ce,ye){var Ne=typeof ae;(Ne==="undefined"||Ne==="boolean")&&(ae=null);var be=!1;if(ae===null)be=!0;else switch(Ne){case"string":case"number":be=!0;break;case"object":switch(ae.$$typeof){case e:case t:be=!0}}if(be)return be=ae,ye=ye(be),ae=ce===""?"."+re(be,0):ce,R(ye)?(Ae="",ae!=null&&(Ae=ae.replace(Z,"$&/")+"/"),he(ye,fe,Ae,"",function(Re){return Re})):ye!=null&&(ne(ye)&&(ye=X(ye,Ae+(!ye.key||be&&be.key===ye.key?"":(""+ye.key).replace(Z,"$&/")+"/")+ae)),fe.push(ye)),1;if(be=0,ce=ce===""?".":ce+":",R(ae))for(var je=0;je<ae.length;je++){Ne=ae[je];var Ie=ce+re(Ne,je);be+=he(Ne,fe,Ae,Ie,ye)}else if(Ie=x(ae),typeof Ie=="function")for(ae=Ie.call(ae),je=0;!(Ne=ae.next()).done;)Ne=Ne.value,Ie=ce+re(Ne,je++),be+=he(Ne,fe,Ae,Ie,ye);else if(Ne==="object")throw fe=String(ae),Error("Objects are not valid as a React child (found: "+(fe==="[object Object]"?"object with keys {"+Object.keys(ae).join(", ")+"}":fe)+"). If you meant to render a collection of children, use an array instead.");return be}function Y(ae,fe,Ae){if(ae==null)return ae;var ce=[],ye=0;return he(ae,ce,"","",function(Ne){return fe.call(Ae,Ne,ye++)}),ce}function ie(ae){if(ae._status===-1){var fe=ae._result;fe=fe(),fe.then(function(Ae){(ae._status===0||ae._status===-1)&&(ae._status=1,ae._result=Ae)},function(Ae){(ae._status===0||ae._status===-1)&&(ae._status=2,ae._result=Ae)}),ae._status===-1&&(ae._status=0,ae._result=fe)}if(ae._status===1)return ae._result.default;throw ae._result}var oe={current:null},G={transition:null},V={ReactCurrentDispatcher:oe,ReactCurrentBatchConfig:G,ReactCurrentOwner:U};function ee(){throw Error("act(...) is not supported in production builds of React.")}return Di.Children={map:Y,forEach:function(ae,fe,Ae){Y(ae,function(){fe.apply(this,arguments)},Ae)},count:function(ae){var fe=0;return Y(ae,function(){fe++}),fe},toArray:function(ae){return Y(ae,function(fe){return fe})||[]},only:function(ae){if(!ne(ae))throw Error("React.Children.only expected to receive a single React element child.");return ae}},Di.Component=C,Di.Fragment=n,Di.Profiler=s,Di.PureComponent=I,Di.StrictMode=r,Di.Suspense=c,Di.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=V,Di.act=ee,Di.cloneElement=function(ae,fe,Ae){if(ae==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+ae+".");var ce=v({},ae.props),ye=ae.key,Ne=ae.ref,be=ae._owner;if(fe!=null){if(fe.ref!==void 0&&(Ne=fe.ref,be=U.current),fe.key!==void 0&&(ye=""+fe.key),ae.type&&ae.type.defaultProps)var je=ae.type.defaultProps;for(Ie in fe)F.call(fe,Ie)&&!L.hasOwnProperty(Ie)&&(ce[Ie]=fe[Ie]===void 0&&je!==void 0?je[Ie]:fe[Ie])}var Ie=arguments.length-2;if(Ie===1)ce.children=Ae;else if(1<Ie){je=Array(Ie);for(var Re=0;Re<Ie;Re++)je[Re]=arguments[Re+2];ce.children=je}return{$$typeof:e,type:ae.type,key:ye,ref:Ne,props:ce,_owner:be}},Di.createContext=function(ae){return ae={$$typeof:o,_currentValue:ae,_currentValue2:ae,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},ae.Provider={$$typeof:a,_context:ae},ae.Consumer=ae},Di.createElement=z,Di.createFactory=function(ae){var fe=z.bind(null,ae);return fe.type=ae,fe},Di.createRef=function(){return{current:null}},Di.forwardRef=function(ae){return{$$typeof:l,render:ae}},Di.isValidElement=ne,Di.lazy=function(ae){return{$$typeof:d,_payload:{_status:-1,_result:ae},_init:ie}},Di.memo=function(ae,fe){return{$$typeof:u,type:ae,compare:fe===void 0?null:fe}},Di.startTransition=function(ae){var fe=G.transition;G.transition={};try{ae()}finally{G.transition=fe}},Di.unstable_act=ee,Di.useCallback=function(ae,fe){return oe.current.useCallback(ae,fe)},Di.useContext=function(ae){return oe.current.useContext(ae)},Di.useDebugValue=function(){},Di.useDeferredValue=function(ae){return oe.current.useDeferredValue(ae)},Di.useEffect=function(ae,fe){return oe.current.useEffect(ae,fe)},Di.useId=function(){return oe.current.useId()},Di.useImperativeHandle=function(ae,fe,Ae){return oe.current.useImperativeHandle(ae,fe,Ae)},Di.useInsertionEffect=function(ae,fe){return oe.current.useInsertionEffect(ae,fe)},Di.useLayoutEffect=function(ae,fe){return oe.current.useLayoutEffect(ae,fe)},Di.useMemo=function(ae,fe){return oe.current.useMemo(ae,fe)},Di.useReducer=function(ae,fe,Ae){return oe.current.useReducer(ae,fe,Ae)},Di.useRef=function(ae){return oe.current.useRef(ae)},Di.useState=function(ae){return oe.current.useState(ae)},Di.useSyncExternalStore=function(ae,fe,Ae){return oe.current.useSyncExternalStore(ae,fe,Ae)},Di.useTransition=function(){return oe.current.useTransition()},Di.version="18.3.1",Di}var mde;function tx(){return mde||(mde=1,lz.exports=qGe()),lz.exports}/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var xde;function GGe(){if(xde)return c7;xde=1;var e=tx(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(l,c,u){var d,f={},x=null,g=null;u!==void 0&&(x=""+u),c.key!==void 0&&(x=""+c.key),c.ref!==void 0&&(g=c.ref);for(d in c)r.call(c,d)&&!a.hasOwnProperty(d)&&(f[d]=c[d]);if(l&&l.defaultProps)for(d in c=l.defaultProps,c)f[d]===void 0&&(f[d]=c[d]);return{$$typeof:t,type:l,key:x,ref:g,props:f,_owner:s.current}}return c7.Fragment=n,c7.jsx=o,c7.jsxs=o,c7}var gde;function KGe(){return gde||(gde=1,oz.exports=GGe()),oz.exports}var i=KGe(),vI={},cz={exports:{}},Ed={},uz={exports:{}},dz={};/**
 * @license React
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var bde;function YGe(){return bde||(bde=1,function(e){function t(G,V){var ee=G.length;G.push(V);e:for(;0<ee;){var ae=ee-1>>>1,fe=G[ae];if(0<s(fe,V))G[ae]=V,G[ee]=fe,ee=ae;else break e}}function n(G){return G.length===0?null:G[0]}function r(G){if(G.length===0)return null;var V=G[0],ee=G.pop();if(ee!==V){G[0]=ee;e:for(var ae=0,fe=G.length,Ae=fe>>>1;ae<Ae;){var ce=2*(ae+1)-1,ye=G[ce],Ne=ce+1,be=G[Ne];if(0>s(ye,ee))Ne<fe&&0>s(be,ye)?(G[ae]=be,G[Ne]=ee,ae=Ne):(G[ae]=ye,G[ce]=ee,ae=ce);else if(Ne<fe&&0>s(be,ee))G[ae]=be,G[Ne]=ee,ae=Ne;else break e}}return V}function s(G,V){var ee=G.sortIndex-V.sortIndex;return ee!==0?ee:G.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,x=3,g=!1,v=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(G){for(var V=n(u);V!==null;){if(V.callback===null)r(u);else if(V.startTime<=G)r(u),V.sortIndex=V.expirationTime,t(c,V);else break;V=n(u)}}function R(G){if(w=!1,P(G),!v)if(n(c)!==null)v=!0,ie(F);else{var V=n(u);V!==null&&oe(R,V.startTime-G)}}function F(G,V){v=!1,w&&(w=!1,N(z),z=-1),g=!0;var ee=x;try{for(P(V),f=n(c);f!==null&&(!(f.expirationTime>V)||G&&!J());){var ae=f.callback;if(typeof ae=="function"){f.callback=null,x=f.priorityLevel;var fe=ae(f.expirationTime<=V);V=e.unstable_now(),typeof fe=="function"?f.callback=fe:f===n(c)&&r(c),P(V)}else r(c);f=n(c)}if(f!==null)var Ae=!0;else{var ce=n(u);ce!==null&&oe(R,ce.startTime-V),Ae=!1}return Ae}finally{f=null,x=ee,g=!1}}var U=!1,L=null,z=-1,X=5,ne=-1;function J(){return!(e.unstable_now()-ne<X)}function Z(){if(L!==null){var G=e.unstable_now();ne=G;var V=!0;try{V=L(!0,G)}finally{V?re():(U=!1,L=null)}}else U=!1}var re;if(typeof I=="function")re=function(){I(Z)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,Y=he.port2;he.port1.onmessage=Z,re=function(){Y.postMessage(null)}}else re=function(){C(Z,0)};function ie(G){L=G,U||(U=!0,re())}function oe(G,V){z=C(function(){G(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_continueExecution=function(){v||g||(v=!0,ie(F))},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(G){switch(x){case 1:case 2:case 3:var V=3;break;default:V=x}var ee=x;x=V;try{return G()}finally{x=ee}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(G,V){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var ee=x;x=G;try{return V()}finally{x=ee}},e.unstable_scheduleCallback=function(G,V,ee){var ae=e.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?ae+ee:ae):ee=ae,G){case 1:var fe=-1;break;case 2:fe=250;break;case 5:fe=1073741823;break;case 4:fe=1e4;break;default:fe=5e3}return fe=ee+fe,G={id:d++,callback:V,priorityLevel:G,startTime:ee,expirationTime:fe,sortIndex:-1},ee>ae?(G.sortIndex=ee,t(u,G),n(c)===null&&G===n(u)&&(w?(N(z),z=-1):w=!0,oe(R,ee-ae))):(G.sortIndex=fe,t(c,G),v||g||(v=!0,ie(F))),G},e.unstable_shouldYield=J,e.unstable_wrapCallback=function(G){var V=x;return function(){var ee=x;x=V;try{return G.apply(this,arguments)}finally{x=ee}}}}(dz)),dz}var yde;function XGe(){return yde||(yde=1,uz.exports=YGe()),uz.exports}/**
 * @license React
 * react-dom.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var vde;function QGe(){if(vde)return Ed;vde=1;var e=tx(),t=XGe();function n(A){for(var M="https://reactjs.org/docs/error-decoder.html?invariant="+A,Q=1;Q<arguments.length;Q++)M+="&args[]="+encodeURIComponent(arguments[Q]);return"Minified React error #"+A+"; visit "+M+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function a(A,M){o(A,M),o(A+"Capture",M)}function o(A,M){for(s[A]=M,A=0;A<M.length;A++)r.add(M[A])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},f={};function x(A){return c.call(f,A)?!0:c.call(d,A)?!1:u.test(A)?f[A]=!0:(d[A]=!0,!1)}function g(A,M,Q,me){if(Q!==null&&Q.type===0)return!1;switch(typeof M){case"function":case"symbol":return!0;case"boolean":return me?!1:Q!==null?!Q.acceptsBooleans:(A=A.toLowerCase().slice(0,5),A!=="data-"&&A!=="aria-");default:return!1}}function v(A,M,Q,me){if(M===null||typeof M>"u"||g(A,M,Q,me))return!0;if(me)return!1;if(Q!==null)switch(Q.type){case 3:return!M;case 4:return M===!1;case 5:return isNaN(M);case 6:return isNaN(M)||1>M}return!1}function w(A,M,Q,me,Pe,Ue,Ct){this.acceptsBooleans=M===2||M===3||M===4,this.attributeName=me,this.attributeNamespace=Pe,this.mustUseProperty=Q,this.propertyName=A,this.type=M,this.sanitizeURL=Ue,this.removeEmptyString=Ct}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(A){C[A]=new w(A,0,!1,A,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(A){var M=A[0];C[M]=new w(M,1,!1,A[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(A){C[A]=new w(A,2,!1,A.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(A){C[A]=new w(A,2,!1,A,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(A){C[A]=new w(A,3,!1,A.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(A){C[A]=new w(A,3,!0,A,null,!1,!1)}),["capture","download"].forEach(function(A){C[A]=new w(A,4,!1,A,null,!1,!1)}),["cols","rows","size","span"].forEach(function(A){C[A]=new w(A,6,!1,A,null,!1,!1)}),["rowSpan","start"].forEach(function(A){C[A]=new w(A,5,!1,A.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function I(A){return A[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(A){var M=A.replace(N,I);C[M]=new w(M,1,!1,A,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(A){var M=A.replace(N,I);C[M]=new w(M,1,!1,A,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(A){var M=A.replace(N,I);C[M]=new w(M,1,!1,A,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(A){C[A]=new w(A,1,!1,A.toLowerCase(),null,!1,!1)}),C.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(A){C[A]=new w(A,1,!1,A.toLowerCase(),null,!0,!0)});function P(A,M,Q,me){var Pe=C.hasOwnProperty(M)?C[M]:null;(Pe!==null?Pe.type!==0:me||!(2<M.length)||M[0]!=="o"&&M[0]!=="O"||M[1]!=="n"&&M[1]!=="N")&&(v(M,Q,Pe,me)&&(Q=null),me||Pe===null?x(M)&&(Q===null?A.removeAttribute(M):A.setAttribute(M,""+Q)):Pe.mustUseProperty?A[Pe.propertyName]=Q===null?Pe.type===3?!1:"":Q:(M=Pe.attributeName,me=Pe.attributeNamespace,Q===null?A.removeAttribute(M):(Pe=Pe.type,Q=Pe===3||Pe===4&&Q===!0?"":""+Q,me?A.setAttributeNS(me,M,Q):A.setAttribute(M,Q))))}var R=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,F=Symbol.for("react.element"),U=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),X=Symbol.for("react.profiler"),ne=Symbol.for("react.provider"),J=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),re=Symbol.for("react.suspense"),he=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),ie=Symbol.for("react.lazy"),oe=Symbol.for("react.offscreen"),G=Symbol.iterator;function V(A){return A===null||typeof A!="object"?null:(A=G&&A[G]||A["@@iterator"],typeof A=="function"?A:null)}var ee=Object.assign,ae;function fe(A){if(ae===void 0)try{throw Error()}catch(Q){var M=Q.stack.trim().match(/\n( *(at )?)/);ae=M&&M[1]||""}return`
`+ae+A}var Ae=!1;function ce(A,M){if(!A||Ae)return"";Ae=!0;var Q=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(M)if(M=function(){throw Error()},Object.defineProperty(M.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(M,[])}catch(rr){var me=rr}Reflect.construct(A,[],M)}else{try{M.call()}catch(rr){me=rr}A.call(M.prototype)}else{try{throw Error()}catch(rr){me=rr}A()}}catch(rr){if(rr&&me&&typeof rr.stack=="string"){for(var Pe=rr.stack.split(`
`),Ue=me.stack.split(`
`),Ct=Pe.length-1,mn=Ue.length-1;1<=Ct&&0<=mn&&Pe[Ct]!==Ue[mn];)mn--;for(;1<=Ct&&0<=mn;Ct--,mn--)if(Pe[Ct]!==Ue[mn]){if(Ct!==1||mn!==1)do if(Ct--,mn--,0>mn||Pe[Ct]!==Ue[mn]){var In=`
`+Pe[Ct].replace(" at new "," at ");return A.displayName&&In.includes("<anonymous>")&&(In=In.replace("<anonymous>",A.displayName)),In}while(1<=Ct&&0<=mn);break}}}finally{Ae=!1,Error.prepareStackTrace=Q}return(A=A?A.displayName||A.name:"")?fe(A):""}function ye(A){switch(A.tag){case 5:return fe(A.type);case 16:return fe("Lazy");case 13:return fe("Suspense");case 19:return fe("SuspenseList");case 0:case 2:case 15:return A=ce(A.type,!1),A;case 11:return A=ce(A.type.render,!1),A;case 1:return A=ce(A.type,!0),A;default:return""}}function Ne(A){if(A==null)return null;if(typeof A=="function")return A.displayName||A.name||null;if(typeof A=="string")return A;switch(A){case L:return"Fragment";case U:return"Portal";case X:return"Profiler";case z:return"StrictMode";case re:return"Suspense";case he:return"SuspenseList"}if(typeof A=="object")switch(A.$$typeof){case J:return(A.displayName||"Context")+".Consumer";case ne:return(A._context.displayName||"Context")+".Provider";case Z:var M=A.render;return A=A.displayName,A||(A=M.displayName||M.name||"",A=A!==""?"ForwardRef("+A+")":"ForwardRef"),A;case Y:return M=A.displayName||null,M!==null?M:Ne(A.type)||"Memo";case ie:M=A._payload,A=A._init;try{return Ne(A(M))}catch{}}return null}function be(A){var M=A.type;switch(A.tag){case 24:return"Cache";case 9:return(M.displayName||"Context")+".Consumer";case 10:return(M._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return A=M.render,A=A.displayName||A.name||"",M.displayName||(A!==""?"ForwardRef("+A+")":"ForwardRef");case 7:return"Fragment";case 5:return M;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ne(M);case 8:return M===z?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof M=="function")return M.displayName||M.name||null;if(typeof M=="string")return M}return null}function je(A){switch(typeof A){case"boolean":case"number":case"string":case"undefined":return A;case"object":return A;default:return""}}function Ie(A){var M=A.type;return(A=A.nodeName)&&A.toLowerCase()==="input"&&(M==="checkbox"||M==="radio")}function Re(A){var M=Ie(A)?"checked":"value",Q=Object.getOwnPropertyDescriptor(A.constructor.prototype,M),me=""+A[M];if(!A.hasOwnProperty(M)&&typeof Q<"u"&&typeof Q.get=="function"&&typeof Q.set=="function"){var Pe=Q.get,Ue=Q.set;return Object.defineProperty(A,M,{configurable:!0,get:function(){return Pe.call(this)},set:function(Ct){me=""+Ct,Ue.call(this,Ct)}}),Object.defineProperty(A,M,{enumerable:Q.enumerable}),{getValue:function(){return me},setValue:function(Ct){me=""+Ct},stopTracking:function(){A._valueTracker=null,delete A[M]}}}}function Qe(A){A._valueTracker||(A._valueTracker=Re(A))}function Be(A){if(!A)return!1;var M=A._valueTracker;if(!M)return!0;var Q=M.getValue(),me="";return A&&(me=Ie(A)?A.checked?"true":"false":A.value),A=me,A!==Q?(M.setValue(A),!0):!1}function it(A){if(A=A||(typeof document<"u"?document:void 0),typeof A>"u")return null;try{return A.activeElement||A.body}catch{return A.body}}function tt(A,M){var Q=M.checked;return ee({},M,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:Q??A._wrapperState.initialChecked})}function at(A,M){var Q=M.defaultValue==null?"":M.defaultValue,me=M.checked!=null?M.checked:M.defaultChecked;Q=je(M.value!=null?M.value:Q),A._wrapperState={initialChecked:me,initialValue:Q,controlled:M.type==="checkbox"||M.type==="radio"?M.checked!=null:M.value!=null}}function dt(A,M){M=M.checked,M!=null&&P(A,"checked",M,!1)}function ct(A,M){dt(A,M);var Q=je(M.value),me=M.type;if(Q!=null)me==="number"?(Q===0&&A.value===""||A.value!=Q)&&(A.value=""+Q):A.value!==""+Q&&(A.value=""+Q);else if(me==="submit"||me==="reset"){A.removeAttribute("value");return}M.hasOwnProperty("value")?kt(A,M.type,Q):M.hasOwnProperty("defaultValue")&&kt(A,M.type,je(M.defaultValue)),M.checked==null&&M.defaultChecked!=null&&(A.defaultChecked=!!M.defaultChecked)}function Ut(A,M,Q){if(M.hasOwnProperty("value")||M.hasOwnProperty("defaultValue")){var me=M.type;if(!(me!=="submit"&&me!=="reset"||M.value!==void 0&&M.value!==null))return;M=""+A._wrapperState.initialValue,Q||M===A.value||(A.value=M),A.defaultValue=M}Q=A.name,Q!==""&&(A.name=""),A.defaultChecked=!!A._wrapperState.initialChecked,Q!==""&&(A.name=Q)}function kt(A,M,Q){(M!=="number"||it(A.ownerDocument)!==A)&&(Q==null?A.defaultValue=""+A._wrapperState.initialValue:A.defaultValue!==""+Q&&(A.defaultValue=""+Q))}var tn=Array.isArray;function jt(A,M,Q,me){if(A=A.options,M){M={};for(var Pe=0;Pe<Q.length;Pe++)M["$"+Q[Pe]]=!0;for(Q=0;Q<A.length;Q++)Pe=M.hasOwnProperty("$"+A[Q].value),A[Q].selected!==Pe&&(A[Q].selected=Pe),Pe&&me&&(A[Q].defaultSelected=!0)}else{for(Q=""+je(Q),M=null,Pe=0;Pe<A.length;Pe++){if(A[Pe].value===Q){A[Pe].selected=!0,me&&(A[Pe].defaultSelected=!0);return}M!==null||A[Pe].disabled||(M=A[Pe])}M!==null&&(M.selected=!0)}}function un(A,M){if(M.dangerouslySetInnerHTML!=null)throw Error(n(91));return ee({},M,{value:void 0,defaultValue:void 0,children:""+A._wrapperState.initialValue})}function cn(A,M){var Q=M.value;if(Q==null){if(Q=M.children,M=M.defaultValue,Q!=null){if(M!=null)throw Error(n(92));if(tn(Q)){if(1<Q.length)throw Error(n(93));Q=Q[0]}M=Q}M==null&&(M=""),Q=M}A._wrapperState={initialValue:je(Q)}}function Pt(A,M){var Q=je(M.value),me=je(M.defaultValue);Q!=null&&(Q=""+Q,Q!==A.value&&(A.value=Q),M.defaultValue==null&&A.defaultValue!==Q&&(A.defaultValue=Q)),me!=null&&(A.defaultValue=""+me)}function Xe(A){var M=A.textContent;M===A._wrapperState.initialValue&&M!==""&&M!==null&&(A.value=M)}function Vt(A){switch(A){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Yt(A,M){return A==null||A==="http://www.w3.org/1999/xhtml"?Vt(M):A==="http://www.w3.org/2000/svg"&&M==="foreignObject"?"http://www.w3.org/1999/xhtml":A}var Ve,Ke=function(A){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(M,Q,me,Pe){MSApp.execUnsafeLocalFunction(function(){return A(M,Q,me,Pe)})}:A}(function(A,M){if(A.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in A)A.innerHTML=M;else{for(Ve=Ve||document.createElement("div"),Ve.innerHTML="<svg>"+M.valueOf().toString()+"</svg>",M=Ve.firstChild;A.firstChild;)A.removeChild(A.firstChild);for(;M.firstChild;)A.appendChild(M.firstChild)}});function ft(A,M){if(M){var Q=A.firstChild;if(Q&&Q===A.lastChild&&Q.nodeType===3){Q.nodeValue=M;return}}A.textContent=M}var en={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Dt=["Webkit","ms","Moz","O"];Object.keys(en).forEach(function(A){Dt.forEach(function(M){M=M+A.charAt(0).toUpperCase()+A.substring(1),en[M]=en[A]})});function At(A,M,Q){return M==null||typeof M=="boolean"||M===""?"":Q||typeof M!="number"||M===0||en.hasOwnProperty(A)&&en[A]?(""+M).trim():M+"px"}function Je(A,M){A=A.style;for(var Q in M)if(M.hasOwnProperty(Q)){var me=Q.indexOf("--")===0,Pe=At(Q,M[Q],me);Q==="float"&&(Q="cssFloat"),me?A.setProperty(Q,Pe):A[Q]=Pe}}var He=ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Rt(A,M){if(M){if(He[A]&&(M.children!=null||M.dangerouslySetInnerHTML!=null))throw Error(n(137,A));if(M.dangerouslySetInnerHTML!=null){if(M.children!=null)throw Error(n(60));if(typeof M.dangerouslySetInnerHTML!="object"||!("__html"in M.dangerouslySetInnerHTML))throw Error(n(61))}if(M.style!=null&&typeof M.style!="object")throw Error(n(62))}}function qe(A,M){if(A.indexOf("-")===-1)return typeof M.is=="string";switch(A){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var lt=null;function xt(A){return A=A.target||A.srcElement||window,A.correspondingUseElement&&(A=A.correspondingUseElement),A.nodeType===3?A.parentNode:A}var Nt=null,It=null,xn=null;function dn(A){if(A=oc(A)){if(typeof Nt!="function")throw Error(n(280));var M=A.stateNode;M&&(M=L5(M),Nt(A.stateNode,A.type,M))}}function Mn(A){It?xn?xn.push(A):xn=[A]:It=A}function _n(){if(It){var A=It,M=xn;if(xn=It=null,dn(A),M)for(A=0;A<M.length;A++)dn(M[A])}}function kn(A,M){return A(M)}function vn(){}var Qn=!1;function Hn(A,M,Q){if(Qn)return A(M,Q);Qn=!0;try{return kn(A,M,Q)}finally{Qn=!1,(It!==null||xn!==null)&&(vn(),_n())}}function $n(A,M){var Q=A.stateNode;if(Q===null)return null;var me=L5(Q);if(me===null)return null;Q=me[M];e:switch(M){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(me=!me.disabled)||(A=A.type,me=!(A==="button"||A==="input"||A==="select"||A==="textarea")),A=!me;break e;default:A=!1}if(A)return null;if(Q&&typeof Q!="function")throw Error(n(231,M,typeof Q));return Q}var Jn=!1;if(l)try{var Nn={};Object.defineProperty(Nn,"passive",{get:function(){Jn=!0}}),window.addEventListener("test",Nn,Nn),window.removeEventListener("test",Nn,Nn)}catch{Jn=!1}function ln(A,M,Q,me,Pe,Ue,Ct,mn,In){var rr=Array.prototype.slice.call(arguments,3);try{M.apply(Q,rr)}catch(Dr){this.onError(Dr)}}var Oe=!1,sn=null,fn=!1,Et=null,Kn={onError:function(A){Oe=!0,sn=A}};function Cn(A,M,Q,me,Pe,Ue,Ct,mn,In){Oe=!1,sn=null,ln.apply(Kn,arguments)}function Bt(A,M,Q,me,Pe,Ue,Ct,mn,In){if(Cn.apply(this,arguments),Oe){if(Oe){var rr=sn;Oe=!1,sn=null}else throw Error(n(198));fn||(fn=!0,Et=rr)}}function an(A){var M=A,Q=A;if(A.alternate)for(;M.return;)M=M.return;else{A=M;do M=A,M.flags&4098&&(Q=M.return),A=M.return;while(A)}return M.tag===3?Q:null}function Pn(A){if(A.tag===13){var M=A.memoizedState;if(M===null&&(A=A.alternate,A!==null&&(M=A.memoizedState)),M!==null)return M.dehydrated}return null}function qn(A){if(an(A)!==A)throw Error(n(188))}function nr(A){var M=A.alternate;if(!M){if(M=an(A),M===null)throw Error(n(188));return M!==A?null:A}for(var Q=A,me=M;;){var Pe=Q.return;if(Pe===null)break;var Ue=Pe.alternate;if(Ue===null){if(me=Pe.return,me!==null){Q=me;continue}break}if(Pe.child===Ue.child){for(Ue=Pe.child;Ue;){if(Ue===Q)return qn(Pe),A;if(Ue===me)return qn(Pe),M;Ue=Ue.sibling}throw Error(n(188))}if(Q.return!==me.return)Q=Pe,me=Ue;else{for(var Ct=!1,mn=Pe.child;mn;){if(mn===Q){Ct=!0,Q=Pe,me=Ue;break}if(mn===me){Ct=!0,me=Pe,Q=Ue;break}mn=mn.sibling}if(!Ct){for(mn=Ue.child;mn;){if(mn===Q){Ct=!0,Q=Ue,me=Pe;break}if(mn===me){Ct=!0,me=Ue,Q=Pe;break}mn=mn.sibling}if(!Ct)throw Error(n(189))}}if(Q.alternate!==me)throw Error(n(190))}if(Q.tag!==3)throw Error(n(188));return Q.stateNode.current===Q?A:M}function tr(A){return A=nr(A),A!==null?Qt(A):null}function Qt(A){if(A.tag===5||A.tag===6)return A;for(A=A.child;A!==null;){var M=Qt(A);if(M!==null)return M;A=A.sibling}return null}var zn=t.unstable_scheduleCallback,Yn=t.unstable_cancelCallback,Lt=t.unstable_shouldYield,Fn=t.unstable_requestPaint,Ee=t.unstable_now,p=t.unstable_getCurrentPriorityLevel,h=t.unstable_ImmediatePriority,S=t.unstable_UserBlockingPriority,_=t.unstable_NormalPriority,k=t.unstable_LowPriority,T=t.unstable_IdlePriority,B=null,q=null;function te(A){if(q&&typeof q.onCommitFiberRoot=="function")try{q.onCommitFiberRoot(B,A,void 0,(A.current.flags&128)===128)}catch{}}var ue=Math.clz32?Math.clz32:we,de=Math.log,xe=Math.LN2;function we(A){return A>>>=0,A===0?32:31-(de(A)/xe|0)|0}var ke=64,Me=4194304;function Ye(A){switch(A&-A){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return A&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return A&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return A}}function Fe(A,M){var Q=A.pendingLanes;if(Q===0)return 0;var me=0,Pe=A.suspendedLanes,Ue=A.pingedLanes,Ct=Q&268435455;if(Ct!==0){var mn=Ct&~Pe;mn!==0?me=Ye(mn):(Ue&=Ct,Ue!==0&&(me=Ye(Ue)))}else Ct=Q&~Pe,Ct!==0?me=Ye(Ct):Ue!==0&&(me=Ye(Ue));if(me===0)return 0;if(M!==0&&M!==me&&!(M&Pe)&&(Pe=me&-me,Ue=M&-M,Pe>=Ue||Pe===16&&(Ue&4194240)!==0))return M;if(me&4&&(me|=Q&16),M=A.entangledLanes,M!==0)for(A=A.entanglements,M&=me;0<M;)Q=31-ue(M),Pe=1<<Q,me|=A[Q],M&=~Pe;return me}function rt(A,M){switch(A){case 1:case 2:case 4:return M+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return M+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function se(A,M){for(var Q=A.suspendedLanes,me=A.pingedLanes,Pe=A.expirationTimes,Ue=A.pendingLanes;0<Ue;){var Ct=31-ue(Ue),mn=1<<Ct,In=Pe[Ct];In===-1?(!(mn&Q)||mn&me)&&(Pe[Ct]=rt(mn,M)):In<=M&&(A.expiredLanes|=mn),Ue&=~mn}}function Ce(A){return A=A.pendingLanes&-1073741825,A!==0?A:A&1073741824?1073741824:0}function De(){var A=ke;return ke<<=1,!(ke&4194240)&&(ke=64),A}function Le(A){for(var M=[],Q=0;31>Q;Q++)M.push(A);return M}function _e(A,M,Q){A.pendingLanes|=M,M!==536870912&&(A.suspendedLanes=0,A.pingedLanes=0),A=A.eventTimes,M=31-ue(M),A[M]=Q}function nt(A,M){var Q=A.pendingLanes&~M;A.pendingLanes=M,A.suspendedLanes=0,A.pingedLanes=0,A.expiredLanes&=M,A.mutableReadLanes&=M,A.entangledLanes&=M,M=A.entanglements;var me=A.eventTimes;for(A=A.expirationTimes;0<Q;){var Pe=31-ue(Q),Ue=1<<Pe;M[Pe]=0,me[Pe]=-1,A[Pe]=-1,Q&=~Ue}}function ot(A,M){var Q=A.entangledLanes|=M;for(A=A.entanglements;Q;){var me=31-ue(Q),Pe=1<<me;Pe&M|A[me]&M&&(A[me]|=M),Q&=~Pe}}var gt=0;function Jt(A){return A&=-A,1<A?4<A?A&268435455?16:536870912:4:1}var Ge,et,We,wt,St,Kt=!1,gn=[],yn=null,hn=null,br=null,pt=new Map,Wt=new Map,Zt=[],vt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Ot(A,M){switch(A){case"focusin":case"focusout":yn=null;break;case"dragenter":case"dragleave":hn=null;break;case"mouseover":case"mouseout":br=null;break;case"pointerover":case"pointerout":pt.delete(M.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wt.delete(M.pointerId)}}function wn(A,M,Q,me,Pe,Ue){return A===null||A.nativeEvent!==Ue?(A={blockedOn:M,domEventName:Q,eventSystemFlags:me,nativeEvent:Ue,targetContainers:[Pe]},M!==null&&(M=oc(M),M!==null&&et(M)),A):(A.eventSystemFlags|=me,M=A.targetContainers,Pe!==null&&M.indexOf(Pe)===-1&&M.push(Pe),A)}function Gn(A,M,Q,me,Pe){switch(M){case"focusin":return yn=wn(yn,A,M,Q,me,Pe),!0;case"dragenter":return hn=wn(hn,A,M,Q,me,Pe),!0;case"mouseover":return br=wn(br,A,M,Q,me,Pe),!0;case"pointerover":var Ue=Pe.pointerId;return pt.set(Ue,wn(pt.get(Ue)||null,A,M,Q,me,Pe)),!0;case"gotpointercapture":return Ue=Pe.pointerId,Wt.set(Ue,wn(Wt.get(Ue)||null,A,M,Q,me,Pe)),!0}return!1}function fr(A){var M=Kf(A.target);if(M!==null){var Q=an(M);if(Q!==null){if(M=Q.tag,M===13){if(M=Pn(Q),M!==null){A.blockedOn=M,St(A.priority,function(){We(Q)});return}}else if(M===3&&Q.stateNode.current.memoizedState.isDehydrated){A.blockedOn=Q.tag===3?Q.stateNode.containerInfo:null;return}}}A.blockedOn=null}function ur(A){if(A.blockedOn!==null)return!1;for(var M=A.targetContainers;0<M.length;){var Q=vr(A.domEventName,A.eventSystemFlags,M[0],A.nativeEvent);if(Q===null){Q=A.nativeEvent;var me=new Q.constructor(Q.type,Q);lt=me,Q.target.dispatchEvent(me),lt=null}else return M=oc(Q),M!==null&&et(M),A.blockedOn=Q,!1;M.shift()}return!0}function $t(A,M,Q){ur(A)&&Q.delete(M)}function nn(){Kt=!1,yn!==null&&ur(yn)&&(yn=null),hn!==null&&ur(hn)&&(hn=null),br!==null&&ur(br)&&(br=null),pt.forEach($t),Wt.forEach($t)}function Vn(A,M){A.blockedOn===M&&(A.blockedOn=null,Kt||(Kt=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,nn)))}function lr(A){function M(Pe){return Vn(Pe,A)}if(0<gn.length){Vn(gn[0],A);for(var Q=1;Q<gn.length;Q++){var me=gn[Q];me.blockedOn===A&&(me.blockedOn=null)}}for(yn!==null&&Vn(yn,A),hn!==null&&Vn(hn,A),br!==null&&Vn(br,A),pt.forEach(M),Wt.forEach(M),Q=0;Q<Zt.length;Q++)me=Zt[Q],me.blockedOn===A&&(me.blockedOn=null);for(;0<Zt.length&&(Q=Zt[0],Q.blockedOn===null);)fr(Q),Q.blockedOn===null&&Zt.shift()}var er=R.ReactCurrentBatchConfig,gr=!0;function dr(A,M,Q,me){var Pe=gt,Ue=er.transition;er.transition=null;try{gt=1,us(A,M,Q,me)}finally{gt=Pe,er.transition=Ue}}function Fs(A,M,Q,me){var Pe=gt,Ue=er.transition;er.transition=null;try{gt=4,us(A,M,Q,me)}finally{gt=Pe,er.transition=Ue}}function us(A,M,Q,me){if(gr){var Pe=vr(A,M,Q,me);if(Pe===null)f8(A,M,me,xr,Q),Ot(A,me);else if(Gn(Pe,A,M,Q,me))me.stopPropagation();else if(Ot(A,me),M&4&&-1<vt.indexOf(A)){for(;Pe!==null;){var Ue=oc(Pe);if(Ue!==null&&Ge(Ue),Ue=vr(A,M,Q,me),Ue===null&&f8(A,M,me,xr,Q),Ue===Pe)break;Pe=Ue}Pe!==null&&me.stopPropagation()}else f8(A,M,me,null,Q)}}var xr=null;function vr(A,M,Q,me){if(xr=null,A=xt(me),A=Kf(A),A!==null)if(M=an(A),M===null)A=null;else if(Q=M.tag,Q===13){if(A=Pn(M),A!==null)return A;A=null}else if(Q===3){if(M.stateNode.current.memoizedState.isDehydrated)return M.tag===3?M.stateNode.containerInfo:null;A=null}else M!==A&&(A=null);return xr=A,null}function rs(A){switch(A){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(p()){case h:return 1;case S:return 4;case _:case k:return 16;case T:return 536870912;default:return 16}default:return 16}}var Zr=null,gi=null,oi=null;function la(){if(oi)return oi;var A,M=gi,Q=M.length,me,Pe="value"in Zr?Zr.value:Zr.textContent,Ue=Pe.length;for(A=0;A<Q&&M[A]===Pe[A];A++);var Ct=Q-A;for(me=1;me<=Ct&&M[Q-me]===Pe[Ue-me];me++);return oi=Pe.slice(A,1<me?1-me:void 0)}function jr(A){var M=A.keyCode;return"charCode"in A?(A=A.charCode,A===0&&M===13&&(A=13)):A=M,A===10&&(A=13),32<=A||A===13?A:0}function Xt(){return!0}function pe(){return!1}function st(A){function M(Q,me,Pe,Ue,Ct){this._reactName=Q,this._targetInst=Pe,this.type=me,this.nativeEvent=Ue,this.target=Ct,this.currentTarget=null;for(var mn in A)A.hasOwnProperty(mn)&&(Q=A[mn],this[mn]=Q?Q(Ue):Ue[mn]);return this.isDefaultPrevented=(Ue.defaultPrevented!=null?Ue.defaultPrevented:Ue.returnValue===!1)?Xt:pe,this.isPropagationStopped=pe,this}return ee(M.prototype,{preventDefault:function(){this.defaultPrevented=!0;var Q=this.nativeEvent;Q&&(Q.preventDefault?Q.preventDefault():typeof Q.returnValue!="unknown"&&(Q.returnValue=!1),this.isDefaultPrevented=Xt)},stopPropagation:function(){var Q=this.nativeEvent;Q&&(Q.stopPropagation?Q.stopPropagation():typeof Q.cancelBubble!="unknown"&&(Q.cancelBubble=!0),this.isPropagationStopped=Xt)},persist:function(){},isPersistent:Xt}),M}var Ft={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(A){return A.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yt=st(Ft),pn=ee({},Ft,{view:0,detail:0}),An=st(pn),or,_r,wr,pr=ee({},pn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bs,button:0,buttons:0,relatedTarget:function(A){return A.relatedTarget===void 0?A.fromElement===A.srcElement?A.toElement:A.fromElement:A.relatedTarget},movementX:function(A){return"movementX"in A?A.movementX:(A!==wr&&(wr&&A.type==="mousemove"?(or=A.screenX-wr.screenX,_r=A.screenY-wr.screenY):_r=or=0,wr=A),or)},movementY:function(A){return"movementY"in A?A.movementY:_r}}),es=st(pr),ts=ee({},pr,{dataTransfer:0}),Lr=st(ts),Qr=ee({},pn,{relatedTarget:0}),Ir=st(Qr),Ss=ee({},Ft,{animationName:0,elapsedTime:0,pseudoElement:0}),hi=st(Ss),li=ee({},Ft,{clipboardData:function(A){return"clipboardData"in A?A.clipboardData:window.clipboardData}}),Pr=st(li),En=ee({},Ft,{data:0}),Rn=st(En),Dn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nr={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Mr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function cr(A){var M=this.nativeEvent;return M.getModifierState?M.getModifierState(A):(A=Mr[A])?!!M[A]:!1}function bs(){return cr}var Kr=ee({},pn,{key:function(A){if(A.key){var M=Dn[A.key]||A.key;if(M!=="Unidentified")return M}return A.type==="keypress"?(A=jr(A),A===13?"Enter":String.fromCharCode(A)):A.type==="keydown"||A.type==="keyup"?Nr[A.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bs,charCode:function(A){return A.type==="keypress"?jr(A):0},keyCode:function(A){return A.type==="keydown"||A.type==="keyup"?A.keyCode:0},which:function(A){return A.type==="keypress"?jr(A):A.type==="keydown"||A.type==="keyup"?A.keyCode:0}}),Ms=st(Kr),ei=ee({},pr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Tt=st(ei),sr=ee({},pn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bs}),mr=st(sr),Vr=ee({},Ft,{propertyName:0,elapsedTime:0,pseudoElement:0}),as=st(Vr),ns=ee({},pr,{deltaX:function(A){return"deltaX"in A?A.deltaX:"wheelDeltaX"in A?-A.wheelDeltaX:0},deltaY:function(A){return"deltaY"in A?A.deltaY:"wheelDeltaY"in A?-A.wheelDeltaY:"wheelDelta"in A?-A.wheelDelta:0},deltaZ:0,deltaMode:0}),ys=st(ns),Ns=[9,13,27,32],ca=l&&"CompositionEvent"in window,Hs=null;l&&"documentMode"in document&&(Hs=document.documentMode);var vs=l&&"TextEvent"in window&&!Hs,sc=l&&(!ca||Hs&&8<Hs&&11>=Hs),j5=" ",E1=!1;function E5(A,M){switch(A){case"keyup":return Ns.indexOf(M.keyCode)!==-1;case"keydown":return M.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function y2(A){return A=A.detail,typeof A=="object"&&"data"in A?A.data:null}var Bl=!1;function vm(A,M){switch(A){case"compositionend":return y2(M);case"keypress":return M.which!==32?null:(E1=!0,j5);case"textInput":return A=M.data,A===j5&&E1?null:A;default:return null}}function v2(A,M){if(Bl)return A==="compositionend"||!ca&&E5(A,M)?(A=la(),oi=gi=Zr=null,Bl=!1,A):null;switch(A){case"paste":return null;case"keypress":if(!(M.ctrlKey||M.altKey||M.metaKey)||M.ctrlKey&&M.altKey){if(M.char&&1<M.char.length)return M.char;if(M.which)return String.fromCharCode(M.which)}return null;case"compositionend":return sc&&M.locale!=="ko"?null:M.data;default:return null}}var cx={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ii(A){var M=A&&A.nodeName&&A.nodeName.toLowerCase();return M==="input"?!!cx[A.type]:M==="textarea"}function wm(A,M,Q,me){Mn(me),M=F5(M,"onChange"),0<M.length&&(Q=new yt("onChange","change",null,Q,me),A.push({event:Q,listeners:M}))}var ut=null,y=null;function E(A){ET(A,0)}function O(A){var M=bi(A);if(Be(M))return A}function $(A,M){if(A==="change")return M}var H=!1;if(l){var K;if(l){var le="oninput"in document;if(!le){var ve=document.createElement("div");ve.setAttribute("oninput","return;"),le=typeof ve.oninput=="function"}K=le}else K=!1;H=K&&(!document.documentMode||9<document.documentMode)}function Te(){ut&&(ut.detachEvent("onpropertychange",Ze),y=ut=null)}function Ze(A){if(A.propertyName==="value"&&O(y)){var M=[];wm(M,y,A,xt(A)),Hn(E,M)}}function ht(A,M,Q){A==="focusin"?(Te(),ut=M,y=Q,ut.attachEvent("onpropertychange",Ze)):A==="focusout"&&Te()}function _t(A){if(A==="selectionchange"||A==="keyup"||A==="keydown")return O(y)}function rn(A,M){if(A==="click")return O(M)}function bt(A,M){if(A==="input"||A==="change")return O(M)}function zt(A,M){return A===M&&(A!==0||1/A===1/M)||A!==A&&M!==M}var qt=typeof Object.is=="function"?Object.is:zt;function Tn(A,M){if(qt(A,M))return!0;if(typeof A!="object"||A===null||typeof M!="object"||M===null)return!1;var Q=Object.keys(A),me=Object.keys(M);if(Q.length!==me.length)return!1;for(me=0;me<Q.length;me++){var Pe=Q[me];if(!c.call(M,Pe)||!qt(A[Pe],M[Pe]))return!1}return!0}function ir(A){for(;A&&A.firstChild;)A=A.firstChild;return A}function Cr(A,M){var Q=ir(A);A=0;for(var me;Q;){if(Q.nodeType===3){if(me=A+Q.textContent.length,A<=M&&me>=M)return{node:Q,offset:M-A};A=me}e:{for(;Q;){if(Q.nextSibling){Q=Q.nextSibling;break e}Q=Q.parentNode}Q=void 0}Q=ir(Q)}}function Ar(A,M){return A&&M?A===M?!0:A&&A.nodeType===3?!1:M&&M.nodeType===3?Ar(A,M.parentNode):"contains"in A?A.contains(M):A.compareDocumentPosition?!!(A.compareDocumentPosition(M)&16):!1:!1}function ps(){for(var A=window,M=it();M instanceof A.HTMLIFrameElement;){try{var Q=typeof M.contentWindow.location.href=="string"}catch{Q=!1}if(Q)A=M.contentWindow;else break;M=it(A.document)}return M}function Ws(A){var M=A&&A.nodeName&&A.nodeName.toLowerCase();return M&&(M==="input"&&(A.type==="text"||A.type==="search"||A.type==="tel"||A.type==="url"||A.type==="password")||M==="textarea"||A.contentEditable==="true")}function ic(A){var M=ps(),Q=A.focusedElem,me=A.selectionRange;if(M!==Q&&Q&&Q.ownerDocument&&Ar(Q.ownerDocument.documentElement,Q)){if(me!==null&&Ws(Q)){if(M=me.start,A=me.end,A===void 0&&(A=M),"selectionStart"in Q)Q.selectionStart=M,Q.selectionEnd=Math.min(A,Q.value.length);else if(A=(M=Q.ownerDocument||document)&&M.defaultView||window,A.getSelection){A=A.getSelection();var Pe=Q.textContent.length,Ue=Math.min(me.start,Pe);me=me.end===void 0?Ue:Math.min(me.end,Pe),!A.extend&&Ue>me&&(Pe=me,me=Ue,Ue=Pe),Pe=Cr(Q,Ue);var Ct=Cr(Q,me);Pe&&Ct&&(A.rangeCount!==1||A.anchorNode!==Pe.node||A.anchorOffset!==Pe.offset||A.focusNode!==Ct.node||A.focusOffset!==Ct.offset)&&(M=M.createRange(),M.setStart(Pe.node,Pe.offset),A.removeAllRanges(),Ue>me?(A.addRange(M),A.extend(Ct.node,Ct.offset)):(M.setEnd(Ct.node,Ct.offset),A.addRange(M)))}}for(M=[],A=Q;A=A.parentNode;)A.nodeType===1&&M.push({element:A,left:A.scrollLeft,top:A.scrollTop});for(typeof Q.focus=="function"&&Q.focus(),Q=0;Q<M.length;Q++)A=M[Q],A.element.scrollLeft=A.left,A.element.scrollTop=A.top}}var Ya=l&&"documentMode"in document&&11>=document.documentMode,Xa=null,ua=null,Sa=null,Uo=!1;function hd(A,M,Q){var me=Q.window===Q?Q.document:Q.nodeType===9?Q:Q.ownerDocument;Uo||Xa==null||Xa!==it(me)||(me=Xa,"selectionStart"in me&&Ws(me)?me={start:me.selectionStart,end:me.selectionEnd}:(me=(me.ownerDocument&&me.ownerDocument.defaultView||window).getSelection(),me={anchorNode:me.anchorNode,anchorOffset:me.anchorOffset,focusNode:me.focusNode,focusOffset:me.focusOffset}),Sa&&Tn(Sa,me)||(Sa=me,me=F5(ua,"onSelect"),0<me.length&&(M=new yt("onSelect","select",null,M,Q),A.push({event:M,listeners:me}),M.target=Xa)))}function _i(A,M){var Q={};return Q[A.toLowerCase()]=M.toLowerCase(),Q["Webkit"+A]="webkit"+M,Q["Moz"+A]="moz"+M,Q}var Cm={animationend:_i("Animation","AnimationEnd"),animationiteration:_i("Animation","AnimationIteration"),animationstart:_i("Animation","AnimationStart"),transitionend:_i("Transition","TransitionEnd")},_1={},w2={};l&&(w2=document.createElement("div").style,"AnimationEvent"in window||(delete Cm.animationend.animation,delete Cm.animationiteration.animation,delete Cm.animationstart.animation),"TransitionEvent"in window||delete Cm.transitionend.transition);function _5(A){if(_1[A])return _1[A];if(!Cm[A])return A;var M=Cm[A],Q;for(Q in M)if(M.hasOwnProperty(Q)&&Q in w2)return _1[A]=M[Q];return A}var NT=_5("animationend"),AT=_5("animationiteration"),C2=_5("animationstart"),lp=_5("transitionend"),S2=new Map,u8="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function af(A,M){S2.set(A,M),a(M,[A])}for(var k5=0;k5<u8.length;k5++){var T5=u8[k5],I5=T5.toLowerCase(),jT=T5[0].toUpperCase()+T5.slice(1);af(I5,"on"+jT)}af(NT,"onAnimationEnd"),af(AT,"onAnimationIteration"),af(C2,"onAnimationStart"),af("dblclick","onDoubleClick"),af("focusin","onFocus"),af("focusout","onBlur"),af(lp,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var cp="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ux=new Set("cancel close invalid load scroll toggle".split(" ").concat(cp));function N2(A,M,Q){var me=A.type||"unknown-event";A.currentTarget=Q,Bt(me,M,void 0,A),A.currentTarget=null}function ET(A,M){M=(M&4)!==0;for(var Q=0;Q<A.length;Q++){var me=A[Q],Pe=me.event;me=me.listeners;e:{var Ue=void 0;if(M)for(var Ct=me.length-1;0<=Ct;Ct--){var mn=me[Ct],In=mn.instance,rr=mn.currentTarget;if(mn=mn.listener,In!==Ue&&Pe.isPropagationStopped())break e;N2(Pe,mn,rr),Ue=In}else for(Ct=0;Ct<me.length;Ct++){if(mn=me[Ct],In=mn.instance,rr=mn.currentTarget,mn=mn.listener,In!==Ue&&Pe.isPropagationStopped())break e;N2(Pe,mn,rr),Ue=In}}}if(fn)throw A=Et,fn=!1,Et=null,A}function za(A,M){var Q=M[R5];Q===void 0&&(Q=M[R5]=new Set);var me=A+"__bubble";Q.has(me)||(P5(M,A,2,!1),Q.add(me))}function d8(A,M,Q){var me=0;M&&(me|=4),P5(Q,A,me,M)}var dx="_reactListening"+Math.random().toString(36).slice(2);function Sm(A){if(!A[dx]){A[dx]=!0,r.forEach(function(Q){Q!=="selectionchange"&&(ux.has(Q)||d8(Q,!1,A),d8(Q,!0,A))});var M=A.nodeType===9?A:A.ownerDocument;M===null||M[dx]||(M[dx]=!0,d8("selectionchange",!1,M))}}function P5(A,M,Q,me){switch(rs(M)){case 1:var Pe=dr;break;case 4:Pe=Fs;break;default:Pe=us}Q=Pe.bind(null,M,Q,A),Pe=void 0,!Jn||M!=="touchstart"&&M!=="touchmove"&&M!=="wheel"||(Pe=!0),me?Pe!==void 0?A.addEventListener(M,Q,{capture:!0,passive:Pe}):A.addEventListener(M,Q,!0):Pe!==void 0?A.addEventListener(M,Q,{passive:Pe}):A.addEventListener(M,Q,!1)}function f8(A,M,Q,me,Pe){var Ue=me;if(!(M&1)&&!(M&2)&&me!==null)e:for(;;){if(me===null)return;var Ct=me.tag;if(Ct===3||Ct===4){var mn=me.stateNode.containerInfo;if(mn===Pe||mn.nodeType===8&&mn.parentNode===Pe)break;if(Ct===4)for(Ct=me.return;Ct!==null;){var In=Ct.tag;if((In===3||In===4)&&(In=Ct.stateNode.containerInfo,In===Pe||In.nodeType===8&&In.parentNode===Pe))return;Ct=Ct.return}for(;mn!==null;){if(Ct=Kf(mn),Ct===null)return;if(In=Ct.tag,In===5||In===6){me=Ue=Ct;continue e}mn=mn.parentNode}}me=me.return}Hn(function(){var rr=Ue,Dr=xt(Q),$r=[];e:{var Rr=S2.get(A);if(Rr!==void 0){var os=yt,ms=A;switch(A){case"keypress":if(jr(Q)===0)break e;case"keydown":case"keyup":os=Ms;break;case"focusin":ms="focus",os=Ir;break;case"focusout":ms="blur",os=Ir;break;case"beforeblur":case"afterblur":os=Ir;break;case"click":if(Q.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":os=es;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":os=Lr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":os=mr;break;case NT:case AT:case C2:os=hi;break;case lp:os=as;break;case"scroll":os=An;break;case"wheel":os=ys;break;case"copy":case"cut":case"paste":os=Pr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":os=Tt}var As=(M&4)!==0,wo=!As&&A==="scroll",Xn=As?Rr!==null?Rr+"Capture":null:Rr;As=[];for(var Bn=rr,Zn;Bn!==null;){Zn=Bn;var Wr=Zn.stateNode;if(Zn.tag===5&&Wr!==null&&(Zn=Wr,Xn!==null&&(Wr=$n(Bn,Xn),Wr!=null&&As.push(k1(Bn,Wr,Zn)))),wo)break;Bn=Bn.return}0<As.length&&(Rr=new os(Rr,ms,null,Q,Dr),$r.push({event:Rr,listeners:As}))}}if(!(M&7)){e:{if(Rr=A==="mouseover"||A==="pointerover",os=A==="mouseout"||A==="pointerout",Rr&&Q!==lt&&(ms=Q.relatedTarget||Q.fromElement)&&(Kf(ms)||ms[Mu]))break e;if((os||Rr)&&(Rr=Dr.window===Dr?Dr:(Rr=Dr.ownerDocument)?Rr.defaultView||Rr.parentWindow:window,os?(ms=Q.relatedTarget||Q.toElement,os=rr,ms=ms?Kf(ms):null,ms!==null&&(wo=an(ms),ms!==wo||ms.tag!==5&&ms.tag!==6)&&(ms=null)):(os=null,ms=rr),os!==ms)){if(As=es,Wr="onMouseLeave",Xn="onMouseEnter",Bn="mouse",(A==="pointerout"||A==="pointerover")&&(As=Tt,Wr="onPointerLeave",Xn="onPointerEnter",Bn="pointer"),wo=os==null?Rr:bi(os),Zn=ms==null?Rr:bi(ms),Rr=new As(Wr,Bn+"leave",os,Q,Dr),Rr.target=wo,Rr.relatedTarget=Zn,Wr=null,Kf(Dr)===rr&&(As=new As(Xn,Bn+"enter",ms,Q,Dr),As.target=Zn,As.relatedTarget=wo,Wr=As),wo=Wr,os&&ms)t:{for(As=os,Xn=ms,Bn=0,Zn=As;Zn;Zn=T1(Zn))Bn++;for(Zn=0,Wr=Xn;Wr;Wr=T1(Wr))Zn++;for(;0<Bn-Zn;)As=T1(As),Bn--;for(;0<Zn-Bn;)Xn=T1(Xn),Zn--;for(;Bn--;){if(As===Xn||Xn!==null&&As===Xn.alternate)break t;As=T1(As),Xn=T1(Xn)}As=null}else As=null;os!==null&&zo($r,Rr,os,As,!1),ms!==null&&wo!==null&&zo($r,wo,ms,As,!0)}}e:{if(Rr=rr?bi(rr):window,os=Rr.nodeName&&Rr.nodeName.toLowerCase(),os==="select"||os==="input"&&Rr.type==="file")var js=$;else if(Ii(Rr))if(H)js=bt;else{js=_t;var Ls=ht}else(os=Rr.nodeName)&&os.toLowerCase()==="input"&&(Rr.type==="checkbox"||Rr.type==="radio")&&(js=rn);if(js&&(js=js(A,rr))){wm($r,js,Q,Dr);break e}Ls&&Ls(A,Rr,rr),A==="focusout"&&(Ls=Rr._wrapperState)&&Ls.controlled&&Rr.type==="number"&&kt(Rr,"number",Rr.value)}switch(Ls=rr?bi(rr):window,A){case"focusin":(Ii(Ls)||Ls.contentEditable==="true")&&(Xa=Ls,ua=rr,Sa=null);break;case"focusout":Sa=ua=Xa=null;break;case"mousedown":Uo=!0;break;case"contextmenu":case"mouseup":case"dragend":Uo=!1,hd($r,Q,Dr);break;case"selectionchange":if(Ya)break;case"keydown":case"keyup":hd($r,Q,Dr)}var Ds;if(ca)e:{switch(A){case"compositionstart":var Vs="onCompositionStart";break e;case"compositionend":Vs="onCompositionEnd";break e;case"compositionupdate":Vs="onCompositionUpdate";break e}Vs=void 0}else Bl?E5(A,Q)&&(Vs="onCompositionEnd"):A==="keydown"&&Q.keyCode===229&&(Vs="onCompositionStart");Vs&&(sc&&Q.locale!=="ko"&&(Bl||Vs!=="onCompositionStart"?Vs==="onCompositionEnd"&&Bl&&(Ds=la()):(Zr=Dr,gi="value"in Zr?Zr.value:Zr.textContent,Bl=!0)),Ls=F5(rr,Vs),0<Ls.length&&(Vs=new Rn(Vs,A,null,Q,Dr),$r.push({event:Vs,listeners:Ls}),Ds?Vs.data=Ds:(Ds=y2(Q),Ds!==null&&(Vs.data=Ds)))),(Ds=vs?vm(A,Q):v2(A,Q))&&(rr=F5(rr,"onBeforeInput"),0<rr.length&&(Dr=new Rn("onBeforeInput","beforeinput",null,Q,Dr),$r.push({event:Dr,listeners:rr}),Dr.data=Ds))}ET($r,M)})}function k1(A,M,Q){return{instance:A,listener:M,currentTarget:Q}}function F5(A,M){for(var Q=M+"Capture",me=[];A!==null;){var Pe=A,Ue=Pe.stateNode;Pe.tag===5&&Ue!==null&&(Pe=Ue,Ue=$n(A,Q),Ue!=null&&me.unshift(k1(A,Ue,Pe)),Ue=$n(A,M),Ue!=null&&me.push(k1(A,Ue,Pe))),A=A.return}return me}function T1(A){if(A===null)return null;do A=A.return;while(A&&A.tag!==5);return A||null}function zo(A,M,Q,me,Pe){for(var Ue=M._reactName,Ct=[];Q!==null&&Q!==me;){var mn=Q,In=mn.alternate,rr=mn.stateNode;if(In!==null&&In===me)break;mn.tag===5&&rr!==null&&(mn=rr,Pe?(In=$n(Q,Ue),In!=null&&Ct.unshift(k1(Q,In,mn))):Pe||(In=$n(Q,Ue),In!=null&&Ct.push(k1(Q,In,mn)))),Q=Q.return}Ct.length!==0&&A.push({event:M,listeners:Ct})}var ac=/\r\n?/g,kU=/\u0000|\uFFFD/g;function _T(A){return(typeof A=="string"?A:""+A).replace(ac,`
`).replace(kU,"")}function A2(A,M,Q){if(M=_T(M),_T(A)!==M&&Q)throw Error(n(425))}function O5(){}var j2=null,fx=null;function E2(A,M){return A==="textarea"||A==="noscript"||typeof M.children=="string"||typeof M.children=="number"||typeof M.dangerouslySetInnerHTML=="object"&&M.dangerouslySetInnerHTML!==null&&M.dangerouslySetInnerHTML.__html!=null}var Nm=typeof setTimeout=="function"?setTimeout:void 0,_2=typeof clearTimeout=="function"?clearTimeout:void 0,I1=typeof Promise=="function"?Promise:void 0,M5=typeof queueMicrotask=="function"?queueMicrotask:typeof I1<"u"?function(A){return I1.resolve(null).then(A).catch(P1)}:Nm;function P1(A){setTimeout(function(){throw A})}function h8(A,M){var Q=M,me=0;do{var Pe=Q.nextSibling;if(A.removeChild(Q),Pe&&Pe.nodeType===8)if(Q=Pe.data,Q==="/$"){if(me===0){A.removeChild(Pe),lr(M);return}me--}else Q!=="$"&&Q!=="$?"&&Q!=="$!"||me++;Q=Pe}while(Q);lr(M)}function Am(A){for(;A!=null;A=A.nextSibling){var M=A.nodeType;if(M===1||M===3)break;if(M===8){if(M=A.data,M==="$"||M==="$!"||M==="$?")break;if(M==="/$")return null}}return A}function kT(A){A=A.previousSibling;for(var M=0;A;){if(A.nodeType===8){var Q=A.data;if(Q==="$"||Q==="$!"||Q==="$?"){if(M===0)return A;M--}else Q==="/$"&&M++}A=A.previousSibling}return null}var F1=Math.random().toString(36).slice(2),Gf="__reactFiber$"+F1,jm="__reactProps$"+F1,Mu="__reactContainer$"+F1,R5="__reactEvents$"+F1,Mt="__reactListeners$"+F1,O1="__reactHandles$"+F1;function Kf(A){var M=A[Gf];if(M)return M;for(var Q=A.parentNode;Q;){if(M=Q[Mu]||Q[Gf]){if(Q=M.alternate,M.child!==null||Q!==null&&Q.child!==null)for(A=kT(A);A!==null;){if(Q=A[Gf])return Q;A=kT(A)}return M}A=Q,Q=A.parentNode}return null}function oc(A){return A=A[Gf]||A[Mu],!A||A.tag!==5&&A.tag!==6&&A.tag!==13&&A.tag!==3?null:A}function bi(A){if(A.tag===5||A.tag===6)return A.stateNode;throw Error(n(33))}function L5(A){return A[jm]||null}var p8=[],M1=-1;function su(A){return{current:A}}function Ha(A){0>M1||(A.current=p8[M1],p8[M1]=null,M1--)}function Ra(A,M){M1++,p8[M1]=A.current,A.current=M}var Em={},lc=su(Em),iu=su(!1),Oc=Em;function R1(A,M){var Q=A.type.contextTypes;if(!Q)return Em;var me=A.stateNode;if(me&&me.__reactInternalMemoizedUnmaskedChildContext===M)return me.__reactInternalMemoizedMaskedChildContext;var Pe={},Ue;for(Ue in Q)Pe[Ue]=M[Ue];return me&&(A=A.stateNode,A.__reactInternalMemoizedUnmaskedChildContext=M,A.__reactInternalMemoizedMaskedChildContext=Pe),Pe}function au(A){return A=A.childContextTypes,A!=null}function D5(){Ha(iu),Ha(lc)}function TT(A,M,Q){if(lc.current!==Em)throw Error(n(168));Ra(lc,M),Ra(iu,Q)}function IT(A,M,Q){var me=A.stateNode;if(M=M.childContextTypes,typeof me.getChildContext!="function")return Q;me=me.getChildContext();for(var Pe in me)if(!(Pe in M))throw Error(n(108,be(A)||"Unknown",Pe));return ee({},Q,me)}function pd(A){return A=(A=A.stateNode)&&A.__reactInternalMemoizedMergedChildContext||Em,Oc=lc.current,Ra(lc,A),Ra(iu,iu.current),!0}function PT(A,M,Q){var me=A.stateNode;if(!me)throw Error(n(169));Q?(A=IT(A,M,Oc),me.__reactInternalMemoizedMergedChildContext=A,Ha(iu),Ha(lc),Ra(lc,A)):Ha(iu),Ra(iu,Q)}var up=null,B5=!1,m8=!1;function FT(A){up===null?up=[A]:up.push(A)}function hx(A){B5=!0,FT(A)}function _m(){if(!m8&&up!==null){m8=!0;var A=0,M=gt;try{var Q=up;for(gt=1;A<Q.length;A++){var me=Q[A];do me=me(!0);while(me!==null)}up=null,B5=!1}catch(Pe){throw up!==null&&(up=up.slice(A+1)),zn(h,_m),Pe}finally{gt=M,m8=!1}}return null}var L1=[],cc=0,$5=null,U5=0,md=[],xd=0,px=null,Yf=1,Xf="";function mx(A,M){L1[cc++]=U5,L1[cc++]=$5,$5=A,U5=M}function OT(A,M,Q){md[xd++]=Yf,md[xd++]=Xf,md[xd++]=px,px=A;var me=Yf;A=Xf;var Pe=32-ue(me)-1;me&=~(1<<Pe),Q+=1;var Ue=32-ue(M)+Pe;if(30<Ue){var Ct=Pe-Pe%5;Ue=(me&(1<<Ct)-1).toString(32),me>>=Ct,Pe-=Ct,Yf=1<<32-ue(M)+Pe|Q<<Pe|me,Xf=Ue+A}else Yf=1<<Ue|Q<<Pe|me,Xf=A}function k2(A){A.return!==null&&(mx(A,1),OT(A,1,0))}function xx(A){for(;A===$5;)$5=L1[--cc],L1[cc]=null,U5=L1[--cc],L1[cc]=null;for(;A===px;)px=md[--xd],md[xd]=null,Xf=md[--xd],md[xd]=null,Yf=md[--xd],md[xd]=null}var uc=null,Ru=null,Va=!1,of=null;function Qf(A,M){var Q=Sd(5,null,null,0);Q.elementType="DELETED",Q.stateNode=M,Q.return=A,M=A.deletions,M===null?(A.deletions=[Q],A.flags|=16):M.push(Q)}function z5(A,M){switch(A.tag){case 5:var Q=A.type;return M=M.nodeType!==1||Q.toLowerCase()!==M.nodeName.toLowerCase()?null:M,M!==null?(A.stateNode=M,uc=A,Ru=Am(M.firstChild),!0):!1;case 6:return M=A.pendingProps===""||M.nodeType!==3?null:M,M!==null?(A.stateNode=M,uc=A,Ru=null,!0):!1;case 13:return M=M.nodeType!==8?null:M,M!==null?(Q=px!==null?{id:Yf,overflow:Xf}:null,A.memoizedState={dehydrated:M,treeContext:Q,retryLane:1073741824},Q=Sd(18,null,null,0),Q.stateNode=M,Q.return=A,A.child=Q,uc=A,Ru=null,!0):!1;default:return!1}}function dp(A){return(A.mode&1)!==0&&(A.flags&128)===0}function ou(A){if(Va){var M=Ru;if(M){var Q=M;if(!z5(A,M)){if(dp(A))throw Error(n(418));M=Am(Q.nextSibling);var me=uc;M&&z5(A,M)?Qf(me,Q):(A.flags=A.flags&-4097|2,Va=!1,uc=A)}}else{if(dp(A))throw Error(n(418));A.flags=A.flags&-4097|2,Va=!1,uc=A}}}function MT(A){for(A=A.return;A!==null&&A.tag!==5&&A.tag!==3&&A.tag!==13;)A=A.return;uc=A}function T2(A){if(A!==uc)return!1;if(!Va)return MT(A),Va=!0,!1;var M;if((M=A.tag!==3)&&!(M=A.tag!==5)&&(M=A.type,M=M!=="head"&&M!=="body"&&!E2(A.type,A.memoizedProps)),M&&(M=Ru)){if(dp(A))throw x8(),Error(n(418));for(;M;)Qf(A,M),M=Am(M.nextSibling)}if(MT(A),A.tag===13){if(A=A.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(n(317));e:{for(A=A.nextSibling,M=0;A;){if(A.nodeType===8){var Q=A.data;if(Q==="/$"){if(M===0){Ru=Am(A.nextSibling);break e}M--}else Q!=="$"&&Q!=="$!"&&Q!=="$?"||M++}A=A.nextSibling}Ru=null}}else Ru=uc?Am(A.stateNode.nextSibling):null;return!0}function x8(){for(var A=Ru;A;)A=Am(A.nextSibling)}function Zf(){Ru=uc=null,Va=!1}function Jf(A){of===null?of=[A]:of.push(A)}var RT=R.ReactCurrentBatchConfig;function I2(A,M,Q){if(A=Q.ref,A!==null&&typeof A!="function"&&typeof A!="object"){if(Q._owner){if(Q=Q._owner,Q){if(Q.tag!==1)throw Error(n(309));var me=Q.stateNode}if(!me)throw Error(n(147,A));var Pe=me,Ue=""+A;return M!==null&&M.ref!==null&&typeof M.ref=="function"&&M.ref._stringRef===Ue?M.ref:(M=function(Ct){var mn=Pe.refs;Ct===null?delete mn[Ue]:mn[Ue]=Ct},M._stringRef=Ue,M)}if(typeof A!="string")throw Error(n(284));if(!Q._owner)throw Error(n(290,A))}return A}function gx(A,M){throw A=Object.prototype.toString.call(M),Error(n(31,A==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":A))}function LT(A){var M=A._init;return M(A._payload)}function g8(A){function M(Xn,Bn){if(A){var Zn=Xn.deletions;Zn===null?(Xn.deletions=[Bn],Xn.flags|=16):Zn.push(Bn)}}function Q(Xn,Bn){if(!A)return null;for(;Bn!==null;)M(Xn,Bn),Bn=Bn.sibling;return null}function me(Xn,Bn){for(Xn=new Map;Bn!==null;)Bn.key!==null?Xn.set(Bn.key,Bn):Xn.set(Bn.index,Bn),Bn=Bn.sibling;return Xn}function Pe(Xn,Bn){return Xn=pf(Xn,Bn),Xn.index=0,Xn.sibling=null,Xn}function Ue(Xn,Bn,Zn){return Xn.index=Zn,A?(Zn=Xn.alternate,Zn!==null?(Zn=Zn.index,Zn<Bn?(Xn.flags|=2,Bn):Zn):(Xn.flags|=2,Bn)):(Xn.flags|=1048576,Bn)}function Ct(Xn){return A&&Xn.alternate===null&&(Xn.flags|=2),Xn}function mn(Xn,Bn,Zn,Wr){return Bn===null||Bn.tag!==6?(Bn=r7(Zn,Xn.mode,Wr),Bn.return=Xn,Bn):(Bn=Pe(Bn,Zn),Bn.return=Xn,Bn)}function In(Xn,Bn,Zn,Wr){var js=Zn.type;return js===L?Dr(Xn,Bn,Zn.props.children,Wr,Zn.key):Bn!==null&&(Bn.elementType===js||typeof js=="object"&&js!==null&&js.$$typeof===ie&&LT(js)===Bn.type)?(Wr=Pe(Bn,Zn.props),Wr.ref=I2(Xn,Bn,Zn),Wr.return=Xn,Wr):(Wr=S6(Zn.type,Zn.key,Zn.props,null,Xn.mode,Wr),Wr.ref=I2(Xn,Bn,Zn),Wr.return=Xn,Wr)}function rr(Xn,Bn,Zn,Wr){return Bn===null||Bn.tag!==4||Bn.stateNode.containerInfo!==Zn.containerInfo||Bn.stateNode.implementation!==Zn.implementation?(Bn=s7(Zn,Xn.mode,Wr),Bn.return=Xn,Bn):(Bn=Pe(Bn,Zn.children||[]),Bn.return=Xn,Bn)}function Dr(Xn,Bn,Zn,Wr,js){return Bn===null||Bn.tag!==7?(Bn=_x(Zn,Xn.mode,Wr,js),Bn.return=Xn,Bn):(Bn=Pe(Bn,Zn),Bn.return=Xn,Bn)}function $r(Xn,Bn,Zn){if(typeof Bn=="string"&&Bn!==""||typeof Bn=="number")return Bn=r7(""+Bn,Xn.mode,Zn),Bn.return=Xn,Bn;if(typeof Bn=="object"&&Bn!==null){switch(Bn.$$typeof){case F:return Zn=S6(Bn.type,Bn.key,Bn.props,null,Xn.mode,Zn),Zn.ref=I2(Xn,null,Bn),Zn.return=Xn,Zn;case U:return Bn=s7(Bn,Xn.mode,Zn),Bn.return=Xn,Bn;case ie:var Wr=Bn._init;return $r(Xn,Wr(Bn._payload),Zn)}if(tn(Bn)||V(Bn))return Bn=_x(Bn,Xn.mode,Zn,null),Bn.return=Xn,Bn;gx(Xn,Bn)}return null}function Rr(Xn,Bn,Zn,Wr){var js=Bn!==null?Bn.key:null;if(typeof Zn=="string"&&Zn!==""||typeof Zn=="number")return js!==null?null:mn(Xn,Bn,""+Zn,Wr);if(typeof Zn=="object"&&Zn!==null){switch(Zn.$$typeof){case F:return Zn.key===js?In(Xn,Bn,Zn,Wr):null;case U:return Zn.key===js?rr(Xn,Bn,Zn,Wr):null;case ie:return js=Zn._init,Rr(Xn,Bn,js(Zn._payload),Wr)}if(tn(Zn)||V(Zn))return js!==null?null:Dr(Xn,Bn,Zn,Wr,null);gx(Xn,Zn)}return null}function os(Xn,Bn,Zn,Wr,js){if(typeof Wr=="string"&&Wr!==""||typeof Wr=="number")return Xn=Xn.get(Zn)||null,mn(Bn,Xn,""+Wr,js);if(typeof Wr=="object"&&Wr!==null){switch(Wr.$$typeof){case F:return Xn=Xn.get(Wr.key===null?Zn:Wr.key)||null,In(Bn,Xn,Wr,js);case U:return Xn=Xn.get(Wr.key===null?Zn:Wr.key)||null,rr(Bn,Xn,Wr,js);case ie:var Ls=Wr._init;return os(Xn,Bn,Zn,Ls(Wr._payload),js)}if(tn(Wr)||V(Wr))return Xn=Xn.get(Zn)||null,Dr(Bn,Xn,Wr,js,null);gx(Bn,Wr)}return null}function ms(Xn,Bn,Zn,Wr){for(var js=null,Ls=null,Ds=Bn,Vs=Bn=0,ol=null;Ds!==null&&Vs<Zn.length;Vs++){Ds.index>Vs?(ol=Ds,Ds=null):ol=Ds.sibling;var na=Rr(Xn,Ds,Zn[Vs],Wr);if(na===null){Ds===null&&(Ds=ol);break}A&&Ds&&na.alternate===null&&M(Xn,Ds),Bn=Ue(na,Bn,Vs),Ls===null?js=na:Ls.sibling=na,Ls=na,Ds=ol}if(Vs===Zn.length)return Q(Xn,Ds),Va&&mx(Xn,Vs),js;if(Ds===null){for(;Vs<Zn.length;Vs++)Ds=$r(Xn,Zn[Vs],Wr),Ds!==null&&(Bn=Ue(Ds,Bn,Vs),Ls===null?js=Ds:Ls.sibling=Ds,Ls=Ds);return Va&&mx(Xn,Vs),js}for(Ds=me(Xn,Ds);Vs<Zn.length;Vs++)ol=os(Ds,Xn,Vs,Zn[Vs],Wr),ol!==null&&(A&&ol.alternate!==null&&Ds.delete(ol.key===null?Vs:ol.key),Bn=Ue(ol,Bn,Vs),Ls===null?js=ol:Ls.sibling=ol,Ls=ol);return A&&Ds.forEach(function($m){return M(Xn,$m)}),Va&&mx(Xn,Vs),js}function As(Xn,Bn,Zn,Wr){var js=V(Zn);if(typeof js!="function")throw Error(n(150));if(Zn=js.call(Zn),Zn==null)throw Error(n(151));for(var Ls=js=null,Ds=Bn,Vs=Bn=0,ol=null,na=Zn.next();Ds!==null&&!na.done;Vs++,na=Zn.next()){Ds.index>Vs?(ol=Ds,Ds=null):ol=Ds.sibling;var $m=Rr(Xn,Ds,na.value,Wr);if($m===null){Ds===null&&(Ds=ol);break}A&&Ds&&$m.alternate===null&&M(Xn,Ds),Bn=Ue($m,Bn,Vs),Ls===null?js=$m:Ls.sibling=$m,Ls=$m,Ds=ol}if(na.done)return Q(Xn,Ds),Va&&mx(Xn,Vs),js;if(Ds===null){for(;!na.done;Vs++,na=Zn.next())na=$r(Xn,na.value,Wr),na!==null&&(Bn=Ue(na,Bn,Vs),Ls===null?js=na:Ls.sibling=na,Ls=na);return Va&&mx(Xn,Vs),js}for(Ds=me(Xn,Ds);!na.done;Vs++,na=Zn.next())na=os(Ds,Xn,Vs,na.value,Wr),na!==null&&(A&&na.alternate!==null&&Ds.delete(na.key===null?Vs:na.key),Bn=Ue(na,Bn,Vs),Ls===null?js=na:Ls.sibling=na,Ls=na);return A&&Ds.forEach(function(KU){return M(Xn,KU)}),Va&&mx(Xn,Vs),js}function wo(Xn,Bn,Zn,Wr){if(typeof Zn=="object"&&Zn!==null&&Zn.type===L&&Zn.key===null&&(Zn=Zn.props.children),typeof Zn=="object"&&Zn!==null){switch(Zn.$$typeof){case F:e:{for(var js=Zn.key,Ls=Bn;Ls!==null;){if(Ls.key===js){if(js=Zn.type,js===L){if(Ls.tag===7){Q(Xn,Ls.sibling),Bn=Pe(Ls,Zn.props.children),Bn.return=Xn,Xn=Bn;break e}}else if(Ls.elementType===js||typeof js=="object"&&js!==null&&js.$$typeof===ie&&LT(js)===Ls.type){Q(Xn,Ls.sibling),Bn=Pe(Ls,Zn.props),Bn.ref=I2(Xn,Ls,Zn),Bn.return=Xn,Xn=Bn;break e}Q(Xn,Ls);break}else M(Xn,Ls);Ls=Ls.sibling}Zn.type===L?(Bn=_x(Zn.props.children,Xn.mode,Wr,Zn.key),Bn.return=Xn,Xn=Bn):(Wr=S6(Zn.type,Zn.key,Zn.props,null,Xn.mode,Wr),Wr.ref=I2(Xn,Bn,Zn),Wr.return=Xn,Xn=Wr)}return Ct(Xn);case U:e:{for(Ls=Zn.key;Bn!==null;){if(Bn.key===Ls)if(Bn.tag===4&&Bn.stateNode.containerInfo===Zn.containerInfo&&Bn.stateNode.implementation===Zn.implementation){Q(Xn,Bn.sibling),Bn=Pe(Bn,Zn.children||[]),Bn.return=Xn,Xn=Bn;break e}else{Q(Xn,Bn);break}else M(Xn,Bn);Bn=Bn.sibling}Bn=s7(Zn,Xn.mode,Wr),Bn.return=Xn,Xn=Bn}return Ct(Xn);case ie:return Ls=Zn._init,wo(Xn,Bn,Ls(Zn._payload),Wr)}if(tn(Zn))return ms(Xn,Bn,Zn,Wr);if(V(Zn))return As(Xn,Bn,Zn,Wr);gx(Xn,Zn)}return typeof Zn=="string"&&Zn!==""||typeof Zn=="number"?(Zn=""+Zn,Bn!==null&&Bn.tag===6?(Q(Xn,Bn.sibling),Bn=Pe(Bn,Zn),Bn.return=Xn,Xn=Bn):(Q(Xn,Bn),Bn=r7(Zn,Xn.mode,Wr),Bn.return=Xn,Xn=Bn),Ct(Xn)):Q(Xn,Bn)}return wo}var vo=g8(!0),H5=g8(!1),P2=su(null),Lu=null,km=null,D1=null;function fp(){D1=km=Lu=null}function V5(A){var M=P2.current;Ha(P2),A._currentValue=M}function $l(A,M,Q){for(;A!==null;){var me=A.alternate;if((A.childLanes&M)!==M?(A.childLanes|=M,me!==null&&(me.childLanes|=M)):me!==null&&(me.childLanes&M)!==M&&(me.childLanes|=M),A===Q)break;A=A.return}}function Tm(A,M){Lu=A,D1=km=null,A=A.dependencies,A!==null&&A.firstContext!==null&&(A.lanes&M&&(Rc=!0),A.firstContext=null)}function gd(A){var M=A._currentValue;if(D1!==A)if(A={context:A,memoizedValue:M,next:null},km===null){if(Lu===null)throw Error(n(308));km=A,Lu.dependencies={lanes:0,firstContext:A}}else km=km.next=A;return M}var bx=null;function b8(A){bx===null?bx=[A]:bx.push(A)}function W5(A,M,Q,me){var Pe=M.interleaved;return Pe===null?(Q.next=Q,b8(M)):(Q.next=Pe.next,Pe.next=Q),M.interleaved=Q,hp(A,me)}function hp(A,M){A.lanes|=M;var Q=A.alternate;for(Q!==null&&(Q.lanes|=M),Q=A,A=A.return;A!==null;)A.childLanes|=M,Q=A.alternate,Q!==null&&(Q.childLanes|=M),Q=A,A=A.return;return Q.tag===3?Q.stateNode:null}var bd=!1;function q5(A){A.updateQueue={baseState:A.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function DT(A,M){A=A.updateQueue,M.updateQueue===A&&(M.updateQueue={baseState:A.baseState,firstBaseUpdate:A.firstBaseUpdate,lastBaseUpdate:A.lastBaseUpdate,shared:A.shared,effects:A.effects})}function pp(A,M){return{eventTime:A,lane:M,tag:0,payload:null,callback:null,next:null}}function yd(A,M,Q){var me=A.updateQueue;if(me===null)return null;if(me=me.shared,qi&2){var Pe=me.pending;return Pe===null?M.next=M:(M.next=Pe.next,Pe.next=M),me.pending=M,hp(A,Q)}return Pe=me.interleaved,Pe===null?(M.next=M,b8(me)):(M.next=Pe.next,Pe.next=M),me.interleaved=M,hp(A,Q)}function G5(A,M,Q){if(M=M.updateQueue,M!==null&&(M=M.shared,(Q&4194240)!==0)){var me=M.lanes;me&=A.pendingLanes,Q|=me,M.lanes=Q,ot(A,Q)}}function BT(A,M){var Q=A.updateQueue,me=A.alternate;if(me!==null&&(me=me.updateQueue,Q===me)){var Pe=null,Ue=null;if(Q=Q.firstBaseUpdate,Q!==null){do{var Ct={eventTime:Q.eventTime,lane:Q.lane,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null};Ue===null?Pe=Ue=Ct:Ue=Ue.next=Ct,Q=Q.next}while(Q!==null);Ue===null?Pe=Ue=M:Ue=Ue.next=M}else Pe=Ue=M;Q={baseState:me.baseState,firstBaseUpdate:Pe,lastBaseUpdate:Ue,shared:me.shared,effects:me.effects},A.updateQueue=Q;return}A=Q.lastBaseUpdate,A===null?Q.firstBaseUpdate=M:A.next=M,Q.lastBaseUpdate=M}function B1(A,M,Q,me){var Pe=A.updateQueue;bd=!1;var Ue=Pe.firstBaseUpdate,Ct=Pe.lastBaseUpdate,mn=Pe.shared.pending;if(mn!==null){Pe.shared.pending=null;var In=mn,rr=In.next;In.next=null,Ct===null?Ue=rr:Ct.next=rr,Ct=In;var Dr=A.alternate;Dr!==null&&(Dr=Dr.updateQueue,mn=Dr.lastBaseUpdate,mn!==Ct&&(mn===null?Dr.firstBaseUpdate=rr:mn.next=rr,Dr.lastBaseUpdate=In))}if(Ue!==null){var $r=Pe.baseState;Ct=0,Dr=rr=In=null,mn=Ue;do{var Rr=mn.lane,os=mn.eventTime;if((me&Rr)===Rr){Dr!==null&&(Dr=Dr.next={eventTime:os,lane:0,tag:mn.tag,payload:mn.payload,callback:mn.callback,next:null});e:{var ms=A,As=mn;switch(Rr=M,os=Q,As.tag){case 1:if(ms=As.payload,typeof ms=="function"){$r=ms.call(os,$r,Rr);break e}$r=ms;break e;case 3:ms.flags=ms.flags&-65537|128;case 0:if(ms=As.payload,Rr=typeof ms=="function"?ms.call(os,$r,Rr):ms,Rr==null)break e;$r=ee({},$r,Rr);break e;case 2:bd=!0}}mn.callback!==null&&mn.lane!==0&&(A.flags|=64,Rr=Pe.effects,Rr===null?Pe.effects=[mn]:Rr.push(mn))}else os={eventTime:os,lane:Rr,tag:mn.tag,payload:mn.payload,callback:mn.callback,next:null},Dr===null?(rr=Dr=os,In=$r):Dr=Dr.next=os,Ct|=Rr;if(mn=mn.next,mn===null){if(mn=Pe.shared.pending,mn===null)break;Rr=mn,mn=Rr.next,Rr.next=null,Pe.lastBaseUpdate=Rr,Pe.shared.pending=null}}while(!0);if(Dr===null&&(In=$r),Pe.baseState=In,Pe.firstBaseUpdate=rr,Pe.lastBaseUpdate=Dr,M=Pe.shared.interleaved,M!==null){Pe=M;do Ct|=Pe.lane,Pe=Pe.next;while(Pe!==M)}else Ue===null&&(Pe.shared.lanes=0);Mm|=Ct,A.lanes=Ct,A.memoizedState=$r}}function y8(A,M,Q){if(A=M.effects,M.effects=null,A!==null)for(M=0;M<A.length;M++){var me=A[M],Pe=me.callback;if(Pe!==null){if(me.callback=null,me=Q,typeof Pe!="function")throw Error(n(191,Pe));Pe.call(me)}}}var F2={},eh=su(F2),O2=su(F2),$1=su(F2);function mp(A){if(A===F2)throw Error(n(174));return A}function v8(A,M){switch(Ra($1,M),Ra(O2,A),Ra(eh,F2),A=M.nodeType,A){case 9:case 11:M=(M=M.documentElement)?M.namespaceURI:Yt(null,"");break;default:A=A===8?M.parentNode:M,M=A.namespaceURI||null,A=A.tagName,M=Yt(M,A)}Ha(eh),Ra(eh,M)}function Im(){Ha(eh),Ha(O2),Ha($1)}function w8(A){mp($1.current);var M=mp(eh.current),Q=Yt(M,A.type);M!==Q&&(Ra(O2,A),Ra(eh,Q))}function K5(A){O2.current===A&&(Ha(eh),Ha(O2))}var Qa=su(0);function yx(A){for(var M=A;M!==null;){if(M.tag===13){var Q=M.memoizedState;if(Q!==null&&(Q=Q.dehydrated,Q===null||Q.data==="$?"||Q.data==="$!"))return M}else if(M.tag===19&&M.memoizedProps.revealOrder!==void 0){if(M.flags&128)return M}else if(M.child!==null){M.child.return=M,M=M.child;continue}if(M===A)break;for(;M.sibling===null;){if(M.return===null||M.return===A)return null;M=M.return}M.sibling.return=M.return,M=M.sibling}return null}var C8=[];function Y5(){for(var A=0;A<C8.length;A++)C8[A]._workInProgressVersionPrimary=null;C8.length=0}var M2=R.ReactCurrentDispatcher,S8=R.ReactCurrentBatchConfig,Pm=0,lo=null,Po=null,il=null,U1=!1,R2=!1,vx=0,ki=0;function dc(){throw Error(n(321))}function N8(A,M){if(M===null)return!1;for(var Q=0;Q<M.length&&Q<A.length;Q++)if(!qt(A[Q],M[Q]))return!1;return!0}function wx(A,M,Q,me,Pe,Ue){if(Pm=Ue,lo=M,M.memoizedState=null,M.updateQueue=null,M.lanes=0,M2.current=A===null||A.memoizedState===null?IU:n6,A=Q(me,Pe),R2){Ue=0;do{if(R2=!1,vx=0,25<=Ue)throw Error(n(301));Ue+=1,il=Po=null,M.updateQueue=null,M2.current=W1,A=Q(me,Pe)}while(R2)}if(M2.current=t6,M=Po!==null&&Po.next!==null,Pm=0,il=Po=lo=null,U1=!1,M)throw Error(n(300));return A}function X5(){var A=vx!==0;return vx=0,A}function th(){var A={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return il===null?lo.memoizedState=il=A:il=il.next=A,il}function vd(){if(Po===null){var A=lo.alternate;A=A!==null?A.memoizedState:null}else A=Po.next;var M=il===null?lo.memoizedState:il.next;if(M!==null)il=M,Po=A;else{if(A===null)throw Error(n(310));Po=A,A={memoizedState:Po.memoizedState,baseState:Po.baseState,baseQueue:Po.baseQueue,queue:Po.queue,next:null},il===null?lo.memoizedState=il=A:il=il.next=A}return il}function fc(A,M){return typeof M=="function"?M(A):M}function A8(A){var M=vd(),Q=M.queue;if(Q===null)throw Error(n(311));Q.lastRenderedReducer=A;var me=Po,Pe=me.baseQueue,Ue=Q.pending;if(Ue!==null){if(Pe!==null){var Ct=Pe.next;Pe.next=Ue.next,Ue.next=Ct}me.baseQueue=Pe=Ue,Q.pending=null}if(Pe!==null){Ue=Pe.next,me=me.baseState;var mn=Ct=null,In=null,rr=Ue;do{var Dr=rr.lane;if((Pm&Dr)===Dr)In!==null&&(In=In.next={lane:0,action:rr.action,hasEagerState:rr.hasEagerState,eagerState:rr.eagerState,next:null}),me=rr.hasEagerState?rr.eagerState:A(me,rr.action);else{var $r={lane:Dr,action:rr.action,hasEagerState:rr.hasEagerState,eagerState:rr.eagerState,next:null};In===null?(mn=In=$r,Ct=me):In=In.next=$r,lo.lanes|=Dr,Mm|=Dr}rr=rr.next}while(rr!==null&&rr!==Ue);In===null?Ct=me:In.next=mn,qt(me,M.memoizedState)||(Rc=!0),M.memoizedState=me,M.baseState=Ct,M.baseQueue=In,Q.lastRenderedState=me}if(A=Q.interleaved,A!==null){Pe=A;do Ue=Pe.lane,lo.lanes|=Ue,Mm|=Ue,Pe=Pe.next;while(Pe!==A)}else Pe===null&&(Q.lanes=0);return[M.memoizedState,Q.dispatch]}function z1(A){var M=vd(),Q=M.queue;if(Q===null)throw Error(n(311));Q.lastRenderedReducer=A;var me=Q.dispatch,Pe=Q.pending,Ue=M.memoizedState;if(Pe!==null){Q.pending=null;var Ct=Pe=Pe.next;do Ue=A(Ue,Ct.action),Ct=Ct.next;while(Ct!==Pe);qt(Ue,M.memoizedState)||(Rc=!0),M.memoizedState=Ue,M.baseQueue===null&&(M.baseState=Ue),Q.lastRenderedState=Ue}return[Ue,me]}function Q5(){}function j8(A,M){var Q=lo,me=vd(),Pe=M(),Ue=!qt(me.memoizedState,Pe);if(Ue&&(me.memoizedState=Pe,Rc=!0),me=me.queue,nh(xp.bind(null,Q,me,A),[A]),me.getSnapshot!==M||Ue||il!==null&&il.memoizedState.tag&1){if(Q.flags|=2048,H1(9,lu.bind(null,Q,me,Pe,M),void 0,null),Nl===null)throw Error(n(349));Pm&30||E8(Q,M,Pe)}return Pe}function E8(A,M,Q){A.flags|=16384,A={getSnapshot:M,value:Q},M=lo.updateQueue,M===null?(M={lastEffect:null,stores:null},lo.updateQueue=M,M.stores=[A]):(Q=M.stores,Q===null?M.stores=[A]:Q.push(A))}function lu(A,M,Q,me){M.value=Q,M.getSnapshot=me,Z5(M)&&_8(A)}function xp(A,M,Q){return Q(function(){Z5(M)&&_8(A)})}function Z5(A){var M=A.getSnapshot;A=A.value;try{var Q=M();return!qt(A,Q)}catch{return!0}}function _8(A){var M=hp(A,1);M!==null&&hf(M,A,1,-1)}function L2(A){var M=th();return typeof A=="function"&&(A=A()),M.memoizedState=M.baseState=A,A={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:fc,lastRenderedState:A},M.queue=A,A=A.dispatch=WT.bind(null,lo,A),[M.memoizedState,A]}function H1(A,M,Q,me){return A={tag:A,create:M,destroy:Q,deps:me,next:null},M=lo.updateQueue,M===null?(M={lastEffect:null,stores:null},lo.updateQueue=M,M.lastEffect=A.next=A):(Q=M.lastEffect,Q===null?M.lastEffect=A.next=A:(me=Q.next,Q.next=A,A.next=me,M.lastEffect=A)),A}function J5(){return vd().memoizedState}function D2(A,M,Q,me){var Pe=th();lo.flags|=A,Pe.memoizedState=H1(1|M,Q,void 0,me===void 0?null:me)}function V1(A,M,Q,me){var Pe=vd();me=me===void 0?null:me;var Ue=void 0;if(Po!==null){var Ct=Po.memoizedState;if(Ue=Ct.destroy,me!==null&&N8(me,Ct.deps)){Pe.memoizedState=H1(M,Q,Ue,me);return}}lo.flags|=A,Pe.memoizedState=H1(1|M,Q,Ue,me)}function e6(A,M){return D2(8390656,8,A,M)}function nh(A,M){return V1(2048,8,A,M)}function $T(A,M){return V1(4,2,A,M)}function gp(A,M){return V1(4,4,A,M)}function k8(A,M){if(typeof M=="function")return A=A(),M(A),function(){M(null)};if(M!=null)return A=A(),M.current=A,function(){M.current=null}}function T8(A,M,Q){return Q=Q!=null?Q.concat([A]):null,V1(4,4,k8.bind(null,M,A),Q)}function B2(){}function UT(A,M){var Q=vd();M=M===void 0?null:M;var me=Q.memoizedState;return me!==null&&M!==null&&N8(M,me[1])?me[0]:(Q.memoizedState=[A,M],A)}function zT(A,M){var Q=vd();M=M===void 0?null:M;var me=Q.memoizedState;return me!==null&&M!==null&&N8(M,me[1])?me[0]:(A=A(),Q.memoizedState=[A,M],A)}function HT(A,M,Q){return Pm&21?(qt(Q,M)||(Q=De(),lo.lanes|=Q,Mm|=Q,A.baseState=!0),M):(A.baseState&&(A.baseState=!1,Rc=!0),A.memoizedState=Q)}function VT(A,M){var Q=gt;gt=Q!==0&&4>Q?Q:4,A(!0);var me=S8.transition;S8.transition={};try{A(!1),M()}finally{gt=Q,S8.transition=me}}function I8(){return vd().memoizedState}function TU(A,M,Q){var me=Dm(A);if(Q={lane:me,action:Q,hasEagerState:!1,eagerState:null,next:null},P8(A))Mc(M,Q);else if(Q=W5(A,M,Q,me),Q!==null){var Pe=Bc();hf(Q,A,me,Pe),lf(Q,M,me)}}function WT(A,M,Q){var me=Dm(A),Pe={lane:me,action:Q,hasEagerState:!1,eagerState:null,next:null};if(P8(A))Mc(M,Pe);else{var Ue=A.alternate;if(A.lanes===0&&(Ue===null||Ue.lanes===0)&&(Ue=M.lastRenderedReducer,Ue!==null))try{var Ct=M.lastRenderedState,mn=Ue(Ct,Q);if(Pe.hasEagerState=!0,Pe.eagerState=mn,qt(mn,Ct)){var In=M.interleaved;In===null?(Pe.next=Pe,b8(M)):(Pe.next=In.next,In.next=Pe),M.interleaved=Pe;return}}catch{}finally{}Q=W5(A,M,Pe,me),Q!==null&&(Pe=Bc(),hf(Q,A,me,Pe),lf(Q,M,me))}}function P8(A){var M=A.alternate;return A===lo||M!==null&&M===lo}function Mc(A,M){R2=U1=!0;var Q=A.pending;Q===null?M.next=M:(M.next=Q.next,Q.next=M),A.pending=M}function lf(A,M,Q){if(Q&4194240){var me=M.lanes;me&=A.pendingLanes,Q|=me,M.lanes=Q,ot(A,Q)}}var t6={readContext:gd,useCallback:dc,useContext:dc,useEffect:dc,useImperativeHandle:dc,useInsertionEffect:dc,useLayoutEffect:dc,useMemo:dc,useReducer:dc,useRef:dc,useState:dc,useDebugValue:dc,useDeferredValue:dc,useTransition:dc,useMutableSource:dc,useSyncExternalStore:dc,useId:dc,unstable_isNewReconciler:!1},IU={readContext:gd,useCallback:function(A,M){return th().memoizedState=[A,M===void 0?null:M],A},useContext:gd,useEffect:e6,useImperativeHandle:function(A,M,Q){return Q=Q!=null?Q.concat([A]):null,D2(4194308,4,k8.bind(null,M,A),Q)},useLayoutEffect:function(A,M){return D2(4194308,4,A,M)},useInsertionEffect:function(A,M){return D2(4,2,A,M)},useMemo:function(A,M){var Q=th();return M=M===void 0?null:M,A=A(),Q.memoizedState=[A,M],A},useReducer:function(A,M,Q){var me=th();return M=Q!==void 0?Q(M):M,me.memoizedState=me.baseState=M,A={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:A,lastRenderedState:M},me.queue=A,A=A.dispatch=TU.bind(null,lo,A),[me.memoizedState,A]},useRef:function(A){var M=th();return A={current:A},M.memoizedState=A},useState:L2,useDebugValue:B2,useDeferredValue:function(A){return th().memoizedState=A},useTransition:function(){var A=L2(!1),M=A[0];return A=VT.bind(null,A[1]),th().memoizedState=A,[M,A]},useMutableSource:function(){},useSyncExternalStore:function(A,M,Q){var me=lo,Pe=th();if(Va){if(Q===void 0)throw Error(n(407));Q=Q()}else{if(Q=M(),Nl===null)throw Error(n(349));Pm&30||E8(me,M,Q)}Pe.memoizedState=Q;var Ue={value:Q,getSnapshot:M};return Pe.queue=Ue,e6(xp.bind(null,me,Ue,A),[A]),me.flags|=2048,H1(9,lu.bind(null,me,Ue,Q,M),void 0,null),Q},useId:function(){var A=th(),M=Nl.identifierPrefix;if(Va){var Q=Xf,me=Yf;Q=(me&~(1<<32-ue(me)-1)).toString(32)+Q,M=":"+M+"R"+Q,Q=vx++,0<Q&&(M+="H"+Q.toString(32)),M+=":"}else Q=ki++,M=":"+M+"r"+Q.toString(32)+":";return A.memoizedState=M},unstable_isNewReconciler:!1},n6={readContext:gd,useCallback:UT,useContext:gd,useEffect:nh,useImperativeHandle:T8,useInsertionEffect:$T,useLayoutEffect:gp,useMemo:zT,useReducer:A8,useRef:J5,useState:function(){return A8(fc)},useDebugValue:B2,useDeferredValue:function(A){var M=vd();return HT(M,Po.memoizedState,A)},useTransition:function(){var A=A8(fc)[0],M=vd().memoizedState;return[A,M]},useMutableSource:Q5,useSyncExternalStore:j8,useId:I8,unstable_isNewReconciler:!1},W1={readContext:gd,useCallback:UT,useContext:gd,useEffect:nh,useImperativeHandle:T8,useInsertionEffect:$T,useLayoutEffect:gp,useMemo:zT,useReducer:z1,useRef:J5,useState:function(){return z1(fc)},useDebugValue:B2,useDeferredValue:function(A){var M=vd();return Po===null?M.memoizedState=A:HT(M,Po.memoizedState,A)},useTransition:function(){var A=z1(fc)[0],M=vd().memoizedState;return[A,M]},useMutableSource:Q5,useSyncExternalStore:j8,useId:I8,unstable_isNewReconciler:!1};function wd(A,M){if(A&&A.defaultProps){M=ee({},M),A=A.defaultProps;for(var Q in A)M[Q]===void 0&&(M[Q]=A[Q]);return M}return M}function r6(A,M,Q,me){M=A.memoizedState,Q=Q(me,M),Q=Q==null?M:ee({},M,Q),A.memoizedState=Q,A.lanes===0&&(A.updateQueue.baseState=Q)}var s6={isMounted:function(A){return(A=A._reactInternals)?an(A)===A:!1},enqueueSetState:function(A,M,Q){A=A._reactInternals;var me=Bc(),Pe=Dm(A),Ue=pp(me,Pe);Ue.payload=M,Q!=null&&(Ue.callback=Q),M=yd(A,Ue,Pe),M!==null&&(hf(M,A,Pe,me),G5(M,A,Pe))},enqueueReplaceState:function(A,M,Q){A=A._reactInternals;var me=Bc(),Pe=Dm(A),Ue=pp(me,Pe);Ue.tag=1,Ue.payload=M,Q!=null&&(Ue.callback=Q),M=yd(A,Ue,Pe),M!==null&&(hf(M,A,Pe,me),G5(M,A,Pe))},enqueueForceUpdate:function(A,M){A=A._reactInternals;var Q=Bc(),me=Dm(A),Pe=pp(Q,me);Pe.tag=2,M!=null&&(Pe.callback=M),M=yd(A,Pe,me),M!==null&&(hf(M,A,me,Q),G5(M,A,me))}};function F8(A,M,Q,me,Pe,Ue,Ct){return A=A.stateNode,typeof A.shouldComponentUpdate=="function"?A.shouldComponentUpdate(me,Ue,Ct):M.prototype&&M.prototype.isPureReactComponent?!Tn(Q,me)||!Tn(Pe,Ue):!0}function Cx(A,M,Q){var me=!1,Pe=Em,Ue=M.contextType;return typeof Ue=="object"&&Ue!==null?Ue=gd(Ue):(Pe=au(M)?Oc:lc.current,me=M.contextTypes,Ue=(me=me!=null)?R1(A,Pe):Em),M=new M(Q,Ue),A.memoizedState=M.state!==null&&M.state!==void 0?M.state:null,M.updater=s6,A.stateNode=M,M._reactInternals=A,me&&(A=A.stateNode,A.__reactInternalMemoizedUnmaskedChildContext=Pe,A.__reactInternalMemoizedMaskedChildContext=Ue),M}function q1(A,M,Q,me){A=M.state,typeof M.componentWillReceiveProps=="function"&&M.componentWillReceiveProps(Q,me),typeof M.UNSAFE_componentWillReceiveProps=="function"&&M.UNSAFE_componentWillReceiveProps(Q,me),M.state!==A&&s6.enqueueReplaceState(M,M.state,null)}function O8(A,M,Q,me){var Pe=A.stateNode;Pe.props=Q,Pe.state=A.memoizedState,Pe.refs={},q5(A);var Ue=M.contextType;typeof Ue=="object"&&Ue!==null?Pe.context=gd(Ue):(Ue=au(M)?Oc:lc.current,Pe.context=R1(A,Ue)),Pe.state=A.memoizedState,Ue=M.getDerivedStateFromProps,typeof Ue=="function"&&(r6(A,M,Ue,Q),Pe.state=A.memoizedState),typeof M.getDerivedStateFromProps=="function"||typeof Pe.getSnapshotBeforeUpdate=="function"||typeof Pe.UNSAFE_componentWillMount!="function"&&typeof Pe.componentWillMount!="function"||(M=Pe.state,typeof Pe.componentWillMount=="function"&&Pe.componentWillMount(),typeof Pe.UNSAFE_componentWillMount=="function"&&Pe.UNSAFE_componentWillMount(),M!==Pe.state&&s6.enqueueReplaceState(Pe,Pe.state,null),B1(A,Q,Pe,me),Pe.state=A.memoizedState),typeof Pe.componentDidMount=="function"&&(A.flags|=4194308)}function Sx(A,M){try{var Q="",me=M;do Q+=ye(me),me=me.return;while(me);var Pe=Q}catch(Ue){Pe=`
Error generating stack: `+Ue.message+`
`+Ue.stack}return{value:A,source:M,stack:Pe,digest:null}}function i6(A,M,Q){return{value:A,source:null,stack:Q??null,digest:M??null}}function G1(A,M){try{console.error(M.value)}catch(Q){setTimeout(function(){throw Q})}}var qT=typeof WeakMap=="function"?WeakMap:Map;function $2(A,M,Q){Q=pp(-1,Q),Q.tag=3,Q.payload={element:null};var me=M.value;return Q.callback=function(){x6||(x6=!0,X8=me),G1(A,M)},Q}function a6(A,M,Q){Q=pp(-1,Q),Q.tag=3;var me=A.type.getDerivedStateFromError;if(typeof me=="function"){var Pe=M.value;Q.payload=function(){return me(Pe)},Q.callback=function(){G1(A,M)}}var Ue=A.stateNode;return Ue!==null&&typeof Ue.componentDidCatch=="function"&&(Q.callback=function(){G1(A,M),typeof me!="function"&&(Rm===null?Rm=new Set([this]):Rm.add(this));var Ct=M.stack;this.componentDidCatch(M.value,{componentStack:Ct!==null?Ct:""})}),Q}function U2(A,M,Q){var me=A.pingCache;if(me===null){me=A.pingCache=new qT;var Pe=new Set;me.set(M,Pe)}else Pe=me.get(M),Pe===void 0&&(Pe=new Set,me.set(M,Pe));Pe.has(Q)||(Pe.add(Q),A=BU.bind(null,A,M,Q),M.then(A,A))}function GT(A){do{var M;if((M=A.tag===13)&&(M=A.memoizedState,M=M!==null?M.dehydrated!==null:!0),M)return A;A=A.return}while(A!==null);return null}function M8(A,M,Q,me,Pe){return A.mode&1?(A.flags|=65536,A.lanes=Pe,A):(A===M?A.flags|=65536:(A.flags|=128,Q.flags|=131072,Q.flags&=-52805,Q.tag===1&&(Q.alternate===null?Q.tag=17:(M=pp(-1,1),M.tag=2,yd(Q,M,1))),Q.lanes|=1),A)}var o6=R.ReactCurrentOwner,Rc=!1;function Ul(A,M,Q,me){M.child=A===null?H5(M,null,Q,me):vo(M,A.child,Q,me)}function KT(A,M,Q,me,Pe){Q=Q.render;var Ue=M.ref;return Tm(M,Pe),me=wx(A,M,Q,me,Ue,Pe),Q=X5(),A!==null&&!Rc?(M.updateQueue=A.updateQueue,M.flags&=-2053,A.lanes&=~Pe,cf(A,M,Pe)):(Va&&Q&&k2(M),M.flags|=1,Ul(A,M,me,Pe),M.child)}function R8(A,M,Q,me,Pe){if(A===null){var Ue=Q.type;return typeof Ue=="function"&&!C6(Ue)&&Ue.defaultProps===void 0&&Q.compare===null&&Q.defaultProps===void 0?(M.tag=15,M.type=Ue,rh(A,M,Ue,me,Pe)):(A=S6(Q.type,null,me,M,M.mode,Pe),A.ref=M.ref,A.return=M,M.child=A)}if(Ue=A.child,!(A.lanes&Pe)){var Ct=Ue.memoizedProps;if(Q=Q.compare,Q=Q!==null?Q:Tn,Q(Ct,me)&&A.ref===M.ref)return cf(A,M,Pe)}return M.flags|=1,A=pf(Ue,me),A.ref=M.ref,A.return=M,M.child=A}function rh(A,M,Q,me,Pe){if(A!==null){var Ue=A.memoizedProps;if(Tn(Ue,me)&&A.ref===M.ref)if(Rc=!1,M.pendingProps=me=Ue,(A.lanes&Pe)!==0)A.flags&131072&&(Rc=!0);else return M.lanes=A.lanes,cf(A,M,Pe)}return B8(A,M,Q,me,Pe)}function L8(A,M,Q){var me=M.pendingProps,Pe=me.children,Ue=A!==null?A.memoizedState:null;if(me.mode==="hidden")if(!(M.mode&1))M.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ra(Q1,Bu),Bu|=Q;else{if(!(Q&1073741824))return A=Ue!==null?Ue.baseLanes|Q:Q,M.lanes=M.childLanes=1073741824,M.memoizedState={baseLanes:A,cachePool:null,transitions:null},M.updateQueue=null,Ra(Q1,Bu),Bu|=A,null;M.memoizedState={baseLanes:0,cachePool:null,transitions:null},me=Ue!==null?Ue.baseLanes:Q,Ra(Q1,Bu),Bu|=me}else Ue!==null?(me=Ue.baseLanes|Q,M.memoizedState=null):me=Q,Ra(Q1,Bu),Bu|=me;return Ul(A,M,Pe,Q),M.child}function D8(A,M){var Q=M.ref;(A===null&&Q!==null||A!==null&&A.ref!==Q)&&(M.flags|=512,M.flags|=2097152)}function B8(A,M,Q,me,Pe){var Ue=au(Q)?Oc:lc.current;return Ue=R1(M,Ue),Tm(M,Pe),Q=wx(A,M,Q,me,Ue,Pe),me=X5(),A!==null&&!Rc?(M.updateQueue=A.updateQueue,M.flags&=-2053,A.lanes&=~Pe,cf(A,M,Pe)):(Va&&me&&k2(M),M.flags|=1,Ul(A,M,Q,Pe),M.child)}function $8(A,M,Q,me,Pe){if(au(Q)){var Ue=!0;pd(M)}else Ue=!1;if(Tm(M,Pe),M.stateNode===null)c6(A,M),Cx(M,Q,me),O8(M,Q,me,Pe),me=!0;else if(A===null){var Ct=M.stateNode,mn=M.memoizedProps;Ct.props=mn;var In=Ct.context,rr=Q.contextType;typeof rr=="object"&&rr!==null?rr=gd(rr):(rr=au(Q)?Oc:lc.current,rr=R1(M,rr));var Dr=Q.getDerivedStateFromProps,$r=typeof Dr=="function"||typeof Ct.getSnapshotBeforeUpdate=="function";$r||typeof Ct.UNSAFE_componentWillReceiveProps!="function"&&typeof Ct.componentWillReceiveProps!="function"||(mn!==me||In!==rr)&&q1(M,Ct,me,rr),bd=!1;var Rr=M.memoizedState;Ct.state=Rr,B1(M,me,Ct,Pe),In=M.memoizedState,mn!==me||Rr!==In||iu.current||bd?(typeof Dr=="function"&&(r6(M,Q,Dr,me),In=M.memoizedState),(mn=bd||F8(M,Q,mn,me,Rr,In,rr))?($r||typeof Ct.UNSAFE_componentWillMount!="function"&&typeof Ct.componentWillMount!="function"||(typeof Ct.componentWillMount=="function"&&Ct.componentWillMount(),typeof Ct.UNSAFE_componentWillMount=="function"&&Ct.UNSAFE_componentWillMount()),typeof Ct.componentDidMount=="function"&&(M.flags|=4194308)):(typeof Ct.componentDidMount=="function"&&(M.flags|=4194308),M.memoizedProps=me,M.memoizedState=In),Ct.props=me,Ct.state=In,Ct.context=rr,me=mn):(typeof Ct.componentDidMount=="function"&&(M.flags|=4194308),me=!1)}else{Ct=M.stateNode,DT(A,M),mn=M.memoizedProps,rr=M.type===M.elementType?mn:wd(M.type,mn),Ct.props=rr,$r=M.pendingProps,Rr=Ct.context,In=Q.contextType,typeof In=="object"&&In!==null?In=gd(In):(In=au(Q)?Oc:lc.current,In=R1(M,In));var os=Q.getDerivedStateFromProps;(Dr=typeof os=="function"||typeof Ct.getSnapshotBeforeUpdate=="function")||typeof Ct.UNSAFE_componentWillReceiveProps!="function"&&typeof Ct.componentWillReceiveProps!="function"||(mn!==$r||Rr!==In)&&q1(M,Ct,me,In),bd=!1,Rr=M.memoizedState,Ct.state=Rr,B1(M,me,Ct,Pe);var ms=M.memoizedState;mn!==$r||Rr!==ms||iu.current||bd?(typeof os=="function"&&(r6(M,Q,os,me),ms=M.memoizedState),(rr=bd||F8(M,Q,rr,me,Rr,ms,In)||!1)?(Dr||typeof Ct.UNSAFE_componentWillUpdate!="function"&&typeof Ct.componentWillUpdate!="function"||(typeof Ct.componentWillUpdate=="function"&&Ct.componentWillUpdate(me,ms,In),typeof Ct.UNSAFE_componentWillUpdate=="function"&&Ct.UNSAFE_componentWillUpdate(me,ms,In)),typeof Ct.componentDidUpdate=="function"&&(M.flags|=4),typeof Ct.getSnapshotBeforeUpdate=="function"&&(M.flags|=1024)):(typeof Ct.componentDidUpdate!="function"||mn===A.memoizedProps&&Rr===A.memoizedState||(M.flags|=4),typeof Ct.getSnapshotBeforeUpdate!="function"||mn===A.memoizedProps&&Rr===A.memoizedState||(M.flags|=1024),M.memoizedProps=me,M.memoizedState=ms),Ct.props=me,Ct.state=ms,Ct.context=In,me=rr):(typeof Ct.componentDidUpdate!="function"||mn===A.memoizedProps&&Rr===A.memoizedState||(M.flags|=4),typeof Ct.getSnapshotBeforeUpdate!="function"||mn===A.memoizedProps&&Rr===A.memoizedState||(M.flags|=1024),me=!1)}return U8(A,M,Q,me,Ue,Pe)}function U8(A,M,Q,me,Pe,Ue){D8(A,M);var Ct=(M.flags&128)!==0;if(!me&&!Ct)return Pe&&PT(M,Q,!1),cf(A,M,Ue);me=M.stateNode,o6.current=M;var mn=Ct&&typeof Q.getDerivedStateFromError!="function"?null:me.render();return M.flags|=1,A!==null&&Ct?(M.child=vo(M,A.child,null,Ue),M.child=vo(M,null,mn,Ue)):Ul(A,M,mn,Ue),M.memoizedState=me.state,Pe&&PT(M,Q,!0),M.child}function YT(A){var M=A.stateNode;M.pendingContext?TT(A,M.pendingContext,M.pendingContext!==M.context):M.context&&TT(A,M.context,!1),v8(A,M.containerInfo)}function sh(A,M,Q,me,Pe){return Zf(),Jf(Pe),M.flags|=256,Ul(A,M,Q,me),M.child}var z2={dehydrated:null,treeContext:null,retryLane:0};function H2(A){return{baseLanes:A,cachePool:null,transitions:null}}function l6(A,M,Q){var me=M.pendingProps,Pe=Qa.current,Ue=!1,Ct=(M.flags&128)!==0,mn;if((mn=Ct)||(mn=A!==null&&A.memoizedState===null?!1:(Pe&2)!==0),mn?(Ue=!0,M.flags&=-129):(A===null||A.memoizedState!==null)&&(Pe|=1),Ra(Qa,Pe&1),A===null)return ou(M),A=M.memoizedState,A!==null&&(A=A.dehydrated,A!==null)?(M.mode&1?A.data==="$!"?M.lanes=8:M.lanes=1073741824:M.lanes=1,null):(Ct=me.children,A=me.fallback,Ue?(me=M.mode,Ue=M.child,Ct={mode:"hidden",children:Ct},!(me&1)&&Ue!==null?(Ue.childLanes=0,Ue.pendingProps=Ct):Ue=N6(Ct,me,0,null),A=_x(A,me,Q,null),Ue.return=M,A.return=M,Ue.sibling=A,M.child=Ue,M.child.memoizedState=H2(Q),M.memoizedState=z2,A):K1(M,Ct));if(Pe=A.memoizedState,Pe!==null&&(mn=Pe.dehydrated,mn!==null))return $s(A,M,Ct,me,mn,Pe,Q);if(Ue){Ue=me.fallback,Ct=M.mode,Pe=A.child,mn=Pe.sibling;var In={mode:"hidden",children:me.children};return!(Ct&1)&&M.child!==Pe?(me=M.child,me.childLanes=0,me.pendingProps=In,M.deletions=null):(me=pf(Pe,In),me.subtreeFlags=Pe.subtreeFlags&14680064),mn!==null?Ue=pf(mn,Ue):(Ue=_x(Ue,Ct,Q,null),Ue.flags|=2),Ue.return=M,me.return=M,me.sibling=Ue,M.child=me,me=Ue,Ue=M.child,Ct=A.child.memoizedState,Ct=Ct===null?H2(Q):{baseLanes:Ct.baseLanes|Q,cachePool:null,transitions:Ct.transitions},Ue.memoizedState=Ct,Ue.childLanes=A.childLanes&~Q,M.memoizedState=z2,me}return Ue=A.child,A=Ue.sibling,me=pf(Ue,{mode:"visible",children:me.children}),!(M.mode&1)&&(me.lanes=Q),me.return=M,me.sibling=null,A!==null&&(Q=M.deletions,Q===null?(M.deletions=[A],M.flags|=16):Q.push(A)),M.child=me,M.memoizedState=null,me}function K1(A,M){return M=N6({mode:"visible",children:M},A.mode,0,null),M.return=A,A.child=M}function bp(A,M,Q,me){return me!==null&&Jf(me),vo(M,A.child,null,Q),A=K1(M,M.pendingProps.children),A.flags|=2,M.memoizedState=null,A}function $s(A,M,Q,me,Pe,Ue,Ct){if(Q)return M.flags&256?(M.flags&=-257,me=i6(Error(n(422))),bp(A,M,Ct,me)):M.memoizedState!==null?(M.child=A.child,M.flags|=128,null):(Ue=me.fallback,Pe=M.mode,me=N6({mode:"visible",children:me.children},Pe,0,null),Ue=_x(Ue,Pe,Ct,null),Ue.flags|=2,me.return=M,Ue.return=M,me.sibling=Ue,M.child=me,M.mode&1&&vo(M,A.child,null,Ct),M.child.memoizedState=H2(Ct),M.memoizedState=z2,Ue);if(!(M.mode&1))return bp(A,M,Ct,null);if(Pe.data==="$!"){if(me=Pe.nextSibling&&Pe.nextSibling.dataset,me)var mn=me.dgst;return me=mn,Ue=Error(n(419)),me=i6(Ue,me,void 0),bp(A,M,Ct,me)}if(mn=(Ct&A.childLanes)!==0,Rc||mn){if(me=Nl,me!==null){switch(Ct&-Ct){case 4:Pe=2;break;case 16:Pe=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:Pe=32;break;case 536870912:Pe=268435456;break;default:Pe=0}Pe=Pe&(me.suspendedLanes|Ct)?0:Pe,Pe!==0&&Pe!==Ue.retryLane&&(Ue.retryLane=Pe,hp(A,Pe),hf(me,A,Pe,-1))}return n7(),me=i6(Error(n(421))),bp(A,M,Ct,me)}return Pe.data==="$?"?(M.flags|=128,M.child=A.child,M=$U.bind(null,A),Pe._reactRetry=M,null):(A=Ue.treeContext,Ru=Am(Pe.nextSibling),uc=M,Va=!0,of=null,A!==null&&(md[xd++]=Yf,md[xd++]=Xf,md[xd++]=px,Yf=A.id,Xf=A.overflow,px=M),M=K1(M,me.children),M.flags|=4096,M)}function V2(A,M,Q){A.lanes|=M;var me=A.alternate;me!==null&&(me.lanes|=M),$l(A.return,M,Q)}function W2(A,M,Q,me,Pe){var Ue=A.memoizedState;Ue===null?A.memoizedState={isBackwards:M,rendering:null,renderingStartTime:0,last:me,tail:Q,tailMode:Pe}:(Ue.isBackwards=M,Ue.rendering=null,Ue.renderingStartTime=0,Ue.last=me,Ue.tail=Q,Ue.tailMode=Pe)}function Fm(A,M,Q){var me=M.pendingProps,Pe=me.revealOrder,Ue=me.tail;if(Ul(A,M,me.children,Q),me=Qa.current,me&2)me=me&1|2,M.flags|=128;else{if(A!==null&&A.flags&128)e:for(A=M.child;A!==null;){if(A.tag===13)A.memoizedState!==null&&V2(A,Q,M);else if(A.tag===19)V2(A,Q,M);else if(A.child!==null){A.child.return=A,A=A.child;continue}if(A===M)break e;for(;A.sibling===null;){if(A.return===null||A.return===M)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}me&=1}if(Ra(Qa,me),!(M.mode&1))M.memoizedState=null;else switch(Pe){case"forwards":for(Q=M.child,Pe=null;Q!==null;)A=Q.alternate,A!==null&&yx(A)===null&&(Pe=Q),Q=Q.sibling;Q=Pe,Q===null?(Pe=M.child,M.child=null):(Pe=Q.sibling,Q.sibling=null),W2(M,!1,Pe,Q,Ue);break;case"backwards":for(Q=null,Pe=M.child,M.child=null;Pe!==null;){if(A=Pe.alternate,A!==null&&yx(A)===null){M.child=Pe;break}A=Pe.sibling,Pe.sibling=Q,Q=Pe,Pe=A}W2(M,!0,Q,null,Ue);break;case"together":W2(M,!1,null,null,void 0);break;default:M.memoizedState=null}return M.child}function c6(A,M){!(M.mode&1)&&A!==null&&(A.alternate=null,M.alternate=null,M.flags|=2)}function cf(A,M,Q){if(A!==null&&(M.dependencies=A.dependencies),Mm|=M.lanes,!(Q&M.childLanes))return null;if(A!==null&&M.child!==A.child)throw Error(n(153));if(M.child!==null){for(A=M.child,Q=pf(A,A.pendingProps),M.child=Q,Q.return=M;A.sibling!==null;)A=A.sibling,Q=Q.sibling=pf(A,A.pendingProps),Q.return=M;Q.sibling=null}return M.child}function XT(A,M,Q){switch(M.tag){case 3:YT(M),Zf();break;case 5:w8(M);break;case 1:au(M.type)&&pd(M);break;case 4:v8(M,M.stateNode.containerInfo);break;case 10:var me=M.type._context,Pe=M.memoizedProps.value;Ra(P2,me._currentValue),me._currentValue=Pe;break;case 13:if(me=M.memoizedState,me!==null)return me.dehydrated!==null?(Ra(Qa,Qa.current&1),M.flags|=128,null):Q&M.child.childLanes?l6(A,M,Q):(Ra(Qa,Qa.current&1),A=cf(A,M,Q),A!==null?A.sibling:null);Ra(Qa,Qa.current&1);break;case 19:if(me=(Q&M.childLanes)!==0,A.flags&128){if(me)return Fm(A,M,Q);M.flags|=128}if(Pe=M.memoizedState,Pe!==null&&(Pe.rendering=null,Pe.tail=null,Pe.lastEffect=null),Ra(Qa,Qa.current),me)break;return null;case 22:case 23:return M.lanes=0,L8(A,M,Q)}return cf(A,M,Q)}var zl,z8,QT,H8;zl=function(A,M){for(var Q=M.child;Q!==null;){if(Q.tag===5||Q.tag===6)A.appendChild(Q.stateNode);else if(Q.tag!==4&&Q.child!==null){Q.child.return=Q,Q=Q.child;continue}if(Q===M)break;for(;Q.sibling===null;){if(Q.return===null||Q.return===M)return;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}},z8=function(){},QT=function(A,M,Q,me){var Pe=A.memoizedProps;if(Pe!==me){A=M.stateNode,mp(eh.current);var Ue=null;switch(Q){case"input":Pe=tt(A,Pe),me=tt(A,me),Ue=[];break;case"select":Pe=ee({},Pe,{value:void 0}),me=ee({},me,{value:void 0}),Ue=[];break;case"textarea":Pe=un(A,Pe),me=un(A,me),Ue=[];break;default:typeof Pe.onClick!="function"&&typeof me.onClick=="function"&&(A.onclick=O5)}Rt(Q,me);var Ct;Q=null;for(rr in Pe)if(!me.hasOwnProperty(rr)&&Pe.hasOwnProperty(rr)&&Pe[rr]!=null)if(rr==="style"){var mn=Pe[rr];for(Ct in mn)mn.hasOwnProperty(Ct)&&(Q||(Q={}),Q[Ct]="")}else rr!=="dangerouslySetInnerHTML"&&rr!=="children"&&rr!=="suppressContentEditableWarning"&&rr!=="suppressHydrationWarning"&&rr!=="autoFocus"&&(s.hasOwnProperty(rr)?Ue||(Ue=[]):(Ue=Ue||[]).push(rr,null));for(rr in me){var In=me[rr];if(mn=Pe!=null?Pe[rr]:void 0,me.hasOwnProperty(rr)&&In!==mn&&(In!=null||mn!=null))if(rr==="style")if(mn){for(Ct in mn)!mn.hasOwnProperty(Ct)||In&&In.hasOwnProperty(Ct)||(Q||(Q={}),Q[Ct]="");for(Ct in In)In.hasOwnProperty(Ct)&&mn[Ct]!==In[Ct]&&(Q||(Q={}),Q[Ct]=In[Ct])}else Q||(Ue||(Ue=[]),Ue.push(rr,Q)),Q=In;else rr==="dangerouslySetInnerHTML"?(In=In?In.__html:void 0,mn=mn?mn.__html:void 0,In!=null&&mn!==In&&(Ue=Ue||[]).push(rr,In)):rr==="children"?typeof In!="string"&&typeof In!="number"||(Ue=Ue||[]).push(rr,""+In):rr!=="suppressContentEditableWarning"&&rr!=="suppressHydrationWarning"&&(s.hasOwnProperty(rr)?(In!=null&&rr==="onScroll"&&za("scroll",A),Ue||mn===In||(Ue=[])):(Ue=Ue||[]).push(rr,In))}Q&&(Ue=Ue||[]).push("style",Q);var rr=Ue;(M.updateQueue=rr)&&(M.flags|=4)}},H8=function(A,M,Q,me){Q!==me&&(M.flags|=4)};function q2(A,M){if(!Va)switch(A.tailMode){case"hidden":M=A.tail;for(var Q=null;M!==null;)M.alternate!==null&&(Q=M),M=M.sibling;Q===null?A.tail=null:Q.sibling=null;break;case"collapsed":Q=A.tail;for(var me=null;Q!==null;)Q.alternate!==null&&(me=Q),Q=Q.sibling;me===null?M||A.tail===null?A.tail=null:A.tail.sibling=null:me.sibling=null}}function Hl(A){var M=A.alternate!==null&&A.alternate.child===A.child,Q=0,me=0;if(M)for(var Pe=A.child;Pe!==null;)Q|=Pe.lanes|Pe.childLanes,me|=Pe.subtreeFlags&14680064,me|=Pe.flags&14680064,Pe.return=A,Pe=Pe.sibling;else for(Pe=A.child;Pe!==null;)Q|=Pe.lanes|Pe.childLanes,me|=Pe.subtreeFlags,me|=Pe.flags,Pe.return=A,Pe=Pe.sibling;return A.subtreeFlags|=me,A.childLanes=Q,M}function PU(A,M,Q){var me=M.pendingProps;switch(xx(M),M.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Hl(M),null;case 1:return au(M.type)&&D5(),Hl(M),null;case 3:return me=M.stateNode,Im(),Ha(iu),Ha(lc),Y5(),me.pendingContext&&(me.context=me.pendingContext,me.pendingContext=null),(A===null||A.child===null)&&(T2(M)?M.flags|=4:A===null||A.memoizedState.isDehydrated&&!(M.flags&256)||(M.flags|=1024,of!==null&&(J8(of),of=null))),z8(A,M),Hl(M),null;case 5:K5(M);var Pe=mp($1.current);if(Q=M.type,A!==null&&M.stateNode!=null)QT(A,M,Q,me,Pe),A.ref!==M.ref&&(M.flags|=512,M.flags|=2097152);else{if(!me){if(M.stateNode===null)throw Error(n(166));return Hl(M),null}if(A=mp(eh.current),T2(M)){me=M.stateNode,Q=M.type;var Ue=M.memoizedProps;switch(me[Gf]=M,me[jm]=Ue,A=(M.mode&1)!==0,Q){case"dialog":za("cancel",me),za("close",me);break;case"iframe":case"object":case"embed":za("load",me);break;case"video":case"audio":for(Pe=0;Pe<cp.length;Pe++)za(cp[Pe],me);break;case"source":za("error",me);break;case"img":case"image":case"link":za("error",me),za("load",me);break;case"details":za("toggle",me);break;case"input":at(me,Ue),za("invalid",me);break;case"select":me._wrapperState={wasMultiple:!!Ue.multiple},za("invalid",me);break;case"textarea":cn(me,Ue),za("invalid",me)}Rt(Q,Ue),Pe=null;for(var Ct in Ue)if(Ue.hasOwnProperty(Ct)){var mn=Ue[Ct];Ct==="children"?typeof mn=="string"?me.textContent!==mn&&(Ue.suppressHydrationWarning!==!0&&A2(me.textContent,mn,A),Pe=["children",mn]):typeof mn=="number"&&me.textContent!==""+mn&&(Ue.suppressHydrationWarning!==!0&&A2(me.textContent,mn,A),Pe=["children",""+mn]):s.hasOwnProperty(Ct)&&mn!=null&&Ct==="onScroll"&&za("scroll",me)}switch(Q){case"input":Qe(me),Ut(me,Ue,!0);break;case"textarea":Qe(me),Xe(me);break;case"select":case"option":break;default:typeof Ue.onClick=="function"&&(me.onclick=O5)}me=Pe,M.updateQueue=me,me!==null&&(M.flags|=4)}else{Ct=Pe.nodeType===9?Pe:Pe.ownerDocument,A==="http://www.w3.org/1999/xhtml"&&(A=Vt(Q)),A==="http://www.w3.org/1999/xhtml"?Q==="script"?(A=Ct.createElement("div"),A.innerHTML="<script><\/script>",A=A.removeChild(A.firstChild)):typeof me.is=="string"?A=Ct.createElement(Q,{is:me.is}):(A=Ct.createElement(Q),Q==="select"&&(Ct=A,me.multiple?Ct.multiple=!0:me.size&&(Ct.size=me.size))):A=Ct.createElementNS(A,Q),A[Gf]=M,A[jm]=me,zl(A,M,!1,!1),M.stateNode=A;e:{switch(Ct=qe(Q,me),Q){case"dialog":za("cancel",A),za("close",A),Pe=me;break;case"iframe":case"object":case"embed":za("load",A),Pe=me;break;case"video":case"audio":for(Pe=0;Pe<cp.length;Pe++)za(cp[Pe],A);Pe=me;break;case"source":za("error",A),Pe=me;break;case"img":case"image":case"link":za("error",A),za("load",A),Pe=me;break;case"details":za("toggle",A),Pe=me;break;case"input":at(A,me),Pe=tt(A,me),za("invalid",A);break;case"option":Pe=me;break;case"select":A._wrapperState={wasMultiple:!!me.multiple},Pe=ee({},me,{value:void 0}),za("invalid",A);break;case"textarea":cn(A,me),Pe=un(A,me),za("invalid",A);break;default:Pe=me}Rt(Q,Pe),mn=Pe;for(Ue in mn)if(mn.hasOwnProperty(Ue)){var In=mn[Ue];Ue==="style"?Je(A,In):Ue==="dangerouslySetInnerHTML"?(In=In?In.__html:void 0,In!=null&&Ke(A,In)):Ue==="children"?typeof In=="string"?(Q!=="textarea"||In!=="")&&ft(A,In):typeof In=="number"&&ft(A,""+In):Ue!=="suppressContentEditableWarning"&&Ue!=="suppressHydrationWarning"&&Ue!=="autoFocus"&&(s.hasOwnProperty(Ue)?In!=null&&Ue==="onScroll"&&za("scroll",A):In!=null&&P(A,Ue,In,Ct))}switch(Q){case"input":Qe(A),Ut(A,me,!1);break;case"textarea":Qe(A),Xe(A);break;case"option":me.value!=null&&A.setAttribute("value",""+je(me.value));break;case"select":A.multiple=!!me.multiple,Ue=me.value,Ue!=null?jt(A,!!me.multiple,Ue,!1):me.defaultValue!=null&&jt(A,!!me.multiple,me.defaultValue,!0);break;default:typeof Pe.onClick=="function"&&(A.onclick=O5)}switch(Q){case"button":case"input":case"select":case"textarea":me=!!me.autoFocus;break e;case"img":me=!0;break e;default:me=!1}}me&&(M.flags|=4)}M.ref!==null&&(M.flags|=512,M.flags|=2097152)}return Hl(M),null;case 6:if(A&&M.stateNode!=null)H8(A,M,A.memoizedProps,me);else{if(typeof me!="string"&&M.stateNode===null)throw Error(n(166));if(Q=mp($1.current),mp(eh.current),T2(M)){if(me=M.stateNode,Q=M.memoizedProps,me[Gf]=M,(Ue=me.nodeValue!==Q)&&(A=uc,A!==null))switch(A.tag){case 3:A2(me.nodeValue,Q,(A.mode&1)!==0);break;case 5:A.memoizedProps.suppressHydrationWarning!==!0&&A2(me.nodeValue,Q,(A.mode&1)!==0)}Ue&&(M.flags|=4)}else me=(Q.nodeType===9?Q:Q.ownerDocument).createTextNode(me),me[Gf]=M,M.stateNode=me}return Hl(M),null;case 13:if(Ha(Qa),me=M.memoizedState,A===null||A.memoizedState!==null&&A.memoizedState.dehydrated!==null){if(Va&&Ru!==null&&M.mode&1&&!(M.flags&128))x8(),Zf(),M.flags|=98560,Ue=!1;else if(Ue=T2(M),me!==null&&me.dehydrated!==null){if(A===null){if(!Ue)throw Error(n(318));if(Ue=M.memoizedState,Ue=Ue!==null?Ue.dehydrated:null,!Ue)throw Error(n(317));Ue[Gf]=M}else Zf(),!(M.flags&128)&&(M.memoizedState=null),M.flags|=4;Hl(M),Ue=!1}else of!==null&&(J8(of),of=null),Ue=!0;if(!Ue)return M.flags&65536?M:null}return M.flags&128?(M.lanes=Q,M):(me=me!==null,me!==(A!==null&&A.memoizedState!==null)&&me&&(M.child.flags|=8192,M.mode&1&&(A===null||Qa.current&1?al===0&&(al=3):n7())),M.updateQueue!==null&&(M.flags|=4),Hl(M),null);case 4:return Im(),z8(A,M),A===null&&Sm(M.stateNode.containerInfo),Hl(M),null;case 10:return V5(M.type._context),Hl(M),null;case 17:return au(M.type)&&D5(),Hl(M),null;case 19:if(Ha(Qa),Ue=M.memoizedState,Ue===null)return Hl(M),null;if(me=(M.flags&128)!==0,Ct=Ue.rendering,Ct===null)if(me)q2(Ue,!1);else{if(al!==0||A!==null&&A.flags&128)for(A=M.child;A!==null;){if(Ct=yx(A),Ct!==null){for(M.flags|=128,q2(Ue,!1),me=Ct.updateQueue,me!==null&&(M.updateQueue=me,M.flags|=4),M.subtreeFlags=0,me=Q,Q=M.child;Q!==null;)Ue=Q,A=me,Ue.flags&=14680066,Ct=Ue.alternate,Ct===null?(Ue.childLanes=0,Ue.lanes=A,Ue.child=null,Ue.subtreeFlags=0,Ue.memoizedProps=null,Ue.memoizedState=null,Ue.updateQueue=null,Ue.dependencies=null,Ue.stateNode=null):(Ue.childLanes=Ct.childLanes,Ue.lanes=Ct.lanes,Ue.child=Ct.child,Ue.subtreeFlags=0,Ue.deletions=null,Ue.memoizedProps=Ct.memoizedProps,Ue.memoizedState=Ct.memoizedState,Ue.updateQueue=Ct.updateQueue,Ue.type=Ct.type,A=Ct.dependencies,Ue.dependencies=A===null?null:{lanes:A.lanes,firstContext:A.firstContext}),Q=Q.sibling;return Ra(Qa,Qa.current&1|2),M.child}A=A.sibling}Ue.tail!==null&&Ee()>Nx&&(M.flags|=128,me=!0,q2(Ue,!1),M.lanes=4194304)}else{if(!me)if(A=yx(Ct),A!==null){if(M.flags|=128,me=!0,Q=A.updateQueue,Q!==null&&(M.updateQueue=Q,M.flags|=4),q2(Ue,!0),Ue.tail===null&&Ue.tailMode==="hidden"&&!Ct.alternate&&!Va)return Hl(M),null}else 2*Ee()-Ue.renderingStartTime>Nx&&Q!==1073741824&&(M.flags|=128,me=!0,q2(Ue,!1),M.lanes=4194304);Ue.isBackwards?(Ct.sibling=M.child,M.child=Ct):(Q=Ue.last,Q!==null?Q.sibling=Ct:M.child=Ct,Ue.last=Ct)}return Ue.tail!==null?(M=Ue.tail,Ue.rendering=M,Ue.tail=M.sibling,Ue.renderingStartTime=Ee(),M.sibling=null,Q=Qa.current,Ra(Qa,me?Q&1|2:Q&1),M):(Hl(M),null);case 22:case 23:return t7(),me=M.memoizedState!==null,A!==null&&A.memoizedState!==null!==me&&(M.flags|=8192),me&&M.mode&1?Bu&1073741824&&(Hl(M),M.subtreeFlags&6&&(M.flags|=8192)):Hl(M),null;case 24:return null;case 25:return null}throw Error(n(156,M.tag))}function FU(A,M){switch(xx(M),M.tag){case 1:return au(M.type)&&D5(),A=M.flags,A&65536?(M.flags=A&-65537|128,M):null;case 3:return Im(),Ha(iu),Ha(lc),Y5(),A=M.flags,A&65536&&!(A&128)?(M.flags=A&-65537|128,M):null;case 5:return K5(M),null;case 13:if(Ha(Qa),A=M.memoizedState,A!==null&&A.dehydrated!==null){if(M.alternate===null)throw Error(n(340));Zf()}return A=M.flags,A&65536?(M.flags=A&-65537|128,M):null;case 19:return Ha(Qa),null;case 4:return Im(),null;case 10:return V5(M.type._context),null;case 22:case 23:return t7(),null;case 24:return null;default:return null}}var u6=!1,Za=!1,Lc=typeof WeakSet=="function"?WeakSet:Set,ds=null;function Y1(A,M){var Q=A.ref;if(Q!==null)if(typeof Q=="function")try{Q(null)}catch(me){co(A,M,me)}else Q.current=null}function G2(A,M,Q){try{Q()}catch(me){co(A,M,me)}}var ZT=!1;function OU(A,M){if(j2=gr,A=ps(),Ws(A)){if("selectionStart"in A)var Q={start:A.selectionStart,end:A.selectionEnd};else e:{Q=(Q=A.ownerDocument)&&Q.defaultView||window;var me=Q.getSelection&&Q.getSelection();if(me&&me.rangeCount!==0){Q=me.anchorNode;var Pe=me.anchorOffset,Ue=me.focusNode;me=me.focusOffset;try{Q.nodeType,Ue.nodeType}catch{Q=null;break e}var Ct=0,mn=-1,In=-1,rr=0,Dr=0,$r=A,Rr=null;t:for(;;){for(var os;$r!==Q||Pe!==0&&$r.nodeType!==3||(mn=Ct+Pe),$r!==Ue||me!==0&&$r.nodeType!==3||(In=Ct+me),$r.nodeType===3&&(Ct+=$r.nodeValue.length),(os=$r.firstChild)!==null;)Rr=$r,$r=os;for(;;){if($r===A)break t;if(Rr===Q&&++rr===Pe&&(mn=Ct),Rr===Ue&&++Dr===me&&(In=Ct),(os=$r.nextSibling)!==null)break;$r=Rr,Rr=$r.parentNode}$r=os}Q=mn===-1||In===-1?null:{start:mn,end:In}}else Q=null}Q=Q||{start:0,end:0}}else Q=null;for(fx={focusedElem:A,selectionRange:Q},gr=!1,ds=M;ds!==null;)if(M=ds,A=M.child,(M.subtreeFlags&1028)!==0&&A!==null)A.return=M,ds=A;else for(;ds!==null;){M=ds;try{var ms=M.alternate;if(M.flags&1024)switch(M.tag){case 0:case 11:case 15:break;case 1:if(ms!==null){var As=ms.memoizedProps,wo=ms.memoizedState,Xn=M.stateNode,Bn=Xn.getSnapshotBeforeUpdate(M.elementType===M.type?As:wd(M.type,As),wo);Xn.__reactInternalSnapshotBeforeUpdate=Bn}break;case 3:var Zn=M.stateNode.containerInfo;Zn.nodeType===1?Zn.textContent="":Zn.nodeType===9&&Zn.documentElement&&Zn.removeChild(Zn.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Wr){co(M,M.return,Wr)}if(A=M.sibling,A!==null){A.return=M.return,ds=A;break}ds=M.return}return ms=ZT,ZT=!1,ms}function yp(A,M,Q){var me=M.updateQueue;if(me=me!==null?me.lastEffect:null,me!==null){var Pe=me=me.next;do{if((Pe.tag&A)===A){var Ue=Pe.destroy;Pe.destroy=void 0,Ue!==void 0&&G2(M,Q,Ue)}Pe=Pe.next}while(Pe!==me)}}function K2(A,M){if(M=M.updateQueue,M=M!==null?M.lastEffect:null,M!==null){var Q=M=M.next;do{if((Q.tag&A)===A){var me=Q.create;Q.destroy=me()}Q=Q.next}while(Q!==M)}}function d6(A){var M=A.ref;if(M!==null){var Q=A.stateNode;switch(A.tag){case 5:A=Q;break;default:A=Q}typeof M=="function"?M(A):M.current=A}}function JT(A){var M=A.alternate;M!==null&&(A.alternate=null,JT(M)),A.child=null,A.deletions=null,A.sibling=null,A.tag===5&&(M=A.stateNode,M!==null&&(delete M[Gf],delete M[jm],delete M[R5],delete M[Mt],delete M[O1])),A.stateNode=null,A.return=null,A.dependencies=null,A.memoizedProps=null,A.memoizedState=null,A.pendingProps=null,A.stateNode=null,A.updateQueue=null}function eI(A){return A.tag===5||A.tag===3||A.tag===4}function tI(A){e:for(;;){for(;A.sibling===null;){if(A.return===null||eI(A.return))return null;A=A.return}for(A.sibling.return=A.return,A=A.sibling;A.tag!==5&&A.tag!==6&&A.tag!==18;){if(A.flags&2||A.child===null||A.tag===4)continue e;A.child.return=A,A=A.child}if(!(A.flags&2))return A.stateNode}}function V8(A,M,Q){var me=A.tag;if(me===5||me===6)A=A.stateNode,M?Q.nodeType===8?Q.parentNode.insertBefore(A,M):Q.insertBefore(A,M):(Q.nodeType===8?(M=Q.parentNode,M.insertBefore(A,Q)):(M=Q,M.appendChild(A)),Q=Q._reactRootContainer,Q!=null||M.onclick!==null||(M.onclick=O5));else if(me!==4&&(A=A.child,A!==null))for(V8(A,M,Q),A=A.sibling;A!==null;)V8(A,M,Q),A=A.sibling}function f6(A,M,Q){var me=A.tag;if(me===5||me===6)A=A.stateNode,M?Q.insertBefore(A,M):Q.appendChild(A);else if(me!==4&&(A=A.child,A!==null))for(f6(A,M,Q),A=A.sibling;A!==null;)f6(A,M,Q),A=A.sibling}var Sl=null,uf=!1;function ih(A,M,Q){for(Q=Q.child;Q!==null;)W8(A,M,Q),Q=Q.sibling}function W8(A,M,Q){if(q&&typeof q.onCommitFiberUnmount=="function")try{q.onCommitFiberUnmount(B,Q)}catch{}switch(Q.tag){case 5:Za||Y1(Q,M);case 6:var me=Sl,Pe=uf;Sl=null,ih(A,M,Q),Sl=me,uf=Pe,Sl!==null&&(uf?(A=Sl,Q=Q.stateNode,A.nodeType===8?A.parentNode.removeChild(Q):A.removeChild(Q)):Sl.removeChild(Q.stateNode));break;case 18:Sl!==null&&(uf?(A=Sl,Q=Q.stateNode,A.nodeType===8?h8(A.parentNode,Q):A.nodeType===1&&h8(A,Q),lr(A)):h8(Sl,Q.stateNode));break;case 4:me=Sl,Pe=uf,Sl=Q.stateNode.containerInfo,uf=!0,ih(A,M,Q),Sl=me,uf=Pe;break;case 0:case 11:case 14:case 15:if(!Za&&(me=Q.updateQueue,me!==null&&(me=me.lastEffect,me!==null))){Pe=me=me.next;do{var Ue=Pe,Ct=Ue.destroy;Ue=Ue.tag,Ct!==void 0&&(Ue&2||Ue&4)&&G2(Q,M,Ct),Pe=Pe.next}while(Pe!==me)}ih(A,M,Q);break;case 1:if(!Za&&(Y1(Q,M),me=Q.stateNode,typeof me.componentWillUnmount=="function"))try{me.props=Q.memoizedProps,me.state=Q.memoizedState,me.componentWillUnmount()}catch(mn){co(Q,M,mn)}ih(A,M,Q);break;case 21:ih(A,M,Q);break;case 22:Q.mode&1?(Za=(me=Za)||Q.memoizedState!==null,ih(A,M,Q),Za=me):ih(A,M,Q);break;default:ih(A,M,Q)}}function X1(A){var M=A.updateQueue;if(M!==null){A.updateQueue=null;var Q=A.stateNode;Q===null&&(Q=A.stateNode=new Lc),M.forEach(function(me){var Pe=UU.bind(null,A,me);Q.has(me)||(Q.add(me),me.then(Pe,Pe))})}}function Du(A,M){var Q=M.deletions;if(Q!==null)for(var me=0;me<Q.length;me++){var Pe=Q[me];try{var Ue=A,Ct=M,mn=Ct;e:for(;mn!==null;){switch(mn.tag){case 5:Sl=mn.stateNode,uf=!1;break e;case 3:Sl=mn.stateNode.containerInfo,uf=!0;break e;case 4:Sl=mn.stateNode.containerInfo,uf=!0;break e}mn=mn.return}if(Sl===null)throw Error(n(160));W8(Ue,Ct,Pe),Sl=null,uf=!1;var In=Pe.alternate;In!==null&&(In.return=null),Pe.return=null}catch(rr){co(Pe,M,rr)}}if(M.subtreeFlags&12854)for(M=M.child;M!==null;)q8(M,A),M=M.sibling}function q8(A,M){var Q=A.alternate,me=A.flags;switch(A.tag){case 0:case 11:case 14:case 15:if(Du(M,A),df(A),me&4){try{yp(3,A,A.return),K2(3,A)}catch(As){co(A,A.return,As)}try{yp(5,A,A.return)}catch(As){co(A,A.return,As)}}break;case 1:Du(M,A),df(A),me&512&&Q!==null&&Y1(Q,Q.return);break;case 5:if(Du(M,A),df(A),me&512&&Q!==null&&Y1(Q,Q.return),A.flags&32){var Pe=A.stateNode;try{ft(Pe,"")}catch(As){co(A,A.return,As)}}if(me&4&&(Pe=A.stateNode,Pe!=null)){var Ue=A.memoizedProps,Ct=Q!==null?Q.memoizedProps:Ue,mn=A.type,In=A.updateQueue;if(A.updateQueue=null,In!==null)try{mn==="input"&&Ue.type==="radio"&&Ue.name!=null&&dt(Pe,Ue),qe(mn,Ct);var rr=qe(mn,Ue);for(Ct=0;Ct<In.length;Ct+=2){var Dr=In[Ct],$r=In[Ct+1];Dr==="style"?Je(Pe,$r):Dr==="dangerouslySetInnerHTML"?Ke(Pe,$r):Dr==="children"?ft(Pe,$r):P(Pe,Dr,$r,rr)}switch(mn){case"input":ct(Pe,Ue);break;case"textarea":Pt(Pe,Ue);break;case"select":var Rr=Pe._wrapperState.wasMultiple;Pe._wrapperState.wasMultiple=!!Ue.multiple;var os=Ue.value;os!=null?jt(Pe,!!Ue.multiple,os,!1):Rr!==!!Ue.multiple&&(Ue.defaultValue!=null?jt(Pe,!!Ue.multiple,Ue.defaultValue,!0):jt(Pe,!!Ue.multiple,Ue.multiple?[]:"",!1))}Pe[jm]=Ue}catch(As){co(A,A.return,As)}}break;case 6:if(Du(M,A),df(A),me&4){if(A.stateNode===null)throw Error(n(162));Pe=A.stateNode,Ue=A.memoizedProps;try{Pe.nodeValue=Ue}catch(As){co(A,A.return,As)}}break;case 3:if(Du(M,A),df(A),me&4&&Q!==null&&Q.memoizedState.isDehydrated)try{lr(M.containerInfo)}catch(As){co(A,A.return,As)}break;case 4:Du(M,A),df(A);break;case 13:Du(M,A),df(A),Pe=A.child,Pe.flags&8192&&(Ue=Pe.memoizedState!==null,Pe.stateNode.isHidden=Ue,!Ue||Pe.alternate!==null&&Pe.alternate.memoizedState!==null||(Y8=Ee())),me&4&&X1(A);break;case 22:if(Dr=Q!==null&&Q.memoizedState!==null,A.mode&1?(Za=(rr=Za)||Dr,Du(M,A),Za=rr):Du(M,A),df(A),me&8192){if(rr=A.memoizedState!==null,(A.stateNode.isHidden=rr)&&!Dr&&A.mode&1)for(ds=A,Dr=A.child;Dr!==null;){for($r=ds=Dr;ds!==null;){switch(Rr=ds,os=Rr.child,Rr.tag){case 0:case 11:case 14:case 15:yp(4,Rr,Rr.return);break;case 1:Y1(Rr,Rr.return);var ms=Rr.stateNode;if(typeof ms.componentWillUnmount=="function"){me=Rr,Q=Rr.return;try{M=me,ms.props=M.memoizedProps,ms.state=M.memoizedState,ms.componentWillUnmount()}catch(As){co(me,Q,As)}}break;case 5:Y1(Rr,Rr.return);break;case 22:if(Rr.memoizedState!==null){Om($r);continue}}os!==null?(os.return=Rr,ds=os):Om($r)}Dr=Dr.sibling}e:for(Dr=null,$r=A;;){if($r.tag===5){if(Dr===null){Dr=$r;try{Pe=$r.stateNode,rr?(Ue=Pe.style,typeof Ue.setProperty=="function"?Ue.setProperty("display","none","important"):Ue.display="none"):(mn=$r.stateNode,In=$r.memoizedProps.style,Ct=In!=null&&In.hasOwnProperty("display")?In.display:null,mn.style.display=At("display",Ct))}catch(As){co(A,A.return,As)}}}else if($r.tag===6){if(Dr===null)try{$r.stateNode.nodeValue=rr?"":$r.memoizedProps}catch(As){co(A,A.return,As)}}else if(($r.tag!==22&&$r.tag!==23||$r.memoizedState===null||$r===A)&&$r.child!==null){$r.child.return=$r,$r=$r.child;continue}if($r===A)break e;for(;$r.sibling===null;){if($r.return===null||$r.return===A)break e;Dr===$r&&(Dr=null),$r=$r.return}Dr===$r&&(Dr=null),$r.sibling.return=$r.return,$r=$r.sibling}}break;case 19:Du(M,A),df(A),me&4&&X1(A);break;case 21:break;default:Du(M,A),df(A)}}function df(A){var M=A.flags;if(M&2){try{e:{for(var Q=A.return;Q!==null;){if(eI(Q)){var me=Q;break e}Q=Q.return}throw Error(n(160))}switch(me.tag){case 5:var Pe=me.stateNode;me.flags&32&&(ft(Pe,""),me.flags&=-33);var Ue=tI(A);f6(A,Ue,Pe);break;case 3:case 4:var Ct=me.stateNode.containerInfo,mn=tI(A);V8(A,mn,Ct);break;default:throw Error(n(161))}}catch(In){co(A,A.return,In)}A.flags&=-3}M&4096&&(A.flags&=-4097)}function h6(A,M,Q){ds=A,G8(A)}function G8(A,M,Q){for(var me=(A.mode&1)!==0;ds!==null;){var Pe=ds,Ue=Pe.child;if(Pe.tag===22&&me){var Ct=Pe.memoizedState!==null||u6;if(!Ct){var mn=Pe.alternate,In=mn!==null&&mn.memoizedState!==null||Za;mn=u6;var rr=Za;if(u6=Ct,(Za=In)&&!rr)for(ds=Pe;ds!==null;)Ct=ds,In=Ct.child,Ct.tag===22&&Ct.memoizedState!==null?nI(Pe):In!==null?(In.return=Ct,ds=In):nI(Pe);for(;Ue!==null;)ds=Ue,G8(Ue),Ue=Ue.sibling;ds=Pe,u6=mn,Za=rr}ff(A)}else Pe.subtreeFlags&8772&&Ue!==null?(Ue.return=Pe,ds=Ue):ff(A)}}function ff(A){for(;ds!==null;){var M=ds;if(M.flags&8772){var Q=M.alternate;try{if(M.flags&8772)switch(M.tag){case 0:case 11:case 15:Za||K2(5,M);break;case 1:var me=M.stateNode;if(M.flags&4&&!Za)if(Q===null)me.componentDidMount();else{var Pe=M.elementType===M.type?Q.memoizedProps:wd(M.type,Q.memoizedProps);me.componentDidUpdate(Pe,Q.memoizedState,me.__reactInternalSnapshotBeforeUpdate)}var Ue=M.updateQueue;Ue!==null&&y8(M,Ue,me);break;case 3:var Ct=M.updateQueue;if(Ct!==null){if(Q=null,M.child!==null)switch(M.child.tag){case 5:Q=M.child.stateNode;break;case 1:Q=M.child.stateNode}y8(M,Ct,Q)}break;case 5:var mn=M.stateNode;if(Q===null&&M.flags&4){Q=mn;var In=M.memoizedProps;switch(M.type){case"button":case"input":case"select":case"textarea":In.autoFocus&&Q.focus();break;case"img":In.src&&(Q.src=In.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(M.memoizedState===null){var rr=M.alternate;if(rr!==null){var Dr=rr.memoizedState;if(Dr!==null){var $r=Dr.dehydrated;$r!==null&&lr($r)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Za||M.flags&512&&d6(M)}catch(Rr){co(M,M.return,Rr)}}if(M===A){ds=null;break}if(Q=M.sibling,Q!==null){Q.return=M.return,ds=Q;break}ds=M.return}}function Om(A){for(;ds!==null;){var M=ds;if(M===A){ds=null;break}var Q=M.sibling;if(Q!==null){Q.return=M.return,ds=Q;break}ds=M.return}}function nI(A){for(;ds!==null;){var M=ds;try{switch(M.tag){case 0:case 11:case 15:var Q=M.return;try{K2(4,M)}catch(In){co(M,Q,In)}break;case 1:var me=M.stateNode;if(typeof me.componentDidMount=="function"){var Pe=M.return;try{me.componentDidMount()}catch(In){co(M,Pe,In)}}var Ue=M.return;try{d6(M)}catch(In){co(M,Ue,In)}break;case 5:var Ct=M.return;try{d6(M)}catch(In){co(M,Ct,In)}}}catch(In){co(M,M.return,In)}if(M===A){ds=null;break}var mn=M.sibling;if(mn!==null){mn.return=M.return,ds=mn;break}ds=M.return}}var rI=Math.ceil,p6=R.ReactCurrentDispatcher,K8=R.ReactCurrentOwner,Cd=R.ReactCurrentBatchConfig,qi=0,Nl=null,Ho=null,Vl=0,Bu=0,Q1=su(0),al=0,Y2=null,Mm=0,X2=0,m6=0,Q2=null,cu=null,Y8=0,Nx=1/0,vp=null,x6=!1,X8=null,Rm=null,g6=!1,Lm=null,Dc=0,Z2=0,Q8=null,b6=-1,J2=0;function Bc(){return qi&6?Ee():b6!==-1?b6:b6=Ee()}function Dm(A){return A.mode&1?qi&2&&Vl!==0?Vl&-Vl:RT.transition!==null?(J2===0&&(J2=De()),J2):(A=gt,A!==0||(A=window.event,A=A===void 0?16:rs(A.type)),A):1}function hf(A,M,Q,me){if(50<Z2)throw Z2=0,Q8=null,Error(n(185));_e(A,Q,me),(!(qi&2)||A!==Nl)&&(A===Nl&&(!(qi&2)&&(X2|=Q),al===4&&Bm(A,Vl)),uu(A,me),Q===1&&qi===0&&!(M.mode&1)&&(Nx=Ee()+500,B5&&_m()))}function uu(A,M){var Q=A.callbackNode;se(A,M);var me=Fe(A,A===Nl?Vl:0);if(me===0)Q!==null&&Yn(Q),A.callbackNode=null,A.callbackPriority=0;else if(M=me&-me,A.callbackPriority!==M){if(Q!=null&&Yn(Q),M===1)A.tag===0?hx(sI.bind(null,A)):FT(sI.bind(null,A)),M5(function(){!(qi&6)&&_m()}),Q=null;else{switch(Jt(me)){case 1:Q=h;break;case 4:Q=S;break;case 16:Q=_;break;case 536870912:Q=T;break;default:Q=_}Q=dI(Q,y6.bind(null,A))}A.callbackPriority=M,A.callbackNode=Q}}function y6(A,M){if(b6=-1,J2=0,qi&6)throw Error(n(327));var Q=A.callbackNode;if(Z1()&&A.callbackNode!==Q)return null;var me=Fe(A,A===Nl?Vl:0);if(me===0)return null;if(me&30||me&A.expiredLanes||M)M=v6(A,me);else{M=me;var Pe=qi;qi|=2;var Ue=aI();(Nl!==A||Vl!==M)&&(vp=null,Nx=Ee()+500,jx(A,M));do try{LU();break}catch(mn){iI(A,mn)}while(!0);fp(),p6.current=Ue,qi=Pe,Ho!==null?M=0:(Nl=null,Vl=0,M=al)}if(M!==0){if(M===2&&(Pe=Ce(A),Pe!==0&&(me=Pe,M=Z8(A,Pe))),M===1)throw Q=Y2,jx(A,0),Bm(A,me),uu(A,Ee()),Q;if(M===6)Bm(A,me);else{if(Pe=A.current.alternate,!(me&30)&&!MU(Pe)&&(M=v6(A,me),M===2&&(Ue=Ce(A),Ue!==0&&(me=Ue,M=Z8(A,Ue))),M===1))throw Q=Y2,jx(A,0),Bm(A,me),uu(A,Ee()),Q;switch(A.finishedWork=Pe,A.finishedLanes=me,M){case 0:case 1:throw Error(n(345));case 2:Ex(A,cu,vp);break;case 3:if(Bm(A,me),(me&130023424)===me&&(M=Y8+500-Ee(),10<M)){if(Fe(A,0)!==0)break;if(Pe=A.suspendedLanes,(Pe&me)!==me){Bc(),A.pingedLanes|=A.suspendedLanes&Pe;break}A.timeoutHandle=Nm(Ex.bind(null,A,cu,vp),M);break}Ex(A,cu,vp);break;case 4:if(Bm(A,me),(me&4194240)===me)break;for(M=A.eventTimes,Pe=-1;0<me;){var Ct=31-ue(me);Ue=1<<Ct,Ct=M[Ct],Ct>Pe&&(Pe=Ct),me&=~Ue}if(me=Pe,me=Ee()-me,me=(120>me?120:480>me?480:1080>me?1080:1920>me?1920:3e3>me?3e3:4320>me?4320:1960*rI(me/1960))-me,10<me){A.timeoutHandle=Nm(Ex.bind(null,A,cu,vp),me);break}Ex(A,cu,vp);break;case 5:Ex(A,cu,vp);break;default:throw Error(n(329))}}}return uu(A,Ee()),A.callbackNode===Q?y6.bind(null,A):null}function Z8(A,M){var Q=Q2;return A.current.memoizedState.isDehydrated&&(jx(A,M).flags|=256),A=v6(A,M),A!==2&&(M=cu,cu=Q,M!==null&&J8(M)),A}function J8(A){cu===null?cu=A:cu.push.apply(cu,A)}function MU(A){for(var M=A;;){if(M.flags&16384){var Q=M.updateQueue;if(Q!==null&&(Q=Q.stores,Q!==null))for(var me=0;me<Q.length;me++){var Pe=Q[me],Ue=Pe.getSnapshot;Pe=Pe.value;try{if(!qt(Ue(),Pe))return!1}catch{return!1}}}if(Q=M.child,M.subtreeFlags&16384&&Q!==null)Q.return=M,M=Q;else{if(M===A)break;for(;M.sibling===null;){if(M.return===null||M.return===A)return!0;M=M.return}M.sibling.return=M.return,M=M.sibling}}return!0}function Bm(A,M){for(M&=~m6,M&=~X2,A.suspendedLanes|=M,A.pingedLanes&=~M,A=A.expirationTimes;0<M;){var Q=31-ue(M),me=1<<Q;A[Q]=-1,M&=~me}}function sI(A){if(qi&6)throw Error(n(327));Z1();var M=Fe(A,0);if(!(M&1))return uu(A,Ee()),null;var Q=v6(A,M);if(A.tag!==0&&Q===2){var me=Ce(A);me!==0&&(M=me,Q=Z8(A,me))}if(Q===1)throw Q=Y2,jx(A,0),Bm(A,M),uu(A,Ee()),Q;if(Q===6)throw Error(n(345));return A.finishedWork=A.current.alternate,A.finishedLanes=M,Ex(A,cu,vp),uu(A,Ee()),null}function e7(A,M){var Q=qi;qi|=1;try{return A(M)}finally{qi=Q,qi===0&&(Nx=Ee()+500,B5&&_m())}}function Ax(A){Lm!==null&&Lm.tag===0&&!(qi&6)&&Z1();var M=qi;qi|=1;var Q=Cd.transition,me=gt;try{if(Cd.transition=null,gt=1,A)return A()}finally{gt=me,Cd.transition=Q,qi=M,!(qi&6)&&_m()}}function t7(){Bu=Q1.current,Ha(Q1)}function jx(A,M){A.finishedWork=null,A.finishedLanes=0;var Q=A.timeoutHandle;if(Q!==-1&&(A.timeoutHandle=-1,_2(Q)),Ho!==null)for(Q=Ho.return;Q!==null;){var me=Q;switch(xx(me),me.tag){case 1:me=me.type.childContextTypes,me!=null&&D5();break;case 3:Im(),Ha(iu),Ha(lc),Y5();break;case 5:K5(me);break;case 4:Im();break;case 13:Ha(Qa);break;case 19:Ha(Qa);break;case 10:V5(me.type._context);break;case 22:case 23:t7()}Q=Q.return}if(Nl=A,Ho=A=pf(A.current,null),Vl=Bu=M,al=0,Y2=null,m6=X2=Mm=0,cu=Q2=null,bx!==null){for(M=0;M<bx.length;M++)if(Q=bx[M],me=Q.interleaved,me!==null){Q.interleaved=null;var Pe=me.next,Ue=Q.pending;if(Ue!==null){var Ct=Ue.next;Ue.next=Pe,me.next=Ct}Q.pending=me}bx=null}return A}function iI(A,M){do{var Q=Ho;try{if(fp(),M2.current=t6,U1){for(var me=lo.memoizedState;me!==null;){var Pe=me.queue;Pe!==null&&(Pe.pending=null),me=me.next}U1=!1}if(Pm=0,il=Po=lo=null,R2=!1,vx=0,K8.current=null,Q===null||Q.return===null){al=1,Y2=M,Ho=null;break}e:{var Ue=A,Ct=Q.return,mn=Q,In=M;if(M=Vl,mn.flags|=32768,In!==null&&typeof In=="object"&&typeof In.then=="function"){var rr=In,Dr=mn,$r=Dr.tag;if(!(Dr.mode&1)&&($r===0||$r===11||$r===15)){var Rr=Dr.alternate;Rr?(Dr.updateQueue=Rr.updateQueue,Dr.memoizedState=Rr.memoizedState,Dr.lanes=Rr.lanes):(Dr.updateQueue=null,Dr.memoizedState=null)}var os=GT(Ct);if(os!==null){os.flags&=-257,M8(os,Ct,mn,Ue,M),os.mode&1&&U2(Ue,rr,M),M=os,In=rr;var ms=M.updateQueue;if(ms===null){var As=new Set;As.add(In),M.updateQueue=As}else ms.add(In);break e}else{if(!(M&1)){U2(Ue,rr,M),n7();break e}In=Error(n(426))}}else if(Va&&mn.mode&1){var wo=GT(Ct);if(wo!==null){!(wo.flags&65536)&&(wo.flags|=256),M8(wo,Ct,mn,Ue,M),Jf(Sx(In,mn));break e}}Ue=In=Sx(In,mn),al!==4&&(al=2),Q2===null?Q2=[Ue]:Q2.push(Ue),Ue=Ct;do{switch(Ue.tag){case 3:Ue.flags|=65536,M&=-M,Ue.lanes|=M;var Xn=$2(Ue,In,M);BT(Ue,Xn);break e;case 1:mn=In;var Bn=Ue.type,Zn=Ue.stateNode;if(!(Ue.flags&128)&&(typeof Bn.getDerivedStateFromError=="function"||Zn!==null&&typeof Zn.componentDidCatch=="function"&&(Rm===null||!Rm.has(Zn)))){Ue.flags|=65536,M&=-M,Ue.lanes|=M;var Wr=a6(Ue,mn,M);BT(Ue,Wr);break e}}Ue=Ue.return}while(Ue!==null)}lI(Q)}catch(js){M=js,Ho===Q&&Q!==null&&(Ho=Q=Q.return);continue}break}while(!0)}function aI(){var A=p6.current;return p6.current=t6,A===null?t6:A}function n7(){(al===0||al===3||al===2)&&(al=4),Nl===null||!(Mm&268435455)&&!(X2&268435455)||Bm(Nl,Vl)}function v6(A,M){var Q=qi;qi|=2;var me=aI();(Nl!==A||Vl!==M)&&(vp=null,jx(A,M));do try{RU();break}catch(Pe){iI(A,Pe)}while(!0);if(fp(),qi=Q,p6.current=me,Ho!==null)throw Error(n(261));return Nl=null,Vl=0,al}function RU(){for(;Ho!==null;)oI(Ho)}function LU(){for(;Ho!==null&&!Lt();)oI(Ho)}function oI(A){var M=uI(A.alternate,A,Bu);A.memoizedProps=A.pendingProps,M===null?lI(A):Ho=M,K8.current=null}function lI(A){var M=A;do{var Q=M.alternate;if(A=M.return,M.flags&32768){if(Q=FU(Q,M),Q!==null){Q.flags&=32767,Ho=Q;return}if(A!==null)A.flags|=32768,A.subtreeFlags=0,A.deletions=null;else{al=6,Ho=null;return}}else if(Q=PU(Q,M,Bu),Q!==null){Ho=Q;return}if(M=M.sibling,M!==null){Ho=M;return}Ho=M=A}while(M!==null);al===0&&(al=5)}function Ex(A,M,Q){var me=gt,Pe=Cd.transition;try{Cd.transition=null,gt=1,DU(A,M,Q,me)}finally{Cd.transition=Pe,gt=me}return null}function DU(A,M,Q,me){do Z1();while(Lm!==null);if(qi&6)throw Error(n(327));Q=A.finishedWork;var Pe=A.finishedLanes;if(Q===null)return null;if(A.finishedWork=null,A.finishedLanes=0,Q===A.current)throw Error(n(177));A.callbackNode=null,A.callbackPriority=0;var Ue=Q.lanes|Q.childLanes;if(nt(A,Ue),A===Nl&&(Ho=Nl=null,Vl=0),!(Q.subtreeFlags&2064)&&!(Q.flags&2064)||g6||(g6=!0,dI(_,function(){return Z1(),null})),Ue=(Q.flags&15990)!==0,Q.subtreeFlags&15990||Ue){Ue=Cd.transition,Cd.transition=null;var Ct=gt;gt=1;var mn=qi;qi|=4,K8.current=null,OU(A,Q),q8(Q,A),ic(fx),gr=!!j2,fx=j2=null,A.current=Q,h6(Q),Fn(),qi=mn,gt=Ct,Cd.transition=Ue}else A.current=Q;if(g6&&(g6=!1,Lm=A,Dc=Pe),Ue=A.pendingLanes,Ue===0&&(Rm=null),te(Q.stateNode),uu(A,Ee()),M!==null)for(me=A.onRecoverableError,Q=0;Q<M.length;Q++)Pe=M[Q],me(Pe.value,{componentStack:Pe.stack,digest:Pe.digest});if(x6)throw x6=!1,A=X8,X8=null,A;return Dc&1&&A.tag!==0&&Z1(),Ue=A.pendingLanes,Ue&1?A===Q8?Z2++:(Z2=0,Q8=A):Z2=0,_m(),null}function Z1(){if(Lm!==null){var A=Jt(Dc),M=Cd.transition,Q=gt;try{if(Cd.transition=null,gt=16>A?16:A,Lm===null)var me=!1;else{if(A=Lm,Lm=null,Dc=0,qi&6)throw Error(n(331));var Pe=qi;for(qi|=4,ds=A.current;ds!==null;){var Ue=ds,Ct=Ue.child;if(ds.flags&16){var mn=Ue.deletions;if(mn!==null){for(var In=0;In<mn.length;In++){var rr=mn[In];for(ds=rr;ds!==null;){var Dr=ds;switch(Dr.tag){case 0:case 11:case 15:yp(8,Dr,Ue)}var $r=Dr.child;if($r!==null)$r.return=Dr,ds=$r;else for(;ds!==null;){Dr=ds;var Rr=Dr.sibling,os=Dr.return;if(JT(Dr),Dr===rr){ds=null;break}if(Rr!==null){Rr.return=os,ds=Rr;break}ds=os}}}var ms=Ue.alternate;if(ms!==null){var As=ms.child;if(As!==null){ms.child=null;do{var wo=As.sibling;As.sibling=null,As=wo}while(As!==null)}}ds=Ue}}if(Ue.subtreeFlags&2064&&Ct!==null)Ct.return=Ue,ds=Ct;else e:for(;ds!==null;){if(Ue=ds,Ue.flags&2048)switch(Ue.tag){case 0:case 11:case 15:yp(9,Ue,Ue.return)}var Xn=Ue.sibling;if(Xn!==null){Xn.return=Ue.return,ds=Xn;break e}ds=Ue.return}}var Bn=A.current;for(ds=Bn;ds!==null;){Ct=ds;var Zn=Ct.child;if(Ct.subtreeFlags&2064&&Zn!==null)Zn.return=Ct,ds=Zn;else e:for(Ct=Bn;ds!==null;){if(mn=ds,mn.flags&2048)try{switch(mn.tag){case 0:case 11:case 15:K2(9,mn)}}catch(js){co(mn,mn.return,js)}if(mn===Ct){ds=null;break e}var Wr=mn.sibling;if(Wr!==null){Wr.return=mn.return,ds=Wr;break e}ds=mn.return}}if(qi=Pe,_m(),q&&typeof q.onPostCommitFiberRoot=="function")try{q.onPostCommitFiberRoot(B,A)}catch{}me=!0}return me}finally{gt=Q,Cd.transition=M}}return!1}function w6(A,M,Q){M=Sx(Q,M),M=$2(A,M,1),A=yd(A,M,1),M=Bc(),A!==null&&(_e(A,1,M),uu(A,M))}function co(A,M,Q){if(A.tag===3)w6(A,A,Q);else for(;M!==null;){if(M.tag===3){w6(M,A,Q);break}else if(M.tag===1){var me=M.stateNode;if(typeof M.type.getDerivedStateFromError=="function"||typeof me.componentDidCatch=="function"&&(Rm===null||!Rm.has(me))){A=Sx(Q,A),A=a6(M,A,1),M=yd(M,A,1),A=Bc(),M!==null&&(_e(M,1,A),uu(M,A));break}}M=M.return}}function BU(A,M,Q){var me=A.pingCache;me!==null&&me.delete(M),M=Bc(),A.pingedLanes|=A.suspendedLanes&Q,Nl===A&&(Vl&Q)===Q&&(al===4||al===3&&(Vl&130023424)===Vl&&500>Ee()-Y8?jx(A,0):m6|=Q),uu(A,M)}function cI(A,M){M===0&&(A.mode&1?(M=Me,Me<<=1,!(Me&130023424)&&(Me=4194304)):M=1);var Q=Bc();A=hp(A,M),A!==null&&(_e(A,M,Q),uu(A,Q))}function $U(A){var M=A.memoizedState,Q=0;M!==null&&(Q=M.retryLane),cI(A,Q)}function UU(A,M){var Q=0;switch(A.tag){case 13:var me=A.stateNode,Pe=A.memoizedState;Pe!==null&&(Q=Pe.retryLane);break;case 19:me=A.stateNode;break;default:throw Error(n(314))}me!==null&&me.delete(M),cI(A,Q)}var uI;uI=function(A,M,Q){if(A!==null)if(A.memoizedProps!==M.pendingProps||iu.current)Rc=!0;else{if(!(A.lanes&Q)&&!(M.flags&128))return Rc=!1,XT(A,M,Q);Rc=!!(A.flags&131072)}else Rc=!1,Va&&M.flags&1048576&&OT(M,U5,M.index);switch(M.lanes=0,M.tag){case 2:var me=M.type;c6(A,M),A=M.pendingProps;var Pe=R1(M,lc.current);Tm(M,Q),Pe=wx(null,M,me,A,Pe,Q);var Ue=X5();return M.flags|=1,typeof Pe=="object"&&Pe!==null&&typeof Pe.render=="function"&&Pe.$$typeof===void 0?(M.tag=1,M.memoizedState=null,M.updateQueue=null,au(me)?(Ue=!0,pd(M)):Ue=!1,M.memoizedState=Pe.state!==null&&Pe.state!==void 0?Pe.state:null,q5(M),Pe.updater=s6,M.stateNode=Pe,Pe._reactInternals=M,O8(M,me,A,Q),M=U8(null,M,me,!0,Ue,Q)):(M.tag=0,Va&&Ue&&k2(M),Ul(null,M,Pe,Q),M=M.child),M;case 16:me=M.elementType;e:{switch(c6(A,M),A=M.pendingProps,Pe=me._init,me=Pe(me._payload),M.type=me,Pe=M.tag=HU(me),A=wd(me,A),Pe){case 0:M=B8(null,M,me,A,Q);break e;case 1:M=$8(null,M,me,A,Q);break e;case 11:M=KT(null,M,me,A,Q);break e;case 14:M=R8(null,M,me,wd(me.type,A),Q);break e}throw Error(n(306,me,""))}return M;case 0:return me=M.type,Pe=M.pendingProps,Pe=M.elementType===me?Pe:wd(me,Pe),B8(A,M,me,Pe,Q);case 1:return me=M.type,Pe=M.pendingProps,Pe=M.elementType===me?Pe:wd(me,Pe),$8(A,M,me,Pe,Q);case 3:e:{if(YT(M),A===null)throw Error(n(387));me=M.pendingProps,Ue=M.memoizedState,Pe=Ue.element,DT(A,M),B1(M,me,null,Q);var Ct=M.memoizedState;if(me=Ct.element,Ue.isDehydrated)if(Ue={element:me,isDehydrated:!1,cache:Ct.cache,pendingSuspenseBoundaries:Ct.pendingSuspenseBoundaries,transitions:Ct.transitions},M.updateQueue.baseState=Ue,M.memoizedState=Ue,M.flags&256){Pe=Sx(Error(n(423)),M),M=sh(A,M,me,Q,Pe);break e}else if(me!==Pe){Pe=Sx(Error(n(424)),M),M=sh(A,M,me,Q,Pe);break e}else for(Ru=Am(M.stateNode.containerInfo.firstChild),uc=M,Va=!0,of=null,Q=H5(M,null,me,Q),M.child=Q;Q;)Q.flags=Q.flags&-3|4096,Q=Q.sibling;else{if(Zf(),me===Pe){M=cf(A,M,Q);break e}Ul(A,M,me,Q)}M=M.child}return M;case 5:return w8(M),A===null&&ou(M),me=M.type,Pe=M.pendingProps,Ue=A!==null?A.memoizedProps:null,Ct=Pe.children,E2(me,Pe)?Ct=null:Ue!==null&&E2(me,Ue)&&(M.flags|=32),D8(A,M),Ul(A,M,Ct,Q),M.child;case 6:return A===null&&ou(M),null;case 13:return l6(A,M,Q);case 4:return v8(M,M.stateNode.containerInfo),me=M.pendingProps,A===null?M.child=vo(M,null,me,Q):Ul(A,M,me,Q),M.child;case 11:return me=M.type,Pe=M.pendingProps,Pe=M.elementType===me?Pe:wd(me,Pe),KT(A,M,me,Pe,Q);case 7:return Ul(A,M,M.pendingProps,Q),M.child;case 8:return Ul(A,M,M.pendingProps.children,Q),M.child;case 12:return Ul(A,M,M.pendingProps.children,Q),M.child;case 10:e:{if(me=M.type._context,Pe=M.pendingProps,Ue=M.memoizedProps,Ct=Pe.value,Ra(P2,me._currentValue),me._currentValue=Ct,Ue!==null)if(qt(Ue.value,Ct)){if(Ue.children===Pe.children&&!iu.current){M=cf(A,M,Q);break e}}else for(Ue=M.child,Ue!==null&&(Ue.return=M);Ue!==null;){var mn=Ue.dependencies;if(mn!==null){Ct=Ue.child;for(var In=mn.firstContext;In!==null;){if(In.context===me){if(Ue.tag===1){In=pp(-1,Q&-Q),In.tag=2;var rr=Ue.updateQueue;if(rr!==null){rr=rr.shared;var Dr=rr.pending;Dr===null?In.next=In:(In.next=Dr.next,Dr.next=In),rr.pending=In}}Ue.lanes|=Q,In=Ue.alternate,In!==null&&(In.lanes|=Q),$l(Ue.return,Q,M),mn.lanes|=Q;break}In=In.next}}else if(Ue.tag===10)Ct=Ue.type===M.type?null:Ue.child;else if(Ue.tag===18){if(Ct=Ue.return,Ct===null)throw Error(n(341));Ct.lanes|=Q,mn=Ct.alternate,mn!==null&&(mn.lanes|=Q),$l(Ct,Q,M),Ct=Ue.sibling}else Ct=Ue.child;if(Ct!==null)Ct.return=Ue;else for(Ct=Ue;Ct!==null;){if(Ct===M){Ct=null;break}if(Ue=Ct.sibling,Ue!==null){Ue.return=Ct.return,Ct=Ue;break}Ct=Ct.return}Ue=Ct}Ul(A,M,Pe.children,Q),M=M.child}return M;case 9:return Pe=M.type,me=M.pendingProps.children,Tm(M,Q),Pe=gd(Pe),me=me(Pe),M.flags|=1,Ul(A,M,me,Q),M.child;case 14:return me=M.type,Pe=wd(me,M.pendingProps),Pe=wd(me.type,Pe),R8(A,M,me,Pe,Q);case 15:return rh(A,M,M.type,M.pendingProps,Q);case 17:return me=M.type,Pe=M.pendingProps,Pe=M.elementType===me?Pe:wd(me,Pe),c6(A,M),M.tag=1,au(me)?(A=!0,pd(M)):A=!1,Tm(M,Q),Cx(M,me,Pe),O8(M,me,Pe,Q),U8(null,M,me,!0,A,Q);case 19:return Fm(A,M,Q);case 22:return L8(A,M,Q)}throw Error(n(156,M.tag))};function dI(A,M){return zn(A,M)}function zU(A,M,Q,me){this.tag=A,this.key=Q,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=M,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=me,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Sd(A,M,Q,me){return new zU(A,M,Q,me)}function C6(A){return A=A.prototype,!(!A||!A.isReactComponent)}function HU(A){if(typeof A=="function")return C6(A)?1:0;if(A!=null){if(A=A.$$typeof,A===Z)return 11;if(A===Y)return 14}return 2}function pf(A,M){var Q=A.alternate;return Q===null?(Q=Sd(A.tag,M,A.key,A.mode),Q.elementType=A.elementType,Q.type=A.type,Q.stateNode=A.stateNode,Q.alternate=A,A.alternate=Q):(Q.pendingProps=M,Q.type=A.type,Q.flags=0,Q.subtreeFlags=0,Q.deletions=null),Q.flags=A.flags&14680064,Q.childLanes=A.childLanes,Q.lanes=A.lanes,Q.child=A.child,Q.memoizedProps=A.memoizedProps,Q.memoizedState=A.memoizedState,Q.updateQueue=A.updateQueue,M=A.dependencies,Q.dependencies=M===null?null:{lanes:M.lanes,firstContext:M.firstContext},Q.sibling=A.sibling,Q.index=A.index,Q.ref=A.ref,Q}function S6(A,M,Q,me,Pe,Ue){var Ct=2;if(me=A,typeof A=="function")C6(A)&&(Ct=1);else if(typeof A=="string")Ct=5;else e:switch(A){case L:return _x(Q.children,Pe,Ue,M);case z:Ct=8,Pe|=8;break;case X:return A=Sd(12,Q,M,Pe|2),A.elementType=X,A.lanes=Ue,A;case re:return A=Sd(13,Q,M,Pe),A.elementType=re,A.lanes=Ue,A;case he:return A=Sd(19,Q,M,Pe),A.elementType=he,A.lanes=Ue,A;case oe:return N6(Q,Pe,Ue,M);default:if(typeof A=="object"&&A!==null)switch(A.$$typeof){case ne:Ct=10;break e;case J:Ct=9;break e;case Z:Ct=11;break e;case Y:Ct=14;break e;case ie:Ct=16,me=null;break e}throw Error(n(130,A==null?A:typeof A,""))}return M=Sd(Ct,Q,M,Pe),M.elementType=A,M.type=me,M.lanes=Ue,M}function _x(A,M,Q,me){return A=Sd(7,A,me,M),A.lanes=Q,A}function N6(A,M,Q,me){return A=Sd(22,A,me,M),A.elementType=oe,A.lanes=Q,A.stateNode={isHidden:!1},A}function r7(A,M,Q){return A=Sd(6,A,null,M),A.lanes=Q,A}function s7(A,M,Q){return M=Sd(4,A.children!==null?A.children:[],A.key,M),M.lanes=Q,M.stateNode={containerInfo:A.containerInfo,pendingChildren:null,implementation:A.implementation},M}function VU(A,M,Q,me,Pe){this.tag=M,this.containerInfo=A,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Le(0),this.expirationTimes=Le(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Le(0),this.identifierPrefix=me,this.onRecoverableError=Pe,this.mutableSourceEagerHydrationData=null}function i7(A,M,Q,me,Pe,Ue,Ct,mn,In){return A=new VU(A,M,Q,mn,In),M===1?(M=1,Ue===!0&&(M|=8)):M=0,Ue=Sd(3,null,null,M),A.current=Ue,Ue.stateNode=A,Ue.memoizedState={element:me,isDehydrated:Q,cache:null,transitions:null,pendingSuspenseBoundaries:null},q5(Ue),A}function WU(A,M,Q){var me=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:U,key:me==null?null:""+me,children:A,containerInfo:M,implementation:Q}}function fI(A){if(!A)return Em;A=A._reactInternals;e:{if(an(A)!==A||A.tag!==1)throw Error(n(170));var M=A;do{switch(M.tag){case 3:M=M.stateNode.context;break e;case 1:if(au(M.type)){M=M.stateNode.__reactInternalMemoizedMergedChildContext;break e}}M=M.return}while(M!==null);throw Error(n(171))}if(A.tag===1){var Q=A.type;if(au(Q))return IT(A,Q,M)}return M}function hI(A,M,Q,me,Pe,Ue,Ct,mn,In){return A=i7(Q,me,!0,A,Pe,Ue,Ct,mn,In),A.context=fI(null),Q=A.current,me=Bc(),Pe=Dm(Q),Ue=pp(me,Pe),Ue.callback=M??null,yd(Q,Ue,Pe),A.current.lanes=Pe,_e(A,Pe,me),uu(A,me),A}function A6(A,M,Q,me){var Pe=M.current,Ue=Bc(),Ct=Dm(Pe);return Q=fI(Q),M.context===null?M.context=Q:M.pendingContext=Q,M=pp(Ue,Ct),M.payload={element:A},me=me===void 0?null:me,me!==null&&(M.callback=me),A=yd(Pe,M,Ct),A!==null&&(hf(A,Pe,Ct,Ue),G5(A,Pe,Ct)),Ct}function j6(A){if(A=A.current,!A.child)return null;switch(A.child.tag){case 5:return A.child.stateNode;default:return A.child.stateNode}}function pI(A,M){if(A=A.memoizedState,A!==null&&A.dehydrated!==null){var Q=A.retryLane;A.retryLane=Q!==0&&Q<M?Q:M}}function a7(A,M){pI(A,M),(A=A.alternate)&&pI(A,M)}var mI=typeof reportError=="function"?reportError:function(A){console.error(A)};function o7(A){this._internalRoot=A}ev.prototype.render=o7.prototype.render=function(A){var M=this._internalRoot;if(M===null)throw Error(n(409));A6(A,M,null,null)},ev.prototype.unmount=o7.prototype.unmount=function(){var A=this._internalRoot;if(A!==null){this._internalRoot=null;var M=A.containerInfo;Ax(function(){A6(null,A,null,null)}),M[Mu]=null}};function ev(A){this._internalRoot=A}ev.prototype.unstable_scheduleHydration=function(A){if(A){var M=wt();A={blockedOn:null,target:A,priority:M};for(var Q=0;Q<Zt.length&&M!==0&&M<Zt[Q].priority;Q++);Zt.splice(Q,0,A),Q===0&&fr(A)}};function E6(A){return!(!A||A.nodeType!==1&&A.nodeType!==9&&A.nodeType!==11)}function _6(A){return!(!A||A.nodeType!==1&&A.nodeType!==9&&A.nodeType!==11&&(A.nodeType!==8||A.nodeValue!==" react-mount-point-unstable "))}function xI(){}function qU(A,M,Q,me,Pe){if(Pe){if(typeof me=="function"){var Ue=me;me=function(){var rr=j6(Ct);Ue.call(rr)}}var Ct=hI(M,me,A,0,null,!1,!1,"",xI);return A._reactRootContainer=Ct,A[Mu]=Ct.current,Sm(A.nodeType===8?A.parentNode:A),Ax(),Ct}for(;Pe=A.lastChild;)A.removeChild(Pe);if(typeof me=="function"){var mn=me;me=function(){var rr=j6(In);mn.call(rr)}}var In=i7(A,0,!1,null,null,!1,!1,"",xI);return A._reactRootContainer=In,A[Mu]=In.current,Sm(A.nodeType===8?A.parentNode:A),Ax(function(){A6(M,In,Q,me)}),In}function k6(A,M,Q,me,Pe){var Ue=Q._reactRootContainer;if(Ue){var Ct=Ue;if(typeof Pe=="function"){var mn=Pe;Pe=function(){var In=j6(Ct);mn.call(In)}}A6(M,Ct,A,Pe)}else Ct=qU(Q,M,A,Pe,me);return j6(Ct)}Ge=function(A){switch(A.tag){case 3:var M=A.stateNode;if(M.current.memoizedState.isDehydrated){var Q=Ye(M.pendingLanes);Q!==0&&(ot(M,Q|1),uu(M,Ee()),!(qi&6)&&(Nx=Ee()+500,_m()))}break;case 13:Ax(function(){var me=hp(A,1);if(me!==null){var Pe=Bc();hf(me,A,1,Pe)}}),a7(A,1)}},et=function(A){if(A.tag===13){var M=hp(A,134217728);if(M!==null){var Q=Bc();hf(M,A,134217728,Q)}a7(A,134217728)}},We=function(A){if(A.tag===13){var M=Dm(A),Q=hp(A,M);if(Q!==null){var me=Bc();hf(Q,A,M,me)}a7(A,M)}},wt=function(){return gt},St=function(A,M){var Q=gt;try{return gt=A,M()}finally{gt=Q}},Nt=function(A,M,Q){switch(M){case"input":if(ct(A,Q),M=Q.name,Q.type==="radio"&&M!=null){for(Q=A;Q.parentNode;)Q=Q.parentNode;for(Q=Q.querySelectorAll("input[name="+JSON.stringify(""+M)+'][type="radio"]'),M=0;M<Q.length;M++){var me=Q[M];if(me!==A&&me.form===A.form){var Pe=L5(me);if(!Pe)throw Error(n(90));Be(me),ct(me,Pe)}}}break;case"textarea":Pt(A,Q);break;case"select":M=Q.value,M!=null&&jt(A,!!Q.multiple,M,!1)}},kn=e7,vn=Ax;var T6={usingClientEntryPoint:!1,Events:[oc,bi,L5,Mn,_n,e7]},tv={findFiberByHostInstance:Kf,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},GU={bundleType:tv.bundleType,version:tv.version,rendererPackageName:tv.rendererPackageName,rendererConfig:tv.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:R.ReactCurrentDispatcher,findHostInstanceByFiber:function(A){return A=tr(A),A===null?null:A.stateNode},findFiberByHostInstance:tv.findFiberByHostInstance,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var I6=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!I6.isDisabled&&I6.supportsFiber)try{B=I6.inject(GU),q=I6}catch{}}return Ed.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T6,Ed.createPortal=function(A,M){var Q=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!E6(M))throw Error(n(200));return WU(A,M,null,Q)},Ed.createRoot=function(A,M){if(!E6(A))throw Error(n(299));var Q=!1,me="",Pe=mI;return M!=null&&(M.unstable_strictMode===!0&&(Q=!0),M.identifierPrefix!==void 0&&(me=M.identifierPrefix),M.onRecoverableError!==void 0&&(Pe=M.onRecoverableError)),M=i7(A,1,!1,null,null,Q,!1,me,Pe),A[Mu]=M.current,Sm(A.nodeType===8?A.parentNode:A),new o7(M)},Ed.findDOMNode=function(A){if(A==null)return null;if(A.nodeType===1)return A;var M=A._reactInternals;if(M===void 0)throw typeof A.render=="function"?Error(n(188)):(A=Object.keys(A).join(","),Error(n(268,A)));return A=tr(M),A=A===null?null:A.stateNode,A},Ed.flushSync=function(A){return Ax(A)},Ed.hydrate=function(A,M,Q){if(!_6(M))throw Error(n(200));return k6(null,A,M,!0,Q)},Ed.hydrateRoot=function(A,M,Q){if(!E6(A))throw Error(n(405));var me=Q!=null&&Q.hydratedSources||null,Pe=!1,Ue="",Ct=mI;if(Q!=null&&(Q.unstable_strictMode===!0&&(Pe=!0),Q.identifierPrefix!==void 0&&(Ue=Q.identifierPrefix),Q.onRecoverableError!==void 0&&(Ct=Q.onRecoverableError)),M=hI(M,null,A,1,Q??null,Pe,!1,Ue,Ct),A[Mu]=M.current,Sm(A),me)for(A=0;A<me.length;A++)Q=me[A],Pe=Q._getVersion,Pe=Pe(Q._source),M.mutableSourceEagerHydrationData==null?M.mutableSourceEagerHydrationData=[Q,Pe]:M.mutableSourceEagerHydrationData.push(Q,Pe);return new ev(M)},Ed.render=function(A,M,Q){if(!_6(M))throw Error(n(200));return k6(null,A,M,!1,Q)},Ed.unmountComponentAtNode=function(A){if(!_6(A))throw Error(n(40));return A._reactRootContainer?(Ax(function(){k6(null,null,A,!1,function(){A._reactRootContainer=null,A[Mu]=null})}),!0):!1},Ed.unstable_batchedUpdates=e7,Ed.unstable_renderSubtreeIntoContainer=function(A,M,Q,me){if(!_6(Q))throw Error(n(200));if(A==null||A._reactInternals===void 0)throw Error(n(38));return k6(A,M,Q,!1,me)},Ed.version="18.3.1-next-f1338f8080-20240426",Ed}var wde;function PNe(){if(wde)return cz.exports;wde=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),cz.exports=QGe(),cz.exports}var Cde;function ZGe(){if(Cde)return vI;Cde=1;var e=PNe();return vI.createRoot=e.createRoot,vI.hydrateRoot=e.hydrateRoot,vI}var FNe=ZGe(),m=tx();const Se=ji(m),Ey=INe({__proto__:null,default:Se},[m]);var Ia=PNe();const yre=ji(Ia);/**
 * @remix-run/router v1.19.2
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function g9(){return g9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},g9.apply(this,arguments)}var iy;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(iy||(iy={}));const Sde="popstate";function JGe(e){e===void 0&&(e={});function t(r,s){let{pathname:a,search:o,hash:l}=r.location;return oQ("",{pathname:a,search:o,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:FO(s)}return tKe(t,n,null,e)}function Bo(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ONe(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function eKe(){return Math.random().toString(36).substr(2,8)}function Nde(e,t){return{usr:e.state,key:e.key,idx:t}}function oQ(e,t,n,r){return n===void 0&&(n=null),g9({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?QN(t):t,{state:n,key:t&&t.key||r||eKe()})}function FO(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function QN(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function tKe(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:a=!1}=r,o=s.history,l=iy.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(g9({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=iy.Pop;let C=d(),N=C==null?null:C-u;u=C,c&&c({action:l,location:w.location,delta:N})}function x(C,N){l=iy.Push;let I=oQ(w.location,C,N);u=d()+1;let P=Nde(I,u),R=w.createHref(I);try{o.pushState(P,"",R)}catch(F){if(F instanceof DOMException&&F.name==="DataCloneError")throw F;s.location.assign(R)}a&&c&&c({action:l,location:w.location,delta:1})}function g(C,N){l=iy.Replace;let I=oQ(w.location,C,N);u=d();let P=Nde(I,u),R=w.createHref(I);o.replaceState(P,"",R),a&&c&&c({action:l,location:w.location,delta:0})}function v(C){let N=s.location.origin!=="null"?s.location.origin:s.location.href,I=typeof C=="string"?C:FO(C);return I=I.replace(/ $/,"%20"),Bo(N,"No window.location.(origin|href) available to create URL for href: "+I),new URL(I,N)}let w={get action(){return l},get location(){return e(s,o)},listen(C){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(Sde,f),c=C,()=>{s.removeEventListener(Sde,f),c=null}},createHref(C){return t(s,C)},createURL:v,encodeLocation(C){let N=v(C);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:x,replace:g,go(C){return o.go(C)}};return w}var Ade;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ade||(Ade={}));function nKe(e,t,n){return n===void 0&&(n="/"),rKe(e,t,n)}function rKe(e,t,n,r){let s=typeof t=="string"?QN(t):t,a=vS(s.pathname||"/",n);if(a==null)return null;let o=MNe(e);sKe(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=mKe(a);l=hKe(o[c],u)}return l}function MNe(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(a,o,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(Bo(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=xy([r,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(Bo(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),MNe(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:dKe(u,a.index),routesMeta:d})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))s(a,o);else for(let c of RNe(a.path))s(a,o,c)}),t}function RNe(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return s?[a,""]:[a];let o=RNe(r.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),s&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function sKe(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:fKe(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const iKe=/^:[\w-]+$/,aKe=3,oKe=2,lKe=1,cKe=10,uKe=-2,jde=e=>e==="*";function dKe(e,t){let n=e.split("/"),r=n.length;return n.some(jde)&&(r+=uKe),t&&(r+=oKe),n.filter(s=>!jde(s)).reduce((s,a)=>s+(iKe.test(a)?aKe:a===""?lKe:cKe),r)}function fKe(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function hKe(e,t,n){let{routesMeta:r}=e,s={},a="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,d=a==="/"?t:t.slice(a.length)||"/",f=lQ({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),x=c.route;if(!f)return null;Object.assign(s,f.params),o.push({params:s,pathname:xy([a,f.pathname]),pathnameBase:yKe(xy([a,f.pathnameBase])),route:x}),f.pathnameBase!=="/"&&(a=xy([a,f.pathnameBase]))}return o}function lQ(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=pKe(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let a=s[0],o=a.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:x,isOptional:g}=d;if(x==="*"){let w=l[f]||"";o=a.slice(0,a.length-w.length).replace(/(.)\/+$/,"$1")}const v=l[f];return g&&!v?u[x]=void 0:u[x]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function pKe(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ONe(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function mKe(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ONe(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function vS(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function xKe(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?QN(e):e;return{pathname:n?n.startsWith("/")?n:gKe(n,t):t,search:vKe(r),hash:wKe(s)}}function gKe(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function fz(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"].  Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function bKe(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function vre(e,t){let n=bKe(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function wre(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=QN(e):(s=g9({},e),Bo(!s.pathname||!s.pathname.includes("?"),fz("?","pathname","search",s)),Bo(!s.pathname||!s.pathname.includes("#"),fz("#","pathname","hash",s)),Bo(!s.search||!s.search.includes("#"),fz("#","search","hash",s)));let a=e===""||s.pathname==="",o=a?"/":s.pathname,l;if(o==null)l=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let x=o.split("/");for(;x[0]==="..";)x.shift(),f-=1;s.pathname=x.join("/")}l=f>=0?t[f]:"/"}let c=xKe(s,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const xy=e=>e.join("/").replace(/\/\/+/g,"/"),yKe=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),vKe=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,wKe=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function CKe(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const LNe=["post","put","patch","delete"];new Set(LNe);const SKe=["get",...LNe];new Set(SKe);/**
 * React Router v6.26.2
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function b9(){return b9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},b9.apply(this,arguments)}const xD=m.createContext(null),DNe=m.createContext(null),p1=m.createContext(null),gD=m.createContext(null),nx=m.createContext({outlet:null,matches:[],isDataRoute:!1}),BNe=m.createContext(null);function NKe(e,t){let{relative:n}=t===void 0?{}:t;ZN()||Bo(!1);let{basename:r,navigator:s}=m.useContext(p1),{hash:a,pathname:o,search:l}=bD(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:xy([r,o])),s.createHref({pathname:c,search:l,hash:a})}function ZN(){return m.useContext(gD)!=null}function Ic(){return ZN()||Bo(!1),m.useContext(gD).location}function $Ne(e){m.useContext(p1).static||m.useLayoutEffect(e)}function nl(){let{isDataRoute:e}=m.useContext(nx);return e?BKe():AKe()}function AKe(){ZN()||Bo(!1);let e=m.useContext(xD),{basename:t,future:n,navigator:r}=m.useContext(p1),{matches:s}=m.useContext(nx),{pathname:a}=Ic(),o=JSON.stringify(vre(s,n.v7_relativeSplatPath)),l=m.useRef(!1);return $Ne(()=>{l.current=!0}),m.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=wre(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:xy([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,a,e])}const jKe=m.createContext(null);function EKe(e){let t=m.useContext(nx).outlet;return t&&m.createElement(jKe.Provider,{value:e},t)}function Z3(){let{matches:e}=m.useContext(nx),t=e[e.length-1];return t?t.params:{}}function bD(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(p1),{matches:s}=m.useContext(nx),{pathname:a}=Ic(),o=JSON.stringify(vre(s,r.v7_relativeSplatPath));return m.useMemo(()=>wre(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function _Ke(e,t){return kKe(e,t)}function kKe(e,t,n,r){ZN()||Bo(!1);let{navigator:s}=m.useContext(p1),{matches:a}=m.useContext(nx),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=Ic(),d;if(t){var f;let C=typeof t=="string"?QN(t):t;c==="/"||(f=C.pathname)!=null&&f.startsWith(c)||Bo(!1),d=C}else d=u;let x=d.pathname||"/",g=x;if(c!=="/"){let C=c.replace(/^\//,"").split("/");g="/"+x.replace(/^\//,"").split("/").slice(C.length).join("/")}let v=nKe(e,{pathname:g}),w=OKe(v&&v.map(C=>Object.assign({},C,{params:Object.assign({},l,C.params),pathname:xy([c,s.encodeLocation?s.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?c:xy([c,s.encodeLocation?s.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),a,n,r);return t&&w?m.createElement(gD.Provider,{value:{location:b9({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:iy.Pop}},w):w}function TKe(){let e=DKe(),t=CKe(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:s},n):null,null)}const IKe=m.createElement(TKe,null);class PKe extends m.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?m.createElement(nx.Provider,{value:this.props.routeContext},m.createElement(BNe.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function FKe(e){let{routeContext:t,match:n,children:r}=e,s=m.useContext(xD);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(nx.Provider,{value:t},r)}function OKe(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(s=n)==null?void 0:s.errors;if(l!=null){let d=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||Bo(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:x,errors:g}=n,v=f.route.loader&&x[f.route.id]===void 0&&(!g||g[f.route.id]===void 0);if(f.route.lazy||v){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,x)=>{let g,v=!1,w=null,C=null;n&&(g=l&&f.route.id?l[f.route.id]:void 0,w=f.route.errorElement||IKe,c&&(u<0&&x===0?(v=!0,C=null):u===x&&(v=!0,C=f.route.hydrateFallbackElement||null)));let N=t.concat(o.slice(0,x+1)),I=()=>{let P;return g?P=w:v?P=C:f.route.Component?P=m.createElement(f.route.Component,null):f.route.element?P=f.route.element:P=d,m.createElement(FKe,{match:f,routeContext:{outlet:d,matches:N,isDataRoute:n!=null},children:P})};return n&&(f.route.ErrorBoundary||f.route.errorElement||x===0)?m.createElement(PKe,{location:n.location,revalidation:n.revalidation,component:w,error:g,children:I(),routeContext:{outlet:null,matches:N,isDataRoute:!0}}):I()},null)}var UNe=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(UNe||{}),OO=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(OO||{});function MKe(e){let t=m.useContext(xD);return t||Bo(!1),t}function RKe(e){let t=m.useContext(DNe);return t||Bo(!1),t}function LKe(e){let t=m.useContext(nx);return t||Bo(!1),t}function zNe(e){let t=LKe(),n=t.matches[t.matches.length-1];return n.route.id||Bo(!1),n.route.id}function DKe(){var e;let t=m.useContext(BNe),n=RKe(OO.UseRouteError),r=zNe(OO.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function BKe(){let{router:e}=MKe(UNe.UseNavigateStable),t=zNe(OO.UseNavigateStable),n=m.useRef(!1);return $Ne(()=>{n.current=!0}),m.useCallback(function(s,a){a===void 0&&(a={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,b9({fromRouteId:t},a)))},[e,t])}function Ede(e){let{to:t,replace:n,state:r,relative:s}=e;ZN()||Bo(!1);let{future:a,static:o}=m.useContext(p1),{matches:l}=m.useContext(nx),{pathname:c}=Ic(),u=nl(),d=wre(t,vre(l,a.v7_relativeSplatPath),c,s==="path"),f=JSON.stringify(d);return m.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:s}),[u,f,s,n,r]),null}function $Ke(e){return EKe(e.context)}function ba(e){Bo(!1)}function UKe(e){let{basename:t="/",children:n=null,location:r,navigationType:s=iy.Pop,navigator:a,static:o=!1,future:l}=e;ZN()&&Bo(!1);let c=t.replace(/^\/*/,"/"),u=m.useMemo(()=>({basename:c,navigator:a,static:o,future:b9({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof r=="string"&&(r=QN(r));let{pathname:d="/",search:f="",hash:x="",state:g=null,key:v="default"}=r,w=m.useMemo(()=>{let C=vS(d,c);return C==null?null:{location:{pathname:C,search:f,hash:x,state:g,key:v},navigationType:s}},[c,d,f,x,g,v,s]);return w==null?null:m.createElement(p1.Provider,{value:u},m.createElement(gD.Provider,{children:n,value:w}))}function zKe(e){let{children:t,location:n}=e;return _Ke(cQ(t),n)}new Promise(()=>{});function cQ(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(r,s)=>{if(!m.isValidElement(r))return;let a=[...t,s];if(r.type===m.Fragment){n.push.apply(n,cQ(r.props.children,a));return}r.type!==ba&&Bo(!1),!r.props.index||!r.props.children||Bo(!1);let o={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=cQ(r.props.children,a)),n.push(o)}),n}/**
 * React Router DOM v6.26.2
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function MO(){return MO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},MO.apply(this,arguments)}function HNe(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function HKe(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function VKe(e,t){return e.button===0&&(!t||t==="_self")&&!HKe(e)}function uQ(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function WKe(e,t){let n=uQ(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(a=>{n.append(s,a)})}),n}const qKe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],GKe=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],KKe="6";try{window.__reactRouterVersion=KKe}catch{}const YKe=m.createContext({isTransitioning:!1}),XKe="startTransition",_de=Ey[XKe];function QKe(e){let{basename:t,children:n,future:r,window:s}=e,a=m.useRef();a.current==null&&(a.current=JGe({window:s,v5Compat:!0}));let o=a.current,[l,c]=m.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=m.useCallback(f=>{u&&_de?_de(()=>c(f)):c(f)},[c,u]);return m.useLayoutEffect(()=>o.listen(d),[o,d]),m.createElement(UKe,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const ZKe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",JKe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ul=m.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:d,unstable_viewTransition:f}=t,x=HNe(t,qKe),{basename:g}=m.useContext(p1),v,w=!1;if(typeof u=="string"&&JKe.test(u)&&(v=u,ZKe))try{let P=new URL(window.location.href),R=u.startsWith("//")?new URL(P.protocol+u):new URL(u),F=vS(R.pathname,g);R.origin===P.origin&&F!=null?u=F+R.search+R.hash:w=!0}catch{}let C=NKe(u,{relative:s}),N=tYe(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:s,unstable_viewTransition:f});function I(P){r&&r(P),P.defaultPrevented||N(P)}return m.createElement("a",MO({},x,{href:v||C,onClick:w||a?r:I,ref:n,target:c}))}),kde=m.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:s=!1,className:a="",end:o=!1,style:l,to:c,unstable_viewTransition:u,children:d}=t,f=HNe(t,GKe),x=bD(c,{relative:f.relative}),g=Ic(),v=m.useContext(DNe),{navigator:w,basename:C}=m.useContext(p1),N=v!=null&&nYe(x)&&u===!0,I=w.encodeLocation?w.encodeLocation(x).pathname:x.pathname,P=g.pathname,R=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;s||(P=P.toLowerCase(),R=R?R.toLowerCase():null,I=I.toLowerCase()),R&&C&&(R=vS(R,C)||R);const F=I!=="/"&&I.endsWith("/")?I.length-1:I.length;let U=P===I||!o&&P.startsWith(I)&&P.charAt(F)==="/",L=R!=null&&(R===I||!o&&R.startsWith(I)&&R.charAt(I.length)==="/"),z={isActive:U,isPending:L,isTransitioning:N},X=U?r:void 0,ne;typeof a=="function"?ne=a(z):ne=[a,U?"active":null,L?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let J=typeof l=="function"?l(z):l;return m.createElement(ul,MO({},f,{"aria-current":X,className:ne,ref:n,style:J,to:c,unstable_viewTransition:u}),typeof d=="function"?d(z):d)});var dQ;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(dQ||(dQ={}));var Tde;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Tde||(Tde={}));function eYe(e){let t=m.useContext(xD);return t||Bo(!1),t}function tYe(e,t){let{target:n,replace:r,state:s,preventScrollReset:a,relative:o,unstable_viewTransition:l}=t===void 0?{}:t,c=nl(),u=Ic(),d=bD(e,{relative:o});return m.useCallback(f=>{if(VKe(f,n)){f.preventDefault();let x=r!==void 0?r:FO(u)===FO(d);c(e,{replace:x,state:s,preventScrollReset:a,relative:o,unstable_viewTransition:l})}},[u,c,d,r,s,n,e,a,o,l])}function VNe(e){let t=m.useRef(uQ(e)),n=m.useRef(!1),r=Ic(),s=m.useMemo(()=>WKe(r.search,n.current?null:t.current),[r.search]),a=nl(),o=m.useCallback((l,c)=>{const u=uQ(typeof l=="function"?l(s):l);n.current=!0,a("?"+u,c)},[a,s]);return[s,o]}function nYe(e,t){t===void 0&&(t={});let n=m.useContext(YKe);n==null&&Bo(!1);let{basename:r}=eYe(dQ.useViewTransitionState),s=bD(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=vS(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=vS(n.nextLocation.pathname,r)||n.nextLocation.pathname;return lQ(s.pathname,o)!=null||lQ(s.pathname,a)!=null}let rYe={data:""},sYe=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||rYe,iYe=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,aYe=/\/\*[^]*?\*\/|  +/g,Ide=/\n+/g,Eb=(e,t)=>{let n="",r="",s="";for(let a in e){let o=e[a];a[0]=="@"?a[1]=="i"?n=a+" "+o+";":r+=a[1]=="f"?Eb(o,a):a+"{"+Eb(o,a[1]=="k"?"":t)+"}":typeof o=="object"?r+=Eb(o,t?t.replace(/([^,])+/g,l=>a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):a):o!=null&&(a=/^--/.test(a)?a:a.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=Eb.p?Eb.p(a,o):a+":"+o+";")}return n+(t&&s?t+"{"+s+"}":s)+r},Px={},WNe=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+WNe(e[n]);return t}return e},oYe=(e,t,n,r,s)=>{let a=WNe(e),o=Px[a]||(Px[a]=(c=>{let u=0,d=11;for(;u<c.length;)d=101*d+c.charCodeAt(u++)>>>0;return"go"+d})(a));if(!Px[o]){let c=a!==e?e:(u=>{let d,f,x=[{}];for(;d=iYe.exec(u.replace(aYe,""));)d[4]?x.shift():d[3]?(f=d[3].replace(Ide," ").trim(),x.unshift(x[0][f]=x[0][f]||{})):x[0][d[1]]=d[2].replace(Ide," ").trim();return x[0]})(e);Px[o]=Eb(s?{["@keyframes "+o]:c}:c,n?"":"."+o)}let l=n&&Px.g?Px.g:null;return n&&(Px.g=Px[o]),((c,u,d,f)=>{f?u.data=u.data.replace(f,c):u.data.indexOf(c)===-1&&(u.data=d?c+u.data:u.data+c)})(Px[o],t,r,l),o},lYe=(e,t,n)=>e.reduce((r,s,a)=>{let o=t[a];if(o&&o.call){let l=o(n),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;o=c?"."+c:l&&typeof l=="object"?l.props?"":Eb(l,""):l===!1?"":l}return r+s+(o??"")},"");function yD(e){let t=this||{},n=e.call?e(t.p):e;return oYe(n.unshift?n.raw?lYe(n,[].slice.call(arguments,1),t.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,sYe(t.target),t.g,t.o,t.k)}let qNe,fQ,hQ;yD.bind({g:1});let Yg=yD.bind({k:1});function cYe(e,t,n,r){Eb.p=t,qNe=e,fQ=n,hQ=r}function Xy(e,t){let n=this||{};return function(){let r=arguments;function s(a,o){let l=Object.assign({},a),c=l.className||s.className;n.p=Object.assign({theme:fQ&&fQ()},l),n.o=/ *go\d+/.test(c),l.className=yD.apply(n,r)+(c?" "+c:"");let u=e;return e[0]&&(u=l.as||e,delete l.as),hQ&&u[0]&&hQ(l),qNe(u,l)}return s}}var uYe=e=>typeof e=="function",RO=(e,t)=>uYe(e)?e(t):e,dYe=(()=>{let e=0;return()=>(++e).toString()})(),GNe=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),fYe=20,SF=new Map,hYe=1e3,Pde=e=>{if(SF.has(e))return;let t=setTimeout(()=>{SF.delete(e),J3({type:4,toastId:e})},hYe);SF.set(e,t)},pYe=e=>{let t=SF.get(e);t&&clearTimeout(t)},pQ=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,fYe)};case 1:return t.toast.id&&pYe(t.toast.id),{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case 2:let{toast:n}=t;return e.toasts.find(a=>a.id===n.id)?pQ(e,{type:1,toast:n}):pQ(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?Pde(r):e.toasts.forEach(a=>{Pde(a.id)}),{...e,toasts:e.toasts.map(a=>a.id===r||r===void 0?{...a,visible:!1}:a)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(a=>({...a,pauseDuration:a.pauseDuration+s}))}}},NF=[],AF={toasts:[],pausedAt:void 0},J3=e=>{AF=pQ(AF,e),NF.forEach(t=>{t(AF)})},mYe={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},xYe=(e={})=>{let[t,n]=m.useState(AF);m.useEffect(()=>(NF.push(n),()=>{let s=NF.indexOf(n);s>-1&&NF.splice(s,1)}),[t]);let r=t.toasts.map(s=>{var a,o;return{...e,...e[s.type],...s,duration:s.duration||((a=e[s.type])==null?void 0:a.duration)||(e==null?void 0:e.duration)||mYe[s.type],style:{...e.style,...(o=e[s.type])==null?void 0:o.style,...s.style}}});return{...t,toasts:r}},gYe=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||dYe()}),hk=e=>(t,n)=>{let r=gYe(t,e,n);return J3({type:2,toast:r}),r.id},Pf=(e,t)=>hk("blank")(e,t);Pf.error=hk("error");Pf.success=hk("success");Pf.loading=hk("loading");Pf.custom=hk("custom");Pf.dismiss=e=>{J3({type:3,toastId:e})};Pf.remove=e=>J3({type:4,toastId:e});Pf.promise=(e,t,n)=>{let r=Pf.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(s=>(Pf.success(RO(t.success,s),{id:r,...n,...n==null?void 0:n.success}),s)).catch(s=>{Pf.error(RO(t.error,s),{id:r,...n,...n==null?void 0:n.error})}),e};var bYe=(e,t)=>{J3({type:1,toast:{id:e,height:t}})},yYe=()=>{J3({type:5,time:Date.now()})},vYe=e=>{let{toasts:t,pausedAt:n}=xYe(e);m.useEffect(()=>{if(n)return;let a=Date.now(),o=t.map(l=>{if(l.duration===1/0)return;let c=(l.duration||0)+l.pauseDuration-(a-l.createdAt);if(c<0){l.visible&&Pf.dismiss(l.id);return}return setTimeout(()=>Pf.dismiss(l.id),c)});return()=>{o.forEach(l=>l&&clearTimeout(l))}},[t,n]);let r=m.useCallback(()=>{n&&J3({type:6,time:Date.now()})},[n]),s=m.useCallback((a,o)=>{let{reverseOrder:l=!1,gutter:c=8,defaultPosition:u}=o||{},d=t.filter(g=>(g.position||u)===(a.position||u)&&g.height),f=d.findIndex(g=>g.id===a.id),x=d.filter((g,v)=>v<f&&g.visible).length;return d.filter(g=>g.visible).slice(...l?[x+1]:[0,x]).reduce((g,v)=>g+(v.height||0)+c,0)},[t]);return{toasts:t,handlers:{updateHeight:bYe,startPause:yYe,endPause:r,calculateOffset:s}}},wYe=Yg`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
 transform: scale(1) rotate(45deg);
  opacity: 1;
}`,CYe=Yg`
from {
  transform: scale(0);
  opacity: 0;
}
to {
  transform: scale(1);
  opacity: 1;
}`,SYe=Yg`
from {
  transform: scale(0) rotate(90deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(90deg);
	opacity: 1;
}`,NYe=Xy("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#ff4b4b"};
  position: relative;
  transform: rotate(45deg);

  animation: ${wYe} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;

  &:after,
  &:before {
    content: '';
    animation: ${CYe} 0.15s ease-out forwards;
    animation-delay: 150ms;
    position: absolute;
    border-radius: 3px;
    opacity: 0;
    background: ${e=>e.secondary||"#fff"};
    bottom: 9px;
    left: 4px;
    height: 2px;
    width: 12px;
  }

  &:before {
    animation: ${SYe} 0.15s ease-out forwards;
    animation-delay: 180ms;
    transform: rotate(90deg);
  }
`,AYe=Yg`
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
`,KNe=Xy("div")`
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 2px solid;
  border-radius: 100%;
  border-color: ${e=>e.secondary||"#e0e0e0"};
  border-right-color: ${e=>e.primary||"#616161"};
  animation: ${AYe} 1s linear infinite;
`,jYe=Yg`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(45deg);
	opacity: 1;
}`,EYe=Yg`
0% {
	height: 0;
	width: 0;
	opacity: 0;
}
40% {
  height: 0;
	width: 6px;
	opacity: 1;
}
100% {
  opacity: 1;
  height: 10px;
}`,_Ye=Xy("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#61d345"};
  position: relative;
  transform: rotate(45deg);

  animation: ${jYe} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;
  &:after {
    content: '';
    box-sizing: border-box;
    animation: ${EYe} 0.2s ease-out forwards;
    opacity: 0;
    animation-delay: 200ms;
    position: absolute;
    border-right: 2px solid;
    border-bottom: 2px solid;
    border-color: ${e=>e.secondary||"#fff"};
    bottom: 6px;
    left: 6px;
    height: 10px;
    width: 6px;
  }
`,kYe=Xy("div")`
  position: absolute;
`,TYe=Xy("div")`
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 20px;
  min-height: 20px;
`,IYe=Yg`
from {
  transform: scale(0.6);
  opacity: 0.4;
}
to {
  transform: scale(1);
  opacity: 1;
}`,PYe=Xy("div")`
  position: relative;
  transform: scale(0.6);
  opacity: 0.4;
  min-width: 20px;
  animation: ${IYe} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
`,FYe=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?m.createElement(PYe,null,t):t:n==="blank"?null:m.createElement(TYe,null,m.createElement(KNe,{...r}),n!=="loading"&&m.createElement(kYe,null,n==="error"?m.createElement(NYe,{...r}):m.createElement(_Ye,{...r})))},OYe=e=>`
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`,MYe=e=>`
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
`,RYe="0%{opacity:0;} 100%{opacity:1;}",LYe="0%{opacity:1;} 100%{opacity:0;}",DYe=Xy("div")`
  display: flex;
  align-items: center;
  background: #fff;
  color: #363636;
  line-height: 1.3;
  will-change: transform;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
  max-width: 350px;
  pointer-events: auto;
  padding: 8px 10px;
  border-radius: 8px;
`,BYe=Xy("div")`
  display: flex;
  justify-content: center;
  margin: 4px 10px;
  color: inherit;
  flex: 1 1 auto;
  white-space: pre-line;
`,$Ye=(e,t)=>{let n=e.includes("top")?1:-1,[r,s]=GNe()?[RYe,LYe]:[OYe(n),MYe(n)];return{animation:t?`${Yg(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Yg(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},UYe=m.memo(({toast:e,position:t,style:n,children:r})=>{let s=e.height?$Ye(e.position||t||"top-center",e.visible):{opacity:0},a=m.createElement(FYe,{toast:e}),o=m.createElement(BYe,{...e.ariaProps},RO(e.message,e));return m.createElement(DYe,{className:e.className,style:{...s,...n,...e.style}},typeof r=="function"?r({icon:a,message:o}):m.createElement(m.Fragment,null,a,o))});cYe(m.createElement);var zYe=({id:e,className:t,style:n,onHeightUpdate:r,children:s})=>{let a=m.useCallback(o=>{if(o){let l=()=>{let c=o.getBoundingClientRect().height;r(e,c)};l(),new MutationObserver(l).observe(o,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return m.createElement("div",{ref:a,className:t,style:n},s)},HYe=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},s=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:GNe()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...s}},VYe=yD`
  z-index: 9999;
  > * {
    pointer-events: auto;
  }
`,wI=16,WYe=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:s,containerStyle:a,containerClassName:o})=>{let{toasts:l,handlers:c}=vYe(n);return m.createElement("div",{style:{position:"fixed",zIndex:9999,top:wI,left:wI,right:wI,bottom:wI,pointerEvents:"none",...a},className:o,onMouseEnter:c.startPause,onMouseLeave:c.endPause},l.map(u=>{let d=u.position||t,f=c.calculateOffset(u,{reverseOrder:e,gutter:r,defaultPosition:t}),x=HYe(d,f);return m.createElement(zYe,{id:u.id,key:u.id,onHeightUpdate:c.updateHeight,className:u.visible?VYe:"",style:x},u.type==="custom"?RO(u.message,u):s?s(u):m.createElement(UYe,{toast:u,position:d}))}))},on=Pf;const YNe=typeof document<"u"?Se.useLayoutEffect:()=>{};function qYe(e){const t=m.useRef(null);return YNe(()=>{t.current=e},[e]),m.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const pk=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Dv=e=>e&&"window"in e&&e.window===e?e:pk(e).defaultView||window;function GYe(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function KYe(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function XNe(e){let t=null;return()=>(t==null&&(t=e()),t)}const YYe=XNe(function(){return KYe(/^Mac/i)}),XYe=XNe(function(){return GYe(/Android/i)});function QYe(e){return e.mozInputSource===0&&e.isTrusted?!0:XYe()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class ZYe{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function QNe(e){let t=m.useRef({isFocused:!1,observer:null});YNe(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=qYe(r=>{e==null||e(r)});return m.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let s=r.target,a=o=>{t.current.isFocused=!1,s.disabled&&n(new ZYe("blur",o)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};s.addEventListener("focusout",a,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&s.disabled){var o;(o=t.current.observer)===null||o===void 0||o.disconnect();let l=s===document.activeElement?null:document.activeElement;s.dispatchEvent(new FocusEvent("blur",{relatedTarget:l})),s.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:l}))}}),t.current.observer.observe(s,{attributes:!0,attributeFilter:["disabled"]})}},[n])}function JYe(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:s}=e;const a=m.useCallback(c=>{if(c.target===c.currentTarget)return r&&r(c),s&&s(!1),!0},[r,s]),o=QNe(a),l=m.useCallback(c=>{const u=pk(c.target);c.target===c.currentTarget&&u.activeElement===c.target&&(n&&n(c),s&&s(!0),o(c))},[s,n,o]);return{focusProps:{onFocus:!t&&(n||s||r)?l:void 0,onBlur:!t&&(r||s)?a:void 0}}}let mk=null,mQ=new Set,Mj=new Map,l3=!1,xQ=!1;const eXe={Tab:!0,Escape:!0};function Cre(e,t){for(let n of mQ)n(e,t)}function tXe(e){return!(e.metaKey||!YYe()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function LO(e){l3=!0,tXe(e)&&(mk="keyboard",Cre("keyboard",e))}function Lh(e){mk="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(l3=!0,Cre("pointer",e))}function ZNe(e){QYe(e)&&(l3=!0,mk="virtual")}function JNe(e){e.target===window||e.target===document||(!l3&&!xQ&&(mk="virtual",Cre("virtual",e)),l3=!1,xQ=!1)}function eAe(){l3=!1,xQ=!0}function gQ(e){if(typeof window>"u"||Mj.get(Dv(e)))return;const t=Dv(e),n=pk(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){l3=!0,r.apply(this,arguments)},n.addEventListener("keydown",LO,!0),n.addEventListener("keyup",LO,!0),n.addEventListener("click",ZNe,!0),t.addEventListener("focus",JNe,!0),t.addEventListener("blur",eAe,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Lh,!0),n.addEventListener("pointermove",Lh,!0),n.addEventListener("pointerup",Lh,!0)):(n.addEventListener("mousedown",Lh,!0),n.addEventListener("mousemove",Lh,!0),n.addEventListener("mouseup",Lh,!0)),t.addEventListener("beforeunload",()=>{tAe(e)},{once:!0}),Mj.set(t,{focus:r})}const tAe=(e,t)=>{const n=Dv(e),r=pk(e);t&&r.removeEventListener("DOMContentLoaded",t),Mj.has(n)&&(n.HTMLElement.prototype.focus=Mj.get(n).focus,r.removeEventListener("keydown",LO,!0),r.removeEventListener("keyup",LO,!0),r.removeEventListener("click",ZNe,!0),n.removeEventListener("focus",JNe,!0),n.removeEventListener("blur",eAe,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Lh,!0),r.removeEventListener("pointermove",Lh,!0),r.removeEventListener("pointerup",Lh,!0)):(r.removeEventListener("mousedown",Lh,!0),r.removeEventListener("mousemove",Lh,!0),r.removeEventListener("mouseup",Lh,!0)),Mj.delete(n))};function nXe(e){const t=pk(e);let n;return t.readyState!=="loading"?gQ(e):(n=()=>{gQ(e)},t.addEventListener("DOMContentLoaded",n)),()=>tAe(e,n)}typeof document<"u"&&nXe();function nAe(){return mk!=="pointer"}const rXe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function sXe(e,t,n){var r;const s=typeof window<"u"?Dv(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,a=typeof window<"u"?Dv(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,o=typeof window<"u"?Dv(n==null?void 0:n.target).HTMLElement:HTMLElement,l=typeof window<"u"?Dv(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||(n==null?void 0:n.target)instanceof s&&!rXe.has(n==null||(r=n.target)===null||r===void 0?void 0:r.type)||(n==null?void 0:n.target)instanceof a||(n==null?void 0:n.target)instanceof o&&(n==null?void 0:n.target.isContentEditable),!(e&&t==="keyboard"&&n instanceof l&&!eXe[n.key])}function iXe(e,t,n){gQ(),m.useEffect(()=>{let r=(s,a)=>{sXe(!!(n!=null&&n.isTextInput),s,a)&&e(nAe())};return mQ.add(r),()=>{mQ.delete(r)}},t)}function aXe(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:s}=e,a=m.useRef({isFocusWithin:!1}),o=m.useCallback(u=>{a.current.isFocusWithin&&!u.currentTarget.contains(u.relatedTarget)&&(a.current.isFocusWithin=!1,n&&n(u),s&&s(!1))},[n,s,a]),l=QNe(o),c=m.useCallback(u=>{!a.current.isFocusWithin&&document.activeElement===u.target&&(r&&r(u),s&&s(!0),a.current.isFocusWithin=!0,l(u))},[r,s,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:o}}}let DO=!1,hz=0;function bQ(){DO=!0,setTimeout(()=>{DO=!1},50)}function Fde(e){e.pointerType==="touch"&&bQ()}function oXe(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",Fde):document.addEventListener("touchend",bQ),hz++,()=>{hz--,!(hz>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Fde):document.removeEventListener("touchend",bQ))}}function Sre(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:s}=e,[a,o]=m.useState(!1),l=m.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;m.useEffect(oXe,[]);let{hoverProps:c,triggerHoverEnd:u}=m.useMemo(()=>{let d=(g,v)=>{if(l.pointerType=v,s||v==="touch"||l.isHovered||!g.currentTarget.contains(g.target))return;l.isHovered=!0;let w=g.currentTarget;l.target=w,t&&t({type:"hoverstart",target:w,pointerType:v}),n&&n(!0),o(!0)},f=(g,v)=>{if(l.pointerType="",l.target=null,v==="touch"||!l.isHovered)return;l.isHovered=!1;let w=g.currentTarget;r&&r({type:"hoverend",target:w,pointerType:v}),n&&n(!1),o(!1)},x={};return typeof PointerEvent<"u"?(x.onPointerEnter=g=>{DO&&g.pointerType==="mouse"||d(g,g.pointerType)},x.onPointerLeave=g=>{!s&&g.currentTarget.contains(g.target)&&f(g,g.pointerType)}):(x.onTouchStart=()=>{l.ignoreEmulatedMouseEvents=!0},x.onMouseEnter=g=>{!l.ignoreEmulatedMouseEvents&&!DO&&d(g,"mouse"),l.ignoreEmulatedMouseEvents=!1},x.onMouseLeave=g=>{!s&&g.currentTarget.contains(g.target)&&f(g,"mouse")}),{hoverProps:x,triggerHoverEnd:f}},[t,n,r,s,l]);return m.useEffect(()=>{s&&u({currentTarget:l.target},l.pointerType)},[s]),{hoverProps:c,isHovered:a}}function Nre(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,s=m.useRef({isFocused:!1,isFocusVisible:t||nAe()}),[a,o]=m.useState(!1),[l,c]=m.useState(()=>s.current.isFocused&&s.current.isFocusVisible),u=m.useCallback(()=>c(s.current.isFocused&&s.current.isFocusVisible),[]),d=m.useCallback(g=>{s.current.isFocused=g,o(g),u()},[u]);iXe(g=>{s.current.isFocusVisible=g,u()},[],{isTextInput:n});let{focusProps:f}=JYe({isDisabled:r,onFocusChange:d}),{focusWithinProps:x}=aXe({isDisabled:!r,onFocusWithinChange:d});return{isFocused:a,isFocusVisible:l,focusProps:r?x:f}}var lXe=Object.defineProperty,cXe=(e,t,n)=>t in e?lXe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pz=(e,t,n)=>(cXe(e,typeof t!="symbol"?t+"":t,n),n);let uXe=class{constructor(){pz(this,"current",this.detect()),pz(this,"handoffState","pending"),pz(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Bw=new uXe;function Qy(e){return Bw.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function vD(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function rx(){let e=[],t={addEventListener(n,r,s,a){return n.addEventListener(r,s,a),t.add(()=>n.removeEventListener(r,s,a))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return vD(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,s){let a=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:s}),this.add(()=>{Object.assign(n.style,{[r]:a})})},group(n){let r=rx();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let s of e.splice(r,1))s()}},dispose(){for(let n of e.splice(0))n()}};return t}function Zy(){let[e]=m.useState(rx);return m.useEffect(()=>()=>e.dispose(),[e]),e}let Ka=(e,t)=>{Bw.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function e5(e){let t=m.useRef(e);return Ka(()=>{t.current=e},[e]),t}let Rs=function(e){let t=e5(e);return Se.useCallback((...n)=>t.current(...n),[t])};function dXe(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function fXe(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Are({disabled:e=!1}={}){let t=m.useRef(null),[n,r]=m.useState(!1),s=Zy(),a=Rs(()=>{t.current=null,r(!1),s.dispose()}),o=Rs(l=>{if(s.dispose(),t.current===null){t.current=l.currentTarget,r(!0);{let c=Qy(l.currentTarget);s.addEventListener(c,"pointerup",a,!1),s.addEventListener(c,"pointermove",u=>{if(t.current){let d=dXe(u);r(fXe(d,t.current.getBoundingClientRect()))}},!1),s.addEventListener(c,"pointercancel",a,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:o,onPointerUp:a,onClick:a}}}let hXe=m.createContext(void 0);function jre(){return m.useContext(hXe)}function yQ(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Bf(e,t,...n){if(e in t){let s=t[e];return typeof s=="function"?s(...n):s}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(s=>`"${s}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Bf),r}var _y=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(_y||{}),ay=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(ay||{});function yo(){let e=mXe();return m.useCallback(t=>pXe({mergeRefs:e,...t}),[e])}function pXe({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:s,visible:a=!0,name:o,mergeRefs:l}){l=l??xXe;let c=rAe(t,e);if(a)return CI(c,n,r,o,l);let u=s??0;if(u&2){let{static:d=!1,...f}=c;if(d)return CI(f,n,r,o,l)}if(u&1){let{unmount:d=!0,...f}=c;return Bf(d?0:1,{0(){return null},1(){return CI({...f,hidden:!0,style:{display:"none"}},n,r,o,l)}})}return CI(c,n,r,o,l)}function CI(e,t={},n,r,s){let{as:a=n,children:o,refName:l="ref",...c}=mz(e,["unmount","static"]),u=e.ref!==void 0?{[l]:e.ref}:{},d=typeof o=="function"?o(t):o;"className"in c&&c.className&&typeof c.className=="function"&&(c.className=c.className(t)),c["aria-labelledby"]&&c["aria-labelledby"]===c.id&&(c["aria-labelledby"]=void 0);let f={};if(t){let x=!1,g=[];for(let[v,w]of Object.entries(t))typeof w=="boolean"&&(x=!0),w===!0&&g.push(v.replace(/([A-Z])/g,C=>`-${C.toLowerCase()}`));if(x){f["data-headlessui-state"]=g.join(" ");for(let v of g)f[`data-${v}`]=""}}if(a===m.Fragment&&(Object.keys(Ab(c)).length>0||Object.keys(Ab(f)).length>0))if(!m.isValidElement(d)||Array.isArray(d)&&d.length>1){if(Object.keys(Ab(c)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(Ab(c)).concat(Object.keys(Ab(f))).map(x=>`  - ${x}`).join(`
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(x=>`  - ${x}`).join(`
`)].join(`
`))}else{let x=d.props,g=x==null?void 0:x.className,v=typeof g=="function"?(...N)=>yQ(g(...N),c.className):yQ(g,c.className),w=v?{className:v}:{},C=rAe(d.props,Ab(mz(c,["ref"])));for(let N in f)N in C&&delete f[N];return m.cloneElement(d,Object.assign({},C,f,u,{ref:s(gXe(d),u.ref)},w))}return m.createElement(a,Object.assign({},mz(c,["ref"]),a!==m.Fragment&&u,a!==m.Fragment&&f),d)}function mXe(){let e=m.useRef([]),t=m.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function xXe(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function rAe(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let s in r)s.startsWith("on")&&typeof r[s]=="function"?(n[s]!=null||(n[s]=[]),n[s].push(r[s])):t[s]=r[s];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[s=>{var a;return(a=s==null?void 0:s.preventDefault)==null?void 0:a.call(s)}]);for(let r in n)Object.assign(t,{[r](s,...a){let o=n[r];for(let l of o){if((s instanceof Event||(s==null?void 0:s.nativeEvent)instanceof Event)&&s.defaultPrevented)return;l(s,...a)}}});return t}function y9(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let s in r)s.startsWith("on")&&typeof r[s]=="function"?(n[s]!=null||(n[s]=[]),n[s].push(r[s])):t[s]=r[s];for(let r in n)Object.assign(t,{[r](...s){let a=n[r];for(let o of a)o==null||o(...s)}});return t}function oo(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Ab(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function mz(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function gXe(e){return Se.version.split(".")[0]>="19"?e.props.ref:e.ref}function bXe(e,t,n){let[r,s]=m.useState(n),a=e!==void 0,o=m.useRef(a),l=m.useRef(!1),c=m.useRef(!1);return a&&!o.current&&!l.current?(l.current=!0,o.current=a,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!a&&o.current&&!c.current&&(c.current=!0,o.current=a,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[a?e:r,Rs(u=>(a||s(u),t==null?void 0:t(u)))]}function yXe(e){let[t]=m.useState(e);return t}function sAe(e={},t=null,n=[]){for(let[r,s]of Object.entries(e))aAe(n,iAe(t,r),s);return n}function iAe(e,t){return e?e+"["+t+"]":t}function aAe(e,t,n){if(Array.isArray(n))for(let[r,s]of n.entries())aAe(e,iAe(t,r.toString()),s);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):sAe(n,t,e)}function vXe(e){var t,n;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let s of r.elements)if(s!==e&&(s.tagName==="INPUT"&&s.type==="submit"||s.tagName==="BUTTON"&&s.type==="submit"||s.nodeName==="INPUT"&&s.type==="image")){s.click();return}(n=r.requestSubmit)==null||n.call(r)}}let wXe="span";var wS=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(wS||{});function CXe(e,t){var n;let{features:r=1,...s}=e,a={ref:t,"aria-hidden":(r&2)===2?!0:(n=s["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return yo()({ourProps:a,theirProps:s,slot:{},defaultTag:wXe,name:"Hidden"})}let v9=oo(CXe),SXe=m.createContext(null);function NXe({children:e}){let t=m.useContext(SXe);if(!t)return Se.createElement(Se.Fragment,null,e);let{target:n}=t;return n?Ia.createPortal(Se.createElement(Se.Fragment,null,e),n):null}function AXe({data:e,form:t,disabled:n,onReset:r,overrides:s}){let[a,o]=m.useState(null),l=Zy();return m.useEffect(()=>{if(r&&a)return l.addEventListener(a,"reset",r)},[a,t,r]),Se.createElement(NXe,null,Se.createElement(jXe,{setForm:o,formId:t}),sAe(e).map(([c,u])=>Se.createElement(v9,{features:wS.Hidden,...Ab({key:c,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:c,value:u,...s})})))}function jXe({setForm:e,formId:t}){return m.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:Se.createElement(v9,{features:wS.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let EXe=m.createContext(void 0);function oAe(){return m.useContext(EXe)}function Ere(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&_Xe(n)?!1:r}function _Xe(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let lAe=Symbol();function cAe(e,t=!0){return Object.assign(e,{[lAe]:t})}function tc(...e){let t=m.useRef(e);m.useEffect(()=>{t.current=e},[e]);let n=Rs(r=>{for(let s of t.current)s!=null&&(typeof s=="function"?s(r):s.current=r)});return e.every(r=>r==null||(r==null?void 0:r[lAe]))?void 0:n}let wD=m.createContext(null);wD.displayName="DescriptionContext";function uAe(){let e=m.useContext(wD);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,uAe),t}return e}function kXe(){var e,t;return(t=(e=m.useContext(wD))==null?void 0:e.value)!=null?t:void 0}function _re(){let[e,t]=m.useState([]);return[e.length>0?e.join(" "):void 0,m.useMemo(()=>function(n){let r=Rs(a=>(t(o=>[...o,a]),()=>t(o=>{let l=o.slice(),c=l.indexOf(a);return c!==-1&&l.splice(c,1),l}))),s=m.useMemo(()=>({register:r,slot:n.slot,name:n.name,props:n.props,value:n.value}),[r,n.slot,n.name,n.props,n.value]);return Se.createElement(wD.Provider,{value:s},n.children)},[t])]}let TXe="p";function IXe(e,t){let n=m.useId(),r=jre(),{id:s=`headlessui-description-${n}`,...a}=e,o=uAe(),l=tc(t);Ka(()=>o.register(s),[s,o.register]);let c=r||!1,u=m.useMemo(()=>({...o.slot,disabled:c}),[o.slot,c]),d={ref:l,...o.props,id:s};return yo()({ourProps:d,theirProps:a,slot:u,defaultTag:TXe,name:o.name||"Description"})}let PXe=oo(IXe),dAe=Object.assign(PXe,{});var ho=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(ho||{});let CD=m.createContext(null);CD.displayName="LabelContext";function kre(){let e=m.useContext(CD);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,kre),t}return e}function fAe(e){var t,n,r;let s=(n=(t=m.useContext(CD))==null?void 0:t.value)!=null?n:void 0;return((r=void 0)!=null?r:0)>0?[s,...e].filter(Boolean).join(" "):s}function Tre({inherit:e=!1}={}){let t=fAe(),[n,r]=m.useState([]),s=e?[t,...n].filter(Boolean):n;return[s.length>0?s.join(" "):void 0,m.useMemo(()=>function(a){let o=Rs(c=>(r(u=>[...u,c]),()=>r(u=>{let d=u.slice(),f=d.indexOf(c);return f!==-1&&d.splice(f,1),d}))),l=m.useMemo(()=>({register:o,slot:a.slot,name:a.name,props:a.props,value:a.value}),[o,a.slot,a.name,a.props,a.value]);return Se.createElement(CD.Provider,{value:l},a.children)},[r])]}let FXe="label";function OXe(e,t){var n;let r=m.useId(),s=kre(),a=oAe(),o=jre(),{id:l=`headlessui-label-${r}`,htmlFor:c=a??((n=s.props)==null?void 0:n.htmlFor),passive:u=!1,...d}=e,f=tc(t);Ka(()=>s.register(l),[l,s.register]);let x=Rs(C=>{let N=C.currentTarget;if(N instanceof HTMLLabelElement&&C.preventDefault(),s.props&&"onClick"in s.props&&typeof s.props.onClick=="function"&&s.props.onClick(C),N instanceof HTMLLabelElement){let I=document.getElementById(N.htmlFor);if(I){let P=I.getAttribute("disabled");if(P==="true"||P==="")return;let R=I.getAttribute("aria-disabled");if(R==="true"||R==="")return;(I instanceof HTMLInputElement&&(I.type==="radio"||I.type==="checkbox")||I.role==="radio"||I.role==="checkbox"||I.role==="switch")&&I.click(),I.focus({preventScroll:!0})}}}),g=o||!1,v=m.useMemo(()=>({...s.slot,disabled:g}),[s.slot,g]),w={ref:f,...s.props,id:l,htmlFor:c,onClick:x};return u&&("onClick"in w&&(delete w.htmlFor,delete w.onClick),"onClick"in d&&delete d.onClick),yo()({ourProps:w,theirProps:d,slot:v,defaultTag:c?FXe:"div",name:s.name||"Label"})}let MXe=oo(OXe),RXe=Object.assign(MXe,{}),LXe=m.createContext(()=>{});function hAe({value:e,children:t}){return Se.createElement(LXe.Provider,{value:e},t)}function DXe(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function BXe(e,t=!1){let[n,r]=m.useReducer(()=>({}),{}),s=m.useMemo(()=>DXe(e),[e,n]);return Ka(()=>{if(!e)return;let a=new ResizeObserver(r);return a.observe(e),()=>{a.disconnect()}},[e]),t?{width:`${s.width}px`,height:`${s.height}px`}:s}let $Xe=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};function pAe(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(s){return r.add(s),()=>r.delete(s)},dispatch(s,...a){let o=t[s].call(n,...a);o&&(n=o,r.forEach(l=>l()))}}}function mAe(e){return m.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let UXe=new $Xe(()=>pAe(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let n=this.slice();return n.splice(t,1),n}}));function JN(e,t){let n=UXe.get(t),r=m.useId(),s=mAe(n);if(Ka(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let a=s.indexOf(r),o=s.length;return a===-1&&(a=o,o+=1),a===o-1}let vQ=new Map,Rj=new Map;function Ode(e){var t;let n=(t=Rj.get(e))!=null?t:0;return Rj.set(e,n+1),n!==0?()=>Mde(e):(vQ.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Mde(e))}function Mde(e){var t;let n=(t=Rj.get(e))!=null?t:1;if(n===1?Rj.delete(e):Rj.set(e,n-1),n!==1)return;let r=vQ.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,vQ.delete(e))}function xAe(e,{allowed:t,disallowed:n}={}){let r=JN(e,"inert-others");Ka(()=>{var s,a;if(!r)return;let o=rx();for(let c of(s=n==null?void 0:n())!=null?s:[])c&&o.add(Ode(c));let l=(a=t==null?void 0:t())!=null?a:[];for(let c of l){if(!c)continue;let u=Qy(c);if(!u)continue;let d=c.parentElement;for(;d&&d!==u.body;){for(let f of d.children)l.some(x=>f.contains(x))||o.add(Ode(f));d=d.parentElement}}return o.dispose},[r,t,n])}function gAe(e,t,n){let r=e5(s=>{let a=s.getBoundingClientRect();a.x===0&&a.y===0&&a.width===0&&a.height===0&&n()});m.useEffect(()=>{if(!e)return;let s=t===null?null:t instanceof HTMLElement?t:t.current;if(!s)return;let a=rx();if(typeof ResizeObserver<"u"){let o=new ResizeObserver(()=>r.current(s));o.observe(s),a.add(()=>o.disconnect())}if(typeof IntersectionObserver<"u"){let o=new IntersectionObserver(()=>r.current(s));o.observe(s),a.add(()=>o.disconnect())}return()=>a.dispose()},[t,r,e])}let BO=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),zXe=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Gp=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(Gp||{}),wQ=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(wQ||{}),HXe=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(HXe||{});function bAe(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(BO)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function VXe(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(zXe)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Ire=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Ire||{});function Pre(e,t=0){var n;return e===((n=Qy(e))==null?void 0:n.body)?!1:Bf(t,{0(){return e.matches(BO)},1(){let r=e;for(;r!==null;){if(r.matches(BO))return!0;r=r.parentElement}return!1}})}function yAe(e){let t=Qy(e);rx().nextFrame(()=>{t&&!Pre(t.activeElement,0)&&k0(e)})}var WXe=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(WXe||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function k0(e){e==null||e.focus({preventScroll:!0})}let qXe=["textarea","input"].join(",");function GXe(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,qXe))!=null?n:!1}function vAe(e,t=n=>n){return e.slice().sort((n,r)=>{let s=t(n),a=t(r);if(s===null||a===null)return 0;let o=s.compareDocumentPosition(a);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function KXe(e,t){return qC(bAe(),t,{relativeTo:e})}function qC(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:s=[]}={}){let a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?n?vAe(e):e:t&64?VXe(e):bAe(e);s.length>0&&o.length>1&&(o=o.filter(g=>!s.some(v=>v!=null&&"current"in v?(v==null?void 0:v.current)===g:v===g))),r=r??a.activeElement;let l=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(r))-1;if(t&4)return Math.max(0,o.indexOf(r))+1;if(t&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},d=0,f=o.length,x;do{if(d>=f||d+f<=0)return 0;let g=c+d;if(t&16)g=(g+f)%f;else{if(g<0)return 3;if(g>=f)return 1}x=o[g],x==null||x.focus(u),d+=l}while(x!==a.activeElement);return t&6&&GXe(x)&&x.select(),2}function wAe(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function YXe(){return/Android/gi.test(window.navigator.userAgent)}function XXe(){return wAe()||YXe()}function u7(e,t,n,r){let s=e5(n);m.useEffect(()=>{if(!e)return;function a(o){s.current(o)}return document.addEventListener(t,a,r),()=>document.removeEventListener(t,a,r)},[e,t,r])}function CAe(e,t,n,r){let s=e5(n);m.useEffect(()=>{if(!e)return;function a(o){s.current(o)}return window.addEventListener(t,a,r),()=>window.removeEventListener(t,a,r)},[e,t,r])}const Rde=30;function SAe(e,t,n){let r=JN(e,"outside-click"),s=e5(n),a=m.useCallback(function(c,u){if(c.defaultPrevented)return;let d=u(c);if(d===null||!d.getRootNode().contains(d)||!d.isConnected)return;let f=function x(g){return typeof g=="function"?x(g()):Array.isArray(g)||g instanceof Set?g:[g]}(t);for(let x of f)if(x!==null&&(x.contains(d)||c.composed&&c.composedPath().includes(x)))return;return!Pre(d,Ire.Loose)&&d.tabIndex!==-1&&c.preventDefault(),s.current(c,d)},[s,t]),o=m.useRef(null);u7(r,"pointerdown",c=>{var u,d;o.current=((d=(u=c.composedPath)==null?void 0:u.call(c))==null?void 0:d[0])||c.target},!0),u7(r,"mousedown",c=>{var u,d;o.current=((d=(u=c.composedPath)==null?void 0:u.call(c))==null?void 0:d[0])||c.target},!0),u7(r,"click",c=>{XXe()||o.current&&(a(c,()=>o.current),o.current=null)},!0);let l=m.useRef({x:0,y:0});u7(r,"touchstart",c=>{l.current.x=c.touches[0].clientX,l.current.y=c.touches[0].clientY},!0),u7(r,"touchend",c=>{let u={x:c.changedTouches[0].clientX,y:c.changedTouches[0].clientY};if(!(Math.abs(u.x-l.current.x)>=Rde||Math.abs(u.y-l.current.y)>=Rde))return a(c,()=>c.target instanceof HTMLElement?c.target:null)},!0),CAe(r,"blur",c=>a(c,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function eA(...e){return m.useMemo(()=>Qy(...e),[...e])}function NAe(e,t,n,r){let s=e5(n);m.useEffect(()=>{e=e??window;function a(o){s.current(o)}return e.addEventListener(t,a,r),()=>e.removeEventListener(t,a,r)},[e,t,r])}function Fre(e,t){return m.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function QXe(){let e;return{before({doc:t}){var n;let r=t.documentElement,s=(n=t.defaultView)!=null?n:window;e=Math.max(0,s.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,s=Math.max(0,r.clientWidth-r.offsetWidth),a=Math.max(0,e-s);n.style(r,"paddingRight",`${a}px`)}}}function ZXe(){return wAe()?{before({doc:e,d:t,meta:n}){function r(s){return n.containers.flatMap(a=>a()).some(a=>a.contains(s))}t.microTask(()=>{var s;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let l=rx();l.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>l.dispose()))}let a=(s=window.scrollY)!=null?s:window.pageYOffset,o=null;t.addEventListener(e,"click",l=>{if(l.target instanceof HTMLElement)try{let c=l.target.closest("a");if(!c)return;let{hash:u}=new URL(c.href),d=e.querySelector(u);d&&!r(d)&&(o=d)}catch{}},!0),t.addEventListener(e,"touchstart",l=>{if(l.target instanceof HTMLElement)if(r(l.target)){let c=l.target;for(;c.parentElement&&r(c.parentElement);)c=c.parentElement;t.style(c,"overscrollBehavior","contain")}else t.style(l.target,"touchAction","none")}),t.addEventListener(e,"touchmove",l=>{if(l.target instanceof HTMLElement){if(l.target.tagName==="INPUT")return;if(r(l.target)){let c=l.target;for(;c.parentElement&&c.dataset.headlessuiPortal!==""&&!(c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth);)c=c.parentElement;c.dataset.headlessuiPortal===""&&l.preventDefault()}else l.preventDefault()}},{passive:!1}),t.add(()=>{var l;let c=(l=window.scrollY)!=null?l:window.pageYOffset;a!==c&&window.scrollTo(0,a),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})}}:{}}function JXe(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function eQe(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Bv=pAe(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:rx(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:eQe(n)},s=[ZXe(),QXe(),JXe()];s.forEach(({before:a})=>a==null?void 0:a(r)),s.forEach(({after:a})=>a==null?void 0:a(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Bv.subscribe(()=>{let e=Bv.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",s=n.count!==0;(s&&!r||!s&&r)&&Bv.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Bv.dispatch("TEARDOWN",n)}});function tQe(e,t,n=()=>({containers:[]})){let r=mAe(Bv),s=t?r.get(t):void 0,a=s?s.count>0:!1;return Ka(()=>{if(!(!t||!e))return Bv.dispatch("PUSH",t,n),()=>Bv.dispatch("POP",t,n)},[e,t]),a}function AAe(e,t,n=()=>[document.body]){let r=JN(e,"scroll-lock");tQe(r,t,s=>{var a;return{containers:[...(a=s.containers)!=null?a:[],n]}})}function Lde(e){return[e.screenX,e.screenY]}function nQe(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=Lde(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=Lde(t)}}}function rQe(e=0){let[t,n]=m.useState(e),r=m.useCallback(c=>n(c),[t]),s=m.useCallback(c=>n(u=>u|c),[t]),a=m.useCallback(c=>(t&c)===c,[t]),o=m.useCallback(c=>n(u=>u&~c),[n]),l=m.useCallback(c=>n(u=>u^c),[n]);return{flags:t,setFlag:r,addFlag:s,hasFlag:a,removeFlag:o,toggleFlag:l}}var sQe={},Dde,Bde;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((Dde=process==null?void 0:sQe)==null?void 0:Dde.NODE_ENV)==="test"&&typeof((Bde=Element==null?void 0:Element.prototype)==null?void 0:Bde.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
`)),[]});var iQe=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(iQe||{});function Ore(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Mre(e,t,n,r){let[s,a]=m.useState(n),{hasFlag:o,addFlag:l,removeFlag:c}=rQe(e&&s?3:0),u=m.useRef(!1),d=m.useRef(!1),f=Zy();return Ka(()=>{var x;if(e){if(n&&a(!0),!t){n&&l(3);return}return(x=r==null?void 0:r.start)==null||x.call(r,n),aQe(t,{inFlight:u,prepare(){d.current?d.current=!1:d.current=u.current,u.current=!0,!d.current&&(n?(l(3),c(4)):(l(4),c(2)))},run(){d.current?n?(c(3),l(4)):(c(4),l(3)):n?c(1):l(1)},done(){var g;d.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(u.current=!1,c(7),n||a(!1),(g=r==null?void 0:r.end)==null||g.call(r,n))}})}},[e,n,t,f]),e?[s,{closed:o(1),enter:o(2),leave:o(4),transition:o(2)||o(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function aQe(e,{prepare:t,run:n,done:r,inFlight:s}){let a=rx();return lQe(e,{prepare:t,inFlight:s}),a.nextFrame(()=>{n(),a.requestAnimationFrame(()=>{a.add(oQe(e,r))})}),a.dispose}function oQe(e,t){var n,r;let s=rx();if(!e)return s.dispose;let a=!1;s.add(()=>{a=!0});let o=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(l=>l instanceof CSSTransition))!=null?r:[];return o.length===0?(t(),s.dispose):(Promise.allSettled(o.map(l=>l.finished)).then(()=>{a||t()}),s.dispose)}function lQe(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function cQe(e,{container:t,accept:n,walk:r}){let s=m.useRef(n),a=m.useRef(r);m.useEffect(()=>{s.current=n,a.current=r},[n,r]),Ka(()=>{if(!t||!e)return;let o=Qy(t);if(!o)return;let l=s.current,c=a.current,u=Object.assign(f=>l(f),{acceptNode:l}),d=o.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,u,!1);for(;d.nextNode();)c(d.currentNode)},[t,e,s,a])}function Rre(e,t){let n=m.useRef([]),r=Rs(e);m.useEffect(()=>{let s=[...n.current];for(let[a,o]of t.entries())if(n.current[a]!==o){let l=r(t,s);return n.current=t,l}},[r,...t])}function SD(){return typeof window<"u"}function tA(e){return jAe(e)?(e.nodeName||"").toLowerCase():"#document"}function Of(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function sx(e){var t;return(t=(jAe(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function jAe(e){return SD()?e instanceof Node||e instanceof Of(e).Node:!1}function Qu(e){return SD()?e instanceof Element||e instanceof Of(e).Element:!1}function U0(e){return SD()?e instanceof HTMLElement||e instanceof Of(e).HTMLElement:!1}function $de(e){return!SD()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Of(e).ShadowRoot}function xk(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=om(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function uQe(e){return["table","td","th"].includes(tA(e))}function ND(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Lre(e){const t=Dre(),n=Qu(e)?om(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function dQe(e){let t=ky(e);for(;U0(t)&&!CS(t);){if(Lre(t))return t;if(ND(t))return null;t=ky(t)}return null}function Dre(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function CS(e){return["html","body","#document"].includes(tA(e))}function om(e){return Of(e).getComputedStyle(e)}function AD(e){return Qu(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ky(e){if(tA(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$de(e)&&e.host||sx(e);return $de(t)?t.host:t}function EAe(e){const t=ky(e);return CS(t)?e.ownerDocument?e.ownerDocument.body:e.body:U0(t)&&xk(t)?t:EAe(t)}function w9(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=EAe(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),o=Of(s);if(a){const l=CQ(o);return t.concat(o,o.visualViewport||[],xk(s)?s:[],l&&n?w9(l):[])}return t.concat(s,w9(s,[],n))}function CQ(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fQe(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const hQe=["top","right","bottom","left"],Ty=Math.min,wu=Math.max,C9=Math.round,SI=Math.floor,Iy=e=>({x:e,y:e}),pQe={left:"right",right:"left",bottom:"top",top:"bottom"},mQe={start:"end",end:"start"};function SQ(e,t,n){return wu(e,Ty(t,n))}function z0(e,t){return typeof e=="function"?e(t):e}function Xg(e){return e.split("-")[0]}function nA(e){return e.split("-")[1]}function Bre(e){return e==="x"?"y":"x"}function $re(e){return e==="y"?"height":"width"}function Py(e){return["top","bottom"].includes(Xg(e))?"y":"x"}function Ure(e){return Bre(Py(e))}function xQe(e,t,n){n===void 0&&(n=!1);const r=nA(e),s=Ure(e),a=$re(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=$O(o)),[o,$O(o)]}function gQe(e){const t=$O(e);return[NQ(e),t,NQ(t)]}function NQ(e){return e.replace(/start|end/g,t=>mQe[t])}function bQe(e,t,n){const r=["left","right"],s=["right","left"],a=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?a:o;default:return[]}}function yQe(e,t,n,r){const s=nA(e);let a=bQe(Xg(e),n==="start",r);return s&&(a=a.map(o=>o+"-"+s),t&&(a=a.concat(a.map(NQ)))),a}function $O(e){return e.replace(/left|right|bottom|top/g,t=>pQe[t])}function vQe(e){return{top:0,right:0,bottom:0,left:0,...e}}function _Ae(e){return typeof e!="number"?vQe(e):{top:e,right:e,bottom:e,left:e}}function S9(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Ude(e,t,n){let{reference:r,floating:s}=e;const a=Py(t),o=Ure(t),l=$re(o),c=Xg(t),u=a==="y",d=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,x=r[l]/2-s[l]/2;let g;switch(c){case"top":g={x:d,y:r.y-s.height};break;case"bottom":g={x:d,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:f};break;case"left":g={x:r.x-s.width,y:f};break;default:g={x:r.x,y:r.y}}switch(nA(t)){case"start":g[o]-=x*(n&&u?-1:1);break;case"end":g[o]+=x*(n&&u?-1:1);break}return g}const wQe=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:o}=n,l=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:f}=Ude(u,r,c),x=r,g={},v=0;for(let w=0;w<l.length;w++){const{name:C,fn:N}=l[w],{x:I,y:P,data:R,reset:F}=await N({x:d,y:f,initialPlacement:r,placement:x,strategy:s,middlewareData:g,rects:u,platform:o,elements:{reference:e,floating:t}});d=I??d,f=P??f,g={...g,[C]:{...g[C],...R}},F&&v<=50&&(v++,typeof F=="object"&&(F.placement&&(x=F.placement),F.rects&&(u=F.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):F.rects),{x:d,y:f}=Ude(u,x,c)),w=-1)}return{x:d,y:f,placement:x,strategy:s,middlewareData:g}};async function SS(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:x=!1,padding:g=0}=z0(t,e),v=_Ae(g),C=l[x?f==="floating"?"reference":"floating":f],N=S9(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(C)))==null||n?C:C.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),I=f==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,P=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),R=await(a.isElement==null?void 0:a.isElement(P))?await(a.getScale==null?void 0:a.getScale(P))||{x:1,y:1}:{x:1,y:1},F=S9(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:I,offsetParent:P,strategy:c}):I);return{top:(N.top-F.top+v.top)/R.y,bottom:(F.bottom-N.bottom+v.bottom)/R.y,left:(N.left-F.left+v.left)/R.x,right:(F.right-N.right+v.right)/R.x}}const CQe=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=z0(e,t)||{};if(u==null)return{};const f=_Ae(d),x={x:n,y:r},g=Ure(s),v=$re(g),w=await o.getDimensions(u),C=g==="y",N=C?"top":"left",I=C?"bottom":"right",P=C?"clientHeight":"clientWidth",R=a.reference[v]+a.reference[g]-x[g]-a.floating[v],F=x[g]-a.reference[g],U=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let L=U?U[P]:0;(!L||!await(o.isElement==null?void 0:o.isElement(U)))&&(L=l.floating[P]||a.floating[v]);const z=R/2-F/2,X=L/2-w[v]/2-1,ne=Ty(f[N],X),J=Ty(f[I],X),Z=ne,re=L-w[v]-J,he=L/2-w[v]/2+z,Y=SQ(Z,he,re),ie=!c.arrow&&nA(s)!=null&&he!==Y&&a.reference[v]/2-(he<Z?ne:J)-w[v]/2<0,oe=ie?he<Z?he-Z:he-re:0;return{[g]:x[g]+oe,data:{[g]:Y,centerOffset:he-Y-oe,...ie&&{alignmentOffset:oe}},reset:ie}}}),SQe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:a,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:x,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:w=!0,...C}=z0(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const N=Xg(s),I=Py(l),P=Xg(l)===l,R=await(c.isRTL==null?void 0:c.isRTL(u.floating)),F=x||(P||!w?[$O(l)]:gQe(l)),U=v!=="none";!x&&U&&F.push(...yQe(l,w,v,R));const L=[l,...F],z=await SS(t,C),X=[];let ne=((r=a.flip)==null?void 0:r.overflows)||[];if(d&&X.push(z[N]),f){const he=xQe(s,o,R);X.push(z[he[0]],z[he[1]])}if(ne=[...ne,{placement:s,overflows:X}],!X.every(he=>he<=0)){var J,Z;const he=(((J=a.flip)==null?void 0:J.index)||0)+1,Y=L[he];if(Y)return{data:{index:he,overflows:ne},reset:{placement:Y}};let ie=(Z=ne.filter(oe=>oe.overflows[0]<=0).sort((oe,G)=>oe.overflows[1]-G.overflows[1])[0])==null?void 0:Z.placement;if(!ie)switch(g){case"bestFit":{var re;const oe=(re=ne.filter(G=>{if(U){const V=Py(G.placement);return V===I||V==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(V=>V>0).reduce((V,ee)=>V+ee,0)]).sort((G,V)=>G[1]-V[1])[0])==null?void 0:re[0];oe&&(ie=oe);break}case"initialPlacement":ie=l;break}if(s!==ie)return{reset:{placement:ie}}}return{}}}};function zde(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Hde(e){return hQe.some(t=>e[t]>=0)}const NQe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=z0(e,t);switch(r){case"referenceHidden":{const a=await SS(t,{...s,elementContext:"reference"}),o=zde(a,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Hde(o)}}}case"escaped":{const a=await SS(t,{...s,altBoundary:!0}),o=zde(a,n.floating);return{data:{escapedOffsets:o,escaped:Hde(o)}}}default:return{}}}}};async function AQe(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=Xg(n),l=nA(n),c=Py(n)==="y",u=["left","top"].includes(o)?-1:1,d=a&&c?-1:1,f=z0(t,e);let{mainAxis:x,crossAxis:g,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof v=="number"&&(g=l==="end"?v*-1:v),c?{x:g*d,y:x*u}:{x:x*u,y:g*d}}const jQe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:o,middlewareData:l}=t,c=await AQe(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:a+c.y,data:{...c,placement:o}}}}},EQe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:l={fn:C=>{let{x:N,y:I}=C;return{x:N,y:I}}},...c}=z0(e,t),u={x:n,y:r},d=await SS(t,c),f=Py(Xg(s)),x=Bre(f);let g=u[x],v=u[f];if(a){const C=x==="y"?"top":"left",N=x==="y"?"bottom":"right",I=g+d[C],P=g-d[N];g=SQ(I,g,P)}if(o){const C=f==="y"?"top":"left",N=f==="y"?"bottom":"right",I=v+d[C],P=v-d[N];v=SQ(I,v,P)}const w=l.fn({...t,[x]:g,[f]:v});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[x]:a,[f]:o}}}}}},_Qe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:a,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=z0(e,t),d={x:n,y:r},f=Py(s),x=Bre(f);let g=d[x],v=d[f];const w=z0(l,t),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const P=x==="y"?"height":"width",R=a.reference[x]-a.floating[P]+C.mainAxis,F=a.reference[x]+a.reference[P]-C.mainAxis;g<R?g=R:g>F&&(g=F)}if(u){var N,I;const P=x==="y"?"width":"height",R=["top","left"].includes(Xg(s)),F=a.reference[f]-a.floating[P]+(R&&((N=o.offset)==null?void 0:N[f])||0)+(R?0:C.crossAxis),U=a.reference[f]+a.reference[P]+(R?0:((I=o.offset)==null?void 0:I[f])||0)-(R?C.crossAxis:0);v<F?v=F:v>U&&(v=U)}return{[x]:g,[f]:v}}}},kQe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:a,platform:o,elements:l}=t,{apply:c=()=>{},...u}=z0(e,t),d=await SS(t,u),f=Xg(s),x=nA(s),g=Py(s)==="y",{width:v,height:w}=a.floating;let C,N;f==="top"||f==="bottom"?(C=f,N=x===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(N=f,C=x==="end"?"top":"bottom");const I=w-d.top-d.bottom,P=v-d.left-d.right,R=Ty(w-d[C],I),F=Ty(v-d[N],P),U=!t.middlewareData.shift;let L=R,z=F;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(z=P),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(L=I),U&&!x){const ne=wu(d.left,0),J=wu(d.right,0),Z=wu(d.top,0),re=wu(d.bottom,0);g?z=v-2*(ne!==0||J!==0?ne+J:wu(d.left,d.right)):L=w-2*(Z!==0||re!==0?Z+re:wu(d.top,d.bottom))}await c({...t,availableWidth:z,availableHeight:L});const X=await o.getDimensions(l.floating);return v!==X.width||w!==X.height?{reset:{rects:!0}}:{}}}};function kAe(e){const t=om(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=U0(e),a=s?e.offsetWidth:n,o=s?e.offsetHeight:r,l=C9(n)!==a||C9(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function zre(e){return Qu(e)?e:e.contextElement}function GC(e){const t=zre(e);if(!U0(t))return Iy(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=kAe(t);let o=(a?C9(n.width):n.width)/r,l=(a?C9(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const TQe=Iy(0);function TAe(e){const t=Of(e);return!Dre()||!t.visualViewport?TQe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function IQe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Of(e)?!1:t}function c3(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=zre(e);let o=Iy(1);t&&(r?Qu(r)&&(o=GC(r)):o=GC(e));const l=IQe(a,n,r)?TAe(a):Iy(0);let c=(s.left+l.x)/o.x,u=(s.top+l.y)/o.y,d=s.width/o.x,f=s.height/o.y;if(a){const x=Of(a),g=r&&Qu(r)?Of(r):r;let v=x,w=CQ(v);for(;w&&r&&g!==v;){const C=GC(w),N=w.getBoundingClientRect(),I=om(w),P=N.left+(w.clientLeft+parseFloat(I.paddingLeft))*C.x,R=N.top+(w.clientTop+parseFloat(I.paddingTop))*C.y;c*=C.x,u*=C.y,d*=C.x,f*=C.y,c+=P,u+=R,v=Of(w),w=CQ(v)}}return S9({width:d,height:f,x:c,y:u})}function PQe(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",o=sx(r),l=t?ND(t.floating):!1;if(r===o||l&&a)return n;let c={scrollLeft:0,scrollTop:0},u=Iy(1);const d=Iy(0),f=U0(r);if((f||!f&&!a)&&((tA(r)!=="body"||xk(o))&&(c=AD(r)),U0(r))){const x=c3(r);u=GC(r),d.x=x.x+r.clientLeft,d.y=x.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x,y:n.y*u.y-c.scrollTop*u.y+d.y}}function FQe(e){return Array.from(e.getClientRects())}function AQ(e,t){const n=AD(e).scrollLeft;return t?t.left+n:c3(sx(e)).left+n}function OQe(e){const t=sx(e),n=AD(e),r=e.ownerDocument.body,s=wu(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=wu(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+AQ(e);const l=-n.scrollTop;return om(r).direction==="rtl"&&(o+=wu(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:o,y:l}}function MQe(e,t){const n=Of(e),r=sx(e),s=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,l=0,c=0;if(s){a=s.width,o=s.height;const u=Dre();(!u||u&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:a,height:o,x:l,y:c}}function RQe(e,t){const n=c3(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=U0(e)?GC(e):Iy(1),o=e.clientWidth*a.x,l=e.clientHeight*a.y,c=s*a.x,u=r*a.y;return{width:o,height:l,x:c,y:u}}function Vde(e,t,n){let r;if(t==="viewport")r=MQe(e,n);else if(t==="document")r=OQe(sx(e));else if(Qu(t))r=RQe(t,n);else{const s=TAe(e);r={...t,x:t.x-s.x,y:t.y-s.y}}return S9(r)}function IAe(e,t){const n=ky(e);return n===t||!Qu(n)||CS(n)?!1:om(n).position==="fixed"||IAe(n,t)}function LQe(e,t){const n=t.get(e);if(n)return n;let r=w9(e,[],!1).filter(l=>Qu(l)&&tA(l)!=="body"),s=null;const a=om(e).position==="fixed";let o=a?ky(e):e;for(;Qu(o)&&!CS(o);){const l=om(o),c=Lre(o);!c&&l.position==="fixed"&&(s=null),(a?!c&&!s:!c&&l.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||xk(o)&&!c&&IAe(e,o))?r=r.filter(d=>d!==o):s=l,o=ky(o)}return t.set(e,r),r}function DQe(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?ND(t)?[]:LQe(t,this._c):[].concat(n),r],l=o[0],c=o.reduce((u,d)=>{const f=Vde(t,d,s);return u.top=wu(f.top,u.top),u.right=Ty(f.right,u.right),u.bottom=Ty(f.bottom,u.bottom),u.left=wu(f.left,u.left),u},Vde(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function BQe(e){const{width:t,height:n}=kAe(e);return{width:t,height:n}}function $Qe(e,t,n){const r=U0(t),s=sx(t),a=n==="fixed",o=c3(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=Iy(0);if(r||!r&&!a)if((tA(t)!=="body"||xk(s))&&(l=AD(t)),r){const g=c3(t,!0,a,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else s&&(c.x=AQ(s));let u=0,d=0;if(s&&!r&&!a){const g=s.getBoundingClientRect();d=g.top+l.scrollTop,u=g.left+l.scrollLeft-AQ(s,g)}const f=o.left+l.scrollLeft-c.x-u,x=o.top+l.scrollTop-c.y-d;return{x:f,y:x,width:o.width,height:o.height}}function xz(e){return om(e).position==="static"}function Wde(e,t){if(!U0(e)||om(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return sx(e)===n&&(n=n.ownerDocument.body),n}function PAe(e,t){const n=Of(e);if(ND(e))return n;if(!U0(e)){let s=ky(e);for(;s&&!CS(s);){if(Qu(s)&&!xz(s))return s;s=ky(s)}return n}let r=Wde(e,t);for(;r&&uQe(r)&&xz(r);)r=Wde(r,t);return r&&CS(r)&&xz(r)&&!Lre(r)?n:r||dQe(e)||n}const UQe=async function(e){const t=this.getOffsetParent||PAe,n=this.getDimensions,r=await n(e.floating);return{reference:$Qe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function zQe(e){return om(e).direction==="rtl"}const HQe={convertOffsetParentRelativeRectToViewportRelativeRect:PQe,getDocumentElement:sx,getClippingRect:DQe,getOffsetParent:PAe,getElementRects:UQe,getClientRects:FQe,getDimensions:BQe,getScale:GC,isElement:Qu,isRTL:zQe};function VQe(e,t){let n=null,r;const s=sx(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const{left:u,top:d,width:f,height:x}=e.getBoundingClientRect();if(l||t(),!f||!x)return;const g=SI(d),v=SI(s.clientWidth-(u+f)),w=SI(s.clientHeight-(d+x)),C=SI(u),I={rootMargin:-g+"px "+-v+"px "+-w+"px "+-C+"px",threshold:wu(0,Ty(1,c))||1};let P=!0;function R(F){const U=F[0].intersectionRatio;if(U!==c){if(!P)return o();U?o(!1,U):r=setTimeout(()=>{o(!1,1e-7)},1e3)}P=!1}try{n=new IntersectionObserver(R,{...I,root:s.ownerDocument})}catch{n=new IntersectionObserver(R,I)}n.observe(e)}return o(!0),a}function FAe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=zre(e),d=s||a?[...u?w9(u):[],...w9(t)]:[];d.forEach(N=>{s&&N.addEventListener("scroll",n,{passive:!0}),a&&N.addEventListener("resize",n)});const f=u&&l?VQe(u,n):null;let x=-1,g=null;o&&(g=new ResizeObserver(N=>{let[I]=N;I&&I.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var P;(P=g)==null||P.observe(t)})),n()}),u&&!c&&g.observe(u),g.observe(t));let v,w=c?c3(e):null;c&&C();function C(){const N=c3(e);w&&(N.x!==w.x||N.y!==w.y||N.width!==w.width||N.height!==w.height)&&n(),w=N,v=requestAnimationFrame(C)}return n(),()=>{var N;d.forEach(I=>{s&&I.removeEventListener("scroll",n),a&&I.removeEventListener("resize",n)}),f==null||f(),(N=g)==null||N.disconnect(),g=null,c&&cancelAnimationFrame(v)}}const gz=SS,OAe=jQe,MAe=EQe,RAe=SQe,LAe=kQe,WQe=NQe,qde=CQe,qQe=_Qe,DAe=(e,t,n)=>{const r=new Map,s={platform:HQe,...n},a={...s.platform,_c:r};return wQe(e,t,{...s,platform:a})};var jF=typeof document<"u"?m.useLayoutEffect:m.useEffect;function UO(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!UO(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!UO(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function BAe(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gde(e,t){const n=BAe(e);return Math.round(t*n)/n}function bz(e){const t=m.useRef(e);return jF(()=>{t.current=e}),t}function GQe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,g]=m.useState(r);UO(x,r)||g(r);const[v,w]=m.useState(null),[C,N]=m.useState(null),I=m.useCallback(G=>{G!==U.current&&(U.current=G,w(G))},[]),P=m.useCallback(G=>{G!==L.current&&(L.current=G,N(G))},[]),R=a||v,F=o||C,U=m.useRef(null),L=m.useRef(null),z=m.useRef(d),X=c!=null,ne=bz(c),J=bz(s),Z=bz(u),re=m.useCallback(()=>{if(!U.current||!L.current)return;const G={placement:t,strategy:n,middleware:x};J.current&&(G.platform=J.current),DAe(U.current,L.current,G).then(V=>{const ee={...V,isPositioned:Z.current!==!1};he.current&&!UO(z.current,ee)&&(z.current=ee,Ia.flushSync(()=>{f(ee)}))})},[x,t,n,J,Z]);jF(()=>{u===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,f(G=>({...G,isPositioned:!1})))},[u]);const he=m.useRef(!1);jF(()=>(he.current=!0,()=>{he.current=!1}),[]),jF(()=>{if(R&&(U.current=R),F&&(L.current=F),R&&F){if(ne.current)return ne.current(R,F,re);re()}},[R,F,re,ne,X]);const Y=m.useMemo(()=>({reference:U,floating:L,setReference:I,setFloating:P}),[I,P]),ie=m.useMemo(()=>({reference:R,floating:F}),[R,F]),oe=m.useMemo(()=>{const G={position:n,left:0,top:0};if(!ie.floating)return G;const V=Gde(ie.floating,d.x),ee=Gde(ie.floating,d.y);return l?{...G,transform:"translate("+V+"px, "+ee+"px)",...BAe(ie.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:ee}},[n,l,ie.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:re,refs:Y,elements:ie,floatingStyles:oe}),[d,re,Y,ie,oe])}const $Ae=(e,t)=>({...OAe(e),options:[e,t]}),KQe=(e,t)=>({...MAe(e),options:[e,t]}),YQe=(e,t)=>({...RAe(e),options:[e,t]}),XQe=(e,t)=>({...LAe(e),options:[e,t]}),UAe={...Ey},QQe=UAe.useInsertionEffect,ZQe=QQe||(e=>e());function zAe(e){const t=m.useRef(()=>{});return ZQe(()=>{t.current=e}),m.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.current==null?void 0:t.current(...r)},[])}var jQ=typeof document<"u"?m.useLayoutEffect:m.useEffect;let Kde=!1,JQe=0;const Yde=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+JQe++;function eZe(){const[e,t]=m.useState(()=>Kde?Yde():void 0);return jQ(()=>{e==null&&t(Yde())},[]),m.useEffect(()=>{Kde=!0},[]),e}const tZe=UAe.useId,nZe=tZe||eZe;function rZe(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(s=>s(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(s=>s!==n))||[])}}}const sZe=m.createContext(null),iZe=m.createContext(null),aZe=()=>{var e;return((e=m.useContext(sZe))==null?void 0:e.id)||null},oZe=()=>m.useContext(iZe),lZe="data-floating-ui-focusable";function cZe(e){const{open:t=!1,onOpenChange:n,elements:r}=e,s=nZe(),a=m.useRef({}),[o]=m.useState(()=>rZe()),l=aZe()!=null,[c,u]=m.useState(r.reference),d=zAe((g,v,w)=>{a.current.openEvent=g?v:void 0,o.emit("openchange",{open:g,event:v,reason:w,nested:l}),n==null||n(g,v,w)}),f=m.useMemo(()=>({setPositionReference:u}),[]),x=m.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return m.useMemo(()=>({dataRef:a,open:t,onOpenChange:d,elements:x,events:o,floatingId:s,refs:f}),[t,d,x,o,s,f])}function uZe(e){e===void 0&&(e={});const{nodeId:t}=e,n=cZe({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,s=r.elements,[a,o]=m.useState(null),[l,c]=m.useState(null),d=(s==null?void 0:s.reference)||a,f=m.useRef(null),x=oZe();jQ(()=>{d&&(f.current=d)},[d]);const g=GQe({...e,elements:{...s,...l&&{reference:l}}}),v=m.useCallback(P=>{const R=Qu(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),contextElement:P}:P;c(R),g.refs.setReference(R)},[g.refs]),w=m.useCallback(P=>{(Qu(P)||P===null)&&(f.current=P,o(P)),(Qu(g.refs.reference.current)||g.refs.reference.current===null||P!==null&&!Qu(P))&&g.refs.setReference(P)},[g.refs]),C=m.useMemo(()=>({...g.refs,setReference:w,setPositionReference:v,domReference:f}),[g.refs,w,v]),N=m.useMemo(()=>({...g.elements,domReference:d}),[g.elements,d]),I=m.useMemo(()=>({...g,...r,refs:C,elements:N,nodeId:t}),[g,C,N,t,r]);return jQ(()=>{r.dataRef.current.floatingContext=I;const P=x==null?void 0:x.nodesRef.current.find(R=>R.id===t);P&&(P.context=I)}),m.useMemo(()=>({...g,context:I,refs:C,elements:N}),[g,C,N,I])}const Xde="active",Qde="selected";function yz(e,t,n){const r=new Map,s=n==="item";let a=e;if(s&&e){const{[Xde]:o,[Qde]:l,...c}=e;a=c}return{...n==="floating"&&{tabIndex:-1,[lZe]:""},...a,...t.map(o=>{const l=o?o[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((o,l)=>(l&&Object.entries(l).forEach(c=>{let[u,d]=c;if(!(s&&[Xde,Qde].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof d=="function"){var f;(f=r.get(u))==null||f.push(d),o[u]=function(){for(var x,g=arguments.length,v=new Array(g),w=0;w<g;w++)v[w]=arguments[w];return(x=r.get(u))==null?void 0:x.map(C=>C(...v)).find(C=>C!==void 0)}}}else o[u]=d}),o),{})}}function dZe(e){e===void 0&&(e=[]);const t=e.map(l=>l==null?void 0:l.reference),n=e.map(l=>l==null?void 0:l.floating),r=e.map(l=>l==null?void 0:l.item),s=m.useCallback(l=>yz(l,e,"reference"),t),a=m.useCallback(l=>yz(l,e,"floating"),n),o=m.useCallback(l=>yz(l,e,"item"),r);return m.useMemo(()=>({getReferenceProps:s,getFloatingProps:a,getItemProps:o}),[s,a,o])}function Zde(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const fZe=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:s,offset:a=0,index:o=0,minItemsVisible:l=4,referenceOverflowThreshold:c=0,scrollRef:u,...d}=z0(e,t),{rects:f,elements:{floating:x}}=t,g=n.current[o],v=(u==null?void 0:u.current)||x,w=x.clientTop||v.clientTop,C=x.clientTop!==0,N=v.clientTop!==0,I=x===v;if(!g)return{};const P={...t,...await $Ae(-g.offsetTop-x.clientTop-f.reference.height/2-g.offsetHeight/2-a).fn(t)},R=await gz(Zde(P,v.scrollHeight+w+x.clientTop),d),F=await gz(P,{...d,elementContext:"reference"}),U=wu(0,R.top),L=P.y+U,z=v.scrollHeight>v.clientHeight,ne=(z?J=>J:C9)(wu(0,v.scrollHeight+(C&&I||N?w*2:0)-U-wu(0,R.bottom)));if(v.style.maxHeight=ne+"px",v.scrollTop=U,s){const J=z&&v.offsetHeight<g.offsetHeight*l-1||F.top>=-c||F.bottom>=-c;Ia.flushSync(()=>s(J))}return r&&(r.current=await gz(Zde({...P,y:L},v.offsetHeight+w+x.clientTop),d)),{y:L}}});function hZe(e,t){const{open:n,elements:r}=e,{enabled:s=!0,overflowRef:a,scrollRef:o,onChange:l}=t,c=zAe(l),u=m.useRef(!1),d=m.useRef(null),f=m.useRef(null);m.useEffect(()=>{if(!s)return;function g(w){if(w.ctrlKey||!v||a.current==null)return;const C=w.deltaY,N=a.current.top>=-.5,I=a.current.bottom>=-.5,P=v.scrollHeight-v.clientHeight,R=C<0?-1:1,F=C<0?"max":"min";v.scrollHeight<=v.clientHeight||(!N&&C>0||!I&&C<0?(w.preventDefault(),Ia.flushSync(()=>{c(U=>U+Math[F](C,P*R))})):/firefox/i.test(fQe())&&(v.scrollTop+=C))}const v=(o==null?void 0:o.current)||r.floating;if(n&&v)return v.addEventListener("wheel",g),requestAnimationFrame(()=>{d.current=v.scrollTop,a.current!=null&&(f.current={...a.current})}),()=>{d.current=null,f.current=null,v.removeEventListener("wheel",g)}},[s,n,r.floating,a,o,c]);const x=m.useMemo(()=>({onKeyDown(){u.current=!0},onWheel(){u.current=!1},onPointerMove(){u.current=!1},onScroll(){const g=(o==null?void 0:o.current)||r.floating;if(!(!a.current||!g||!u.current)){if(d.current!==null){const v=g.scrollTop-d.current;(a.current.bottom<-.5&&v<-1||a.current.top<-.5&&v>1)&&Ia.flushSync(()=>c(w=>w+v))}requestAnimationFrame(()=>{d.current=g.scrollTop})}}}),[r.floating,c,a,o]);return m.useMemo(()=>s?{floating:x}:{},[s,x])}let rA=m.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});rA.displayName="FloatingContext";let Hre=m.createContext(null);Hre.displayName="PlacementContext";function pZe(e){return m.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function mZe(){return m.useContext(rA).setReference}function xZe(){return m.useContext(rA).getReferenceProps}function gZe(){let{getFloatingProps:e,slot:t}=m.useContext(rA);return m.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function bZe(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=m.useContext(Hre),n=m.useMemo(()=>e,[JSON.stringify(e,(s,a)=>{var o;return(o=a==null?void 0:a.outerHTML)!=null?o:a})]);Ka(()=>{t==null||t(n??null)},[t,n]);let r=m.useContext(rA);return m.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let Jde=4;function yZe({children:e,enabled:t=!0}){let[n,r]=m.useState(null),[s,a]=m.useState(0),o=m.useRef(null),[l,c]=m.useState(null);vZe(l);let u=t&&n!==null&&l!==null,{to:d="bottom",gap:f=0,offset:x=0,padding:g=0,inner:v}=wZe(n,l),[w,C="center"]=d.split(" ");Ka(()=>{u&&a(0)},[u]);let{refs:N,floatingStyles:I,context:P}=uZe({open:u,placement:w==="selection"?C==="center"?"bottom":`bottom-${C}`:C==="center"?`${w}`:`${w}-${C}`,strategy:"absolute",transform:!1,middleware:[$Ae({mainAxis:w==="selection"?0:f,crossAxis:x}),KQe({padding:g}),w!=="selection"&&YQe({padding:g}),w==="selection"&&v?fZe({...v,padding:g,overflowRef:o,offset:s,minItemsVisible:Jde,referenceOverflowThreshold:g,onFallbackChange(J){var Z,re;if(!J)return;let he=P.elements.floating;if(!he)return;let Y=parseFloat(getComputedStyle(he).scrollPaddingBottom)||0,ie=Math.min(Jde,he.childElementCount),oe=0,G=0;for(let V of(re=(Z=P.elements.floating)==null?void 0:Z.childNodes)!=null?re:[])if(V instanceof HTMLElement){let ee=V.offsetTop,ae=ee+V.clientHeight+Y,fe=he.scrollTop,Ae=fe+he.clientHeight;if(ee>=fe&&ae<=Ae)ie--;else{G=Math.max(0,Math.min(ae,Ae)-Math.max(ee,fe)),oe=V.clientHeight;break}}ie>=1&&a(V=>{let ee=oe*ie-G+Y;return V>=ee?V:ee})}}):null,XQe({padding:g,apply({availableWidth:J,availableHeight:Z,elements:re}){Object.assign(re.floating.style,{overflow:"auto",maxWidth:`${J}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${Z}px)`})}})].filter(Boolean),whileElementsMounted:FAe}),[R=w,F=C]=P.placement.split("-");w==="selection"&&(R="selection");let U=m.useMemo(()=>({anchor:[R,F].filter(Boolean).join(" ")}),[R,F]),L=hZe(P,{overflowRef:o,onChange:a}),{getReferenceProps:z,getFloatingProps:X}=dZe([L]),ne=Rs(J=>{c(J),N.setFloating(J)});return m.createElement(Hre.Provider,{value:r},m.createElement(rA.Provider,{value:{setFloating:ne,setReference:N.setReference,styles:I,getReferenceProps:z,getFloatingProps:X,slot:U}},e))}function vZe(e){Ka(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let s=parseInt(n);isNaN(s)||r!==s&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function wZe(e,t){var n,r,s;let a=vz((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),o=vz((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),l=vz((s=e==null?void 0:e.padding)!=null?s:"var(--anchor-padding, 0)",t);return{...e,gap:a,offset:o,padding:l}}function vz(e,t,n=void 0){let r=Zy(),s=Rs((c,u)=>{if(c==null)return[n,null];if(typeof c=="number")return[c,null];if(typeof c=="string"){if(!u)return[n,null];let d=efe(c,u);return[d,f=>{let x=HAe(c);{let g=x.map(v=>window.getComputedStyle(u).getPropertyValue(v));r.requestAnimationFrame(function v(){r.nextFrame(v);let w=!1;for(let[N,I]of x.entries()){let P=window.getComputedStyle(u).getPropertyValue(I);if(g[N]!==P){g[N]=P,w=!0;break}}if(!w)return;let C=efe(c,u);d!==C&&(f(C),d=C)})}return r.dispose}]}return[n,null]}),a=m.useMemo(()=>s(e,t)[0],[e,t]),[o=a,l]=m.useState();return Ka(()=>{let[c,u]=s(e,t);if(l(c),!!u)return u(l)},[e,t]),o}function HAe(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),s=t[1].slice(n+1).trim();return s?[r,...HAe(s)]:[r]}return[]}function efe(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}let jD=m.createContext(null);jD.displayName="OpenClosedContext";var Kl=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Kl||{});function sA(){return m.useContext(jD)}function Vre({value:e,children:t}){return Se.createElement(jD.Provider,{value:e},t)}function VAe({children:e}){return Se.createElement(jD.Provider,{value:null},e)}function CZe(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let _b=[];CZe(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||_b[0]===t.target)return;let n=t.target;n=n.closest(BO),_b.unshift(n??t.target),_b=_b.filter(r=>r!=null&&r.isConnected),_b.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function SZe(e){throw new Error("Unexpected object: "+e)}var Nu=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Nu||{});function wz(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),s=r??-1;switch(e.focus){case 0:{for(let a=0;a<n.length;++a)if(!t.resolveDisabled(n[a],a,n))return a;return r}case 1:{s===-1&&(s=n.length);for(let a=s-1;a>=0;--a)if(!t.resolveDisabled(n[a],a,n))return a;return r}case 2:{for(let a=s+1;a<n.length;++a)if(!t.resolveDisabled(n[a],a,n))return a;return r}case 3:{for(let a=n.length-1;a>=0;--a)if(!t.resolveDisabled(n[a],a,n))return a;return r}case 4:{for(let a=0;a<n.length;++a)if(t.resolveId(n[a],a,n)===e.id)return a;return r}case 5:return null;default:SZe(e)}}function WAe(e){let t=Rs(e),n=m.useRef(!1);m.useEffect(()=>(n.current=!1,()=>{n.current=!0,vD(()=>{n.current&&t()})}),[t])}function NZe(){let e=typeof document>"u";return"useSyncExternalStore"in Ey?(t=>t.useSyncExternalStore)(Ey)(()=>()=>{},()=>!1,()=>!e):!1}function gk(){let e=NZe(),[t,n]=m.useState(Bw.isHandoffComplete);return t&&Bw.isHandoffComplete===!1&&n(!1),m.useEffect(()=>{t!==!0&&n(!0)},[t]),m.useEffect(()=>Bw.handoff(),[]),e?!1:t}let qAe=m.createContext(!1);function AZe(){return m.useContext(qAe)}function tfe(e){return Se.createElement(qAe.Provider,{value:e.force},e.children)}function jZe(e){let t=AZe(),n=m.useContext(KAe),r=eA(e),[s,a]=m.useState(()=>{var o;if(!t&&n!==null)return(o=n.current)!=null?o:null;if(Bw.isServer)return null;let l=r==null?void 0:r.getElementById("headlessui-portal-root");if(l)return l;if(r===null)return null;let c=r.createElement("div");return c.setAttribute("id","headlessui-portal-root"),r.body.appendChild(c)});return m.useEffect(()=>{s!==null&&(r!=null&&r.body.contains(s)||r==null||r.body.appendChild(s))},[s,r]),m.useEffect(()=>{t||n!==null&&a(n.current)},[n,a,t]),s}let GAe=m.Fragment,EZe=oo(function(e,t){let n=e,r=m.useRef(null),s=tc(cAe(f=>{r.current=f}),t),a=eA(r),o=jZe(r),[l]=m.useState(()=>{var f;return Bw.isServer?null:(f=a==null?void 0:a.createElement("div"))!=null?f:null}),c=m.useContext(EQ),u=gk();Ka(()=>{!o||!l||o.contains(l)||(l.setAttribute("data-headlessui-portal",""),o.appendChild(l))},[o,l]),Ka(()=>{if(l&&c)return c.register(l)},[c,l]),WAe(()=>{var f;!o||!l||(l instanceof Node&&o.contains(l)&&o.removeChild(l),o.childNodes.length<=0&&((f=o.parentElement)==null||f.removeChild(o)))});let d=yo();return u?!o||!l?null:Ia.createPortal(d({ourProps:{ref:s},theirProps:n,slot:{},defaultTag:GAe,name:"Portal"}),l):null});function _Ze(e,t){let n=tc(t),{enabled:r=!0,...s}=e,a=yo();return r?Se.createElement(EZe,{...s,ref:n}):a({ourProps:{ref:n},theirProps:s,slot:{},defaultTag:GAe,name:"Portal"})}let kZe=m.Fragment,KAe=m.createContext(null);function TZe(e,t){let{target:n,...r}=e,s={ref:tc(t)},a=yo();return Se.createElement(KAe.Provider,{value:n},a({ourProps:s,theirProps:r,defaultTag:kZe,name:"Popover.Group"}))}let EQ=m.createContext(null);function IZe(){let e=m.useContext(EQ),t=m.useRef([]),n=Rs(a=>(t.current.push(a),e&&e.register(a),()=>r(a))),r=Rs(a=>{let o=t.current.indexOf(a);o!==-1&&t.current.splice(o,1),e&&e.unregister(a)}),s=m.useMemo(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,m.useMemo(()=>function({children:a}){return Se.createElement(EQ.Provider,{value:s},a)},[s])]}let PZe=oo(_Ze),YAe=oo(TZe),XAe=Object.assign(PZe,{Group:YAe});function FZe(e,t=typeof document<"u"?document.defaultView:null,n){let r=JN(e,"escape");NAe(t,"keydown",s=>{r&&(s.defaultPrevented||s.key===ho.Escape&&n(s))})}function OZe(){var e;let[t]=m.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[n,r]=m.useState((e=t==null?void 0:t.matches)!=null?e:!1);return Ka(()=>{if(!t)return;function s(a){r(a.matches)}return t.addEventListener("change",s),()=>t.removeEventListener("change",s)},[t]),n}function MZe({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=eA(n),s=Rs(()=>{var a,o;let l=[];for(let c of e)c!==null&&(c instanceof HTMLElement?l.push(c):"current"in c&&c.current instanceof HTMLElement&&l.push(c.current));if(t!=null&&t.current)for(let c of t.current)l.push(c);for(let c of(a=r==null?void 0:r.querySelectorAll("html > *, body > *"))!=null?a:[])c!==document.body&&c!==document.head&&c instanceof HTMLElement&&c.id!=="headlessui-portal-root"&&(n&&(c.contains(n)||c.contains((o=n==null?void 0:n.getRootNode())==null?void 0:o.host))||l.some(u=>c.contains(u))||l.push(c));return l});return{resolveContainers:s,contains:Rs(a=>s().some(o=>o.contains(a)))}}let QAe=m.createContext(null);function nfe({children:e,node:t}){let[n,r]=m.useState(null),s=ZAe(t??n);return Se.createElement(QAe.Provider,{value:s},e,s===null&&Se.createElement(v9,{features:wS.Hidden,ref:a=>{var o,l;if(a){for(let c of(l=(o=Qy(a))==null?void 0:o.querySelectorAll("html > *, body > *"))!=null?l:[])if(c!==document.body&&c!==document.head&&c instanceof HTMLElement&&c!=null&&c.contains(a)){r(c);break}}}}))}function ZAe(e=null){var t;return(t=m.useContext(QAe))!=null?t:e}function Wre(){let e=m.useRef(!1);return Ka(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var aj=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(aj||{});function RZe(){let e=m.useRef(0);return CAe(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function JAe(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}let LZe="div";var Tv=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(Tv||{});function DZe(e,t){let n=m.useRef(null),r=tc(n,t),{initialFocus:s,initialFocusFallback:a,containers:o,features:l=15,...c}=e;gk()||(l=0);let u=eA(n);zZe(l,{ownerDocument:u});let d=HZe(l,{ownerDocument:u,container:n,initialFocus:s,initialFocusFallback:a});VZe(l,{ownerDocument:u,container:n,containers:o,previousActiveElement:d});let f=RZe(),x=Rs(I=>{let P=n.current;P&&(R=>R())(()=>{Bf(f.current,{[aj.Forwards]:()=>{qC(P,Gp.First,{skipElements:[I.relatedTarget,a]})},[aj.Backwards]:()=>{qC(P,Gp.Last,{skipElements:[I.relatedTarget,a]})}})})}),g=JN(!!(l&2),"focus-trap#tab-lock"),v=Zy(),w=m.useRef(!1),C={ref:r,onKeyDown(I){I.key=="Tab"&&(w.current=!0,v.requestAnimationFrame(()=>{w.current=!1}))},onBlur(I){if(!(l&4))return;let P=JAe(o);n.current instanceof HTMLElement&&P.add(n.current);let R=I.relatedTarget;R instanceof HTMLElement&&R.dataset.headlessuiFocusGuard!=="true"&&(e8e(P,R)||(w.current?qC(n.current,Bf(f.current,{[aj.Forwards]:()=>Gp.Next,[aj.Backwards]:()=>Gp.Previous})|Gp.WrapAround,{relativeTo:I.target}):I.target instanceof HTMLElement&&k0(I.target)))}},N=yo();return Se.createElement(Se.Fragment,null,g&&Se.createElement(v9,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:x,features:wS.Focusable}),N({ourProps:C,theirProps:c,defaultTag:LZe,name:"FocusTrap"}),g&&Se.createElement(v9,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:x,features:wS.Focusable}))}let BZe=oo(DZe),$Ze=Object.assign(BZe,{features:Tv});function UZe(e=!0){let t=m.useRef(_b.slice());return Rre(([n],[r])=>{r===!0&&n===!1&&vD(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=_b.slice())},[e,_b,t]),Rs(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function zZe(e,{ownerDocument:t}){let n=!!(e&8),r=UZe(n);Rre(()=>{n||(t==null?void 0:t.activeElement)===(t==null?void 0:t.body)&&k0(r())},[n]),WAe(()=>{n&&k0(r())})}function HZe(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:s}){let a=m.useRef(null),o=JN(!!(e&1),"focus-trap#initial-focus"),l=Wre();return Rre(()=>{if(e===0)return;if(!o){s!=null&&s.current&&k0(s.current);return}let c=n.current;c&&vD(()=>{if(!l.current)return;let u=t==null?void 0:t.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===u){a.current=u;return}}else if(c.contains(u)){a.current=u;return}if(r!=null&&r.current)k0(r.current);else{if(e&16){if(qC(c,Gp.First|Gp.AutoFocus)!==wQ.Error)return}else if(qC(c,Gp.First)!==wQ.Error)return;if(s!=null&&s.current&&(k0(s.current),(t==null?void 0:t.activeElement)===s.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}a.current=t==null?void 0:t.activeElement})},[s,o,e]),a}function VZe(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:s}){let a=Wre(),o=!!(e&4);NAe(t==null?void 0:t.defaultView,"focus",l=>{if(!o||!a.current)return;let c=JAe(r);n.current instanceof HTMLElement&&c.add(n.current);let u=s.current;if(!u)return;let d=l.target;d&&d instanceof HTMLElement?e8e(c,d)?(s.current=d,k0(d)):(l.preventDefault(),l.stopPropagation(),k0(u)):k0(s.current)},!0)}function e8e(e,t){for(let n of e)if(n.contains(t))return!0;return!1}function t8e(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:r8e)!==m.Fragment||Se.Children.count(e.children)===1}let ED=m.createContext(null);ED.displayName="TransitionContext";var WZe=(e=>(e.Visible="visible",e.Hidden="hidden",e))(WZe||{});function qZe(){let e=m.useContext(ED);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function GZe(){let e=m.useContext(_D);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let _D=m.createContext(null);_D.displayName="NestingContext";function kD(e){return"children"in e?kD(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function n8e(e,t){let n=e5(e),r=m.useRef([]),s=Wre(),a=Zy(),o=Rs((g,v=ay.Hidden)=>{let w=r.current.findIndex(({el:C})=>C===g);w!==-1&&(Bf(v,{[ay.Unmount](){r.current.splice(w,1)},[ay.Hidden](){r.current[w].state="hidden"}}),a.microTask(()=>{var C;!kD(r)&&s.current&&((C=n.current)==null||C.call(n))}))}),l=Rs(g=>{let v=r.current.find(({el:w})=>w===g);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:g,state:"visible"}),()=>o(g,ay.Unmount)}),c=m.useRef([]),u=m.useRef(Promise.resolve()),d=m.useRef({enter:[],leave:[]}),f=Rs((g,v,w)=>{c.current.splice(0),t&&(t.chains.current[v]=t.chains.current[v].filter(([C])=>C!==g)),t==null||t.chains.current[v].push([g,new Promise(C=>{c.current.push(C)})]),t==null||t.chains.current[v].push([g,new Promise(C=>{Promise.all(d.current[v].map(([N,I])=>I)).then(()=>C())})]),v==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>w(v)):w(v)}),x=Rs((g,v,w)=>{Promise.all(d.current[v].splice(0).map(([C,N])=>N)).then(()=>{var C;(C=c.current.shift())==null||C()}).then(()=>w(v))});return m.useMemo(()=>({children:r,register:l,unregister:o,onStart:f,onStop:x,wait:u,chains:d}),[l,o,r,f,x,d,u])}let r8e=m.Fragment,s8e=_y.RenderStrategy;function KZe(e,t){var n,r;let{transition:s=!0,beforeEnter:a,afterEnter:o,beforeLeave:l,afterLeave:c,enter:u,enterFrom:d,enterTo:f,entered:x,leave:g,leaveFrom:v,leaveTo:w,...C}=e,[N,I]=m.useState(null),P=m.useRef(null),R=t8e(e),F=tc(...R?[P,t,I]:t===null?[]:[t]),U=(n=C.unmount)==null||n?ay.Unmount:ay.Hidden,{show:L,appear:z,initial:X}=qZe(),[ne,J]=m.useState(L?"visible":"hidden"),Z=GZe(),{register:re,unregister:he}=Z;Ka(()=>re(P),[re,P]),Ka(()=>{if(U===ay.Hidden&&P.current){if(L&&ne!=="visible"){J("visible");return}return Bf(ne,{hidden:()=>he(P),visible:()=>re(P)})}},[ne,P,re,he,L,U]);let Y=gk();Ka(()=>{if(R&&Y&&ne==="visible"&&P.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[P,ne,Y,R]);let ie=X&&!z,oe=z&&L&&X,G=m.useRef(!1),V=n8e(()=>{G.current||(J("hidden"),he(P))},Z),ee=Rs(be=>{G.current=!0;let je=be?"enter":"leave";V.onStart(P,je,Ie=>{Ie==="enter"?a==null||a():Ie==="leave"&&(l==null||l())})}),ae=Rs(be=>{let je=be?"enter":"leave";G.current=!1,V.onStop(P,je,Ie=>{Ie==="enter"?o==null||o():Ie==="leave"&&(c==null||c())}),je==="leave"&&!kD(V)&&(J("hidden"),he(P))});m.useEffect(()=>{R&&s||(ee(L),ae(L))},[L,R,s]);let fe=!(!s||!R||!Y||ie),[,Ae]=Mre(fe,N,L,{start:ee,end:ae}),ce=Ab({ref:F,className:((r=yQ(C.className,oe&&u,oe&&d,Ae.enter&&u,Ae.enter&&Ae.closed&&d,Ae.enter&&!Ae.closed&&f,Ae.leave&&g,Ae.leave&&!Ae.closed&&v,Ae.leave&&Ae.closed&&w,!Ae.transition&&L&&x))==null?void 0:r.trim())||void 0,...Ore(Ae)}),ye=0;ne==="visible"&&(ye|=Kl.Open),ne==="hidden"&&(ye|=Kl.Closed),Ae.enter&&(ye|=Kl.Opening),Ae.leave&&(ye|=Kl.Closing);let Ne=yo();return Se.createElement(_D.Provider,{value:V},Se.createElement(Vre,{value:ye},Ne({ourProps:ce,theirProps:C,defaultTag:r8e,features:s8e,visible:ne==="visible",name:"Transition.Child"})))}function YZe(e,t){let{show:n,appear:r=!1,unmount:s=!0,...a}=e,o=m.useRef(null),l=t8e(e),c=tc(...l?[o,t]:t===null?[]:[t]);gk();let u=sA();if(n===void 0&&u!==null&&(n=(u&Kl.Open)===Kl.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[d,f]=m.useState(n?"visible":"hidden"),x=n8e(()=>{n||f("hidden")}),[g,v]=m.useState(!0),w=m.useRef([n]);Ka(()=>{g!==!1&&w.current[w.current.length-1]!==n&&(w.current.push(n),v(!1))},[w,n]);let C=m.useMemo(()=>({show:n,appear:r,initial:g}),[n,r,g]);Ka(()=>{n?f("visible"):!kD(x)&&o.current!==null&&f("hidden")},[n,x]);let N={unmount:s},I=Rs(()=>{var F;g&&v(!1),(F=e.beforeEnter)==null||F.call(e)}),P=Rs(()=>{var F;g&&v(!1),(F=e.beforeLeave)==null||F.call(e)}),R=yo();return Se.createElement(_D.Provider,{value:x},Se.createElement(ED.Provider,{value:C},R({ourProps:{...N,as:m.Fragment,children:Se.createElement(i8e,{ref:c,...N,...a,beforeEnter:I,beforeLeave:P})},theirProps:{},defaultTag:m.Fragment,features:s8e,visible:d==="visible",name:"Transition"})))}function XZe(e,t){let n=m.useContext(ED)!==null,r=sA()!==null;return Se.createElement(Se.Fragment,null,!n&&r?Se.createElement(_Q,{ref:t,...e}):Se.createElement(i8e,{ref:t,...e}))}let _Q=oo(YZe),i8e=oo(KZe),qre=oo(XZe),a8e=Object.assign(_Q,{Child:qre,Root:_Q});var QZe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(QZe||{}),ZZe=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(ZZe||{});let JZe={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Gre=m.createContext(null);Gre.displayName="DialogContext";function TD(e){let t=m.useContext(Gre);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,TD),n}return t}function eJe(e,t){return Bf(t.type,JZe,e,t)}let rfe=oo(function(e,t){let n=m.useId(),{id:r=`headlessui-dialog-${n}`,open:s,onClose:a,initialFocus:o,role:l="dialog",autoFocus:c=!0,__demoMode:u=!1,unmount:d=!1,...f}=e,x=m.useRef(!1);l=function(){return l==="dialog"||l==="alertdialog"?l:(x.current||(x.current=!0,console.warn(`Invalid role [${l}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let g=sA();s===void 0&&g!==null&&(s=(g&Kl.Open)===Kl.Open);let v=m.useRef(null),w=tc(v,t),C=eA(v),N=s?0:1,[I,P]=m.useReducer(eJe,{titleId:null,descriptionId:null,panelRef:m.createRef()}),R=Rs(()=>a(!1)),F=Rs(ae=>P({type:0,id:ae})),U=gk()?N===0:!1,[L,z]=IZe(),X={get current(){var ae;return(ae=I.panelRef.current)!=null?ae:v.current}},ne=ZAe(),{resolveContainers:J}=MZe({mainTreeNode:ne,portals:L,defaultContainers:[X]}),Z=g!==null?(g&Kl.Closing)===Kl.Closing:!1;xAe(u||Z?!1:U,{allowed:Rs(()=>{var ae,fe;return[(fe=(ae=v.current)==null?void 0:ae.closest("[data-headlessui-portal]"))!=null?fe:null]}),disallowed:Rs(()=>{var ae;return[(ae=ne==null?void 0:ne.closest("body > *:not(#headlessui-portal-root)"))!=null?ae:null]})}),SAe(U,J,ae=>{ae.preventDefault(),R()}),FZe(U,C==null?void 0:C.defaultView,ae=>{ae.preventDefault(),ae.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),R()}),AAe(u||Z?!1:U,C,J),gAe(U,v,R);let[re,he]=_re(),Y=m.useMemo(()=>[{dialogState:N,close:R,setTitleId:F,unmount:d},I],[N,I,R,F,d]),ie=m.useMemo(()=>({open:N===0}),[N]),oe={ref:w,id:r,role:l,tabIndex:-1,"aria-modal":u?void 0:N===0?!0:void 0,"aria-labelledby":I.titleId,"aria-describedby":re,unmount:d},G=!OZe(),V=Tv.None;U&&!u&&(V|=Tv.RestoreFocus,V|=Tv.TabLock,c&&(V|=Tv.AutoFocus),G&&(V|=Tv.InitialFocus));let ee=yo();return Se.createElement(VAe,null,Se.createElement(tfe,{force:!0},Se.createElement(XAe,null,Se.createElement(Gre.Provider,{value:Y},Se.createElement(YAe,{target:v},Se.createElement(tfe,{force:!1},Se.createElement(he,{slot:ie},Se.createElement(z,null,Se.createElement($Ze,{initialFocus:o,initialFocusFallback:v,containers:J,features:V},Se.createElement(hAe,{value:R},ee({ourProps:oe,theirProps:f,slot:ie,defaultTag:tJe,features:nJe,visible:N===0,name:"Dialog"})))))))))))}),tJe="div",nJe=_y.RenderStrategy|_y.Static;function rJe(e,t){let{transition:n=!1,open:r,...s}=e,a=sA(),o=e.hasOwnProperty("open")||a!==null,l=e.hasOwnProperty("onClose");if(!o&&!l)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!o)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!l)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof e.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(r!==void 0||n)&&!s.static?Se.createElement(nfe,null,Se.createElement(a8e,{show:r,transition:n,unmount:s.unmount},Se.createElement(rfe,{ref:t,...s}))):Se.createElement(nfe,null,Se.createElement(rfe,{ref:t,open:r,...s}))}let sJe="div";function iJe(e,t){let n=m.useId(),{id:r=`headlessui-dialog-panel-${n}`,transition:s=!1,...a}=e,[{dialogState:o,unmount:l},c]=TD("Dialog.Panel"),u=tc(t,c.panelRef),d=m.useMemo(()=>({open:o===0}),[o]),f=Rs(C=>{C.stopPropagation()}),x={ref:u,id:r,onClick:f},g=s?qre:m.Fragment,v=s?{unmount:l}:{},w=yo();return Se.createElement(g,{...v},w({ourProps:x,theirProps:a,slot:d,defaultTag:sJe,name:"Dialog.Panel"}))}let aJe="div";function oJe(e,t){let{transition:n=!1,...r}=e,[{dialogState:s,unmount:a}]=TD("Dialog.Backdrop"),o=m.useMemo(()=>({open:s===0}),[s]),l={ref:t,"aria-hidden":!0},c=n?qre:m.Fragment,u=n?{unmount:a}:{},d=yo();return Se.createElement(c,{...u},d({ourProps:l,theirProps:r,slot:o,defaultTag:aJe,name:"Dialog.Backdrop"}))}let lJe="h2";function cJe(e,t){let n=m.useId(),{id:r=`headlessui-dialog-title-${n}`,...s}=e,[{dialogState:a,setTitleId:o}]=TD("Dialog.Title"),l=tc(t);m.useEffect(()=>(o(r),()=>o(null)),[r,o]);let c=m.useMemo(()=>({open:a===0}),[a]),u={ref:l,id:r};return yo()({ourProps:u,theirProps:s,slot:c,defaultTag:lJe,name:"Dialog.Title"})}let uJe=oo(rJe),da=oo(iJe),xa=oo(oJe),dJe=oo(cJe),ga=Object.assign(uJe,{Panel:da,Title:dJe,Description:dAe});var sfe;let fJe=(sfe=Se.startTransition)!=null?sfe:function(e){e()};var hJe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(hJe||{}),pJe=(e=>(e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.CloseDisclosure=1]="CloseDisclosure",e[e.SetButtonId=2]="SetButtonId",e[e.SetPanelId=3]="SetPanelId",e[e.SetButtonElement=4]="SetButtonElement",e[e.SetPanelElement=5]="SetPanelElement",e))(pJe||{});let mJe={0:e=>({...e,disclosureState:Bf(e.disclosureState,{0:1,1:0})}),1:e=>e.disclosureState===1?e:{...e,disclosureState:1},2(e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},3(e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}},4(e,t){return e.buttonElement===t.element?e:{...e,buttonElement:t.element}},5(e,t){return e.panelElement===t.element?e:{...e,panelElement:t.element}}},Kre=m.createContext(null);Kre.displayName="DisclosureContext";function Yre(e){let t=m.useContext(Kre);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Yre),n}return t}let Xre=m.createContext(null);Xre.displayName="DisclosureAPIContext";function o8e(e){let t=m.useContext(Xre);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,o8e),n}return t}let Qre=m.createContext(null);Qre.displayName="DisclosurePanelContext";function xJe(){return m.useContext(Qre)}function gJe(e,t){return Bf(t.type,mJe,e,t)}let bJe=m.Fragment;function yJe(e,t){let{defaultOpen:n=!1,...r}=e,s=m.useRef(null),a=tc(t,cAe(w=>{s.current=w},e.as===void 0||e.as===m.Fragment)),o=m.useReducer(gJe,{disclosureState:n?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:l,buttonId:c},u]=o,d=Rs(w=>{u({type:1});let C=Qy(s);if(!C||!c)return;let N=w?w instanceof HTMLElement?w:w.current instanceof HTMLElement?w.current:C.getElementById(c):C.getElementById(c);N==null||N.focus()}),f=m.useMemo(()=>({close:d}),[d]),x=m.useMemo(()=>({open:l===0,close:d}),[l,d]),g={ref:a},v=yo();return Se.createElement(Kre.Provider,{value:o},Se.createElement(Xre.Provider,{value:f},Se.createElement(hAe,{value:d},Se.createElement(Vre,{value:Bf(l,{0:Kl.Open,1:Kl.Closed})},v({ourProps:g,theirProps:r,slot:x,defaultTag:bJe,name:"Disclosure"})))))}let vJe="button";function wJe(e,t){let n=m.useId(),{id:r=`headlessui-disclosure-button-${n}`,disabled:s=!1,autoFocus:a=!1,...o}=e,[l,c]=Yre("Disclosure.Button"),u=xJe(),d=u===null?!1:u===l.panelId,f=m.useRef(null),x=tc(f,t,Rs(X=>{if(!d)return c({type:4,element:X})}));m.useEffect(()=>{if(!d)return c({type:2,buttonId:r}),()=>{c({type:2,buttonId:null})}},[r,c,d]);let g=Rs(X=>{var ne;if(d){if(l.disclosureState===1)return;switch(X.key){case ho.Space:case ho.Enter:X.preventDefault(),X.stopPropagation(),c({type:0}),(ne=l.buttonElement)==null||ne.focus();break}}else switch(X.key){case ho.Space:case ho.Enter:X.preventDefault(),X.stopPropagation(),c({type:0});break}}),v=Rs(X=>{switch(X.key){case ho.Space:X.preventDefault();break}}),w=Rs(X=>{var ne;Ere(X.currentTarget)||s||(d?(c({type:0}),(ne=l.buttonElement)==null||ne.focus()):c({type:0}))}),{isFocusVisible:C,focusProps:N}=Nre({autoFocus:a}),{isHovered:I,hoverProps:P}=Sre({isDisabled:s}),{pressed:R,pressProps:F}=Are({disabled:s}),U=m.useMemo(()=>({open:l.disclosureState===0,hover:I,active:R,disabled:s,focus:C,autofocus:a}),[l,I,R,C,s,a]),L=Fre(e,l.buttonElement),z=y9(d?{ref:x,type:L,disabled:s||void 0,autoFocus:a,onKeyDown:g,onClick:w}:{ref:x,id:r,type:L,"aria-expanded":l.disclosureState===0,"aria-controls":l.panelElement?l.panelId:void 0,disabled:s||void 0,autoFocus:a,onKeyDown:g,onKeyUp:v,onClick:w},N,P,F);return yo()({ourProps:z,theirProps:o,slot:U,defaultTag:vJe,name:"Disclosure.Button"})}let CJe="div",SJe=_y.RenderStrategy|_y.Static;function NJe(e,t){let n=m.useId(),{id:r=`headlessui-disclosure-panel-${n}`,transition:s=!1,...a}=e,[o,l]=Yre("Disclosure.Panel"),{close:c}=o8e("Disclosure.Panel"),[u,d]=m.useState(null),f=tc(t,Rs(I=>{fJe(()=>l({type:5,element:I}))}),d);m.useEffect(()=>(l({type:3,panelId:r}),()=>{l({type:3,panelId:null})}),[r,l]);let x=sA(),[g,v]=Mre(s,u,x!==null?(x&Kl.Open)===Kl.Open:o.disclosureState===0),w=m.useMemo(()=>({open:o.disclosureState===0,close:c}),[o.disclosureState,c]),C={ref:f,id:r,...Ore(v)},N=yo();return Se.createElement(VAe,null,Se.createElement(Qre.Provider,{value:o.panelId},N({ourProps:C,theirProps:a,slot:w,defaultTag:CJe,features:SJe,visible:g,name:"Disclosure.Panel"})))}let AJe=oo(yJe),Zre=oo(wJe),Jre=oo(NJe),l8e=Object.assign(AJe,{Button:Zre,Panel:Jre});function jJe(e,t){let n=m.useRef({left:0,top:0});if(Ka(()=>{if(!t)return;let s=t.getBoundingClientRect();s&&(n.current=s)},[e,t]),t==null||!e||t===document.activeElement)return!1;let r=t.getBoundingClientRect();return r.top!==n.current.top||r.left!==n.current.left}let ife=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function afe(e){var t,n;let r=(t=e.innerText)!=null?t:"",s=e.cloneNode(!0);if(!(s instanceof HTMLElement))return r;let a=!1;for(let l of s.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))l.remove(),a=!0;let o=a?(n=s.innerText)!=null?n:"":r;return ife.test(o)&&(o=o.replace(ife,"")),o}function EJe(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(s=>{let a=document.getElementById(s);if(a){let o=a.getAttribute("aria-label");return typeof o=="string"?o.trim():afe(a).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return afe(e).trim()}function _Je(e){let t=m.useRef(""),n=m.useRef("");return Rs(()=>{let r=e.current;if(!r)return"";let s=r.innerText;if(t.current===s)return n.current;let a=EJe(r).trim().toLowerCase();return t.current=s,n.current=a,a})}var kJe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(kJe||{}),TJe=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(TJe||{}),IJe=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetItemsElement=8]="SetItemsElement",e))(IJe||{});function Cz(e,t=n=>n){let n=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,r=vAe(t(e.items.slice()),a=>a.dataRef.current.domRef.current),s=n?r.indexOf(n):null;return s===-1&&(s=null),{items:r,activeItemIndex:s}}let PJe={1(e){return e.menuState===1?e:{...e,activeItemIndex:null,menuState:1}},0(e){return e.menuState===0?e:{...e,__demoMode:!1,menuState:0}},2:(e,t)=>{var n,r,s,a,o;if(e.menuState===1)return e;let l={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===Nu.Nothing)return{...l,activeItemIndex:null};if(t.focus===Nu.Specific)return{...l,activeItemIndex:e.items.findIndex(d=>d.id===t.id)};if(t.focus===Nu.Previous){let d=e.activeItemIndex;if(d!==null){let f=e.items[d].dataRef.current.domRef,x=wz(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:g=>g.id,resolveDisabled:g=>g.dataRef.current.disabled});if(x!==null){let g=e.items[x].dataRef.current.domRef;if(((r=f.current)==null?void 0:r.previousElementSibling)===g.current||((s=g.current)==null?void 0:s.previousElementSibling)===null)return{...l,activeItemIndex:x}}}}else if(t.focus===Nu.Next){let d=e.activeItemIndex;if(d!==null){let f=e.items[d].dataRef.current.domRef,x=wz(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:g=>g.id,resolveDisabled:g=>g.dataRef.current.disabled});if(x!==null){let g=e.items[x].dataRef.current.domRef;if(((a=f.current)==null?void 0:a.nextElementSibling)===g.current||((o=g.current)==null?void 0:o.nextElementSibling)===null)return{...l,activeItemIndex:x}}}}let c=Cz(e),u=wz(t,{resolveItems:()=>c.items,resolveActiveIndex:()=>c.activeItemIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});return{...l,...c,activeItemIndex:u}},3:(e,t)=>{let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),s=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find(o=>{var l;return((l=o.dataRef.current.textValue)==null?void 0:l.startsWith(r))&&!o.dataRef.current.disabled}),a=s?e.items.indexOf(s):-1;return a===-1||a===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:a,activationTrigger:1}},4(e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},5:(e,t)=>{let n=Cz(e,r=>[...r,{id:t.id,dataRef:t.dataRef}]);return{...e,...n}},6:(e,t)=>{let n=Cz(e,r=>{let s=r.findIndex(a=>a.id===t.id);return s!==-1&&r.splice(s,1),r});return{...e,...n,activationTrigger:1}},7:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},8:(e,t)=>e.itemsElement===t.element?e:{...e,itemsElement:t.element}},ese=m.createContext(null);ese.displayName="MenuContext";function ID(e){let t=m.useContext(ese);if(t===null){let n=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ID),n}return t}function FJe(e,t){return Bf(t.type,PJe,e,t)}let OJe=m.Fragment;function MJe(e,t){let{__demoMode:n=!1,...r}=e,s=m.useReducer(FJe,{__demoMode:n,menuState:n?0:1,buttonElement:null,itemsElement:null,items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:a,itemsElement:o,buttonElement:l},c]=s,u=tc(t);SAe(a===0,[l,o],(v,w)=>{c({type:1}),Pre(w,Ire.Loose)||(v.preventDefault(),l==null||l.focus())});let d=Rs(()=>{c({type:1})}),f=m.useMemo(()=>({open:a===0,close:d}),[a,d]),x={ref:u},g=yo();return Se.createElement(yZe,null,Se.createElement(ese.Provider,{value:s},Se.createElement(Vre,{value:Bf(a,{0:Kl.Open,1:Kl.Closed})},g({ourProps:x,theirProps:r,slot:f,defaultTag:OJe,name:"Menu"}))))}let RJe="button";function LJe(e,t){var n;let r=m.useId(),{id:s=`headlessui-menu-button-${r}`,disabled:a=!1,autoFocus:o=!1,...l}=e,[c,u]=ID("Menu.Button"),d=xZe(),f=tc(t,mZe(),Rs(L=>u({type:7,element:L}))),x=Rs(L=>{switch(L.key){case ho.Space:case ho.Enter:case ho.ArrowDown:L.preventDefault(),L.stopPropagation(),Ia.flushSync(()=>u({type:0})),u({type:2,focus:Nu.First});break;case ho.ArrowUp:L.preventDefault(),L.stopPropagation(),Ia.flushSync(()=>u({type:0})),u({type:2,focus:Nu.Last});break}}),g=Rs(L=>{switch(L.key){case ho.Space:L.preventDefault();break}}),v=Rs(L=>{var z;if(Ere(L.currentTarget))return L.preventDefault();a||(c.menuState===0?(Ia.flushSync(()=>u({type:1})),(z=c.buttonElement)==null||z.focus({preventScroll:!0})):(L.preventDefault(),u({type:0})))}),{isFocusVisible:w,focusProps:C}=Nre({autoFocus:o}),{isHovered:N,hoverProps:I}=Sre({isDisabled:a}),{pressed:P,pressProps:R}=Are({disabled:a}),F=m.useMemo(()=>({open:c.menuState===0,active:P||c.menuState===0,disabled:a,hover:N,focus:w,autofocus:o}),[c,N,w,P,a,o]),U=y9(d(),{ref:f,id:s,type:Fre(e,c.buttonElement),"aria-haspopup":"menu","aria-controls":(n=c.itemsElement)==null?void 0:n.id,"aria-expanded":c.menuState===0,disabled:a||void 0,autoFocus:o,onKeyDown:x,onKeyUp:g,onClick:v},C,I,R);return yo()({ourProps:U,theirProps:l,slot:F,defaultTag:RJe,name:"Menu.Button"})}let DJe="div",BJe=_y.RenderStrategy|_y.Static;function $Je(e,t){var n,r;let s=m.useId(),{id:a=`headlessui-menu-items-${s}`,anchor:o,portal:l=!1,modal:c=!0,transition:u=!1,...d}=e,f=pZe(o),[x,g]=ID("Menu.Items"),[v,w]=bZe(f),C=gZe(),[N,I]=m.useState(null),P=tc(t,f?v:null,Rs(G=>g({type:8,element:G})),I),R=eA(x.itemsElement);f&&(l=!0);let F=sA(),[U,L]=Mre(u,N,F!==null?(F&Kl.Open)===Kl.Open:x.menuState===0);gAe(U,x.buttonElement,()=>{g({type:1})});let z=x.__demoMode?!1:c&&x.menuState===0;AAe(z,R);let X=x.__demoMode?!1:c&&x.menuState===0;xAe(X,{allowed:m.useCallback(()=>[x.buttonElement,x.itemsElement],[x.buttonElement,x.itemsElement])});let ne=x.menuState!==0,J=jJe(ne,x.buttonElement)?!1:U;m.useEffect(()=>{let G=x.itemsElement;G&&x.menuState===0&&G!==(R==null?void 0:R.activeElement)&&G.focus({preventScroll:!0})},[x.menuState,x.itemsElement,R]),cQe(x.menuState===0,{container:x.itemsElement,accept(G){return G.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:G.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(G){G.setAttribute("role","none")}});let Z=Zy(),re=Rs(G=>{var V,ee,ae;switch(Z.dispose(),G.key){case ho.Space:if(x.searchQuery!=="")return G.preventDefault(),G.stopPropagation(),g({type:3,value:G.key});case ho.Enter:if(G.preventDefault(),G.stopPropagation(),g({type:1}),x.activeItemIndex!==null){let{dataRef:fe}=x.items[x.activeItemIndex];(ee=(V=fe.current)==null?void 0:V.domRef.current)==null||ee.click()}yAe(x.buttonElement);break;case ho.ArrowDown:return G.preventDefault(),G.stopPropagation(),g({type:2,focus:Nu.Next});case ho.ArrowUp:return G.preventDefault(),G.stopPropagation(),g({type:2,focus:Nu.Previous});case ho.Home:case ho.PageUp:return G.preventDefault(),G.stopPropagation(),g({type:2,focus:Nu.First});case ho.End:case ho.PageDown:return G.preventDefault(),G.stopPropagation(),g({type:2,focus:Nu.Last});case ho.Escape:G.preventDefault(),G.stopPropagation(),Ia.flushSync(()=>g({type:1})),(ae=x.buttonElement)==null||ae.focus({preventScroll:!0});break;case ho.Tab:G.preventDefault(),G.stopPropagation(),Ia.flushSync(()=>g({type:1})),KXe(x.buttonElement,G.shiftKey?Gp.Previous:Gp.Next);break;default:G.key.length===1&&(g({type:3,value:G.key}),Z.setTimeout(()=>g({type:4}),350));break}}),he=Rs(G=>{switch(G.key){case ho.Space:G.preventDefault();break}}),Y=m.useMemo(()=>({open:x.menuState===0}),[x.menuState]),ie=y9(f?C():{},{"aria-activedescendant":x.activeItemIndex===null||(n=x.items[x.activeItemIndex])==null?void 0:n.id,"aria-labelledby":(r=x.buttonElement)==null?void 0:r.id,id:a,onKeyDown:re,onKeyUp:he,role:"menu",tabIndex:x.menuState===0?0:void 0,ref:P,style:{...d.style,...w,"--button-width":BXe(x.buttonElement,!0).width},...Ore(L)}),oe=yo();return Se.createElement(XAe,{enabled:l?e.static||U:!1},oe({ourProps:ie,theirProps:d,slot:Y,defaultTag:DJe,features:BJe,visible:J,name:"Menu.Items"}))}let UJe=m.Fragment;function zJe(e,t){let n=m.useId(),{id:r=`headlessui-menu-item-${n}`,disabled:s=!1,...a}=e,[o,l]=ID("Menu.Item"),c=o.activeItemIndex!==null?o.items[o.activeItemIndex].id===r:!1,u=m.useRef(null),d=tc(t,u);Ka(()=>{if(!o.__demoMode&&o.menuState===0&&c&&o.activationTrigger!==0)return rx().requestAnimationFrame(()=>{var J,Z;(Z=(J=u.current)==null?void 0:J.scrollIntoView)==null||Z.call(J,{block:"nearest"})})},[o.__demoMode,u,c,o.menuState,o.activationTrigger,o.activeItemIndex]);let f=_Je(u),x=m.useRef({disabled:s,domRef:u,get textValue(){return f()}});Ka(()=>{x.current.disabled=s},[x,s]),Ka(()=>(l({type:5,id:r,dataRef:x}),()=>l({type:6,id:r})),[x,r]);let g=Rs(()=>{l({type:1})}),v=Rs(J=>{if(s)return J.preventDefault();l({type:1}),yAe(o.buttonElement)}),w=Rs(()=>{if(s)return l({type:2,focus:Nu.Nothing});l({type:2,focus:Nu.Specific,id:r})}),C=nQe(),N=Rs(J=>{C.update(J),!s&&(c||l({type:2,focus:Nu.Specific,id:r,trigger:0}))}),I=Rs(J=>{C.wasMoved(J)&&(s||c||l({type:2,focus:Nu.Specific,id:r,trigger:0}))}),P=Rs(J=>{C.wasMoved(J)&&(s||c&&l({type:2,focus:Nu.Nothing}))}),[R,F]=Tre(),[U,L]=_re(),z=m.useMemo(()=>({active:c,focus:c,disabled:s,close:g}),[c,s,g]),X={id:r,ref:d,role:"menuitem",tabIndex:s===!0?void 0:-1,"aria-disabled":s===!0?!0:void 0,"aria-labelledby":R,"aria-describedby":U,disabled:void 0,onClick:v,onFocus:w,onPointerEnter:N,onMouseEnter:N,onPointerMove:I,onMouseMove:I,onPointerLeave:P,onMouseLeave:P},ne=yo();return Se.createElement(F,null,Se.createElement(L,null,ne({ourProps:X,theirProps:a,slot:z,defaultTag:UJe,name:"Menu.Item"})))}let HJe="div";function VJe(e,t){let[n,r]=Tre(),s=e,a={ref:t,"aria-labelledby":n,role:"group"},o=yo();return Se.createElement(r,null,o({ourProps:a,theirProps:s,slot:{},defaultTag:HJe,name:"Menu.Section"}))}let WJe="header";function qJe(e,t){let n=m.useId(),{id:r=`headlessui-menu-heading-${n}`,...s}=e,a=kre();Ka(()=>a.register(r),[r,a.register]);let o={id:r,ref:t,role:"presentation",...a.props};return yo()({ourProps:o,theirProps:s,slot:{},defaultTag:WJe,name:"Menu.Heading"})}let GJe="div";function KJe(e,t){let n=e,r={ref:t,role:"separator"};return yo()({ourProps:r,theirProps:n,slot:{},defaultTag:GJe,name:"Menu.Separator"})}let YJe=oo(MJe),PD=oo(LJe),FD=oo($Je),AC=oo(zJe),XJe=oo(VJe),QJe=oo(qJe),ZJe=oo(KJe),OD=Object.assign(YJe,{Button:PD,Items:FD,Item:AC,Section:XJe,Heading:QJe,Separator:ZJe}),tse=m.createContext(null);tse.displayName="GroupContext";let JJe=m.Fragment;function eet(e){var t;let[n,r]=m.useState(null),[s,a]=Tre(),[o,l]=_re(),c=m.useMemo(()=>({switch:n,setSwitch:r}),[n,r]),u={},d=e,f=yo();return Se.createElement(l,{name:"Switch.Description",value:o},Se.createElement(a,{name:"Switch.Label",value:s,props:{htmlFor:(t=c.switch)==null?void 0:t.id,onClick(x){n&&(x.currentTarget instanceof HTMLLabelElement&&x.preventDefault(),n.click(),n.focus({preventScroll:!0}))}}},Se.createElement(tse.Provider,{value:c},f({ourProps:u,theirProps:d,slot:{},defaultTag:JJe,name:"Switch.Group"}))))}let tet="button";function net(e,t){var n;let r=m.useId(),s=oAe(),a=jre(),{id:o=s||`headlessui-switch-${r}`,disabled:l=a||!1,checked:c,defaultChecked:u,onChange:d,name:f,value:x,form:g,autoFocus:v=!1,...w}=e,C=m.useContext(tse),[N,I]=m.useState(null),P=m.useRef(null),R=tc(P,t,C===null?null:C.setSwitch,I),F=yXe(u),[U,L]=bXe(c,d,F??!1),z=Zy(),[X,ne]=m.useState(!1),J=Rs(()=>{ne(!0),L==null||L(!U),z.nextFrame(()=>{ne(!1)})}),Z=Rs(be=>{if(Ere(be.currentTarget))return be.preventDefault();be.preventDefault(),J()}),re=Rs(be=>{be.key===ho.Space?(be.preventDefault(),J()):be.key===ho.Enter&&vXe(be.currentTarget)}),he=Rs(be=>be.preventDefault()),Y=fAe(),ie=kXe(),{isFocusVisible:oe,focusProps:G}=Nre({autoFocus:v}),{isHovered:V,hoverProps:ee}=Sre({isDisabled:l}),{pressed:ae,pressProps:fe}=Are({disabled:l}),Ae=m.useMemo(()=>({checked:U,disabled:l,hover:V,focus:oe,active:ae,autofocus:v,changing:X}),[U,V,oe,ae,l,X,v]),ce=y9({id:o,ref:R,role:"switch",type:Fre(e,N),tabIndex:e.tabIndex===-1?0:(n=e.tabIndex)!=null?n:0,"aria-checked":U,"aria-labelledby":Y,"aria-describedby":ie,disabled:l||void 0,autoFocus:v,onClick:Z,onKeyUp:re,onKeyPress:he},G,ee,fe),ye=m.useCallback(()=>{if(F!==void 0)return L==null?void 0:L(F)},[L,F]),Ne=yo();return Se.createElement(Se.Fragment,null,f!=null&&Se.createElement(AXe,{disabled:l,data:{[f]:x||"on"},overrides:{type:"checkbox",checked:U},form:g,onReset:ye}),Ne({ourProps:ce,theirProps:w,slot:Ae,defaultTag:tet,name:"Switch"}))}let ret=oo(net),set=eet,iet=RXe,aet=dAe,Oo=Object.assign(ret,{Group:set,Label:iet,Description:aet});function oet({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M10 3a.75.75 0 0 1 .75.75v10.638l3.96-4.158a.75.75 0 1 1 1.08 1.04l-5.25 5.5a.75.75 0 0 1-1.08 0l-5.25-5.5a.75.75 0 1 1 1.08-1.04l3.96 4.158V3.75A.75.75 0 0 1 10 3Z",clipRule:"evenodd"}))}const Pl=m.forwardRef(oet);function cet({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M15.312 11.424a5.5 5.5 0 0 1-9.201 2.466l-.312-.311h2.433a.75.75 0 0 0 0-1.5H3.989a.75.75 0 0 0-.75.75v4.242a.75.75 0 0 0 1.5 0v-2.43l.31.31a7 7 0 0 0 11.712-3.138.75.75 0 0 0-1.449-.39Zm1.23-3.723a.75.75 0 0 0 .219-.53V2.929a.75.75 0 0 0-1.5 0V5.36l-.31-.31A7 7 0 0 0 3.239 8.188a.75.75 0 1 0 1.448.389A5.5 5.5 0 0 1 13.89 6.11l.311.31h-2.432a.75.75 0 0 0 0 1.5h4.243a.75.75 0 0 0 .53-.219Z",clipRule:"evenodd"}))}const NS=m.forwardRef(cet);function uet({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M4.25 5.5a.75.75 0 0 0-.75.75v8.5c0 .414.336.75.75.75h8.5a.75.75 0 0 0 .75-.75v-4a.75.75 0 0 1 1.5 0v4A2.25 2.25 0 0 1 12.75 17h-8.5A2.25 2.25 0 0 1 2 14.75v-8.5A2.25 2.25 0 0 1 4.25 4h5a.75.75 0 0 1 0 1.5h-5Z",clipRule:"evenodd"}),m.createElement("path",{fillRule:"evenodd",d:"M6.194 12.753a.75.75 0 0 0 1.06.053L16.5 4.44v2.81a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.553l-9.056 8.194a.75.75 0 0 0-.053 1.06Z",clipRule:"evenodd"}))}const det=m.forwardRef(uet);function fet({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M10 17a.75.75 0 0 1-.75-.75V5.612L5.29 9.77a.75.75 0 0 1-1.08-1.04l5.25-5.5a.75.75 0 0 1 1.08 0l5.25 5.5a.75.75 0 1 1-1.08 1.04l-3.96-4.158V16.25A.75.75 0 0 1 10 17Z",clipRule:"evenodd"}))}const nse=m.forwardRef(fet);function het({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",clipRule:"evenodd"}))}const pet=m.forwardRef(het);function met({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"}))}const c8e=m.forwardRef(met);function xet({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const N9=m.forwardRef(xet);function get({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M9.47 6.47a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 1 1-1.06 1.06L10 8.06l-3.72 3.72a.75.75 0 0 1-1.06-1.06l4.25-4.25Z",clipRule:"evenodd"}))}const rse=m.forwardRef(get);function bet({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M10 1c3.866 0 7 1.79 7 4s-3.134 4-7 4-7-1.79-7-4 3.134-4 7-4Zm5.694 8.13c.464-.264.91-.583 1.306-.952V10c0 2.21-3.134 4-7 4s-7-1.79-7-4V8.178c.396.37.842.688 1.306.953C5.838 10.006 7.854 10.5 10 10.5s4.162-.494 5.694-1.37ZM3 13.179V15c0 2.21 3.134 4 7 4s7-1.79 7-4v-1.822c-.396.37-.842.688-1.306.953-1.532.875-3.548 1.369-5.694 1.369s-4.162-.494-5.694-1.37A7.009 7.009 0 0 1 3 13.179Z",clipRule:"evenodd"}))}const iA=m.forwardRef(bet);function yet({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M3.28 2.22a.75.75 0 0 0-1.06 1.06l14.5 14.5a.75.75 0 1 0 1.06-1.06l-1.745-1.745a10.029 10.029 0 0 0 3.3-4.38 1.651 1.651 0 0 0 0-1.185A10.004 10.004 0 0 0 9.999 3a9.956 9.956 0 0 0-4.744 1.194L3.28 2.22ZM7.752 6.69l1.092 1.092a2.5 2.5 0 0 1 3.374 3.373l1.091 1.092a4 4 0 0 0-5.557-5.557Z",clipRule:"evenodd"}),m.createElement("path",{d:"m10.748 13.93 2.523 2.523a9.987 9.987 0 0 1-3.27.547c-4.258 0-7.894-2.66-9.337-6.41a1.651 1.651 0 0 1 0-1.186A10.007 10.007 0 0 1 2.839 6.02L6.07 9.252a4 4 0 0 0 4.678 4.678Z"}))}const vet=m.forwardRef(yet);function wet({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{d:"M10 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"}),m.createElement("path",{fillRule:"evenodd",d:"M.664 10.59a1.651 1.651 0 0 1 0-1.186A10.004 10.004 0 0 1 10 3c4.257 0 7.893 2.66 9.336 6.41.147.381.146.804 0 1.186A10.004 10.004 0 0 1 10 17c-4.257 0-7.893-2.66-9.336-6.41ZM14 10a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z",clipRule:"evenodd"}))}const Cet=m.forwardRef(wet);function Net({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M4 10a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H4.75A.75.75 0 0 1 4 10Z",clipRule:"evenodd"}))}const u8e=m.forwardRef(Net);function Aet({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{d:"M13 4.5a2.5 2.5 0 1 1 .702 1.737L6.97 9.604a2.518 2.518 0 0 1 0 .792l6.733 3.367a2.5 2.5 0 1 1-.671 1.341l-6.733-3.367a2.5 2.5 0 1 1 0-3.475l6.733-3.366A2.52 2.52 0 0 1 13 4.5Z"}))}const jet=m.forwardRef(Aet);function Eet({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"}))}const d8e=m.forwardRef(Eet),f8e=m.createContext({});function _et(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const sse=typeof window<"u",ket=sse?m.useLayoutEffect:m.useEffect,ise=m.createContext(null);function bk(e,t){e.indexOf(t)===-1&&e.push(t)}function yk(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const _c=(e,t,n)=>n>t?t:n<e?e:n;let AS=()=>{};const kc={},MD=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function RD(e){return typeof e=="object"&&e!==null}const LD=e=>/^0[^.\s]+$/u.test(e);function aA(e){let t;return()=>(t===void 0&&(t=e()),t)}const rl=e=>e,Tet=(e,t)=>n=>t(e(n)),ix=(...e)=>e.reduce(Tet),H0=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class oA{constructor(){this.subscriptions=[]}add(t){return bk(this.subscriptions,t),()=>yk(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let a=0;a<s;a++){const o=this.subscriptions[a];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Rl=e=>e*1e3,Jo=e=>e/1e3;function DD(e,t){return t?e*(1e3/t):0}const h8e=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Iet=1e-7,Pet=12;function Fet(e,t,n,r,s){let a,o,l=0;do o=t+(n-t)/2,a=h8e(o,r,s)-e,a>0?n=o:t=o;while(Math.abs(a)>Iet&&++l<Pet);return o}function vk(e,t,n,r){if(e===t&&n===r)return rl;const s=a=>Fet(a,0,1,e,n);return a=>a===0||a===1?a:h8e(s(a),t,r)}const p8e=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,m8e=e=>t=>1-e(1-t),x8e=vk(.33,1.53,.69,.99),ase=m8e(x8e),ose=p8e(ase),lse=e=>(e*=2)<1?.5*ase(e):.5*(2-Math.pow(2,-10*(e-1))),cse=e=>1-Math.sin(Math.acos(e)),use=m8e(cse),dse=p8e(cse),Oet=vk(.42,0,1,1),Met=vk(0,0,.58,1),fse=vk(.42,0,.58,1),g8e=e=>Array.isArray(e)&&typeof e[0]!="number",hse=e=>Array.isArray(e)&&typeof e[0]=="number",ofe={linear:rl,easeIn:Oet,easeInOut:fse,easeOut:Met,circIn:cse,circInOut:dse,circOut:use,backIn:ase,backInOut:ose,backOut:x8e,anticipate:lse},Ret=e=>typeof e=="string",zO=e=>{if(hse(e)){AS(e.length===4);const[t,n,r,s]=e;return vk(t,n,r,s)}else if(Ret(e))return AS(ofe[e]!==void 0),ofe[e];return e},NI=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Let(e,t){let n=new Set,r=new Set,s=!1,a=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(d){o.has(d)&&(u.schedule(d),e()),d(l)}const u={schedule:(d,f=!1,x=!1)=>{const v=x&&s?n:r;return f&&o.add(d),v.has(d)||v.add(d),d},cancel:d=>{r.delete(d),o.delete(d)},process:d=>{if(l=d,s){a=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),n.clear(),s=!1,a&&(a=!1,u.process(d))}};return u}const Det=40;function b8e(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=NI.reduce((P,R)=>(P[R]=Let(a),P),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:d,update:f,preRender:x,render:g,postRender:v}=o,w=()=>{const P=kc.useManualTiming?s.timestamp:performance.now();n=!1,kc.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(P-s.timestamp,Det),1)),s.timestamp=P,s.isProcessing=!0,l.process(s),c.process(s),u.process(s),d.process(s),f.process(s),x.process(s),g.process(s),v.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(w))},C=()=>{n=!0,r=!0,s.isProcessing||e(w)};return{schedule:NI.reduce((P,R)=>{const F=o[R];return P[R]=(U,L=!1,z=!1)=>(n||C(),F.schedule(U,L,z)),P},{}),cancel:P=>{for(let R=0;R<NI.length;R++)o[NI[R]].cancel(P)},state:s,steps:o}}const{schedule:Eo,cancel:Fy,state:Hc,steps:Sz}=b8e(typeof requestAnimationFrame<"u"?requestAnimationFrame:rl,!0);let EF;function Bet(){EF=void 0}const zd={now:()=>(EF===void 0&&zd.set(Hc.isProcessing||kc.useManualTiming?Hc.timestamp:performance.now()),EF),set:e=>{EF=e,queueMicrotask(Bet)}},y8e=e=>t=>typeof t=="string"&&t.startsWith(e),pse=y8e("--"),$et=y8e("var(--"),mse=e=>$et(e)?Uet.test(e.split("/*")[0].trim()):!1,Uet=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,lA={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},A9={...lA,transform:e=>_c(0,1,e)},AI={...lA,default:1},Lj=e=>Math.round(e*1e5)/1e5,xse=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function zet(e){return e==null}const Het=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,gse=(e,t)=>n=>!!(typeof n=="string"&&Het.test(n)&&n.startsWith(e)||t&&!zet(n)&&Object.prototype.hasOwnProperty.call(n,t)),v8e=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,a,o,l]=r.match(xse);return{[e]:parseFloat(s),[t]:parseFloat(a),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},Vet=e=>_c(0,255,e),Nz={...lA,transform:e=>Math.round(Vet(e))},$v={test:gse("rgb","red"),parse:v8e("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Nz.transform(e)+", "+Nz.transform(t)+", "+Nz.transform(n)+", "+Lj(A9.transform(r))+")"};function Wet(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const kQ={test:gse("#"),parse:Wet,transform:$v.transform},wk=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),bb=wk("deg"),T0=wk("%"),ti=wk("px"),qet=wk("vh"),Get=wk("vw"),lfe={...T0,parse:e=>T0.parse(e)/100,transform:e=>T0.transform(e*100)},jC={test:gse("hsl","hue"),parse:v8e("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+T0.transform(Lj(t))+", "+T0.transform(Lj(n))+", "+Lj(A9.transform(r))+")"},Tl={test:e=>$v.test(e)||kQ.test(e)||jC.test(e),parse:e=>$v.test(e)?$v.parse(e):jC.test(e)?jC.parse(e):kQ.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?$v.transform(e):jC.transform(e),getAnimatableNone:e=>{const t=Tl.parse(e);return t.alpha=0,Tl.transform(t)}},Ket=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Yet(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(xse))==null?void 0:t.length)||0)+(((n=e.match(Ket))==null?void 0:n.length)||0)>0}const w8e="number",C8e="color",Xet="var",Qet="var(",cfe="${}",Zet=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function j9(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let a=0;const l=t.replace(Zet,c=>(Tl.test(c)?(r.color.push(a),s.push(C8e),n.push(Tl.parse(c))):c.startsWith(Qet)?(r.var.push(a),s.push(Xet),n.push(c)):(r.number.push(a),s.push(w8e),n.push(parseFloat(c))),++a,cfe)).split(cfe);return{values:n,split:l,indexes:r,types:s}}function S8e(e){return j9(e).values}function N8e(e){const{split:t,types:n}=j9(e),r=t.length;return s=>{let a="";for(let o=0;o<r;o++)if(a+=t[o],s[o]!==void 0){const l=n[o];l===w8e?a+=Lj(s[o]):l===C8e?a+=Tl.transform(s[o]):a+=s[o]}return a}}const Jet=e=>typeof e=="number"?0:Tl.test(e)?Tl.getAnimatableNone(e):e;function ett(e){const t=S8e(e);return N8e(e)(t.map(Jet))}const Oy={test:Yet,parse:S8e,createTransformer:N8e,getAnimatableNone:ett};function Az(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ttt({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,a=0,o=0;if(!t)s=a=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;s=Az(c,l,e+1/3),a=Az(c,l,e),o=Az(c,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function HO(e,t){return n=>n>0?t:e}const Lo=(e,t,n)=>e+(t-e)*n,jz=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},ntt=[kQ,$v,jC],rtt=e=>ntt.find(t=>t.test(e));function ufe(e){const t=rtt(e);if(!t)return!1;let n=t.parse(e);return t===jC&&(n=ttt(n)),n}const dfe=(e,t)=>{const n=ufe(e),r=ufe(t);if(!n||!r)return HO(e,t);const s={...n};return a=>(s.red=jz(n.red,r.red,a),s.green=jz(n.green,r.green,a),s.blue=jz(n.blue,r.blue,a),s.alpha=Lo(n.alpha,r.alpha,a),$v.transform(s))},TQ=new Set(["none","hidden"]);function stt(e,t){return TQ.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function itt(e,t){return n=>Lo(e,t,n)}function bse(e){return typeof e=="number"?itt:typeof e=="string"?mse(e)?HO:Tl.test(e)?dfe:ltt:Array.isArray(e)?A8e:typeof e=="object"?Tl.test(e)?dfe:att:HO}function A8e(e,t){const n=[...e],r=n.length,s=e.map((a,o)=>bse(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)n[o]=s[o](a);return n}}function att(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=bse(e[s])(e[s],t[s]));return s=>{for(const a in r)n[a]=r[a](s);return n}}function ott(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const a=t.types[s],o=e.indexes[a][r[a]],l=e.values[o]??0;n[s]=l,r[a]++}return n}const ltt=(e,t)=>{const n=Oy.createTransformer(t),r=j9(e),s=j9(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?TQ.has(e)&&!s.values.length||TQ.has(t)&&!r.values.length?stt(e,t):ix(A8e(ott(r,s),s.values),n):HO(e,t)};function j8e(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Lo(e,t,n):bse(e)(e,t)}const ctt=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Eo.update(t,n),stop:()=>Fy(t),now:()=>Hc.isProcessing?Hc.timestamp:zd.now()}},E8e=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let a=0;a<s;a++)r+=Math.round(e(a/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},VO=2e4;function yse(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<VO;)t+=n,r=e.next(t);return t>=VO?1/0:t}function utt(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(yse(r),VO);return{type:"keyframes",ease:a=>r.next(s*a).value/t,duration:Jo(s)}}const dtt=5;function _8e(e,t,n){const r=Math.max(t-dtt,0);return DD(n-e(r),t-r)}const Yo={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},ffe=.001;function ftt({duration:e=Yo.duration,bounce:t=Yo.bounce,velocity:n=Yo.velocity,mass:r=Yo.mass}){let s,a,o=1-t;o=_c(Yo.minDamping,Yo.maxDamping,o),e=_c(Yo.minDuration,Yo.maxDuration,Jo(e)),o<1?(s=u=>{const d=u*o,f=d*e,x=d-n,g=IQ(u,o),v=Math.exp(-f);return ffe-x/g*v},a=u=>{const f=u*o*e,x=f*n+n,g=Math.pow(o,2)*Math.pow(u,2)*e,v=Math.exp(-f),w=IQ(Math.pow(u,2),o);return(-s(u)+ffe>0?-1:1)*((x-g)*v)/w}):(s=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-.001+d*f},a=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=ptt(s,a,l);if(e=Rl(e),isNaN(c))return{stiffness:Yo.stiffness,damping:Yo.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const htt=12;function ptt(e,t,n){let r=n;for(let s=1;s<htt;s++)r=r-e(r)/t(r);return r}function IQ(e,t){return e*Math.sqrt(1-t*t)}const mtt=["duration","bounce"],xtt=["stiffness","damping","mass"];function hfe(e,t){return t.some(n=>e[n]!==void 0)}function gtt(e){let t={velocity:Yo.velocity,stiffness:Yo.stiffness,damping:Yo.damping,mass:Yo.mass,isResolvedFromDuration:!1,...e};if(!hfe(e,xtt)&&hfe(e,mtt))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,a=2*_c(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Yo.mass,stiffness:s,damping:a}}else{const n=ftt(e);t={...t,...n,mass:Yo.mass},t.isResolvedFromDuration=!0}return t}function WO(e=Yo.visualDuration,t=Yo.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:a},{stiffness:c,damping:u,mass:d,duration:f,velocity:x,isResolvedFromDuration:g}=gtt({...n,velocity:-Jo(n.velocity||0)}),v=x||0,w=u/(2*Math.sqrt(c*d)),C=o-a,N=Jo(Math.sqrt(c/d)),I=Math.abs(C)<5;r||(r=I?Yo.restSpeed.granular:Yo.restSpeed.default),s||(s=I?Yo.restDelta.granular:Yo.restDelta.default);let P;if(w<1){const F=IQ(N,w);P=U=>{const L=Math.exp(-w*N*U);return o-L*((v+w*N*C)/F*Math.sin(F*U)+C*Math.cos(F*U))}}else if(w===1)P=F=>o-Math.exp(-N*F)*(C+(v+N*C)*F);else{const F=N*Math.sqrt(w*w-1);P=U=>{const L=Math.exp(-w*N*U),z=Math.min(F*U,300);return o-L*((v+w*N*C)*Math.sinh(z)+F*C*Math.cosh(z))/F}}const R={calculatedDuration:g&&f||null,next:F=>{const U=P(F);if(g)l.done=F>=f;else{let L=F===0?v:0;w<1&&(L=F===0?Rl(v):_8e(P,F,U));const z=Math.abs(L)<=r,X=Math.abs(o-U)<=s;l.done=z&&X}return l.value=l.done?o:U,l},toString:()=>{const F=Math.min(yse(R),VO),U=E8e(L=>R.next(F*L).value,F,30);return F+"ms "+U},toTransition:()=>{}};return R}WO.applyToOptions=e=>{const t=utt(e,100,WO);return e.ease=t.ease,e.duration=Rl(t.duration),e.type="keyframes",e};function PQ({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:a=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],x={done:!1,value:f},g=z=>l!==void 0&&z<l||c!==void 0&&z>c,v=z=>l===void 0?c:c===void 0||Math.abs(l-z)<Math.abs(c-z)?l:c;let w=n*t;const C=f+w,N=o===void 0?C:o(C);N!==C&&(w=N-f);const I=z=>-w*Math.exp(-z/r),P=z=>N+I(z),R=z=>{const X=I(z),ne=P(z);x.done=Math.abs(X)<=u,x.value=x.done?N:ne};let F,U;const L=z=>{g(x.value)&&(F=z,U=WO({keyframes:[x.value,v(x.value)],velocity:_8e(P,z,x.value),damping:s,stiffness:a,restDelta:u,restSpeed:d}))};return L(0),{calculatedDuration:null,next:z=>{let X=!1;return!U&&F===void 0&&(X=!0,R(z),L(z)),F!==void 0&&z>=F?U.next(z-F):(!X&&R(z),x)}}}function btt(e,t,n){const r=[],s=n||kc.mix||j8e,a=e.length-1;for(let o=0;o<a;o++){let l=s(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||rl:t;l=ix(c,l)}r.push(l)}return r}function ytt(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const a=e.length;if(AS(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=btt(t,r,s),c=l.length,u=d=>{if(o&&d<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(d<e[f+1]);f++);const x=H0(e[f],e[f+1],d);return l[f](x)};return n?d=>u(_c(e[0],e[a-1],d)):u}function vtt(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=H0(0,t,r);e.push(Lo(n,1,s))}}function wtt(e){const t=[0];return vtt(t,e.length-1),t}function Ctt(e,t){return e.map(n=>n*t)}function Stt(e,t){return e.map(()=>t||fse).splice(0,e.length-1)}function Dj({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=g8e(r)?r.map(zO):zO(r),a={done:!1,value:t[0]},o=Ctt(n&&n.length===t.length?n:wtt(t),e),l=ytt(o,t,{ease:Array.isArray(s)?s:Stt(t,s)});return{calculatedDuration:e,next:c=>(a.value=l(c),a.done=c>=e,a)}}const Ntt=e=>e!==null;function vse(e,{repeat:t,repeatType:n="loop"},r,s=1){const a=e.filter(Ntt),l=s<0||t&&n!=="loop"&&t%2===1?0:a.length-1;return!l||r===void 0?a[l]:r}const Att={decay:PQ,inertia:PQ,tween:Dj,keyframes:Dj,spring:WO};function k8e(e){typeof e.type=="string"&&(e.type=Att[e.type])}let wse=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}};const jtt=e=>e/100;let Cse=class extends wse{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==zd.now()&&this.tick(zd.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;k8e(t);const{type:n=Dj,repeat:r=0,repeatDelay:s=0,repeatType:a,velocity:o=0}=t;let{keyframes:l}=t;const c=n||Dj;c!==Dj&&typeof l[0]!="number"&&(this.mixKeyframes=ix(jtt,j8e(l[0],l[1])),l=[0,100]);const u=c({...t,keyframes:l});a==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...l].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=yse(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:f,repeatType:x,repeatDelay:g,type:v,onUpdate:w,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const N=this.currentTime-u*(this.playbackSpeed>=0?1:-1),I=this.playbackSpeed>=0?N<0:N>s;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let P=this.currentTime,R=r;if(f){const z=Math.min(this.currentTime,s)/l;let X=Math.floor(z),ne=z%1;!ne&&z>=1&&(ne=1),ne===1&&X--,X=Math.min(X,f+1),!!(X%2)&&(x==="reverse"?(ne=1-ne,g&&(ne-=g/l)):x==="mirror"&&(R=o)),P=_c(0,1,ne)*l}const F=I?{done:!1,value:d[0]}:R.next(P);a&&(F.value=a(F.value));let{done:U}=F;!I&&c!==null&&(U=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&U);return L&&v!==PQ&&(F.value=vse(d,this.options,C,this.speed)),w&&w(F.value),L&&this.finish(),F}then(t,n){return this.finished.then(t,n)}get duration(){return Jo(this.calculatedDuration)}get time(){return Jo(this.currentTime)}set time(t){var n;t=Rl(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(zd.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Jo(this.currentTime))}play(){var s,a;if(this.isStopped)return;const{driver:t=ctt,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(a=(s=this.options).onPlay)==null||a.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(zd.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}};function Ett(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Uv=e=>e*180/Math.PI,FQ=e=>{const t=Uv(Math.atan2(e[1],e[0]));return OQ(t)},_tt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:FQ,rotateZ:FQ,skewX:e=>Uv(Math.atan(e[1])),skewY:e=>Uv(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},OQ=e=>(e=e%360,e<0&&(e+=360),e),pfe=FQ,mfe=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),xfe=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),ktt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:mfe,scaleY:xfe,scale:e=>(mfe(e)+xfe(e))/2,rotateX:e=>OQ(Uv(Math.atan2(e[6],e[5]))),rotateY:e=>OQ(Uv(Math.atan2(-e[2],e[0]))),rotateZ:pfe,rotate:pfe,skewX:e=>Uv(Math.atan(e[4])),skewY:e=>Uv(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function MQ(e){return e.includes("scale")?1:0}function RQ(e,t){if(!e||e==="none")return MQ(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=ktt,s=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=_tt,s=l}if(!s)return MQ(t);const a=r[t],o=s[1].split(",").map(Itt);return typeof a=="function"?a(o):o[a]}const Ttt=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return RQ(n,t)};function Itt(e){return parseFloat(e.trim())}const cA=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],uA=new Set(cA),gfe=e=>e===lA||e===ti,Ptt=new Set(["x","y","z"]),Ftt=cA.filter(e=>!Ptt.has(e));function Ott(e){const t=[];return Ftt.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const $w={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>RQ(t,"x"),y:(e,{transform:t})=>RQ(t,"y")};$w.translateX=$w.x;$w.translateY=$w.y;const Uw=new Set;let LQ=!1,DQ=!1,BQ=!1;function T8e(){if(DQ){const e=Array.from(Uw).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Ott(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([a,o])=>{var l;(l=r.getValue(a))==null||l.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}DQ=!1,LQ=!1,Uw.forEach(e=>e.complete(BQ)),Uw.clear()}function I8e(){Uw.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(DQ=!0)})}function Mtt(){BQ=!0,I8e(),T8e(),BQ=!1}let Sse=class{constructor(t,n,r,s,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Uw.add(this),LQ||(LQ=!0,Eo.read(I8e),Eo.resolveKeyframes(T8e))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const a=s==null?void 0:s.get(),o=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const l=r.readValue(n,o);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=o),s&&a===void 0&&s.set(t[0])}Ett(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Uw.delete(this)}cancel(){this.state==="scheduled"&&(Uw.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}};const Rtt=e=>e.startsWith("--");function Ltt(e,t,n){Rtt(t)?e.style.setProperty(t,n):e.style[t]=n}const Dtt=aA(()=>window.ScrollTimeline!==void 0),Btt={};function $tt(e,t){const n=aA(e);return()=>Btt[t]??n()}const P8e=$tt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),oj=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,bfe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:oj([0,.65,.55,1]),circOut:oj([.55,0,1,.45]),backIn:oj([.31,.01,.66,-.59]),backOut:oj([.33,1.53,.69,.99])};function F8e(e,t){if(e)return typeof e=="function"?P8e()?E8e(e,t):"ease-out":hse(e)?oj(e):Array.isArray(e)?e.map(n=>F8e(n,t)||bfe.easeOut):bfe[e]}function Utt(e,t,n,{delay:r=0,duration:s=300,repeat:a=0,repeatType:o="loop",ease:l="easeOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const f=F8e(l,s);Array.isArray(f)&&(d.easing=f);const x={delay:r,duration:s,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return u&&(x.pseudoElement=u),e.animate(d,x)}function O8e(e){return typeof e=="function"&&"applyToOptions"in e}function ztt({type:e,...t}){return O8e(e)&&P8e()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}let Htt=class extends wse{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=t;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=t,AS(typeof t.type!="string");const u=ztt(t);this.animation=Utt(n,r,s,u,a),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const d=vse(s,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(d):Ltt(n,r,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Jo(Number(t))}get time(){return Jo(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Rl(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Dtt()?(this.animation.timeline=t,rl):n(this)}};const M8e={anticipate:lse,backInOut:ose,circInOut:dse};function Vtt(e){return e in M8e}function Wtt(e){typeof e.ease=="string"&&Vtt(e.ease)&&(e.ease=M8e[e.ease])}const yfe=10;let qtt=class extends Htt{constructor(t){Wtt(t),k8e(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:a,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new Cse({...o,autoplay:!1}),c=Rl(this.finishedTime??this.time);n.setWithVelocity(l.sample(c-yfe).value,l.sample(c).value,yfe),l.stop()}};const vfe=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Oy.test(e)||e==="0")&&!e.startsWith("url("));function Gtt(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Ktt(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=vfe(s,t),l=vfe(a,t);return!o||!l?!1:Gtt(e)||(n==="spring"||O8e(n))&&r}function $Q(e){e.duration=0,e.type}const Ytt=new Set(["opacity","clipPath","filter","transform"]),Xtt=aA(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Qtt(e){var d;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:a,type:o}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return Xtt()&&n&&Ytt.has(n)&&(n!=="transform"||!u)&&!c&&!r&&s!=="mirror"&&a!==0&&o!=="inertia"}const Ztt=40;let Jtt=class extends wse{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:a=0,repeatType:o="loop",keyframes:l,name:c,motionValue:u,element:d,...f}){var v;super(),this.stop=()=>{var w,C;this._animation&&(this._animation.stop(),(w=this.stopTimeline)==null||w.call(this)),(C=this.keyframeResolver)==null||C.cancel()},this.createdAt=zd.now();const x={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:a,repeatType:o,name:c,motionValue:u,element:d,...f},g=(d==null?void 0:d.KeyframeResolver)||Sse;this.keyframeResolver=new g(l,(w,C,N)=>this.onKeyframesResolved(w,C,x,!N),c,u,d),(v=this.keyframeResolver)==null||v.scheduleResolve()}onKeyframesResolved(t,n,r,s){this.keyframeResolver=void 0;const{name:a,type:o,velocity:l,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=zd.now(),Ktt(t,a,o,l)||((kc.instantAnimations||!c)&&(d==null||d(vse(t,r,n))),t[0]=t[t.length-1],$Q(r),r.repeat=0);const x={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>Ztt?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},g=!u&&Qtt(x)?new qtt({...x,element:x.motionValue.owner.current}):new Cse(x);g.finished.then(()=>this.notifyFinished()).catch(rl),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Mtt()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}};const ent=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function tnt(e){const t=ent.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function R8e(e,t,n=1){const[r,s]=tnt(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return MD(o)?parseFloat(o):o}return mse(s)?R8e(s,t,n+1):s}function Nse(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const L8e=new Set(["width","height","top","left","right","bottom",...cA]),nnt={test:e=>e==="auto",parse:e=>e},D8e=e=>t=>t.test(e),B8e=[lA,ti,T0,bb,Get,qet,nnt],wfe=e=>B8e.find(D8e(e));function rnt(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||LD(e):!0}const snt=new Set(["brightness","contrast","saturate","opacity"]);function int(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(xse)||[];if(!r)return e;const s=n.replace(r,"");let a=snt.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+s+")"}const ant=/\b([a-z-]*)\(.*?\)/gu,UQ={...Oy,getAnimatableNone:e=>{const t=e.match(ant);return t?t.map(int).join(" "):e}},Cfe={...lA,transform:Math.round},ont={rotate:bb,rotateX:bb,rotateY:bb,rotateZ:bb,scale:AI,scaleX:AI,scaleY:AI,scaleZ:AI,skew:bb,skewX:bb,skewY:bb,distance:ti,translateX:ti,translateY:ti,translateZ:ti,x:ti,y:ti,z:ti,perspective:ti,transformPerspective:ti,opacity:A9,originX:lfe,originY:lfe,originZ:ti},Ase={borderWidth:ti,borderTopWidth:ti,borderRightWidth:ti,borderBottomWidth:ti,borderLeftWidth:ti,borderRadius:ti,radius:ti,borderTopLeftRadius:ti,borderTopRightRadius:ti,borderBottomRightRadius:ti,borderBottomLeftRadius:ti,width:ti,maxWidth:ti,height:ti,maxHeight:ti,top:ti,right:ti,bottom:ti,left:ti,padding:ti,paddingTop:ti,paddingRight:ti,paddingBottom:ti,paddingLeft:ti,margin:ti,marginTop:ti,marginRight:ti,marginBottom:ti,marginLeft:ti,backgroundPositionX:ti,backgroundPositionY:ti,...ont,zIndex:Cfe,fillOpacity:A9,strokeOpacity:A9,numOctaves:Cfe},lnt={...Ase,color:Tl,backgroundColor:Tl,outlineColor:Tl,fill:Tl,stroke:Tl,borderColor:Tl,borderTopColor:Tl,borderRightColor:Tl,borderBottomColor:Tl,borderLeftColor:Tl,filter:UQ,WebkitFilter:UQ},$8e=e=>lnt[e];function U8e(e,t){let n=$8e(e);return n!==UQ&&(n=Oy),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const cnt=new Set(["auto","none","0"]);function unt(e,t,n){let r=0,s;for(;r<e.length&&!s;){const a=e[r];typeof a=="string"&&!cnt.has(a)&&j9(a).values.length&&(s=e[r]),r++}if(s&&n)for(const a of t)e[a]=U8e(n,s)}let dnt=class extends Sse{constructor(t,n,r,s,a){super(t,n,r,s,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),mse(u))){const d=R8e(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!L8e.has(r)||t.length!==2)return;const[s,a]=t,o=wfe(s),l=wfe(a);if(o!==l)if(gfe(o)&&gfe(l))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else $w[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||rnt(t[s]))&&r.push(s);r.length&&unt(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=$w[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var l;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const a=r.length-1,o=r[a];r[a]=$w[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}};function fnt(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const s=document.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}const z8e=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function hnt(e){return RD(e)&&"offsetHeight"in e}const Sfe=30,pnt=e=>!isNaN(parseFloat(e));let mnt=class{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var a;const s=zd.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((a=this.events.change)==null||a.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=zd.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=pnt(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new oA);const r=this.events[t].add(n);return t==="change"?()=>{r(),Eo.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=zd.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Sfe)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Sfe);return DD(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function jS(e,t){return new mnt(e,t)}const{schedule:jse,cancel:f2n}=b8e(queueMicrotask,!1),Ep={x:!1,y:!1};function H8e(){return Ep.x||Ep.y}function xnt(e){return e==="x"||e==="y"?Ep[e]?null:(Ep[e]=!0,()=>{Ep[e]=!1}):Ep.x||Ep.y?null:(Ep.x=Ep.y=!0,()=>{Ep.x=Ep.y=!1})}function V8e(e,t){const n=fnt(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function Nfe(e){return!(e.pointerType==="touch"||H8e())}function gnt(e,t,n={}){const[r,s,a]=V8e(e,n),o=l=>{if(!Nfe(l))return;const{target:c}=l,u=t(c,l);if(typeof u!="function"||!c)return;const d=f=>{Nfe(f)&&(u(f),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,s)};return r.forEach(l=>{l.addEventListener("pointerenter",o,s)}),a}const W8e=(e,t)=>t?e===t?!0:W8e(e,t.parentElement):!1,Ese=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,bnt=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ynt(e){return bnt.has(e.tagName)||e.tabIndex!==-1}const _F=new WeakSet;function Afe(e){return t=>{t.key==="Enter"&&e(t)}}function Ez(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const vnt=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Afe(()=>{if(_F.has(n))return;Ez(n,"down");const s=Afe(()=>{Ez(n,"up")}),a=()=>Ez(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function jfe(e){return Ese(e)&&!H8e()}function wnt(e,t,n={}){const[r,s,a]=V8e(e,n),o=l=>{const c=l.currentTarget;if(!jfe(l))return;_F.add(c);const u=t(c,l),d=(g,v)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",x),_F.has(c)&&_F.delete(c),jfe(g)&&typeof u=="function"&&u(g,{success:v})},f=g=>{d(g,c===window||c===document||n.useGlobalTarget||W8e(c,g.target))},x=g=>{d(g,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",x,s)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),hnt(l)&&(l.addEventListener("focus",u=>vnt(u,s)),!ynt(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),a}function q8e(e){return RD(e)&&"ownerSVGElement"in e}function Cnt(e){return q8e(e)&&e.tagName==="svg"}const Eu=e=>!!(e&&e.getVelocity),Snt=[...B8e,Tl,Oy],Nnt=e=>Snt.find(D8e(e)),G8e=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Ant(e=!0){const t=m.useContext(ise);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,a=m.useId();m.useEffect(()=>{if(e)return s(a)},[e]);const o=m.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const K8e=m.createContext({strict:!1}),Efe={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ES={};for(const e in Efe)ES[e]={isEnabled:t=>Efe[e].some(n=>!!t[n])};function jnt(e){for(const t in e)ES[t]={...ES[t],...e[t]}}const Ent=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function qO(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Ent.has(e)}let Y8e=e=>!qO(e);function _nt(e){typeof e=="function"&&(Y8e=t=>t.startsWith("on")?!qO(t):e(t))}try{_nt(require("@emotion/is-prop-valid").default)}catch{}function knt(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Y8e(s)||n===!0&&qO(s)||!t&&!qO(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const BD=m.createContext({});function $D(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function E9(e){return typeof e=="string"||Array.isArray(e)}const _se=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],kse=["initial",..._se];function UD(e){return $D(e.animate)||kse.some(t=>E9(e[t]))}function X8e(e){return!!(UD(e)||e.variants)}function Tnt(e,t){if(UD(e)){const{initial:n,animate:r}=e;return{initial:n===!1||E9(n)?n:void 0,animate:E9(r)?r:void 0}}return e.inherit!==!1?t:{}}function Int(e){const{initial:t,animate:n}=Tnt(e,m.useContext(BD));return m.useMemo(()=>({initial:t,animate:n}),[_fe(t),_fe(n)])}function _fe(e){return Array.isArray(e)?e.join(" "):e}const _9={};function Pnt(e){for(const t in e)_9[t]=e[t],pse(t)&&(_9[t].isCSSVariable=!0)}function Q8e(e,{layout:t,layoutId:n}){return uA.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!_9[e]||e==="opacity")}const Fnt={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ont=cA.length;function Mnt(e,t,n){let r="",s=!0;for(let a=0;a<Ont;a++){const o=cA[a],l=e[o];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(o.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const u=z8e(l,Ase[o]);if(!c){s=!1;const d=Fnt[o]||o;r+=`${d}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function Tse(e,t,n){const{style:r,vars:s,transformOrigin:a}=e;let o=!1,l=!1;for(const c in t){const u=t[c];if(uA.has(c)){o=!0;continue}else if(pse(c)){s[c]=u;continue}else{const d=z8e(u,Ase[c]);c.startsWith("origin")?(l=!0,a[c]=d):r[c]=d}}if(t.transform||(o||n?r.transform=Mnt(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=a;r.transformOrigin=`${c} ${u} ${d}`}}const Ise=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Z8e(e,t,n){for(const r in t)!Eu(t[r])&&!Q8e(r,n)&&(e[r]=t[r])}function Rnt({transformTemplate:e},t){return m.useMemo(()=>{const n=Ise();return Tse(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Lnt(e,t){const n=e.style||{},r={};return Z8e(r,n,e),Object.assign(r,Rnt(e,t)),r}function Dnt(e,t){const n={},r=Lnt(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Bnt={offset:"stroke-dashoffset",array:"stroke-dasharray"},$nt={offset:"strokeDashoffset",array:"strokeDasharray"};function Unt(e,t,n=1,r=0,s=!0){e.pathLength=1;const a=s?Bnt:$nt;e[a.offset]=ti.transform(-r);const o=ti.transform(t),l=ti.transform(n);e[a.array]=`${o} ${l}`}function J8e(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:a=1,pathOffset:o=0,...l},c,u,d){if(Tse(e,l,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:x}=e;f.transform&&(x.transform=f.transform,delete f.transform),(x.transform||f.transformOrigin)&&(x.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),x.transform&&(x.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),s!==void 0&&Unt(f,s,a,o,!1)}const e7e=()=>({...Ise(),attrs:{}}),t7e=e=>typeof e=="string"&&e.toLowerCase()==="svg";function znt(e,t,n,r){const s=m.useMemo(()=>{const a=e7e();return J8e(a,t,t7e(r),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};Z8e(a,e.style,e),s.style={...a,...s.style}}return s}const Hnt=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Pse(e){return typeof e!="string"||e.includes("-")?!1:!!(Hnt.indexOf(e)>-1||/[A-Z]/u.test(e))}function Vnt(e,t,n,{latestValues:r},s,a=!1){const l=(Pse(e)?znt:Dnt)(t,r,s,e),c=knt(t,typeof e=="string",a),u=e!==m.Fragment?{...c,...l,ref:n}:{},{children:d}=t,f=m.useMemo(()=>Eu(d)?d.get():d,[d]);return m.createElement(e,{...u,children:f})}function kfe(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Fse(e,t,n,r){if(typeof t=="function"){const[s,a]=kfe(r);t=t(n!==void 0?n:e.custom,s,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,a]=kfe(r);t=t(n!==void 0?n:e.custom,s,a)}return t}function kF(e){return Eu(e)?e.get():e}function Wnt({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:qnt(n,r,s,e),renderState:t()}}function qnt(e,t,n,r){const s={},a=r(e,{});for(const x in a)s[x]=kF(a[x]);let{initial:o,animate:l}=e;const c=UD(e),u=X8e(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const f=d?l:o;if(f&&typeof f!="boolean"&&!$D(f)){const x=Array.isArray(f)?f:[f];for(let g=0;g<x.length;g++){const v=Fse(e,x[g]);if(v){const{transitionEnd:w,transition:C,...N}=v;for(const I in N){let P=N[I];if(Array.isArray(P)){const R=d?P.length-1:0;P=P[R]}P!==null&&(s[I]=P)}for(const I in w)s[I]=w[I]}}}return s}const n7e=e=>(t,n)=>{const r=m.useContext(BD),s=m.useContext(ise),a=()=>Wnt(e,t,r,s);return n?a():_et(a)};function Ose(e,t,n){var a;const{style:r}=e,s={};for(const o in r)(Eu(r[o])||t.style&&Eu(t.style[o])||Q8e(o,e)||((a=n==null?void 0:n.getValue(o))==null?void 0:a.liveStyle)!==void 0)&&(s[o]=r[o]);return s}const Gnt=n7e({scrapeMotionValuesFromProps:Ose,createRenderState:Ise});function r7e(e,t,n){const r=Ose(e,t,n);for(const s in e)if(Eu(e[s])||Eu(t[s])){const a=cA.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[a]=e[s]}return r}const Knt=n7e({scrapeMotionValuesFromProps:r7e,createRenderState:e7e}),Ynt=Symbol.for("motionComponentSymbol");function EC(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Xnt(e,t,n){return m.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):EC(n)&&(n.current=r))},[t])}const Mse=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Qnt="framerAppearId",s7e="data-"+Mse(Qnt),i7e=m.createContext({});function Znt(e,t,n,r,s){var w,C;const{visualElement:a}=m.useContext(BD),o=m.useContext(K8e),l=m.useContext(ise),c=m.useContext(G8e).reducedMotion,u=m.useRef(null);r=r||o.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:a,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}));const d=u.current,f=m.useContext(i7e);d&&!d.projection&&s&&(d.type==="html"||d.type==="svg")&&Jnt(u.current,n,s,f);const x=m.useRef(!1);m.useInsertionEffect(()=>{d&&x.current&&d.update(n,l)});const g=n[s7e],v=m.useRef(!!g&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,g))&&((C=window.MotionHasOptimisedAnimation)==null?void 0:C.call(window,g)));return ket(()=>{d&&(x.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),v.current&&d.animationState&&d.animationState.animateChanges())}),m.useEffect(()=>{d&&(!v.current&&d.animationState&&d.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var N;(N=window.MotionHandoffMarkAsComplete)==null||N.call(window,g)}),v.current=!1),d.enteringChildren=void 0)}),d}function Jnt(e,t,n,r){const{layoutId:s,layout:a,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:a7e(e.parent)),e.projection.setOptions({layoutId:s,layout:a,alwaysMeasureLayout:!!o||l&&EC(l),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:u})}function a7e(e){if(e)return e.options.allowProjection!==!1?e.projection:a7e(e.parent)}function _z(e,{forwardMotionProps:t=!1}={},n,r){n&&jnt(n);const s=Pse(e)?Knt:Gnt;function a(l,c){let u;const d={...m.useContext(G8e),...l,layoutId:ert(l)},{isStatic:f}=d,x=Int(l),g=s(l,f);if(!f&&sse){trt();const v=nrt(d);u=v.MeasureLayout,x.visualElement=Znt(e,g,d,r,v.ProjectionNode)}return i.jsxs(BD.Provider,{value:x,children:[u&&x.visualElement?i.jsx(u,{visualElement:x.visualElement,...d}):null,Vnt(e,l,Xnt(g,x.visualElement,c),g,f,t)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const o=m.forwardRef(a);return o[Ynt]=e,o}function ert({layoutId:e}){const t=m.useContext(f8e).id;return t&&e!==void 0?t+"-"+e:e}function trt(e,t){m.useContext(K8e).strict}function nrt(e){const{drag:t,layout:n}=ES;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function rrt(e,t){if(typeof Proxy>"u")return _z;const n=new Map,r=(a,o)=>_z(a,o,e,t),s=(a,o)=>r(a,o);return new Proxy(s,{get:(a,o)=>o==="create"?r:(n.has(o)||n.set(o,_z(o,void 0,e,t)),n.get(o))})}function o7e({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function srt({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function irt(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function kz(e){return e===void 0||e===1}function zQ({scale:e,scaleX:t,scaleY:n}){return!kz(e)||!kz(t)||!kz(n)}function yv(e){return zQ(e)||l7e(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function l7e(e){return Tfe(e.x)||Tfe(e.y)}function Tfe(e){return e&&e!=="0%"}function GO(e,t,n){const r=e-n,s=t*r;return n+s}function Ife(e,t,n,r,s){return s!==void 0&&(e=GO(e,s,r)),GO(e,n,r)+t}function HQ(e,t=0,n=1,r,s){e.min=Ife(e.min,t,n,r,s),e.max=Ife(e.max,t,n,r,s)}function c7e(e,{x:t,y:n}){HQ(e.x,t.translate,t.scale,t.originPoint),HQ(e.y,n.translate,n.scale,n.originPoint)}const Pfe=.999999999999,Ffe=1.0000000000001;function art(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let a,o;for(let l=0;l<s;l++){a=n[l],o=a.projectionDelta;const{visualElement:c}=a.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&kC(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,c7e(e,o)),r&&yv(a.latestValues)&&kC(e,a.latestValues))}t.x<Ffe&&t.x>Pfe&&(t.x=1),t.y<Ffe&&t.y>Pfe&&(t.y=1)}function _C(e,t){e.min=e.min+t,e.max=e.max+t}function Ofe(e,t,n,r,s=.5){const a=Lo(e.min,e.max,s);HQ(e,t,n,a,r)}function kC(e,t){Ofe(e.x,t.x,t.scaleX,t.scale,t.originX),Ofe(e.y,t.y,t.scaleY,t.scale,t.originY)}function u7e(e,t){return o7e(irt(e.getBoundingClientRect(),t))}function ort(e,t,n){const r=u7e(e,n),{scroll:s}=t;return s&&(_C(r.x,s.offset.x),_C(r.y,s.offset.y)),r}const Mfe=()=>({translate:0,scale:1,origin:0,originPoint:0}),TC=()=>({x:Mfe(),y:Mfe()}),Rfe=()=>({min:0,max:0}),dl=()=>({x:Rfe(),y:Rfe()}),VQ={current:null},d7e={current:!1};function lrt(){if(d7e.current=!0,!!sse)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>VQ.current=e.matches;e.addEventListener("change",t),t()}else VQ.current=!1}const crt=new WeakMap;function urt(e,t,n){for(const r in t){const s=t[r],a=n[r];if(Eu(s))e.addValue(r,s);else if(Eu(a))e.addValue(r,jS(s,{owner:e}));else if(a!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,jS(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Lfe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let drt=class{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:a,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Sse,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const x=zd.now();this.renderScheduledAt<x&&(this.renderScheduledAt=x,Eo.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=UD(n),this.isVariantNode=X8e(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const x in f){const g=f[x];c[x]!==void 0&&Eu(g)&&g.set(c[x])}}mount(t){var n;this.current=t,crt.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,s)=>this.bindToMotionValue(s,r)),d7e.current||lrt(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:VQ.current,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Fy(this.notifyUpdate),Fy(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=uA.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Eo.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ES){const n=ES[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):dl()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Lfe.length;r++){const s=Lfe[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const a="on"+s,o=t[a];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=urt(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=jS(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(MD(r)||LD(r))?r=parseFloat(r):!Nnt(r)&&Oy.test(n)&&(r=U8e(t,n)),this.setBaseTarget(t,Eu(r)?r.get():r)),Eu(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var a;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Fse(this.props,n,(a=this.presenceContext)==null?void 0:a.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Eu(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new oA),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){jse.render(this.render)}},f7e=class extends drt{constructor(){super(...arguments),this.KeyframeResolver=dnt}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Eu(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}};function h7e(e,{style:t,vars:n},r,s){const a=e.style;let o;for(o in t)a[o]=t[o];s==null||s.applyProjectionStyles(a,r);for(o in n)a.setProperty(o,n[o])}function frt(e){return window.getComputedStyle(e)}let hrt=class extends f7e{constructor(){super(...arguments),this.type="html",this.renderInstance=h7e}readValueFromInstance(t,n){var r;if(uA.has(n))return(r=this.projection)!=null&&r.isProjecting?MQ(n):Ttt(t,n);{const s=frt(t),a=(pse(n)?s.getPropertyValue(n):s[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:n}){return u7e(t,n)}build(t,n,r){Tse(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Ose(t,n,r)}};const p7e=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function prt(e,t,n,r){h7e(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(p7e.has(s)?s:Mse(s),t.attrs[s])}let mrt=class extends f7e{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=dl}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(uA.has(n)){const r=$8e(n);return r&&r.default||0}return n=p7e.has(n)?n:Mse(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return r7e(t,n,r)}build(t,n,r){J8e(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){prt(t,n,r,s)}mount(t){this.isSVGTag=t7e(t.tagName),super.mount(t)}};const xrt=(e,t)=>Pse(e)?new mrt(t):new hrt(t,{allowProjection:e!==m.Fragment});function KC(e,t,n){const r=e.getProps();return Fse(r,t,n!==void 0?n:r.custom,e)}const WQ=e=>Array.isArray(e);function grt(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,jS(n))}function brt(e){return WQ(e)?e[e.length-1]||0:e}function yrt(e,t){const n=KC(e,t);let{transitionEnd:r={},transition:s={},...a}=n||{};a={...a,...r};for(const o in a){const l=brt(a[o]);grt(e,o,l)}}function vrt(e){return!!(Eu(e)&&e.add)}function qQ(e,t){const n=e.getValue("willChange");if(vrt(n))return n.add(t);if(!n&&kc.WillChange){const r=new kc.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function m7e(e){return e.props[s7e]}const wrt=e=>e!==null;function Crt(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(wrt),a=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[a]}const Srt={type:"spring",stiffness:500,damping:25,restSpeed:10},Nrt=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Art={type:"keyframes",duration:.8},jrt={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ert=(e,{keyframes:t})=>t.length>2?Art:uA.has(e)?e.startsWith("scale")?Nrt(t[1]):Srt:jrt;function _rt({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:a,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const Rse=(e,t,n,r={},s,a)=>o=>{const l=Nse(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Rl(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:x=>{t.set(x),l.onUpdate&&l.onUpdate(x)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:a?void 0:s};_rt(l)||Object.assign(d,Ert(e,d)),d.duration&&(d.duration=Rl(d.duration)),d.repeatDelay&&(d.repeatDelay=Rl(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&($Q(d),d.delay===0&&(f=!0)),(kc.instantAnimations||kc.skipAnimations)&&(f=!0,$Q(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,f&&!a&&t.get()!==void 0){const x=Crt(d.keyframes,l);if(x!==void 0){Eo.update(()=>{d.onUpdate(x),d.onComplete()});return}}return l.isSync?new Cse(d):new Jtt(d)};function krt({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function x7e(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:o,...l}=t;r&&(a=r);const c=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const d in l){const f=e.getValue(d,e.latestValues[d]??null),x=l[d];if(x===void 0||u&&krt(u,d))continue;const g={delay:n,...Nse(a||{},d)},v=f.get();if(v!==void 0&&!f.isAnimating&&!Array.isArray(x)&&x===v&&!g.velocity)continue;let w=!1;if(window.MotionHandoffAnimation){const N=m7e(e);if(N){const I=window.MotionHandoffAnimation(N,d,Eo);I!==null&&(g.startTime=I,w=!0)}}qQ(e,d),f.start(Rse(d,f,x,e.shouldReduceMotion&&L8e.has(d)?{type:!1}:g,e,w));const C=f.animation;C&&c.push(C)}return o&&Promise.all(c).then(()=>{Eo.update(()=>{o&&yrt(e,o)})}),c}function g7e(e,t,n,r=0,s=1){const a=Array.from(e).sort((u,d)=>u.sortNodePosition(d)).indexOf(t),o=e.size,l=(o-1)*r;return typeof n=="function"?n(a,o):s===1?a*r:l-a*r}function GQ(e,t,n={}){var c;const r=KC(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const a=r?()=>Promise.all(x7e(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:x}=s;return Trt(e,t,u,d,f,x,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[u,d]=l==="beforeChildren"?[a,o]:[o,a];return u().then(()=>d())}else return Promise.all([a(),o(n.delay)])}function Trt(e,t,n=0,r=0,s=0,a=1,o){const l=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),l.push(GQ(c,t,{...o,delay:n+(typeof r=="function"?0:r)+g7e(e.variantChildren,c,r,s,a)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(l)}function Irt(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(a=>GQ(e,a,n));r=Promise.all(s)}else if(typeof t=="string")r=GQ(e,t,n);else{const s=typeof t=="function"?KC(e,t,n.custom):t;r=Promise.all(x7e(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function b7e(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Prt=kse.length;function y7e(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?y7e(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Prt;n++){const r=kse[n],s=e.props[r];(E9(s)||s===!1)&&(t[r]=s)}return t}const Frt=[..._se].reverse(),Ort=_se.length;function Mrt(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Irt(e,n,r)))}function Rrt(e){let t=Mrt(e),n=Dfe(),r=!0;const s=c=>(u,d)=>{var x;const f=KC(e,d,c==="exit"?(x=e.presenceContext)==null?void 0:x.custom:void 0);if(f){const{transition:g,transitionEnd:v,...w}=f;u={...u,...w,...v}}return u};function a(c){t=c(e)}function o(c){const{props:u}=e,d=y7e(e.parent)||{},f=[],x=new Set;let g={},v=1/0;for(let C=0;C<Ort;C++){const N=Frt[C],I=n[N],P=u[N]!==void 0?u[N]:d[N],R=E9(P),F=N===c?I.isActive:null;F===!1&&(v=C);let U=P===d[N]&&P!==u[N]&&R;if(U&&r&&e.manuallyAnimateOnMount&&(U=!1),I.protectedKeys={...g},!I.isActive&&F===null||!P&&!I.prevProp||$D(P)||typeof P=="boolean")continue;const L=Lrt(I.prevProp,P);let z=L||N===c&&I.isActive&&!U&&R||C>v&&R,X=!1;const ne=Array.isArray(P)?P:[P];let J=ne.reduce(s(N),{});F===!1&&(J={});const{prevResolvedValues:Z={}}=I,re={...Z,...J},he=oe=>{z=!0,x.has(oe)&&(X=!0,x.delete(oe)),I.needsAnimating[oe]=!0;const G=e.getValue(oe);G&&(G.liveStyle=!1)};for(const oe in re){const G=J[oe],V=Z[oe];if(g.hasOwnProperty(oe))continue;let ee=!1;WQ(G)&&WQ(V)?ee=!b7e(G,V):ee=G!==V,ee?G!=null?he(oe):x.add(oe):G!==void 0&&x.has(oe)?he(oe):I.protectedKeys[oe]=!0}I.prevProp=P,I.prevResolvedValues=J,I.isActive&&(g={...g,...J}),r&&e.blockInitialAnimation&&(z=!1);const Y=U&&L;z&&(!Y||X)&&f.push(...ne.map(oe=>{const G={type:N};if(typeof oe=="string"&&r&&!Y&&e.manuallyAnimateOnMount&&e.parent){const{parent:V}=e,ee=KC(V,oe);if(V.enteringChildren&&ee){const{delayChildren:ae}=ee.transition||{};G.delay=g7e(V.enteringChildren,e,ae)}}return{animation:oe,options:G}}))}if(x.size){const C={};if(typeof u.initial!="boolean"){const N=KC(e,Array.isArray(u.initial)?u.initial[0]:u.initial);N&&N.transition&&(C.transition=N.transition)}x.forEach(N=>{const I=e.getBaseTarget(N),P=e.getValue(N);P&&(P.liveStyle=!0),C[N]=I??null}),f.push({animation:C})}let w=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,w?t(f):Promise.resolve()}function l(c,u){var f;if(n[c].isActive===u)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(x=>{var g;return(g=x.animationState)==null?void 0:g.setActive(c,u)}),n[c].isActive=u;const d=o(c);for(const x in n)n[x].protectedKeys={};return d}return{animateChanges:o,setActive:l,setAnimateFunction:a,getState:()=>n,reset:()=>{n=Dfe(),r=!0}}}function Lrt(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!b7e(t,e):!1}function rv(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Dfe(){return{animate:rv(!0),whileInView:rv(),whileHover:rv(),whileTap:rv(),whileDrag:rv(),whileFocus:rv(),exit:rv()}}let Jy=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},Drt=class extends Jy{constructor(t){super(t),t.animationState||(t.animationState=Rrt(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();$D(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}},Brt=0,$rt=class extends Jy{constructor(){super(...arguments),this.id=Brt++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}};const Urt={animation:{Feature:Drt},exit:{Feature:$rt}};function k9(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Ck(e){return{point:{x:e.pageX,y:e.pageY}}}const zrt=e=>t=>Ese(t)&&e(t,Ck(t));function Bj(e,t,n,r){return k9(e,t,zrt(n),r)}const v7e=1e-4,Hrt=1-v7e,Vrt=1+v7e,w7e=.01,Wrt=0-w7e,qrt=0+w7e;function Zu(e){return e.max-e.min}function Grt(e,t,n){return Math.abs(e-t)<=n}function Bfe(e,t,n,r=.5){e.origin=r,e.originPoint=Lo(t.min,t.max,e.origin),e.scale=Zu(n)/Zu(t),e.translate=Lo(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Hrt&&e.scale<=Vrt||isNaN(e.scale))&&(e.scale=1),(e.translate>=Wrt&&e.translate<=qrt||isNaN(e.translate))&&(e.translate=0)}function $j(e,t,n,r){Bfe(e.x,t.x,n.x,r?r.originX:void 0),Bfe(e.y,t.y,n.y,r?r.originY:void 0)}function $fe(e,t,n){e.min=n.min+t.min,e.max=e.min+Zu(t)}function Krt(e,t,n){$fe(e.x,t.x,n.x),$fe(e.y,t.y,n.y)}function Ufe(e,t,n){e.min=t.min-n.min,e.max=e.min+Zu(t)}function Uj(e,t,n){Ufe(e.x,t.x,n.x),Ufe(e.y,t.y,n.y)}function Ch(e){return[e("x"),e("y")]}const C7e=({current:e})=>e?e.ownerDocument.defaultView:null,zfe=(e,t)=>Math.abs(e-t);function Yrt(e,t){const n=zfe(e.x,t.x),r=zfe(e.y,t.y);return Math.sqrt(n**2+r**2)}let S7e=class{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:a=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Iz(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,v=Yrt(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!v)return;const{point:w}=x,{timestamp:C}=Hc;this.history.push({...w,timestamp:C});const{onStart:N,onMove:I}=this.handlers;g||(N&&N(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),I&&I(this.lastMoveEvent,x)},this.handlePointerMove=(x,g)=>{this.lastMoveEvent=x,this.lastMoveEventInfo=Tz(g,this.transformPagePoint),Eo.update(this.updatePoint,!0)},this.handlePointerUp=(x,g)=>{this.end();const{onEnd:v,onSessionEnd:w,resumeAnimation:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=Iz(x.type==="pointercancel"?this.lastMoveEventInfo:Tz(g,this.transformPagePoint),this.history);this.startEvent&&v&&v(x,N),w&&w(x,N)},!Ese(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=Ck(t),c=Tz(l,this.transformPagePoint),{point:u}=c,{timestamp:d}=Hc;this.history=[{...u,timestamp:d}];const{onSessionStart:f}=n;f&&f(t,Iz(c,this.history)),this.removeListeners=ix(Bj(this.contextWindow,"pointermove",this.handlePointerMove),Bj(this.contextWindow,"pointerup",this.handlePointerUp),Bj(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Fy(this.updatePoint)}};function Tz(e,t){return t?{point:t(e.point)}:e}function Hfe(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Iz({point:e},t){return{point:e,delta:Hfe(e,N7e(t)),offset:Hfe(e,Xrt(t)),velocity:Qrt(t,.1)}}function Xrt(e){return e[0]}function N7e(e){return e[e.length-1]}function Qrt(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=N7e(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Rl(t)));)n--;if(!r)return{x:0,y:0};const a=Jo(s.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const o={x:(s.x-r.x)/a,y:(s.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Zrt(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Lo(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Lo(n,e,r.max):Math.min(e,n)),e}function Vfe(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Jrt(e,{top:t,left:n,bottom:r,right:s}){return{x:Vfe(e.x,n,s),y:Vfe(e.y,t,r)}}function Wfe(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function est(e,t){return{x:Wfe(e.x,t.x),y:Wfe(e.y,t.y)}}function tst(e,t){let n=.5;const r=Zu(e),s=Zu(t);return s>r?n=H0(t.min,t.max-r,e.min):r>s&&(n=H0(e.min,e.max-s,t.min)),_c(0,1,n)}function nst(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const KQ=.35;function rst(e=KQ){return e===!1?e=0:e===!0&&(e=KQ),{x:qfe(e,"left","right"),y:qfe(e,"top","bottom")}}function qfe(e,t,n){return{min:Gfe(e,t),max:Gfe(e,n)}}function Gfe(e,t){return typeof e=="number"?e:e[t]||0}const sst=new WeakMap;let ist=class{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=dl(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const a=f=>{const{dragSnapToOrigin:x}=this.getProps();x?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ck(f).point)},o=(f,x)=>{const{drag:g,dragPropagation:v,onDragStart:w}=this.getProps();if(g&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=xnt(g),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=x,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ch(N=>{let I=this.getAxisMotionValue(N).get()||0;if(T0.test(I)){const{projection:P}=this.visualElement;if(P&&P.layout){const R=P.layout.layoutBox[N];R&&(I=Zu(R)*(parseFloat(I)/100))}}this.originPoint[N]=I}),w&&Eo.postRender(()=>w(f,x)),qQ(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},l=(f,x)=>{this.latestPointerEvent=f,this.latestPanInfo=x;const{dragPropagation:g,dragDirectionLock:v,onDirectionLock:w,onDrag:C}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:N}=x;if(v&&this.currentDirection===null){this.currentDirection=ast(N),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",x.point,N),this.updateAxis("y",x.point,N),this.visualElement.render(),C&&C(f,x)},c=(f,x)=>{this.latestPointerEvent=f,this.latestPanInfo=x,this.stop(f,x),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>Ch(f=>{var x;return this.getAnimationState(f)==="paused"&&((x=this.getAxisMotionValue(f).animation)==null?void 0:x.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new S7e(t,{onSessionStart:a,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:C7e(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&Eo.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!jI(t,s,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=Zrt(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){var a;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)==null?void 0:a.layout,s=this.constraints;t&&EC(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Jrt(r.layoutBox,t):this.constraints=!1,this.elastic=rst(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ch(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=nst(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!EC(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const a=ort(r,s.root,this.visualElement.getTransformPagePoint());let o=est(s.layout.layoutBox,a);if(n){const l=n(srt(o));this.hasMutatedConstraints=!!l,l&&(o=o7e(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Ch(d=>{if(!jI(d,n,this.currentDirection))return;let f=c[d]||{};o&&(f={min:0,max:0});const x=s?200:1e6,g=s?40:1e7,v={type:"inertia",velocity:r?t[d]:0,bounceStiffness:x,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...a,...f};return this.startAxisValueAnimation(d,v)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return qQ(this.visualElement,t),r.start(Rse(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ch(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ch(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ch(n=>{const{drag:r}=this.getProps();if(!jI(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,a=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n];a.set(t[n]-Lo(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!EC(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ch(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();s[o]=tst({min:c,max:c},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ch(o=>{if(!jI(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(Lo(c,u,s[o]))})}addListeners(){if(!this.visualElement.current)return;sst.set(this.visualElement,this);const t=this.visualElement.current,n=Bj(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();EC(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,a=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Eo.read(r);const o=k9(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ch(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{o(),n(),a(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:a=!1,dragElastic:o=KQ,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:a,dragElastic:o,dragMomentum:l}}};function jI(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ast(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}let ost=class extends Jy{constructor(t){super(t),this.removeGroupControls=rl,this.removeListeners=rl,this.controls=new ist(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||rl}unmount(){this.removeGroupControls(),this.removeListeners()}};const Kfe=e=>(t,n)=>{e&&Eo.postRender(()=>e(t,n))};let lst=class extends Jy{constructor(){super(...arguments),this.removePointerDownListener=rl}onPointerDown(t){this.session=new S7e(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:C7e(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Kfe(t),onStart:Kfe(n),onMove:r,onEnd:(a,o)=>{delete this.session,s&&Eo.postRender(()=>s(a,o))}}}mount(){this.removePointerDownListener=Bj(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};const TF={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Yfe(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const d7={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ti.test(e))e=parseFloat(e);else return e;const n=Yfe(e,t.target.x),r=Yfe(e,t.target.y);return`${n}% ${r}%`}},cst={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Oy.parse(e);if(s.length>5)return r;const a=Oy.createTransformer(e),o=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;s[0+o]/=l,s[1+o]/=c;const u=Lo(l,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),a(s)}};let Pz=!1,ust=class extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:a}=t;Pnt(dst),a&&(n.group&&n.group.add(a),r&&r.register&&s&&r.register(a),Pz&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),TF.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,Pz=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==a?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||Eo.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),jse.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;Pz=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}};function A7e(e){const[t,n]=Ant(),r=m.useContext(f8e);return i.jsx(ust,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(i7e),isPresent:t,safeToRemove:n})}const dst={borderRadius:{...d7,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:d7,borderTopRightRadius:d7,borderBottomLeftRadius:d7,borderBottomRightRadius:d7,boxShadow:cst};function fst(e,t,n){const r=Eu(e)?e:jS(e);return r.start(Rse("",r,t,n)),r.animation}const hst=(e,t)=>e.depth-t.depth;let pst=class{constructor(){this.children=[],this.isDirty=!1}add(t){bk(this.children,t),this.isDirty=!0}remove(t){yk(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(hst),this.isDirty=!1,this.children.forEach(t)}};function mst(e,t){const n=zd.now(),r=({timestamp:s})=>{const a=s-n;a>=t&&(Fy(r),e(a-t))};return Eo.setup(r,!0),()=>Fy(r)}const j7e=["TopLeft","TopRight","BottomLeft","BottomRight"],xst=j7e.length,Xfe=e=>typeof e=="string"?parseFloat(e):e,Qfe=e=>typeof e=="number"||ti.test(e);function gst(e,t,n,r,s,a){s?(e.opacity=Lo(0,n.opacity??1,bst(r)),e.opacityExit=Lo(t.opacity??1,0,yst(r))):a&&(e.opacity=Lo(t.opacity??1,n.opacity??1,r));for(let o=0;o<xst;o++){const l=`border${j7e[o]}Radius`;let c=Zfe(t,l),u=Zfe(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||Qfe(c)===Qfe(u)?(e[l]=Math.max(Lo(Xfe(c),Xfe(u),r),0),(T0.test(u)||T0.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=Lo(t.rotate||0,n.rotate||0,r))}function Zfe(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const bst=E7e(0,.5,use),yst=E7e(.5,.95,rl);function E7e(e,t,n){return r=>r<e?0:r>t?1:n(H0(e,t,r))}function Jfe(e,t){e.min=t.min,e.max=t.max}function oh(e,t){Jfe(e.x,t.x),Jfe(e.y,t.y)}function ehe(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function the(e,t,n,r,s){return e-=t,e=GO(e,1/n,r),s!==void 0&&(e=GO(e,1/s,r)),e}function vst(e,t=0,n=1,r=.5,s,a=e,o=e){if(T0.test(t)&&(t=parseFloat(t),t=Lo(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=Lo(a.min,a.max,r);e===a&&(l-=t),e.min=the(e.min,t,n,l,s),e.max=the(e.max,t,n,l,s)}function nhe(e,t,[n,r,s],a,o){vst(e,t[n],t[r],t[s],t.scale,a,o)}const wst=["x","scaleX","originX"],Cst=["y","scaleY","originY"];function rhe(e,t,n,r){nhe(e.x,t,wst,n?n.x:void 0,r?r.x:void 0),nhe(e.y,t,Cst,n?n.y:void 0,r?r.y:void 0)}function she(e){return e.translate===0&&e.scale===1}function _7e(e){return she(e.x)&&she(e.y)}function ihe(e,t){return e.min===t.min&&e.max===t.max}function Sst(e,t){return ihe(e.x,t.x)&&ihe(e.y,t.y)}function ahe(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function k7e(e,t){return ahe(e.x,t.x)&&ahe(e.y,t.y)}function ohe(e){return Zu(e.x)/Zu(e.y)}function lhe(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}let Nst=class{constructor(){this.members=[]}add(t){bk(this.members,t),t.scheduleRender()}remove(t){if(yk(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const a=this.members[s];if(a.isPresent!==!1){r=a;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function Ast(e,t,n){let r="";const s=e.x.translate/t.x,a=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||a||o)&&(r=`translate3d(${s}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:x,skewX:g,skewY:v}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),x&&(r+=`rotateY(${x}deg) `),g&&(r+=`skewX(${g}deg) `),v&&(r+=`skewY(${v}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const Fz=["","X","Y","Z"],jst=1e3;let Est=0;function Oz(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function T7e(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=m7e(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Eo,!(s||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&T7e(r)}function I7e({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=t==null?void 0:t()){this.id=Est++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Tst),this.nodes.forEach(Ost),this.nodes.forEach(Mst),this.nodes.forEach(Ist)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new pst)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new oA),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=q8e(o)&&!Cnt(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||l)&&(this.isLayoutDirty=!0),e){let d,f=0;const x=()=>this.root.updateBlockedByResize=!1;Eo.read(()=>{f=window.innerWidth}),e(o,()=>{const g=window.innerWidth;g!==f&&(f=g,this.root.updateBlockedByResize=!0,d&&d(),d=mst(x,250),TF.hasAnimatedSinceResize&&(TF.hasAnimatedSinceResize=!1,this.nodes.forEach(dhe)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:x,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||u.getDefaultTransition()||$st,{onLayoutAnimationStart:w,onLayoutAnimationComplete:C}=u.getProps(),N=!this.targetLayout||!k7e(this.targetLayout,g),I=!f&&x;if(this.options.layoutRoot||this.resumeFrom||I||f&&(N||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const P={...Nse(v,"layout"),onPlay:w,onComplete:C};(u.shouldReduceMotion||this.options.layoutRoot)&&(P.delay=0,P.type=!1),this.startAnimation(P),this.setAnimationOrigin(d,I)}else f||dhe(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Fy(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Rst),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&T7e(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(che);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(uhe);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Fst),this.nodes.forEach(_st),this.nodes.forEach(kst)):this.nodes.forEach(uhe),this.clearAllSnapshots();const l=zd.now();Hc.delta=_c(0,1e3/60,l-Hc.timestamp),Hc.timestamp=l,Hc.isProcessing=!0,Sz.update.process(Hc),Sz.preRender.process(Hc),Sz.render.process(Hc),Hc.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,jse.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Pst),this.sharedNodes.forEach(Lst)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Eo.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Eo.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Zu(this.snapshot.measuredBox.x)&&!Zu(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=dl(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!_7e(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&this.instance&&(l||yv(this.latestValues)||d)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),Ust(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return dl();const l=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(zst))){const{scroll:d}=this.root;d&&(_C(l.x,d.offset.x),_C(l.y,d.offset.y))}return l}removeElementScroll(o){var c;const l=dl();if(oh(l,o),(c=this.scroll)!=null&&c.wasRoot)return l;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:x}=d;d!==this.root&&f&&x.layoutScroll&&(f.wasRoot&&oh(l,o),_C(l.x,f.offset.x),_C(l.y,f.offset.y))}return l}applyTransform(o,l=!1){const c=dl();oh(c,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&kC(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),yv(d.latestValues)&&kC(c,d.latestValues)}return yv(this.latestValues)&&kC(c,this.latestValues),c}removeTransform(o){const l=dl();oh(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!yv(u.latestValues))continue;zQ(u.latestValues)&&u.updateSnapshot();const d=dl(),f=u.measurePageBox();oh(d,f),rhe(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return yv(this.latestValues)&&rhe(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Hc.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var x;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=Hc.timestamp,!this.targetDelta&&!this.relativeTarget){const g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=dl(),this.relativeTargetOrigin=dl(),Uj(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),oh(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=dl(),this.targetWithTransforms=dl()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Krt(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):oh(this.target,this.layout.layoutBox),c7e(this.target,this.targetDelta)):oh(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const g=this.getClosestProjectingParent();g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=dl(),this.relativeTargetOrigin=dl(),Uj(this.relativeTargetOrigin,this.target,g.target),oh(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||zQ(this.parent.latestValues)||l7e(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var v;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Hc.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;oh(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,x=this.treeScale.y;art(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=dl());const{target:g}=o;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ehe(this.prevProjectionDelta.x,this.projectionDelta.x),ehe(this.prevProjectionDelta.y,this.projectionDelta.y)),$j(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==x||!lhe(this.projectionDelta.x,this.prevProjectionDelta.x)||!lhe(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=TC(),this.projectionDelta=TC(),this.projectionDeltaWithTransform=TC()}setAnimationOrigin(o,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=TC();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const x=dl(),g=c?c.source:void 0,v=this.layout?this.layout.source:void 0,w=g!==v,C=this.getStack(),N=!C||C.members.length<=1,I=!!(w&&!N&&this.options.crossfade===!0&&!this.path.some(Bst));this.animationProgress=0;let P;this.mixTargetDelta=R=>{const F=R/1e3;fhe(f.x,o.x,F),fhe(f.y,o.y,F),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Uj(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Dst(this.relativeTarget,this.relativeTargetOrigin,x,F),P&&Sst(this.relativeTarget,P)&&(this.isProjectionDirty=!1),P||(P=dl()),oh(P,this.relativeTarget)),w&&(this.animationValues=d,gst(d,u,this.latestValues,F,I,N)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=F},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,c,u;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Fy(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Eo.update(()=>{TF.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=jS(0)),this.currentAnimation=fst(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(jst),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&P7e(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||dl();const f=Zu(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const x=Zu(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+x}oh(l,c),kC(l,d),$j(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Nst),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&Oz("z",o,u,this.animationValues);for(let d=0;d<Fz.length;d++)Oz(`rotate${Fz[d]}`,o,u,this.animationValues),Oz(`skew${Fz[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=kF(l==null?void 0:l.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=kF(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!yv(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=Ast(this.projectionDeltaWithTransform,this.treeScale,d);c&&(f=c(d,f)),o.transform=f;const{x,y:g}=this.projectionDelta;o.transformOrigin=`${x.origin*100}% ${g.origin*100}% 0`,u.animationValues?o.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:o.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const v in _9){if(d[v]===void 0)continue;const{correct:w,applyTo:C,isCSSVariable:N}=_9[v],I=f==="none"?d[v]:w(d[v],u);if(C){const P=C.length;for(let R=0;R<P;R++)o[C[R]]=I}else N?this.options.visualElement.renderState.vars[v]=I:o[v]=I}this.options.layoutId&&(o.pointerEvents=u===this?kF(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(che),this.root.sharedNodes.clear()}}}function _st(e){e.updateLayout()}function kst(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:a}=e.options,o=t.source!==e.layout.source;a==="size"?Ch(f=>{const x=o?t.measuredBox[f]:t.layoutBox[f],g=Zu(x);x.min=r[f].min,x.max=x.min+g}):P7e(a,t.layoutBox,r)&&Ch(f=>{const x=o?t.measuredBox[f]:t.layoutBox[f],g=Zu(r[f]);x.max=x.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+g)});const l=TC();$j(l,r,t.layoutBox);const c=TC();o?$j(c,e.applyTransform(s,!0),t.measuredBox):$j(c,r,t.layoutBox);const u=!_7e(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:x,layout:g}=f;if(x&&g){const v=dl();Uj(v,t.layoutBox,x.layoutBox);const w=dl();Uj(w,r,g.layoutBox),k7e(v,w)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=v,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Tst(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Ist(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Pst(e){e.clearSnapshot()}function che(e){e.clearMeasurements()}function uhe(e){e.isLayoutDirty=!1}function Fst(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function dhe(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Ost(e){e.resolveTargetDelta()}function Mst(e){e.calcProjection()}function Rst(e){e.resetSkewAndRotation()}function Lst(e){e.removeLeadSnapshot()}function fhe(e,t,n){e.translate=Lo(t.translate,0,n),e.scale=Lo(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function hhe(e,t,n,r){e.min=Lo(t.min,n.min,r),e.max=Lo(t.max,n.max,r)}function Dst(e,t,n,r){hhe(e.x,t.x,n.x,r),hhe(e.y,t.y,n.y,r)}function Bst(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const $st={duration:.45,ease:[.4,0,.1,1]},phe=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),mhe=phe("applewebkit/")&&!phe("chrome/")?Math.round:rl;function xhe(e){e.min=mhe(e.min),e.max=mhe(e.max)}function Ust(e){xhe(e.x),xhe(e.y)}function P7e(e,t,n){return e==="position"||e==="preserve-aspect"&&!Grt(ohe(t),ohe(n),.2)}function zst(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Hst=I7e({attachResizeListener:(e,t)=>k9(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Mz={current:void 0},F7e=I7e({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Mz.current){const e=new Hst({});e.mount(window),e.setOptions({layoutScroll:!0}),Mz.current=e}return Mz.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Vst={pan:{Feature:lst},drag:{Feature:ost,ProjectionNode:F7e,MeasureLayout:A7e}};function ghe(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,a=r[s];a&&Eo.postRender(()=>a(t,Ck(t)))}let Wst=class extends Jy{mount(){const{current:t}=this.node;t&&(this.unmount=gnt(t,(n,r)=>(ghe(this.node,r,"Start"),s=>ghe(this.node,s,"End"))))}unmount(){}},qst=class extends Jy{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ix(k9(this.node.current,"focus",()=>this.onFocus()),k9(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function bhe(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),a=r[s];a&&Eo.postRender(()=>a(t,Ck(t)))}let Gst=class extends Jy{mount(){const{current:t}=this.node;t&&(this.unmount=wnt(t,(n,r)=>(bhe(this.node,r,"Start"),(s,{success:a})=>bhe(this.node,s,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};const YQ=new WeakMap,Rz=new WeakMap,Kst=e=>{const t=YQ.get(e.target);t&&t(e)},Yst=e=>{e.forEach(Kst)};function Xst({root:e,...t}){const n=e||document;Rz.has(n)||Rz.set(n,{});const r=Rz.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(Yst,{root:e,...t})),r[s]}function Qst(e,t,n){const r=Xst(t);return YQ.set(e,n),r.observe(e),()=>{YQ.delete(e),r.unobserve(e)}}const Zst={some:0,all:1};let Jst=class extends Jy{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:a}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Zst[s]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),x=u?d:f;x&&x(c)};return Qst(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(eit(t,n))&&this.startObserver()}unmount(){}};function eit({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const tit={inView:{Feature:Jst},tap:{Feature:Gst},focus:{Feature:qst},hover:{Feature:Wst}},nit={layout:{ProjectionNode:F7e,MeasureLayout:A7e}},rit={...Urt,...tit,...Vst,...nit},Qp=rrt(rit,xrt),yhe={yellow:"bg-yellow-300",red:"bg-red-300",purple:"bg-purple-300",emerald:"bg-emerald-300",blue:"bg-sky-300",orange:"bg-orange-300"};function m0({label:e="NEW",tone:t="yellow"}){const n=yhe[t]??yhe.yellow;return i.jsxs("span",{className:"relative inline-flex h-4 items-center rounded-full px-2 text-[9px] font-semibold uppercase tracking-[0.08em] text-black overflow-hidden select-none ml-1 mt-[1px]",children:[i.jsx("span",{className:`absolute inset-[1px] rounded-full ${n}`}),i.jsx(Qp.span,{className:"absolute -inset-y-2 left-[-40%] h-[200%] w-[40%] rotate-[18deg] bg-gradient-to-r from-transparent via-white/70 to-transparent opacity-80",animate:{x:["0%","300%"]},transition:{duration:3.2,ease:"linear",repeat:1/0}}),i.jsx("span",{className:"relative z-10",children:e})]})}function sit({label:e,items:t=[],activePaths:n=[],badgeLabel:r,badgeTone:s="yellow",align:a="left"}){var d;const{pathname:o}=Ic(),l=(d=n==null?void 0:n.some)==null?void 0:d.call(n,f=>o.startsWith(f)),c=a==="right"?"right-0":"left-0",u=f=>{if(!f)return null;if(typeof f=="string")return i.jsx("img",{src:f,alt:"",className:"w-4 h-4 object-contain shrink-0",loading:"lazy"});if(Se.isValidElement(f))return f;if(typeof f=="function"){const x=f;return i.jsx(x,{className:"w-4 h-4 shrink-0"})}return null};return i.jsxs(OD,{as:"div",className:"relative hidden sm:inline-block text-left",children:[i.jsxs(PD,{className:`${l?"bg-[#232323]":"bg-transparent"} h-8 px-2 py-2 hover:bg-[#232323] rounded-[256px] inline-flex items-center focus:outline-none focus:ring-0`,children:[i.jsx("div",{className:"text-white text-[13px] font-semibold font-manrope leading-none",children:e}),r?i.jsx(m0,{label:r,tone:s}):null,i.jsx(N9,{"aria-hidden":"true",className:"-mr-1 size-5 text-gray-400"})]}),i.jsx(FD,{transition:!0,className:`absolute ${c} z-50 mt-1 origin-top-right ring-1 ring-black/5 transition focus:outline-none data-[closed]:scale-95 data-[closed]:transform data-[closed]:opacity-0 data-[enter]:duration-100 data-[leave]:duration-75 data-[enter]:ease-out data-[leave]:ease-in w-max min-w-[220px] bg-[#1A1A1A] rounded-2xl shadow border border-[#242424]`,children:i.jsx("div",{className:"flex flex-col items-start gap-1.5 p-1.5",children:t.map((f,x)=>{if(f.flyout&&f.submenu)return i.jsxs(AC,{as:"div",className:"relative group w-full",children:[i.jsxs("div",{className:"w-full p-2.5 hover:bg-[#111111] rounded-2xl flex justify-between items-center cursor-pointer",children:[i.jsx("span",{className:"text-white text-[13px] font-semibold font-manrope",children:f.label}),i.jsx(N9,{className:"size-4 -rotate-90 text-gray-400"})]}),i.jsx("div",{className:"absolute top-0 left-full hidden group-hover:block z-50 px-2",children:i.jsx("div",{className:"min-w-[220px] bg-[#1A1A1A] rounded-2xl shadow border border-[#242424] p-1.5",children:f.submenu.map((v,w)=>v.to?i.jsx(kde,{to:v.to,className:"w-full p-2.5 hover:bg-[#111111] rounded-2xl flex justify-between items-center",children:i.jsx("span",{className:"text-white text-[13px] font-semibold font-manrope",children:v.label})},`sub-to-${w}`):i.jsxs("button",{onClick:v.onClick,className:"w-full p-2.5 hover:bg-[#111111] rounded-2xl flex justify-start items-center",children:[i.jsx("span",{className:"text-white text-[13px] font-semibold font-manrope",children:v.label}),v.badge&&i.jsx(m0,{tone:"emerald",label:v.badge})]},`sub-btn-${w}`))})})]},`flyout-${x}`);const g=()=>i.jsx("div",{className:"flex justify-between items-center gap-6 w-full",children:i.jsxs("div",{className:"text-white text-[13px] font-semibold font-manrope flex items-center gap-2",children:[u(f.icon),f.label,f.badge&&i.jsx(m0,{tone:"emerald",label:f.badge})]})});return f.to?i.jsx(AC,{children:i.jsx(kde,{to:f.to,className:"w-full p-2.5 hover:bg-[#111111] rounded-2xl block",children:i.jsx(g,{})})},`to-${f.to}-${x}`):f.href?i.jsx(AC,{children:i.jsx("a",{href:f.href,target:f.external?"_blank":void 0,rel:f.external?"noreferrer":void 0,className:"w-full p-2.5 hover:bg-[#111111] rounded-2xl block",children:i.jsx(g,{})})},`href-${f.href}-${x}`):i.jsx(AC,{children:i.jsx("button",{className:"w-full p-2.5 hover:bg-[#111111] rounded-2xl",onClick:f.onClick,children:i.jsx(g,{})})},`btn-${x}`)})})})]})}const oy=({className:e})=>i.jsxs("svg",{viewBox:"0 0 53 96",fill:"currentColor",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:`size-full ${e}`,children:[i.jsx("path",{d:"M23 76.3751L0 96V20.687L23 0V76.3751Z"}),i.jsx("path",{d:"M53 76.4219L30 96V66.6279L53 46V76.4219Z"})]}),iit=[{type:"link",label:"Terminal",to:"/terminal/BTC"},{type:"dropdown",label:"Copy Trade",activePaths:["/copy-trade","/wallet-management","/discover-wallets","/hyperliquid-vaults","/back-testing","/hyperliquid-whale-trades","/hyperliquid-fee-calculator"],items:[{label:"Discover Wallets",to:"/discover-wallets"},{label:"My Copy Trading",to:"/copy-trade"},{label:"Wallet Management",to:"/wallet-management"},{label:"Discover Vaults",to:"/hyperliquid-vaults"},{label:"Backtest",to:"/back-testing"},{label:"Whale Trades",to:"/hyperliquid-whale-trades"},{label:"HL Fee Calculator",to:"/hyperliquid-fee-calculator"},{label:"Ticker",to:"ticker"}]},{type:"dropdown",label:"Leaderboard",activePaths:["/leaderboard","/referral"],items:[{label:"Leaderboard",to:"/leaderboard"},{label:"Referral",to:"/referral"}]},{type:"dropdown",label:"Tracker",activePaths:["/tracked-wallets","/tracker"],items:[{label:"Tracked Wallets",to:"/tracked-wallets"},{label:"My Activities",to:"/tracker"}]},{type:"dropdown",label:"Trading Bots",activePaths:[""],badgeTone:"yellow",items:[{label:"Extended Grid Bot",to:"/terminal/extended/BTC#gridbot",icon:"https://app.extended.exchange/assets/logo/extended.svg"},{label:"Extended DCA Bot",to:"/dca-bot",icon:"https://app.extended.exchange/assets/logo/extended.svg"},{label:"Extended Farming",action:"openExtended",badge:"SMART",icon:"https://app.extended.exchange/assets/logo/extended.svg"},{label:"Lighter Grid Bot",to:"/terminal/lighter/BTC#gridbot",icon:oy},{label:"HL Grid Bot",to:"/terminal/hyperliquid/BTC#gridbot",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg"},{label:"HL Market Maker Bot",to:"/market-maker",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg"},{label:"Farming Bots",flyout:!0,submenu:[{label:"Aster Farming",action:"openAster"},{label:"BasedApp Farming",action:"openFarm"},{label:"Lighter Farming",action:"openLighter"},{label:"Apex Farming",action:"openApex"},{label:"Variational Farming",action:"openVariational"},{label:"Paradex Farming",action:"openParadex"},{label:"Pacifica Farming",action:"openPacifica"}]}]}];function u3(e){"@babel/helpers - typeof";return u3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u3(e)}function ait(e,t){if(u3(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(u3(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function O7e(e){var t=ait(e,"string");return u3(t)=="symbol"?t:t+""}function lj(e,t,n){return(t=O7e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vhe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function zs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vhe(Object(n),!0).forEach(function(r){lj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vhe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oit(e){if(Array.isArray(e))return e}function lit(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function XQ(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function M7e(e,t){if(e){if(typeof e=="string")return XQ(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?XQ(e,t):void 0}}function cit(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lg(e,t){return oit(e)||lit(e,t)||M7e(e,t)||cit()}function uit(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function m1(e,t){if(e==null)return{};var n,r,s=uit(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}var dit=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function fit(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,s=r===void 0?!1:r,a=e.defaultValue,o=a===void 0?null:a,l=e.inputValue,c=e.menuIsOpen,u=e.onChange,d=e.onInputChange,f=e.onMenuClose,x=e.onMenuOpen,g=e.value,v=m1(e,dit),w=m.useState(l!==void 0?l:n),C=Lg(w,2),N=C[0],I=C[1],P=m.useState(c!==void 0?c:s),R=Lg(P,2),F=R[0],U=R[1],L=m.useState(g!==void 0?g:o),z=Lg(L,2),X=z[0],ne=z[1],J=m.useCallback(function(G,V){typeof u=="function"&&u(G,V),ne(G)},[u]),Z=m.useCallback(function(G,V){var ee;typeof d=="function"&&(ee=d(G,V)),I(ee!==void 0?ee:G)},[d]),re=m.useCallback(function(){typeof x=="function"&&x(),U(!0)},[x]),he=m.useCallback(function(){typeof f=="function"&&f(),U(!1)},[f]),Y=l!==void 0?l:N,ie=c!==void 0?c:F,oe=g!==void 0?g:X;return zs(zs({},v),{},{inputValue:Y,menuIsOpen:ie,onChange:J,onInputChange:Z,onMenuClose:he,onMenuOpen:re,value:oe})}function Ys(){return Ys=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ys.apply(null,arguments)}function hit(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function whe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,O7e(r.key),r)}}function pit(e,t,n){return whe(e.prototype,t),whe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function QQ(e,t){return QQ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},QQ(e,t)}function mit(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&QQ(e,t)}function KO(e){return KO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},KO(e)}function R7e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(R7e=function(){return!!e})()}function xit(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function git(e,t){if(t&&(u3(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xit(e)}function bit(e){var t=R7e();return function(){var n,r=KO(e);if(t){var s=KO(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return git(this,n)}}function yit(e){if(Array.isArray(e))return XQ(e)}function vit(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wit(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lse(e){return yit(e)||vit(e)||M7e(e)||wit()}function Cit(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function Sit(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var Nit=function(){function e(n){var r=this;this._insertTag=function(s){var a;r.tags.length===0?r.insertionPoint?a=r.insertionPoint.nextSibling:r.prepend?a=r.container.firstChild:a=r.before:a=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(s,a),r.tags.push(s)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Sit(this));var s=this.tags[this.tags.length-1];if(this.isSpeedy){var a=Cit(s);try{a.insertRule(r,a.cssRules.length)}catch{}}else s.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var s;return(s=r.parentNode)==null?void 0:s.removeChild(r)}),this.tags=[],this.ctr=0},e}(),du="-ms-",YO="-moz-",ya="-webkit-",L7e="comm",Dse="rule",Bse="decl",Ait="@import",D7e="@keyframes",jit="@layer",Eit=Math.abs,zD=String.fromCharCode,_it=Object.assign;function kit(e,t){return qc(e,0)^45?(((t<<2^qc(e,0))<<2^qc(e,1))<<2^qc(e,2))<<2^qc(e,3):0}function B7e(e){return e.trim()}function Tit(e,t){return(e=t.exec(e))?e[0]:e}function va(e,t,n){return e.replace(t,n)}function ZQ(e,t){return e.indexOf(t)}function qc(e,t){return e.charCodeAt(t)|0}function T9(e,t,n){return e.slice(t,n)}function d0(e){return e.length}function $se(e){return e.length}function EI(e,t){return t.push(e),e}function Iit(e,t){return e.map(t).join("")}var HD=1,_S=1,$7e=0,Jd=0,Fl=0,dA="";function VD(e,t,n,r,s,a,o){return{value:e,root:t,parent:n,type:r,props:s,children:a,line:HD,column:_S,length:o,return:""}}function f7(e,t){return _it(VD("",null,null,"",null,null,0),e,{length:-e.length},t)}function Pit(){return Fl}function Fit(){return Fl=Jd>0?qc(dA,--Jd):0,_S--,Fl===10&&(_S=1,HD--),Fl}function Mf(){return Fl=Jd<$7e?qc(dA,Jd++):0,_S++,Fl===10&&(_S=1,HD++),Fl}function I0(){return qc(dA,Jd)}function IF(){return Jd}function Sk(e,t){return T9(dA,e,t)}function I9(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function U7e(e){return HD=_S=1,$7e=d0(dA=e),Jd=0,[]}function z7e(e){return dA="",e}function PF(e){return B7e(Sk(Jd-1,JQ(e===91?e+2:e===40?e+1:e)))}function Oit(e){for(;(Fl=I0())&&Fl<33;)Mf();return I9(e)>2||I9(Fl)>3?"":" "}function Mit(e,t){for(;--t&&Mf()&&!(Fl<48||Fl>102||Fl>57&&Fl<65||Fl>70&&Fl<97););return Sk(e,IF()+(t<6&&I0()==32&&Mf()==32))}function JQ(e){for(;Mf();)switch(Fl){case e:return Jd;case 34:case 39:e!==34&&e!==39&&JQ(Fl);break;case 40:e===41&&JQ(e);break;case 92:Mf();break}return Jd}function Rit(e,t){for(;Mf()&&e+Fl!==57;)if(e+Fl===84&&I0()===47)break;return"/*"+Sk(t,Jd-1)+"*"+zD(e===47?e:Mf())}function Lit(e){for(;!I9(I0());)Mf();return Sk(e,Jd)}function Dit(e){return z7e(FF("",null,null,null,[""],e=U7e(e),0,[0],e))}function FF(e,t,n,r,s,a,o,l,c){for(var u=0,d=0,f=o,x=0,g=0,v=0,w=1,C=1,N=1,I=0,P="",R=s,F=a,U=r,L=P;C;)switch(v=I,I=Mf()){case 40:if(v!=108&&qc(L,f-1)==58){ZQ(L+=va(PF(I),"&","&\f"),"&\f")!=-1&&(N=-1);break}case 34:case 39:case 91:L+=PF(I);break;case 9:case 10:case 13:case 32:L+=Oit(v);break;case 92:L+=Mit(IF()-1,7);continue;case 47:switch(I0()){case 42:case 47:EI(Bit(Rit(Mf(),IF()),t,n),c);break;default:L+="/"}break;case 123*w:l[u++]=d0(L)*N;case 125*w:case 59:case 0:switch(I){case 0:case 125:C=0;case 59+d:N==-1&&(L=va(L,/\f/g,"")),g>0&&d0(L)-f&&EI(g>32?She(L+";",r,n,f-1):She(va(L," ","")+";",r,n,f-2),c);break;case 59:L+=";";default:if(EI(U=Che(L,t,n,u,d,s,l,P,R=[],F=[],f),a),I===123)if(d===0)FF(L,t,U,U,R,a,f,l,F);else switch(x===99&&qc(L,3)===110?100:x){case 100:case 108:case 109:case 115:FF(e,U,U,r&&EI(Che(e,U,U,0,0,s,l,P,s,R=[],f),F),s,F,f,l,r?R:F);break;default:FF(L,U,U,U,[""],F,0,l,F)}}u=d=g=0,w=N=1,P=L="",f=o;break;case 58:f=1+d0(L),g=v;default:if(w<1){if(I==123)--w;else if(I==125&&w++==0&&Fit()==125)continue}switch(L+=zD(I),I*w){case 38:N=d>0?1:(L+="\f",-1);break;case 44:l[u++]=(d0(L)-1)*N,N=1;break;case 64:I0()===45&&(L+=PF(Mf())),x=I0(),d=f=d0(P=L+=Lit(IF())),I++;break;case 45:v===45&&d0(L)==2&&(w=0)}}return a}function Che(e,t,n,r,s,a,o,l,c,u,d){for(var f=s-1,x=s===0?a:[""],g=$se(x),v=0,w=0,C=0;v<r;++v)for(var N=0,I=T9(e,f+1,f=Eit(w=o[v])),P=e;N<g;++N)(P=B7e(w>0?x[N]+" "+I:va(I,/&\f/g,x[N])))&&(c[C++]=P);return VD(e,t,n,s===0?Dse:l,c,u,d)}function Bit(e,t,n){return VD(e,t,n,L7e,zD(Pit()),T9(e,2,-2),0)}function She(e,t,n,r){return VD(e,t,n,Bse,T9(e,0,r),T9(e,r+1,-1),r)}function YC(e,t){for(var n="",r=$se(e),s=0;s<r;s++)n+=t(e[s],s,e,t)||"";return n}function $it(e,t,n,r){switch(e.type){case jit:if(e.children.length)break;case Ait:case Bse:return e.return=e.return||e.value;case L7e:return"";case D7e:return e.return=e.value+"{"+YC(e.children,r)+"}";case Dse:e.value=e.props.join(",")}return d0(n=YC(e.children,r))?e.return=e.value+"{"+n+"}":""}function Uit(e){var t=$se(e);return function(n,r,s,a){for(var o="",l=0;l<t;l++)o+=e[l](n,r,s,a)||"";return o}}function zit(e){return function(t){t.root||(t=t.return)&&e(t)}}function Hit(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Vit=function(t,n,r){for(var s=0,a=0;s=a,a=I0(),s===38&&a===12&&(n[r]=1),!I9(a);)Mf();return Sk(t,Jd)},Wit=function(t,n){var r=-1,s=44;do switch(I9(s)){case 0:s===38&&I0()===12&&(n[r]=1),t[r]+=Vit(Jd-1,n,r);break;case 2:t[r]+=PF(s);break;case 4:if(s===44){t[++r]=I0()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=zD(s)}while(s=Mf());return t},qit=function(t,n){return z7e(Wit(U7e(t),n))},Nhe=new WeakMap,Git=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,s=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!Nhe.get(r))&&!s){Nhe.set(t,!0);for(var a=[],o=qit(n,a),l=r.props,c=0,u=0;c<o.length;c++)for(var d=0;d<l.length;d++,u++)t.props[u]=a[c]?o[c].replace(/&\f/g,l[d]):l[d]+" "+o[c]}}},Kit=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function H7e(e,t){switch(kit(e,t)){case 5103:return ya+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ya+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ya+e+YO+e+du+e+e;case 6828:case 4268:return ya+e+du+e+e;case 6165:return ya+e+du+"flex-"+e+e;case 5187:return ya+e+va(e,/(\w+).+(:[^]+)/,ya+"box-$1$2"+du+"flex-$1$2")+e;case 5443:return ya+e+du+"flex-item-"+va(e,/flex-|-self/,"")+e;case 4675:return ya+e+du+"flex-line-pack"+va(e,/align-content|flex-|-self/,"")+e;case 5548:return ya+e+du+va(e,"shrink","negative")+e;case 5292:return ya+e+du+va(e,"basis","preferred-size")+e;case 6060:return ya+"box-"+va(e,"-grow","")+ya+e+du+va(e,"grow","positive")+e;case 4554:return ya+va(e,/([^-])(transform)/g,"$1"+ya+"$2")+e;case 6187:return va(va(va(e,/(zoom-|grab)/,ya+"$1"),/(image-set)/,ya+"$1"),e,"")+e;case 5495:case 3959:return va(e,/(image-set\([^]*)/,ya+"$1$`$1");case 4968:return va(va(e,/(.+:)(flex-)?(.*)/,ya+"box-pack:$3"+du+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ya+e+e;case 4095:case 3583:case 4068:case 2532:return va(e,/(.+)-inline(.+)/,ya+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(d0(e)-1-t>6)switch(qc(e,t+1)){case 109:if(qc(e,t+4)!==45)break;case 102:return va(e,/(.+:)(.+)-([^]+)/,"$1"+ya+"$2-$3$1"+YO+(qc(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~ZQ(e,"stretch")?H7e(va(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(qc(e,t+1)!==115)break;case 6444:switch(qc(e,d0(e)-3-(~ZQ(e,"!important")&&10))){case 107:return va(e,":",":"+ya)+e;case 101:return va(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ya+(qc(e,14)===45?"inline-":"")+"box$3$1"+ya+"$2$3$1"+du+"$2box$3")+e}break;case 5936:switch(qc(e,t+11)){case 114:return ya+e+du+va(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ya+e+du+va(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ya+e+du+va(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ya+e+du+e+e}return e}var Yit=function(t,n,r,s){if(t.length>-1&&!t.return)switch(t.type){case Bse:t.return=H7e(t.value,t.length);break;case D7e:return YC([f7(t,{value:va(t.value,"@","@"+ya)})],s);case Dse:if(t.length)return Iit(t.props,function(a){switch(Tit(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return YC([f7(t,{props:[va(a,/:(read-\w+)/,":"+YO+"$1")]})],s);case"::placeholder":return YC([f7(t,{props:[va(a,/:(plac\w+)/,":"+ya+"input-$1")]}),f7(t,{props:[va(a,/:(plac\w+)/,":"+YO+"$1")]}),f7(t,{props:[va(a,/:(plac\w+)/,du+"input-$1")]})],s)}return""})}},Xit=[Yit],Qit=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(w){var C=w.getAttribute("data-emotion");C.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var s=t.stylisPlugins||Xit,a={},o,l=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(w){for(var C=w.getAttribute("data-emotion").split(" "),N=1;N<C.length;N++)a[C[N]]=!0;l.push(w)});var c,u=[Git,Kit];{var d,f=[$it,zit(function(w){d.insert(w)})],x=Uit(u.concat(s,f)),g=function(C){return YC(Dit(C),x)};c=function(C,N,I,P){d=I,g(C?C+"{"+N.styles+"}":N.styles),P&&(v.inserted[N.name]=!0)}}var v={key:n,sheet:new Nit({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:c};return v.sheet.hydrate(l),v},Lz={exports:{}},Aa={};/** @license React v16.13.1
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Ahe;function Zit(){if(Ahe)return Aa;Ahe=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,x=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,w=e?Symbol.for("react.block"):60121,C=e?Symbol.for("react.fundamental"):60117,N=e?Symbol.for("react.responder"):60118,I=e?Symbol.for("react.scope"):60119;function P(F){if(typeof F=="object"&&F!==null){var U=F.$$typeof;switch(U){case t:switch(F=F.type,F){case c:case u:case r:case a:case s:case f:return F;default:switch(F=F&&F.$$typeof,F){case l:case d:case v:case g:case o:return F;default:return U}}case n:return U}}}function R(F){return P(F)===u}return Aa.AsyncMode=c,Aa.ConcurrentMode=u,Aa.ContextConsumer=l,Aa.ContextProvider=o,Aa.Element=t,Aa.ForwardRef=d,Aa.Fragment=r,Aa.Lazy=v,Aa.Memo=g,Aa.Portal=n,Aa.Profiler=a,Aa.StrictMode=s,Aa.Suspense=f,Aa.isAsyncMode=function(F){return R(F)||P(F)===c},Aa.isConcurrentMode=R,Aa.isContextConsumer=function(F){return P(F)===l},Aa.isContextProvider=function(F){return P(F)===o},Aa.isElement=function(F){return typeof F=="object"&&F!==null&&F.$$typeof===t},Aa.isForwardRef=function(F){return P(F)===d},Aa.isFragment=function(F){return P(F)===r},Aa.isLazy=function(F){return P(F)===v},Aa.isMemo=function(F){return P(F)===g},Aa.isPortal=function(F){return P(F)===n},Aa.isProfiler=function(F){return P(F)===a},Aa.isStrictMode=function(F){return P(F)===s},Aa.isSuspense=function(F){return P(F)===f},Aa.isValidElementType=function(F){return typeof F=="string"||typeof F=="function"||F===r||F===u||F===a||F===s||F===f||F===x||typeof F=="object"&&F!==null&&(F.$$typeof===v||F.$$typeof===g||F.$$typeof===o||F.$$typeof===l||F.$$typeof===d||F.$$typeof===C||F.$$typeof===N||F.$$typeof===I||F.$$typeof===w)},Aa.typeOf=P,Aa}var jhe;function Jit(){return jhe||(jhe=1,Lz.exports=Zit()),Lz.exports}var Dz,Ehe;function eat(){if(Ehe)return Dz;Ehe=1;var e=Jit(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};a[e.ForwardRef]=r,a[e.Memo]=s;function o(v){return e.isMemo(v)?s:a[v.$$typeof]||t}var l=Object.defineProperty,c=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,x=Object.prototype;function g(v,w,C){if(typeof w!="string"){if(x){var N=f(w);N&&N!==x&&g(v,N,C)}var I=c(w);u&&(I=I.concat(u(w)));for(var P=o(v),R=o(w),F=0;F<I.length;++F){var U=I[F];if(!n[U]&&!(C&&C[U])&&!(R&&R[U])&&!(P&&P[U])){var L=d(w,U);try{l(v,U,L)}catch{}}}}return v}return Dz=g,Dz}eat();var tat=!0;function nat(e,t,n){var r="";return n.split(" ").forEach(function(s){e[s]!==void 0?t.push(e[s]+";"):s&&(r+=s+" ")}),r}var V7e=function(t,n,r){var s=t.key+"-"+n.name;(r===!1||tat===!1)&&t.registered[s]===void 0&&(t.registered[s]=n.styles)},rat=function(t,n,r){V7e(t,n,r);var s=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var a=n;do t.insert(n===a?"."+s:"",a,t.sheet,!0),a=a.next;while(a!==void 0)}};function sat(e){for(var t=0,n,r=0,s=e.length;s>=4;++r,s-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(s){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var iat={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},aat=/[A-Z]|^ms/g,oat=/_EMO_([^_]+?)_([^]*?)_EMO_/g,W7e=function(t){return t.charCodeAt(1)===45},_he=function(t){return t!=null&&typeof t!="boolean"},Bz=Hit(function(e){return W7e(e)?e:e.replace(aat,"-$&").toLowerCase()}),khe=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(oat,function(r,s,a){return f0={name:s,styles:a,next:f0},s})}return iat[t]!==1&&!W7e(t)&&typeof n=="number"&&n!==0?n+"px":n};function P9(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var s=n;if(s.anim===1)return f0={name:s.name,styles:s.styles,next:f0},s.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)f0={name:o.name,styles:o.styles,next:f0},o=o.next;var l=a.styles+";";return l}return lat(e,t,n)}case"function":{if(e!==void 0){var c=f0,u=n(e);return f0=c,P9(e,t,u)}break}}var d=n;return d}function lat(e,t,n){var r="";if(Array.isArray(n))for(var s=0;s<n.length;s++)r+=P9(e,t,n[s])+";";else for(var a in n){var o=n[a];if(typeof o!="object"){var l=o;_he(l)&&(r+=Bz(a)+":"+khe(a,l)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&t==null)for(var c=0;c<o.length;c++)_he(o[c])&&(r+=Bz(a)+":"+khe(a,o[c])+";");else{var u=P9(e,t,o);switch(a){case"animation":case"animationName":{r+=Bz(a)+":"+u+";";break}default:r+=a+"{"+u+"}"}}}return r}var The=/label:\s*([^\s;{]+)\s*(;|$)/g,f0;function q7e(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,s="";f0=void 0;var a=e[0];if(a==null||a.raw===void 0)r=!1,s+=P9(n,t,a);else{var o=a;s+=o[0]}for(var l=1;l<e.length;l++)if(s+=P9(n,t,e[l]),r){var c=a;s+=c[l]}The.lastIndex=0;for(var u="",d;(d=The.exec(s))!==null;)u+="-"+d[1];var f=sat(s)+u;return{name:f,styles:s,next:f0}}var cat=function(t){return t()},uat=Ey.useInsertionEffect?Ey.useInsertionEffect:!1,dat=uat||cat,G7e=m.createContext(typeof HTMLElement<"u"?Qit({key:"css"}):null);G7e.Provider;var fat=function(t){return m.forwardRef(function(n,r){var s=m.useContext(G7e);return t(n,s,r)})},hat=m.createContext({}),Use={}.hasOwnProperty,eZ="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",pat=function(t,n){var r={};for(var s in n)Use.call(n,s)&&(r[s]=n[s]);return r[eZ]=t,r},mat=function(t){var n=t.cache,r=t.serialized,s=t.isStringTag;return V7e(n,r,s),dat(function(){return rat(n,r,s)}),null},xat=fat(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var s=e[eZ],a=[r],o="";typeof e.className=="string"?o=nat(t.registered,a,e.className):e.className!=null&&(o=e.className+" ");var l=q7e(a,void 0,m.useContext(hat));o+=t.key+"-"+l.name;var c={};for(var u in e)Use.call(e,u)&&u!=="css"&&u!==eZ&&(c[u]=e[u]);return c.className=o,n&&(c.ref=n),m.createElement(m.Fragment,null,m.createElement(mat,{cache:t,serialized:l,isStringTag:typeof s=="string"}),m.createElement(s,c))}),gat=xat,Bs=function(t,n){var r=arguments;if(n==null||!Use.call(n,"css"))return m.createElement.apply(void 0,r);var s=r.length,a=new Array(s);a[0]=gat,a[1]=pat(t,n);for(var o=2;o<s;o++)a[o]=r[o];return m.createElement.apply(null,a)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(Bs);function zse(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return q7e(t)}function bat(){var e=zse.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function yat(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const vat=Math.min,wat=Math.max,XO=Math.round,_I=Math.floor,QO=e=>({x:e,y:e});function WD(){return typeof window<"u"}function K7e(e){return X7e(e)?(e.nodeName||"").toLowerCase():"#document"}function Qg(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Y7e(e){var t;return(t=(X7e(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function X7e(e){return WD()?e instanceof Node||e instanceof Qg(e).Node:!1}function Cat(e){return WD()?e instanceof Element||e instanceof Qg(e).Element:!1}function Hse(e){return WD()?e instanceof HTMLElement||e instanceof Qg(e).HTMLElement:!1}function Ihe(e){return!WD()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Qg(e).ShadowRoot}function Q7e(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Vse(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function Sat(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Nat(e){return["html","body","#document"].includes(K7e(e))}function Vse(e){return Qg(e).getComputedStyle(e)}function Aat(e){if(K7e(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ihe(e)&&e.host||Y7e(e);return Ihe(t)?t.host:t}function Z7e(e){const t=Aat(e);return Nat(t)?e.ownerDocument?e.ownerDocument.body:e.body:Hse(t)&&Q7e(t)?t:Z7e(t)}function ZO(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Z7e(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),o=Qg(s);if(a){const l=tZ(o);return t.concat(o,o.visualViewport||[],Q7e(s)?s:[],l&&n?ZO(l):[])}return t.concat(s,ZO(s,[],n))}function tZ(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jat(e){const t=Vse(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Hse(e),a=s?e.offsetWidth:n,o=s?e.offsetHeight:r,l=XO(n)!==a||XO(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function Wse(e){return Cat(e)?e:e.contextElement}function Phe(e){const t=Wse(e);if(!Hse(t))return QO(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=jat(t);let o=(a?XO(n.width):n.width)/r,l=(a?XO(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Eat=QO(0);function _at(e){const t=Qg(e);return!Sat()||!t.visualViewport?Eat:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kat(e,t,n){return!1}function Fhe(e,t,n,r){t===void 0&&(t=!1);const s=e.getBoundingClientRect(),a=Wse(e);let o=QO(1);t&&(o=Phe(e));const l=kat()?_at(a):QO(0);let c=(s.left+l.x)/o.x,u=(s.top+l.y)/o.y,d=s.width/o.x,f=s.height/o.y;if(a){const x=Qg(a),g=r;let v=x,w=tZ(v);for(;w&&r&&g!==v;){const C=Phe(w),N=w.getBoundingClientRect(),I=Vse(w),P=N.left+(w.clientLeft+parseFloat(I.paddingLeft))*C.x,R=N.top+(w.clientTop+parseFloat(I.paddingTop))*C.y;c*=C.x,u*=C.y,d*=C.x,f*=C.y,c+=P,u+=R,v=Qg(w),w=tZ(v)}}return S9({width:d,height:f,x:c,y:u})}function J7e(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Tat(e,t){let n=null,r;const s=Y7e(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const u=e.getBoundingClientRect(),{left:d,top:f,width:x,height:g}=u;if(l||t(),!x||!g)return;const v=_I(f),w=_I(s.clientWidth-(d+x)),C=_I(s.clientHeight-(f+g)),N=_I(d),P={rootMargin:-v+"px "+-w+"px "+-C+"px "+-N+"px",threshold:wat(0,vat(1,c))||1};let R=!0;function F(U){const L=U[0].intersectionRatio;if(L!==c){if(!R)return o();L?o(!1,L):r=setTimeout(()=>{o(!1,1e-7)},1e3)}L===1&&!J7e(u,e.getBoundingClientRect())&&o(),R=!1}try{n=new IntersectionObserver(F,{...P,root:s.ownerDocument})}catch{n=new IntersectionObserver(F,P)}n.observe(e)}return o(!0),a}function Iat(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Wse(e),d=s||a?[...u?ZO(u):[],...ZO(t)]:[];d.forEach(N=>{s&&N.addEventListener("scroll",n,{passive:!0}),a&&N.addEventListener("resize",n)});const f=u&&l?Tat(u,n):null;let x=-1,g=null;o&&(g=new ResizeObserver(N=>{let[I]=N;I&&I.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var P;(P=g)==null||P.observe(t)})),n()}),u&&!c&&g.observe(u),g.observe(t));let v,w=c?Fhe(e):null;c&&C();function C(){const N=Fhe(e);w&&!J7e(w,N)&&n(),w=N,v=requestAnimationFrame(C)}return n(),()=>{var N;d.forEach(I=>{s&&I.removeEventListener("scroll",n),a&&I.removeEventListener("resize",n)}),f==null||f(),(N=g)==null||N.disconnect(),g=null,c&&cancelAnimationFrame(v)}}var nZ=m.useLayoutEffect,Pat=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],JO=function(){};function Fat(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function Oat(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];var a=[].concat(r);if(t&&e)for(var o in t)t.hasOwnProperty(o)&&t[o]&&a.push("".concat(Fat(e,o)));return a.filter(function(l){return l}).map(function(l){return String(l).trim()}).join(" ")}var Ohe=function(t){return Hat(t)?t.filter(Boolean):u3(t)==="object"&&t!==null?[t]:[]},eje=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=m1(t,Pat);return zs({},n)},sl=function(t,n,r){var s=t.cx,a=t.getStyles,o=t.getClassNames,l=t.className;return{css:a(n,t),className:s(r??{},o(n,t),l)}};function qD(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function Mat(e){return qD(e)?window.innerHeight:e.clientHeight}function tje(e){return qD(e)?window.pageYOffset:e.scrollTop}function eM(e,t){if(qD(e)){window.scrollTo(0,t);return}e.scrollTop=t}function Rat(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var s=e;s=s.parentElement;)if(t=getComputedStyle(s),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return s;return document.documentElement}function Lat(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function kI(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:JO,s=tje(e),a=t-s,o=10,l=0;function c(){l+=o;var u=Lat(l,s,a,n);eM(e,u),l<n?window.requestAnimationFrame(c):r(e)}c()}function Mhe(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),s=t.offsetHeight/3;r.bottom+s>n.bottom?eM(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+s,e.scrollHeight)):r.top-s<n.top&&eM(e,Math.max(t.offsetTop-s,0))}function Dat(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function Rhe(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function Bat(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var nje=!1,$at={get passive(){return nje=!0}},TI=typeof window<"u"?window:{};TI.addEventListener&&TI.removeEventListener&&(TI.addEventListener("p",JO,$at),TI.removeEventListener("p",JO,!1));var Uat=nje;function zat(e){return e!=null}function Hat(e){return Array.isArray(e)}function II(e,t,n){return e?t:n}var Vat=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];var a=Object.entries(t).filter(function(o){var l=Lg(o,1),c=l[0];return!r.includes(c)});return a.reduce(function(o,l){var c=Lg(l,2),u=c[0],d=c[1];return o[u]=d,o},{})},Wat=["children","innerProps"],qat=["children","innerProps"];function Gat(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,s=e.placement,a=e.shouldScroll,o=e.isFixedPosition,l=e.controlHeight,c=Rat(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var d=c.getBoundingClientRect(),f=d.height,x=n.getBoundingClientRect(),g=x.bottom,v=x.height,w=x.top,C=n.offsetParent.getBoundingClientRect(),N=C.top,I=o?window.innerHeight:Mat(c),P=tje(c),R=parseInt(getComputedStyle(n).marginBottom,10),F=parseInt(getComputedStyle(n).marginTop,10),U=N-F,L=I-w,z=U+P,X=f-P-w,ne=g-I+P+R,J=P+w-F,Z=160;switch(s){case"auto":case"bottom":if(L>=v)return{placement:"bottom",maxHeight:t};if(X>=v&&!o)return a&&kI(c,ne,Z),{placement:"bottom",maxHeight:t};if(!o&&X>=r||o&&L>=r){a&&kI(c,ne,Z);var re=o?L-R:X-R;return{placement:"bottom",maxHeight:re}}if(s==="auto"||o){var he=t,Y=o?U:z;return Y>=r&&(he=Math.min(Y-R-l,t)),{placement:"top",maxHeight:he}}if(s==="bottom")return a&&eM(c,ne),{placement:"bottom",maxHeight:t};break;case"top":if(U>=v)return{placement:"top",maxHeight:t};if(z>=v&&!o)return a&&kI(c,J,Z),{placement:"top",maxHeight:t};if(!o&&z>=r||o&&U>=r){var ie=t;return(!o&&z>=r||o&&U>=r)&&(ie=o?U-F:z-F),a&&kI(c,J,Z),{placement:"top",maxHeight:ie}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(s,'".'))}return u}function Kat(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var rje=function(t){return t==="auto"?"bottom":t},Yat=function(t,n){var r,s=t.placement,a=t.theme,o=a.borderRadius,l=a.spacing,c=a.colors;return zs((r={label:"menu"},lj(r,Kat(s),"100%"),lj(r,"position","absolute"),lj(r,"width","100%"),lj(r,"zIndex",1),r),n?{}:{backgroundColor:c.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:l.menuGutter,marginTop:l.menuGutter})},sje=m.createContext(null),Xat=function(t){var n=t.children,r=t.minMenuHeight,s=t.maxMenuHeight,a=t.menuPlacement,o=t.menuPosition,l=t.menuShouldScrollIntoView,c=t.theme,u=m.useContext(sje)||{},d=u.setPortalPlacement,f=m.useRef(null),x=m.useState(s),g=Lg(x,2),v=g[0],w=g[1],C=m.useState(null),N=Lg(C,2),I=N[0],P=N[1],R=c.spacing.controlHeight;return nZ(function(){var F=f.current;if(F){var U=o==="fixed",L=l&&!U,z=Gat({maxHeight:s,menuEl:F,minHeight:r,placement:a,shouldScroll:L,isFixedPosition:U,controlHeight:R});w(z.maxHeight),P(z.placement),d==null||d(z.placement)}},[s,a,o,l,r,d,R]),n({ref:f,placerProps:zs(zs({},t),{},{placement:I||rje(a),maxHeight:v})})},Qat=function(t){var n=t.children,r=t.innerRef,s=t.innerProps;return Bs("div",Ys({},sl(t,"menu",{menu:!0}),{ref:r},s),n)},Zat=Qat,Jat=function(t,n){var r=t.maxHeight,s=t.theme.spacing.baseUnit;return zs({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:s,paddingTop:s})},eot=function(t){var n=t.children,r=t.innerProps,s=t.innerRef,a=t.isMulti;return Bs("div",Ys({},sl(t,"menuList",{"menu-list":!0,"menu-list--is-multi":a}),{ref:s},r),n)},ije=function(t,n){var r=t.theme,s=r.spacing.baseUnit,a=r.colors;return zs({textAlign:"center"},n?{}:{color:a.neutral40,padding:"".concat(s*2,"px ").concat(s*3,"px")})},tot=ije,not=ije,rot=function(t){var n=t.children,r=n===void 0?"No options":n,s=t.innerProps,a=m1(t,Wat);return Bs("div",Ys({},sl(zs(zs({},a),{},{children:r,innerProps:s}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),s),r)},sot=function(t){var n=t.children,r=n===void 0?"Loading...":n,s=t.innerProps,a=m1(t,qat);return Bs("div",Ys({},sl(zs(zs({},a),{},{children:r,innerProps:s}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),s),r)},iot=function(t){var n=t.rect,r=t.offset,s=t.position;return{left:n.left,position:s,top:r,width:n.width,zIndex:1}},aot=function(t){var n=t.appendTo,r=t.children,s=t.controlElement,a=t.innerProps,o=t.menuPlacement,l=t.menuPosition,c=m.useRef(null),u=m.useRef(null),d=m.useState(rje(o)),f=Lg(d,2),x=f[0],g=f[1],v=m.useMemo(function(){return{setPortalPlacement:g}},[]),w=m.useState(null),C=Lg(w,2),N=C[0],I=C[1],P=m.useCallback(function(){if(s){var L=Dat(s),z=l==="fixed"?0:window.pageYOffset,X=L[x]+z;(X!==(N==null?void 0:N.offset)||L.left!==(N==null?void 0:N.rect.left)||L.width!==(N==null?void 0:N.rect.width))&&I({offset:X,rect:L})}},[s,l,x,N==null?void 0:N.offset,N==null?void 0:N.rect.left,N==null?void 0:N.rect.width]);nZ(function(){P()},[P]);var R=m.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),s&&c.current&&(u.current=Iat(s,c.current,P,{elementResize:"ResizeObserver"in window}))},[s,P]);nZ(function(){R()},[R]);var F=m.useCallback(function(L){c.current=L,R()},[R]);if(!n&&l!=="fixed"||!N)return null;var U=Bs("div",Ys({ref:F},sl(zs(zs({},t),{},{offset:N.offset,position:l,rect:N.rect}),"menuPortal",{"menu-portal":!0}),a),r);return Bs(sje.Provider,{value:v},n?Ia.createPortal(U,n):U)},oot=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},lot=function(t){var n=t.children,r=t.innerProps,s=t.isDisabled,a=t.isRtl;return Bs("div",Ys({},sl(t,"container",{"--is-disabled":s,"--is-rtl":a}),r),n)},cot=function(t,n){var r=t.theme.spacing,s=t.isMulti,a=t.hasValue,o=t.selectProps.controlShouldRenderValue;return zs({alignItems:"center",display:s&&a&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},uot=function(t){var n=t.children,r=t.innerProps,s=t.isMulti,a=t.hasValue;return Bs("div",Ys({},sl(t,"valueContainer",{"value-container":!0,"value-container--is-multi":s,"value-container--has-value":a}),r),n)},dot=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},fot=function(t){var n=t.children,r=t.innerProps;return Bs("div",Ys({},sl(t,"indicatorsContainer",{indicators:!0}),r),n)},Lhe,hot=["size"],pot=["innerProps","isRtl","size"],mot={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},aje=function(t){var n=t.size,r=m1(t,hot);return Bs("svg",Ys({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:mot},r))},qse=function(t){return Bs(aje,Ys({size:20},t),Bs("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},oje=function(t){return Bs(aje,Ys({size:20},t),Bs("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},lje=function(t,n){var r=t.isFocused,s=t.theme,a=s.spacing.baseUnit,o=s.colors;return zs({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?o.neutral60:o.neutral20,padding:a*2,":hover":{color:r?o.neutral80:o.neutral40}})},xot=lje,got=function(t){var n=t.children,r=t.innerProps;return Bs("div",Ys({},sl(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||Bs(oje,null))},bot=lje,yot=function(t){var n=t.children,r=t.innerProps;return Bs("div",Ys({},sl(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||Bs(qse,null))},vot=function(t,n){var r=t.isDisabled,s=t.theme,a=s.spacing.baseUnit,o=s.colors;return zs({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?o.neutral10:o.neutral20,marginBottom:a*2,marginTop:a*2})},wot=function(t){var n=t.innerProps;return Bs("span",Ys({},n,sl(t,"indicatorSeparator",{"indicator-separator":!0})))},Cot=bat(Lhe||(Lhe=yat([`
  0%, 80%, 100% { opacity: 0; }
  40% { opacity: 1; }
`]))),Sot=function(t,n){var r=t.isFocused,s=t.size,a=t.theme,o=a.colors,l=a.spacing.baseUnit;return zs({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:s,lineHeight:1,marginRight:s,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?o.neutral60:o.neutral20,padding:l*2})},$z=function(t){var n=t.delay,r=t.offset;return Bs("span",{css:zse({animation:"".concat(Cot," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Not=function(t){var n=t.innerProps,r=t.isRtl,s=t.size,a=s===void 0?4:s,o=m1(t,pot);return Bs("div",Ys({},sl(zs(zs({},o),{},{innerProps:n,isRtl:r,size:a}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Bs($z,{delay:0,offset:r}),Bs($z,{delay:160,offset:!0}),Bs($z,{delay:320,offset:!r}))},Aot=function(t,n){var r=t.isDisabled,s=t.isFocused,a=t.theme,o=a.colors,l=a.borderRadius,c=a.spacing;return zs({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:c.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?o.neutral5:o.neutral0,borderColor:r?o.neutral10:s?o.primary:o.neutral20,borderRadius:l,borderStyle:"solid",borderWidth:1,boxShadow:s?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:s?o.primary:o.neutral30}})},jot=function(t){var n=t.children,r=t.isDisabled,s=t.isFocused,a=t.innerRef,o=t.innerProps,l=t.menuIsOpen;return Bs("div",Ys({ref:a},sl(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":s,"control--menu-is-open":l}),o,{"aria-disabled":r||void 0}),n)},Eot=jot,_ot=["data"],kot=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},Tot=function(t){var n=t.children,r=t.cx,s=t.getStyles,a=t.getClassNames,o=t.Heading,l=t.headingProps,c=t.innerProps,u=t.label,d=t.theme,f=t.selectProps;return Bs("div",Ys({},sl(t,"group",{group:!0}),c),Bs(o,Ys({},l,{selectProps:f,theme:d,getStyles:s,getClassNames:a,cx:r}),u),Bs("div",null,n))},Iot=function(t,n){var r=t.theme,s=r.colors,a=r.spacing;return zs({label:"group",cursor:"default",display:"block"},n?{}:{color:s.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:a.baseUnit*3,paddingRight:a.baseUnit*3,textTransform:"uppercase"})},Pot=function(t){var n=eje(t);n.data;var r=m1(n,_ot);return Bs("div",Ys({},sl(t,"groupHeading",{"group-heading":!0}),r))},Fot=Tot,Oot=["innerRef","isDisabled","isHidden","inputClassName"],Mot=function(t,n){var r=t.isDisabled,s=t.value,a=t.theme,o=a.spacing,l=a.colors;return zs(zs({visibility:r?"hidden":"visible",transform:s?"translateZ(0)":""},Rot),n?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:l.neutral80})},cje={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Rot={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":zs({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},cje)},Lot=function(t){return zs({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},cje)},Dot=function(t){var n=t.cx,r=t.value,s=eje(t),a=s.innerRef,o=s.isDisabled,l=s.isHidden,c=s.inputClassName,u=m1(s,Oot);return Bs("div",Ys({},sl(t,"input",{"input-container":!0}),{"data-value":r||""}),Bs("input",Ys({className:n({input:!0},c),ref:a,style:Lot(l),disabled:o},u)))},Bot=Dot,$ot=function(t,n){var r=t.theme,s=r.spacing,a=r.borderRadius,o=r.colors;return zs({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:o.neutral10,borderRadius:a/2,margin:s.baseUnit/2})},Uot=function(t,n){var r=t.theme,s=r.borderRadius,a=r.colors,o=t.cropWithEllipsis;return zs({overflow:"hidden",textOverflow:o||o===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:s/2,color:a.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},zot=function(t,n){var r=t.theme,s=r.spacing,a=r.borderRadius,o=r.colors,l=t.isFocused;return zs({alignItems:"center",display:"flex"},n?{}:{borderRadius:a/2,backgroundColor:l?o.dangerLight:void 0,paddingLeft:s.baseUnit,paddingRight:s.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},uje=function(t){var n=t.children,r=t.innerProps;return Bs("div",r,n)},Hot=uje,Vot=uje;function Wot(e){var t=e.children,n=e.innerProps;return Bs("div",Ys({role:"button"},n),t||Bs(qse,{size:14}))}var qot=function(t){var n=t.children,r=t.components,s=t.data,a=t.innerProps,o=t.isDisabled,l=t.removeProps,c=t.selectProps,u=r.Container,d=r.Label,f=r.Remove;return Bs(u,{data:s,innerProps:zs(zs({},sl(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),a),selectProps:c},Bs(d,{data:s,innerProps:zs({},sl(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:c},n),Bs(f,{data:s,innerProps:zs(zs({},sl(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},l),selectProps:c}))},Got=qot,Kot=function(t,n){var r=t.isDisabled,s=t.isFocused,a=t.isSelected,o=t.theme,l=o.spacing,c=o.colors;return zs({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:a?c.primary:s?c.primary25:"transparent",color:r?c.neutral20:a?c.neutral0:"inherit",padding:"".concat(l.baseUnit*2,"px ").concat(l.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:a?c.primary:c.primary50}})},Yot=function(t){var n=t.children,r=t.isDisabled,s=t.isFocused,a=t.isSelected,o=t.innerRef,l=t.innerProps;return Bs("div",Ys({},sl(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":s,"option--is-selected":a}),{ref:o,"aria-disabled":r},l),n)},Xot=Yot,Qot=function(t,n){var r=t.theme,s=r.spacing,a=r.colors;return zs({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:a.neutral50,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},Zot=function(t){var n=t.children,r=t.innerProps;return Bs("div",Ys({},sl(t,"placeholder",{placeholder:!0}),r),n)},Jot=Zot,elt=function(t,n){var r=t.isDisabled,s=t.theme,a=s.spacing,o=s.colors;return zs({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?o.neutral40:o.neutral80,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},tlt=function(t){var n=t.children,r=t.isDisabled,s=t.innerProps;return Bs("div",Ys({},sl(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),s),n)},nlt=tlt,$a={ClearIndicator:yot,Control:Eot,DropdownIndicator:got,DownChevron:oje,CrossIcon:qse,Group:Fot,GroupHeading:Pot,IndicatorsContainer:fot,IndicatorSeparator:wot,Input:Bot,LoadingIndicator:Not,Menu:Zat,MenuList:eot,MenuPortal:aot,LoadingMessage:sot,NoOptionsMessage:rot,MultiValue:Got,MultiValueContainer:Hot,MultiValueLabel:Vot,MultiValueRemove:Wot,Option:Xot,Placeholder:Jot,SelectContainer:lot,SingleValue:nlt,ValueContainer:uot},rlt=function(t){return zs(zs({},$a),t.components)},Dhe=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function slt(e,t){return!!(e===t||Dhe(e)&&Dhe(t))}function ilt(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!slt(e[n],t[n]))return!1;return!0}function alt(e,t){t===void 0&&(t=ilt);var n=null;function r(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];if(n&&n.lastThis===this&&t(s,n.lastArgs))return n.lastResult;var o=e.apply(this,s);return n={lastResult:o,lastArgs:s,lastThis:this},o}return r.clear=function(){n=null},r}var olt={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},llt=function(t){return Bs("span",Ys({css:olt},t))},Bhe=llt,clt={guidance:function(t){var n=t.isSearchable,r=t.isMulti,s=t.tabSelectsValue,a=t.context,o=t.isInitialFocus;switch(a){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(s?", press Tab to select the option and exit the menu":"",".");case"input":return o?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,s=r===void 0?"":r,a=t.labels,o=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(s,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(a.length>1?"s":""," ").concat(a.join(","),", selected.");case"select-option":return o?"option ".concat(s," is disabled. Select another option."):"option ".concat(s,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,s=t.options,a=t.label,o=a===void 0?"":a,l=t.selectValue,c=t.isDisabled,u=t.isSelected,d=t.isAppleDevice,f=function(w,C){return w&&w.length?"".concat(w.indexOf(C)+1," of ").concat(w.length):""};if(n==="value"&&l)return"value ".concat(o," focused, ").concat(f(l,r),".");if(n==="menu"&&d){var x=c?" disabled":"",g="".concat(u?" selected":"").concat(x);return"".concat(o).concat(g,", ").concat(f(s,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},ult=function(t){var n=t.ariaSelection,r=t.focusedOption,s=t.focusedValue,a=t.focusableOptions,o=t.isFocused,l=t.selectValue,c=t.selectProps,u=t.id,d=t.isAppleDevice,f=c.ariaLiveMessages,x=c.getOptionLabel,g=c.inputValue,v=c.isMulti,w=c.isOptionDisabled,C=c.isSearchable,N=c.menuIsOpen,I=c.options,P=c.screenReaderStatus,R=c.tabSelectsValue,F=c.isLoading,U=c["aria-label"],L=c["aria-live"],z=m.useMemo(function(){return zs(zs({},clt),f||{})},[f]),X=m.useMemo(function(){var Y="";if(n&&z.onChange){var ie=n.option,oe=n.options,G=n.removedValue,V=n.removedValues,ee=n.value,ae=function(je){return Array.isArray(je)?null:je},fe=G||ie||ae(ee),Ae=fe?x(fe):"",ce=oe||V||void 0,ye=ce?ce.map(x):[],Ne=zs({isDisabled:fe&&w(fe,l),label:Ae,labels:ye},n);Y=z.onChange(Ne)}return Y},[n,z,w,l,x]),ne=m.useMemo(function(){var Y="",ie=r||s,oe=!!(r&&l&&l.includes(r));if(ie&&z.onFocus){var G={focused:ie,label:x(ie),isDisabled:w(ie,l),isSelected:oe,options:a,context:ie===r?"menu":"value",selectValue:l,isAppleDevice:d};Y=z.onFocus(G)}return Y},[r,s,x,w,z,a,l,d]),J=m.useMemo(function(){var Y="";if(N&&I.length&&!F&&z.onFilter){var ie=P({count:a.length});Y=z.onFilter({inputValue:g,resultsMessage:ie})}return Y},[a,g,N,z,I,P,F]),Z=(n==null?void 0:n.action)==="initial-input-focus",re=m.useMemo(function(){var Y="";if(z.guidance){var ie=s?"value":N?"menu":"input";Y=z.guidance({"aria-label":U,context:ie,isDisabled:r&&w(r,l),isMulti:v,isSearchable:C,tabSelectsValue:R,isInitialFocus:Z})}return Y},[U,r,s,v,w,C,N,z,l,R,Z]),he=Bs(m.Fragment,null,Bs("span",{id:"aria-selection"},X),Bs("span",{id:"aria-focused"},ne),Bs("span",{id:"aria-results"},J),Bs("span",{id:"aria-guidance"},re));return Bs(m.Fragment,null,Bs(Bhe,{id:u},Z&&he),Bs(Bhe,{"aria-live":L,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},o&&!Z&&he))},dlt=ult,rZ=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],flt=new RegExp("["+rZ.map(function(e){return e.letters}).join("")+"]","g"),dje={};for(var Uz=0;Uz<rZ.length;Uz++)for(var zz=rZ[Uz],Hz=0;Hz<zz.letters.length;Hz++)dje[zz.letters[Hz]]=zz.base;var fje=function(t){return t.replace(flt,function(n){return dje[n]})},hlt=alt(fje),$he=function(t){return t.replace(/^\s+|\s+$/g,"")},plt=function(t){return"".concat(t.label," ").concat(t.value)},mlt=function(t){return function(n,r){if(n.data.__isNew__)return!0;var s=zs({ignoreCase:!0,ignoreAccents:!0,stringify:plt,trim:!0,matchFrom:"any"},t),a=s.ignoreCase,o=s.ignoreAccents,l=s.stringify,c=s.trim,u=s.matchFrom,d=c?$he(r):r,f=c?$he(l(n)):l(n);return a&&(d=d.toLowerCase(),f=f.toLowerCase()),o&&(d=hlt(d),f=fje(f)),u==="start"?f.substr(0,d.length)===d:f.indexOf(d)>-1}},xlt=["innerRef"];function glt(e){var t=e.innerRef,n=m1(e,xlt),r=Vat(n,"onExited","in","enter","exit","appear");return Bs("input",Ys({ref:t},r,{css:zse({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var blt=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function ylt(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,s=e.onTopArrive,a=e.onTopLeave,o=m.useRef(!1),l=m.useRef(!1),c=m.useRef(0),u=m.useRef(null),d=m.useCallback(function(C,N){if(u.current!==null){var I=u.current,P=I.scrollTop,R=I.scrollHeight,F=I.clientHeight,U=u.current,L=N>0,z=R-F-P,X=!1;z>N&&o.current&&(r&&r(C),o.current=!1),L&&l.current&&(a&&a(C),l.current=!1),L&&N>z?(n&&!o.current&&n(C),U.scrollTop=R,X=!0,o.current=!0):!L&&-N>P&&(s&&!l.current&&s(C),U.scrollTop=0,X=!0,l.current=!0),X&&blt(C)}},[n,r,s,a]),f=m.useCallback(function(C){d(C,C.deltaY)},[d]),x=m.useCallback(function(C){c.current=C.changedTouches[0].clientY},[]),g=m.useCallback(function(C){var N=c.current-C.changedTouches[0].clientY;d(C,N)},[d]),v=m.useCallback(function(C){if(C){var N=Uat?{passive:!1}:!1;C.addEventListener("wheel",f,N),C.addEventListener("touchstart",x,N),C.addEventListener("touchmove",g,N)}},[g,x,f]),w=m.useCallback(function(C){C&&(C.removeEventListener("wheel",f,!1),C.removeEventListener("touchstart",x,!1),C.removeEventListener("touchmove",g,!1))},[g,x,f]);return m.useEffect(function(){if(t){var C=u.current;return v(C),function(){w(C)}}},[t,v,w]),function(C){u.current=C}}var Uhe=["boxSizing","height","overflow","paddingRight","position"],zhe={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Hhe(e){e.cancelable&&e.preventDefault()}function Vhe(e){e.stopPropagation()}function Whe(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function qhe(){return"ontouchstart"in window||navigator.maxTouchPoints}var Ghe=!!(typeof window<"u"&&window.document&&window.document.createElement),h7=0,O6={capture:!1,passive:!1};function vlt(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,s=m.useRef({}),a=m.useRef(null),o=m.useCallback(function(c){if(Ghe){var u=document.body,d=u&&u.style;if(r&&Uhe.forEach(function(v){var w=d&&d[v];s.current[v]=w}),r&&h7<1){var f=parseInt(s.current.paddingRight,10)||0,x=document.body?document.body.clientWidth:0,g=window.innerWidth-x+f||0;Object.keys(zhe).forEach(function(v){var w=zhe[v];d&&(d[v]=w)}),d&&(d.paddingRight="".concat(g,"px"))}u&&qhe()&&(u.addEventListener("touchmove",Hhe,O6),c&&(c.addEventListener("touchstart",Whe,O6),c.addEventListener("touchmove",Vhe,O6))),h7+=1}},[r]),l=m.useCallback(function(c){if(Ghe){var u=document.body,d=u&&u.style;h7=Math.max(h7-1,0),r&&h7<1&&Uhe.forEach(function(f){var x=s.current[f];d&&(d[f]=x)}),u&&qhe()&&(u.removeEventListener("touchmove",Hhe,O6),c&&(c.removeEventListener("touchstart",Whe,O6),c.removeEventListener("touchmove",Vhe,O6)))}},[r]);return m.useEffect(function(){if(t){var c=a.current;return o(c),function(){l(c)}}},[t,o,l]),function(c){a.current=c}}var wlt=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},Clt={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Slt(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,s=r===void 0?!0:r,a=e.onBottomArrive,o=e.onBottomLeave,l=e.onTopArrive,c=e.onTopLeave,u=ylt({isEnabled:s,onBottomArrive:a,onBottomLeave:o,onTopArrive:l,onTopLeave:c}),d=vlt({isEnabled:n}),f=function(g){u(g),d(g)};return Bs(m.Fragment,null,n&&Bs("div",{onClick:wlt,css:Clt}),t(f))}var Nlt={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Alt=function(t){var n=t.name,r=t.onFocus;return Bs("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:Nlt,value:"",onChange:function(){}})},jlt=Alt;function Gse(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function Elt(){return Gse(/^iPhone/i)}function hje(){return Gse(/^Mac/i)}function _lt(){return Gse(/^iPad/i)||hje()&&navigator.maxTouchPoints>1}function klt(){return Elt()||_lt()}function Tlt(){return hje()||klt()}var Ilt=function(t){return t.label},Plt=function(t){return t.label},Flt=function(t){return t.value},Olt=function(t){return!!t.isDisabled},Mlt={clearIndicator:bot,container:oot,control:Aot,dropdownIndicator:xot,group:kot,groupHeading:Iot,indicatorsContainer:dot,indicatorSeparator:vot,input:Mot,loadingIndicator:Sot,loadingMessage:not,menu:Yat,menuList:Jat,menuPortal:iot,multiValue:$ot,multiValueLabel:Uot,multiValueRemove:zot,noOptionsMessage:tot,option:Kot,placeholder:Qot,singleValue:elt,valueContainer:cot},Rlt={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},Llt=4,pje=4,Dlt=38,Blt=pje*2,$lt={baseUnit:pje,controlHeight:Dlt,menuGutter:Blt},Vz={borderRadius:Llt,colors:Rlt,spacing:$lt},Ult={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Rhe(),captureMenuScroll:!Rhe(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:mlt(),formatGroupLabel:Ilt,getOptionLabel:Plt,getOptionValue:Flt,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Olt,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Bat(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Khe(e,t,n,r){var s=gje(e,t,n),a=bje(e,t,n),o=xje(e,t),l=tM(e,t);return{type:"option",data:t,isDisabled:s,isSelected:a,label:o,value:l,index:r}}function OF(e,t){return e.options.map(function(n,r){if("options"in n){var s=n.options.map(function(o,l){return Khe(e,o,t,l)}).filter(function(o){return Xhe(e,o)});return s.length>0?{type:"group",data:n,options:s,index:r}:void 0}var a=Khe(e,n,t,r);return Xhe(e,a)?a:void 0}).filter(zat)}function mje(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Lse(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function Yhe(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Lse(r.options.map(function(s){return{data:s.data,id:"".concat(t,"-").concat(r.index,"-").concat(s.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function zlt(e,t){return mje(OF(e,t))}function Xhe(e,t){var n=e.inputValue,r=n===void 0?"":n,s=t.data,a=t.isSelected,o=t.label,l=t.value;return(!vje(e)||!a)&&yje(e,{label:o,value:l,data:s},r)}function Hlt(e,t){var n=e.focusedValue,r=e.selectValue,s=r.indexOf(n);if(s>-1){var a=t.indexOf(n);if(a>-1)return n;if(s<t.length)return t[s]}return null}function Vlt(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var Wz=function(t,n){var r,s=(r=t.find(function(a){return a.data===n}))===null||r===void 0?void 0:r.id;return s||null},xje=function(t,n){return t.getOptionLabel(n)},tM=function(t,n){return t.getOptionValue(n)};function gje(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function bje(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=tM(e,t);return n.some(function(s){return tM(e,s)===r})}function yje(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var vje=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},Wlt=1,wje=function(e){mit(n,e);var t=bit(n);function n(r){var s;if(hit(this,n),s=t.call(this,r),s.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},s.blockOptionHover=!1,s.isComposing=!1,s.commonProps=void 0,s.initialTouchX=0,s.initialTouchY=0,s.openAfterFocus=!1,s.scrollToFocusedOptionOnUpdate=!1,s.userIsDragging=void 0,s.isAppleDevice=Tlt(),s.controlRef=null,s.getControlRef=function(c){s.controlRef=c},s.focusedOptionRef=null,s.getFocusedOptionRef=function(c){s.focusedOptionRef=c},s.menuListRef=null,s.getMenuListRef=function(c){s.menuListRef=c},s.inputRef=null,s.getInputRef=function(c){s.inputRef=c},s.focus=s.focusInput,s.blur=s.blurInput,s.onChange=function(c,u){var d=s.props,f=d.onChange,x=d.name;u.name=x,s.ariaOnChange(c,u),f(c,u)},s.setValue=function(c,u,d){var f=s.props,x=f.closeMenuOnSelect,g=f.isMulti,v=f.inputValue;s.onInputChange("",{action:"set-value",prevInputValue:v}),x&&(s.setState({inputIsHiddenAfterUpdate:!g}),s.onMenuClose()),s.setState({clearFocusValueOnUpdate:!0}),s.onChange(c,{action:u,option:d})},s.selectOption=function(c){var u=s.props,d=u.blurInputOnSelect,f=u.isMulti,x=u.name,g=s.state.selectValue,v=f&&s.isOptionSelected(c,g),w=s.isOptionDisabled(c,g);if(v){var C=s.getOptionValue(c);s.setValue(g.filter(function(N){return s.getOptionValue(N)!==C}),"deselect-option",c)}else if(!w)f?s.setValue([].concat(Lse(g),[c]),"select-option",c):s.setValue(c,"select-option");else{s.ariaOnChange(c,{action:"select-option",option:c,name:x});return}d&&s.blurInput()},s.removeValue=function(c){var u=s.props.isMulti,d=s.state.selectValue,f=s.getOptionValue(c),x=d.filter(function(v){return s.getOptionValue(v)!==f}),g=II(u,x,x[0]||null);s.onChange(g,{action:"remove-value",removedValue:c}),s.focusInput()},s.clearValue=function(){var c=s.state.selectValue;s.onChange(II(s.props.isMulti,[],null),{action:"clear",removedValues:c})},s.popValue=function(){var c=s.props.isMulti,u=s.state.selectValue,d=u[u.length-1],f=u.slice(0,u.length-1),x=II(c,f,f[0]||null);d&&s.onChange(x,{action:"pop-value",removedValue:d})},s.getFocusedOptionId=function(c){return Wz(s.state.focusableOptionsWithIds,c)},s.getFocusableOptionsWithIds=function(){return Yhe(OF(s.props,s.state.selectValue),s.getElementId("option"))},s.getValue=function(){return s.state.selectValue},s.cx=function(){for(var c=arguments.length,u=new Array(c),d=0;d<c;d++)u[d]=arguments[d];return Oat.apply(void 0,[s.props.classNamePrefix].concat(u))},s.getOptionLabel=function(c){return xje(s.props,c)},s.getOptionValue=function(c){return tM(s.props,c)},s.getStyles=function(c,u){var d=s.props.unstyled,f=Mlt[c](u,d);f.boxSizing="border-box";var x=s.props.styles[c];return x?x(f,u):f},s.getClassNames=function(c,u){var d,f;return(d=(f=s.props.classNames)[c])===null||d===void 0?void 0:d.call(f,u)},s.getElementId=function(c){return"".concat(s.state.instancePrefix,"-").concat(c)},s.getComponents=function(){return rlt(s.props)},s.buildCategorizedOptions=function(){return OF(s.props,s.state.selectValue)},s.getCategorizedOptions=function(){return s.props.menuIsOpen?s.buildCategorizedOptions():[]},s.buildFocusableOptions=function(){return mje(s.buildCategorizedOptions())},s.getFocusableOptions=function(){return s.props.menuIsOpen?s.buildFocusableOptions():[]},s.ariaOnChange=function(c,u){s.setState({ariaSelection:zs({value:c},u)})},s.onMenuMouseDown=function(c){c.button===0&&(c.stopPropagation(),c.preventDefault(),s.focusInput())},s.onMenuMouseMove=function(c){s.blockOptionHover=!1},s.onControlMouseDown=function(c){if(!c.defaultPrevented){var u=s.props.openMenuOnClick;s.state.isFocused?s.props.menuIsOpen?c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&s.onMenuClose():u&&s.openMenu("first"):(u&&(s.openAfterFocus=!0),s.focusInput()),c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&c.preventDefault()}},s.onDropdownIndicatorMouseDown=function(c){if(!(c&&c.type==="mousedown"&&c.button!==0)&&!s.props.isDisabled){var u=s.props,d=u.isMulti,f=u.menuIsOpen;s.focusInput(),f?(s.setState({inputIsHiddenAfterUpdate:!d}),s.onMenuClose()):s.openMenu("first"),c.preventDefault()}},s.onClearIndicatorMouseDown=function(c){c&&c.type==="mousedown"&&c.button!==0||(s.clearValue(),c.preventDefault(),s.openAfterFocus=!1,c.type==="touchend"?s.focusInput():setTimeout(function(){return s.focusInput()}))},s.onScroll=function(c){typeof s.props.closeMenuOnScroll=="boolean"?c.target instanceof HTMLElement&&qD(c.target)&&s.props.onMenuClose():typeof s.props.closeMenuOnScroll=="function"&&s.props.closeMenuOnScroll(c)&&s.props.onMenuClose()},s.onCompositionStart=function(){s.isComposing=!0},s.onCompositionEnd=function(){s.isComposing=!1},s.onTouchStart=function(c){var u=c.touches,d=u&&u.item(0);d&&(s.initialTouchX=d.clientX,s.initialTouchY=d.clientY,s.userIsDragging=!1)},s.onTouchMove=function(c){var u=c.touches,d=u&&u.item(0);if(d){var f=Math.abs(d.clientX-s.initialTouchX),x=Math.abs(d.clientY-s.initialTouchY),g=5;s.userIsDragging=f>g||x>g}},s.onTouchEnd=function(c){s.userIsDragging||(s.controlRef&&!s.controlRef.contains(c.target)&&s.menuListRef&&!s.menuListRef.contains(c.target)&&s.blurInput(),s.initialTouchX=0,s.initialTouchY=0)},s.onControlTouchEnd=function(c){s.userIsDragging||s.onControlMouseDown(c)},s.onClearIndicatorTouchEnd=function(c){s.userIsDragging||s.onClearIndicatorMouseDown(c)},s.onDropdownIndicatorTouchEnd=function(c){s.userIsDragging||s.onDropdownIndicatorMouseDown(c)},s.handleInputChange=function(c){var u=s.props.inputValue,d=c.currentTarget.value;s.setState({inputIsHiddenAfterUpdate:!1}),s.onInputChange(d,{action:"input-change",prevInputValue:u}),s.props.menuIsOpen||s.onMenuOpen()},s.onInputFocus=function(c){s.props.onFocus&&s.props.onFocus(c),s.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(s.openAfterFocus||s.props.openMenuOnFocus)&&s.openMenu("first"),s.openAfterFocus=!1},s.onInputBlur=function(c){var u=s.props.inputValue;if(s.menuListRef&&s.menuListRef.contains(document.activeElement)){s.inputRef.focus();return}s.props.onBlur&&s.props.onBlur(c),s.onInputChange("",{action:"input-blur",prevInputValue:u}),s.onMenuClose(),s.setState({focusedValue:null,isFocused:!1})},s.onOptionHover=function(c){if(!(s.blockOptionHover||s.state.focusedOption===c)){var u=s.getFocusableOptions(),d=u.indexOf(c);s.setState({focusedOption:c,focusedOptionId:d>-1?s.getFocusedOptionId(c):null})}},s.shouldHideSelectedOptions=function(){return vje(s.props)},s.onValueInputFocus=function(c){c.preventDefault(),c.stopPropagation(),s.focus()},s.onKeyDown=function(c){var u=s.props,d=u.isMulti,f=u.backspaceRemovesValue,x=u.escapeClearsValue,g=u.inputValue,v=u.isClearable,w=u.isDisabled,C=u.menuIsOpen,N=u.onKeyDown,I=u.tabSelectsValue,P=u.openMenuOnFocus,R=s.state,F=R.focusedOption,U=R.focusedValue,L=R.selectValue;if(!w&&!(typeof N=="function"&&(N(c),c.defaultPrevented))){switch(s.blockOptionHover=!0,c.key){case"ArrowLeft":if(!d||g)return;s.focusValue("previous");break;case"ArrowRight":if(!d||g)return;s.focusValue("next");break;case"Delete":case"Backspace":if(g)return;if(U)s.removeValue(U);else{if(!f)return;d?s.popValue():v&&s.clearValue()}break;case"Tab":if(s.isComposing||c.shiftKey||!C||!I||!F||P&&s.isOptionSelected(F,L))return;s.selectOption(F);break;case"Enter":if(c.keyCode===229)break;if(C){if(!F||s.isComposing)return;s.selectOption(F);break}return;case"Escape":C?(s.setState({inputIsHiddenAfterUpdate:!1}),s.onInputChange("",{action:"menu-close",prevInputValue:g}),s.onMenuClose()):v&&x&&s.clearValue();break;case" ":if(g)return;if(!C){s.openMenu("first");break}if(!F)return;s.selectOption(F);break;case"ArrowUp":C?s.focusOption("up"):s.openMenu("last");break;case"ArrowDown":C?s.focusOption("down"):s.openMenu("first");break;case"PageUp":if(!C)return;s.focusOption("pageup");break;case"PageDown":if(!C)return;s.focusOption("pagedown");break;case"Home":if(!C)return;s.focusOption("first");break;case"End":if(!C)return;s.focusOption("last");break;default:return}c.preventDefault()}},s.state.instancePrefix="react-select-"+(s.props.instanceId||++Wlt),s.state.selectValue=Ohe(r.value),r.menuIsOpen&&s.state.selectValue.length){var a=s.getFocusableOptionsWithIds(),o=s.buildFocusableOptions(),l=o.indexOf(s.state.selectValue[0]);s.state.focusableOptionsWithIds=a,s.state.focusedOption=o[l],s.state.focusedOptionId=Wz(a,o[l])}return s}return pit(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Mhe(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(s){var a=this.props,o=a.isDisabled,l=a.menuIsOpen,c=this.state.isFocused;(c&&!o&&s.isDisabled||c&&l&&!s.menuIsOpen)&&this.focusInput(),c&&o&&!s.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!c&&!o&&s.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Mhe(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(s,a){this.props.onInputChange(s,a)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(s){var a=this,o=this.state,l=o.selectValue,c=o.isFocused,u=this.buildFocusableOptions(),d=s==="first"?0:u.length-1;if(!this.props.isMulti){var f=u.indexOf(l[0]);f>-1&&(d=f)}this.scrollToFocusedOptionOnUpdate=!(c&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[d],focusedOptionId:this.getFocusedOptionId(u[d])},function(){return a.onMenuOpen()})}},{key:"focusValue",value:function(s){var a=this.state,o=a.selectValue,l=a.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var c=o.indexOf(l);l||(c=-1);var u=o.length-1,d=-1;if(o.length){switch(s){case"previous":c===0?d=0:c===-1?d=u:d=c-1;break;case"next":c>-1&&c<u&&(d=c+1);break}this.setState({inputIsHidden:d!==-1,focusedValue:o[d]})}}}},{key:"focusOption",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",a=this.props.pageSize,o=this.state.focusedOption,l=this.getFocusableOptions();if(l.length){var c=0,u=l.indexOf(o);o||(u=-1),s==="up"?c=u>0?u-1:l.length-1:s==="down"?c=(u+1)%l.length:s==="pageup"?(c=u-a,c<0&&(c=0)):s==="pagedown"?(c=u+a,c>l.length-1&&(c=l.length-1)):s==="last"&&(c=l.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:l[c],focusedValue:null,focusedOptionId:this.getFocusedOptionId(l[c])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Vz):zs(zs({},Vz),this.props.theme):Vz}},{key:"getCommonProps",value:function(){var s=this.clearValue,a=this.cx,o=this.getStyles,l=this.getClassNames,c=this.getValue,u=this.selectOption,d=this.setValue,f=this.props,x=f.isMulti,g=f.isRtl,v=f.options,w=this.hasValue();return{clearValue:s,cx:a,getStyles:o,getClassNames:l,getValue:c,hasValue:w,isMulti:x,isRtl:g,options:v,selectOption:u,selectProps:f,setValue:d,theme:this.getTheme()}}},{key:"hasValue",value:function(){var s=this.state.selectValue;return s.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var s=this.props,a=s.isClearable,o=s.isMulti;return a===void 0?o:a}},{key:"isOptionDisabled",value:function(s,a){return gje(this.props,s,a)}},{key:"isOptionSelected",value:function(s,a){return bje(this.props,s,a)}},{key:"filterOption",value:function(s,a){return yje(this.props,s,a)}},{key:"formatOptionLabel",value:function(s,a){if(typeof this.props.formatOptionLabel=="function"){var o=this.props.inputValue,l=this.state.selectValue;return this.props.formatOptionLabel(s,{context:a,inputValue:o,selectValue:l})}else return this.getOptionLabel(s)}},{key:"formatGroupLabel",value:function(s){return this.props.formatGroupLabel(s)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var s=this.props,a=s.isDisabled,o=s.isSearchable,l=s.inputId,c=s.inputValue,u=s.tabIndex,d=s.form,f=s.menuIsOpen,x=s.required,g=this.getComponents(),v=g.Input,w=this.state,C=w.inputIsHidden,N=w.ariaSelection,I=this.commonProps,P=l||this.getElementId("input"),R=zs(zs(zs({"aria-autocomplete":"list","aria-expanded":f,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":x,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},f&&{"aria-controls":this.getElementId("listbox")}),!o&&{"aria-readonly":!0}),this.hasValue()?(N==null?void 0:N.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return o?m.createElement(v,Ys({},I,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:P,innerRef:this.getInputRef,isDisabled:a,isHidden:C,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:d,type:"text",value:c},R)):m.createElement(glt,Ys({id:P,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:JO,onFocus:this.onInputFocus,disabled:a,tabIndex:u,inputMode:"none",form:d,value:""},R))}},{key:"renderPlaceholderOrValue",value:function(){var s=this,a=this.getComponents(),o=a.MultiValue,l=a.MultiValueContainer,c=a.MultiValueLabel,u=a.MultiValueRemove,d=a.SingleValue,f=a.Placeholder,x=this.commonProps,g=this.props,v=g.controlShouldRenderValue,w=g.isDisabled,C=g.isMulti,N=g.inputValue,I=g.placeholder,P=this.state,R=P.selectValue,F=P.focusedValue,U=P.isFocused;if(!this.hasValue()||!v)return N?null:m.createElement(f,Ys({},x,{key:"placeholder",isDisabled:w,isFocused:U,innerProps:{id:this.getElementId("placeholder")}}),I);if(C)return R.map(function(z,X){var ne=z===F,J="".concat(s.getOptionLabel(z),"-").concat(s.getOptionValue(z));return m.createElement(o,Ys({},x,{components:{Container:l,Label:c,Remove:u},isFocused:ne,isDisabled:w,key:J,index:X,removeProps:{onClick:function(){return s.removeValue(z)},onTouchEnd:function(){return s.removeValue(z)},onMouseDown:function(re){re.preventDefault()}},data:z}),s.formatOptionLabel(z,"value"))});if(N)return null;var L=R[0];return m.createElement(d,Ys({},x,{data:L,isDisabled:w}),this.formatOptionLabel(L,"value"))}},{key:"renderClearIndicator",value:function(){var s=this.getComponents(),a=s.ClearIndicator,o=this.commonProps,l=this.props,c=l.isDisabled,u=l.isLoading,d=this.state.isFocused;if(!this.isClearable()||!a||c||!this.hasValue()||u)return null;var f={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return m.createElement(a,Ys({},o,{innerProps:f,isFocused:d}))}},{key:"renderLoadingIndicator",value:function(){var s=this.getComponents(),a=s.LoadingIndicator,o=this.commonProps,l=this.props,c=l.isDisabled,u=l.isLoading,d=this.state.isFocused;if(!a||!u)return null;var f={"aria-hidden":"true"};return m.createElement(a,Ys({},o,{innerProps:f,isDisabled:c,isFocused:d}))}},{key:"renderIndicatorSeparator",value:function(){var s=this.getComponents(),a=s.DropdownIndicator,o=s.IndicatorSeparator;if(!a||!o)return null;var l=this.commonProps,c=this.props.isDisabled,u=this.state.isFocused;return m.createElement(o,Ys({},l,{isDisabled:c,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var s=this.getComponents(),a=s.DropdownIndicator;if(!a)return null;var o=this.commonProps,l=this.props.isDisabled,c=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return m.createElement(a,Ys({},o,{innerProps:u,isDisabled:l,isFocused:c}))}},{key:"renderMenu",value:function(){var s=this,a=this.getComponents(),o=a.Group,l=a.GroupHeading,c=a.Menu,u=a.MenuList,d=a.MenuPortal,f=a.LoadingMessage,x=a.NoOptionsMessage,g=a.Option,v=this.commonProps,w=this.state.focusedOption,C=this.props,N=C.captureMenuScroll,I=C.inputValue,P=C.isLoading,R=C.loadingMessage,F=C.minMenuHeight,U=C.maxMenuHeight,L=C.menuIsOpen,z=C.menuPlacement,X=C.menuPosition,ne=C.menuPortalTarget,J=C.menuShouldBlockScroll,Z=C.menuShouldScrollIntoView,re=C.noOptionsMessage,he=C.onMenuScrollToTop,Y=C.onMenuScrollToBottom;if(!L)return null;var ie=function(Ae,ce){var ye=Ae.type,Ne=Ae.data,be=Ae.isDisabled,je=Ae.isSelected,Ie=Ae.label,Re=Ae.value,Qe=w===Ne,Be=be?void 0:function(){return s.onOptionHover(Ne)},it=be?void 0:function(){return s.selectOption(Ne)},tt="".concat(s.getElementId("option"),"-").concat(ce),at={id:tt,onClick:it,onMouseMove:Be,onMouseOver:Be,tabIndex:-1,role:"option","aria-selected":s.isAppleDevice?void 0:je};return m.createElement(g,Ys({},v,{innerProps:at,data:Ne,isDisabled:be,isSelected:je,key:tt,label:Ie,type:ye,value:Re,isFocused:Qe,innerRef:Qe?s.getFocusedOptionRef:void 0}),s.formatOptionLabel(Ae.data,"menu"))},oe;if(this.hasOptions())oe=this.getCategorizedOptions().map(function(fe){if(fe.type==="group"){var Ae=fe.data,ce=fe.options,ye=fe.index,Ne="".concat(s.getElementId("group"),"-").concat(ye),be="".concat(Ne,"-heading");return m.createElement(o,Ys({},v,{key:Ne,data:Ae,options:ce,Heading:l,headingProps:{id:be,data:fe.data},label:s.formatGroupLabel(fe.data)}),fe.options.map(function(je){return ie(je,"".concat(ye,"-").concat(je.index))}))}else if(fe.type==="option")return ie(fe,"".concat(fe.index))});else if(P){var G=R({inputValue:I});if(G===null)return null;oe=m.createElement(f,v,G)}else{var V=re({inputValue:I});if(V===null)return null;oe=m.createElement(x,v,V)}var ee={minMenuHeight:F,maxMenuHeight:U,menuPlacement:z,menuPosition:X,menuShouldScrollIntoView:Z},ae=m.createElement(Xat,Ys({},v,ee),function(fe){var Ae=fe.ref,ce=fe.placerProps,ye=ce.placement,Ne=ce.maxHeight;return m.createElement(c,Ys({},v,ee,{innerRef:Ae,innerProps:{onMouseDown:s.onMenuMouseDown,onMouseMove:s.onMenuMouseMove},isLoading:P,placement:ye}),m.createElement(Slt,{captureEnabled:N,onTopArrive:he,onBottomArrive:Y,lockEnabled:J},function(be){return m.createElement(u,Ys({},v,{innerRef:function(Ie){s.getMenuListRef(Ie),be(Ie)},innerProps:{role:"listbox","aria-multiselectable":v.isMulti,id:s.getElementId("listbox")},isLoading:P,maxHeight:Ne,focusedOption:w}),oe)}))});return ne||X==="fixed"?m.createElement(d,Ys({},v,{appendTo:ne,controlElement:this.controlRef,menuPlacement:z,menuPosition:X}),ae):ae}},{key:"renderFormField",value:function(){var s=this,a=this.props,o=a.delimiter,l=a.isDisabled,c=a.isMulti,u=a.name,d=a.required,f=this.state.selectValue;if(d&&!this.hasValue()&&!l)return m.createElement(jlt,{name:u,onFocus:this.onValueInputFocus});if(!(!u||l))if(c)if(o){var x=f.map(function(w){return s.getOptionValue(w)}).join(o);return m.createElement("input",{name:u,type:"hidden",value:x})}else{var g=f.length>0?f.map(function(w,C){return m.createElement("input",{key:"i-".concat(C),name:u,type:"hidden",value:s.getOptionValue(w)})}):m.createElement("input",{name:u,type:"hidden",value:""});return m.createElement("div",null,g)}else{var v=f[0]?this.getOptionValue(f[0]):"";return m.createElement("input",{name:u,type:"hidden",value:v})}}},{key:"renderLiveRegion",value:function(){var s=this.commonProps,a=this.state,o=a.ariaSelection,l=a.focusedOption,c=a.focusedValue,u=a.isFocused,d=a.selectValue,f=this.getFocusableOptions();return m.createElement(dlt,Ys({},s,{id:this.getElementId("live-region"),ariaSelection:o,focusedOption:l,focusedValue:c,isFocused:u,selectValue:d,focusableOptions:f,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var s=this.getComponents(),a=s.Control,o=s.IndicatorsContainer,l=s.SelectContainer,c=s.ValueContainer,u=this.props,d=u.className,f=u.id,x=u.isDisabled,g=u.menuIsOpen,v=this.state.isFocused,w=this.commonProps=this.getCommonProps();return m.createElement(l,Ys({},w,{className:d,innerProps:{id:f,onKeyDown:this.onKeyDown},isDisabled:x,isFocused:v}),this.renderLiveRegion(),m.createElement(a,Ys({},w,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:x,isFocused:v,menuIsOpen:g}),m.createElement(c,Ys({},w,{isDisabled:x}),this.renderPlaceholderOrValue(),this.renderInput()),m.createElement(o,Ys({},w,{isDisabled:x}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(s,a){var o=a.prevProps,l=a.clearFocusValueOnUpdate,c=a.inputIsHiddenAfterUpdate,u=a.ariaSelection,d=a.isFocused,f=a.prevWasFocused,x=a.instancePrefix,g=s.options,v=s.value,w=s.menuIsOpen,C=s.inputValue,N=s.isMulti,I=Ohe(v),P={};if(o&&(v!==o.value||g!==o.options||w!==o.menuIsOpen||C!==o.inputValue)){var R=w?zlt(s,I):[],F=w?Yhe(OF(s,I),"".concat(x,"-option")):[],U=l?Hlt(a,I):null,L=Vlt(a,R),z=Wz(F,L);P={selectValue:I,focusedOption:L,focusedOptionId:z,focusableOptionsWithIds:F,focusedValue:U,clearFocusValueOnUpdate:!1}}var X=c!=null&&s!==o?{inputIsHidden:c,inputIsHiddenAfterUpdate:void 0}:{},ne=u,J=d&&f;return d&&!J&&(ne={value:II(N,I,I[0]||null),options:I,action:"initial-input-focus"},J=!f),(u==null?void 0:u.action)==="initial-input-focus"&&(ne=null),zs(zs(zs({},P),X),{},{prevProps:s,ariaSelection:ne,prevWasFocused:J})}}]),n}(m.Component);wje.defaultProps=Ult;var qlt=m.forwardRef(function(e,t){var n=fit(e);return m.createElement(wje,Ys({ref:t},n))}),Zl=qlt;function eu(e){if(!e)return"--/--/--";const t=new Date(e),n=t.toLocaleString("en-US",{month:"short"}),r=t.getDate(),s=t.getFullYear(),a=String(t.getHours()%12||12).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0");String(t.getSeconds()).padStart(2,"0");const l=t.getHours()>=12?" PM":" AM";return`${n} ${r}, ${s}, ${a}:${o}  ${l}`}function d3(e){const t=new Date(e),n=t.toLocaleString("en-US",{month:"short"}),r=t.getDate(),s=t.getFullYear();return String(t.getHours()%12||12).padStart(2,"0"),String(t.getMinutes()).padStart(2,"0"),String(t.getSeconds()).padStart(2,"0"),t.getHours()>=12,`${n} ${r}, ${s}`}function To(e){const t=new Date(e),r=Math.floor((new Date().getTime()-t.getTime())/1e3),s=Math.floor(r/60),a=Math.floor(r/3600),o=Math.floor(r/86400),l=Math.floor(r/31536e3),c=s%60,u=a%24,d=o%365;return{dateTime:r<60?`${r} seconds ago`:r<3600?`${s} minutes ago`:r<86400?c>0?`${a} hours ${c} minutes ago`:`${a} hours ago`:r<31536e3?u>0?`${o} days ${u} hours ago`:`${o} days ago`:d>0?`${l} years ${d} days ago`:`${l} years ago`}}function Glt(e){const t=new Date(Number(e)),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear(),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0");String(t.getSeconds()).padStart(2,"0");const l=t.getHours()>=12?" PM":" AM";return`${n}/${r}/${s} ${a}:${o} ${l}`}function PI(e){if(!e)return"--";const t=new Date(Number(e)),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear();return String(t.getHours()).padStart(2,"0"),String(t.getMinutes()).padStart(2,"0"),String(t.getSeconds()).padStart(2,"0"),`${n}/${r}/${s}`}function Klt(e){const t=new Date(e),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear();return String(t.getHours()).padStart(2,"0"),String(t.getMinutes()).padStart(2,"0"),`${n}/${r}/${s}`}function _s(e){if(e==null||isNaN(e))return"-";const t=e.toString();if(t.includes(".")){const n=t.split(".")[0];return new Intl.NumberFormat("en-US").format(parseInt(n))}return new Intl.NumberFormat("en-US").format(parseInt(e))}function Ylt(e){try{var t=e.split(".")[1],n=t.replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(atob(n).split("").map(function(s){return"%"+("00"+s.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(r)}catch{return JSON.parse(!1)}}function Er(e){if(e==null||isNaN(e))return"--";const t=parseFloat(e),n=Math.floor(t)===0;let r=t.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:n?4:2,useGrouping:!0});if(r.includes(".")){const[s,a]=r.split("."),o=a.replace(/0+$/,"");r=o?`${s}.${o}`:s}return r}function Xlt(e){if(e==null||isNaN(e))return"--";const t=parseFloat(e),n=Math.floor(t)===0,r=t>=1e3;let s=t.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:r?0:n?4:2,useGrouping:!0});if(!r&&s.includes(".")){const[a,o]=s.split("."),l=o.replace(/0+$/,"");s=l?`${a}.${l}`:a}return s}function ro(e){if(e==null||isNaN(e)||e===0)return"--";const t=parseFloat(e),n=t>=1e3;let r=t.toLocaleString("en-US",{minimumFractionDigits:n?2:0,maximumFractionDigits:n?2:4,useGrouping:!0});if(r.includes(".")){const[s,a]=r.split(".");r=`${s}.${a.replace(/0+$/,"")}`}return r.replace(/\.$/,"")}function ly(e){if(e==null||isNaN(e)||e===0)return"--";const t=parseFloat(e),n=t%1!==0;return t.toLocaleString("en-US",{minimumFractionDigits:n?4:0,maximumFractionDigits:4,useGrouping:!0})}function vv(e){if(e==null||isNaN(e)||e===0)return"--";const t=parseFloat(e),n=t>=1e3;let r=t.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:n?2:4,useGrouping:!0});if(r.includes(".")){const[s,a]=r.split(".");r=`${s}.${a.slice(0,2)}`}return r.replace(/(\.\d*?)0+$/,"$1").replace(/\.$/,"")}const GD=e=>e?`${e.slice(0,4)}..${e.slice(-4)}`:"-";function Ku(e){const t=parseFloat(e);return isNaN(t)?"0.00":t>=1e9?(t/1e9).toFixed(2).replace(/\.00$/,"")+"B":t>=1e6?(t/1e6).toFixed(2).replace(/\.00$/,"")+"M":t>=1e3?(t/1e3).toFixed(2).replace(/\.00$/,"")+"K":t.toFixed(2).replace(/\.00$/,"")}function zw(e){if(isNaN(e))return;const t=e.toString().replace(".",",");return Number(t.replace(",",".")).toLocaleString("en-US",{maximumFractionDigits:20})}const Cje="2.28.0";let p7={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${Cje}`},Or=class sZ extends Error{constructor(t,n={}){var l;const r=(()=>{var c;return n.cause instanceof sZ?n.cause.details:(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),s=n.cause instanceof sZ&&n.cause.docsPath||n.docsPath,a=(l=p7.getDocsUrl)==null?void 0:l.call(p7,{...n,docsPath:s}),o=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...p7.version?[`Version: ${p7.version}`]:[]].join(`
`);super(o,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=Cje}walk(t){return Sje(this,t)}};function Sje(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?Sje(e.cause,t):t?null:e}let Nje=class extends Or{constructor({max:t,min:n,signed:r,size:s,value:a}){super(`Number "${a}" is not in safe ${s?`${s*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}};class Qlt extends Or{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class Zlt extends Or{constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let Jlt=class extends Or{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}},Aje=class extends Or{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},jje=class extends Or{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}};class Qhe extends Or{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`,{name:"InvalidBytesLengthError"})}}function fA(e,{dir:t,size:n=32}={}){return typeof e=="string"?gy(e,{dir:t,size:n}):ect(e,{dir:t,size:n})}function gy(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new jje({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function ect(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new jje({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let s=0;s<n;s++){const a=t==="right";r[a?s:n-s-1]=e[a?s:e.length-s-1]}return r}function V0(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function el(e){return V0(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function Rf(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let s=0;s<n.length-1&&n[t==="left"?s:n.length-s-1].toString()==="0";s++)r++;return n=t==="left"?n.slice(r):n.slice(0,n.length-r),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}const tct=new TextEncoder;function hA(e,t={}){return typeof e=="number"||typeof e=="bigint"?rct(e,t):typeof e=="boolean"?nct(e,t):V0(e)?Qh(e,t):Hw(e,t)}function nct(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(ap(n,{size:t.size}),fA(n,{size:t.size})):n}const Fx={zero:48,nine:57,A:65,F:70,a:97,f:102};function Zhe(e){if(e>=Fx.zero&&e<=Fx.nine)return e-Fx.zero;if(e>=Fx.A&&e<=Fx.F)return e-(Fx.A-10);if(e>=Fx.a&&e<=Fx.f)return e-(Fx.a-10)}function Qh(e,t={}){let n=e;t.size&&(ap(n,{size:t.size}),n=fA(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const s=r.length/2,a=new Uint8Array(s);for(let o=0,l=0;o<s;o++){const c=Zhe(r.charCodeAt(l++)),u=Zhe(r.charCodeAt(l++));if(c===void 0||u===void 0)throw new Or(`Invalid byte sequence ("${r[l-2]}${r[l-1]}" in "${r}").`);a[o]=c*16+u}return a}function rct(e,t){const n=Os(e,t);return Qh(n)}function Hw(e,t={}){const n=tct.encode(e);return typeof t.size=="number"?(ap(n,{size:t.size}),fA(n,{dir:"right",size:t.size})):n}function ap(e,{size:t}){if(el(e)>t)throw new Jlt({givenSize:el(e),maxSize:t})}function Xu(e,t={}){const{signed:n}=t;t.size&&ap(e,{size:t.size});const r=BigInt(e);if(!n)return r;const s=(e.length-2)/2,a=(1n<<BigInt(s)*8n-1n)-1n;return r<=a?r:r-BigInt(`0x${"f".padStart(s*2,"f")}`)-1n}function sct(e,t={}){let n=e;if(t.size&&(ap(n,{size:t.size}),n=Rf(n)),Rf(n)==="0x00")return!1;if(Rf(n)==="0x01")return!0;throw new Zlt(n)}function W0(e,t={}){return Number(Xu(e,t))}function ict(e,t={}){let n=Qh(e);return t.size&&(ap(n,{size:t.size}),n=Rf(n,{dir:"right"})),new TextDecoder().decode(n)}const act=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ri(e,t={}){return typeof e=="number"||typeof e=="bigint"?Os(e,t):typeof e=="string"?kS(e,t):typeof e=="boolean"?Eje(e,t):Dl(e,t)}function Eje(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(ap(n,{size:t.size}),fA(n,{size:t.size})):n}function Dl(e,t={}){let n="";for(let s=0;s<e.length;s++)n+=act[e[s]];const r=`0x${n}`;return typeof t.size=="number"?(ap(r,{size:t.size}),fA(r,{dir:"right",size:t.size})):r}function Os(e,t={}){const{signed:n,size:r}=t,s=BigInt(e);let a;r?n?a=(1n<<BigInt(r)*8n-1n)-1n:a=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(a=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof a=="bigint"&&n?-a-1n:0;if(a&&s>a||s<o){const c=typeof e=="bigint"?"n":"";throw new Nje({max:a?`${a}${c}`:void 0,min:`${o}${c}`,signed:n,size:r,value:`${e}${c}`})}const l=`0x${(n&&s<0?(1n<<BigInt(r*8))+BigInt(s):s).toString(16)}`;return r?fA(l,{size:r}):l}const oct=new TextEncoder;function kS(e,t={}){const n=oct.encode(e);return Dl(n,t)}function lm(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new vct(e.type);return`${e.name}(${KD(e.inputs,{includeName:t})})`}function KD(e,{includeName:t=!1}={}){return e?e.map(n=>lct(n,{includeName:t})).join(t?", ":","):""}function lct(e,{includeName:t}){return e.type.startsWith("tuple")?`(${KD(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}class cct extends Or{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
`),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class Jhe extends Or{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
`),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}class _je extends Or{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
`),{metaMessages:[`Params: (${KD(n,{includeName:!0})})`,`Data:   ${t} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=n,this.size=r}}class Nk extends Or{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class uct extends Or{constructor({expectedLength:t,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
`),{name:"AbiEncodingArrayLengthMismatchError"})}}class dct extends Or{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${el(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class fct extends Or{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
`),{name:"AbiEncodingLengthMismatchError"})}}class hct extends Or{constructor(t,{docsPath:n}){super([`Arguments (\`args\`) were provided to "${t}", but "${t}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(`
`),{docsPath:n,name:"AbiErrorInputsNotFoundError"})}}class epe extends Or{constructor(t,{docsPath:n}={}){super([`Error ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(`
`),{docsPath:n,name:"AbiErrorNotFoundError"})}}class kje extends Or{constructor(t,{docsPath:n}){super([`Encoded error signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
`),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class pct extends Or{constructor({docsPath:t}){super("Cannot extract event signature from empty topics.",{docsPath:t,name:"AbiEventSignatureEmptyTopicsError"})}}class Tje extends Or{constructor(t,{docsPath:n}){super([`Encoded event signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
`),{docsPath:n,name:"AbiEventSignatureNotFoundError"})}}class tpe extends Or{constructor(t,{docsPath:n}={}){super([`Event ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(`
`),{docsPath:n,name:"AbiEventNotFoundError"})}}class TS extends Or{constructor(t,{docsPath:n}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
`),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class Ije extends Or{constructor(t,{docsPath:n}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
`),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}}class mct extends Or{constructor(t,{docsPath:n}){super([`Encoded function signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
`),{docsPath:n,name:"AbiFunctionSignatureNotFoundError"})}}class xct extends Or{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${lm(t.abiItem)}\`, and`,`\`${n.type}\` in \`${lm(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}let gct=class extends Or{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`,{name:"BytesSizeMismatchError"})}};class F9 extends Or{constructor({abiItem:t,data:n,params:r,size:s}){super([`Data size of ${s} bytes is too small for non-indexed event parameters.`].join(`
`),{metaMessages:[`Params: (${KD(r,{includeName:!0})})`,`Data:   ${n} (${s} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t,this.data=n,this.params=r,this.size=s}}class YD extends Or{constructor({abiItem:t,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${lm(t,{includeName:!0})}".`].join(`
`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class bct extends Or{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
`),{docsPath:n,name:"InvalidAbiEncodingType"})}}class yct extends Or{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
`),{docsPath:n,name:"InvalidAbiDecodingType"})}}let Pje=class extends Or{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
`),{name:"InvalidArrayError"})}};class vct extends Or{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
`),{name:"InvalidDefinitionTypeError"})}}function Zg(e){return typeof e[0]=="string"?mm(e):wct(e)}function wct(e){let t=0;for(const s of e)t+=s.length;const n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function mm(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}let ld=class extends Or{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}},XD=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}};function nM(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Cct(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Ak(e,...t){if(!Cct(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 Sct(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");nM(e.outputLen),nM(e.blockLen)}function IS(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 Fje(e,t){Ak(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}const FI=BigInt(2**32-1),npe=BigInt(32);function Nct(e,t=!1){return t?{h:Number(e&FI),l:Number(e>>npe&FI)}:{h:Number(e>>npe&FI)|0,l:Number(e&FI)|0}}function Act(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:a,l:o}=Nct(e[s],t);[n[s],r[s]]=[a,o]}return[n,r]}const jct=(e,t,n)=>e<<n|t>>>32-n,Ect=(e,t,n)=>t<<n|e>>>32-n,_ct=(e,t,n)=>t<<n-32|e>>>64-n,kct=(e,t,n)=>e<<n-32|t>>>64-n,M6=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Tct(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function qz(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Um(e,t){return e<<32-t|e>>>t}const rpe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Ict(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function spe(e){for(let t=0;t<e.length;t++)e[t]=Ict(e[t])}typeof Uint8Array.from([]).toHex=="function"&&Uint8Array.fromHex;function Pct(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function QD(e){return typeof e=="string"&&(e=Pct(e)),Ak(e),e}function Fct(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];Ak(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const a=e[r];n.set(a,s),s+=a.length}return n}let Kse=class{clone(){return this._cloneInto()}};function Oje(e){const t=r=>e().update(QD(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Oct(e=32){if(M6&&typeof M6.getRandomValues=="function")return M6.getRandomValues(new Uint8Array(e));if(M6&&typeof M6.randomBytes=="function")return Uint8Array.from(M6.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const Mje=[],Rje=[],Lje=[],Mct=BigInt(0),m7=BigInt(1),Rct=BigInt(2),Lct=BigInt(7),Dct=BigInt(256),Bct=BigInt(113);for(let e=0,t=m7,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Mje.push(2*(5*r+n)),Rje.push((e+1)*(e+2)/2%64);let s=Mct;for(let a=0;a<7;a++)t=(t<<m7^(t>>Lct)*Bct)%Dct,t&Rct&&(s^=m7<<(m7<<BigInt(a))-m7);Lje.push(s)}const[$ct,Uct]=Act(Lje,!0),ipe=(e,t,n)=>n>32?_ct(e,t,n):jct(e,t,n),ape=(e,t,n)=>n>32?kct(e,t,n):Ect(e,t,n);function zct(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const l=(o+8)%10,c=(o+2)%10,u=n[c],d=n[c+1],f=ipe(u,d,1)^n[l],x=ape(u,d,1)^n[l+1];for(let g=0;g<50;g+=10)e[o+g]^=f,e[o+g+1]^=x}let s=e[2],a=e[3];for(let o=0;o<24;o++){const l=Rje[o],c=ipe(s,a,l),u=ape(s,a,l),d=Mje[o];s=e[d],a=e[d+1],e[d]=c,e[d+1]=u}for(let o=0;o<50;o+=10){for(let l=0;l<10;l++)n[l]=e[o+l];for(let l=0;l<10;l++)e[o+l]^=~n[(l+2)%10]&n[(l+4)%10]}e[0]^=$ct[r],e[1]^=Uct[r]}n.fill(0)}let Hct=class Dje extends Kse{constructor(t,n,r,s=!1,a=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=a,nM(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Tct(this.state)}keccak(){rpe||spe(this.state32),zct(this.state32,this.rounds),rpe||spe(this.state32),this.posOut=0,this.pos=0}update(t){IS(this);const{blockLen:n,state:r}=this;t=QD(t);const s=t.length;for(let a=0;a<s;){const o=Math.min(n-this.pos,s-a);for(let l=0;l<o;l++)r[this.pos++]^=t[a++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){IS(this,!1),Ak(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,a=t.length;s<a;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,a-s);t.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return nM(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Fje(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:a,enableXOF:o}=this;return t||(t=new Dje(n,r,s,o,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=s,t.enableXOF=o,t.destroyed=this.destroyed,t}};const Vct=(e,t,n)=>Oje(()=>new Hct(t,e,n)),Wct=Vct(1,136,256/8);function Xc(e,t){const n=t||"hex",r=Wct(V0(e,{strict:!1})?hA(e):e);return n==="bytes"?r:ri(r)}const Gz=new XD(8192);function ZD(e,t){if(Gz.has(`${e}.${t}`))return Gz.get(`${e}.${t}`);const n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=Xc(Hw(n),"bytes"),s=(t?n.substring(`${t}0x`.length):n).split("");for(let o=0;o<40;o+=2)r[o>>1]>>4>=8&&s[o]&&(s[o]=s[o].toUpperCase()),(r[o>>1]&15)>=8&&s[o+1]&&(s[o+1]=s[o+1].toUpperCase());const a=`0x${s.join("")}`;return Gz.set(`${e}.${t}`,a),a}function wc(e,t){if(!Jl(e,{strict:!1}))throw new ld({address:e});return ZD(e,t)}const qct=/^0x[a-fA-F0-9]{40}$/,Kz=new XD(8192);function Jl(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(Kz.has(r))return Kz.get(r);const s=qct.test(e)?e.toLowerCase()===e?!0:n?ZD(e)===e:!0:!1;return Kz.set(r,s),s}function f3(e,t,n,{strict:r}={}){return V0(e,{strict:!1})?zje(e,t,n,{strict:r}):Uje(e,t,n,{strict:r})}function Bje(e,t){if(typeof t=="number"&&t>0&&t>el(e)-1)throw new Aje({offset:t,position:"start",size:el(e)})}function $je(e,t,n){if(typeof t=="number"&&typeof n=="number"&&el(e)!==n-t)throw new Aje({offset:n,position:"end",size:el(e)})}function Uje(e,t,n,{strict:r}={}){Bje(e,t);const s=e.slice(t,n);return r&&$je(s,t,n),s}function zje(e,t,n,{strict:r}={}){Bje(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&$je(s,t,n),s}const Gct=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Hje=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function e2(e,t){if(e.length!==t.length)throw new fct({expectedLength:e.length,givenLength:t.length});const n=Kct({params:e,values:t}),r=Xse(n);return r.length===0?"0x":r}function Kct({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(Yse({param:e[r],value:t[r]}));return n}function Yse({param:e,value:t}){const n=Qse(e.type);if(n){const[r,s]=n;return Xct(t,{length:r,param:{...e,type:s}})}if(e.type==="tuple")return tut(t,{param:e});if(e.type==="address")return Yct(t);if(e.type==="bool")return Zct(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int"),[,,s="256"]=Hje.exec(e.type)??[];return Jct(t,{signed:r,size:Number(s)})}if(e.type.startsWith("bytes"))return Qct(t,{param:e});if(e.type==="string")return eut(t);throw new bct(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Xse(e){let t=0;for(let a=0;a<e.length;a++){const{dynamic:o,encoded:l}=e[a];o?t+=32:t+=el(l)}const n=[],r=[];let s=0;for(let a=0;a<e.length;a++){const{dynamic:o,encoded:l}=e[a];o?(n.push(Os(t+s,{size:32})),r.push(l),s+=el(l)):n.push(l)}return Zg([...n,...r])}function Yct(e){if(!Jl(e))throw new ld({address:e});return{dynamic:!1,encoded:gy(e.toLowerCase())}}function Xct(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new Pje(e);if(!r&&e.length!==t)throw new uct({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let s=!1;const a=[];for(let o=0;o<e.length;o++){const l=Yse({param:n,value:e[o]});l.dynamic&&(s=!0),a.push(l)}if(r||s){const o=Xse(a);if(r){const l=Os(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?Zg([l,o]):l}}if(s)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:Zg(a.map(({encoded:o})=>o))}}function Qct(e,{param:t}){const[,n]=t.type.split("bytes"),r=el(e);if(!n){let s=e;return r%32!==0&&(s=gy(s,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:Zg([gy(Os(r,{size:32})),s])}}if(r!==Number.parseInt(n))throw new dct({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:gy(e,{dir:"right"})}}function Zct(e){if(typeof e!="boolean")throw new Or(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:gy(Eje(e))}}function Jct(e,{signed:t,size:n=256}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-r-1n:0n;if(e>r||e<s)throw new Nje({max:r.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:Os(e,{size:32,signed:t})}}function eut(e){const t=kS(e),n=Math.ceil(el(t)/32),r=[];for(let s=0;s<n;s++)r.push(gy(f3(t,s*32,(s+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Zg([gy(Os(el(t),{size:32})),...r])}}function tut(e,{param:t}){let n=!1;const r=[];for(let s=0;s<t.components.length;s++){const a=t.components[s],o=Array.isArray(e)?s:a.name,l=Yse({param:a,value:e[o]});r.push(l),l.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Xse(r):Zg(r.map(({encoded:s})=>s))}}function Qse(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Yz="/docs/contract/encodeDeployData";function Zse(e){const{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;const s=t.find(o=>"type"in o&&o.type==="constructor");if(!s)throw new cct({docsPath:Yz});if(!("inputs"in s))throw new Jhe({docsPath:Yz});if(!s.inputs||s.inputs.length===0)throw new Jhe({docsPath:Yz});const a=e2(s.inputs,n);return mm([r,a])}function Ou(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}class JD extends Or{constructor({docsPath:t}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
`),{docsPath:t,docsSlug:"account",name:"AccountNotFoundError"})}}class Xz extends Or{constructor({docsPath:t,metaMessages:n,type:r}){super(`Account type "${r}" is not supported.`,{docsPath:t,metaMessages:n,name:"AccountTypeNotSupportedError"})}}function nut(e){const t=Xc(`0x${e.substring(4)}`).substring(26);return ZD(`0x${t}`)}const rut="modulepreload",sut=function(e){return"/"+e},ope={},Jr=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=sut(c),c in ope)return;ope[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":rut,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((x,g)=>{f.addEventListener("load",x),f.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})};async function iut({hash:e,signature:t}){const n=V0(e)?e:ri(e),{secp256k1:r}=await Jr(async()=>{const{secp256k1:o}=await Promise.resolve().then(()=>Umt);return{secp256k1:o}},void 0);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:u,s:d,v:f,yParity:x}=t,g=Number(x??f),v=lpe(g);return new r.Signature(Xu(u),Xu(d)).addRecoveryBit(v)}const o=V0(t)?t:ri(t),l=W0(`0x${o.slice(130)}`),c=lpe(l);return r.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function lpe(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function Vje({hash:e,signature:t}){return nut(await iut({hash:e,signature:t}))}class cpe extends Or{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class Wje extends Or{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}}class aut extends Or{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}const out={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new aut({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Wje({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new cpe({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new cpe({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function Jse(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(out);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function My(e,t="hex"){const n=qje(e),r=Jse(new Uint8Array(n.length));return n.encode(r),t==="hex"?Dl(r.bytes):r.bytes}function qje(e){return Array.isArray(e)?lut(e.map(t=>qje(t))):cut(e)}function lut(e){const t=e.reduce((s,a)=>s+a.length,0),n=Gje(t);return{length:t<=55?1+t:1+n+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+n),n===1?s.pushUint8(t):n===2?s.pushUint16(t):n===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:a}of e)a(s)}}}function cut(e){const t=typeof e=="string"?Qh(e):e,n=Gje(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+n),n===1?s.pushUint8(t.length):n===2?s.pushUint16(t.length):n===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function Gje(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new Or("Length is too large.")}function uut(e){const{chainId:t,nonce:n,to:r}=e,s=e.contractAddress??e.address,a=Xc(mm(["0x05",My([t?Os(t):"0x",s,n?Os(n):"0x"])]));return r==="bytes"?Qh(a):a}async function Kje(e){const{authorization:t,signature:n}=e;return Vje({hash:uut(t),signature:n??t})}class iZ extends Or{constructor({blockNumber:t,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}let dut=class extends Or{constructor({chain:t,currentChainId:n}){super(`The current chain of the wallet (id: ${n}) does not match the target chain for the transaction (id: ${t.id} – ${t.name}).`,{metaMessages:[`Current Chain ID:  ${n}`,`Expected Chain ID: ${t.id} – ${t.name}`],name:"ChainMismatchError"})}};class fut extends Or{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(`
`),{name:"ChainNotFoundError"})}}class Yje extends Or{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class eB extends Or{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}function hut({chain:e,currentChainId:t}){if(!e)throw new fut;if(t!==e.id)throw new dut({chain:e,currentChainId:t})}const put={gwei:9,wei:18},mut={ether:-9,wei:9},xut={ether:-18,gwei:-9};function jk(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[s,a]=[n.slice(0,n.length-t),n.slice(n.length-t)];return a=a.replace(/(0+)$/,""),`${r?"-":""}${s||"0"}${a?`.${a}`:""}`}function Gd(e,t="wei"){return jk(e,mut[t])}class IC extends Or{constructor({cause:t,message:n}={}){var s;const r=(s=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:s.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(IC,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(IC,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class h3 extends Or{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Gd(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(h3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class aZ extends Or{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Gd(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(aZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class oZ extends Or{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(oZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class lZ extends Or{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
`),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(lZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class cZ extends Or{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(cZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class uZ extends Or{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
`),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(uZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class dZ extends Or{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(dZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class fZ extends Or{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(fZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class hZ extends Or{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(hZ,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class O9 extends Or{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${Gd(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${Gd(r)} gwei`:""}).`].join(`
`),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(O9,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class Ek extends Or{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function eie(e,t="wei"){return jk(e,put[t])}function _k(e){const t=Object.entries(e).map(([r,s])=>s===void 0||s===!1?null:[r,s]).filter(Boolean),n=t.reduce((r,[s])=>Math.max(r,s.length),0);return t.map(([r,s])=>`  ${`${r}:`.padEnd(n+1)}  ${s}`).join(`
`)}class gut extends Or{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(`
`),{name:"FeeConflictError"})}}class but extends Or{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class yut extends Or{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",_k(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class vut extends Or{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class wut extends Or{constructor(t,{account:n,docsPath:r,chain:s,data:a,gas:o,gasPrice:l,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:d,to:f,value:x}){var v;const g=_k({chain:s&&`${s==null?void 0:s.name} (id: ${s==null?void 0:s.id})`,from:n==null?void 0:n.address,to:f,value:typeof x<"u"&&`${eie(x)} ${((v=s==null?void 0:s.nativeCurrency)==null?void 0:v.symbol)||"ETH"}`,data:a,gas:o,gasPrice:typeof l<"u"&&`${Gd(l)} gwei`,maxFeePerGas:typeof c<"u"&&`${Gd(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${Gd(u)} gwei`,nonce:d});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",g].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class Xje extends Or{constructor({blockHash:t,blockNumber:n,blockTag:r,hash:s,index:a}){let o="Transaction";r&&a!==void 0&&(o=`Transaction at block time "${r}" at index "${a}"`),t&&a!==void 0&&(o=`Transaction at block hash "${t}" at index "${a}"`),n&&a!==void 0&&(o=`Transaction at block number "${n}" at index "${a}"`),s&&(o=`Transaction with hash "${s}"`),super(`${o} could not be found.`,{name:"TransactionNotFoundError"})}}class Qje extends Or{constructor({hash:t}){super(`Transaction receipt with hash "${t}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class Cut extends Or{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const jc=(e,t,n)=>JSON.stringify(e,(r,s)=>typeof s=="bigint"?s.toString():s,n),Sut=e=>e,tie=e=>e;class zj extends Or{constructor({body:t,cause:n,details:r,headers:s,status:a,url:o}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[a&&`Status: ${a}`,`URL: ${tie(o)}`,t&&`Request body: ${jc(t)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=s,this.status=a,this.url=o}}class nie extends Or{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${tie(r)}`,`Request body: ${jc(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code,this.data=n.data}}class upe extends Or{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${tie(n)}`,`Request body: ${jc(t)}`],name:"TimeoutError"})}}const Nut=-1;let nf=class extends Or{constructor(t,{code:n,docsPath:r,metaMessages:s,name:a,shortMessage:o}){super(o,{cause:t,docsPath:r,metaMessages:s||(t==null?void 0:t.metaMessages),name:a||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=a||t.name,this.code=t instanceof nie?t.code:n??Nut}};class Vf extends nf{constructor(t,n){super(t,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class M9 extends nf{constructor(t){super(t,{code:M9.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(M9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class R9 extends nf{constructor(t){super(t,{code:R9.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(R9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class L9 extends nf{constructor(t,{method:n}={}){super(t,{code:L9.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(L9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class D9 extends nf{constructor(t){super(t,{code:D9.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
`)})}}Object.defineProperty(D9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class p3 extends nf{constructor(t){super(t,{code:p3.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(p3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class m3 extends nf{constructor(t){super(t,{code:m3.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
`)})}}Object.defineProperty(m3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class B9 extends nf{constructor(t){super(t,{code:B9.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(B9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class by extends nf{constructor(t){super(t,{code:by.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(by,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class $9 extends nf{constructor(t){super(t,{code:$9.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty($9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class zv extends nf{constructor(t,{method:n}={}){super(t,{code:zv.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(zv,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class PS extends nf{constructor(t){super(t,{code:PS.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(PS,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class U9 extends nf{constructor(t){super(t,{code:U9.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(U9,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class mo extends Vf{constructor(t){super(t,{code:mo.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(mo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class z9 extends Vf{constructor(t){super(t,{code:z9.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(z9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class H9 extends Vf{constructor(t,{method:n}={}){super(t,{code:H9.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(H9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class V9 extends Vf{constructor(t){super(t,{code:V9.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(V9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class W9 extends Vf{constructor(t){super(t,{code:W9.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(W9,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Zh extends Vf{constructor(t){super(t,{code:Zh.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(Zh,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class q9 extends Vf{constructor(t){super(t,{code:q9.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(q9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class G9 extends Vf{constructor(t){super(t,{code:G9.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(G9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class K9 extends Vf{constructor(t){super(t,{code:K9.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(K9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class Y9 extends Vf{constructor(t){super(t,{code:Y9.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(Y9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class X9 extends Vf{constructor(t){super(t,{code:X9.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(X9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class Q9 extends Vf{constructor(t){super(t,{code:Q9.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(Q9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class Z9 extends Vf{constructor(t){super(t,{code:Z9.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(Z9,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class Aut extends nf{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}function tB(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof Or?e.walk(s=>(s==null?void 0:s.code)===IC.code):e;return r instanceof Or?new IC({cause:e,message:r.details}):IC.nodeMessage.test(n)?new IC({cause:e,message:e.details}):h3.nodeMessage.test(n)?new h3({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):aZ.nodeMessage.test(n)?new aZ({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):oZ.nodeMessage.test(n)?new oZ({cause:e,nonce:t==null?void 0:t.nonce}):lZ.nodeMessage.test(n)?new lZ({cause:e,nonce:t==null?void 0:t.nonce}):cZ.nodeMessage.test(n)?new cZ({cause:e,nonce:t==null?void 0:t.nonce}):uZ.nodeMessage.test(n)?new uZ({cause:e}):dZ.nodeMessage.test(n)?new dZ({cause:e,gas:t==null?void 0:t.gas}):fZ.nodeMessage.test(n)?new fZ({cause:e,gas:t==null?void 0:t.gas}):hZ.nodeMessage.test(n)?new hZ({cause:e}):O9.nodeMessage.test(n)?new O9({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new Ek({cause:e})}function jut(e,{docsPath:t,...n}){const r=(()=>{const s=tB(e,n);return s instanceof Ek?e:s})();return new wut(r,{docsPath:t,...n})}function nB(e,{format:t}){if(!t)return{};const n={};function r(a){const o=Object.keys(a);for(const l of o)l in e&&(n[l]=e[l]),a[l]&&typeof a[l]=="object"&&!Array.isArray(a[l])&&r(a[l])}const s=t(e||{});return r(s),n}function rie(e,t){return({exclude:n,format:r})=>({exclude:n,format:s=>{const a=t(s);if(n)for(const o of n)delete a[o];return{...a,...r(s)}},type:e})}const Eut={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function kk(e){const t={};return typeof e.authorizationList<"u"&&(t.authorizationList=_ut(e.authorizationList)),typeof e.accessList<"u"&&(t.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(t.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?t.blobs=e.blobs.map(n=>Dl(n)):t.blobs=e.blobs),typeof e.data<"u"&&(t.data=e.data),typeof e.from<"u"&&(t.from=e.from),typeof e.gas<"u"&&(t.gas=Os(e.gas)),typeof e.gasPrice<"u"&&(t.gasPrice=Os(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(t.maxFeePerBlobGas=Os(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=Os(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=Os(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=Os(e.nonce)),typeof e.to<"u"&&(t.to=e.to),typeof e.type<"u"&&(t.type=Eut[e.type]),typeof e.value<"u"&&(t.value=Os(e.value)),t}function _ut(e){return e.map(t=>({address:t.address,r:t.r?Os(BigInt(t.r)):t.r,s:t.s?Os(BigInt(t.s)):t.s,chainId:Os(t.chainId),nonce:Os(t.nonce),...typeof t.yParity<"u"?{yParity:Os(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:Os(t.v)}:{}}))}function Zs(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const s=e[n];return typeof s=="function"?s:a=>t(e,a)}const rB=2n**256n-1n;function pA(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:s,to:a}=e,o=t?Ou(t):void 0;if(o&&!Jl(o.address))throw new ld({address:o.address});if(a&&!Jl(a))throw new ld({address:a});if(typeof n<"u"&&(typeof r<"u"||typeof s<"u"))throw new gut;if(r&&r>rB)throw new h3({maxFeePerGas:r});if(s&&r&&s>r)throw new O9({maxFeePerGas:r,maxPriorityFeePerGas:s})}async function sie(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return W0(t)}class kut extends Or{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class iie extends Or{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class Tut extends Or{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Gd(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class Zje extends Or{constructor({blockHash:t,blockNumber:n}){let r="Block";t&&(r=`Block at hash "${t}"`),n&&(r=`Block at number "${n}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}const Jje={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function sB(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?W0(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?W0(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Jje[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(t.authorizationList=Put(e.authorizationList)),t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof t.v=="bigint"){if(t.v===0n||t.v===27n)return 0;if(t.v===1n||t.v===28n)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),t.type==="legacy"&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),t.type==="eip2930"&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),t.type==="eip1559"&&delete t.maxFeePerBlobGas,t}const Iut=rie("transaction",sB);function Put(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function aie(e){const t=(e.transactions??[]).map(n=>typeof n=="string"?n:sB(n));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const Fut=rie("block",aie);async function w0(e,{blockHash:t,blockNumber:n,blockTag:r,includeTransactions:s}={}){var d,f,x;const a=r??"latest",o=s??!1,l=n!==void 0?Os(n):void 0;let c=null;if(t?c=await e.request({method:"eth_getBlockByHash",params:[t,o]},{dedupe:!0}):c=await e.request({method:"eth_getBlockByNumber",params:[l||a,o]},{dedupe:!!l}),!c)throw new Zje({blockHash:t,blockNumber:n});return(((x=(f=(d=e.chain)==null?void 0:d.formatters)==null?void 0:f.block)==null?void 0:x.format)||aie)(c)}async function oie(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function Out(e,t){return e9e(e,t)}async function e9e(e,t){var a,o;const{block:n,chain:r=e.chain,request:s}=t||{};try{const l=((a=r==null?void 0:r.fees)==null?void 0:a.maxPriorityFeePerGas)??((o=r==null?void 0:r.fees)==null?void 0:o.defaultPriorityFee);if(typeof l=="function"){const u=n||await Zs(e,w0,"getBlock")({}),d=await l({block:u,client:e,request:s});if(d===null)throw new Error;return d}if(typeof l<"u")return l;const c=await e.request({method:"eth_maxPriorityFeePerGas"});return Xu(c)}catch{const[l,c]=await Promise.all([n?Promise.resolve(n):Zs(e,w0,"getBlock")({}),Zs(e,oie,"getGasPrice")({})]);if(typeof l.baseFeePerGas!="bigint")throw new iie;const u=c-l.baseFeePerGas;return u<0n?0n:u}}async function Mut(e,t){return pZ(e,t)}async function pZ(e,t){var x,g;const{block:n,chain:r=e.chain,request:s,type:a="eip1559"}=t||{},o=await(async()=>{var v,w;return typeof((v=r==null?void 0:r.fees)==null?void 0:v.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:s}):((w=r==null?void 0:r.fees)==null?void 0:w.baseFeeMultiplier)??1.2})();if(o<1)throw new kut;const c=10**(((x=o.toString().split(".")[1])==null?void 0:x.length)??0),u=v=>v*BigInt(Math.ceil(o*c))/BigInt(c),d=n||await Zs(e,w0,"getBlock")({});if(typeof((g=r==null?void 0:r.fees)==null?void 0:g.estimateFeesPerGas)=="function"){const v=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:u,request:s,type:a});if(v!==null)return v}if(a==="eip1559"){if(typeof d.baseFeePerGas!="bigint")throw new iie;const v=typeof(s==null?void 0:s.maxPriorityFeePerGas)=="bigint"?s.maxPriorityFeePerGas:await e9e(e,{block:d,chain:r,request:s}),w=u(d.baseFeePerGas);return{maxFeePerGas:(s==null?void 0:s.maxFeePerGas)??w+v,maxPriorityFeePerGas:v}}return{gasPrice:(s==null?void 0:s.gasPrice)??u(await Zs(e,oie,"getGasPrice")({}))}}class Rut extends Or{constructor(t,{account:n,docsPath:r,chain:s,data:a,gas:o,gasPrice:l,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:d,to:f,value:x}){var v;const g=_k({from:n==null?void 0:n.address,to:f,value:typeof x<"u"&&`${eie(x)} ${((v=s==null?void 0:s.nativeCurrency)==null?void 0:v.symbol)||"ETH"}`,data:a,gas:o,gasPrice:typeof l<"u"&&`${Gd(l)} gwei`,maxFeePerGas:typeof c<"u"&&`${Gd(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${Gd(u)} gwei`,nonce:d});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",g].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}function Lut(e,{docsPath:t,...n}){const r=(()=>{const s=tB(e,n);return s instanceof Ek?e:s})();return new Rut(r,{docsPath:t,...n})}class Dut extends Or{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class But extends Or{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function dpe(e){return e.reduce((t,{slot:n,value:r})=>`${t}        ${n}: ${r}
`,"")}function $ut(e){return e.reduce((t,{address:n,...r})=>{let s=`${t}    ${n}:
`;return r.nonce&&(s+=`      nonce: ${r.nonce}
`),r.balance&&(s+=`      balance: ${r.balance}
`),r.code&&(s+=`      code: ${r.code}
`),r.state&&(s+=`      state:
`,s+=dpe(r.state)),r.stateDiff&&(s+=`      stateDiff:
`,s+=dpe(r.stateDiff)),s},`  State Override:
`).slice(0,-1)}function fpe(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new Qhe({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new Qhe({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function Uut(e){const{balance:t,nonce:n,state:r,stateDiff:s,code:a}=e,o={};if(a!==void 0&&(o.code=a),t!==void 0&&(o.balance=Os(t)),n!==void 0&&(o.nonce=Os(n)),r!==void 0&&(o.state=fpe(r)),s!==void 0){if(o.state)throw new But;o.stateDiff=fpe(s)}return o}function lie(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!Jl(n,{strict:!1}))throw new ld({address:n});if(t[n])throw new Dut({address:n});t[n]=Uut(r)}return t}async function cie(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=n?Os(n):void 0,a=await e.request({method:"eth_getBalance",params:[t,s||r]});return BigInt(a)}async function uie(e,t){var s,a,o;const{account:n=e.account}=t,r=n?Ou(n):void 0;try{let he=function(ie){const{block:oe,request:G,rpcStateOverride:V}=ie;return e.request({method:"eth_estimateGas",params:V?[G,oe??"latest",V]:oe?[G,oe]:[G]})};const{accessList:l,authorizationList:c,blobs:u,blobVersionedHashes:d,blockNumber:f,blockTag:x,data:g,gas:v,gasPrice:w,maxFeePerBlobGas:C,maxFeePerGas:N,maxPriorityFeePerGas:I,nonce:P,value:R,stateOverride:F,...U}=await pie(e,{...t,parameters:(r==null?void 0:r.type)==="local"?void 0:["blobVersionedHashes"]}),z=(f?Os(f):void 0)||x,X=lie(F),ne=await(async()=>{if(U.to)return U.to;if(c&&c.length>0)return await Kje({authorization:c[0]}).catch(()=>{throw new Or("`to` is required. Could not infer from `authorizationList`")})})();pA(t);const J=(o=(a=(s=e.chain)==null?void 0:s.formatters)==null?void 0:a.transactionRequest)==null?void 0:o.format,re=(J||kk)({...nB(U,{format:J}),from:r==null?void 0:r.address,accessList:l,authorizationList:c,blobs:u,blobVersionedHashes:d,data:g,gas:v,gasPrice:w,maxFeePerBlobGas:C,maxFeePerGas:N,maxPriorityFeePerGas:I,nonce:P,to:ne,value:R});let Y=BigInt(await he({block:z,request:re,rpcStateOverride:X}));if(c){const ie=await cie(e,{address:re.from}),oe=await Promise.all(c.map(async G=>{const{address:V}=G,ee=await he({block:z,request:{authorizationList:void 0,data:g,from:r==null?void 0:r.address,to:V,value:Os(ie)},rpcStateOverride:X}).catch(()=>100000n);return 2n*BigInt(ee)}));Y+=oe.reduce((G,V)=>G+V,0n)}return Y}catch(l){throw Lut(l,{...t,account:r,chain:e.chain})}}async function t9e(e,{address:t,blockTag:n="latest",blockNumber:r}){const s=await e.request({method:"eth_getTransactionCount",params:[t,r?Os(r):n]},{dedupe:!!r});return W0(s)}function die(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(a=>Qh(a)):e.blobs,s=[];for(const a of r)s.push(Uint8Array.from(t.blobToKzgCommitment(a)));return n==="bytes"?s:s.map(a=>Dl(a))}function fie(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(o=>Qh(o)):e.blobs,s=typeof e.commitments[0]=="string"?e.commitments.map(o=>Qh(o)):e.commitments,a=[];for(let o=0;o<r.length;o++){const l=r[o],c=s[o];a.push(Uint8Array.from(t.computeBlobKzgProof(l,c)))}return n==="bytes"?a:a.map(o=>Dl(o))}function zut(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),a=BigInt(4294967295),o=Number(n>>s&a),l=Number(n&a),c=r?4:0,u=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+u,l,r)}function Hut(e,t,n){return e&t^~e&n}function Vut(e,t,n){return e&t^e&n^t&n}let Wut=class extends Kse{constructor(t,n,r,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(t),this.view=qz(this.buffer)}update(t){IS(this);const{view:n,buffer:r,blockLen:s}=this;t=QD(t);const a=t.length;for(let o=0;o<a;){const l=Math.min(s-this.pos,a-o);if(l===s){const c=qz(t);for(;s<=a-o;o+=s)this.process(c,o);continue}r.set(t.subarray(o,o+l),this.pos),this.pos+=l,o+=l,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){IS(this),Fje(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:a}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let f=o;f<s;f++)n[f]=0;zut(r,s-8,BigInt(this.length*8),a),this.process(r,0);const l=qz(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)l.setUint32(4*f,d[f],a)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:a,destroyed:o,pos:l}=this;return t.length=s,t.pos=l,t.finished=a,t.destroyed=o,s%n&&t.buffer.set(r),t}};const qut=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),tb=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),nb=new Uint32Array(64);let Gut=class extends Wut{constructor(t=32){super(64,t,8,!1),this.A=tb[0]|0,this.B=tb[1]|0,this.C=tb[2]|0,this.D=tb[3]|0,this.E=tb[4]|0,this.F=tb[5]|0,this.G=tb[6]|0,this.H=tb[7]|0}get(){const{A:t,B:n,C:r,D:s,E:a,F:o,G:l,H:c}=this;return[t,n,r,s,a,o,l,c]}set(t,n,r,s,a,o,l,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=a|0,this.F=o|0,this.G=l|0,this.H=c|0}process(t,n){for(let f=0;f<16;f++,n+=4)nb[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const x=nb[f-15],g=nb[f-2],v=Um(x,7)^Um(x,18)^x>>>3,w=Um(g,17)^Um(g,19)^g>>>10;nb[f]=w+nb[f-7]+v+nb[f-16]|0}let{A:r,B:s,C:a,D:o,E:l,F:c,G:u,H:d}=this;for(let f=0;f<64;f++){const x=Um(l,6)^Um(l,11)^Um(l,25),g=d+x+Hut(l,c,u)+qut[f]+nb[f]|0,w=(Um(r,2)^Um(r,13)^Um(r,22))+Vut(r,s,a)|0;d=u,u=c,c=l,l=o+g|0,o=a,a=s,s=r,r=g+w|0}r=r+this.A|0,s=s+this.B|0,a=a+this.C|0,o=o+this.D|0,l=l+this.E|0,c=c+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(r,s,a,o,l,c,u,d)}roundClean(){nb.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const n9e=Oje(()=>new Gut);function Kut(e,t){return n9e(V0(e,{strict:!1})?hA(e):e)}function Yut(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),s=Kut(t);return s.set([n],0),r==="bytes"?s:Dl(s)}function r9e(e){const{commitments:t,version:n}=e,r=e.to??(typeof t[0]=="string"?"hex":"bytes"),s=[];for(const a of t)s.push(Yut({commitment:a,to:r,version:n}));return s}const hpe=6,s9e=32,hie=4096,i9e=s9e*hie,ppe=i9e*hpe-1-1*hie*hpe,a9e=1;class Xut extends Or{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class o9e extends Or{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class Qut extends Or{constructor({hash:t,size:n}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`],name:"InvalidVersionedHashSizeError"})}}class Zut extends Or{constructor({hash:t,version:n}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${a9e}`,`Received: ${n}`],name:"InvalidVersionedHashVersionError"})}}function Jut(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?Qh(e.data):e.data,r=el(n);if(!r)throw new o9e;if(r>ppe)throw new Xut({maxSize:ppe,size:r});const s=[];let a=!0,o=0;for(;a;){const l=Jse(new Uint8Array(i9e));let c=0;for(;c<hie;){const u=n.slice(o,o+(s9e-1));if(l.pushByte(0),l.pushBytes(u),u.length<31){l.pushByte(128),a=!1;break}c++,o+=31}s.push(l)}return t==="bytes"?s.map(l=>l.bytes):s.map(l=>Dl(l.bytes))}function l9e(e){const{data:t,kzg:n,to:r}=e,s=e.blobs??Jut({data:t,to:r}),a=e.commitments??die({blobs:s,kzg:n,to:r}),o=e.proofs??fie({blobs:s,commitments:a,kzg:n,to:r}),l=[];for(let c=0;c<s.length;c++)l.push({blob:s[c],commitment:a[c],proof:o[c]});return l}function c9e(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new yut({transaction:e})}const u9e=["blobVersionedHashes","chainId","fees","gas","nonce","type"],mpe=new Map;async function pie(e,t){const{account:n=e.account,blobs:r,chain:s,gas:a,kzg:o,nonce:l,nonceManager:c,parameters:u=u9e,type:d}=t,f=n&&Ou(n),x={...t,...f?{from:f==null?void 0:f.address}:{}};let g;async function v(){return g||(g=await Zs(e,w0,"getBlock")({blockTag:"latest"}),g)}let w;async function C(){return w||(s?s.id:typeof t.chainId<"u"?t.chainId:(w=await Zs(e,sie,"getChainId")({}),w))}if(u.includes("nonce")&&typeof l>"u"&&f)if(c){const N=await C();x.nonce=await c.consume({address:f.address,chainId:N,client:e})}else x.nonce=await Zs(e,t9e,"getTransactionCount")({address:f.address,blockTag:"pending"});if((u.includes("blobVersionedHashes")||u.includes("sidecars"))&&r&&o){const N=die({blobs:r,kzg:o});if(u.includes("blobVersionedHashes")){const I=r9e({commitments:N,to:"hex"});x.blobVersionedHashes=I}if(u.includes("sidecars")){const I=fie({blobs:r,commitments:N,kzg:o}),P=l9e({blobs:r,commitments:N,proofs:I,to:"hex"});x.sidecars=P}}if(u.includes("chainId")&&(x.chainId=await C()),(u.includes("fees")||u.includes("type"))&&typeof d>"u")try{x.type=c9e(x)}catch{let N=mpe.get(e.uid);if(typeof N>"u"){const I=await v();N=typeof(I==null?void 0:I.baseFeePerGas)=="bigint",mpe.set(e.uid,N)}x.type=N?"eip1559":"legacy"}if(u.includes("fees"))if(x.type!=="legacy"&&x.type!=="eip2930"){if(typeof x.maxFeePerGas>"u"||typeof x.maxPriorityFeePerGas>"u"){const N=await v(),{maxFeePerGas:I,maxPriorityFeePerGas:P}=await pZ(e,{block:N,chain:s,request:x});if(typeof t.maxPriorityFeePerGas>"u"&&t.maxFeePerGas&&t.maxFeePerGas<P)throw new Tut({maxPriorityFeePerGas:P});x.maxPriorityFeePerGas=P,x.maxFeePerGas=I}}else{if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")throw new iie;if(typeof t.gasPrice>"u"){const N=await v(),{gasPrice:I}=await pZ(e,{block:N,chain:s,request:x,type:"legacy"});x.gasPrice=I}}return u.includes("gas")&&typeof a>"u"&&(x.gas=await Zs(e,uie,"estimateGas")({...x,account:f&&{address:f.address,type:"json-rpc"}})),pA(x),delete x.parameters,x}async function d9e(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}const Qz=new XD(128);async function edt(e,t){var N,I,P,R;const{account:n=e.account,chain:r=e.chain,accessList:s,authorizationList:a,blobs:o,data:l,gas:c,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:x,nonce:g,value:v,...w}=t;if(typeof n>"u")throw new JD({docsPath:"/docs/actions/wallet/sendTransaction"});const C=n?Ou(n):null;try{pA(t);const F=await(async()=>{if(t.to)return t.to;if(t.to!==null&&a&&a.length>0)return await Kje({authorization:a[0]}).catch(()=>{throw new Or("`to` is required. Could not infer from `authorizationList`.")})})();if((C==null?void 0:C.type)==="json-rpc"||C===null){let U;r!==null&&(U=await Zs(e,sie,"getChainId")({}),hut({currentChainId:U,chain:r}));const L=(P=(I=(N=e.chain)==null?void 0:N.formatters)==null?void 0:I.transactionRequest)==null?void 0:P.format,X=(L||kk)({...nB(w,{format:L}),accessList:s,authorizationList:a,blobs:o,chainId:U,data:l,from:C==null?void 0:C.address,gas:c,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:x,nonce:g,to:F,value:v}),ne=Qz.get(e.uid),J=ne?"wallet_sendTransaction":"eth_sendTransaction";try{return await e.request({method:J,params:[X]},{retryCount:0})}catch(Z){if(ne===!1)throw Z;const re=Z;if(re.name==="InvalidInputRpcError"||re.name==="InvalidParamsRpcError"||re.name==="MethodNotFoundRpcError"||re.name==="MethodNotSupportedRpcError")return await e.request({method:"wallet_sendTransaction",params:[X]},{retryCount:0}).then(he=>(Qz.set(e.uid,!0),he)).catch(he=>{const Y=he;throw Y.name==="MethodNotFoundRpcError"||Y.name==="MethodNotSupportedRpcError"?(Qz.set(e.uid,!1),re):Y});throw re}}if((C==null?void 0:C.type)==="local"){const U=await Zs(e,pie,"prepareTransactionRequest")({account:C,accessList:s,authorizationList:a,blobs:o,chain:r,data:l,gas:c,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:x,nonce:g,nonceManager:C.nonceManager,parameters:[...u9e,"sidecars"],value:v,...w,to:F}),L=(R=r==null?void 0:r.serializers)==null?void 0:R.transaction,z=await C.signTransaction(U,{serializer:L});return await Zs(e,d9e,"sendRawTransaction")({serializedTransaction:z})}throw(C==null?void 0:C.type)==="smart"?new Xz({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new Xz({docsPath:"/docs/actions/wallet/sendTransaction",type:C==null?void 0:C.type})}catch(F){throw F instanceof Xz?F:jut(F,{...t,account:C,chain:t.chain||void 0})}}const mZ=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],xZ=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],f9e=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],h9e=[...f9e,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],tdt=[...f9e,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],xpe=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],gpe=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],bpe=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}];function ndt(e,t={}){typeof t.size<"u"&&ap(e,{size:t.size});const n=Dl(e,t);return Xu(n,t)}function rdt(e,t={}){let n=e;if(typeof t.size<"u"&&(ap(n,{size:t.size}),n=Rf(n)),n.length>1||n[0]>1)throw new Qlt(n);return!!n[0]}function Dg(e,t={}){typeof t.size<"u"&&ap(e,{size:t.size});const n=Dl(e,t);return W0(n,t)}function sdt(e,t={}){let n=e;return typeof t.size<"u"&&(ap(n,{size:t.size}),n=Rf(n,{dir:"right"})),new TextDecoder().decode(n)}function Tk(e,t){const n=typeof t=="string"?Qh(t):t,r=Jse(n);if(el(n)===0&&e.length>0)throw new Nk;if(el(t)&&el(t)<32)throw new _je({data:typeof t=="string"?t:Dl(t),params:e,size:el(t)});let s=0;const a=[];for(let o=0;o<e.length;++o){const l=e[o];r.setPosition(s);const[c,u]=XC(r,l,{staticPosition:0});s+=u,a.push(c)}return a}function XC(e,t,{staticPosition:n}){const r=Qse(t.type);if(r){const[s,a]=r;return adt(e,{...t,type:a},{length:s,staticPosition:n})}if(t.type==="tuple")return udt(e,t,{staticPosition:n});if(t.type==="address")return idt(e);if(t.type==="bool")return odt(e);if(t.type.startsWith("bytes"))return ldt(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return cdt(e,t);if(t.type==="string")return ddt(e,{staticPosition:n});throw new yct(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const ype=32,gZ=32;function idt(e){const t=e.readBytes(32);return[ZD(Dl(Uje(t,-20))),32]}function adt(e,t,{length:n,staticPosition:r}){if(!n){const o=Dg(e.readBytes(gZ)),l=r+o,c=l+ype;e.setPosition(l);const u=Dg(e.readBytes(ype)),d=J9(t);let f=0;const x=[];for(let g=0;g<u;++g){e.setPosition(c+(d?g*32:f));const[v,w]=XC(e,t,{staticPosition:c});f+=w,x.push(v)}return e.setPosition(r+32),[x,32]}if(J9(t)){const o=Dg(e.readBytes(gZ)),l=r+o,c=[];for(let u=0;u<n;++u){e.setPosition(l+u*32);const[d]=XC(e,t,{staticPosition:l});c.push(d)}return e.setPosition(r+32),[c,32]}let s=0;const a=[];for(let o=0;o<n;++o){const[l,c]=XC(e,t,{staticPosition:r+s});s+=c,a.push(l)}return[a,s]}function odt(e){return[rdt(e.readBytes(32),{size:32}),32]}function ldt(e,t,{staticPosition:n}){const[r,s]=t.type.split("bytes");if(!s){const o=Dg(e.readBytes(32));e.setPosition(n+o);const l=Dg(e.readBytes(32));if(l===0)return e.setPosition(n+32),["0x",32];const c=e.readBytes(l);return e.setPosition(n+32),[Dl(c),32]}return[Dl(e.readBytes(Number.parseInt(s),32)),32]}function cdt(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256"),s=e.readBytes(32);return[r>48?ndt(s,{signed:n}):Dg(s,{signed:n}),32]}function udt(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:o})=>!o),s=r?[]:{};let a=0;if(J9(t)){const o=Dg(e.readBytes(gZ)),l=n+o;for(let c=0;c<t.components.length;++c){const u=t.components[c];e.setPosition(l+a);const[d,f]=XC(e,u,{staticPosition:l});a+=f,s[r?c:u==null?void 0:u.name]=d}return e.setPosition(n+32),[s,32]}for(let o=0;o<t.components.length;++o){const l=t.components[o],[c,u]=XC(e,l,{staticPosition:n});s[r?o:l==null?void 0:l.name]=c,a+=u}return[s,a]}function ddt(e,{staticPosition:t}){const n=Dg(e.readBytes(32)),r=t+n;e.setPosition(r);const s=Dg(e.readBytes(32));if(s===0)return e.setPosition(t+32),["",32];const a=e.readBytes(s,32),o=sdt(Rf(a));return e.setPosition(t+32),[o,32]}function J9(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(J9);const n=Qse(e.type);return!!(n&&J9({...e,type:n[1]}))}const fdt=e=>Xc(hA(e));function hdt(e){return fdt(e)}const pdt="1.0.8";let Wf=class bZ extends Error{constructor(t,n={}){var o;const r=n.cause instanceof bZ?n.cause.details:(o=n.cause)!=null&&o.message?n.cause.message:n.details,s=n.cause instanceof bZ&&n.cause.docsPath||n.docsPath,a=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: https://abitype.dev${s}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${pdt}`].join(`
`);super(a),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}};function x1(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const p9e=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,m9e=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,x9e=/^\(.+?\).*?$/,vpe=/^tuple(?<array>(\[(\d*)\])*)$/;function yZ(e){let t=e.type;if(vpe.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let s=0;s<n;s++){const a=e.components[s];t+=yZ(a),s<n-1&&(t+=", ")}const r=x1(vpe,e.type);return t+=`)${(r==null?void 0:r.array)??""}`,yZ({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function x7(e){let t="";const n=e.length;for(let r=0;r<n;r++){const s=e[r];t+=yZ(s),r!==n-1&&(t+=", ")}return t}function rM(e){var t;return e.type==="function"?`function ${e.name}(${x7(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${x7(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${x7(e.inputs)})`:e.type==="error"?`error ${e.name}(${x7(e.inputs)})`:e.type==="constructor"?`constructor(${x7(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const g9e=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function mdt(e){return g9e.test(e)}function xdt(e){return x1(g9e,e)}const b9e=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function gdt(e){return b9e.test(e)}function bdt(e){return x1(b9e,e)}const y9e=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function ydt(e){return y9e.test(e)}function vdt(e){return x1(y9e,e)}const v9e=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function mie(e){return v9e.test(e)}function wdt(e){return x1(v9e,e)}const w9e=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function Cdt(e){return w9e.test(e)}function Sdt(e){return x1(w9e,e)}const C9e=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function Ndt(e){return C9e.test(e)}function Adt(e){return x1(C9e,e)}const jdt=/^receive\(\) external payable$/;function Edt(e){return jdt.test(e)}const _dt=new Set(["indexed"]),vZ=new Set(["calldata","memory","storage"]);class kdt extends Wf{constructor({signature:t}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class Tdt extends Wf{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class Idt extends Wf{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class Pdt extends Wf{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Fdt extends Wf{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class Odt extends Wf{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class Mdt extends Wf{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class Rdt extends Wf{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}let mA=class extends Wf{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}};class Ldt extends Wf{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class Ddt extends Wf{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class Bdt extends Wf{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class $dt extends Wf{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function Udt(e,t,n){let r="";if(n)for(const s of Object.entries(n)){if(!s)continue;let a="";for(const o of s[1])a+=`[${o.type}${o.name?`:${o.name}`:""}]`;r+=`(${s[0]}{${a}})`}return t?`${t}:${e}${r}`:e}const Zz=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function wZ(e,t={}){if(ydt(e))return zdt(e,t);if(gdt(e))return Hdt(e,t);if(mdt(e))return Vdt(e,t);if(Cdt(e))return Wdt(e,t);if(Ndt(e))return qdt(e);if(Edt(e))return{type:"receive",stateMutability:"payable"};throw new Ldt({signature:e})}function zdt(e,t={}){const n=vdt(e);if(!n)throw new mA({signature:e,type:"function"});const r=Kp(n.parameters),s=[],a=r.length;for(let l=0;l<a;l++)s.push(x3(r[l],{modifiers:vZ,structs:t,type:"function"}));const o=[];if(n.returns){const l=Kp(n.returns),c=l.length;for(let u=0;u<c;u++)o.push(x3(l[u],{modifiers:vZ,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:s,outputs:o}}function Hdt(e,t={}){const n=bdt(e);if(!n)throw new mA({signature:e,type:"event"});const r=Kp(n.parameters),s=[],a=r.length;for(let o=0;o<a;o++)s.push(x3(r[o],{modifiers:_dt,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:s}}function Vdt(e,t={}){const n=xdt(e);if(!n)throw new mA({signature:e,type:"error"});const r=Kp(n.parameters),s=[],a=r.length;for(let o=0;o<a;o++)s.push(x3(r[o],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:s}}function Wdt(e,t={}){const n=Sdt(e);if(!n)throw new mA({signature:e,type:"constructor"});const r=Kp(n.parameters),s=[],a=r.length;for(let o=0;o<a;o++)s.push(x3(r[o],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:s}}function qdt(e){const t=Adt(e);if(!t)throw new mA({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const Gdt=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Kdt=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Ydt=/^u?int$/;function x3(e,t){var f,x;const n=Udt(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(Zz.has(n))return Zz.get(n);const r=x9e.test(e),s=x1(r?Kdt:Gdt,e);if(!s)throw new Pdt({param:e});if(s.name&&Qdt(s.name))throw new Fdt({param:e,name:s.name});const a=s.name?{name:s.name}:{},o=s.modifier==="indexed"?{indexed:!0}:{},l=(t==null?void 0:t.structs)??{};let c,u={};if(r){c="tuple";const g=Kp(s.type),v=[],w=g.length;for(let C=0;C<w;C++)v.push(x3(g[C],{structs:l}));u={components:v}}else if(s.type in l)c="tuple",u={components:l[s.type]};else if(Ydt.test(s.type))c=`${s.type}256`;else if(c=s.type,(t==null?void 0:t.type)!=="struct"&&!S9e(c))throw new Idt({type:c});if(s.modifier){if(!((x=(f=t==null?void 0:t.modifiers)==null?void 0:f.has)!=null&&x.call(f,s.modifier)))throw new Odt({param:e,type:t==null?void 0:t.type,modifier:s.modifier});if(vZ.has(s.modifier)&&!Zdt(c,!!s.array))throw new Mdt({param:e,type:t==null?void 0:t.type,modifier:s.modifier})}const d={type:`${c}${s.array??""}`,...a,...o,...u};return Zz.set(n,d),d}function Kp(e,t=[],n="",r=0){const s=e.trim().length;for(let a=0;a<s;a++){const o=e[a],l=e.slice(a+1);switch(o){case",":return r===0?Kp(l,[...t,n.trim()]):Kp(l,t,`${n}${o}`,r);case"(":return Kp(l,t,`${n}${o}`,r+1);case")":return Kp(l,t,`${n}${o}`,r-1);default:return Kp(l,t,`${n}${o}`,r)}}if(n==="")return t;if(r!==0)throw new $dt({current:n,depth:r});return t.push(n.trim()),t}function S9e(e){return e==="address"||e==="bool"||e==="function"||e==="string"||p9e.test(e)||m9e.test(e)}const Xdt=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function Qdt(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||p9e.test(e)||m9e.test(e)||Xdt.test(e)}function Zdt(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function N9e(e){const t={},n=e.length;for(let o=0;o<n;o++){const l=e[o];if(!mie(l))continue;const c=wdt(l);if(!c)throw new mA({signature:l,type:"struct"});const u=c.properties.split(";"),d=[],f=u.length;for(let x=0;x<f;x++){const v=u[x].trim();if(!v)continue;const w=x3(v,{type:"struct"});d.push(w)}if(!d.length)throw new Ddt({signature:l});t[c.name]=d}const r={},s=Object.entries(t),a=s.length;for(let o=0;o<a;o++){const[l,c]=s[o];r[l]=A9e(c,t)}return r}const Jdt=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function A9e(e,t,n=new Set){const r=[],s=e.length;for(let a=0;a<s;a++){const o=e[a];if(x9e.test(o.type))r.push(o);else{const c=x1(Jdt,o.type);if(!(c!=null&&c.type))throw new Rdt({abiParameter:o});const{array:u,type:d}=c;if(d in t){if(n.has(d))throw new Bdt({type:d});r.push({...o,type:`tuple${u??""}`,components:A9e(t[d]??[],t,new Set([...n,d]))})}else if(S9e(d))r.push(o);else throw new Tdt({type:d})}}return r}function j9e(e){const t=N9e(e),n=[],r=e.length;for(let s=0;s<r;s++){const a=e[s];mie(a)||n.push(wZ(a,t))}return n}function wpe(e){let t;if(typeof e=="string")t=wZ(e);else{const n=N9e(e),r=e.length;for(let s=0;s<r;s++){const a=e[s];if(!mie(a)){t=wZ(a,n);break}}}if(!t)throw new kdt({signature:e});return t}function eft(e){let t=!0,n="",r=0,s="",a=!1;for(let o=0;o<e.length;o++){const l=e[o];if(["(",")",","].includes(l)&&(t=!0),l==="("&&r++,l===")"&&r--,!!t){if(r===0){if(l===" "&&["event","function",""].includes(s))s="";else if(s+=l,l===")"){a=!0;break}continue}if(l===" "){e[o-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}s+=l,n+=l}}if(!a)throw new Or("Unable to normalize signature.");return s}const tft=e=>{const t=typeof e=="string"?e:rM(e);return eft(t)};function E9e(e){return hdt(tft(e))}const iB=E9e,Ik=e=>f3(E9e(e),0,4);function t5(e){const{abi:t,args:n=[],name:r}=e,s=V0(r,{strict:!1}),a=t.filter(l=>s?l.type==="function"?Ik(l)===r:l.type==="event"?iB(l)===r:!1:"name"in l&&l.name===r);if(a.length===0)return;if(a.length===1)return a[0];let o;for(const l of a){if(!("inputs"in l))continue;if(!n||n.length===0){if(!l.inputs||l.inputs.length===0)return l;continue}if(!l.inputs||l.inputs.length===0||l.inputs.length!==n.length)continue;if(n.every((u,d)=>{const f="inputs"in l&&l.inputs[d];return f?CZ(u,f):!1})){if(o&&"inputs"in o&&o.inputs){const u=_9e(l.inputs,o.inputs,n);if(u)throw new xct({abiItem:l,type:u[0]},{abiItem:o,type:u[1]})}o=l}}return o||a[0]}function CZ(e,t){const n=typeof e,r=t.type;switch(r){case"address":return Jl(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((s,a)=>CZ(Object.values(e)[a],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(s=>CZ(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function _9e(e,t,n){for(const r in e){const s=e[r],a=t[r];if(s.type==="tuple"&&a.type==="tuple"&&"components"in s&&"components"in a)return _9e(s.components,a.components,n[r]);const o=[s.type,a.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?Jl(n[r],{strict:!1}):o.includes("address")&&o.includes("bytes")?Jl(n[r],{strict:!1}):!1)return o}}const Jz="/docs/contract/decodeFunctionResult";function n5(e){const{abi:t,args:n,functionName:r,data:s}=e;let a=t[0];if(r){const l=t5({abi:t,args:n,name:r});if(!l)throw new TS(r,{docsPath:Jz});a=l}if(a.type!=="function")throw new TS(void 0,{docsPath:Jz});if(!a.outputs)throw new Ije(a.name,{docsPath:Jz});const o=Tk(a.outputs,s);if(o.length>1)return o;if(o.length===1)return o[0]}const Cpe="/docs/contract/encodeFunctionData";function nft(e){const{abi:t,args:n,functionName:r}=e;let s=t[0];if(r){const a=t5({abi:t,args:n,name:r});if(!a)throw new TS(r,{docsPath:Cpe});s=a}if(s.type!=="function")throw new TS(void 0,{docsPath:Cpe});return{abi:[s],functionName:Ik(lm(s))}}function xm(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var l;return e.abi.length===1&&((l=e.functionName)!=null&&l.startsWith("0x"))?e:nft(e)})(),s=n[0],a=r,o="inputs"in s&&s.inputs?e2(s.inputs,t??[]):void 0;return mm([a,o??"0x"])}function xA({blockNumber:e,chain:t,contract:n}){var s;const r=(s=t==null?void 0:t.contracts)==null?void 0:s[n];if(!r)throw new iZ({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new iZ({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}const k9e={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},T9e={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},rft={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function sft(e){const{abi:t,data:n}=e,r=f3(n,0,4);if(r==="0x")throw new Nk;const a=[...t||[],T9e,rft].find(o=>o.type==="error"&&r===Ik(lm(o)));if(!a)throw new kje(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:a,args:"inputs"in a&&a.inputs&&a.inputs.length>0?Tk(a.inputs,f3(n,4)):void 0,errorName:a.name}}function I9e({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((s,a)=>`${r&&s.name?`${s.name}: `:""}${typeof t[a]=="object"?jc(t[a]):t[a]}`).join(", ")})`}class P9e extends Or{constructor(t,{account:n,docsPath:r,chain:s,data:a,gas:o,gasPrice:l,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:d,to:f,value:x,stateOverride:g}){var C;const v=n?Ou(n):void 0;let w=_k({from:v==null?void 0:v.address,to:f,value:typeof x<"u"&&`${eie(x)} ${((C=s==null?void 0:s.nativeCurrency)==null?void 0:C.symbol)||"ETH"}`,data:a,gas:o,gasPrice:typeof l<"u"&&`${Gd(l)} gwei`,maxFeePerGas:typeof c<"u"&&`${Gd(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${Gd(u)} gwei`,nonce:d});g&&(w+=`
${$ut(g)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",w].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class F9e extends Or{constructor(t,{abi:n,args:r,contractAddress:s,docsPath:a,functionName:o,sender:l}){const c=t5({abi:n,args:r,name:o}),u=c?I9e({abiItem:c,args:r,includeFunctionName:!1,includeName:!1}):void 0,d=c?lm(c,{includeName:!0}):void 0,f=_k({address:s&&Sut(s),function:d,args:u&&u!=="()"&&`${[...Array((o==null?void 0:o.length)??0).keys()].map(()=>" ").join("")}${u}`,sender:l});super(t.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:t,docsPath:a,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],f&&"Contract Call:",f].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=n,this.args=r,this.cause=t,this.contractAddress=s,this.functionName=o,this.sender=l}}class SZ extends Or{constructor({abi:t,data:n,functionName:r,message:s}){let a,o,l,c;if(n&&n!=="0x")try{o=sft({abi:t,data:n});const{abiItem:d,errorName:f,args:x}=o;if(f==="Error")c=x[0];else if(f==="Panic"){const[g]=x;c=k9e[g]}else{const g=d?lm(d,{includeName:!0}):void 0,v=d&&x?I9e({abiItem:d,args:x,includeFunctionName:!1,includeName:!1}):void 0;l=[g?`Error: ${g}`:"",v&&v!=="()"?`       ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${v}`:""]}}catch(d){a=d}else s&&(c=s);let u;a instanceof kje&&(u=a.signature,l=[`Unable to decode signature "${u}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${u}.`]),super(c&&c!=="execution reverted"||u?[`The contract function "${r}" reverted with the following ${u?"signature":"reason"}:`,c||u].join(`
`):`The contract function "${r}" reverted.`,{cause:a,metaMessages:l,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=o,this.raw=n,this.reason=c,this.signature=u}}class ift extends Or{constructor({functionName:t}){super(`The contract function "${t}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",`  - The contract does not have the function "${t}",`,"  - The parameters passed to the contract function may be invalid, or","  - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class aft extends Or{constructor({factory:t}){super(`Deployment for counterfactual contract call failed${t?` for factory "${t}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class aB extends Or{constructor({data:t,message:n}){super(n||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}}function xie(e,t){var r,s,a,o,l,c;if(!(e instanceof Or))return!1;const n=e.walk(u=>u instanceof SZ);return n instanceof SZ?!!(((r=n.data)==null?void 0:r.errorName)==="ResolverNotFound"||((s=n.data)==null?void 0:s.errorName)==="ResolverWildcardNotSupported"||((a=n.data)==null?void 0:a.errorName)==="ResolverNotContract"||((o=n.data)==null?void 0:o.errorName)==="ResolverError"||((l=n.data)==null?void 0:l.errorName)==="HttpError"||(c=n.reason)!=null&&c.includes("Wildcard on non-extended resolvers is not supported")||t==="reverse"&&n.reason===k9e[50]):!1}function oft(e){const{abi:t,data:n}=e,r=f3(n,0,4),s=t.find(a=>a.type==="function"&&r===Ik(lm(a)));if(!s)throw new mct(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:s.name,args:"inputs"in s&&s.inputs&&s.inputs.length>0?Tk(s.inputs,f3(n,4)):void 0}}const eH="/docs/contract/encodeErrorResult";function Spe(e){const{abi:t,errorName:n,args:r}=e;let s=t[0];if(n){const c=t5({abi:t,args:r,name:n});if(!c)throw new epe(n,{docsPath:eH});s=c}if(s.type!=="error")throw new epe(void 0,{docsPath:eH});const a=lm(s),o=Ik(a);let l="0x";if(r&&r.length>0){if(!s.inputs)throw new hct(s.name,{docsPath:eH});l=e2(s.inputs,r)}return mm([o,l])}const tH="/docs/contract/encodeFunctionResult";function lft(e){const{abi:t,functionName:n,result:r}=e;let s=t[0];if(n){const o=t5({abi:t,name:n});if(!o)throw new TS(n,{docsPath:tH});s=o}if(s.type!=="function")throw new TS(void 0,{docsPath:tH});if(!s.outputs)throw new Ije(s.name,{docsPath:tH});const a=(()=>{if(s.outputs.length===0)return[];if(s.outputs.length===1)return[r];if(Array.isArray(r))return r;throw new Pje(r)})();return e2(s.outputs,a)}const O9e="x-batch-gateway:true";async function q2n(e){const{data:t,ccipRequest:n}=e,{args:[r]}=oft({abi:xZ,data:t}),s=[],a=[];return await Promise.all(r.map(async(o,l)=>{try{a[l]=await n(o),s[l]=!1}catch(c){s[l]=!0,a[l]=cft(c)}})),lft({abi:xZ,functionName:"query",result:[s,a]})}function cft(e){return e.name==="HttpRequestError"&&e.status?Spe({abi:xZ,errorName:"HttpError",args:[e.status,e.shortMessage]}):Spe({abi:[T9e],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}function M9e(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return V0(t)?t:null}function MF(e){let t=new Uint8Array(32).fill(0);if(!e)return Dl(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const s=M9e(n[r]),a=s?hA(s):Xc(Hw(n[r]),"bytes");t=Xc(Zg([t,a]),"bytes")}return Dl(t)}function uft(e){return`[${e.slice(2)}]`}function dft(e){const t=new Uint8Array(32).fill(0);return e?M9e(e)||Xc(Hw(e)):Dl(t)}function oB(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(Hw(t).byteLength+2);let r=0;const s=t.split(".");for(let a=0;a<s.length;a++){let o=Hw(s[a]);o.byteLength>255&&(o=Hw(uft(dft(s[a])))),n[r]=o.length,n.set(o,r+1),r+=o.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}const fft=3;function g3(e,{abi:t,address:n,args:r,docsPath:s,functionName:a,sender:o}){const l=e instanceof aB?e:e instanceof Or?e.walk(v=>"data"in v)||e.walk():{},{code:c,data:u,details:d,message:f,shortMessage:x}=l,g=e instanceof Nk?new ift({functionName:a}):[fft,p3.code].includes(c)&&(u||d||f||x)?new SZ({abi:t,data:typeof u=="object"?u.data:u,functionName:a,message:l instanceof nie?d:x??f}):e;return new F9e(g,{abi:t,args:r,contractAddress:n,docsPath:s,functionName:a,sender:o})}const hft="0x82ad56cb",R9e="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",pft="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",mft="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";function L9e(e,{docsPath:t,...n}){const r=(()=>{const s=tB(e,n);return s instanceof Ek?e:s})();return new P9e(r,{docsPath:t,...n})}function D9e(){let e=()=>{},t=()=>{};return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}const nH=new Map;function B9e({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:s}){const a=async()=>{const d=c();o();const f=d.map(({args:x})=>x);f.length!==0&&e(f).then(x=>{s&&Array.isArray(x)&&x.sort(s);for(let g=0;g<d.length;g++){const{resolve:v}=d[g];v==null||v([x[g],x])}}).catch(x=>{for(let g=0;g<d.length;g++){const{reject:v}=d[g];v==null||v(x)}})},o=()=>nH.delete(t),l=()=>c().map(({args:d})=>d),c=()=>nH.get(t)||[],u=d=>nH.set(t,[...c(),d]);return{flush:o,async schedule(d){const{promise:f,resolve:x,reject:g}=D9e();return(n==null?void 0:n([...l(),d]))&&a(),c().length>0?(u({args:d,resolve:x,reject:g}),f):(u({args:d,resolve:x,reject:g}),setTimeout(a,r),f)}}}async function lB(e,t){var J,Z,re,he;const{account:n=e.account,batch:r=!!((J=e.batch)!=null&&J.multicall),blockNumber:s,blockTag:a="latest",accessList:o,blobs:l,code:c,data:u,factory:d,factoryData:f,gas:x,gasPrice:g,maxFeePerBlobGas:v,maxFeePerGas:w,maxPriorityFeePerGas:C,nonce:N,to:I,value:P,stateOverride:R,...F}=t,U=n?Ou(n):void 0;if(c&&(d||f))throw new Or("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(c&&I)throw new Or("Cannot provide both `code` & `to` as parameters.");const L=c&&u,z=d&&f&&I&&u,X=L||z,ne=L?bft({code:c,data:u}):z?yft({data:u,factory:d,factoryData:f,to:I}):u;try{pA(t);const ie=(s?Os(s):void 0)||a,oe=lie(R),G=(he=(re=(Z=e.chain)==null?void 0:Z.formatters)==null?void 0:re.transactionRequest)==null?void 0:he.format,ee=(G||kk)({...nB(F,{format:G}),from:U==null?void 0:U.address,accessList:o,blobs:l,data:ne,gas:x,gasPrice:g,maxFeePerBlobGas:v,maxFeePerGas:w,maxPriorityFeePerGas:C,nonce:N,to:X?void 0:I,value:P});if(r&&xft({request:ee})&&!oe)try{return await gft(e,{...ee,blockNumber:s,blockTag:a})}catch(fe){if(!(fe instanceof Yje)&&!(fe instanceof iZ))throw fe}const ae=await e.request({method:"eth_call",params:oe?[ee,ie,oe]:[ee,ie]});return ae==="0x"?{data:void 0}:{data:ae}}catch(Y){const ie=vft(Y),{offchainLookup:oe,offchainLookupSignature:G}=await Jr(async()=>{const{offchainLookup:V,offchainLookupSignature:ee}=await import("./ccip-NTo6jsLP.js");return{offchainLookup:V,offchainLookupSignature:ee}},[]);if(e.ccipRead!==!1&&(ie==null?void 0:ie.slice(0,10))===G&&I)return{data:await oe(e,{data:ie,to:I})};throw X&&(ie==null?void 0:ie.slice(0,10))==="0x101bb98d"?new aft({factory:d}):L9e(Y,{...t,account:U,chain:e.chain})}}function xft({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(hft)||!n||Object.values(r).filter(s=>typeof s<"u").length>0)}async function gft(e,t){var w;const{batchSize:n=1024,wait:r=0}=typeof((w=e.batch)==null?void 0:w.multicall)=="object"?e.batch.multicall:{},{blockNumber:s,blockTag:a="latest",data:o,multicallAddress:l,to:c}=t;let u=l;if(!u){if(!e.chain)throw new Yje;u=xA({blockNumber:s,chain:e.chain,contract:"multicall3"})}const f=(s?Os(s):void 0)||a,{schedule:x}=B9e({id:`${e.uid}.${f}`,wait:r,shouldSplitBatch(C){return C.reduce((I,{data:P})=>I+(P.length-2),0)>n*2},fn:async C=>{const N=C.map(R=>({allowFailure:!0,callData:R.data,target:R.to})),I=xm({abi:mZ,args:[N],functionName:"aggregate3"}),P=await e.request({method:"eth_call",params:[{data:I,to:u},f]});return n5({abi:mZ,args:[N],functionName:"aggregate3",data:P||"0x"})}}),[{returnData:g,success:v}]=await x({data:o,to:c});if(!v)throw new aB({data:g});return g==="0x"?{data:void 0}:{data:g}}function bft(e){const{code:t,data:n}=e;return Zse({abi:j9e(["constructor(bytes, bytes)"]),bytecode:R9e,args:[t,n]})}function yft(e){const{data:t,factory:n,factoryData:r,to:s}=e;return Zse({abi:j9e(["constructor(address, bytes, address, bytes)"]),bytecode:pft,args:[s,t,n,r]})}function vft(e){var n;if(!(e instanceof Or))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(n=t.data)==null?void 0:n.data:t.data}async function q0(e,t){const{abi:n,address:r,args:s,functionName:a,...o}=t,l=xm({abi:n,args:s,functionName:a});try{const{data:c}=await Zs(e,lB,"call")({...o,data:l,to:r});return n5({abi:n,args:s,functionName:a,data:c||"0x"})}catch(c){throw g3(c,{abi:n,address:r,args:s,docsPath:"/docs/contract/readContract",functionName:a})}}async function wft(e,t){const{blockNumber:n,blockTag:r,coinType:s,name:a,gatewayUrls:o,strict:l}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return xA({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),d=c==null?void 0:c.ensTlds;if(d&&!d.some(f=>a.endsWith(f)))return null;try{const f=xm({abi:gpe,functionName:"addr",...s!=null?{args:[MF(a),BigInt(s)]}:{args:[MF(a)]}}),x={address:u,abi:h9e,functionName:"resolve",args:[ri(oB(a)),f,o??[O9e]],blockNumber:n,blockTag:r},v=await Zs(e,q0,"readContract")(x);if(v[0]==="0x")return null;const w=n5({abi:gpe,args:s!=null?[MF(a),BigInt(s)]:void 0,functionName:"addr",data:v[0]});return w==="0x"||Rf(w)==="0x00"?null:w}catch(f){if(l)throw f;if(xie(f,"resolve"))return null;throw f}}class Cft extends Or{constructor({data:t}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(t)}`],name:"EnsAvatarInvalidMetadataError"})}}class g7 extends Or{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class gie extends Or{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class Sft extends Or{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const Nft=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,Aft=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,jft=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Eft=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function _ft(e){try{const t=await fetch(e,{method:"HEAD"});if(t.status===200){const n=t.headers.get("content-type");return n==null?void 0:n.startsWith("image/")}return!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=e})}}function Npe(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function $9e({uri:e,gatewayUrls:t}){const n=jft.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=Npe(t==null?void 0:t.ipfs,"https://ipfs.io"),s=Npe(t==null?void 0:t.arweave,"https://arweave.net"),a=e.match(Nft),{protocol:o,subpath:l,target:c,subtarget:u=""}=(a==null?void 0:a.groups)||{},d=o==="ipns:/"||l==="ipns/",f=o==="ipfs:/"||l==="ipfs/"||Aft.test(e);if(e.startsWith("http")&&!d&&!f){let g=e;return t!=null&&t.arweave&&(g=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:g,isOnChain:!1,isEncoded:!1}}if((d||f)&&c)return{uri:`${r}/${d?"ipns":"ipfs"}/${c}${u}`,isOnChain:!1,isEncoded:!1};if(o==="ar:/"&&c)return{uri:`${s}/${c}${u||""}`,isOnChain:!1,isEncoded:!1};let x=e.replace(Eft,"");if(x.startsWith("<svg")&&(x=`data:image/svg+xml;base64,${btoa(x)}`),x.startsWith("data:")||x.startsWith("{"))return{uri:x,isOnChain:!0,isEncoded:!1};throw new gie({uri:e})}function U9e(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new Cft({data:e});return e.image||e.image_url||e.image_data}async function kft({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(s=>s.json());return await bie({gatewayUrls:e,uri:U9e(n)})}catch{throw new gie({uri:t})}}async function bie({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=$9e({uri:t,gatewayUrls:e});if(r||await _ft(n))return n;throw new gie({uri:t})}function Tft(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,s]=t.split("/"),[a,o]=n.split(":"),[l,c]=r.split(":");if(!a||a.toLowerCase()!=="eip155")throw new g7({reason:"Only EIP-155 supported"});if(!o)throw new g7({reason:"Chain ID not found"});if(!c)throw new g7({reason:"Contract address not found"});if(!s)throw new g7({reason:"Token ID not found"});if(!l)throw new g7({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o),namespace:l.toLowerCase(),contractAddress:c,tokenID:s}}async function Ift(e,{nft:t}){if(t.namespace==="erc721")return q0(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return q0(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new Sft({namespace:t.namespace})}async function Pft(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?Fft(e,{gatewayUrls:t,record:n}):bie({uri:n,gatewayUrls:t})}async function Fft(e,{gatewayUrls:t,record:n}){const r=Tft(n),s=await Ift(e,{nft:r}),{uri:a,isOnChain:o,isEncoded:l}=$9e({uri:s,gatewayUrls:t});if(o&&(a.includes("data:application/json;base64,")||a.startsWith("{"))){const u=l?atob(a.replace("data:application/json;base64,","")):a,d=JSON.parse(u);return bie({uri:U9e(d),gatewayUrls:t})}let c=r.tokenID;return r.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),kft({gatewayUrls:t,uri:a.replace(/(?:0x)?{id}/,c)})}async function z9e(e,t){const{blockNumber:n,blockTag:r,key:s,name:a,gatewayUrls:o,strict:l}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return xA({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),d=c==null?void 0:c.ensTlds;if(d&&!d.some(f=>a.endsWith(f)))return null;try{const f={address:u,abi:h9e,functionName:"resolve",args:[ri(oB(a)),xm({abi:xpe,functionName:"text",args:[MF(a),s]}),o??[O9e]],blockNumber:n,blockTag:r},g=await Zs(e,q0,"readContract")(f);if(g[0]==="0x")return null;const v=n5({abi:xpe,functionName:"text",data:g[0]});return v===""?null:v}catch(f){if(l)throw f;if(xie(f,"resolve"))return null;throw f}}async function H9e(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:s,gatewayUrls:a,strict:o,universalResolverAddress:l}){const c=await Zs(e,z9e,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:s,universalResolverAddress:l,gatewayUrls:a,strict:o});if(!c)return null;try{return await Pft(e,{record:c,gatewayUrls:r})}catch{return null}}async function V9e(e,{address:t,blockNumber:n,blockTag:r,gatewayUrls:s,strict:a,universalResolverAddress:o}){let l=o;if(!l){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");l=xA({blockNumber:n,chain:e.chain,contract:"ensUniversalResolver"})}const c=`${t.toLowerCase().substring(2)}.addr.reverse`;try{const u={address:l,abi:tdt,functionName:"reverse",args:[ri(oB(c))],blockNumber:n,blockTag:r},d=Zs(e,q0,"readContract"),[f,x]=s?await d({...u,args:[...u.args,s]}):await d(u);return t.toLowerCase()!==x.toLowerCase()?null:f}catch(u){if(a)throw u;if(xie(u,"reverse"))return null;throw u}}async function Oft(e,t){const{blockNumber:n,blockTag:r,name:s}=t,{chain:a}=e,o=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return xA({blockNumber:n,chain:a,contract:"ensUniversalResolver"})})(),l=a==null?void 0:a.ensTlds;if(l&&!l.some(u=>s.endsWith(u)))throw new Error(`${s} is not a valid ENS TLD (${l==null?void 0:l.join(", ")}) for chain "${a.name}" (id: ${a.id}).`);const[c]=await Zs(e,q0,"readContract")({address:o,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[ri(oB(s))],blockNumber:n,blockTag:r});return c}async function W9e(e,t){var C,N,I;const{account:n=e.account,blockNumber:r,blockTag:s="latest",blobs:a,data:o,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,to:x,value:g,...v}=t,w=n?Ou(n):void 0;try{pA(t);const R=(r?Os(r):void 0)||s,F=(I=(N=(C=e.chain)==null?void 0:C.formatters)==null?void 0:N.transactionRequest)==null?void 0:I.format,L=(F||kk)({...nB(v,{format:F}),from:w==null?void 0:w.address,blobs:a,data:o,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,to:x,value:g}),z=await e.request({method:"eth_createAccessList",params:[L,R]});return{accessList:z.accessList,gasUsed:BigInt(z.gasUsed)}}catch(P){throw L9e(P,{...t,account:w,chain:e.chain})}}function cB(e,{method:t}){var r,s;const n={};return e.transport.type==="fallback"&&((s=(r=e.transport).onResponse)==null||s.call(r,({method:a,response:o,status:l,transport:c})=>{l==="success"&&t===a&&(n[o]=c.request)})),a=>n[a]||e.request}async function Mft(e){const t=cB(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}class Rft extends Or{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}const Ape="/docs/contract/encodeEventTopics";function Pk(e){var c;const{abi:t,eventName:n,args:r}=e;let s=t[0];if(n){const u=t5({abi:t,name:n});if(!u)throw new tpe(n,{docsPath:Ape});s=u}if(s.type!=="event")throw new tpe(void 0,{docsPath:Ape});const a=lm(s),o=iB(a);let l=[];if(r&&"inputs"in s){const u=(c=s.inputs)==null?void 0:c.filter(f=>"indexed"in f&&f.indexed),d=Array.isArray(r)?r:Object.values(r).length>0?(u==null?void 0:u.map(f=>r[f.name]))??[]:[];d.length>0&&(l=(u==null?void 0:u.map((f,x)=>Array.isArray(d[x])?d[x].map((g,v)=>jpe({param:f,value:d[x][v]})):typeof d[x]<"u"&&d[x]!==null?jpe({param:f,value:d[x]}):null))??[])}return[o,...l]}function jpe({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return Xc(hA(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new Rft(e.type);return e2([e],[t])}async function q9e(e,t){const{address:n,abi:r,args:s,eventName:a,fromBlock:o,strict:l,toBlock:c}=t,u=cB(e,{method:"eth_newFilter"}),d=a?Pk({abi:r,args:s,eventName:a}):void 0,f=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof o=="bigint"?Os(o):o,toBlock:typeof c=="bigint"?Os(c):c,topics:d}]});return{abi:r,args:s,eventName:a,id:f,request:u(f),strict:!!l,type:"event"}}async function G9e(e,{address:t,args:n,event:r,events:s,fromBlock:a,strict:o,toBlock:l}={}){const c=s??(r?[r]:void 0),u=cB(e,{method:"eth_newFilter"});let d=[];c&&(d=[c.flatMap(g=>Pk({abi:[g],eventName:g.name,args:n}))],r&&(d=d[0]));const f=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof a=="bigint"?Os(a):a,toBlock:typeof l=="bigint"?Os(l):l,...d.length?{topics:d}:{}}]});return{abi:c,args:n,eventName:r?r.name:void 0,fromBlock:a,id:f,request:u(f),strict:!!o,toBlock:l,type:"event"}}async function K9e(e){const t=cB(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function Lft(e,t){const{abi:n,address:r,args:s,functionName:a,dataSuffix:o,...l}=t,c=xm({abi:n,args:s,functionName:a});try{return await Zs(e,uie,"estimateGas")({data:`${c}${o?o.replace("0x",""):""}`,to:r,...l})}catch(u){const d=l.account?Ou(l.account):void 0;throw g3(u,{abi:n,address:r,args:s,docsPath:"/docs/contract/estimateContractGas",functionName:a,sender:d==null?void 0:d.address})}}async function Dft(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}const Bft=new Map,$ft=new Map;function Uft(e){const t=(s,a)=>({clear:()=>a.delete(s),get:()=>a.get(s),set:o=>a.set(s,o)}),n=t(e,Bft),r=t(e,$ft);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function zft(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=Uft(t),s=r.response.get();if(s&&n>0&&new Date().getTime()-s.created.getTime()<n)return s.data;let a=r.promise.get();a||(a=e(),r.promise.set(a));try{const o=await a;return r.response.set({created:new Date,data:o}),o}finally{r.promise.clear()}}const Hft=e=>`blockNumber.${e}`;async function Fk(e,{cacheTime:t=e.cacheTime}={}){const n=await zft(()=>e.request({method:"eth_blockNumber"}),{cacheKey:Hft(e.uid),cacheTime:t});return BigInt(n)}async function Vft(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const s=n!==void 0?Os(n):void 0;let a;return t?a=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):a=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||r]},{dedupe:!!s}),W0(a)}async function Epe(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=n!==void 0?Os(n):void 0,a=await e.request({method:"eth_getCode",params:[t,s||r]},{dedupe:!!s});if(a!=="0x")return a}function yie(e,t){if(!Jl(e,{strict:!1}))throw new ld({address:e});if(!Jl(t,{strict:!1}))throw new ld({address:t});return e.toLowerCase()===t.toLowerCase()}const _pe="/docs/contract/decodeEventLog";function vie(e){const{abi:t,data:n,strict:r,topics:s}=e,a=r??!0,[o,...l]=s;if(!o)throw new pct({docsPath:_pe});const c=t.length===1?t[0]:t.find(w=>w.type==="event"&&o===iB(lm(w)));if(!(c&&"name"in c)||c.type!=="event")throw new Tje(o,{docsPath:_pe});const{name:u,inputs:d}=c,f=d==null?void 0:d.some(w=>!("name"in w&&w.name));let x=f?[]:{};const g=d.filter(w=>"indexed"in w&&w.indexed);for(let w=0;w<g.length;w++){const C=g[w],N=l[w];if(!N)throw new YD({abiItem:c,param:C});x[f?w:C.name||w]=Wft({param:C,value:N})}const v=d.filter(w=>!("indexed"in w&&w.indexed));if(v.length>0){if(n&&n!=="0x")try{const w=Tk(v,n);if(w)if(f)x=[...x,...w];else for(let C=0;C<v.length;C++)x[v[C].name]=w[C]}catch(w){if(a)throw w instanceof _je||w instanceof Wje?new F9({abiItem:c,data:n,params:v,size:el(n)}):w}else if(a)throw new F9({abiItem:c,data:"0x",params:v,size:0})}return{eventName:u,args:Object.values(x).length>0?x:void 0}}function Wft({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:Tk([e],t)[0]}function wie(e){const{abi:t,args:n,logs:r,strict:s=!0}=e,a=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})();return r.map(o=>{var l;try{const c=t.find(d=>d.type==="event"&&o.topics[0]===iB(d));if(!c)return null;const u=vie({...o,abi:[c],strict:s});return a&&!a.includes(u.eventName)||!qft({args:u.args,inputs:c.inputs,matchArgs:n})?null:{...u,...o}}catch(c){let u,d;if(c instanceof Tje)return null;if(c instanceof F9||c instanceof YD){if(s)return null;u=c.abiItem.name,d=(l=c.abiItem.inputs)==null?void 0:l.some(f=>!("name"in f&&f.name))}return{...o,args:d?[]:{},eventName:u}}}).filter(Boolean)}function qft(e){const{args:t,inputs:n,matchArgs:r}=e;if(!r)return!0;if(!t)return!1;function s(a,o,l){try{return a.type==="address"?yie(o,l):a.type==="string"||a.type==="bytes"?Xc(hA(o))===l:o===l}catch{return!1}}return Array.isArray(t)&&Array.isArray(r)?r.every((a,o)=>{if(a==null)return!0;const l=n[o];return l?(Array.isArray(a)?a:[a]).some(u=>s(l,u,t[o])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).every(([a,o])=>{if(o==null)return!0;const l=n.find(u=>u.name===a);return l?(Array.isArray(o)?o:[o]).some(u=>s(l,u,t[a])):!1}):!1}function Jg(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}async function Cie(e,{address:t,blockHash:n,fromBlock:r,toBlock:s,event:a,events:o,args:l,strict:c}={}){const u=c??!1,d=o??(a?[a]:void 0);let f=[];d&&(f=[d.flatMap(w=>Pk({abi:[w],eventName:w.name,args:o?void 0:l}))],a&&(f=f[0]));let x;n?x=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,blockHash:n}]}):x=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,fromBlock:typeof r=="bigint"?Os(r):r,toBlock:typeof s=="bigint"?Os(s):s}]});const g=x.map(v=>Jg(v));return d?wie({abi:d,args:l,logs:g,strict:u}):g}async function Y9e(e,t){const{abi:n,address:r,args:s,blockHash:a,eventName:o,fromBlock:l,toBlock:c,strict:u}=t,d=o?t5({abi:n,name:o}):void 0,f=d?void 0:n.filter(x=>x.type==="event");return Zs(e,Cie,"getLogs")({address:r,args:s,blockHash:a,event:d,events:f,fromBlock:l,toBlock:c,strict:u})}class Gft extends Or{constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function Kft(e,t){const{address:n,factory:r,factoryData:s}=t;try{const[a,o,l,c,u,d,f]=await Zs(e,q0,"readContract")({abi:Yft,address:n,functionName:"eip712Domain",factory:r,factoryData:s});return{domain:{name:o,version:l,chainId:Number(c),verifyingContract:u,salt:d},extensions:f,fields:a}}catch(a){const o=a;throw o.name==="ContractFunctionExecutionError"&&o.cause.name==="ContractFunctionZeroDataError"?new Gft({address:n}):o}}const Yft=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];function Xft(e){var t;return{baseFeePerGas:e.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:(t=e.reward)==null?void 0:t.map(n=>n.map(r=>BigInt(r)))}}async function Qft(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:s}){const a=n?Os(n):void 0,o=await e.request({method:"eth_feeHistory",params:[Os(t),a||r,s]},{dedupe:!!a});return Xft(o)}async function uB(e,{filter:t}){const n="strict"in t&&t.strict,r=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof r[0]=="string")return r;const s=r.map(a=>Jg(a));return!("abi"in t)||!t.abi?s:wie({abi:t.abi,logs:s,strict:n})}async function Zft(e,{filter:t}){const n=t.strict??!1,s=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(a=>Jg(a));return t.abi?wie({abi:t.abi,logs:s,strict:n}):s}async function Jft(e,{address:t,blockNumber:n,blockTag:r="latest",slot:s}){const a=n!==void 0?Os(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,s,a||r]})}async function Sie(e,{blockHash:t,blockNumber:n,blockTag:r,hash:s,index:a}){var d,f,x;const o=r||"latest",l=n!==void 0?Os(n):void 0;let c=null;if(s?c=await e.request({method:"eth_getTransactionByHash",params:[s]},{dedupe:!0}):t?c=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,Os(a)]},{dedupe:!0}):(l||o)&&(c=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[l||o,Os(a)]},{dedupe:!!l})),!c)throw new Xje({blockHash:t,blockNumber:n,blockTag:o,hash:s,index:a});return(((x=(f=(d=e.chain)==null?void 0:d.formatters)==null?void 0:f.transaction)==null?void 0:x.format)||sB)(c)}async function eht(e,{hash:t,transactionReceipt:n}){const[r,s]=await Promise.all([Zs(e,Fk,"getBlockNumber")({}),t?Zs(e,Sie,"getTransaction")({hash:t}):void 0]),a=(n==null?void 0:n.blockNumber)||(s==null?void 0:s.blockNumber);return a?r-a+1n:0n}const tht={"0x0":"reverted","0x1":"success"};function X9e(e){const t={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(n=>Jg(n)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?W0(e.transactionIndex):null,status:e.status?tht[e.status]:null,type:e.type?Jje[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const nht=rie("transactionReceipt",X9e);async function NZ(e,{hash:t}){var s,a,o;const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new Qje({hash:t});return(((o=(a=(s=e.chain)==null?void 0:s.formatters)==null?void 0:a.transactionReceipt)==null?void 0:o.format)||X9e)(n)}async function Q9e(e,t){var C;const{allowFailure:n=!0,batchSize:r,blockNumber:s,blockTag:a,multicallAddress:o,stateOverride:l}=t,c=t.contracts,u=r??(typeof((C=e.batch)==null?void 0:C.multicall)=="object"&&e.batch.multicall.batchSize||1024);let d=o;if(!d){if(!e.chain)throw new Error("client chain not configured. multicallAddress is required.");d=xA({blockNumber:s,chain:e.chain,contract:"multicall3"})}const f=[[]];let x=0,g=0;for(let N=0;N<c.length;N++){const{abi:I,address:P,args:R,functionName:F}=c[N];try{const U=xm({abi:I,args:R,functionName:F});g+=(U.length-2)/2,u>0&&g>u&&f[x].length>0&&(x++,g=(U.length-2)/2,f[x]=[]),f[x]=[...f[x],{allowFailure:!0,callData:U,target:P}]}catch(U){const L=g3(U,{abi:I,address:P,args:R,docsPath:"/docs/contract/multicall",functionName:F});if(!n)throw L;f[x]=[...f[x],{allowFailure:!0,callData:"0x",target:P}]}}const v=await Promise.allSettled(f.map(N=>Zs(e,q0,"readContract")({abi:mZ,address:d,args:[N],blockNumber:s,blockTag:a,functionName:"aggregate3",stateOverride:l}))),w=[];for(let N=0;N<v.length;N++){const I=v[N];if(I.status==="rejected"){if(!n)throw I.reason;for(let R=0;R<f[N].length;R++)w.push({status:"failure",error:I.reason,result:void 0});continue}const P=I.value;for(let R=0;R<P.length;R++){const{returnData:F,success:U}=P[R],{callData:L}=f[N][R],{abi:z,address:X,functionName:ne,args:J}=c[w.length];try{if(L==="0x")throw new Nk;if(!U)throw new aB({data:F});const Z=n5({abi:z,args:J,data:F,functionName:ne});w.push(n?{result:Z,status:"success"}:Z)}catch(Z){const re=g3(Z,{abi:z,address:X,args:J,docsPath:"/docs/contract/multicall",functionName:ne});if(!n)throw re;w.push({error:re,result:void 0,status:"failure"})}}}if(w.length!==c.length)throw new Or("multicall results mismatch");return w}const rht="0.1.1";function sht(){return rht}let vl=class AZ extends Error{constructor(t,n={}){const r=(()=>{var c;if(n.cause instanceof AZ){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),s=n.cause instanceof AZ&&n.cause.docsPath||n.docsPath,o=`https://oxlib.sh${s??""}`,l=[t||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||s?["",r?`Details: ${r}`:void 0,s?`See: ${o}`:void 0]:[]].filter(c=>typeof c=="string").join(`
`);super(l,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${sht()}`}),this.cause=n.cause,this.details=r,this.docs=o,this.docsPath=s,this.shortMessage=t}walk(t){return Z9e(this,t)}};function Z9e(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?Z9e(e.cause,t):t?null:e}const iht="#__bigint";function aht(e,t,n){return JSON.stringify(e,(r,s)=>typeof s=="bigint"?s.toString()+iht:s,n)}function oht(e,t){if(Tpe(e)>t)throw new ght({givenSize:Tpe(e),maxSize:t})}const Ox={zero:48,nine:57,A:65,F:70,a:97,f:102};function kpe(e){if(e>=Ox.zero&&e<=Ox.nine)return e-Ox.zero;if(e>=Ox.A&&e<=Ox.F)return e-(Ox.A-10);if(e>=Ox.a&&e<=Ox.f)return e-(Ox.a-10)}function lht(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new bht({size:e.length,targetSize:r,type:"Bytes"});const s=new Uint8Array(r);for(let a=0;a<r;a++){const o=n==="right";s[o?a:r-a-1]=e[o?a:e.length-a-1]}return s}function Nie(e,t){if(Jh(e)>t)throw new Sht({givenSize:Jh(e),maxSize:t})}function cht(e,t){if(typeof t=="number"&&t>0&&t>Jh(e)-1)throw new rEe({offset:t,position:"start",size:Jh(e)})}function uht(e,t,n){if(typeof t=="number"&&typeof n=="number"&&Jh(e)!==n-t)throw new rEe({offset:n,position:"end",size:Jh(e)})}function J9e(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;const s=e.replace("0x","");if(s.length>r*2)throw new Nht({size:Math.ceil(s.length/2),targetSize:r,type:"Hex"});return`0x${s[n==="right"?"padEnd":"padStart"](r*2,"0")}`}const dht=new TextEncoder;function fht(e){return e instanceof Uint8Array?e:typeof e=="string"?pht(e):hht(e)}function hht(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function pht(e,t={}){const{size:n}=t;let r=e;n&&(Nie(e,n),r=y3(e,n));let s=r.slice(2);s.length%2&&(s=`0${s}`);const a=s.length/2,o=new Uint8Array(a);for(let l=0,c=0;l<a;l++){const u=kpe(s.charCodeAt(c++)),d=kpe(s.charCodeAt(c++));if(u===void 0||d===void 0)throw new vl(`Invalid byte sequence ("${s[c-2]}${s[c-1]}" in "${s}").`);o[l]=u*16+d}return o}function mht(e,t={}){const{size:n}=t,r=dht.encode(e);return typeof n=="number"?(oht(r,n),xht(r,n)):r}function xht(e,t){return lht(e,{dir:"right",size:t})}function Tpe(e){return e.length}let ght=class extends vl{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},bht=class extends vl{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};const yht=new TextEncoder,vht=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function wht(e,t={}){const{strict:n=!1}=t;if(!e)throw new Ipe(e);if(typeof e!="string")throw new Ipe(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new Ppe(e);if(!e.startsWith("0x"))throw new Ppe(e)}function G0(...e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function eEe(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(Nie(n,t.size),b3(n,t.size)):n}function tEe(e,t={}){let n="";for(let s=0;s<e.length;s++)n+=vht[e[s]];const r=`0x${n}`;return typeof t.size=="number"?(Nie(r,t.size),y3(r,t.size)):r}function Yu(e,t={}){const{signed:n,size:r}=t,s=BigInt(e);let a;r?n?a=(1n<<BigInt(r)*8n-1n)-1n:a=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(a=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof a=="bigint"&&n?-a-1n:0;if(a&&s>a||s<o){const u=typeof e=="bigint"?"n":"";throw new nEe({max:a?`${a}${u}`:void 0,min:`${o}${u}`,signed:n,size:r,value:`${e}${u}`})}const c=`0x${(n&&s<0?(1n<<BigInt(r*8))+BigInt(s):s).toString(16)}`;return r?b3(c,r):c}function Aie(e,t={}){return tEe(yht.encode(e),t)}function b3(e,t){return J9e(e,{dir:"left",size:t})}function y3(e,t){return J9e(e,{dir:"right",size:t})}function jie(e,t,n,r={}){const{strict:s}=r;cht(e,t);const a=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return s&&uht(a,t,n),a}function Jh(e){return Math.ceil((e.length-2)/2)}function Cht(e,t={}){const{strict:n=!1}=t;try{return wht(e,{strict:n}),!0}catch{return!1}}class nEe extends vl{constructor({max:t,min:n,signed:r,size:s,value:a}){super(`Number \`${a}\` is not in safe${s?` ${s*8}-bit`:""}${r?" signed":" unsigned"} integer range ${t?`(\`${n}\` to \`${t}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class Ipe extends vl{constructor(t){super(`Value \`${typeof t=="object"?aht(t):t}\` of type \`${typeof t}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class Ppe extends vl{constructor(t){super(`Value \`${t}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class Sht extends vl{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class rEe extends vl{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset \`${t}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class Nht extends vl{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function Aht(e){return{address:e.address,amount:Yu(e.amount),index:Yu(e.index),validatorIndex:Yu(e.validatorIndex)}}function jht(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:Yu(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:Yu(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:Yu(e.gasLimit)},...typeof e.number=="bigint"&&{number:Yu(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:Yu(e.prevRandao)},...typeof e.time=="bigint"&&{time:Yu(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(Aht)}}}async function jZ(e,t){const{blockNumber:n,blockTag:r="latest",blocks:s,returnFullTransactions:a,traceTransfers:o,validation:l}=t;try{const c=[];for(const x of s){const g=x.blockOverrides?jht(x.blockOverrides):void 0,v=x.calls.map(C=>{const N=C,I=N.account?Ou(N.account):void 0,P={...N,data:N.abi?xm(N):N.data,from:N.from??(I==null?void 0:I.address)};return pA(P),kk(P)}),w=x.stateOverrides?lie(x.stateOverrides):void 0;c.push({blockOverrides:g,calls:v,stateOverrides:w})}const d=(n?Os(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:c,returnFullTransactions:a,traceTransfers:o,validation:l},d]})).map((x,g)=>({...aie(x),calls:x.calls.map((v,w)=>{var ne,J;const{abi:C,args:N,functionName:I,to:P}=s[g].calls[w],R=((ne=v.error)==null?void 0:ne.data)??v.returnData,F=BigInt(v.gasUsed),U=(J=v.logs)==null?void 0:J.map(Z=>Jg(Z)),L=v.status==="0x1"?"success":"failure",z=C&&L==="success"&&R!=="0x"?n5({abi:C,data:R,functionName:I}):null,X=(()=>{var re;if(L==="success")return;let Z;if(((re=v.error)==null?void 0:re.data)==="0x"?Z=new Nk:v.error&&(Z=new aB(v.error)),!!Z)return g3(Z,{abi:C??[],address:P,args:N,functionName:I??"<unknown>"})})();return{data:R,gasUsed:F,logs:U,status:L,...L==="success"?{result:z}:{error:X}}})}))}catch(c){const u=c,d=tB(u,{});throw d instanceof Ek?u:d}}function Fpe(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Eht(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Eie(e,...t){if(!Eht(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 Ope(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 _ht(e,t){Eie(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const kht=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Mpe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Tht=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function Rpe(e){for(let t=0;t<e.length;t++)e[t]=Tht(e[t])}function Iht(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function sEe(e){return typeof e=="string"&&(e=Iht(e)),Eie(e),e}let Pht=class{clone(){return this._cloneInto()}};function Fht(e){const t=r=>e().update(sEe(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const OI=BigInt(2**32-1),Lpe=BigInt(32);function Oht(e,t=!1){return t?{h:Number(e&OI),l:Number(e>>Lpe&OI)}:{h:Number(e>>Lpe&OI)|0,l:Number(e&OI)|0}}function Mht(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:a,l:o}=Oht(e[s],t);[n[s],r[s]]=[a,o]}return[n,r]}const Rht=(e,t,n)=>e<<n|t>>>32-n,Lht=(e,t,n)=>t<<n|e>>>32-n,Dht=(e,t,n)=>t<<n-32|e>>>64-n,Bht=(e,t,n)=>e<<n-32|t>>>64-n,iEe=[],aEe=[],oEe=[],$ht=BigInt(0),b7=BigInt(1),Uht=BigInt(2),zht=BigInt(7),Hht=BigInt(256),Vht=BigInt(113);for(let e=0,t=b7,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],iEe.push(2*(5*r+n)),aEe.push((e+1)*(e+2)/2%64);let s=$ht;for(let a=0;a<7;a++)t=(t<<b7^(t>>zht)*Vht)%Hht,t&Uht&&(s^=b7<<(b7<<BigInt(a))-b7);oEe.push(s)}const[Wht,qht]=Mht(oEe,!0),Dpe=(e,t,n)=>n>32?Dht(e,t,n):Rht(e,t,n),Bpe=(e,t,n)=>n>32?Bht(e,t,n):Lht(e,t,n);function Ght(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const l=(o+8)%10,c=(o+2)%10,u=n[c],d=n[c+1],f=Dpe(u,d,1)^n[l],x=Bpe(u,d,1)^n[l+1];for(let g=0;g<50;g+=10)e[o+g]^=f,e[o+g+1]^=x}let s=e[2],a=e[3];for(let o=0;o<24;o++){const l=aEe[o],c=Dpe(s,a,l),u=Bpe(s,a,l),d=iEe[o];s=e[d],a=e[d+1],e[d]=c,e[d+1]=u}for(let o=0;o<50;o+=10){for(let l=0;l<10;l++)n[l]=e[o+l];for(let l=0;l<10;l++)e[o+l]^=~n[(l+2)%10]&n[(l+4)%10]}e[0]^=Wht[r],e[1]^=qht[r]}n.fill(0)}let Kht=class lEe extends Pht{constructor(t,n,r,s=!1,a=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Fpe(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=kht(this.state)}keccak(){Mpe||Rpe(this.state32),Ght(this.state32,this.rounds),Mpe||Rpe(this.state32),this.posOut=0,this.pos=0}update(t){Ope(this);const{blockLen:n,state:r}=this;t=sEe(t);const s=t.length;for(let a=0;a<s;){const o=Math.min(n-this.pos,s-a);for(let l=0;l<o;l++)r[this.pos++]^=t[a++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){Ope(this,!1),Eie(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,a=t.length;s<a;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,a-s);t.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Fpe(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(_ht(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:a,enableXOF:o}=this;return t||(t=new lEe(n,r,s,o,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=s,t.enableXOF=o,t.destroyed=this.destroyed,t}};const Yht=(e,t,n)=>Fht(()=>new Kht(t,e,n)),Xht=Yht(1,136,256/8);function cEe(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=Xht(fht(e));return n==="Bytes"?r:tEe(r)}class Qht extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const Zht={checksum:new Qht(8192)},rH=Zht.checksum,Jht=/^0x[a-fA-F0-9]{40}$/;function dB(e,t={}){const{strict:n=!0}=t;if(!Jht.test(e))throw new $pe({address:e,cause:new tpt});if(n){if(e.toLowerCase()===e)return;if(ept(e)!==e)throw new $pe({address:e,cause:new npt})}}function ept(e){if(rH.has(e))return rH.get(e);dB(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=cEe(mht(t),{as:"Bytes"}),r=t.split("");for(let a=0;a<40;a+=2)n[a>>1]>>4>=8&&r[a]&&(r[a]=r[a].toUpperCase()),(n[a>>1]&15)>=8&&r[a+1]&&(r[a+1]=r[a+1].toUpperCase());const s=`0x${r.join("")}`;return rH.set(e,s),s}function EZ(e,t={}){const{strict:n=!0}=t??{};try{return dB(e,{strict:n}),!0}catch{return!1}}let $pe=class extends vl{constructor({address:t,cause:n}){super(`Address "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}},tpt=class extends vl{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}};class npt extends vl{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}function _Z(e){let t=!0,n="",r=0,s="",a=!1;for(let o=0;o<e.length;o++){const l=e[o];if(["(",")",","].includes(l)&&(t=!0),l==="("&&r++,l===")"&&r--,!!t){if(r===0){if(l===" "&&["event","function","error",""].includes(s))s="";else if(s+=l,l===")"){a=!0;break}continue}if(l===" "){e[o-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}s+=l,n+=l}}if(!a)throw new vl("Unable to normalize signature.");return s}function kZ(e,t){const n=typeof e,r=t.type;switch(r){case"address":return EZ(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((s,a)=>kZ(Object.values(e)[a],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(s=>kZ(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function uEe(e,t,n){for(const r in e){const s=e[r],a=t[r];if(s.type==="tuple"&&a.type==="tuple"&&"components"in s&&"components"in a)return uEe(s.components,a.components,n[r]);const o=[s.type,a.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?EZ(n[r],{strict:!1}):o.includes("address")&&o.includes("bytes")?EZ(n[r],{strict:!1}):!1)return o}}function dEe(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?wpe(e):e;return{...r,...n?{hash:PC(r)}:{}}}function rpt(e,t,n){const{args:r=[],prepare:s=!0}=n,a=Cht(t,{strict:!1}),o=e.filter(u=>a?u.type==="function"||u.type==="error"?fEe(u)===jie(t,0,4):u.type==="event"?PC(u)===t:!1:"name"in u&&u.name===t);if(o.length===0)throw new TZ({name:t});if(o.length===1)return{...o[0],...s?{hash:PC(o[0])}:{}};let l;for(const u of o){if(!("inputs"in u))continue;if(!r||r.length===0){if(!u.inputs||u.inputs.length===0)return{...u,...s?{hash:PC(u)}:{}};continue}if(!u.inputs||u.inputs.length===0||u.inputs.length!==r.length)continue;if(r.every((f,x)=>{const g="inputs"in u&&u.inputs[x];return g?kZ(f,g):!1})){if(l&&"inputs"in l&&l.inputs){const f=uEe(u.inputs,l.inputs,r);if(f)throw new ipt({abiItem:u,type:f[0]},{abiItem:l,type:f[1]})}l=u}}const c=(()=>{if(l)return l;const[u,...d]=o;return{...u,overloads:d}})();if(!c)throw new TZ({name:t});return{...c,...s?{hash:PC(c)}:{}}}function fEe(e){return jie(PC(e),0,4)}function spt(e){const t=typeof e=="string"?e:rM(e);return _Z(t)}function PC(e){return typeof e!="string"&&"hash"in e&&e.hash?e.hash:cEe(Aie(spt(e)))}class ipt extends vl{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${_Z(rM(t.abiItem))}\`, and`,`\`${n.type}\` in \`${_Z(rM(n.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class TZ extends vl{constructor({name:t,data:n,type:r="item"}){const s=t?` with name "${t}"`:n?` with data "${n}"`:"";super(`ABI ${r}${s} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}const apt=/^(.*)\[([0-9]*)\]$/,opt=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,hEe=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function lpt({checksumAddress:e,parameters:t,values:n}){const r=[];for(let s=0;s<t.length;s++)r.push(_ie({checksumAddress:e,parameter:t[s],value:n[s]}));return r}function _ie({checksumAddress:e=!1,parameter:t,value:n}){const r=t,s=xpt(r.type);if(s){const[a,o]=s;return upt(n,{checksumAddress:e,length:a,parameter:{...r,type:o}})}if(r.type==="tuple")return mpt(n,{checksumAddress:e,parameter:r});if(r.type==="address")return cpt(n,{checksum:e});if(r.type==="bool")return fpt(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const a=r.type.startsWith("int"),[,,o="256"]=hEe.exec(r.type)??[];return hpt(n,{signed:a,size:Number(o)})}if(r.type.startsWith("bytes"))return dpt(n,{type:r.type});if(r.type==="string")return ppt(n);throw new bEe(r.type)}function kie(e){let t=0;for(let a=0;a<e.length;a++){const{dynamic:o,encoded:l}=e[a];o?t+=32:t+=Jh(l)}const n=[],r=[];let s=0;for(let a=0;a<e.length;a++){const{dynamic:o,encoded:l}=e[a];o?(n.push(Yu(t+s,{size:32})),r.push(l),s+=Jh(l)):n.push(l)}return G0(...n,...r)}function cpt(e,t){const{checksum:n=!1}=t;return dB(e,{strict:n}),{dynamic:!1,encoded:b3(e.toLowerCase())}}function upt(e,t){const{checksumAddress:n,length:r,parameter:s}=t,a=r===null;if(!Array.isArray(e))throw new bpt(e);if(!a&&e.length!==r)throw new gpt({expectedLength:r,givenLength:e.length,type:`${s.type}[${r}]`});let o=!1;const l=[];for(let c=0;c<e.length;c++){const u=_ie({checksumAddress:n,parameter:s,value:e[c]});u.dynamic&&(o=!0),l.push(u)}if(a||o){const c=kie(l);if(a){const u=Yu(l.length,{size:32});return{dynamic:!0,encoded:l.length>0?G0(u,c):u}}if(o)return{dynamic:!0,encoded:c}}return{dynamic:!1,encoded:G0(...l.map(({encoded:c})=>c))}}function dpt(e,{type:t}){const[,n]=t.split("bytes"),r=Jh(e);if(!n){let s=e;return r%32!==0&&(s=y3(s,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:G0(b3(Yu(r,{size:32})),s)}}if(r!==Number.parseInt(n))throw new xEe({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:y3(e)}}function fpt(e){if(typeof e!="boolean")throw new vl(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:b3(eEe(e))}}function hpt(e,{signed:t,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-r-1n:0n;if(e>r||e<s)throw new nEe({max:r.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:Yu(e,{size:32,signed:t})}}function ppt(e){const t=Aie(e),n=Math.ceil(Jh(t)/32),r=[];for(let s=0;s<n;s++)r.push(y3(jie(t,s*32,(s+1)*32)));return{dynamic:!0,encoded:G0(y3(Yu(Jh(t),{size:32})),...r)}}function mpt(e,t){const{checksumAddress:n,parameter:r}=t;let s=!1;const a=[];for(let o=0;o<r.components.length;o++){const l=r.components[o],c=Array.isArray(e)?o:l.name,u=_ie({checksumAddress:n,parameter:l,value:e[c]});a.push(u),u.dynamic&&(s=!0)}return{dynamic:s,encoded:s?kie(a):G0(...a.map(({encoded:o})=>o))}}function xpt(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function pEe(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new gEe({expectedLength:e.length,givenLength:t.length});const s=lpt({checksumAddress:r,parameters:e,values:t}),a=kie(s);return a.length===0?"0x":a}function mEe(e,t){if(e.length!==t.length)throw new gEe({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const s=e[r],a=t[r];n.push(mEe.encode(s,a))}return G0(...n)}(function(e){function t(n,r,s=!1){if(n==="address"){const c=r;return dB(c),b3(c.toLowerCase(),s?32:0)}if(n==="string")return Aie(r);if(n==="bytes")return r;if(n==="bool")return b3(eEe(r),s?32:1);const a=n.match(hEe);if(a){const[c,u,d="256"]=a,f=Number.parseInt(d)/8;return Yu(r,{size:s?32:f,signed:u==="int"})}const o=n.match(opt);if(o){const[c,u]=o;if(Number.parseInt(u)!==(r.length-2)/2)throw new xEe({expectedSize:Number.parseInt(u),value:r});return y3(r,s?32:0)}const l=n.match(apt);if(l&&Array.isArray(r)){const[c,u]=l,d=[];for(let f=0;f<r.length;f++)d.push(t(u,r[f],!0));return d.length===0?"0x":G0(...d)}throw new bEe(n)}e.encode=t})(mEe);class gpt extends vl{constructor({expectedLength:t,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${t}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class xEe extends vl{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${Jh(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class gEe extends vl{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${n}`].join(`
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class bpt extends vl{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class bEe extends vl{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}function ypt(e,t){var s;const{bytecode:n,args:r}=t;return G0(n,(s=e.inputs)!=null&&s.length&&(r!=null&&r.length)?pEe(e.inputs,r):"0x")}function vpt(e){return dEe(e)}function wpt(e,...t){const{overloads:n}=e,r=n?Cpt([e,...n],e.name,{args:t[0]}):e,s=Spt(r),a=t.length>0?pEe(r.inputs,t[0]):void 0;return a?G0(s,a):s}function R6(e,t={}){return dEe(e,t)}function Cpt(e,t,n){const r=rpt(e,t,n);if(r.type!=="function")throw new TZ({name:t,type:"function"});return r}function Spt(e){return fEe(e)}const Npt="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",zm="0x0000000000000000000000000000000000000000",MI=new XD(8192);function Apt(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(MI.get(n))return MI.get(n);const r=e().finally(()=>MI.delete(n));return MI.set(n,r),r}async function IZ(e){return new Promise(t=>setTimeout(t,e))}function sM(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((s,a)=>{const o=async({count:l=0}={})=>{const c=async({error:u})=>{const d=typeof t=="function"?t({count:l,error:u}):t;d&&await IZ(d),o({count:l+1})};try{const u=await e();s(u)}catch(u){if(l<n&&await r({count:l,error:u}))return c({error:u});a(u)}};o()})}function jpt(e,t={}){return async(n,r={})=>{var f;const{dedupe:s=!1,methods:a,retryDelay:o=150,retryCount:l=3,uid:c}={...t,...r},{method:u}=n;if((f=a==null?void 0:a.exclude)!=null&&f.includes(u))throw new zv(new Error("method not supported"),{method:u});if(a!=null&&a.include&&!a.include.includes(u))throw new zv(new Error("method not supported"),{method:u});const d=s?kS(`${c}.${jc(n)}`):void 0;return Apt(()=>sM(async()=>{try{return await e(n)}catch(x){const g=x;switch(g.code){case M9.code:throw new M9(g);case R9.code:throw new R9(g);case L9.code:throw new L9(g,{method:n.method});case D9.code:throw new D9(g);case p3.code:throw new p3(g);case m3.code:throw new m3(g);case B9.code:throw new B9(g);case by.code:throw new by(g);case $9.code:throw new $9(g);case zv.code:throw new zv(g,{method:n.method});case PS.code:throw new PS(g);case U9.code:throw new U9(g);case mo.code:throw new mo(g);case z9.code:throw new z9(g);case H9.code:throw new H9(g);case V9.code:throw new V9(g);case W9.code:throw new W9(g);case Zh.code:throw new Zh(g);case q9.code:throw new q9(g);case G9.code:throw new G9(g);case K9.code:throw new K9(g);case Y9.code:throw new Y9(g);case X9.code:throw new X9(g);case Q9.code:throw new Q9(g);case Z9.code:throw new Z9(g);case 5e3:throw new mo(g);default:throw x instanceof Or?x:new Aut(g)}}},{delay:({count:x,error:g})=>{var v;if(g&&g instanceof zj){const w=(v=g==null?void 0:g.headers)==null?void 0:v.get("Retry-After");if(w!=null&&w.match(/\d/))return Number.parseInt(w)*1e3}return~~(1<<x)*o},retryCount:l,shouldRetry:({error:x})=>Ept(x)}),{enabled:s,id:d})}}function Ept(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===PS.code||e.code===p3.code:e instanceof zj&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}function fB(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}function Tie(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise((s,a)=>{(async()=>{let o;try{const l=new AbortController;n>0&&(o=setTimeout(()=>{r?l.abort():a(t)},n)),s(await e({signal:(l==null?void 0:l.signal)||null}))}catch(l){(l==null?void 0:l.name)==="AbortError"&&a(t),a(l)}finally{clearTimeout(o)}})()})}function _pt(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const Upe=_pt();function kpt(e,t={}){return{async request(n){var f;const{body:r,onRequest:s=t.onRequest,onResponse:a=t.onResponse,timeout:o=t.timeout??1e4}=n,l={...t.fetchOptions??{},...n.fetchOptions??{}},{headers:c,method:u,signal:d}=l;try{const x=await Tie(async({signal:v})=>{const w={...l,body:Array.isArray(r)?jc(r.map(P=>({jsonrpc:"2.0",id:P.id??Upe.take(),...P}))):jc({jsonrpc:"2.0",id:r.id??Upe.take(),...r}),headers:{"Content-Type":"application/json",...c},method:u||"POST",signal:d||(o>0?v:null)},C=new Request(e,w),N=await(s==null?void 0:s(C,w))??{...w,url:e};return await fetch(N.url??e,N)},{errorInstance:new upe({body:r,url:e}),timeout:o,signal:!0});a&&await a(x);let g;if((f=x.headers.get("Content-Type"))!=null&&f.startsWith("application/json"))g=await x.json();else{g=await x.text();try{g=JSON.parse(g||"{}")}catch(v){if(x.ok)throw v;g={error:g}}}if(!x.ok)throw new zj({body:r,details:jc(g.error)||x.statusText,headers:x.headers,status:x.status,url:e});return g}catch(x){throw x instanceof zj||x instanceof upe?x:new zj({body:r,cause:x,url:e})}}}}class Tpt extends Or{constructor({domain:t}){super(`Invalid domain "${jc(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class Ipt extends Or{constructor({primaryType:t,types:n}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class Ppt extends Or{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function Fpt(e){const{domain:t={},message:n,primaryType:r}=e,s={EIP712Domain:NEe({domain:t}),...e.types};SEe({domain:t,message:n,primaryType:r,types:s});const a=["0x1901"];return t&&a.push(Opt({domain:t,types:s})),r!=="EIP712Domain"&&a.push(yEe({data:n,primaryType:r,types:s})),Xc(Zg(a))}function Opt({domain:e,types:t}){return yEe({data:e,primaryType:"EIP712Domain",types:t})}function yEe({data:e,primaryType:t,types:n}){const r=vEe({data:e,primaryType:t,types:n});return Xc(r)}function vEe({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],s=[Mpt({primaryType:t,types:n})];for(const a of n[t]){const[o,l]=CEe({types:n,name:a.name,type:a.type,value:e[a.name]});r.push(o),s.push(l)}return e2(r,s)}function Mpt({primaryType:e,types:t}){const n=ri(Rpt({primaryType:e,types:t}));return Xc(n)}function Rpt({primaryType:e,types:t}){let n="";const r=wEe({primaryType:e,types:t});r.delete(e);const s=[e,...Array.from(r).sort()];for(const a of s)n+=`${a}(${t[a].map(({name:o,type:l})=>`${l} ${o}`).join(",")})`;return n}function wEe({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),s=r==null?void 0:r[0];if(n.has(s)||t[s]===void 0)return n;n.add(s);for(const a of t[s])wEe({primaryType:a.type,types:t},n);return n}function CEe({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},Xc(vEe({data:r,primaryType:n,types:e}))];if(n==="bytes")return r=`0x${(r.length%2?"0":"")+r.slice(2)}`,[{type:"bytes32"},Xc(r)];if(n==="string")return[{type:"bytes32"},Xc(ri(r))];if(n.lastIndexOf("]")===n.length-1){const s=n.slice(0,n.lastIndexOf("[")),a=r.map(o=>CEe({name:t,type:s,types:e,value:o}));return[{type:"bytes32"},Xc(e2(a.map(([o])=>o),a.map(([,o])=>o)))]}return[{type:n},r]}function Lpt(e){const{domain:t,message:n,primaryType:r,types:s}=e,a=(c,u)=>{const d={...u};for(const f of c){const{name:x,type:g}=f;g==="address"&&(d[x]=d[x].toLowerCase())}return d},o=s.EIP712Domain?t?a(s.EIP712Domain,t):{}:{},l=(()=>{if(r!=="EIP712Domain")return a(s[r],n)})();return jc({domain:o,message:l,primaryType:r,types:s})}function SEe(e){const{domain:t,message:n,primaryType:r,types:s}=e,a=(o,l)=>{for(const c of o){const{name:u,type:d}=c,f=l[u],x=d.match(Hje);if(x&&(typeof f=="number"||typeof f=="bigint")){const[w,C,N]=x;Os(f,{signed:C==="int",size:Number.parseInt(N)/8})}if(d==="address"&&typeof f=="string"&&!Jl(f))throw new ld({address:f});const g=d.match(Gct);if(g){const[w,C]=g;if(C&&el(f)!==Number.parseInt(C))throw new gct({expectedSize:Number.parseInt(C),givenSize:el(f)})}const v=s[d];v&&(Dpt(d),a(v,f))}};if(s.EIP712Domain&&t){if(typeof t!="object")throw new Tpt({domain:t});a(s.EIP712Domain,t)}if(r!=="EIP712Domain")if(s[r])a(s[r],n);else throw new Ipt({primaryType:r,types:s})}function NEe({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},(typeof(e==null?void 0:e.chainId)=="number"||typeof(e==null?void 0:e.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function Dpt(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new Ppt({type:e})}function Bpt(e){const{authorizationList:t}=e;if(t)for(const n of t){const{chainId:r}=n,s=n.address;if(!Jl(s))throw new ld({address:s});if(r<0)throw new eB({chainId:r})}Iie(e)}function $pt(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new o9e;for(const n of t){const r=el(n),s=W0(f3(n,0,1));if(r!==32)throw new Qut({hash:n,size:r});if(s!==a9e)throw new Zut({hash:n,version:s})}}Iie(e)}function Iie(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:s}=e;if(t<=0)throw new eB({chainId:t});if(s&&!Jl(s))throw new ld({address:s});if(r&&r>rB)throw new h3({maxFeePerGas:r});if(n&&r&&n>r)throw new O9({maxFeePerGas:r,maxPriorityFeePerGas:n})}function Upt(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:a}=e;if(t<=0)throw new eB({chainId:t});if(a&&!Jl(a))throw new ld({address:a});if(n||s)throw new Or("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>rB)throw new h3({maxFeePerGas:r})}function zpt(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:a}=e;if(a&&!Jl(a))throw new ld({address:a});if(typeof t<"u"&&t<=0)throw new eB({chainId:t});if(n||s)throw new Or("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>rB)throw new h3({maxFeePerGas:r})}function hB(e){if(!e||e.length===0)return[];const t=[];for(let n=0;n<e.length;n++){const{address:r,storageKeys:s}=e[n];for(let a=0;a<s.length;a++)if(s[a].length-2!==64)throw new vut({storageKey:s[a]});if(!Jl(r,{strict:!1}))throw new ld({address:r});t.push([r,s])}return t}function Hpt(e,t){const n=c9e(e);return n==="eip1559"?qpt(e,t):n==="eip2930"?Gpt(e,t):n==="eip4844"?Wpt(e,t):n==="eip7702"?Vpt(e,t):Kpt(e,t)}function Vpt(e,t){const{authorizationList:n,chainId:r,gas:s,nonce:a,to:o,value:l,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:d,data:f}=e;Bpt(e);const x=hB(d),g=Ypt(n);return mm(["0x04",My([ri(r),a?ri(a):"0x",u?ri(u):"0x",c?ri(c):"0x",s?ri(s):"0x",o??"0x",l?ri(l):"0x",f??"0x",x,g,...Ok(e,t)])])}function Wpt(e,t){const{chainId:n,gas:r,nonce:s,to:a,value:o,maxFeePerBlobGas:l,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:d,data:f}=e;$pt(e);let x=e.blobVersionedHashes,g=e.sidecars;if(e.blobs&&(typeof x>"u"||typeof g>"u")){const P=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(U=>Dl(U)),R=e.kzg,F=die({blobs:P,kzg:R});if(typeof x>"u"&&(x=r9e({commitments:F})),typeof g>"u"){const U=fie({blobs:P,commitments:F,kzg:R});g=l9e({blobs:P,commitments:F,proofs:U})}}const v=hB(d),w=[ri(n),s?ri(s):"0x",u?ri(u):"0x",c?ri(c):"0x",r?ri(r):"0x",a??"0x",o?ri(o):"0x",f??"0x",v,l?ri(l):"0x",x??[],...Ok(e,t)],C=[],N=[],I=[];if(g)for(let P=0;P<g.length;P++){const{blob:R,commitment:F,proof:U}=g[P];C.push(R),N.push(F),I.push(U)}return mm(["0x03",My(g?[w,C,N,I]:w)])}function qpt(e,t){const{chainId:n,gas:r,nonce:s,to:a,value:o,maxFeePerGas:l,maxPriorityFeePerGas:c,accessList:u,data:d}=e;Iie(e);const f=hB(u),x=[ri(n),s?ri(s):"0x",c?ri(c):"0x",l?ri(l):"0x",r?ri(r):"0x",a??"0x",o?ri(o):"0x",d??"0x",f,...Ok(e,t)];return mm(["0x02",My(x)])}function Gpt(e,t){const{chainId:n,gas:r,data:s,nonce:a,to:o,value:l,accessList:c,gasPrice:u}=e;Upt(e);const d=hB(c),f=[ri(n),a?ri(a):"0x",u?ri(u):"0x",r?ri(r):"0x",o??"0x",l?ri(l):"0x",s??"0x",d,...Ok(e,t)];return mm(["0x01",My(f)])}function Kpt(e,t){const{chainId:n=0,gas:r,data:s,nonce:a,to:o,value:l,gasPrice:c}=e;zpt(e);let u=[a?ri(a):"0x",c?ri(c):"0x",r?ri(r):"0x",o??"0x",l?ri(l):"0x",s??"0x"];if(t){const d=(()=>{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+t.v-27n);const g=27n+(t.v===27n?0n:1n);if(t.v!==g)throw new but({v:t.v});return g})(),f=Rf(t.r),x=Rf(t.s);u=[...u,ri(d),f==="0x00"?"0x":f,x==="0x00"?"0x":x]}else n>0&&(u=[...u,ri(n),"0x","0x"]);return My(u)}function Ok(e,t){const n=t??e,{v:r,yParity:s}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof r>"u"&&typeof s>"u")return[];const a=Rf(n.r),o=Rf(n.s);return[typeof s=="number"?s?ri(1):"0x":r===0n?"0x":r===1n?ri(1):r===27n?"0x":ri(1),a==="0x00"?"0x":a,o==="0x00"?"0x":o]}function Ypt(e){if(!e||e.length===0)return[];const t=[];for(const n of e){const{chainId:r,nonce:s,...a}=n,o=n.address;t.push([r?ri(r):"0x",o,s?ri(s):"0x",...Ok({},a)])}return t}const Xpt=`Ethereum Signed Message:
`;function Qpt(e){const t=typeof e=="string"?kS(e):typeof e.raw=="string"?e.raw:Dl(e.raw),n=kS(`${Xpt}${el(t)}`);return Zg([n,t])}function AEe(e,t){return Xc(Qpt(e),t)}const jEe="0x6492649264926492649264926492649264926492649264926492649264926492";function Zpt(e){return zje(e,-32)===jEe}function Jpt(e){const{address:t,data:n,signature:r,to:s="hex"}=e,a=mm([e2([{type:"address"},{type:"bytes"},{type:"bytes"}],[t,n,r]),jEe]);return s==="hex"?a:Qh(a)}class emt extends Or{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function tmt(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new emt({value:e});let[n,r="0"]=e.split(".");const s=n.startsWith("-");if(s&&(n=n.slice(1)),r=r.replace(/(0+)$/,""),t===0)Math.round(+`.${r}`)===1&&(n=`${BigInt(n)+1n}`),r="";else if(r.length>t){const[a,o,l]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],c=Math.round(+`${o}.${l}`);c>9?r=`${BigInt(a)+BigInt(1)}0`.padStart(a.length+1,"0"):r=`${a}${c}`,r.length>t&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,"0");return BigInt(`${s?"-":""}${n}${r}`)}const nmt="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function rmt(e,t){const{blockNumber:n,blockTag:r,calls:s,stateOverrides:a,traceAssetChanges:o,traceTransfers:l,validation:c}=t,u=t.account?Ou(t.account):void 0;if(o&&!u)throw new Or("`account` is required when `traceAssetChanges` is true");const d=u?ypt(vpt("constructor(bytes, bytes)"),{bytecode:R9e,args:[nmt,wpt(R6("function getBalance(address)"),[u.address])]}):void 0,f=o?await Promise.all(t.calls.map(async V=>{if(!V.data&&!V.abi)return;const{accessList:ee}=await W9e(e,{account:u.address,...V,data:V.abi?xm(V):V.data});return ee.map(({address:ae,storageKeys:fe})=>fe.length>0?ae:null)})).then(V=>V.flat().filter(Boolean)):[],x=a==null?void 0:a.map(V=>V.address===(u==null?void 0:u.address)?{...V,nonce:0}:V),g=await jZ(e,{blockNumber:n,blockTag:r,blocks:[...o?[{calls:[{data:d}],stateOverrides:a},{calls:f.map((V,ee)=>({abi:[R6("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:V,from:zm,nonce:ee})),stateOverrides:[{address:zm,nonce:0}]}]:[],{calls:[...s,{}].map((V,ee)=>({...V,from:u==null?void 0:u.address,nonce:ee})),stateOverrides:x},...o?[{calls:[{data:d}]},{calls:f.map((V,ee)=>({abi:[R6("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:V,from:zm,nonce:ee})),stateOverrides:[{address:zm,nonce:0}]},{calls:f.map((V,ee)=>({to:V,abi:[R6("function decimals() returns (uint256)")],functionName:"decimals",from:zm,nonce:ee})),stateOverrides:[{address:zm,nonce:0}]},{calls:f.map((V,ee)=>({to:V,abi:[R6("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:zm,nonce:ee})),stateOverrides:[{address:zm,nonce:0}]},{calls:f.map((V,ee)=>({to:V,abi:[R6("function symbol() returns (string)")],functionName:"symbol",from:zm,nonce:ee})),stateOverrides:[{address:zm,nonce:0}]}]:[]],traceTransfers:l,validation:c}),v=o?g[2]:g[0],[w,C,,N,I,P,R,F]=o?g:[],{calls:U,...L}=v,z=U.slice(0,-1)??[],X=(w==null?void 0:w.calls)??[],ne=(C==null?void 0:C.calls)??[],J=[...X,...ne].map(V=>V.status==="success"?Xu(V.data):null),Z=(N==null?void 0:N.calls)??[],re=(I==null?void 0:I.calls)??[],he=[...Z,...re].map(V=>V.status==="success"?Xu(V.data):null),Y=((P==null?void 0:P.calls)??[]).map(V=>V.status==="success"?V.result:null),ie=((F==null?void 0:F.calls)??[]).map(V=>V.status==="success"?V.result:null),oe=((R==null?void 0:R.calls)??[]).map(V=>V.status==="success"?V.result:null),G=[];for(const[V,ee]of he.entries()){const ae=J[V];if(typeof ee!="bigint"||typeof ae!="bigint")continue;const fe=Y[V-1],Ae=ie[V-1],ce=oe[V-1],ye=V===0?{address:Npt,decimals:18,symbol:"ETH"}:{address:f[V-1],decimals:ce||fe?Number(fe??1):void 0,symbol:Ae??void 0};G.some(Ne=>Ne.token.address===ye.address)||G.push({token:ye,value:{pre:ae,post:ee,diff:ee-ae}})}return{assetChanges:G,block:L,results:z}}const sH=new Map,zpe=new Map;let smt=0;function Ry(e,t,n){const r=++smt,s=()=>sH.get(e)||[],a=()=>{const d=s();sH.set(e,d.filter(f=>f.id!==r))},o=()=>{const d=s();if(!d.some(x=>x.id===r))return;const f=zpe.get(e);d.length===1&&f&&f(),a()},l=s();if(sH.set(e,[...l,{id:r,fns:t}]),l.length>0)return o;const c={};for(const d in t)c[d]=(...f)=>{var g,v;const x=s();if(x.length!==0)for(const w of x)(v=(g=w.fns)[d])==null||v.call(g,...f)};const u=n(c);return typeof u=="function"&&zpe.set(e,u),o}function Mk(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let s=!0;const a=()=>s=!1;return(async()=>{let l;t&&(l=await e({unpoll:a}));const c=await(n==null?void 0:n(l))??r;await IZ(c);const u=async()=>{s&&(await e({unpoll:a}),await IZ(r),u())};u()})(),a}function imt(e,{blockTag:t="latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:s,onError:a,includeTransactions:o,poll:l,pollingInterval:c=e.pollingInterval}){const u=typeof l<"u"?l:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"),d=o??!1;let f;return u?(()=>{const v=jc(["watchBlocks",e.uid,t,n,r,d,c]);return Ry(v,{onBlock:s,onError:a},w=>Mk(async()=>{var C;try{const N=await Zs(e,w0,"getBlock")({blockTag:t,includeTransactions:d});if(N.number&&(f!=null&&f.number)){if(N.number===f.number)return;if(N.number-f.number>1&&n)for(let I=(f==null?void 0:f.number)+1n;I<N.number;I++){const P=await Zs(e,w0,"getBlock")({blockNumber:I,includeTransactions:d});w.onBlock(P,f),f=P}}(!(f!=null&&f.number)||t==="pending"&&!(N!=null&&N.number)||N.number&&N.number>f.number)&&(w.onBlock(N,f),f=N)}catch(N){(C=w.onError)==null||C.call(w,N)}},{emitOnBegin:r,interval:c}))})():(()=>{let v=!0,w=!0,C=()=>v=!1;return(async()=>{try{r&&Zs(e,w0,"getBlock")({blockTag:t,includeTransactions:d}).then(P=>{v&&w&&(s(P,void 0),w=!1)});const N=(()=>{if(e.transport.type==="fallback"){const P=e.transport.transports.find(R=>R.config.type==="webSocket");return P?P.value:e.transport}return e.transport})(),{unsubscribe:I}=await N.subscribe({params:["newHeads"],async onData(P){if(!v)return;const R=await Zs(e,w0,"getBlock")({blockNumber:P.blockNumber,includeTransactions:d}).catch(()=>{});v&&(s(R,f),w=!1,f=R)},onError(P){a==null||a(P)}});C=I,v||C()}catch(N){a==null||a(N)}})(),()=>C()})()}function EEe(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:s,poll:a,pollingInterval:o=e.pollingInterval}){const l=typeof a<"u"?a:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket");let c;return l?(()=>{const f=jc(["watchBlockNumber",e.uid,t,n,o]);return Ry(f,{onBlockNumber:r,onError:s},x=>Mk(async()=>{var g;try{const v=await Zs(e,Fk,"getBlockNumber")({cacheTime:0});if(c){if(v===c)return;if(v-c>1&&n)for(let w=c+1n;w<v;w++)x.onBlockNumber(w,c),c=w}(!c||v>c)&&(x.onBlockNumber(v,c),c=v)}catch(v){(g=x.onError)==null||g.call(x,v)}},{emitOnBegin:t,interval:o}))})():(()=>{const f=jc(["watchBlockNumber",e.uid,t,n]);return Ry(f,{onBlockNumber:r,onError:s},x=>{let g=!0,v=()=>g=!1;return(async()=>{try{const w=(()=>{if(e.transport.type==="fallback"){const N=e.transport.transports.find(I=>I.config.type==="webSocket");return N?N.value:e.transport}return e.transport})(),{unsubscribe:C}=await w.subscribe({params:["newHeads"],onData(N){var P;if(!g)return;const I=Xu((P=N.result)==null?void 0:P.number);x.onBlockNumber(I,c),c=I},onError(N){var I;(I=x.onError)==null||I.call(x,N)}});v=C,g||v()}catch(w){s==null||s(w)}})(),()=>v()})})()}async function pB(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function amt(e,{address:t,args:n,batch:r=!0,event:s,events:a,fromBlock:o,onError:l,onLogs:c,poll:u,pollingInterval:d=e.pollingInterval,strict:f}){const x=typeof u<"u"?u:typeof o=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"),g=f??!1;return x?(()=>{const C=jc(["watchEvent",t,n,r,e.uid,s,d,o]);return Ry(C,{onLogs:c,onError:l},N=>{let I;o!==void 0&&(I=o-1n);let P,R=!1;const F=Mk(async()=>{var U;if(!R){try{P=await Zs(e,G9e,"createEventFilter")({address:t,args:n,event:s,events:a,strict:g,fromBlock:o})}catch{}R=!0;return}try{let L;if(P)L=await Zs(e,uB,"getFilterChanges")({filter:P});else{const z=await Zs(e,Fk,"getBlockNumber")({});I&&I!==z?L=await Zs(e,Cie,"getLogs")({address:t,args:n,event:s,events:a,fromBlock:I+1n,toBlock:z}):L=[],I=z}if(L.length===0)return;if(r)N.onLogs(L);else for(const z of L)N.onLogs([z])}catch(L){P&&L instanceof m3&&(R=!1),(U=N.onError)==null||U.call(N,L)}},{emitOnBegin:!0,interval:d});return async()=>{P&&await Zs(e,pB,"uninstallFilter")({filter:P}),F()}})})():(()=>{let C=!0,N=()=>C=!1;return(async()=>{try{const I=(()=>{if(e.transport.type==="fallback"){const U=e.transport.transports.find(L=>L.config.type==="webSocket");return U?U.value:e.transport}return e.transport})(),P=a??(s?[s]:void 0);let R=[];P&&(R=[P.flatMap(L=>Pk({abi:[L],eventName:L.name,args:n}))],s&&(R=R[0]));const{unsubscribe:F}=await I.subscribe({params:["logs",{address:t,topics:R}],onData(U){var z;if(!C)return;const L=U.result;try{const{eventName:X,args:ne}=vie({abi:P??[],data:L.data,topics:L.topics,strict:g}),J=Jg(L,{args:ne,eventName:X});c([J])}catch(X){let ne,J;if(X instanceof F9||X instanceof YD){if(f)return;ne=X.abiItem.name,J=(z=X.abiItem.inputs)==null?void 0:z.some(re=>!("name"in re&&re.name))}const Z=Jg(L,{args:J?[]:{},eventName:ne});c([Z])}},onError(U){l==null||l(U)}});N=F,C||N()}catch(I){l==null||l(I)}})(),()=>N()})()}function omt(e,{batch:t=!0,onError:n,onTransactions:r,poll:s,pollingInterval:a=e.pollingInterval}){return(typeof s<"u"?s:e.transport.type!=="webSocket")?(()=>{const u=jc(["watchPendingTransactions",e.uid,t,a]);return Ry(u,{onTransactions:r,onError:n},d=>{let f;const x=Mk(async()=>{var g;try{if(!f)try{f=await Zs(e,K9e,"createPendingTransactionFilter")({});return}catch(w){throw x(),w}const v=await Zs(e,uB,"getFilterChanges")({filter:f});if(v.length===0)return;if(t)d.onTransactions(v);else for(const w of v)d.onTransactions([w])}catch(v){(g=d.onError)==null||g.call(d,v)}},{emitOnBegin:!0,interval:a});return async()=>{f&&await Zs(e,pB,"uninstallFilter")({filter:f}),x()}})})():(()=>{let u=!0,d=()=>u=!1;return(async()=>{try{const{unsubscribe:f}=await e.transport.subscribe({params:["newPendingTransactions"],onData(x){if(!u)return;const g=x.result;r([g])},onError(x){n==null||n(x)}});d=f,u||d()}catch(f){n==null||n(f)}})(),()=>d()})()}function lmt(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function cmt(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?W0(e.nonce):void 0,storageProof:e.storageProof?lmt(e.storageProof):void 0}}async function umt(e,{address:t,blockNumber:n,blockTag:r,storageKeys:s}){const a=r??"latest",o=n!==void 0?Os(n):void 0,l=await e.request({method:"eth_getProof",params:[t,s,o||a]});return cmt(l)}async function dmt(e,{confirmations:t=1,hash:n,onReplaced:r,pollingInterval:s=e.pollingInterval,retryCount:a=6,retryDelay:o=({count:c})=>~~(1<<c)*200,timeout:l=18e4}){const c=jc(["waitForTransactionReceipt",e.uid,n]);let u,d,f,x=!1;const{promise:g,resolve:v,reject:w}=D9e(),C=l?setTimeout(()=>w(new Cut({hash:n})),l):void 0,N=Ry(c,{onReplaced:r,resolve:v,reject:w},I=>{const P=Zs(e,EEe,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:s,async onBlockNumber(R){const F=L=>{clearTimeout(C),P(),L(),N()};let U=R;if(!x)try{if(f){if(t>1&&(!f.blockNumber||U-f.blockNumber+1n<t))return;F(()=>I.resolve(f));return}if(u||(x=!0,await sM(async()=>{u=await Zs(e,Sie,"getTransaction")({hash:n}),u.blockNumber&&(U=u.blockNumber)},{delay:o,retryCount:a}),x=!1),f=await Zs(e,NZ,"getTransactionReceipt")({hash:n}),t>1&&(!f.blockNumber||U-f.blockNumber+1n<t))return;F(()=>I.resolve(f))}catch(L){if(L instanceof Xje||L instanceof Qje){if(!u){x=!1;return}try{d=u,x=!0;const z=await sM(()=>Zs(e,w0,"getBlock")({blockNumber:U,includeTransactions:!0}),{delay:o,retryCount:a,shouldRetry:({error:J})=>J instanceof Zje});x=!1;const X=z.transactions.find(({from:J,nonce:Z})=>J===d.from&&Z===d.nonce);if(!X||(f=await Zs(e,NZ,"getTransactionReceipt")({hash:X.hash}),t>1&&(!f.blockNumber||U-f.blockNumber+1n<t)))return;let ne="replaced";X.to===d.to&&X.value===d.value&&X.input===d.input?ne="repriced":X.from===X.to&&X.value===0n&&(ne="cancelled"),F(()=>{var J;(J=I.onReplaced)==null||J.call(I,{reason:ne,replacedTransaction:d,transaction:X,transactionReceipt:f}),I.resolve(f)})}catch(z){F(()=>I.reject(z))}}else F(()=>I.reject(L))}}})});return g}async function fmt(e,{account:t=e.account,message:n}){if(!t)throw new JD({docsPath:"/docs/actions/wallet/signMessage"});const r=Ou(t);if(r.signMessage)return r.signMessage({message:n});const s=typeof n=="string"?kS(n):n.raw instanceof Uint8Array?ri(n.raw):n.raw;return e.request({method:"personal_sign",params:[s,r.address]},{retryCount:0})}async function hmt(e,t){const{account:n=e.account,domain:r,message:s,primaryType:a}=t;if(!n)throw new JD({docsPath:"/docs/actions/wallet/signTypedData"});const o=Ou(n),l={EIP712Domain:NEe({domain:r}),...t.types};if(SEe({domain:r,message:s,primaryType:a,types:l}),o.signTypedData)return o.signTypedData({domain:r,message:s,primaryType:a,types:l});const c=Lpt({domain:r,message:s,primaryType:a,types:l});return e.request({method:"eth_signTypedData_v4",params:[o.address,c]},{retryCount:0})}async function pmt(e,t){const{abi:n,address:r,args:s,dataSuffix:a,functionName:o,...l}=t,c=l.account?Ou(l.account):e.account,u=xm({abi:n,args:s,functionName:o});try{const{data:d}=await Zs(e,lB,"call")({batch:!1,data:`${u}${a?a.replace("0x",""):""}`,to:r,...l,account:c}),f=n5({abi:n,args:s,functionName:o,data:d||"0x"}),x=n.filter(g=>"name"in g&&g.name===t.functionName);return{result:f,request:{abi:x,address:r,args:s,dataSuffix:a,functionName:o,...l,account:c}}}catch(d){throw g3(d,{abi:n,address:r,args:s,docsPath:"/docs/contract/simulateContract",functionName:o,sender:c==null?void 0:c.address})}}let _Ee=class extends Kse{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,Sct(t);const r=QD(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,a=new Uint8Array(s);a.set(r.length>s?t.create().update(r).digest():r);for(let o=0;o<a.length;o++)a[o]^=54;this.iHash.update(a),this.oHash=t.create();for(let o=0;o<a.length;o++)a[o]^=106;this.oHash.update(a),a.fill(0)}update(t){return IS(this),this.iHash.update(t),this}digestInto(t){IS(this),Ak(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:a,blockLen:o,outputLen:l}=this;return t=t,t.finished=s,t.destroyed=a,t.blockLen=o,t.outputLen=l,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const kEe=(e,t,n)=>new _Ee(e,t).update(n).digest();kEe.create=(e,t)=>new _Ee(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Pie=BigInt(0),PZ=BigInt(1);function FS(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Fie(e){if(!FS(e))throw new Error("Uint8Array expected")}function eE(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function RI(e){const t=e.toString(16);return t.length&1?"0"+t:t}function TEe(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Pie:BigInt("0x"+e)}const IEe=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",mmt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function tE(e){if(Fie(e),IEe)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=mmt[e[n]];return t}const Mx={_0:48,_9:57,A:65,F:70,a:97,f:102};function Hpe(e){if(e>=Mx._0&&e<=Mx._9)return e-Mx._0;if(e>=Mx.A&&e<=Mx.F)return e-(Mx.A-10);if(e>=Mx.a&&e<=Mx.f)return e-(Mx.a-10)}function iM(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(IEe)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let s=0,a=0;s<n;s++,a+=2){const o=Hpe(e.charCodeAt(a)),l=Hpe(e.charCodeAt(a+1));if(o===void 0||l===void 0){const c=e[a]+e[a+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+a)}r[s]=o*16+l}return r}function Vw(e){return TEe(tE(e))}function PEe(e){return Fie(e),TEe(tE(Uint8Array.from(e).reverse()))}function nE(e,t){return iM(e.toString(16).padStart(t*2,"0"))}function FEe(e,t){return nE(e,t).reverse()}function Ip(e,t,n){let r;if(typeof t=="string")try{r=iM(t)}catch(a){throw new Error(e+" must be hex string or Uint8Array, cause: "+a)}else if(FS(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const s=r.length;if(typeof n=="number"&&s!==n)throw new Error(e+" of length "+n+" expected, got "+s);return r}function aM(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];Fie(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const a=e[r];n.set(a,s),s+=a.length}return n}const iH=e=>typeof e=="bigint"&&Pie<=e;function Oie(e,t,n){return iH(e)&&iH(t)&&iH(n)&&t<=e&&e<n}function QC(e,t,n,r){if(!Oie(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function xmt(e){let t;for(t=0;e>Pie;e>>=PZ,t+=1);return t}const mB=e=>(PZ<<BigInt(e))-PZ,aH=e=>new Uint8Array(e),Vpe=e=>Uint8Array.from(e);function gmt(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=aH(e),s=aH(e),a=0;const o=()=>{r.fill(1),s.fill(0),a=0},l=(...f)=>n(s,r,...f),c=(f=aH(0))=>{s=l(Vpe([0]),f),r=l(),f.length!==0&&(s=l(Vpe([1]),f),r=l())},u=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const x=[];for(;f<t;){r=l();const g=r.slice();x.push(g),f+=r.length}return aM(...x)};return(f,x)=>{o(),c(f);let g;for(;!(g=x(u()));)c();return o(),g}}const bmt={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||FS(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function xB(e,t,n={}){const r=(s,a,o)=>{const l=bmt[a];if(typeof l!="function")throw new Error("invalid validator function");const c=e[s];if(!(o&&c===void 0)&&!l(c,e))throw new Error("param "+String(s)+" is invalid. Expected "+a+", got "+c)};for(const[s,a]of Object.entries(t))r(s,a,!1);for(const[s,a]of Object.entries(n))r(s,a,!0);return e}function Wpe(e){const t=new WeakMap;return(n,...r)=>{const s=t.get(n);if(s!==void 0)return s;const a=e(n,...r);return t.set(n,a),a}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Cc=BigInt(0),ml=BigInt(1),Iv=BigInt(2),ymt=BigInt(3),FZ=BigInt(4),qpe=BigInt(5),Gpe=BigInt(8);function Od(e,t){const n=e%t;return n>=Cc?n:t+n}function vmt(e,t,n){if(t<Cc)throw new Error("invalid exponent, negatives unsupported");if(n<=Cc)throw new Error("invalid modulus");if(n===ml)return Cc;let r=ml;for(;t>Cc;)t&ml&&(r=r*e%n),e=e*e%n,t>>=ml;return r}function lh(e,t,n){let r=e;for(;t-- >Cc;)r*=r,r%=n;return r}function OZ(e,t){if(e===Cc)throw new Error("invert: expected non-zero number");if(t<=Cc)throw new Error("invert: expected positive modulus, got "+t);let n=Od(e,t),r=t,s=Cc,a=ml;for(;n!==Cc;){const l=r/n,c=r%n,u=s-a*l;r=n,n=c,s=a,a=u}if(r!==ml)throw new Error("invert: does not exist");return Od(s,t)}function wmt(e){const t=(e-ml)/Iv;let n,r,s;for(n=e-ml,r=0;n%Iv===Cc;n/=Iv,r++);for(s=Iv;s<e&&vmt(s,t,e)!==e-ml;s++)if(s>1e3)throw new Error("Cannot find square root: likely non-prime P");if(r===1){const o=(e+ml)/FZ;return function(c,u){const d=c.pow(u,o);if(!c.eql(c.sqr(d),u))throw new Error("Cannot find square root");return d}}const a=(n+ml)/Iv;return function(l,c){if(l.pow(c,t)===l.neg(l.ONE))throw new Error("Cannot find square root");let u=r,d=l.pow(l.mul(l.ONE,s),n),f=l.pow(c,a),x=l.pow(c,n);for(;!l.eql(x,l.ONE);){if(l.eql(x,l.ZERO))return l.ZERO;let g=1;for(let w=l.sqr(x);g<u&&!l.eql(w,l.ONE);g++)w=l.sqr(w);const v=l.pow(d,ml<<BigInt(u-g-1));d=l.sqr(v),f=l.mul(f,v),x=l.mul(x,d),u=g}return f}}function Cmt(e){if(e%FZ===ymt){const t=(e+ml)/FZ;return function(r,s){const a=r.pow(s,t);if(!r.eql(r.sqr(a),s))throw new Error("Cannot find square root");return a}}if(e%Gpe===qpe){const t=(e-qpe)/Gpe;return function(r,s){const a=r.mul(s,Iv),o=r.pow(a,t),l=r.mul(s,o),c=r.mul(r.mul(l,Iv),o),u=r.mul(l,r.sub(c,r.ONE));if(!r.eql(r.sqr(u),s))throw new Error("Cannot find square root");return u}}return wmt(e)}const Smt=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Nmt(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Smt.reduce((r,s)=>(r[s]="function",r),t);return xB(e,n)}function Amt(e,t,n){if(n<Cc)throw new Error("invalid exponent, negatives unsupported");if(n===Cc)return e.ONE;if(n===ml)return t;let r=e.ONE,s=t;for(;n>Cc;)n&ml&&(r=e.mul(r,s)),s=e.sqr(s),n>>=ml;return r}function jmt(e,t){const n=new Array(t.length),r=t.reduce((a,o,l)=>e.is0(o)?a:(n[l]=a,e.mul(a,o)),e.ONE),s=e.inv(r);return t.reduceRight((a,o,l)=>e.is0(o)?a:(n[l]=e.mul(a,n[l]),e.mul(a,o)),s),n}function OEe(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function MEe(e,t,n=!1,r={}){if(e<=Cc)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:s,nByteLength:a}=OEe(e,t);if(a>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const l=Object.freeze({ORDER:e,isLE:n,BITS:s,BYTES:a,MASK:mB(s),ZERO:Cc,ONE:ml,create:c=>Od(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return Cc<=c&&c<e},is0:c=>c===Cc,isOdd:c=>(c&ml)===ml,neg:c=>Od(-c,e),eql:(c,u)=>c===u,sqr:c=>Od(c*c,e),add:(c,u)=>Od(c+u,e),sub:(c,u)=>Od(c-u,e),mul:(c,u)=>Od(c*u,e),pow:(c,u)=>Amt(l,c,u),div:(c,u)=>Od(c*OZ(u,e),e),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>OZ(c,e),sqrt:r.sqrt||(c=>(o||(o=Cmt(e)),o(l,c))),invertBatch:c=>jmt(l,c),cmov:(c,u,d)=>d?u:c,toBytes:c=>n?FEe(c,a):nE(c,a),fromBytes:c=>{if(c.length!==a)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+c.length);return n?PEe(c):Vw(c)}});return Object.freeze(l)}function REe(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function LEe(e){const t=REe(e);return t+Math.ceil(t/2)}function Emt(e,t,n=!1){const r=e.length,s=REe(t),a=LEe(t);if(r<16||r<a||r>1024)throw new Error("expected "+a+"-1024 bytes of input, got "+r);const o=n?PEe(e):Vw(e),l=Od(o,t-ml)+ml;return n?FEe(l,s):nE(l,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Kpe=BigInt(0),MZ=BigInt(1);function oH(e,t){const n=t.negate();return e?n:t}function DEe(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function lH(e,t){DEe(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),s=2**e,a=mB(e),o=BigInt(e);return{windows:n,windowSize:r,mask:a,maxNumber:s,shiftBy:o}}function Ype(e,t,n){const{windowSize:r,mask:s,maxNumber:a,shiftBy:o}=n;let l=Number(e&s),c=e>>o;l>r&&(l-=a,c+=MZ);const u=t*r,d=u+Math.abs(l)-1,f=l===0,x=l<0,g=t%2!==0;return{nextN:c,offset:d,isZero:f,isNeg:x,isNegF:g,offsetF:u}}function _mt(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,r)=>{if(!(n instanceof t))throw new Error("invalid point at index "+r)})}function kmt(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,r)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+r)})}const cH=new WeakMap,BEe=new WeakMap;function uH(e){return BEe.get(e)||1}function Tmt(e,t){return{constTimeNegate:oH,hasPrecomputes(n){return uH(n)!==1},unsafeLadder(n,r,s=e.ZERO){let a=n;for(;r>Kpe;)r&MZ&&(s=s.add(a)),a=a.double(),r>>=MZ;return s},precomputeWindow(n,r){const{windows:s,windowSize:a}=lH(r,t),o=[];let l=n,c=l;for(let u=0;u<s;u++){c=l,o.push(c);for(let d=1;d<a;d++)c=c.add(l),o.push(c);l=c.double()}return o},wNAF(n,r,s){let a=e.ZERO,o=e.BASE;const l=lH(n,t);for(let c=0;c<l.windows;c++){const{nextN:u,offset:d,isZero:f,isNeg:x,isNegF:g,offsetF:v}=Ype(s,c,l);s=u,f?o=o.add(oH(g,r[v])):a=a.add(oH(x,r[d]))}return{p:a,f:o}},wNAFUnsafe(n,r,s,a=e.ZERO){const o=lH(n,t);for(let l=0;l<o.windows&&s!==Kpe;l++){const{nextN:c,offset:u,isZero:d,isNeg:f}=Ype(s,l,o);if(s=c,!d){const x=r[u];a=a.add(f?x.negate():x)}}return a},getPrecomputes(n,r,s){let a=cH.get(r);return a||(a=this.precomputeWindow(r,n),n!==1&&cH.set(r,s(a))),a},wNAFCached(n,r,s){const a=uH(n);return this.wNAF(a,this.getPrecomputes(a,n,s),r)},wNAFCachedUnsafe(n,r,s,a){const o=uH(n);return o===1?this.unsafeLadder(n,r,a):this.wNAFUnsafe(o,this.getPrecomputes(o,n,s),r,a)},setWindowSize(n,r){DEe(r,t),BEe.set(n,r),cH.delete(n)}}}function Imt(e,t,n,r){if(_mt(n,e),kmt(r,t),n.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const s=e.ZERO,a=xmt(BigInt(n.length)),o=a>12?a-3:a>4?a-2:a?2:1,l=mB(o),c=new Array(Number(l)+1).fill(s),u=Math.floor((t.BITS-1)/o)*o;let d=s;for(let f=u;f>=0;f-=o){c.fill(s);for(let g=0;g<r.length;g++){const v=r[g],w=Number(v>>BigInt(f)&l);c[w]=c[w].add(n[g])}let x=s;for(let g=c.length-1,v=s;g>0;g--)v=v.add(c[g]),x=x.add(v);if(d=d.add(x),f!==0)for(let g=0;g<o;g++)d=d.double()}return d}function $Ee(e){return Nmt(e.Fp),xB(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...OEe(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Xpe(e){e.lowS!==void 0&&eE("lowS",e.lowS),e.prehash!==void 0&&eE("prehash",e.prehash)}function Pmt(e){const t=$Ee(e);xB(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,r.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...t})}class Fmt extends Error{constructor(t=""){super(t)}}const ig={Err:Fmt,_tlv:{encode:(e,t)=>{const{Err:n}=ig;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length&1)throw new n("tlv.encode: unpadded data");const r=t.length/2,s=RI(r);if(s.length/2&128)throw new n("tlv.encode: long form length too big");const a=r>127?RI(s.length/2|128):"";return RI(e)+a+s+t},decode(e,t){const{Err:n}=ig;let r=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new n("tlv.decode: wrong tlv");const s=t[r++],a=!!(s&128);let o=0;if(!a)o=s;else{const c=s&127;if(!c)throw new n("tlv.decode(long): indefinite length not supported");if(c>4)throw new n("tlv.decode(long): byte length is too big");const u=t.subarray(r,r+c);if(u.length!==c)throw new n("tlv.decode: length bytes not complete");if(u[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const d of u)o=o<<8|d;if(r+=c,o<128)throw new n("tlv.decode(long): not minimal encoding")}const l=t.subarray(r,r+o);if(l.length!==o)throw new n("tlv.decode: wrong value length");return{v:l,l:t.subarray(r+o)}}},_int:{encode(e){const{Err:t}=ig;if(e<Sg)throw new t("integer: negative integers are not allowed");let n=RI(e);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=ig;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return Vw(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=ig,s=Ip("signature",e),{v:a,l:o}=r.decode(48,s);if(o.length)throw new t("invalid signature: left bytes after parsing");const{v:l,l:c}=r.decode(2,a),{v:u,l:d}=r.decode(2,c);if(d.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(l),s:n.decode(u)}},hexFromSig(e){const{_tlv:t,_int:n}=ig,r=t.encode(2,n.encode(e.r)),s=t.encode(2,n.encode(e.s)),a=r+s;return t.encode(48,a)}},Sg=BigInt(0),gc=BigInt(1);BigInt(2);const Qpe=BigInt(3);BigInt(4);function Omt(e){const t=Pmt(e),{Fp:n}=t,r=MEe(t.n,t.nBitLength),s=t.toBytes||((w,C,N)=>{const I=C.toAffine();return aM(Uint8Array.from([4]),n.toBytes(I.x),n.toBytes(I.y))}),a=t.fromBytes||(w=>{const C=w.subarray(1),N=n.fromBytes(C.subarray(0,n.BYTES)),I=n.fromBytes(C.subarray(n.BYTES,2*n.BYTES));return{x:N,y:I}});function o(w){const{a:C,b:N}=t,I=n.sqr(w),P=n.mul(I,w);return n.add(n.add(P,n.mul(w,C)),N)}if(!n.eql(n.sqr(t.Gy),o(t.Gx)))throw new Error("bad generator point: equation left != right");function l(w){return Oie(w,gc,t.n)}function c(w){const{allowedPrivateKeyLengths:C,nByteLength:N,wrapPrivateKey:I,n:P}=t;if(C&&typeof w!="bigint"){if(FS(w)&&(w=tE(w)),typeof w!="string"||!C.includes(w.length))throw new Error("invalid private key");w=w.padStart(N*2,"0")}let R;try{R=typeof w=="bigint"?w:Vw(Ip("private key",w,N))}catch{throw new Error("invalid private key, expected hex or "+N+" bytes, got "+typeof w)}return I&&(R=Od(R,P)),QC("private key",R,gc,P),R}function u(w){if(!(w instanceof x))throw new Error("ProjectivePoint expected")}const d=Wpe((w,C)=>{const{px:N,py:I,pz:P}=w;if(n.eql(P,n.ONE))return{x:N,y:I};const R=w.is0();C==null&&(C=R?n.ONE:n.inv(P));const F=n.mul(N,C),U=n.mul(I,C),L=n.mul(P,C);if(R)return{x:n.ZERO,y:n.ZERO};if(!n.eql(L,n.ONE))throw new Error("invZ was invalid");return{x:F,y:U}}),f=Wpe(w=>{if(w.is0()){if(t.allowInfinityPoint&&!n.is0(w.py))return;throw new Error("bad point: ZERO")}const{x:C,y:N}=w.toAffine();if(!n.isValid(C)||!n.isValid(N))throw new Error("bad point: x or y not FE");const I=n.sqr(N),P=o(C);if(!n.eql(I,P))throw new Error("bad point: equation left != right");if(!w.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class x{constructor(C,N,I){if(C==null||!n.isValid(C))throw new Error("x required");if(N==null||!n.isValid(N))throw new Error("y required");if(I==null||!n.isValid(I))throw new Error("z required");this.px=C,this.py=N,this.pz=I,Object.freeze(this)}static fromAffine(C){const{x:N,y:I}=C||{};if(!C||!n.isValid(N)||!n.isValid(I))throw new Error("invalid affine point");if(C instanceof x)throw new Error("projective point not allowed");const P=R=>n.eql(R,n.ZERO);return P(N)&&P(I)?x.ZERO:new x(N,I,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(C){const N=n.invertBatch(C.map(I=>I.pz));return C.map((I,P)=>I.toAffine(N[P])).map(x.fromAffine)}static fromHex(C){const N=x.fromAffine(a(Ip("pointHex",C)));return N.assertValidity(),N}static fromPrivateKey(C){return x.BASE.multiply(c(C))}static msm(C,N){return Imt(x,r,C,N)}_setWindowSize(C){v.setWindowSize(this,C)}assertValidity(){f(this)}hasEvenY(){const{y:C}=this.toAffine();if(n.isOdd)return!n.isOdd(C);throw new Error("Field doesn't support isOdd")}equals(C){u(C);const{px:N,py:I,pz:P}=this,{px:R,py:F,pz:U}=C,L=n.eql(n.mul(N,U),n.mul(R,P)),z=n.eql(n.mul(I,U),n.mul(F,P));return L&&z}negate(){return new x(this.px,n.neg(this.py),this.pz)}double(){const{a:C,b:N}=t,I=n.mul(N,Qpe),{px:P,py:R,pz:F}=this;let U=n.ZERO,L=n.ZERO,z=n.ZERO,X=n.mul(P,P),ne=n.mul(R,R),J=n.mul(F,F),Z=n.mul(P,R);return Z=n.add(Z,Z),z=n.mul(P,F),z=n.add(z,z),U=n.mul(C,z),L=n.mul(I,J),L=n.add(U,L),U=n.sub(ne,L),L=n.add(ne,L),L=n.mul(U,L),U=n.mul(Z,U),z=n.mul(I,z),J=n.mul(C,J),Z=n.sub(X,J),Z=n.mul(C,Z),Z=n.add(Z,z),z=n.add(X,X),X=n.add(z,X),X=n.add(X,J),X=n.mul(X,Z),L=n.add(L,X),J=n.mul(R,F),J=n.add(J,J),X=n.mul(J,Z),U=n.sub(U,X),z=n.mul(J,ne),z=n.add(z,z),z=n.add(z,z),new x(U,L,z)}add(C){u(C);const{px:N,py:I,pz:P}=this,{px:R,py:F,pz:U}=C;let L=n.ZERO,z=n.ZERO,X=n.ZERO;const ne=t.a,J=n.mul(t.b,Qpe);let Z=n.mul(N,R),re=n.mul(I,F),he=n.mul(P,U),Y=n.add(N,I),ie=n.add(R,F);Y=n.mul(Y,ie),ie=n.add(Z,re),Y=n.sub(Y,ie),ie=n.add(N,P);let oe=n.add(R,U);return ie=n.mul(ie,oe),oe=n.add(Z,he),ie=n.sub(ie,oe),oe=n.add(I,P),L=n.add(F,U),oe=n.mul(oe,L),L=n.add(re,he),oe=n.sub(oe,L),X=n.mul(ne,ie),L=n.mul(J,he),X=n.add(L,X),L=n.sub(re,X),X=n.add(re,X),z=n.mul(L,X),re=n.add(Z,Z),re=n.add(re,Z),he=n.mul(ne,he),ie=n.mul(J,ie),re=n.add(re,he),he=n.sub(Z,he),he=n.mul(ne,he),ie=n.add(ie,he),Z=n.mul(re,ie),z=n.add(z,Z),Z=n.mul(oe,ie),L=n.mul(Y,L),L=n.sub(L,Z),Z=n.mul(Y,re),X=n.mul(oe,X),X=n.add(X,Z),new x(L,z,X)}subtract(C){return this.add(C.negate())}is0(){return this.equals(x.ZERO)}wNAF(C){return v.wNAFCached(this,C,x.normalizeZ)}multiplyUnsafe(C){const{endo:N,n:I}=t;QC("scalar",C,Sg,I);const P=x.ZERO;if(C===Sg)return P;if(this.is0()||C===gc)return this;if(!N||v.hasPrecomputes(this))return v.wNAFCachedUnsafe(this,C,x.normalizeZ);let{k1neg:R,k1:F,k2neg:U,k2:L}=N.splitScalar(C),z=P,X=P,ne=this;for(;F>Sg||L>Sg;)F&gc&&(z=z.add(ne)),L&gc&&(X=X.add(ne)),ne=ne.double(),F>>=gc,L>>=gc;return R&&(z=z.negate()),U&&(X=X.negate()),X=new x(n.mul(X.px,N.beta),X.py,X.pz),z.add(X)}multiply(C){const{endo:N,n:I}=t;QC("scalar",C,gc,I);let P,R;if(N){const{k1neg:F,k1:U,k2neg:L,k2:z}=N.splitScalar(C);let{p:X,f:ne}=this.wNAF(U),{p:J,f:Z}=this.wNAF(z);X=v.constTimeNegate(F,X),J=v.constTimeNegate(L,J),J=new x(n.mul(J.px,N.beta),J.py,J.pz),P=X.add(J),R=ne.add(Z)}else{const{p:F,f:U}=this.wNAF(C);P=F,R=U}return x.normalizeZ([P,R])[0]}multiplyAndAddUnsafe(C,N,I){const P=x.BASE,R=(U,L)=>L===Sg||L===gc||!U.equals(P)?U.multiplyUnsafe(L):U.multiply(L),F=R(this,N).add(R(C,I));return F.is0()?void 0:F}toAffine(C){return d(this,C)}isTorsionFree(){const{h:C,isTorsionFree:N}=t;if(C===gc)return!0;if(N)return N(x,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:C,clearCofactor:N}=t;return C===gc?this:N?N(x,this):this.multiplyUnsafe(t.h)}toRawBytes(C=!0){return eE("isCompressed",C),this.assertValidity(),s(x,this,C)}toHex(C=!0){return eE("isCompressed",C),tE(this.toRawBytes(C))}}x.BASE=new x(t.Gx,t.Gy,n.ONE),x.ZERO=new x(n.ZERO,n.ONE,n.ZERO);const g=t.nBitLength,v=Tmt(x,t.endo?Math.ceil(g/2):g);return{CURVE:t,ProjectivePoint:x,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:l}}function Mmt(e){const t=$Ee(e);return xB(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Rmt(e){const t=Mmt(e),{Fp:n,n:r}=t,s=n.BYTES+1,a=2*n.BYTES+1;function o(he){return Od(he,r)}function l(he){return OZ(he,r)}const{ProjectivePoint:c,normPrivateKeyToScalar:u,weierstrassEquation:d,isWithinCurveOrder:f}=Omt({...t,toBytes(he,Y,ie){const oe=Y.toAffine(),G=n.toBytes(oe.x),V=aM;return eE("isCompressed",ie),ie?V(Uint8Array.from([Y.hasEvenY()?2:3]),G):V(Uint8Array.from([4]),G,n.toBytes(oe.y))},fromBytes(he){const Y=he.length,ie=he[0],oe=he.subarray(1);if(Y===s&&(ie===2||ie===3)){const G=Vw(oe);if(!Oie(G,gc,n.ORDER))throw new Error("Point is not on curve");const V=d(G);let ee;try{ee=n.sqrt(V)}catch(Ae){const ce=Ae instanceof Error?": "+Ae.message:"";throw new Error("Point is not on curve"+ce)}const ae=(ee&gc)===gc;return(ie&1)===1!==ae&&(ee=n.neg(ee)),{x:G,y:ee}}else if(Y===a&&ie===4){const G=n.fromBytes(oe.subarray(0,n.BYTES)),V=n.fromBytes(oe.subarray(n.BYTES,2*n.BYTES));return{x:G,y:V}}else{const G=s,V=a;throw new Error("invalid Point, expected length of "+G+", or uncompressed "+V+", got "+Y)}}}),x=he=>tE(nE(he,t.nByteLength));function g(he){const Y=r>>gc;return he>Y}function v(he){return g(he)?o(-he):he}const w=(he,Y,ie)=>Vw(he.slice(Y,ie));class C{constructor(Y,ie,oe){QC("r",Y,gc,r),QC("s",ie,gc,r),this.r=Y,this.s=ie,oe!=null&&(this.recovery=oe),Object.freeze(this)}static fromCompact(Y){const ie=t.nByteLength;return Y=Ip("compactSignature",Y,ie*2),new C(w(Y,0,ie),w(Y,ie,2*ie))}static fromDER(Y){const{r:ie,s:oe}=ig.toSig(Ip("DER",Y));return new C(ie,oe)}assertValidity(){}addRecoveryBit(Y){return new C(this.r,this.s,Y)}recoverPublicKey(Y){const{r:ie,s:oe,recovery:G}=this,V=U(Ip("msgHash",Y));if(G==null||![0,1,2,3].includes(G))throw new Error("recovery id invalid");const ee=G===2||G===3?ie+t.n:ie;if(ee>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const ae=G&1?"03":"02",fe=c.fromHex(ae+x(ee)),Ae=l(ee),ce=o(-V*Ae),ye=o(oe*Ae),Ne=c.BASE.multiplyAndAddUnsafe(fe,ce,ye);if(!Ne)throw new Error("point at infinify");return Ne.assertValidity(),Ne}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new C(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return iM(this.toDERHex())}toDERHex(){return ig.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return iM(this.toCompactHex())}toCompactHex(){return x(this.r)+x(this.s)}}const N={isValidPrivateKey(he){try{return u(he),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const he=LEe(t.n);return Emt(t.randomBytes(he),t.n)},precompute(he=8,Y=c.BASE){return Y._setWindowSize(he),Y.multiply(BigInt(3)),Y}};function I(he,Y=!0){return c.fromPrivateKey(he).toRawBytes(Y)}function P(he){const Y=FS(he),ie=typeof he=="string",oe=(Y||ie)&&he.length;return Y?oe===s||oe===a:ie?oe===2*s||oe===2*a:he instanceof c}function R(he,Y,ie=!0){if(P(he))throw new Error("first arg must be private key");if(!P(Y))throw new Error("second arg must be public key");return c.fromHex(Y).multiply(u(he)).toRawBytes(ie)}const F=t.bits2int||function(he){if(he.length>8192)throw new Error("input is too large");const Y=Vw(he),ie=he.length*8-t.nBitLength;return ie>0?Y>>BigInt(ie):Y},U=t.bits2int_modN||function(he){return o(F(he))},L=mB(t.nBitLength);function z(he){return QC("num < 2^"+t.nBitLength,he,Sg,L),nE(he,t.nByteLength)}function X(he,Y,ie=ne){if(["recovered","canonical"].some(je=>je in ie))throw new Error("sign() legacy options not supported");const{hash:oe,randomBytes:G}=t;let{lowS:V,prehash:ee,extraEntropy:ae}=ie;V==null&&(V=!0),he=Ip("msgHash",he),Xpe(ie),ee&&(he=Ip("prehashed msgHash",oe(he)));const fe=U(he),Ae=u(Y),ce=[z(Ae),z(fe)];if(ae!=null&&ae!==!1){const je=ae===!0?G(n.BYTES):ae;ce.push(Ip("extraEntropy",je))}const ye=aM(...ce),Ne=fe;function be(je){const Ie=F(je);if(!f(Ie))return;const Re=l(Ie),Qe=c.BASE.multiply(Ie).toAffine(),Be=o(Qe.x);if(Be===Sg)return;const it=o(Re*o(Ne+Be*Ae));if(it===Sg)return;let tt=(Qe.x===Be?0:2)|Number(Qe.y&gc),at=it;return V&&g(it)&&(at=v(it),tt^=1),new C(Be,at,tt)}return{seed:ye,k2sig:be}}const ne={lowS:t.lowS,prehash:!1},J={lowS:t.lowS,prehash:!1};function Z(he,Y,ie=ne){const{seed:oe,k2sig:G}=X(he,Y,ie),V=t;return gmt(V.hash.outputLen,V.nByteLength,V.hmac)(oe,G)}c.BASE._setWindowSize(8);function re(he,Y,ie,oe=J){var tt;const G=he;Y=Ip("msgHash",Y),ie=Ip("publicKey",ie);const{lowS:V,prehash:ee,format:ae}=oe;if(Xpe(oe),"strict"in oe)throw new Error("options.strict was renamed to lowS");if(ae!==void 0&&ae!=="compact"&&ae!=="der")throw new Error("format must be compact or der");const fe=typeof G=="string"||FS(G),Ae=!fe&&!ae&&typeof G=="object"&&G!==null&&typeof G.r=="bigint"&&typeof G.s=="bigint";if(!fe&&!Ae)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let ce,ye;try{if(Ae&&(ce=new C(G.r,G.s)),fe){try{ae!=="compact"&&(ce=C.fromDER(G))}catch(at){if(!(at instanceof ig.Err))throw at}!ce&&ae!=="der"&&(ce=C.fromCompact(G))}ye=c.fromHex(ie)}catch{return!1}if(!ce||V&&ce.hasHighS())return!1;ee&&(Y=t.hash(Y));const{r:Ne,s:be}=ce,je=U(Y),Ie=l(be),Re=o(je*Ie),Qe=o(Ne*Ie),Be=(tt=c.BASE.multiplyAndAddUnsafe(ye,Re,Qe))==null?void 0:tt.toAffine();return Be?o(Be.x)===Ne:!1}return{CURVE:t,getPublicKey:I,getSharedSecret:R,sign:Z,verify:re,ProjectivePoint:c,Signature:C,utils:N}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Lmt(e){return{hash:e,hmac:(t,...n)=>kEe(e,t,Fct(...n)),randomBytes:Oct}}function Dmt(e,t){const n=r=>Rmt({...e,...Lmt(r)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const UEe=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Zpe=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Bmt=BigInt(1),RZ=BigInt(2),Jpe=(e,t)=>(e+t/RZ)/t;function $mt(e){const t=UEe,n=BigInt(3),r=BigInt(6),s=BigInt(11),a=BigInt(22),o=BigInt(23),l=BigInt(44),c=BigInt(88),u=e*e*e%t,d=u*u*e%t,f=lh(d,n,t)*d%t,x=lh(f,n,t)*d%t,g=lh(x,RZ,t)*u%t,v=lh(g,s,t)*g%t,w=lh(v,a,t)*v%t,C=lh(w,l,t)*w%t,N=lh(C,c,t)*C%t,I=lh(N,l,t)*w%t,P=lh(I,n,t)*d%t,R=lh(P,o,t)*v%t,F=lh(R,r,t)*u%t,U=lh(F,RZ,t);if(!LZ.eql(LZ.sqr(U),e))throw new Error("Cannot find square root");return U}const LZ=MEe(UEe,void 0,void 0,{sqrt:$mt}),Mie=Dmt({a:BigInt(0),b:BigInt(7),Fp:LZ,n:Zpe,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Zpe,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Bmt*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),l=Jpe(a*e,t),c=Jpe(-r*e,t);let u=Od(e-l*n-c*s,t),d=Od(-l*r-c*a,t);const f=u>o,x=d>o;if(f&&(u=t-u),x&&(d=t-d),u>o||d>o)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:x,k2:d}}}},n9e);BigInt(0);Mie.ProjectivePoint;const Umt=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:Mie},Symbol.toStringTag,{value:"Module"}));function zmt({r:e,s:t,to:n="hex",v:r,yParity:s}){const a=(()=>{if(s===0||s===1)return s;if(r&&(r===27n||r===28n||r>=35n))return r%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),o=`0x${new Mie.Signature(Xu(e),Xu(t)).toCompactHex()}${a===0?"1b":"1c"}`;return n==="hex"?o:Qh(o)}async function Rie(e,t){var f,x,g;const{address:n,factory:r,factoryData:s,hash:a,signature:o,universalSignatureVerifierAddress:l=(g=(x=(f=e.chain)==null?void 0:f.contracts)==null?void 0:x.universalSignatureVerifier)==null?void 0:g.address,...c}=t,u=V0(o)?o:typeof o=="object"&&"r"in o&&"s"in o?zmt(o):Dl(o),d=await(async()=>!r&&!s||Zpt(u)?u:Jpt({address:r,data:s,signature:u}))();try{const v=l?{to:l,data:xm({abi:bpe,functionName:"isValidSig",args:[n,a,d]}),...c}:{data:Zse({abi:bpe,args:[n,a,d],bytecode:mft}),...c},{data:w}=await Zs(e,lB,"call")(v);return sct(w??"0x0")}catch(v){try{if(yie(wc(n),await Vje({hash:a,signature:o})))return!0}catch{}if(v instanceof P9e)return!1;throw v}}async function Hmt(e,{address:t,message:n,factory:r,factoryData:s,signature:a,...o}){const l=AEe(n);return Rie(e,{address:t,factory:r,factoryData:s,hash:l,signature:a,...o})}async function Vmt(e,t){const{address:n,factory:r,factoryData:s,signature:a,message:o,primaryType:l,types:c,domain:u,...d}=t,f=Fpt({message:o,primaryType:l,types:c,domain:u});return Rie(e,{address:n,factory:r,factoryData:s,hash:f,signature:a,...d})}function Wmt(e,t){const{abi:n,address:r,args:s,batch:a=!0,eventName:o,fromBlock:l,onError:c,onLogs:u,poll:d,pollingInterval:f=e.pollingInterval,strict:x}=t;return(typeof d<"u"?d:typeof l=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"))?(()=>{const C=x??!1,N=jc(["watchContractEvent",r,s,a,e.uid,o,f,C,l]);return Ry(N,{onLogs:u,onError:c},I=>{let P;l!==void 0&&(P=l-1n);let R,F=!1;const U=Mk(async()=>{var L;if(!F){try{R=await Zs(e,q9e,"createContractEventFilter")({abi:n,address:r,args:s,eventName:o,strict:C,fromBlock:l})}catch{}F=!0;return}try{let z;if(R)z=await Zs(e,uB,"getFilterChanges")({filter:R});else{const X=await Zs(e,Fk,"getBlockNumber")({});P&&P<X?z=await Zs(e,Y9e,"getContractEvents")({abi:n,address:r,args:s,eventName:o,fromBlock:P+1n,toBlock:X,strict:C}):z=[],P=X}if(z.length===0)return;if(a)I.onLogs(z);else for(const X of z)I.onLogs([X])}catch(z){R&&z instanceof m3&&(F=!1),(L=I.onError)==null||L.call(I,z)}},{emitOnBegin:!0,interval:f});return async()=>{R&&await Zs(e,pB,"uninstallFilter")({filter:R}),U()}})})():(()=>{const C=x??!1,N=jc(["watchContractEvent",r,s,a,e.uid,o,f,C]);let I=!0,P=()=>I=!1;return Ry(N,{onLogs:u,onError:c},R=>((async()=>{try{const F=(()=>{if(e.transport.type==="fallback"){const z=e.transport.transports.find(X=>X.config.type==="webSocket");return z?z.value:e.transport}return e.transport})(),U=o?Pk({abi:n,eventName:o,args:s}):[],{unsubscribe:L}=await F.subscribe({params:["logs",{address:r,topics:U}],onData(z){var ne;if(!I)return;const X=z.result;try{const{eventName:J,args:Z}=vie({abi:n,data:X.data,topics:X.topics,strict:x}),re=Jg(X,{args:Z,eventName:J});R.onLogs([re])}catch(J){let Z,re;if(J instanceof F9||J instanceof YD){if(x)return;Z=J.abiItem.name,re=(ne=J.abiItem.inputs)==null?void 0:ne.some(Y=>!("name"in Y&&Y.name))}const he=Jg(X,{args:re?[]:{},eventName:Z});R.onLogs([he])}},onError(z){var X;(X=R.onError)==null||X.call(R,z)}});P=L,I||P()}catch(F){c==null||c(F)}})(),()=>P()))})()}async function qmt(e,t){const{abi:n,account:r=e.account,address:s,args:a,dataSuffix:o,functionName:l,...c}=t;if(typeof r>"u")throw new JD({docsPath:"/docs/contract/writeContract"});const u=r?Ou(r):null,d=xm({abi:n,args:a,functionName:l});try{return await Zs(e,edt,"sendTransaction")({data:`${d}${o?o.replace("0x",""):""}`,to:s,account:u,...c})}catch(f){throw g3(f,{abi:n,address:s,args:a,docsPath:"/docs/contract/writeContract",functionName:l,sender:u==null?void 0:u.address})}}function t2(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const s=e[n];return typeof s=="function"?s:a=>t(e,a)}const RF="2.16.7",Gmt=()=>`@wagmi/core@${RF}`;var zEe=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},oM,HEe;let g1=class DZ extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return Gmt()}constructor(t,n={}){var a;super(),oM.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const r=n.cause instanceof DZ?n.cause.details:(a=n.cause)!=null&&a.message?n.cause.message:n.details,s=n.cause instanceof DZ&&n.cause.docsPath||n.docsPath;this.message=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${this.docsBaseUrl}${s}.html${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join(`
`),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}walk(t){return zEe(this,oM,"m",HEe).call(this,this,t)}};oM=new WeakSet,HEe=function e(t,n){return n!=null&&n(t)?t:t.cause?zEe(this,oM,"m",e).call(this,t.cause,n):t};class v3 extends g1{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class Kmt extends g1{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class Ymt extends g1{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class Xmt extends g1{constructor({address:t,connector:n}){super(`Account "${t}" not found for connector "${n.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class Qmt extends g1{constructor({connectionChainId:t,connectorChainId:n}){super(`The current chain of the connector (id: ${n}) does not match the connection's chain (id: ${t}).`,{metaMessages:[`Current Chain ID:  ${n}`,`Expected Chain ID: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class Zmt extends g1{constructor({connector:t}){super(`Connector "${t.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function Jmt(e,t){var r;let n;if(typeof t.connector=="function"?n=e._internal.connectors.setup(t.connector):n=t.connector,n.uid===e.state.current)throw new Kmt;try{e.setState(c=>({...c,status:"connecting"})),n.emitter.emit("message",{type:"connecting"});const{connector:s,...a}=t,o=await n.connect(a),l=o.accounts;return n.emitter.off("connect",e._internal.events.connect),n.emitter.on("change",e._internal.events.change),n.emitter.on("disconnect",e._internal.events.disconnect),await((r=e.storage)==null?void 0:r.setItem("recentConnectorId",n.id)),e.setState(c=>({...c,connections:new Map(c.connections).set(n.uid,{accounts:l,chainId:o.chainId,connector:n}),current:n.uid,status:"connected"})),{accounts:l,chainId:o.chainId}}catch(s){throw e.setState(a=>({...a,status:a.current?"connected":"disconnected"})),s}}const BZ=256;let LI=BZ,DI;function VEe(e=11){if(!DI||LI+e>BZ*2){DI="",LI=0;for(let t=0;t<BZ;t++)DI+=(256+Math.random()*256|0).toString(16).substring(1)}return DI.substring(LI,LI+++e)}function WEe(e){const{batch:t,cacheTime:n=e.pollingInterval??4e3,ccipRead:r,key:s="base",name:a="Base Client",pollingInterval:o=4e3,type:l="base"}=e,c=e.chain,u=e.account?Ou(e.account):void 0,{config:d,request:f,value:x}=e.transport({chain:c,pollingInterval:o}),g={...d,...x},v={account:u,batch:t,cacheTime:n,ccipRead:r,chain:c,key:s,name:a,pollingInterval:o,request:f,transport:g,type:l,uid:VEe()};function w(C){return N=>{const I=N(C);for(const R in v)delete I[R];const P={...C,...I};return Object.assign(P,{extend:w(P)})}}return Object.assign(v,{extend:w(v)})}function qEe({key:e,methods:t,name:n,request:r,retryCount:s=3,retryDelay:a=150,timeout:o,type:l},c){const u=VEe();return{config:{key:e,methods:t,name:n,request:r,retryCount:s,retryDelay:a,timeout:o,type:l},request:jpt(r,{methods:t,retryCount:s,retryDelay:a,uid:u}),value:c}}function e0t(e,t={}){const{key:n="custom",methods:r,name:s="Custom Provider",retryDelay:a}=t;return({retryCount:o})=>qEe({key:n,methods:r,name:s,request:e.request.bind(e),retryCount:t.retryCount??o,retryDelay:a,type:"custom"})}class t0t extends Or{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function cj(e,t={}){const{batch:n,fetchOptions:r,key:s="http",methods:a,name:o="HTTP JSON-RPC",onFetchRequest:l,onFetchResponse:c,retryDelay:u,raw:d}=t;return({chain:f,retryCount:x,timeout:g})=>{const{batchSize:v=1e3,wait:w=0}=typeof n=="object"?n:{},C=t.retryCount??x,N=g??t.timeout??1e4,I=f==null?void 0:f.rpcUrls.default.http[0];if(!I)throw new t0t;const P=kpt(I,{fetchOptions:r,onRequest:l,onResponse:c,timeout:N});return qEe({key:s,methods:a,name:o,async request({method:R,params:F}){const U={method:R,params:F},{schedule:L}=B9e({id:I,wait:w,shouldSplitBatch(J){return J.length>v},fn:J=>P.request({body:J}),sort:(J,Z)=>J.id-Z.id}),z=async J=>n?L(J):[await P.request({body:J})],[{error:X,result:ne}]=await z(U);if(d)return{error:X,result:ne};if(X)throw new nie({body:U,error:X,url:I});return ne},retryCount:C,retryDelay:u,timeout:N,type:"http"},{fetchOptions:r,url:I})}}function n0t(e){var f,x,g;const{scheme:t,statement:n,...r}=((f=e.match(r0t))==null?void 0:f.groups)??{},{chainId:s,expirationTime:a,issuedAt:o,notBefore:l,requestId:c,...u}=((x=e.match(s0t))==null?void 0:x.groups)??{},d=(g=e.split("Resources:")[1])==null?void 0:g.split(`
- `).slice(1);return{...r,...u,...s?{chainId:Number(s)}:{},...a?{expirationTime:new Date(a)}:{},...o?{issuedAt:new Date(o)}:{},...l?{notBefore:new Date(l)}:{},...c?{requestId:c}:{},...d?{resources:d}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}const r0t=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,s0t=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;function i0t(e){const{address:t,domain:n,message:r,nonce:s,scheme:a,time:o=new Date}=e;if(n&&r.domain!==n||s&&r.nonce!==s||a&&r.scheme!==a||r.expirationTime&&o>=r.expirationTime||r.notBefore&&o<r.notBefore)return!1;try{if(!r.address||t&&!yie(r.address,t))return!1}catch{return!1}return!0}async function a0t(e,t){const{address:n,domain:r,message:s,nonce:a,scheme:o,signature:l,time:c=new Date,...u}=t,d=n0t(s);if(!d.address||!i0t({address:n,domain:r,message:d,nonce:a,scheme:o,time:c}))return!1;const x=AEe(s);return Rie(e,{address:d.address,hash:x,signature:l,...u})}function o0t(e){return{call:t=>lB(e,t),createAccessList:t=>W9e(e,t),createBlockFilter:()=>Mft(e),createContractEventFilter:t=>q9e(e,t),createEventFilter:t=>G9e(e,t),createPendingTransactionFilter:()=>K9e(e),estimateContractGas:t=>Lft(e,t),estimateGas:t=>uie(e,t),getBalance:t=>cie(e,t),getBlobBaseFee:()=>Dft(e),getBlock:t=>w0(e,t),getBlockNumber:t=>Fk(e,t),getBlockTransactionCount:t=>Vft(e,t),getBytecode:t=>Epe(e,t),getChainId:()=>sie(e),getCode:t=>Epe(e,t),getContractEvents:t=>Y9e(e,t),getEip712Domain:t=>Kft(e,t),getEnsAddress:t=>wft(e,t),getEnsAvatar:t=>H9e(e,t),getEnsName:t=>V9e(e,t),getEnsResolver:t=>Oft(e,t),getEnsText:t=>z9e(e,t),getFeeHistory:t=>Qft(e,t),estimateFeesPerGas:t=>Mut(e,t),getFilterChanges:t=>uB(e,t),getFilterLogs:t=>Zft(e,t),getGasPrice:()=>oie(e),getLogs:t=>Cie(e,t),getProof:t=>umt(e,t),estimateMaxPriorityFeePerGas:t=>Out(e,t),getStorageAt:t=>Jft(e,t),getTransaction:t=>Sie(e,t),getTransactionConfirmations:t=>eht(e,t),getTransactionCount:t=>t9e(e,t),getTransactionReceipt:t=>NZ(e,t),multicall:t=>Q9e(e,t),prepareTransactionRequest:t=>pie(e,t),readContract:t=>q0(e,t),sendRawTransaction:t=>d9e(e,t),simulate:t=>jZ(e,t),simulateBlocks:t=>jZ(e,t),simulateCalls:t=>rmt(e,t),simulateContract:t=>pmt(e,t),verifyMessage:t=>Hmt(e,t),verifySiweMessage:t=>a0t(e,t),verifyTypedData:t=>Vmt(e,t),uninstallFilter:t=>pB(e,t),waitForTransactionReceipt:t=>dmt(e,t),watchBlocks:t=>imt(e,t),watchBlockNumber:t=>EEe(e,t),watchContractEvent:t=>Wmt(e,t),watchEvent:t=>amt(e,t),watchPendingTransactions:t=>omt(e,t)}}async function Lie(e,t={}){let n;if(t.connector){const{connector:u}=t;if(e.state.status==="reconnecting"&&!u.getAccounts&&!u.getChainId)throw new Zmt({connector:u});const[d,f]=await Promise.all([u.getAccounts().catch(x=>{if(t.account===null)return[];throw x}),u.getChainId()]);n={accounts:d,chainId:f,connector:u}}else n=e.state.connections.get(e.state.current);if(!n)throw new Ymt;const r=t.chainId??n.chainId,s=await n.connector.getChainId();if(s!==n.chainId)throw new Qmt({connectionChainId:n.chainId,connectorChainId:s});const a=n.connector;if(a.getClient)return a.getClient({chainId:r});const o=Ou(t.account??n.accounts[0]);if(o&&(o.address=wc(o.address)),t.account&&!n.accounts.some(u=>u.toLowerCase()===o.address.toLowerCase()))throw new Xmt({address:o.address,connector:a});const l=e.chains.find(u=>u.id===r),c=await n.connector.getProvider({chainId:r});return WEe({account:o,chain:l,name:"Connector Client",transport:u=>e0t(c)({...u,retryCount:0})})}async function l0t(e,t={}){var s,a;let n;if(t.connector)n=t.connector;else{const{connections:o,current:l}=e.state,c=o.get(l);n=c==null?void 0:c.connector}const r=e.state.connections;n&&(await n.disconnect(),n.emitter.off("change",e._internal.events.change),n.emitter.off("disconnect",e._internal.events.disconnect),n.emitter.on("connect",e._internal.events.connect),r.delete(n.uid)),e.setState(o=>{if(r.size===0)return{...o,connections:new Map,current:null,status:"disconnected"};const l=r.values().next().value;return{...o,connections:new Map(r),current:l.connector.uid}});{const o=e.state.current;if(!o)return;const l=(s=e.state.connections.get(o))==null?void 0:s.connector;if(!l)return;await((a=e.storage)==null?void 0:a.setItem("recentConnectorId",l.id))}}function GEe(e){return typeof e=="number"?e:e==="wei"?0:Math.abs(xut[e])}function KEe(e){const t=e.state.current,n=e.state.connections.get(t),r=n==null?void 0:n.accounts,s=r==null?void 0:r[0],a=e.chains.find(l=>l.id===(n==null?void 0:n.chainId)),o=e.state.status;switch(o){case"connected":return{address:s,addresses:r,chain:a,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:o};case"reconnecting":return{address:s,addresses:r,chain:a,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!!s,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:o};case"connecting":return{address:s,addresses:r,chain:a,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:o};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:o}}}async function c0t(e,t){const{allowFailure:n=!0,chainId:r,contracts:s,...a}=t,o=e.getClient({chainId:r});return t2(o,Q9e,"multicall")({allowFailure:n,contracts:s,...a})}function YEe(e,t){const{chainId:n,...r}=t,s=e.getClient({chainId:n});return t2(s,q0,"readContract")(r)}async function u0t(e,t){var l;const{allowFailure:n=!0,blockNumber:r,blockTag:s,...a}=t,o=t.contracts;try{const c={};for(const[x,g]of o.entries()){const v=g.chainId??e.state.chainId;c[v]||(c[v]=[]),(l=c[v])==null||l.push({contract:g,index:x})}const u=()=>Object.entries(c).map(([x,g])=>c0t(e,{...a,allowFailure:n,blockNumber:r,blockTag:s,chainId:Number.parseInt(x),contracts:g.map(({contract:v})=>v)})),d=(await Promise.all(u())).flat(),f=Object.values(c).flatMap(x=>x.map(({index:g})=>g));return d.reduce((x,g,v)=>(x&&(x[f[v]]=g),x),[])}catch(c){if(c instanceof F9e)throw c;const u=()=>o.map(d=>YEe(e,{...d,blockNumber:r,blockTag:s}));return n?(await Promise.allSettled(u())).map(d=>d.status==="fulfilled"?{result:d.value,status:"success"}:{error:d.reason,result:void 0,status:"failure"}):await Promise.all(u())}}async function d0t(e,t){const{address:n,blockNumber:r,blockTag:s,chainId:a,token:o,unit:l="ether"}=t;if(o)try{return await eme(e,{balanceAddress:n,chainId:a,symbolType:"string",tokenAddress:o})}catch(x){if(x.name==="ContractFunctionExecutionError"){const g=await eme(e,{balanceAddress:n,chainId:a,symbolType:"bytes32",tokenAddress:o}),v=ict(Rf(g.symbol,{dir:"right"}));return{...g,symbol:v}}throw x}const c=e.getClient({chainId:a}),d=await t2(c,cie,"getBalance")(r?{address:n,blockNumber:r}:{address:n,blockTag:s}),f=e.chains.find(x=>x.id===a)??c.chain;return{decimals:f.nativeCurrency.decimals,formatted:jk(d,GEe(l)),symbol:f.nativeCurrency.symbol,value:d}}async function eme(e,t){const{balanceAddress:n,chainId:r,symbolType:s,tokenAddress:a,unit:o}=t,l={abi:[{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:s}]}],address:a},[c,u,d]=await u0t(e,{allowFailure:!1,contracts:[{...l,functionName:"balanceOf",args:[n],chainId:r},{...l,functionName:"decimals",chainId:r},{...l,functionName:"symbol",chainId:r}]}),f=jk(c??"0",GEe(o??u));return{decimals:u,formatted:f,symbol:d,value:c}}function tme(e){return e.state.chainId}function Ly(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let n,r;if(Array.isArray(e)&&Array.isArray(t)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ly(e[r],t[r]))return!1;return!0}if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const s=Object.keys(e);if(n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(a&&!Ly(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}let dH=[];function nme(e){const t=e.chains;return Ly(dH,t)?dH:(dH=t,t)}function f0t(e,t={}){let n;try{n=e.getClient(t)}catch{}return n}let BI=[];function $Z(e){const t=[...e.state.connections.values()];return e.state.status==="reconnecting"||Ly(BI,t)?BI:(BI=t,t)}let fH=[];function rme(e){const t=e.connectors;return Ly(fH,t)?fH:(fH=t,t)}function h0t(e,t){const{chainId:n,...r}=t,s=e.getClient({chainId:n});return t2(s,H9e,"getEnsAvatar")(r)}function p0t(e,t){const{chainId:n,...r}=t,s=e.getClient({chainId:n});return t2(s,V9e,"getEnsName")(r)}function UZ(e,t={}){const n=f0t(e,t);return n==null?void 0:n.extend(o0t)}let hH=!1;async function m0t(e,t={}){var u,d;if(hH)return[];hH=!0,e.setState(f=>({...f,status:f.current?"reconnecting":"connecting"}));const n=[];if((u=t.connectors)!=null&&u.length)for(const f of t.connectors){let x;typeof f=="function"?x=e._internal.connectors.setup(f):x=f,n.push(x)}else n.push(...e.connectors);let r;try{r=await((d=e.storage)==null?void 0:d.getItem("recentConnectorId"))}catch{}const s={};for(const[,f]of e.state.connections)s[f.connector.id]=1;r&&(s[r]=0);const a=Object.keys(s).length>0?[...n].sort((f,x)=>(s[f.id]??10)-(s[x.id]??10)):n;let o=!1;const l=[],c=[];for(const f of a){const x=await f.getProvider().catch(()=>{});if(!x||c.some(w=>w===x)||!await f.isAuthorized())continue;const v=await f.connect({isReconnecting:!0}).catch(()=>null);v&&(f.emitter.off("connect",e._internal.events.connect),f.emitter.on("change",e._internal.events.change),f.emitter.on("disconnect",e._internal.events.disconnect),e.setState(w=>{const C=new Map(o?w.connections:new Map).set(f.uid,{accounts:v.accounts,chainId:v.chainId,connector:f});return{...w,current:o?w.current:f.uid,connections:C}}),l.push({accounts:v.accounts,chainId:v.chainId,connector:f}),c.push(x),o=!0)}return(e.state.status==="reconnecting"||e.state.status==="connecting")&&(o?e.setState(f=>({...f,status:"connected"})):e.setState(f=>({...f,connections:new Map,current:null,status:"disconnected"}))),hH=!1,l}async function x0t(e,t){const{account:n,connector:r,...s}=t;let a;return typeof n=="object"&&n.type==="local"?a=e.getClient():a=await Lie(e,{account:n,connector:r}),t2(a,fmt,"signMessage")({...s,...n?{account:n}:{}})}async function g0t(e,t){const{account:n,connector:r,...s}=t;let a;return typeof n=="object"&&n.type==="local"?a=e.getClient():a=await Lie(e,{account:n,connector:r}),t2(a,hmt,"signTypedData")({...s,...n?{account:n}:{}})}class Dh extends g1{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class b0t extends g1{constructor({connector:t}){super(`"${t.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function y0t(e,t){var o;const{addEthereumChainParameter:n,chainId:r}=t,s=e.state.connections.get(((o=t.connector)==null?void 0:o.uid)??e.state.current);if(s){const l=s.connector;if(!l.switchChain)throw new b0t({connector:l});return await l.switchChain({addEthereumChainParameter:n,chainId:r})}const a=e.chains.find(l=>l.id===r);if(!a)throw new v3;return e.setState(l=>({...l,chainId:r})),a}function XEe(e,t){const{onChange:n}=t;return e.subscribe(()=>KEe(e),n,{equalityFn(r,s){const{connector:a,...o}=r,{connector:l,...c}=s;return Ly(o,c)&&(a==null?void 0:a.id)===(l==null?void 0:l.id)&&(a==null?void 0:a.uid)===(l==null?void 0:l.uid)}})}function v0t(e,t){const{onChange:n}=t;return e.subscribe(r=>r.chainId,n)}function w0t(e,t){const{onChange:n}=t;return e.subscribe(()=>$Z(e),n,{equalityFn:Ly})}function C0t(e,t){const{onChange:n}=t;return e._internal.connectors.subscribe((r,s)=>{n(Object.values(r),s)})}function S0t(e,t){const{onChange:n}=t;return e.subscribe(()=>UZ(e),n,{equalityFn(r,s){return(r==null?void 0:r.uid)===(s==null?void 0:s.uid)}})}async function N0t(e,t){const{account:n,chainId:r,connector:s,...a}=t;let o;return typeof n=="object"&&(n==null?void 0:n.type)==="local"?o=e.getClient({chainId:r}):o=await Lie(e,{account:n??void 0,chainId:r,connector:s}),await t2(o,qmt,"writeContract")({...a,...n?{account:n}:{},chain:r?{id:r}:null})}gB.type="injected";function gB(e={}){const{shimDisconnect:t=!0,unstable_shimAsyncInject:n}=e;function r(){const c=e.target;if(typeof c=="function"){const u=c();if(u)return u}return typeof c=="object"?c:typeof c=="string"?{...A0t[c]??{id:c,name:`${c[0].toUpperCase()}${c.slice(1)}`,provider:`is${c[0].toUpperCase()}${c.slice(1)}`}}:{id:"injected",name:"Injected",provider(u){return u==null?void 0:u.ethereum}}}let s,a,o,l;return c=>({get icon(){return r().icon},get id(){return r().id},get name(){return r().name},get supportsSimulation(){return!0},type:gB.type,async setup(){const u=await this.getProvider();u!=null&&u.on&&e.target&&(o||(o=this.onConnect.bind(this),u.on("connect",o)),s||(s=this.onAccountsChanged.bind(this),u.on("accountsChanged",s)))},async connect({chainId:u,isReconnecting:d}={}){var g,v,w,C,N,I;const f=await this.getProvider();if(!f)throw new Dh;let x=[];if(d)x=await this.getAccounts().catch(()=>[]);else if(t)try{x=(C=(w=(v=(g=(await f.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:g.caveats)==null?void 0:v[0])==null?void 0:w.value)==null?void 0:C.map(R=>wc(R)),x.length>0&&(x=await this.getAccounts())}catch(P){const R=P;if(R.code===mo.code)throw new mo(R);if(R.code===by.code)throw R}try{!(x!=null&&x.length)&&!d&&(x=(await f.request({method:"eth_requestAccounts"})).map(F=>wc(F))),o&&(f.removeListener("connect",o),o=void 0),s||(s=this.onAccountsChanged.bind(this),f.on("accountsChanged",s)),a||(a=this.onChainChanged.bind(this),f.on("chainChanged",a)),l||(l=this.onDisconnect.bind(this),f.on("disconnect",l));let P=await this.getChainId();if(u&&P!==u){const R=await this.switchChain({chainId:u}).catch(F=>{if(F.code===mo.code)throw F;return{id:P}});P=(R==null?void 0:R.id)??P}return t&&await((N=c.storage)==null?void 0:N.removeItem(`${this.id}.disconnected`)),e.target||await((I=c.storage)==null?void 0:I.setItem("injected.connected",!0)),{accounts:x,chainId:P}}catch(P){const R=P;throw R.code===mo.code?new mo(R):R.code===by.code?new by(R):R}},async disconnect(){var d,f;const u=await this.getProvider();if(!u)throw new Dh;a&&(u.removeListener("chainChanged",a),a=void 0),l&&(u.removeListener("disconnect",l),l=void 0),o||(o=this.onConnect.bind(this),u.on("connect",o));try{await Tie(()=>u.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}t&&await((d=c.storage)==null?void 0:d.setItem(`${this.id}.disconnected`,!0)),e.target||await((f=c.storage)==null?void 0:f.removeItem("injected.connected"))},async getAccounts(){const u=await this.getProvider();if(!u)throw new Dh;return(await u.request({method:"eth_accounts"})).map(f=>wc(f))},async getChainId(){const u=await this.getProvider();if(!u)throw new Dh;const d=await u.request({method:"eth_chainId"});return Number(d)},async getProvider(){if(typeof window>"u")return;let u;const d=r();return typeof d.provider=="function"?u=d.provider(window):typeof d.provider=="string"?u=LF(window,d.provider):u=d.provider,u&&!u.removeListener&&("off"in u&&typeof u.off=="function"?u.removeListener=u.off:u.removeListener=()=>{}),u},async isAuthorized(){var u,d;try{if(t&&await((u=c.storage)==null?void 0:u.getItem(`${this.id}.disconnected`))||!e.target&&!await((d=c.storage)==null?void 0:d.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(n!==void 0&&n!==!1){const v=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",v),!!await this.getProvider()),w=typeof n=="number"?n:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(N=>window.addEventListener("ethereum#initialized",()=>N(v()),{once:!0}))]:[],new Promise(N=>setTimeout(()=>N(v()),w))]))return!0}throw new Dh}return!!(await sM(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:u,chainId:d}){var v,w,C,N;const f=await this.getProvider();if(!f)throw new Dh;const x=c.chains.find(I=>I.id===d);if(!x)throw new Zh(new v3);const g=new Promise(I=>{const P=R=>{"chainId"in R&&R.chainId===d&&(c.emitter.off("change",P),I())};c.emitter.on("change",P)});try{return await Promise.all([f.request({method:"wallet_switchEthereumChain",params:[{chainId:Os(d)}]}).then(async()=>{await this.getChainId()===d&&c.emitter.emit("change",{chainId:d})}),g]),x}catch(I){const P=I;if(P.code===4902||((w=(v=P==null?void 0:P.data)==null?void 0:v.originalError)==null?void 0:w.code)===4902)try{const{default:R,...F}=x.blockExplorers??{};let U;u!=null&&u.blockExplorerUrls?U=u.blockExplorerUrls:R&&(U=[R.url,...Object.values(F).map(X=>X.url)]);let L;(C=u==null?void 0:u.rpcUrls)!=null&&C.length?L=u.rpcUrls:L=[((N=x.rpcUrls.default)==null?void 0:N.http[0])??""];const z={blockExplorerUrls:U,chainId:Os(d),chainName:(u==null?void 0:u.chainName)??x.name,iconUrls:u==null?void 0:u.iconUrls,nativeCurrency:(u==null?void 0:u.nativeCurrency)??x.nativeCurrency,rpcUrls:L};return await Promise.all([f.request({method:"wallet_addEthereumChain",params:[z]}).then(async()=>{if(await this.getChainId()===d)c.emitter.emit("change",{chainId:d});else throw new mo(new Error("User rejected switch after adding network."))}),g]),x}catch(R){throw new mo(R)}throw P.code===mo.code?new mo(P):new Zh(P)}},async onAccountsChanged(u){var d;if(u.length===0)this.onDisconnect();else if(c.emitter.listenerCount("connect")){const f=(await this.getChainId()).toString();this.onConnect({chainId:f}),t&&await((d=c.storage)==null?void 0:d.removeItem(`${this.id}.disconnected`))}else c.emitter.emit("change",{accounts:u.map(f=>wc(f))})},onChainChanged(u){const d=Number(u);c.emitter.emit("change",{chainId:d})},async onConnect(u){const d=await this.getAccounts();if(d.length===0)return;const f=Number(u.chainId);c.emitter.emit("connect",{accounts:d,chainId:f});const x=await this.getProvider();x&&(o&&(x.removeListener("connect",o),o=void 0),s||(s=this.onAccountsChanged.bind(this),x.on("accountsChanged",s)),a||(a=this.onChainChanged.bind(this),x.on("chainChanged",a)),l||(l=this.onDisconnect.bind(this),x.on("disconnect",l)))},async onDisconnect(u){const d=await this.getProvider();u&&u.code===1013&&d&&(await this.getAccounts()).length||(c.emitter.emit("disconnect"),d&&(a&&(d.removeListener("chainChanged",a),a=void 0),l&&(d.removeListener("disconnect",l),l=void 0),o||(o=this.onConnect.bind(this),d.on("connect",o))))}})}const A0t={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(e){return e!=null&&e.coinbaseWalletExtension?e.coinbaseWalletExtension:LF(e,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(e){return LF(e,t=>{if(!t.isMetaMask||t.isBraveWallet&&!t._events&&!t._state)return!1;const n=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPhantom","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const r of n)if(t[r])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(e){var t,n;return(t=e==null?void 0:e.phantom)!=null&&t.ethereum?(n=e.phantom)==null?void 0:n.ethereum:LF(e,"isPhantom")}}};function LF(e,t){function n(s){return typeof t=="function"?t(s):typeof t=="string"?s[t]:!0}const r=e.ethereum;if(r!=null&&r.providers)return r.providers.find(s=>n(s));if(r&&n(r))return r}function j0t(e){if(typeof window>"u")return;const t=n=>e(n.detail);return window.addEventListener("eip6963:announceProvider",t),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",t)}function E0t(){const e=new Set;let t=[];const n=()=>j0t(s=>{t.some(({info:a})=>a.uuid===s.info.uuid)||(t=[...t,s],e.forEach(a=>a(t,{added:[s]})))});let r=n();return{_listeners(){return e},clear(){e.forEach(s=>s([],{removed:[...t]})),t=[]},destroy(){this.clear(),e.clear(),r==null||r()},findProvider({rdns:s}){return t.find(a=>a.info.rdns===s)},getProviders(){return t},reset(){this.clear(),r==null||r(),r=n()},subscribe(s,{emitImmediately:a}={}){return e.add(s),a&&s(t,{added:t}),()=>e.delete(s)}}}const _0t=e=>(t,n,r)=>{const s=r.subscribe;return r.subscribe=(o,l,c)=>{let u=o;if(l){const d=(c==null?void 0:c.equalityFn)||Object.is;let f=o(r.getState());u=x=>{const g=o(x);if(!d(f,g)){const v=f;l(f=g,v)}},c!=null&&c.fireImmediately&&l(f,f)}return s(u)},e(t,n,r)},k0t=_0t;function T0t(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var a;const o=c=>c===null?null:JSON.parse(c,void 0),l=(a=n.getItem(s))!=null?a:null;return l instanceof Promise?l.then(o):o(l)},setItem:(s,a)=>n.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>n.removeItem(s)}}const zZ=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return zZ(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return zZ(r)(n)}}}},I0t=(e,t)=>(n,r,s)=>{let a={storage:T0t(()=>localStorage),partialize:w=>w,version:0,merge:(w,C)=>({...C,...w}),...t},o=!1;const l=new Set,c=new Set;let u=a.storage;if(!u)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...w)},r,s);const d=()=>{const w=a.partialize({...r()});return u.setItem(a.name,{state:w,version:a.version})},f=s.setState;s.setState=(w,C)=>{f(w,C),d()};const x=e((...w)=>{n(...w),d()},r,s);s.getInitialState=()=>x;let g;const v=()=>{var w,C;if(!u)return;o=!1,l.forEach(I=>{var P;return I((P=r())!=null?P:x)});const N=((C=a.onRehydrateStorage)==null?void 0:C.call(a,(w=r())!=null?w:x))||void 0;return zZ(u.getItem.bind(u))(a.name).then(I=>{if(I)if(typeof I.version=="number"&&I.version!==a.version){if(a.migrate)return[!0,a.migrate(I.state,I.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,I.state];return[!1,void 0]}).then(I=>{var P;const[R,F]=I;if(g=a.merge(F,(P=r())!=null?P:x),n(g,!0),R)return d()}).then(()=>{N==null||N(g,void 0),g=r(),o=!0,c.forEach(I=>I(g))}).catch(I=>{N==null||N(void 0,I)})};return s.persist={setOptions:w=>{a={...a,...w},w.storage&&(u=w.storage)},clearStorage:()=>{u==null||u.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>v(),hasHydrated:()=>o,onHydrate:w=>(l.add(w),()=>{l.delete(w)}),onFinishHydration:w=>(c.add(w),()=>{c.delete(w)})},a.skipHydration||v(),g||x},P0t=I0t,sme=e=>{let t;const n=new Set,r=(u,d)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const x=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(g=>g(t,x))}},s=()=>t,l={setState:r,getState:s,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u))},c=t=e(r,s,l);return l},pH=e=>e?sme(e):sme;var mH={exports:{}},ime;function F0t(){return ime||(ime=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function s(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,f,x){if(typeof d!="function")throw new TypeError("The listener must be a function");var g=new s(d,f||c,x),v=n?n+u:u;return c._events[v]?c._events[v].fn?c._events[v]=[c._events[v],g]:c._events[v].push(g):(c._events[v]=g,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=n?n+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var x=0,g=f.length,v=new Array(g);x<g;x++)v[x]=f[x].fn;return v},l.prototype.listenerCount=function(u){var d=n?n+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,x,g,v){var w=n?n+u:u;if(!this._events[w])return!1;var C=this._events[w],N=arguments.length,I,P;if(C.fn){switch(C.once&&this.removeListener(u,C.fn,void 0,!0),N){case 1:return C.fn.call(C.context),!0;case 2:return C.fn.call(C.context,d),!0;case 3:return C.fn.call(C.context,d,f),!0;case 4:return C.fn.call(C.context,d,f,x),!0;case 5:return C.fn.call(C.context,d,f,x,g),!0;case 6:return C.fn.call(C.context,d,f,x,g,v),!0}for(P=1,I=new Array(N-1);P<N;P++)I[P-1]=arguments[P];C.fn.apply(C.context,I)}else{var R=C.length,F;for(P=0;P<R;P++)switch(C[P].once&&this.removeListener(u,C[P].fn,void 0,!0),N){case 1:C[P].fn.call(C[P].context);break;case 2:C[P].fn.call(C[P].context,d);break;case 3:C[P].fn.call(C[P].context,d,f);break;case 4:C[P].fn.call(C[P].context,d,f,x);break;default:if(!I)for(F=1,I=new Array(N-1);F<N;F++)I[F-1]=arguments[F];C[P].fn.apply(C[P].context,I)}}return!0},l.prototype.on=function(u,d,f){return a(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return a(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,x){var g=n?n+u:u;if(!this._events[g])return this;if(!d)return o(this,g),this;var v=this._events[g];if(v.fn)v.fn===d&&(!x||v.once)&&(!f||v.context===f)&&o(this,g);else{for(var w=0,C=[],N=v.length;w<N;w++)(v[w].fn!==d||x&&!v[w].once||f&&v[w].context!==f)&&C.push(v[w]);C.length?this._events[g]=C.length===1?C[0]:C:o(this,g)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&o(this,d)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l}(mH)),mH.exports}var O0t=F0t();const Die=ji(O0t);let M0t=class{constructor(t){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new Die})}on(t,n){this._emitter.on(t,n)}once(t,n){this._emitter.once(t,n)}off(t,n){this._emitter.off(t,n)}emit(t,...n){const r=n[0];this._emitter.emit(t,{uid:this.uid,...r})}listenerCount(t){return this._emitter.listenerCount(t)}};function R0t(e){return new M0t(e)}function L0t(e,t){return JSON.parse(e,(n,r)=>{let s=r;return(s==null?void 0:s.__type)==="bigint"&&(s=BigInt(s.value)),(s==null?void 0:s.__type)==="Map"&&(s=new Map(s.value)),(t==null?void 0:t(n,s))??s})}function ame(e,t){return e.slice(0,t).join(".")||"."}function ome(e,t){const{length:n}=e;for(let r=0;r<n;++r)if(e[r]===t)return r+1;return 0}function D0t(e,t){const n=typeof e=="function",r=typeof t=="function",s=[],a=[];return function(l,c){if(typeof c=="object")if(s.length){const u=ome(s,this);u===0?s[s.length]=this:(s.splice(u),a.splice(u)),a[a.length]=l;const d=ome(s,c);if(d!==0)return r?t.call(this,l,c,ame(a,d)):`[ref=${ame(a,d)}]`}else s[0]=c,a[0]=l;return n?e.call(this,l,c):c}}function B0t(e,t,n,r){return JSON.stringify(e,D0t((s,a)=>{let o=a;return typeof o=="bigint"&&(o={__type:"bigint",value:a.toString()}),o instanceof Map&&(o={__type:"Map",value:Array.from(a.entries())}),(t==null?void 0:t(s,o))??o},r),n??void 0)}function $0t(e){const{deserialize:t=L0t,key:n="wagmi",serialize:r=B0t,storage:s=QEe}=e;function a(o){return o instanceof Promise?o.then(l=>l).catch(()=>null):o}return{...s,key:n,async getItem(o,l){const c=s.getItem(`${n}.${o}`),u=await a(c);return u?t(u)??null:l??null},async setItem(o,l){const c=`${n}.${o}`;l===null?await a(s.removeItem(c)):await a(s.setItem(c,r(l)))},async removeItem(o){await a(s.removeItem(`${n}.${o}`))}}}const QEe={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function U0t(){const e=typeof window<"u"&&window.localStorage?window.localStorage:QEe;return{getItem(t){return e.getItem(t)},removeItem(t){e.removeItem(t)},setItem(t,n){try{e.setItem(t,n)}catch{}}}}const HZ=256;let $I=HZ,UI;function z0t(e=11){if(!UI||$I+e>HZ*2){UI="",$I=0;for(let t=0;t<HZ;t++)UI+=(256+Math.random()*256|0).toString(16).substring(1)}return UI.substring($I,$I+++e)}function H0t(e){const{multiInjectedProviderDiscovery:t=!0,storage:n=$0t({storage:U0t()}),syncConnectedChain:r=!0,ssr:s=!1,...a}=e,o=typeof window<"u"&&t?E0t():void 0,l=pH(()=>a.chains),c=pH(()=>{const F=[],U=new Set;for(const L of a.connectors??[]){const z=u(L);if(F.push(z),!s&&z.rdns){const X=typeof z.rdns=="string"?[z.rdns]:z.rdns;for(const ne of X)U.add(ne)}}if(!s&&o){const L=o.getProviders();for(const z of L)U.has(z.info.rdns)||F.push(u(d(z)))}return F});function u(F){var z;const U=R0t(z0t()),L={...F({emitter:U,chains:l.getState(),storage:n,transports:a.transports}),emitter:U,uid:U.uid};return U.on("connect",P),(z=L.setup)==null||z.call(L),L}function d(F){const{info:U}=F,L=F.provider;return gB({target:{...U,id:U.rdns,provider:L}})}const f=new Map;function x(F={}){const U=F.chainId??C.getState().chainId,L=l.getState().find(X=>X.id===U);if(F.chainId&&!L)throw new v3;{const X=f.get(C.getState().chainId);if(X&&!L)return X;if(!L)throw new v3}{const X=f.get(U);if(X)return X}let z;if(a.client)z=a.client({chain:L});else{const X=L.id,ne=l.getState().map(re=>re.id),J={},Z=Object.entries(a);for(const[re,he]of Z)if(!(re==="chains"||re==="client"||re==="connectors"||re==="transports"))if(typeof he=="object")if(X in he)J[re]=he[X];else{if(ne.some(ie=>ie in he))continue;J[re]=he}else J[re]=he;z=WEe({...J,chain:L,batch:J.batch??{multicall:!0},transport:re=>a.transports[X]({...re,connectors:c})})}return f.set(U,z),z}function g(){return{chainId:l.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let v;const w="0.0.0-canary-";RF.startsWith(w)?v=Number.parseInt(RF.replace(w,"")):v=Number.parseInt(RF.split(".")[0]??"0");const C=pH(k0t(n?P0t(g,{migrate(F,U){if(U===v)return F;const L=g(),z=N(F,L.chainId);return{...L,chainId:z}},name:"store",partialize(F){return{connections:{__type:"Map",value:Array.from(F.connections.entries()).map(([U,L])=>{const{id:z,name:X,type:ne,uid:J}=L.connector;return[U,{...L,connector:{id:z,name:X,type:ne,uid:J}}]})},chainId:F.chainId,current:F.current}},merge(F,U){typeof F=="object"&&F&&"status"in F&&delete F.status;const L=N(F,U.chainId);return{...U,...F,chainId:L}},skipHydration:s,storage:n,version:v}):g));C.setState(g());function N(F,U){return F&&typeof F=="object"&&"chainId"in F&&typeof F.chainId=="number"&&l.getState().some(L=>L.id===F.chainId)?F.chainId:U}r&&C.subscribe(({connections:F,current:U})=>{var L;return U?(L=F.get(U))==null?void 0:L.chainId:void 0},F=>{if(l.getState().some(L=>L.id===F))return C.setState(L=>({...L,chainId:F??L.chainId}))}),o==null||o.subscribe(F=>{const U=new Set,L=new Set;for(const X of c.getState())if(U.add(X.id),X.rdns){const ne=typeof X.rdns=="string"?[X.rdns]:X.rdns;for(const J of ne)L.add(J)}const z=[];for(const X of F){if(L.has(X.info.rdns))continue;const ne=u(d(X));U.has(ne.id)||z.push(ne)}n&&!C.persist.hasHydrated()||c.setState(X=>[...X,...z],!0)});function I(F){C.setState(U=>{const L=U.connections.get(F.uid);return L?{...U,connections:new Map(U.connections).set(F.uid,{accounts:F.accounts??L.accounts,chainId:F.chainId??L.chainId,connector:L.connector})}:U})}function P(F){C.getState().status==="connecting"||C.getState().status==="reconnecting"||C.setState(U=>{const L=c.getState().find(z=>z.uid===F.uid);return L?(L.emitter.listenerCount("connect")&&L.emitter.off("connect",I),L.emitter.listenerCount("change")||L.emitter.on("change",I),L.emitter.listenerCount("disconnect")||L.emitter.on("disconnect",R),{...U,connections:new Map(U.connections).set(F.uid,{accounts:F.accounts,chainId:F.chainId,connector:L}),current:F.uid,status:"connected"}):U})}function R(F){C.setState(U=>{const L=U.connections.get(F.uid);if(L){const X=L.connector;X.emitter.listenerCount("change")&&L.connector.emitter.off("change",I),X.emitter.listenerCount("disconnect")&&L.connector.emitter.off("disconnect",R),X.emitter.listenerCount("connect")||L.connector.emitter.on("connect",P)}if(U.connections.delete(F.uid),U.connections.size===0)return{...U,connections:new Map,current:null,status:"disconnected"};const z=U.connections.values().next().value;return{...U,connections:new Map(U.connections),current:z.connector.uid}})}return{get chains(){return l.getState()},get connectors(){return c.getState()},storage:n,getClient:x,get state(){return C.getState()},setState(F){let U;typeof F=="function"?U=F(C.getState()):U=F;const L=g();typeof U!="object"&&(U=L),Object.keys(L).some(X=>!(X in U))&&(U=L),C.setState(U,!0)},subscribe(F,U,L){return C.subscribe(F,U,L?{...L,fireImmediately:L.emitImmediately}:void 0)},_internal:{mipd:o,store:C,ssr:!!s,syncConnectedChain:r,transports:a.transports,chains:{setState(F){const U=typeof F=="function"?F(l.getState()):F;if(U.length!==0)return l.setState(U,!0)},subscribe(F){return l.subscribe(F)}},connectors:{providerDetailToConnector:d,setup:u,setState(F){return c.setState(typeof F=="function"?F(c.getState()):F,!0)},subscribe(F){return c.subscribe(F)}},events:{change:I,connect:P,disconnect:R}}}}function V0t(e,t){const{initialState:n,reconnectOnMount:r}=t;return n&&!e._internal.store.persist.hasHydrated()&&e.setState({...n,chainId:e.chains.some(s=>s.id===n.chainId)?n.chainId:e.chains[0].id,connections:r?n.connections:new Map,status:r?"reconnecting":"disconnected"}),{async onMount(){e._internal.ssr&&(await e._internal.store.persist.rehydrate(),e._internal.mipd&&e._internal.connectors.setState(s=>{var c;const a=new Set;for(const u of s??[])if(u.rdns){const d=Array.isArray(u.rdns)?u.rdns:[u.rdns];for(const f of d)a.add(f)}const o=[],l=((c=e._internal.mipd)==null?void 0:c.getProviders())??[];for(const u of l){if(a.has(u.info.rdns))continue;const d=e._internal.connectors.providerDetailToConnector(u),f=e._internal.connectors.setup(d);o.push(f)}return[...s,...o]})),r?m0t(e):e.storage&&e.setState(s=>({...s,connections:new Map}))}}}function W0t(e){var a,o,l;const{chain:t}=e,n=t.rpcUrls.default.http[0];if(!e.transports)return[n];const r=(o=(a=e.transports)==null?void 0:a[t.id])==null?void 0:o.call(a,{chain:t});return(((l=r==null?void 0:r.value)==null?void 0:l.transports)||[r]).map(({value:c})=>(c==null?void 0:c.url)||n)}function q0t(e){const{children:t,config:n,initialState:r,reconnectOnMount:s=!0}=e,{onMount:a}=V0t(n,{initialState:r,reconnectOnMount:s});n._internal.ssr||a();const o=m.useRef(!0);return m.useEffect(()=>{if(o.current&&n._internal.ssr)return a(),()=>{o.current=!1}},[]),t}const ZEe=m.createContext(void 0);function G0t(e){const{children:t,config:n}=e,r={value:n};return m.createElement(q0t,e,m.createElement(ZEe.Provider,r,t))}const K0t="2.14.16",Y0t=()=>`wagmi@${K0t}`;let X0t=class extends g1{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiError"})}get docsBaseUrl(){return"https://wagmi.sh/react"}get version(){return Y0t()}};class Q0t extends X0t{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function wl(e={}){const t=e.config??m.useContext(ZEe);if(!t)throw new Q0t;return t}function Z0t(e,t){const{onChange:n}=t;return e._internal.chains.subscribe((r,s)=>{n(r,s)})}var xH={exports:{}},gH={},bH={exports:{}},yH={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var lme;function J0t(){if(lme)return yH;lme=1;var e=tx();function t(f,x){return f===x&&(f!==0||1/f===1/x)||f!==f&&x!==x}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function l(f,x){var g=x(),v=r({inst:{value:g,getSnapshot:x}}),w=v[0].inst,C=v[1];return a(function(){w.value=g,w.getSnapshot=x,c(w)&&C({inst:w})},[f,g,x]),s(function(){return c(w)&&C({inst:w}),f(function(){c(w)&&C({inst:w})})},[f]),o(g),g}function c(f){var x=f.getSnapshot;f=f.value;try{var g=x();return!n(f,g)}catch{return!0}}function u(f,x){return x()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:l;return yH.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,yH}var cme;function ext(){return cme||(cme=1,bH.exports=J0t()),bH.exports}/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ume;function txt(){if(ume)return gH;ume=1;var e=tx(),t=ext();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,l=e.useMemo,c=e.useDebugValue;return gH.useSyncExternalStoreWithSelector=function(u,d,f,x,g){var v=a(null);if(v.current===null){var w={hasValue:!1,value:null};v.current=w}else w=v.current;v=l(function(){function N(U){if(!I){if(I=!0,P=U,U=x(U),g!==void 0&&w.hasValue){var L=w.value;if(g(L,U))return R=L}return R=U}if(L=R,r(P,U))return L;var z=x(U);return g!==void 0&&g(L,z)?(P=U,L):(P=U,R=z)}var I=!1,P,R,F=f===void 0?null:f;return[function(){return N(d())},F===null?void 0:function(){return N(F())}]},[d,f,x,g]);var C=s(u,v[0],v[1]);return o(function(){w.hasValue=!0,w.value=C},[C]),c(C),C},gH}var dme;function nxt(){return dme||(dme=1,xH.exports=txt()),xH.exports}var JEe=nxt();const vH=e=>typeof e=="object"&&!Array.isArray(e);function rxt(e,t,n=t,r=Ly){const s=m.useRef([]),a=JEe.useSyncExternalStoreWithSelector(e,t,n,o=>o,(o,l)=>{if(vH(o)&&vH(l)&&s.current.length){for(const c of s.current)if(!r(o[c],l[c]))return!1;return!0}return r(o,l)});return m.useMemo(()=>{if(vH(a)){const o={...a};let l={};for(const[c,u]of Object.entries(o))l={...l,[c]:{configurable:!1,enumerable:!0,get:()=>(s.current.includes(c)||s.current.push(c),u)}};return Object.defineProperties(o,l),o}return a},[a])}function Yr(e={}){const t=wl(e);return rxt(n=>XEe(t,{onChange:n}),()=>KEe(t))}function e_e(e={}){const{onConnect:t,onDisconnect:n}=e,r=wl(e);m.useEffect(()=>XEe(r,{onChange(s,a){if((a.status==="reconnecting"||a.status==="connecting"&&a.address===void 0)&&s.status==="connected"){const{address:o,addresses:l,chain:c,chainId:u,connector:d}=s,f=a.status==="reconnecting"||a.status===void 0;t==null||t({address:o,addresses:l,chain:c,chainId:u,connector:d,isReconnected:f})}else a.status==="connected"&&s.status==="disconnected"&&(n==null||n())}}),[r,t,n])}var gA=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},w3=typeof window>"u"||"Deno"in globalThis;function Oh(){}function sxt(e,t){return typeof e=="function"?e(t):e}function VZ(e){return typeof e=="number"&&e>=0&&e!==1/0}function t_e(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ZC(e,t){return typeof e=="function"?e(t):e}function Wp(e,t){return typeof e=="function"?e(t):e}function fme(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==Bie(o,t.options))return!1}else if(!rE(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function hme(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(C3(t.options.mutationKey)!==C3(a))return!1}else if(!rE(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Bie(e,t){return((t==null?void 0:t.queryKeyHashFn)||C3)(e)}function C3(e){return JSON.stringify(e,(t,n)=>WZ(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function rE(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>rE(e[n],t[n])):!1}function $ie(e,t){if(e===t)return e;const n=pme(e)&&pme(t);if(n||WZ(e)&&WZ(t)){const r=n?e:Object.keys(e),s=r.length,a=n?t:Object.keys(t),o=a.length,l=n?[]:{};let c=0;for(let u=0;u<o;u++){const d=n?u:a[u];(!n&&r.includes(d)||n)&&e[d]===void 0&&t[d]===void 0?(l[d]=void 0,c++):(l[d]=$ie(e[d],t[d]),l[d]===e[d]&&e[d]!==void 0&&c++)}return s===o&&c===s?e:l}return t}function lM(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function pme(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function WZ(e){if(!mme(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!mme(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function mme(e){return Object.prototype.toString.call(e)==="[object Object]"}function ixt(e){return new Promise(t=>{setTimeout(t,e)})}function qZ(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?$ie(e,t):t}function axt(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function oxt(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Uie=Symbol();function n_e(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Uie?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var lw,Pb,b4,vNe,lxt=(vNe=class extends gA{constructor(){super();Ln(this,lw);Ln(this,Pb);Ln(this,b4);Ht(this,b4,t=>{if(!w3&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){$e(this,Pb)||this.setEventListener($e(this,b4))}onUnsubscribe(){var t;this.hasListeners()||((t=$e(this,Pb))==null||t.call(this),Ht(this,Pb,void 0))}setEventListener(t){var n;Ht(this,b4,t),(n=$e(this,Pb))==null||n.call(this),Ht(this,Pb,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){$e(this,lw)!==t&&(Ht(this,lw,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof $e(this,lw)=="boolean"?$e(this,lw):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},lw=new WeakMap,Pb=new WeakMap,b4=new WeakMap,vNe),zie=new lxt,y4,Fb,v4,wNe,cxt=(wNe=class extends gA{constructor(){super();Ln(this,y4,!0);Ln(this,Fb);Ln(this,v4);Ht(this,v4,t=>{if(!w3&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){$e(this,Fb)||this.setEventListener($e(this,v4))}onUnsubscribe(){var t;this.hasListeners()||((t=$e(this,Fb))==null||t.call(this),Ht(this,Fb,void 0))}setEventListener(t){var n;Ht(this,v4,t),(n=$e(this,Fb))==null||n.call(this),Ht(this,Fb,t(this.setOnline.bind(this)))}setOnline(t){$e(this,y4)!==t&&(Ht(this,y4,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return $e(this,y4)}},y4=new WeakMap,Fb=new WeakMap,v4=new WeakMap,wNe),cM=new cxt;function GZ(){let e,t;const n=new Promise((s,a)=>{e=s,t=a});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}function uxt(e){return Math.min(1e3*2**e,3e4)}function r_e(e){return(e??"online")==="online"?cM.isOnline():!0}var s_e=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function wH(e){return e instanceof s_e}function i_e(e){let t=!1,n=0,r=!1,s;const a=GZ(),o=w=>{var C;r||(x(new s_e(w)),(C=e.abort)==null||C.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>zie.isFocused()&&(e.networkMode==="always"||cM.isOnline())&&e.canRun(),d=()=>r_e(e.networkMode)&&e.canRun(),f=w=>{var C;r||(r=!0,(C=e.onSuccess)==null||C.call(e,w),s==null||s(),a.resolve(w))},x=w=>{var C;r||(r=!0,(C=e.onError)==null||C.call(e,w),s==null||s(),a.reject(w))},g=()=>new Promise(w=>{var C;s=N=>{(r||u())&&w(N)},(C=e.onPause)==null||C.call(e)}).then(()=>{var w;s=void 0,r||(w=e.onContinue)==null||w.call(e)}),v=()=>{if(r)return;let w;const C=n===0?e.initialPromise:void 0;try{w=C??e.fn()}catch(N){w=Promise.reject(N)}Promise.resolve(w).then(f).catch(N=>{var U;if(r)return;const I=e.retry??(w3?0:3),P=e.retryDelay??uxt,R=typeof P=="function"?P(n,N):P,F=I===!0||typeof I=="number"&&n<I||typeof I=="function"&&I(n,N);if(t||!F){x(N);return}n++,(U=e.onFail)==null||U.call(e,n,N),ixt(R).then(()=>u()?void 0:g()).then(()=>{t?x(N):v()})})};return{promise:a,cancel:o,continue:()=>(s==null||s(),a),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?v():g().then(v),a)}}var dxt=e=>setTimeout(e,0);function fxt(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=dxt;const a=l=>{t?e.push(l):s(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var Gl=fxt(),cw,CNe,a_e=(CNe=class{constructor(){Ln(this,cw)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),VZ(this.gcTime)&&Ht(this,cw,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(w3?1/0:5*60*1e3))}clearGcTimeout(){$e(this,cw)&&(clearTimeout($e(this,cw)),Ht(this,cw,void 0))}},cw=new WeakMap,CNe),w4,C4,kh,uw,pu,G_,dw,Op,Zx,SNe,hxt=(SNe=class extends a_e{constructor(t){super();Ln(this,Op);Ln(this,w4);Ln(this,C4);Ln(this,kh);Ln(this,uw);Ln(this,pu);Ln(this,G_);Ln(this,dw);Ht(this,dw,!1),Ht(this,G_,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ht(this,uw,t.client),Ht(this,kh,$e(this,uw).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ht(this,w4,pxt(this.options)),this.state=t.state??$e(this,w4),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=$e(this,pu))==null?void 0:t.promise}setOptions(t){this.options={...$e(this,G_),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&$e(this,kh).remove(this)}setData(t,n){const r=qZ(this.state.data,t,this.options);return yr(this,Op,Zx).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){yr(this,Op,Zx).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=$e(this,pu))==null?void 0:r.promise;return(s=$e(this,pu))==null||s.cancel(t),n?n.then(Oh).catch(Oh):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState($e(this,w4))}isActive(){return this.observers.some(t=>Wp(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Uie||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!t_e(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=$e(this,pu))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=$e(this,pu))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),$e(this,kh).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||($e(this,pu)&&($e(this,dw)?$e(this,pu).cancel({revert:!0}):$e(this,pu).cancelRetry()),this.scheduleGc()),$e(this,kh).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||yr(this,Op,Zx).call(this,{type:"invalidate"})}fetch(t,n){var c,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if($e(this,pu))return $e(this,pu).continueRetry(),$e(this,pu).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(x=>x.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(Ht(this,dw,!0),r.signal)})},a=()=>{const f=n_e(this.options,n),x={client:$e(this,uw),queryKey:this.queryKey,meta:this.meta};return s(x),Ht(this,dw,!1),this.options.persister?this.options.persister(f,x,this):f(x)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:$e(this,uw),state:this.state,fetchFn:a};s(o),(c=this.options.behavior)==null||c.onFetch(o,this),Ht(this,C4,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&yr(this,Op,Zx).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const l=f=>{var x,g,v,w;wH(f)&&f.silent||yr(this,Op,Zx).call(this,{type:"error",error:f}),wH(f)||((g=(x=$e(this,kh).config).onError)==null||g.call(x,f,this),(w=(v=$e(this,kh).config).onSettled)==null||w.call(v,this.state.data,f,this)),this.scheduleGc()};return Ht(this,pu,i_e({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var x,g,v,w;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(C){l(C);return}(g=(x=$e(this,kh).config).onSuccess)==null||g.call(x,f,this),(w=(v=$e(this,kh).config).onSettled)==null||w.call(v,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,x)=>{yr(this,Op,Zx).call(this,{type:"failed",failureCount:f,error:x})},onPause:()=>{yr(this,Op,Zx).call(this,{type:"pause"})},onContinue:()=>{yr(this,Op,Zx).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),$e(this,pu).start()}},w4=new WeakMap,C4=new WeakMap,kh=new WeakMap,uw=new WeakMap,pu=new WeakMap,G_=new WeakMap,dw=new WeakMap,Op=new WeakSet,Zx=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...o_e(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return wH(s)&&s.revert&&$e(this,C4)?{...$e(this,C4),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Gl.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),$e(this,kh).notify({query:this,type:"updated",action:t})})},SNe);function o_e(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:r_e(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function pxt(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Jm,NNe,mxt=(NNe=class extends gA{constructor(t={}){super();Ln(this,Jm);this.config=t,Ht(this,Jm,new Map)}build(t,n,r){const s=n.queryKey,a=n.queryHash??Bie(s,n);let o=this.get(a);return o||(o=new hxt({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){$e(this,Jm).has(t.queryHash)||($e(this,Jm).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=$e(this,Jm).get(t.queryHash);n&&(t.destroy(),n===t&&$e(this,Jm).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Gl.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return $e(this,Jm).get(t)}getAll(){return[...$e(this,Jm).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>fme(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>fme(t,r)):n}notify(t){Gl.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Gl.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Gl.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Jm=new WeakMap,NNe),e0,Hu,fw,t0,yb,ANe,xxt=(ANe=class extends a_e{constructor(t){super();Ln(this,t0);Ln(this,e0);Ln(this,Hu);Ln(this,fw);this.mutationId=t.mutationId,Ht(this,Hu,t.mutationCache),Ht(this,e0,[]),this.state=t.state||l_e(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){$e(this,e0).includes(t)||($e(this,e0).push(t),this.clearGcTimeout(),$e(this,Hu).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ht(this,e0,$e(this,e0).filter(n=>n!==t)),this.scheduleGc(),$e(this,Hu).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){$e(this,e0).length||(this.state.status==="pending"?this.scheduleGc():$e(this,Hu).remove(this))}continue(){var t;return((t=$e(this,fw))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,o,l,c,u,d,f,x,g,v,w,C,N,I,P,R,F,U,L,z;const n=()=>{yr(this,t0,yb).call(this,{type:"continue"})};Ht(this,fw,i_e({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(X,ne)=>{yr(this,t0,yb).call(this,{type:"failed",failureCount:X,error:ne})},onPause:()=>{yr(this,t0,yb).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>$e(this,Hu).canRun(this)}));const r=this.state.status==="pending",s=!$e(this,fw).canStart();try{if(r)n();else{yr(this,t0,yb).call(this,{type:"pending",variables:t,isPaused:s}),await((o=(a=$e(this,Hu).config).onMutate)==null?void 0:o.call(a,t,this));const ne=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));ne!==this.state.context&&yr(this,t0,yb).call(this,{type:"pending",context:ne,variables:t,isPaused:s})}const X=await $e(this,fw).start();return await((d=(u=$e(this,Hu).config).onSuccess)==null?void 0:d.call(u,X,t,this.state.context,this)),await((x=(f=this.options).onSuccess)==null?void 0:x.call(f,X,t,this.state.context)),await((v=(g=$e(this,Hu).config).onSettled)==null?void 0:v.call(g,X,null,this.state.variables,this.state.context,this)),await((C=(w=this.options).onSettled)==null?void 0:C.call(w,X,null,t,this.state.context)),yr(this,t0,yb).call(this,{type:"success",data:X}),X}catch(X){try{throw await((I=(N=$e(this,Hu).config).onError)==null?void 0:I.call(N,X,t,this.state.context,this)),await((R=(P=this.options).onError)==null?void 0:R.call(P,X,t,this.state.context)),await((U=(F=$e(this,Hu).config).onSettled)==null?void 0:U.call(F,void 0,X,this.state.variables,this.state.context,this)),await((z=(L=this.options).onSettled)==null?void 0:z.call(L,void 0,X,t,this.state.context)),X}finally{yr(this,t0,yb).call(this,{type:"error",error:X})}}finally{$e(this,Hu).runNext(this)}}},e0=new WeakMap,Hu=new WeakMap,fw=new WeakMap,t0=new WeakSet,yb=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Gl.batch(()=>{$e(this,e0).forEach(r=>{r.onMutationUpdate(t)}),$e(this,Hu).notify({mutation:this,type:"updated",action:t})})},ANe);function l_e(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ug,Mp,K_,jNe,gxt=(jNe=class extends gA{constructor(t={}){super();Ln(this,ug);Ln(this,Mp);Ln(this,K_);this.config=t,Ht(this,ug,new Set),Ht(this,Mp,new Map),Ht(this,K_,0)}build(t,n,r){const s=new xxt({mutationCache:this,mutationId:++eb(this,K_)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){$e(this,ug).add(t);const n=zI(t);if(typeof n=="string"){const r=$e(this,Mp).get(n);r?r.push(t):$e(this,Mp).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if($e(this,ug).delete(t)){const n=zI(t);if(typeof n=="string"){const r=$e(this,Mp).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&$e(this,Mp).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=zI(t);if(typeof n=="string"){const r=$e(this,Mp).get(n),s=r==null?void 0:r.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=zI(t);if(typeof n=="string"){const s=(r=$e(this,Mp).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Gl.batch(()=>{$e(this,ug).forEach(t=>{this.notify({type:"removed",mutation:t})}),$e(this,ug).clear(),$e(this,Mp).clear()})}getAll(){return Array.from($e(this,ug))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>hme(n,r))}findAll(t={}){return this.getAll().filter(n=>hme(t,n))}notify(t){Gl.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Gl.batch(()=>Promise.all(t.map(n=>n.continue().catch(Oh))))}},ug=new WeakMap,Mp=new WeakMap,K_=new WeakMap,jNe);function zI(e){var t;return(t=e.options.scope)==null?void 0:t.id}function xme(e){return{onFetch:(t,n)=>{var d,f,x,g,v;const r=t.options,s=(x=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:x.direction,a=((g=t.state.data)==null?void 0:g.pages)||[],o=((v=t.state.data)==null?void 0:v.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let w=!1;const C=P=>{Object.defineProperty(P,"signal",{enumerable:!0,get:()=>(t.signal.aborted?w=!0:t.signal.addEventListener("abort",()=>{w=!0}),t.signal)})},N=n_e(t.options,t.fetchOptions),I=async(P,R,F)=>{if(w)return Promise.reject();if(R==null&&P.pages.length)return Promise.resolve(P);const U={client:t.client,queryKey:t.queryKey,pageParam:R,direction:F?"backward":"forward",meta:t.options.meta};C(U);const L=await N(U),{maxPages:z}=t.options,X=F?oxt:axt;return{pages:X(P.pages,L,z),pageParams:X(P.pageParams,R,z)}};if(s&&a.length){const P=s==="backward",R=P?bxt:gme,F={pages:a,pageParams:o},U=R(r,F);l=await I(F,U,P)}else{const P=e??a.length;do{const R=c===0?o[0]??r.initialPageParam:gme(r,l);if(c>0&&R==null)break;l=await I(l,R),c++}while(c<P)}return l};t.options.persister?t.fetchFn=()=>{var w,C;return(C=(w=t.options).persister)==null?void 0:C.call(w,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function gme(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function bxt(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var qo,Ob,Mb,S4,N4,Rb,A4,j4,ENe,yxt=(ENe=class{constructor(e={}){Ln(this,qo);Ln(this,Ob);Ln(this,Mb);Ln(this,S4);Ln(this,N4);Ln(this,Rb);Ln(this,A4);Ln(this,j4);Ht(this,qo,e.queryCache||new mxt),Ht(this,Ob,e.mutationCache||new gxt),Ht(this,Mb,e.defaultOptions||{}),Ht(this,S4,new Map),Ht(this,N4,new Map),Ht(this,Rb,0)}mount(){eb(this,Rb)._++,$e(this,Rb)===1&&(Ht(this,A4,zie.subscribe(async e=>{e&&(await this.resumePausedMutations(),$e(this,qo).onFocus())})),Ht(this,j4,cM.subscribe(async e=>{e&&(await this.resumePausedMutations(),$e(this,qo).onOnline())})))}unmount(){var e,t;eb(this,Rb)._--,$e(this,Rb)===0&&((e=$e(this,A4))==null||e.call(this),Ht(this,A4,void 0),(t=$e(this,j4))==null||t.call(this),Ht(this,j4,void 0))}isFetching(e){return $e(this,qo).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return $e(this,Ob).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=$e(this,qo).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=$e(this,qo).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ZC(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return $e(this,qo).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=$e(this,qo).get(r.queryHash),a=s==null?void 0:s.state.data,o=sxt(t,a);if(o!==void 0)return $e(this,qo).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Gl.batch(()=>$e(this,qo).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=$e(this,qo).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=$e(this,qo);Gl.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=$e(this,qo);return Gl.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Gl.batch(()=>$e(this,qo).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Oh).catch(Oh)}invalidateQueries(e,t={}){return Gl.batch(()=>($e(this,qo).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Gl.batch(()=>$e(this,qo).findAll(e).filter(s=>!s.isDisabled()).map(s=>{let a=s.fetch(void 0,n);return n.throwOnError||(a=a.catch(Oh)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Oh)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=$e(this,qo).build(this,t);return n.isStaleByTime(ZC(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Oh).catch(Oh)}fetchInfiniteQuery(e){return e.behavior=xme(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Oh).catch(Oh)}ensureInfiniteQueryData(e){return e.behavior=xme(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return cM.isOnline()?$e(this,Ob).resumePausedMutations():Promise.resolve()}getQueryCache(){return $e(this,qo)}getMutationCache(){return $e(this,Ob)}getDefaultOptions(){return $e(this,Mb)}setDefaultOptions(e){Ht(this,Mb,e)}setQueryDefaults(e,t){$e(this,S4).set(C3(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...$e(this,S4).values()],n={};return t.forEach(r=>{rE(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){$e(this,N4).set(C3(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...$e(this,N4).values()],n={};return t.forEach(r=>{rE(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...$e(this,Mb).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Bie(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Uie&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...$e(this,Mb).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){$e(this,qo).clear(),$e(this,Ob).clear()}},qo=new WeakMap,Ob=new WeakMap,Mb=new WeakMap,S4=new WeakMap,N4=new WeakMap,Rb=new WeakMap,A4=new WeakMap,j4=new WeakMap,ENe),Td,Yi,Y_,Vu,hw,E4,Lb,Db,X_,_4,k4,pw,mw,Bb,T4,Ta,uj,KZ,YZ,XZ,QZ,ZZ,JZ,eJ,c_e,_Ne,vxt=(_Ne=class extends gA{constructor(t,n){super();Ln(this,Ta);Ln(this,Td);Ln(this,Yi);Ln(this,Y_);Ln(this,Vu);Ln(this,hw);Ln(this,E4);Ln(this,Lb);Ln(this,Db);Ln(this,X_);Ln(this,_4);Ln(this,k4);Ln(this,pw);Ln(this,mw);Ln(this,Bb);Ln(this,T4,new Set);this.options=n,Ht(this,Td,t),Ht(this,Db,null),Ht(this,Lb,GZ()),this.options.experimental_prefetchInRender||$e(this,Lb).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&($e(this,Yi).addObserver(this),bme($e(this,Yi),this.options)?yr(this,Ta,uj).call(this):this.updateResult(),yr(this,Ta,QZ).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return tJ($e(this,Yi),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return tJ($e(this,Yi),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,yr(this,Ta,ZZ).call(this),yr(this,Ta,JZ).call(this),$e(this,Yi).removeObserver(this)}setOptions(t){const n=this.options,r=$e(this,Yi);if(this.options=$e(this,Td).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Wp(this.options.enabled,$e(this,Yi))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");yr(this,Ta,eJ).call(this),$e(this,Yi).setOptions(this.options),n._defaulted&&!lM(this.options,n)&&$e(this,Td).getQueryCache().notify({type:"observerOptionsUpdated",query:$e(this,Yi),observer:this});const s=this.hasListeners();s&&yme($e(this,Yi),r,this.options,n)&&yr(this,Ta,uj).call(this),this.updateResult(),s&&($e(this,Yi)!==r||Wp(this.options.enabled,$e(this,Yi))!==Wp(n.enabled,$e(this,Yi))||ZC(this.options.staleTime,$e(this,Yi))!==ZC(n.staleTime,$e(this,Yi)))&&yr(this,Ta,KZ).call(this);const a=yr(this,Ta,YZ).call(this);s&&($e(this,Yi)!==r||Wp(this.options.enabled,$e(this,Yi))!==Wp(n.enabled,$e(this,Yi))||a!==$e(this,Bb))&&yr(this,Ta,XZ).call(this,a)}getOptimisticResult(t){const n=$e(this,Td).getQueryCache().build($e(this,Td),t),r=this.createResult(n,t);return Cxt(this,r)&&(Ht(this,Vu,r),Ht(this,E4,this.options),Ht(this,hw,$e(this,Yi).state)),r}getCurrentResult(){return $e(this,Vu)}trackResult(t,n){const r={};return Object.keys(t).forEach(s=>{Object.defineProperty(r,s,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(s),n==null||n(s),t[s])})}),r}trackProp(t){$e(this,T4).add(t)}getCurrentQuery(){return $e(this,Yi)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=$e(this,Td).defaultQueryOptions(t),r=$e(this,Td).getQueryCache().build($e(this,Td),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return yr(this,Ta,uj).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),$e(this,Vu)))}createResult(t,n){var X;const r=$e(this,Yi),s=this.options,a=$e(this,Vu),o=$e(this,hw),l=$e(this,E4),u=t!==r?t.state:$e(this,Y_),{state:d}=t;let f={...d},x=!1,g;if(n._optimisticResults){const ne=this.hasListeners(),J=!ne&&bme(t,n),Z=ne&&yme(t,r,n,s);(J||Z)&&(f={...f,...o_e(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:w,status:C}=f;g=f.data;let N=!1;if(n.placeholderData!==void 0&&g===void 0&&C==="pending"){let ne;a!=null&&a.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(ne=a.data,N=!0):ne=typeof n.placeholderData=="function"?n.placeholderData((X=$e(this,k4))==null?void 0:X.state.data,$e(this,k4)):n.placeholderData,ne!==void 0&&(C="success",g=qZ(a==null?void 0:a.data,ne,n),x=!0)}if(n.select&&g!==void 0&&!N)if(a&&g===(o==null?void 0:o.data)&&n.select===$e(this,X_))g=$e(this,_4);else try{Ht(this,X_,n.select),g=n.select(g),g=qZ(a==null?void 0:a.data,g,n),Ht(this,_4,g),Ht(this,Db,null)}catch(ne){Ht(this,Db,ne)}$e(this,Db)&&(v=$e(this,Db),g=$e(this,_4),w=Date.now(),C="error");const I=f.fetchStatus==="fetching",P=C==="pending",R=C==="error",F=P&&I,U=g!==void 0,z={status:C,fetchStatus:f.fetchStatus,isPending:P,isSuccess:C==="success",isError:R,isInitialLoading:F,isLoading:F,data:g,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:w,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:I,isRefetching:I&&!P,isLoadingError:R&&!U,isPaused:f.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:R&&U,isStale:Hie(t,n),refetch:this.refetch,promise:$e(this,Lb)};if(this.options.experimental_prefetchInRender){const ne=re=>{z.status==="error"?re.reject(z.error):z.data!==void 0&&re.resolve(z.data)},J=()=>{const re=Ht(this,Lb,z.promise=GZ());ne(re)},Z=$e(this,Lb);switch(Z.status){case"pending":t.queryHash===r.queryHash&&ne(Z);break;case"fulfilled":(z.status==="error"||z.data!==Z.value)&&J();break;case"rejected":(z.status!=="error"||z.error!==Z.reason)&&J();break}}return z}updateResult(){const t=$e(this,Vu),n=this.createResult($e(this,Yi),this.options);if(Ht(this,hw,$e(this,Yi).state),Ht(this,E4,this.options),$e(this,hw).data!==void 0&&Ht(this,k4,$e(this,Yi)),lM(n,t))return;Ht(this,Vu,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!$e(this,T4).size)return!0;const o=new Set(a??$e(this,T4));return this.options.throwOnError&&o.add("error"),Object.keys($e(this,Vu)).some(l=>{const c=l;return $e(this,Vu)[c]!==t[c]&&o.has(c)})};yr(this,Ta,c_e).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&yr(this,Ta,QZ).call(this)}},Td=new WeakMap,Yi=new WeakMap,Y_=new WeakMap,Vu=new WeakMap,hw=new WeakMap,E4=new WeakMap,Lb=new WeakMap,Db=new WeakMap,X_=new WeakMap,_4=new WeakMap,k4=new WeakMap,pw=new WeakMap,mw=new WeakMap,Bb=new WeakMap,T4=new WeakMap,Ta=new WeakSet,uj=function(t){yr(this,Ta,eJ).call(this);let n=$e(this,Yi).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Oh)),n},KZ=function(){yr(this,Ta,ZZ).call(this);const t=ZC(this.options.staleTime,$e(this,Yi));if(w3||$e(this,Vu).isStale||!VZ(t))return;const r=t_e($e(this,Vu).dataUpdatedAt,t)+1;Ht(this,pw,setTimeout(()=>{$e(this,Vu).isStale||this.updateResult()},r))},YZ=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval($e(this,Yi)):this.options.refetchInterval)??!1},XZ=function(t){yr(this,Ta,JZ).call(this),Ht(this,Bb,t),!(w3||Wp(this.options.enabled,$e(this,Yi))===!1||!VZ($e(this,Bb))||$e(this,Bb)===0)&&Ht(this,mw,setInterval(()=>{(this.options.refetchIntervalInBackground||zie.isFocused())&&yr(this,Ta,uj).call(this)},$e(this,Bb)))},QZ=function(){yr(this,Ta,KZ).call(this),yr(this,Ta,XZ).call(this,yr(this,Ta,YZ).call(this))},ZZ=function(){$e(this,pw)&&(clearTimeout($e(this,pw)),Ht(this,pw,void 0))},JZ=function(){$e(this,mw)&&(clearInterval($e(this,mw)),Ht(this,mw,void 0))},eJ=function(){const t=$e(this,Td).getQueryCache().build($e(this,Td),this.options);if(t===$e(this,Yi))return;const n=$e(this,Yi);Ht(this,Yi,t),Ht(this,Y_,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},c_e=function(t){Gl.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n($e(this,Vu))}),$e(this,Td).getQueryCache().notify({query:$e(this,Yi),type:"observerResultsUpdated"})})},_Ne);function wxt(e,t){return Wp(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function bme(e,t){return wxt(e,t)||e.state.data!==void 0&&tJ(e,t,t.refetchOnMount)}function tJ(e,t,n){if(Wp(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Hie(e,t)}return!1}function yme(e,t,n,r){return(e!==t||Wp(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Hie(e,n)}function Hie(e,t){return Wp(t.enabled,e)!==!1&&e.isStaleByTime(ZC(t.staleTime,e))}function Cxt(e,t){return!lM(e.getCurrentResult(),t)}var $b,Ub,Id,dg,Kg,DF,nJ,kNe,Sxt=(kNe=class extends gA{constructor(n,r){super();Ln(this,Kg);Ln(this,$b);Ln(this,Ub);Ln(this,Id);Ln(this,dg);Ht(this,$b,n),this.setOptions(r),this.bindMethods(),yr(this,Kg,DF).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=$e(this,$b).defaultMutationOptions(n),lM(this.options,r)||$e(this,$b).getMutationCache().notify({type:"observerOptionsUpdated",mutation:$e(this,Id),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&C3(r.mutationKey)!==C3(this.options.mutationKey)?this.reset():((s=$e(this,Id))==null?void 0:s.state.status)==="pending"&&$e(this,Id).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=$e(this,Id))==null||n.removeObserver(this)}onMutationUpdate(n){yr(this,Kg,DF).call(this),yr(this,Kg,nJ).call(this,n)}getCurrentResult(){return $e(this,Ub)}reset(){var n;(n=$e(this,Id))==null||n.removeObserver(this),Ht(this,Id,void 0),yr(this,Kg,DF).call(this),yr(this,Kg,nJ).call(this)}mutate(n,r){var s;return Ht(this,dg,r),(s=$e(this,Id))==null||s.removeObserver(this),Ht(this,Id,$e(this,$b).getMutationCache().build($e(this,$b),this.options)),$e(this,Id).addObserver(this),$e(this,Id).execute(n)}},$b=new WeakMap,Ub=new WeakMap,Id=new WeakMap,dg=new WeakMap,Kg=new WeakSet,DF=function(){var r;const n=((r=$e(this,Id))==null?void 0:r.state)??l_e();Ht(this,Ub,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},nJ=function(n){Gl.batch(()=>{var r,s,a,o,l,c,u,d;if($e(this,dg)&&this.hasListeners()){const f=$e(this,Ub).variables,x=$e(this,Ub).context;(n==null?void 0:n.type)==="success"?((s=(r=$e(this,dg)).onSuccess)==null||s.call(r,n.data,f,x),(o=(a=$e(this,dg)).onSettled)==null||o.call(a,n.data,null,f,x)):(n==null?void 0:n.type)==="error"&&((c=(l=$e(this,dg)).onError)==null||c.call(l,n.error,f,x),(d=(u=$e(this,dg)).onSettled)==null||d.call(u,void 0,n.error,f,x))}this.listeners.forEach(f=>{f($e(this,Ub))})})},kNe);function Nxt(e,t){return $ie(e,t)}function Axt(e){return JSON.stringify(e,(t,n)=>jxt(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):typeof n=="bigint"?n.toString():n)}function jxt(e){if(!vme(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!vme(n)||!n.hasOwnProperty("isPrototypeOf"))}function vme(e){return Object.prototype.toString.call(e)==="[object Object]"}function bB(e){const{_defaulted:t,behavior:n,gcTime:r,initialData:s,initialDataUpdatedAt:a,maxPages:o,meta:l,networkMode:c,queryFn:u,queryHash:d,queryKey:f,queryKeyHashFn:x,retry:g,retryDelay:v,structuralSharing:w,getPreviousPageParam:C,getNextPageParam:N,initialPageParam:I,_optimisticResults:P,enabled:R,notifyOnChangeProps:F,placeholderData:U,refetchInterval:L,refetchIntervalInBackground:z,refetchOnMount:X,refetchOnReconnect:ne,refetchOnWindowFocus:J,retryOnMount:Z,select:re,staleTime:he,suspense:Y,throwOnError:ie,config:oe,connector:G,query:V,...ee}=e;return ee}function Ext(e){return{mutationFn(t){return Jmt(e,t)},mutationKey:["connect"]}}function _xt(e){return{mutationFn(t){return l0t(e,t)},mutationKey:["disconnect"]}}function kxt(e,t={}){return{async queryFn({queryKey:n}){const{address:r,scopeKey:s,...a}=n[1];if(!r)throw new Error("address is required");return await d0t(e,{...a,address:r})??null},queryKey:Txt(t)}}function Txt(e={}){return["balance",bB(e)]}function Ixt(e,t={}){return{async queryFn({queryKey:n}){const{name:r,scopeKey:s,...a}=n[1];if(!r)throw new Error("name is required");return h0t(e,{...a,name:r})},queryKey:Pxt(t)}}function Pxt(e={}){return["ensAvatar",bB(e)]}function Fxt(e,t={}){return{async queryFn({queryKey:n}){const{address:r,scopeKey:s,...a}=n[1];if(!r)throw new Error("address is required");return p0t(e,{...a,address:r})},queryKey:Oxt(t)}}function Oxt(e={}){return["ensName",bB(e)]}function Mxt(e,t={}){return{async queryFn({queryKey:n}){const r=t.abi;if(!r)throw new Error("abi is required");const{functionName:s,scopeKey:a,...o}=n[1],l=(()=>{const c=n[1];if(c.address)return{address:c.address};if(c.code)return{code:c.code};throw new Error("address or code is required")})();if(!s)throw new Error("functionName is required");return YEe(e,{abi:r,functionName:s,args:o.args,...l,...o})},queryKey:Rxt(t)}}function Rxt(e={}){const{abi:t,...n}=e;return["readContract",bB(n)]}function Lxt(e){return{mutationFn(t){return x0t(e,t)},mutationKey:["signMessage"]}}function Dxt(e){return{mutationFn(t){return g0t(e,t)},mutationKey:["signTypedData"]}}function Bxt(e){return{mutationFn(t){return y0t(e,t)},mutationKey:["switchChain"]}}function $xt(e){return{mutationFn(t){return N0t(e,t)},mutationKey:["writeContract"]}}var u_e=m.createContext(void 0),d_e=e=>{const t=m.useContext(u_e);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Uxt=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(u_e.Provider,{value:e,children:t})),f_e=m.createContext(!1),zxt=()=>m.useContext(f_e);f_e.Provider;function Hxt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Vxt=m.createContext(Hxt()),Wxt=()=>m.useContext(Vxt);function h_e(e,t){return typeof e=="function"?e(...t):!!e}function rJ(){}var qxt=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Gxt=e=>{m.useEffect(()=>{e.clearReset()},[e])},Kxt=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||h_e(n,[e.error,r])),Yxt=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},Xxt=(e,t)=>e.isLoading&&e.isFetching&&!t,Qxt=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,wme=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Zxt(e,t,n){var f,x,g,v,w;const r=d_e(),s=zxt(),a=Wxt(),o=r.defaultQueryOptions(e);(x=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||x.call(f,o),o._optimisticResults=s?"isRestoring":"optimistic",Yxt(o),qxt(o,a),Gxt(a);const l=!r.getQueryCache().get(o.queryHash),[c]=m.useState(()=>new t(r,o)),u=c.getOptimisticResult(o),d=!s&&e.subscribed!==!1;if(m.useSyncExternalStore(m.useCallback(C=>{const N=d?c.subscribe(Gl.batchCalls(C)):rJ;return c.updateResult(),N},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),m.useEffect(()=>{c.setOptions(o)},[o,c]),Qxt(o,u))throw wme(o,c,a);if(Kxt({result:u,errorResetBoundary:a,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((v=(g=r.getDefaultOptions().queries)==null?void 0:g._experimental_afterQuery)==null||v.call(g,o,u),o.experimental_prefetchInRender&&!w3&&Xxt(u,s)){const C=l?wme(o,c,a):(w=r.getQueryCache().get(o.queryHash))==null?void 0:w.promise;C==null||C.catch(rJ).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?u:c.trackResult(u)}function p_e(e,t){return Zxt(e,vxt)}function bA(e,t){const n=d_e(),[r]=m.useState(()=>new Sxt(n,e));m.useEffect(()=>{r.setOptions(e)},[r,e]);const s=m.useSyncExternalStore(m.useCallback(o=>r.subscribe(Gl.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=m.useCallback((o,l)=>{r.mutate(o,l).catch(rJ)},[r]);if(s.error&&h_e(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}function yB(e){const t=p_e({...e,queryKeyHashFn:Axt});return t.queryKey=e.queryKey,t}function yA(e={}){const t=wl(e);return m.useSyncExternalStore(n=>v0t(t,{onChange:n}),()=>tme(t),()=>tme(t))}function m_e(e={}){const{address:t,query:n={}}=e,r=wl(e),s=yA({config:r}),a=kxt(r,{...e,chainId:e.chainId??s}),o=!!(t&&(n.enabled??!0));return yB({...n,...a,enabled:o})}function Jxt(e={}){const t=wl(e);return m.useSyncExternalStore(n=>Z0t(t,{onChange:n}),()=>nme(t),()=>nme(t))}function egt(e={}){const t=wl(e);return m.useSyncExternalStore(n=>C0t(t,{onChange:n}),()=>rme(t),()=>rme(t))}function tgt(e={}){const{mutation:t}=e,n=wl(e),r=Ext(n),{mutate:s,mutateAsync:a,...o}=bA({...t,...r});return m.useEffect(()=>n.subscribe(({status:l})=>l,(l,c)=>{c==="connected"&&l==="disconnected"&&o.reset()}),[n,o.reset]),{...o,connect:s,connectAsync:a,connectors:egt({config:n})}}function ngt(e={}){const t=wl(e);return m.useSyncExternalStore(n=>w0t(t,{onChange:n}),()=>$Z(t),()=>$Z(t))}function vB(e={}){const{mutation:t}=e,n=wl(e),r=_xt(n),{mutate:s,mutateAsync:a,...o}=bA({...t,...r});return{...o,connectors:ngt({config:n}).map(l=>l.connector),disconnect:s,disconnectAsync:a}}function rgt(e={}){const{name:t,query:n={}}=e,r=wl(e),s=yA({config:r}),a=Ixt(r,{...e,chainId:e.chainId??s}),o=!!(t&&(n.enabled??!0));return yB({...n,...a,enabled:o})}function sgt(e={}){const{address:t,query:n={}}=e,r=wl(e),s=yA({config:r}),a=Fxt(r,{...e,chainId:e.chainId??s}),o=!!(t&&(n.enabled??!0));return yB({...n,...a,enabled:o})}function x_e(e={}){const t=wl(e);return JEe.useSyncExternalStoreWithSelector(n=>S0t(t,{onChange:n}),()=>UZ(t,e),()=>UZ(t,e),n=>n,(n,r)=>(n==null?void 0:n.uid)===(r==null?void 0:r.uid))}function Cme(e={}){const{abi:t,address:n,functionName:r,query:s={}}=e,a=e.code,o=wl(e),l=yA({config:o}),c=Mxt(o,{...e,chainId:e.chainId??l}),u=!!((n||a)&&t&&r&&(s.enabled??!0));return yB({...s,...c,enabled:u,structuralSharing:s.structuralSharing??Nxt})}function g_e(e={}){const{mutation:t}=e,n=wl(e),r=Lxt(n),{mutate:s,mutateAsync:a,...o}=bA({...t,...r});return{...o,signMessage:s,signMessageAsync:a}}function igt(e={}){const{mutation:t}=e,n=wl(e),r=Dxt(n),{mutate:s,mutateAsync:a,...o}=bA({...t,...r});return{...o,signTypedData:s,signTypedDataAsync:a}}function Vie(e={}){const{mutation:t}=e,n=wl(e),r=Bxt(n),{mutate:s,mutateAsync:a,...o}=bA({...t,...r});return{...o,chains:Jxt({config:n}),switchChain:s,switchChainAsync:a}}function agt(e={}){const{mutation:t}=e,n=wl(e),r=$xt(n),{mutate:s,mutateAsync:a,...o}=bA({...t,...r});return{...o,writeContract:s,writeContractAsync:a}}const K0=Object.create(null);K0.open="0";K0.close="1";K0.ping="2";K0.pong="3";K0.message="4";K0.upgrade="5";K0.noop="6";const BF=Object.create(null);Object.keys(K0).forEach(e=>{BF[K0[e]]=e});const sJ={type:"error",data:"parser error"},b_e=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",y_e=typeof ArrayBuffer=="function",v_e=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Wie=({type:e,data:t},n,r)=>b_e&&t instanceof Blob?n?r(t):Sme(t,r):y_e&&(t instanceof ArrayBuffer||v_e(t))?n?r(t):Sme(new Blob([t]),r):r(K0[e]+(t||"")),Sme=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Nme(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let CH;function ogt(e,t){if(b_e&&e.data instanceof Blob)return e.data.arrayBuffer().then(Nme).then(t);if(y_e&&(e.data instanceof ArrayBuffer||v_e(e.data)))return t(Nme(e.data));Wie(e,!1,n=>{CH||(CH=new TextEncoder),t(CH.encode(n))})}const Ame="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",dj=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Ame.length;e++)dj[Ame.charCodeAt(e)]=e;const lgt=e=>{let t=e.length*.75,n=e.length,r,s=0,a,o,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(r=0;r<n;r+=4)a=dj[e.charCodeAt(r)],o=dj[e.charCodeAt(r+1)],l=dj[e.charCodeAt(r+2)],c=dj[e.charCodeAt(r+3)],d[s++]=a<<2|o>>4,d[s++]=(o&15)<<4|l>>2,d[s++]=(l&3)<<6|c&63;return u},cgt=typeof ArrayBuffer=="function",qie=(e,t)=>{if(typeof e!="string")return{type:"message",data:w_e(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:ugt(e.substring(1),t)}:BF[n]?e.length>1?{type:BF[n],data:e.substring(1)}:{type:BF[n]}:sJ},ugt=(e,t)=>{if(cgt){const n=lgt(e);return w_e(n,t)}else return{base64:!0,data:e}},w_e=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},C_e="",dgt=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((a,o)=>{Wie(a,!1,l=>{r[o]=l,++s===n&&t(r.join(C_e))})})},fgt=(e,t)=>{const n=e.split(C_e),r=[];for(let s=0;s<n.length;s++){const a=qie(n[s],t);if(r.push(a),a.type==="error")break}return r};function hgt(){return new TransformStream({transform(e,t){ogt(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const a=new DataView(s.buffer);a.setUint8(0,126),a.setUint16(1,r)}else{s=new Uint8Array(9);const a=new DataView(s.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let SH;function HI(e){return e.reduce((t,n)=>t+n.length,0)}function VI(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function pgt(e,t){SH||(SH=new TextDecoder);const n=[];let r=0,s=-1,a=!1;return new TransformStream({transform(o,l){for(n.push(o);;){if(r===0){if(HI(n)<1)break;const c=VI(n,1);a=(c[0]&128)===128,s=c[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(HI(n)<2)break;const c=VI(n,2);s=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),r=3}else if(r===2){if(HI(n)<8)break;const c=VI(n,8),u=new DataView(c.buffer,c.byteOffset,c.length),d=u.getUint32(0);if(d>Math.pow(2,21)-1){l.enqueue(sJ);break}s=d*Math.pow(2,32)+u.getUint32(4),r=3}else{if(HI(n)<s)break;const c=VI(n,s);l.enqueue(qie(a?c:SH.decode(c),t)),r=0}if(s===0||s>e){l.enqueue(sJ);break}}}})}const S_e=4;function Ol(e){if(e)return mgt(e)}function mgt(e){for(var t in Ol.prototype)e[t]=Ol.prototype[t];return e}Ol.prototype.on=Ol.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Ol.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Ol.prototype.off=Ol.prototype.removeListener=Ol.prototype.removeAllListeners=Ol.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Ol.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};Ol.prototype.emitReserved=Ol.prototype.emit;Ol.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Ol.prototype.hasListeners=function(e){return!!this.listeners(e).length};const wB=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Bh=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),xgt="arraybuffer";function N_e(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const ggt=Bh.setTimeout,bgt=Bh.clearTimeout;function CB(e,t){t.useNativeTimers?(e.setTimeoutFn=ggt.bind(Bh),e.clearTimeoutFn=bgt.bind(Bh)):(e.setTimeoutFn=Bh.setTimeout.bind(Bh),e.clearTimeoutFn=Bh.clearTimeout.bind(Bh))}const ygt=1.33;function vgt(e){return typeof e=="string"?wgt(e):Math.ceil((e.byteLength||e.size)*ygt)}function wgt(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function A_e(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Cgt(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Sgt(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let a=n[r].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class Ngt extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}let Gie=class extends Ol{constructor(t){super(),this.writable=!1,CB(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Ngt(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=qie(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Cgt(t);return n.length?"?"+n:""}};class Agt extends Gie{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};fgt(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,dgt(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=A_e()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let j_e=!1;try{j_e=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const jgt=j_e;function Egt(){}class _gt extends Agt{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,a)=>{this.onError("xhr post error",s,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}let JC=class $F extends Ol{constructor(t,n,r){super(),this.createRequest=t,CB(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=N_e(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=$F.requestsCount++,$F.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Egt,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete $F.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};JC.requestsCount=0;JC.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",jme);else if(typeof addEventListener=="function"){const e="onpagehide"in Bh?"pagehide":"unload";addEventListener(e,jme,!1)}}function jme(){for(let e in JC.requests)JC.requests.hasOwnProperty(e)&&JC.requests[e].abort()}const kgt=function(){const e=E_e({xdomain:!1});return e&&e.responseType!==null}();class Tgt extends _gt{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=kgt&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new JC(E_e,this.uri(),t)}}function E_e(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||jgt))return new XMLHttpRequest}catch{}if(!t)try{return new Bh[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const __e=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Igt extends Gie{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=__e?{}:N_e(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;Wie(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}s&&wB(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=A_e()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const NH=Bh.WebSocket||Bh.MozWebSocket;let Pgt=class extends Igt{createSocket(t,n,r){return __e?new NH(t,n,r):n?new NH(t,n):new NH(t)}doWrite(t,n){this.ws.send(n)}};class Fgt extends Gie{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=pgt(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=hgt();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const a=()=>{r.read().then(({done:l,value:c})=>{l||(this.onPacket(c),a())}).catch(l=>{})};a();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&wB(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Ogt={websocket:Pgt,webtransport:Fgt,polling:Tgt},Mgt=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Rgt=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function iJ(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=Mgt.exec(e||""),a={},o=14;for(;o--;)a[Rgt[o]]=s[o]||"";return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=Lgt(a,a.path),a.queryKey=Dgt(a,a.query),a}function Lgt(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Dgt(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,a){s&&(n[s]=a)}),n}const aJ=typeof addEventListener=="function"&&typeof removeEventListener=="function",UF=[];aJ&&addEventListener("offline",()=>{UF.forEach(e=>e())},!1);class yy extends Ol{constructor(t,n){if(super(),this.binaryType=xgt,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=iJ(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=iJ(n.host).host);CB(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Sgt(this.opts.query)),aJ&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},UF.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=S_e,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&yy.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",yy.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=vgt(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,wB(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:t,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(yy.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),aJ&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=UF.indexOf(this._offlineEventListener);r!==-1&&UF.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}yy.protocol=S_e;class Bgt extends yy{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;yy.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;yy.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const x=new Error("probe error");x.transport=n.name,this.emitReserved("upgradeError",x)}}))};function a(){r||(r=!0,d(),n.close(),n=null)}const o=f=>{const x=new Error("probe error: "+f);x.transport=n.name,a(),this.emitReserved("upgradeError",x)};function l(){o("transport closed")}function c(){o("socket closed")}function u(f){n&&f.name!==n.name&&a()}const d=()=>{n.removeListener("open",s),n.removeListener("error",o),n.removeListener("close",l),this.off("close",c),this.off("upgrading",u)};n.once("open",s),n.once("error",o),n.once("close",l),this.once("close",c),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let $gt=class extends Bgt{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(s=>Ogt[s]).filter(s=>!!s)),super(t,r)}};function Ugt(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=iJ(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}const zgt=typeof ArrayBuffer=="function",Hgt=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,k_e=Object.prototype.toString,Vgt=typeof Blob=="function"||typeof Blob<"u"&&k_e.call(Blob)==="[object BlobConstructor]",Wgt=typeof File=="function"||typeof File<"u"&&k_e.call(File)==="[object FileConstructor]";function Kie(e){return zgt&&(e instanceof ArrayBuffer||Hgt(e))||Vgt&&e instanceof Blob||Wgt&&e instanceof File}function zF(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(zF(e[n]))return!0;return!1}if(Kie(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return zF(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&zF(e[n]))return!0;return!1}function qgt(e){const t=[],n=e.data,r=e;return r.data=oJ(n,t),r.attachments=t.length,{packet:r,buffers:t}}function oJ(e,t){if(!e)return e;if(Kie(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=oJ(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=oJ(e[r],t));return n}return e}function Ggt(e,t){return e.data=lJ(e.data,t),delete e.attachments,e}function lJ(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=lJ(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=lJ(e[n],t));return e}const Kgt=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Ygt=5;var Xi;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Xi||(Xi={}));let Xgt=class{constructor(t){this.replacer=t}encode(t){return(t.type===Xi.EVENT||t.type===Xi.ACK)&&zF(t)?this.encodeAsBinary({type:t.type===Xi.EVENT?Xi.BINARY_EVENT:Xi.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Xi.BINARY_EVENT||t.type===Xi.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=qgt(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}};function Eme(e){return Object.prototype.toString.call(e)==="[object Object]"}class Yie extends Ol{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Xi.BINARY_EVENT;r||n.type===Xi.BINARY_ACK?(n.type=r?Xi.EVENT:Xi.ACK,this.reconstructor=new Qgt(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Kie(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Xi[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Xi.BINARY_EVENT||r.type===Xi.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(a,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(t.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(a,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const a=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(a,n+1))}if(t.charAt(++n)){const a=this.tryParse(t.substr(n));if(Yie.isPayloadValid(r.type,a))r.data=a;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Xi.CONNECT:return Eme(n);case Xi.DISCONNECT:return n===void 0;case Xi.CONNECT_ERROR:return typeof n=="string"||Eme(n);case Xi.EVENT:case Xi.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Kgt.indexOf(n[0])===-1);case Xi.ACK:case Xi.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Qgt{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=Ggt(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Zgt=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Yie,Encoder:Xgt,get PacketType(){return Xi},protocol:Ygt},Symbol.toStringTag,{value:"Module"}));function Up(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Jgt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class T_e extends Ol{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Up(t,"open",this.onopen.bind(this)),Up(t,"packet",this.onpacket.bind(this)),Up(t,"error",this.onerror.bind(this)),Up(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,s,a;if(Jgt.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:Xi.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,f=n.pop();this._registerAckCallback(d,f),o.id=d}const l=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,c=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!l||(c?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===t&&this.sendBuffer.splice(l,1);n.call(this,new Error("operation has timed out"))},s),o=(...l)=>{this.io.clearTimeoutFn(a),n.apply(this,l)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,s)=>{const a=(o,l)=>o?s(o):r(l);a.withError=!0,n.push(a),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...a)=>r!==this._queue[0]?void 0:(s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Xi.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Xi.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Xi.EVENT:case Xi.BINARY_EVENT:this.onevent(t);break;case Xi.ACK:case Xi.BINARY_ACK:this.onack(t);break;case Xi.DISCONNECT:this.ondisconnect();break;case Xi.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:Xi.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Xi.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function vA(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}vA.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};vA.prototype.reset=function(){this.attempts=0};vA.prototype.setMin=function(e){this.ms=e};vA.prototype.setMax=function(e){this.max=e};vA.prototype.setJitter=function(e){this.jitter=e};class cJ extends Ol{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,CB(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new vA({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||Zgt;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new $gt(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=Up(n,"open",function(){r.onopen(),t&&t()}),a=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},o=Up(n,"error",a);if(this._timeout!==!1){const l=this._timeout,c=this.setTimeoutFn(()=>{s(),a(new Error("timeout")),n.close()},l);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(s),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Up(t,"ping",this.onping.bind(this)),Up(t,"data",this.ondata.bind(this)),Up(t,"error",this.onerror.bind(this)),Up(t,"close",this.onclose.bind(this)),Up(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){wB(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new T_e(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const y7={};function vy(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Ugt(e,t.path||"/socket.io"),r=n.source,s=n.id,a=n.path,o=y7[s]&&a in y7[s].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let c;return l?c=new cJ(r,t):(y7[s]||(y7[s]=new cJ(r,t)),c=y7[s]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(vy,{Manager:cJ,Socket:T_e,io:vy,connect:vy});function I_e(e,t){return function(){return e.apply(t,arguments)}}const{toString:e1t}=Object.prototype,{getPrototypeOf:Xie}=Object,SB=(e=>t=>{const n=e1t.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),gm=e=>(e=e.toLowerCase(),t=>SB(t)===e),NB=e=>t=>typeof t===e,{isArray:wA}=Array,sE=NB("undefined");function t1t(e){return e!==null&&!sE(e)&&e.constructor!==null&&!sE(e.constructor)&&Lf(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const P_e=gm("ArrayBuffer");function n1t(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&P_e(e.buffer),t}const r1t=NB("string"),Lf=NB("function"),F_e=NB("number"),AB=e=>e!==null&&typeof e=="object",s1t=e=>e===!0||e===!1,HF=e=>{if(SB(e)!=="object")return!1;const t=Xie(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},i1t=gm("Date"),a1t=gm("File"),o1t=gm("Blob"),l1t=gm("FileList"),c1t=e=>AB(e)&&Lf(e.pipe),u1t=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Lf(e.append)&&((t=SB(e))==="formdata"||t==="object"&&Lf(e.toString)&&e.toString()==="[object FormData]"))},d1t=gm("URLSearchParams"),[f1t,h1t,p1t,m1t]=["ReadableStream","Request","Response","Headers"].map(gm),x1t=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Rk(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),wA(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const a=n?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let l;for(r=0;r<o;r++)l=a[r],t.call(null,e[l],l,e)}}function O_e(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const Hv=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,M_e=e=>!sE(e)&&e!==Hv;function uJ(){const{caseless:e}=M_e(this)&&this||{},t={},n=(r,s)=>{const a=e&&O_e(t,s)||s;HF(t[a])&&HF(r)?t[a]=uJ(t[a],r):HF(r)?t[a]=uJ({},r):wA(r)?t[a]=r.slice():t[a]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&Rk(arguments[r],n);return t}const g1t=(e,t,n,{allOwnKeys:r}={})=>(Rk(t,(s,a)=>{n&&Lf(s)?e[a]=I_e(s,n):e[a]=s},{allOwnKeys:r}),e),b1t=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),y1t=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},v1t=(e,t,n,r)=>{let s,a,o;const l={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),a=s.length;a-- >0;)o=s[a],(!r||r(o,e,t))&&!l[o]&&(t[o]=e[o],l[o]=!0);e=n!==!1&&Xie(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},w1t=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},C1t=e=>{if(!e)return null;if(wA(e))return e;let t=e.length;if(!F_e(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},S1t=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Xie(Uint8Array)),N1t=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const a=s.value;t.call(e,a[0],a[1])}},A1t=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},j1t=gm("HTMLFormElement"),E1t=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),_me=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),_1t=gm("RegExp"),R_e=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Rk(n,(s,a)=>{let o;(o=t(s,a,e))!==!1&&(r[a]=o||s)}),Object.defineProperties(e,r)},k1t=e=>{R_e(e,(t,n)=>{if(Lf(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Lf(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},T1t=(e,t)=>{const n={},r=s=>{s.forEach(a=>{n[a]=!0})};return wA(e)?r(e):r(String(e).split(t)),n},I1t=()=>{},P1t=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,AH="abcdefghijklmnopqrstuvwxyz",kme="0123456789",L_e={DIGIT:kme,ALPHA:AH,ALPHA_DIGIT:AH+AH.toUpperCase()+kme},F1t=(e=16,t=L_e.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function O1t(e){return!!(e&&Lf(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const M1t=e=>{const t=new Array(10),n=(r,s)=>{if(AB(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const a=wA(r)?[]:{};return Rk(r,(o,l)=>{const c=n(o,s+1);!sE(c)&&(a[l]=c)}),t[s]=void 0,a}}return r};return n(e,0)},R1t=gm("AsyncFunction"),L1t=e=>e&&(AB(e)||Lf(e))&&Lf(e.then)&&Lf(e.catch),D_e=((e,t)=>e?setImmediate:t?((n,r)=>(Hv.addEventListener("message",({source:s,data:a})=>{s===Hv&&a===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Hv.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Lf(Hv.postMessage)),D1t=typeof queueMicrotask<"u"?queueMicrotask.bind(Hv):typeof process<"u"&&process.nextTick||D_e,hr={isArray:wA,isArrayBuffer:P_e,isBuffer:t1t,isFormData:u1t,isArrayBufferView:n1t,isString:r1t,isNumber:F_e,isBoolean:s1t,isObject:AB,isPlainObject:HF,isReadableStream:f1t,isRequest:h1t,isResponse:p1t,isHeaders:m1t,isUndefined:sE,isDate:i1t,isFile:a1t,isBlob:o1t,isRegExp:_1t,isFunction:Lf,isStream:c1t,isURLSearchParams:d1t,isTypedArray:S1t,isFileList:l1t,forEach:Rk,merge:uJ,extend:g1t,trim:x1t,stripBOM:b1t,inherits:y1t,toFlatObject:v1t,kindOf:SB,kindOfTest:gm,endsWith:w1t,toArray:C1t,forEachEntry:N1t,matchAll:A1t,isHTMLForm:j1t,hasOwnProperty:_me,hasOwnProp:_me,reduceDescriptors:R_e,freezeMethods:k1t,toObjectSet:T1t,toCamelCase:E1t,noop:I1t,toFiniteNumber:P1t,findKey:O_e,global:Hv,isContextDefined:M_e,ALPHABET:L_e,generateString:F1t,isSpecCompliantForm:O1t,toJSONObject:M1t,isAsyncFn:R1t,isThenable:L1t,setImmediate:D_e,asap:D1t};function Ni(e,t,n,r,s){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),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}hr.inherits(Ni,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:hr.toJSONObject(this.config),code:this.code,status:this.status}}});const B_e=Ni.prototype,$_e={};["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=>{$_e[e]={value:e}});Object.defineProperties(Ni,$_e);Object.defineProperty(B_e,"isAxiosError",{value:!0});Ni.from=(e,t,n,r,s,a)=>{const o=Object.create(B_e);return hr.toFlatObject(e,o,function(c){return c!==Error.prototype},l=>l!=="isAxiosError"),Ni.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};const B1t=null;function dJ(e){return hr.isPlainObject(e)||hr.isArray(e)}function U_e(e){return hr.endsWith(e,"[]")?e.slice(0,-2):e}function Tme(e,t,n){return e?e.concat(t).map(function(s,a){return s=U_e(s),!n&&a?"["+s+"]":s}).join(n?".":""):t}function $1t(e){return hr.isArray(e)&&!e.some(dJ)}const U1t=hr.toFlatObject(hr,{},null,function(t){return/^is[A-Z]/.test(t)});function jB(e,t,n){if(!hr.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=hr.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,C){return!hr.isUndefined(C[w])});const r=n.metaTokens,s=n.visitor||d,a=n.dots,o=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&hr.isSpecCompliantForm(t);if(!hr.isFunction(s))throw new TypeError("visitor must be a function");function u(v){if(v===null)return"";if(hr.isDate(v))return v.toISOString();if(!c&&hr.isBlob(v))throw new Ni("Blob is not supported. Use a Buffer instead.");return hr.isArrayBuffer(v)||hr.isTypedArray(v)?c&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function d(v,w,C){let N=v;if(v&&!C&&typeof v=="object"){if(hr.endsWith(w,"{}"))w=r?w:w.slice(0,-2),v=JSON.stringify(v);else if(hr.isArray(v)&&$1t(v)||(hr.isFileList(v)||hr.endsWith(w,"[]"))&&(N=hr.toArray(v)))return w=U_e(w),N.forEach(function(P,R){!(hr.isUndefined(P)||P===null)&&t.append(o===!0?Tme([w],R,a):o===null?w:w+"[]",u(P))}),!1}return dJ(v)?!0:(t.append(Tme(C,w,a),u(v)),!1)}const f=[],x=Object.assign(U1t,{defaultVisitor:d,convertValue:u,isVisitable:dJ});function g(v,w){if(!hr.isUndefined(v)){if(f.indexOf(v)!==-1)throw Error("Circular reference detected in "+w.join("."));f.push(v),hr.forEach(v,function(N,I){(!(hr.isUndefined(N)||N===null)&&s.call(t,N,hr.isString(I)?I.trim():I,w,x))===!0&&g(N,w?w.concat(I):[I])}),f.pop()}}if(!hr.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Ime(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Qie(e,t){this._pairs=[],e&&jB(e,this,t)}const z_e=Qie.prototype;z_e.append=function(t,n){this._pairs.push([t,n])};z_e.toString=function(t){const n=t?function(r){return t.call(this,r,Ime)}:Ime;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function z1t(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function H_e(e,t,n){if(!t)return e;const r=n&&n.encode||z1t;hr.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let a;if(s?a=s(t,n):a=hr.isURLSearchParams(t)?t.toString():new Qie(t,n).toString(r),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class Pme{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){hr.forEach(this.handlers,function(r){r!==null&&t(r)})}}const V_e={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},H1t=typeof URLSearchParams<"u"?URLSearchParams:Qie,V1t=typeof FormData<"u"?FormData:null,W1t=typeof Blob<"u"?Blob:null,q1t={isBrowser:!0,classes:{URLSearchParams:H1t,FormData:V1t,Blob:W1t},protocols:["http","https","file","blob","url","data"]},Zie=typeof window<"u"&&typeof document<"u",fJ=typeof navigator=="object"&&navigator||void 0,G1t=Zie&&(!fJ||["ReactNative","NativeScript","NS"].indexOf(fJ.product)<0),K1t=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Y1t=Zie&&window.location.href||"http://localhost",X1t=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Zie,hasStandardBrowserEnv:G1t,hasStandardBrowserWebWorkerEnv:K1t,navigator:fJ,origin:Y1t},Symbol.toStringTag,{value:"Module"})),Au={...X1t,...q1t};function Q1t(e,t){return jB(e,new Au.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,a){return Au.isNode&&hr.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function Z1t(e){return hr.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function J1t(e){const t={},n=Object.keys(e);let r;const s=n.length;let a;for(r=0;r<s;r++)a=n[r],t[a]=e[a];return t}function W_e(e){function t(n,r,s,a){let o=n[a++];if(o==="__proto__")return!0;const l=Number.isFinite(+o),c=a>=n.length;return o=!o&&hr.isArray(s)?s.length:o,c?(hr.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!l):((!s[o]||!hr.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],a)&&hr.isArray(s[o])&&(s[o]=J1t(s[o])),!l)}if(hr.isFormData(e)&&hr.isFunction(e.entries)){const n={};return hr.forEachEntry(e,(r,s)=>{t(Z1t(r),s,n,0)}),n}return null}function ebt(e,t,n){if(hr.isString(e))try{return(t||JSON.parse)(e),hr.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const Lk={transitional:V_e,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,a=hr.isObject(t);if(a&&hr.isHTMLForm(t)&&(t=new FormData(t)),hr.isFormData(t))return s?JSON.stringify(W_e(t)):t;if(hr.isArrayBuffer(t)||hr.isBuffer(t)||hr.isStream(t)||hr.isFile(t)||hr.isBlob(t)||hr.isReadableStream(t))return t;if(hr.isArrayBufferView(t))return t.buffer;if(hr.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Q1t(t,this.formSerializer).toString();if((l=hr.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return jB(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return a||s?(n.setContentType("application/json",!1),ebt(t)):t}],transformResponse:[function(t){const n=this.transitional||Lk.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(hr.isResponse(t)||hr.isReadableStream(t))return t;if(t&&hr.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(l){if(o)throw l.name==="SyntaxError"?Ni.from(l,Ni.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Au.classes.FormData,Blob:Au.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};hr.forEach(["delete","get","head","post","put","patch"],e=>{Lk.headers[e]={}});const tbt=hr.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"]),nbt=e=>{const t={};let n,r,s;return e&&e.split(`
`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&tbt[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Fme=Symbol("internals");function v7(e){return e&&String(e).trim().toLowerCase()}function VF(e){return e===!1||e==null?e:hr.isArray(e)?e.map(VF):String(e)}function rbt(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const sbt=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function jH(e,t,n,r,s){if(hr.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!hr.isString(t)){if(hr.isString(r))return t.indexOf(r)!==-1;if(hr.isRegExp(r))return r.test(t)}}function ibt(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function abt(e,t){const n=hr.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,a,o){return this[r].call(this,t,s,a,o)},configurable:!0})})}class Kd{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function a(l,c,u){const d=v7(c);if(!d)throw new Error("header name must be a non-empty string");const f=hr.findKey(s,d);(!f||s[f]===void 0||u===!0||u===void 0&&s[f]!==!1)&&(s[f||c]=VF(l))}const o=(l,c)=>hr.forEach(l,(u,d)=>a(u,d,c));if(hr.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(hr.isString(t)&&(t=t.trim())&&!sbt(t))o(nbt(t),n);else if(hr.isHeaders(t))for(const[l,c]of t.entries())a(c,l,r);else t!=null&&a(n,t,r);return this}get(t,n){if(t=v7(t),t){const r=hr.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return rbt(s);if(hr.isFunction(n))return n.call(this,s,r);if(hr.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=v7(t),t){const r=hr.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||jH(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function a(o){if(o=v7(o),o){const l=hr.findKey(r,o);l&&(!n||jH(r,r[l],l,n))&&(delete r[l],s=!0)}}return hr.isArray(t)?t.forEach(a):a(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const a=n[r];(!t||jH(this,this[a],a,t,!0))&&(delete this[a],s=!0)}return s}normalize(t){const n=this,r={};return hr.forEach(this,(s,a)=>{const o=hr.findKey(r,a);if(o){n[o]=VF(s),delete n[a];return}const l=t?ibt(a):String(a).trim();l!==a&&delete n[a],n[l]=VF(s),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return hr.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&hr.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Fme]=this[Fme]={accessors:{}}).accessors,s=this.prototype;function a(o){const l=v7(o);r[l]||(abt(s,o),r[l]=!0)}return hr.isArray(t)?t.forEach(a):a(t),this}}Kd.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);hr.reduceDescriptors(Kd.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});hr.freezeMethods(Kd);function EH(e,t){const n=this||Lk,r=t||n,s=Kd.from(r.headers);let a=r.data;return hr.forEach(e,function(l){a=l.call(n,a,s.normalize(),t?t.status:void 0)}),s.normalize(),a}function q_e(e){return!!(e&&e.__CANCEL__)}function CA(e,t,n){Ni.call(this,e??"canceled",Ni.ERR_CANCELED,t,n),this.name="CanceledError"}hr.inherits(CA,Ni,{__CANCEL__:!0});function G_e(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Ni("Request failed with status code "+n.status,[Ni.ERR_BAD_REQUEST,Ni.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function obt(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function lbt(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,a=0,o;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=r[a];o||(o=u),n[s]=c,r[s]=u;let f=a,x=0;for(;f!==s;)x+=n[f++],f=f%e;if(s=(s+1)%e,s===a&&(a=(a+1)%e),u-o<t)return;const g=d&&u-d;return g?Math.round(x*1e3/g):void 0}}function cbt(e,t){let n=0,r=1e3/t,s,a;const o=(u,d=Date.now())=>{n=d,s=null,a&&(clearTimeout(a),a=null),e.apply(null,u)};return[(...u)=>{const d=Date.now(),f=d-n;f>=r?o(u,d):(s=u,a||(a=setTimeout(()=>{a=null,o(s)},r-f)))},()=>s&&o(s)]}const uM=(e,t,n=3)=>{let r=0;const s=lbt(50,250);return cbt(a=>{const o=a.loaded,l=a.lengthComputable?a.total:void 0,c=o-r,u=s(c),d=o<=l;r=o;const f={loaded:o,total:l,progress:l?o/l:void 0,bytes:c,rate:u||void 0,estimated:u&&l&&d?(l-o)/u:void 0,event:a,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},Ome=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Mme=e=>(...t)=>hr.asap(()=>e(...t)),ubt=Au.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Au.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Au.origin),Au.navigator&&/(msie|trident)/i.test(Au.navigator.userAgent)):()=>!0,dbt=Au.hasStandardBrowserEnv?{write(e,t,n,r,s,a){const o=[e+"="+encodeURIComponent(t)];hr.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),hr.isString(r)&&o.push("path="+r),hr.isString(s)&&o.push("domain="+s),a===!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 fbt(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function hbt(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function K_e(e,t){return e&&!fbt(t)?hbt(e,t):t}const Rme=e=>e instanceof Kd?{...e}:e;function S3(e,t){t=t||{};const n={};function r(u,d,f,x){return hr.isPlainObject(u)&&hr.isPlainObject(d)?hr.merge.call({caseless:x},u,d):hr.isPlainObject(d)?hr.merge({},d):hr.isArray(d)?d.slice():d}function s(u,d,f,x){if(hr.isUndefined(d)){if(!hr.isUndefined(u))return r(void 0,u,f,x)}else return r(u,d,f,x)}function a(u,d){if(!hr.isUndefined(d))return r(void 0,d)}function o(u,d){if(hr.isUndefined(d)){if(!hr.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function l(u,d,f){if(f in t)return r(u,d);if(f in e)return r(void 0,u)}const c={url:a,method:a,data:a,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:l,headers:(u,d,f)=>s(Rme(u),Rme(d),f,!0)};return hr.forEach(Object.keys(Object.assign({},e,t)),function(d){const f=c[d]||s,x=f(e[d],t[d],d);hr.isUndefined(x)&&f!==l||(n[d]=x)}),n}const Y_e=e=>{const t=S3({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:a,headers:o,auth:l}=t;t.headers=o=Kd.from(o),t.url=H_e(K_e(t.baseURL,t.url),e.params,e.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let c;if(hr.isFormData(n)){if(Au.hasStandardBrowserEnv||Au.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[u,...d]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...d].join("; "))}}if(Au.hasStandardBrowserEnv&&(r&&hr.isFunction(r)&&(r=r(t)),r||r!==!1&&ubt(t.url))){const u=s&&a&&dbt.read(a);u&&o.set(s,u)}return t},pbt=typeof XMLHttpRequest<"u",mbt=pbt&&function(e){return new Promise(function(n,r){const s=Y_e(e);let a=s.data;const o=Kd.from(s.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:u}=s,d,f,x,g,v;function w(){g&&g(),v&&v(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let C=new XMLHttpRequest;C.open(s.method.toUpperCase(),s.url,!0),C.timeout=s.timeout;function N(){if(!C)return;const P=Kd.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),F={data:!l||l==="text"||l==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:P,config:e,request:C};G_e(function(L){n(L),w()},function(L){r(L),w()},F),C=null}"onloadend"in C?C.onloadend=N:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(N)},C.onabort=function(){C&&(r(new Ni("Request aborted",Ni.ECONNABORTED,e,C)),C=null)},C.onerror=function(){r(new Ni("Network Error",Ni.ERR_NETWORK,e,C)),C=null},C.ontimeout=function(){let R=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const F=s.transitional||V_e;s.timeoutErrorMessage&&(R=s.timeoutErrorMessage),r(new Ni(R,F.clarifyTimeoutError?Ni.ETIMEDOUT:Ni.ECONNABORTED,e,C)),C=null},a===void 0&&o.setContentType(null),"setRequestHeader"in C&&hr.forEach(o.toJSON(),function(R,F){C.setRequestHeader(F,R)}),hr.isUndefined(s.withCredentials)||(C.withCredentials=!!s.withCredentials),l&&l!=="json"&&(C.responseType=s.responseType),u&&([x,v]=uM(u,!0),C.addEventListener("progress",x)),c&&C.upload&&([f,g]=uM(c),C.upload.addEventListener("progress",f),C.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(d=P=>{C&&(r(!P||P.type?new CA(null,e,C):P),C.abort(),C=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const I=obt(s.url);if(I&&Au.protocols.indexOf(I)===-1){r(new Ni("Unsupported protocol "+I+":",Ni.ERR_BAD_REQUEST,e));return}C.send(a||null)})},xbt=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const a=function(u){if(!s){s=!0,l();const d=u instanceof Error?u:this.reason;r.abort(d instanceof Ni?d:new CA(d instanceof Error?d.message:d))}};let o=t&&setTimeout(()=>{o=null,a(new Ni(`timeout ${t} of ms exceeded`,Ni.ETIMEDOUT))},t);const l=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(a):u.removeEventListener("abort",a)}),e=null)};e.forEach(u=>u.addEventListener("abort",a));const{signal:c}=r;return c.unsubscribe=()=>hr.asap(l),c}},gbt=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},bbt=async function*(e,t){for await(const n of ybt(e))yield*gbt(n,t)},ybt=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Lme=(e,t,n,r)=>{const s=bbt(e,t);let a=0,o,l=c=>{o||(o=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await s.next();if(u){l(),c.close();return}let f=d.byteLength;if(n){let x=a+=f;n(x)}c.enqueue(new Uint8Array(d))}catch(u){throw l(u),u}},cancel(c){return l(c),s.return()}},{highWaterMark:2})},EB=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",X_e=EB&&typeof ReadableStream=="function",vbt=EB&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Q_e=(e,...t)=>{try{return!!e(...t)}catch{return!1}},wbt=X_e&&Q_e(()=>{let e=!1;const t=new Request(Au.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Dme=64*1024,hJ=X_e&&Q_e(()=>hr.isReadableStream(new Response("").body)),dM={stream:hJ&&(e=>e.body)};EB&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!dM[t]&&(dM[t]=hr.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Ni(`Response type '${t}' is not supported`,Ni.ERR_NOT_SUPPORT,r)})})})(new Response);const Cbt=async e=>{if(e==null)return 0;if(hr.isBlob(e))return e.size;if(hr.isSpecCompliantForm(e))return(await new Request(Au.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(hr.isArrayBufferView(e)||hr.isArrayBuffer(e))return e.byteLength;if(hr.isURLSearchParams(e)&&(e=e+""),hr.isString(e))return(await vbt(e)).byteLength},Sbt=async(e,t)=>{const n=hr.toFiniteNumber(e.getContentLength());return n??Cbt(t)},Nbt=EB&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:a,timeout:o,onDownloadProgress:l,onUploadProgress:c,responseType:u,headers:d,withCredentials:f="same-origin",fetchOptions:x}=Y_e(e);u=u?(u+"").toLowerCase():"text";let g=xbt([s,a&&a.toAbortSignal()],o),v;const w=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let C;try{if(c&&wbt&&n!=="get"&&n!=="head"&&(C=await Sbt(d,r))!==0){let F=new Request(t,{method:"POST",body:r,duplex:"half"}),U;if(hr.isFormData(r)&&(U=F.headers.get("content-type"))&&d.setContentType(U),F.body){const[L,z]=Ome(C,uM(Mme(c)));r=Lme(F.body,Dme,L,z)}}hr.isString(f)||(f=f?"include":"omit");const N="credentials"in Request.prototype;v=new Request(t,{...x,signal:g,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:N?f:void 0});let I=await fetch(v);const P=hJ&&(u==="stream"||u==="response");if(hJ&&(l||P&&w)){const F={};["status","statusText","headers"].forEach(X=>{F[X]=I[X]});const U=hr.toFiniteNumber(I.headers.get("content-length")),[L,z]=l&&Ome(U,uM(Mme(l),!0))||[];I=new Response(Lme(I.body,Dme,L,()=>{z&&z(),w&&w()}),F)}u=u||"text";let R=await dM[hr.findKey(dM,u)||"text"](I,e);return!P&&w&&w(),await new Promise((F,U)=>{G_e(F,U,{data:R,headers:Kd.from(I.headers),status:I.status,statusText:I.statusText,config:e,request:v})})}catch(N){throw w&&w(),N&&N.name==="TypeError"&&/fetch/i.test(N.message)?Object.assign(new Ni("Network Error",Ni.ERR_NETWORK,e,v),{cause:N.cause||N}):Ni.from(N,N&&N.code,e,v)}}),pJ={http:B1t,xhr:mbt,fetch:Nbt};hr.forEach(pJ,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Bme=e=>`- ${e}`,Abt=e=>hr.isFunction(e)||e===null||e===!1,Z_e={getAdapter:e=>{e=hr.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let a=0;a<t;a++){n=e[a];let o;if(r=n,!Abt(n)&&(r=pJ[(o=String(n)).toLowerCase()],r===void 0))throw new Ni(`Unknown adapter '${o}'`);if(r)break;s[o||"#"+a]=r}if(!r){const a=Object.entries(s).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=t?a.length>1?`since :
`+a.map(Bme).join(`
`):" "+Bme(a[0]):"as no adapter specified";throw new Ni("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:pJ};function _H(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new CA(null,e)}function $me(e){return _H(e),e.headers=Kd.from(e.headers),e.data=EH.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Z_e.getAdapter(e.adapter||Lk.adapter)(e).then(function(r){return _H(e),r.data=EH.call(e,e.transformResponse,r),r.headers=Kd.from(r.headers),r},function(r){return q_e(r)||(_H(e),r&&r.response&&(r.response.data=EH.call(e,e.transformResponse,r.response),r.response.headers=Kd.from(r.response.headers))),Promise.reject(r)})}const J_e="1.7.9",_B={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{_B[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Ume={};_B.transitional=function(t,n,r){function s(a,o){return"[Axios v"+J_e+"] Transitional option '"+a+"'"+o+(r?". "+r:"")}return(a,o,l)=>{if(t===!1)throw new Ni(s(o," has been removed"+(n?" in "+n:"")),Ni.ERR_DEPRECATED);return n&&!Ume[o]&&(Ume[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,o,l):!0}};_B.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function jbt(e,t,n){if(typeof e!="object")throw new Ni("options must be an object",Ni.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const a=r[s],o=t[a];if(o){const l=e[a],c=l===void 0||o(l,a,e);if(c!==!0)throw new Ni("option "+a+" must be "+c,Ni.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ni("Unknown option "+a,Ni.ERR_BAD_OPTION)}}const WF={assertOptions:jbt,validators:_B},Hm=WF.validators;class Ww{constructor(t){this.defaults=t,this.interceptors={request:new Pme,response:new Pme}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const a=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+a):r.stack=a}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=S3(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:a}=n;r!==void 0&&WF.assertOptions(r,{silentJSONParsing:Hm.transitional(Hm.boolean),forcedJSONParsing:Hm.transitional(Hm.boolean),clarifyTimeoutError:Hm.transitional(Hm.boolean)},!1),s!=null&&(hr.isFunction(s)?n.paramsSerializer={serialize:s}:WF.assertOptions(s,{encode:Hm.function,serialize:Hm.function},!0)),WF.assertOptions(n,{baseUrl:Hm.spelling("baseURL"),withXsrfToken:Hm.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=a&&hr.merge(a.common,a[n.method]);a&&hr.forEach(["delete","get","head","post","put","patch","common"],v=>{delete a[v]}),n.headers=Kd.concat(o,a);const l=[];let c=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(c=c&&w.synchronous,l.unshift(w.fulfilled,w.rejected))});const u=[];this.interceptors.response.forEach(function(w){u.push(w.fulfilled,w.rejected)});let d,f=0,x;if(!c){const v=[$me.bind(this),void 0];for(v.unshift.apply(v,l),v.push.apply(v,u),x=v.length,d=Promise.resolve(n);f<x;)d=d.then(v[f++],v[f++]);return d}x=l.length;let g=n;for(f=0;f<x;){const v=l[f++],w=l[f++];try{g=v(g)}catch(C){w.call(this,C);break}}try{d=$me.call(this,g)}catch(v){return Promise.reject(v)}for(f=0,x=u.length;f<x;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=S3(this.defaults,t);const n=K_e(t.baseURL,t.url);return H_e(n,t.params,t.paramsSerializer)}}hr.forEach(["delete","get","head","options"],function(t){Ww.prototype[t]=function(n,r){return this.request(S3(r||{},{method:t,url:n,data:(r||{}).data}))}});hr.forEach(["post","put","patch"],function(t){function n(r){return function(a,o,l){return this.request(S3(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}Ww.prototype[t]=n(),Ww.prototype[t+"Form"]=n(!0)});class Jie{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(s=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](s);r._listeners=null}),this.promise.then=s=>{let a;const o=new Promise(l=>{r.subscribe(l),a=l}).then(s);return o.cancel=function(){r.unsubscribe(a)},o},t(function(a,o,l){r.reason||(r.reason=new CA(a,o,l),n(r.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 n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Jie(function(s){t=s}),cancel:t}}}function Ebt(e){return function(n){return e.apply(null,n)}}function _bt(e){return hr.isObject(e)&&e.isAxiosError===!0}const mJ={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(mJ).forEach(([e,t])=>{mJ[t]=e});function eke(e){const t=new Ww(e),n=I_e(Ww.prototype.request,t);return hr.extend(n,Ww.prototype,t,{allOwnKeys:!0}),hr.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return eke(S3(e,s))},n}const ls=eke(Lk);ls.Axios=Ww;ls.CanceledError=CA;ls.CancelToken=Jie;ls.isCancel=q_e;ls.VERSION=J_e;ls.toFormData=jB;ls.AxiosError=Ni;ls.Cancel=ls.CanceledError;ls.all=function(t){return Promise.all(t)};ls.spread=Ebt;ls.isAxiosError=_bt;ls.mergeConfig=S3;ls.AxiosHeaders=Kd;ls.formToJSON=e=>W_e(hr.isHTMLForm(e)?new FormData(e):e);ls.getAdapter=Z_e.getAdapter;ls.HttpStatusCode=mJ;ls.default=ls;var Dy="https://dextrabothypev2.nftinit.io/";async function kbt(e,t){if(t==1||t==null)return fetch(Dy+"api/subscriber/sign_start/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e})}).then(n=>n.json());if(t>1)return fetch(Dy+"api/subscriber/sign_start/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,token_slot:t})}).then(n=>n.json())}async function Tbt(e,t,n,r){if(r==1||r==null)return fetch(Dy+"api/subscriber/sign_complete_v2/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,temp_password:t,signature:n})}).then(s=>s.json());if(r>1)return fetch(Dy+"api/subscriber/sign_complete_v2/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,temp_password:t,signature:n,token_slot:r})}).then(s=>s.json())}async function Si(e,t){if(e)return await fetch(Dy+"api/subscriber/check_account/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,token:t})}).then(n=>n.json())}async function Ibt(e,t){if(e)return await fetch(Dy+"api/subscriber/telegram_start/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,token:t})}).then(n=>n.json())}async function Pbt(e,t){if(e)return await fetch(Dy+"api/hyper/following/list/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,token:t})}).then(n=>n.json())}async function Fbt(e,t){if(e)return await fetch(Dy+"api/hyper/tracker/list/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,token:t})}).then(n=>n.json())}async function Obt(e){try{const t=await fetch(`${API_URL}/refresh_token/`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({address:e})});if(!t.ok)throw new Error("Refresh token failed");const n=await t.json();if(n.success&&n.trade_token)return localStorage.setItem("hyperTradeToken",n.trade_token),localStorage.setItem("hyperAddress",n.address),n.trade_token;throw new Error("Refresh response invalid")}catch(t){return console.error("Token refresh error:",t),null}}let kH=null;function Mbt(e){kH&&clearInterval(kH),kH=setInterval(async()=>{const t=localStorage.getItem("hyperTradeTokenExp"),n=Date.now()/1e3;(!t||t-n<600)&&await Obt(e)&&(localStorage.setItem("hyperTradeTokenExp",n+259200),console.log("Trade token refreshed"))},5*60*1e3)}const Rbt=e=>{const t=[...e].sort((r,s)=>s.time-r.time),n=new Map;return t.forEach(r=>{var a;const s=r.oid;if(!n.has(s)){const o=t.filter(v=>v.oid===r.oid),l=o.reduce((v,w)=>v+parseFloat(w.sz),0),c=o.map(v=>parseFloat(v.startPosition));let u;c.includes(0)?u=0:c.every(v=>v>0)?u=Math.max(...c):c.every(v=>v<0)?u=Math.min(...c):u=o.reduce((v,w)=>v+parseFloat(w.startPosition),0);const d=o.reduce((v,w)=>v+parseFloat(w.sz)*parseFloat(w.px),0),f=o.reduce((v,w)=>v+parseFloat(w.closedPnl||0),0),x=o.reduce((v,w)=>v+parseFloat(w.fee||0),0),g=((a=o.find(v=>v.dir==="Long > Short"||v.dir==="Short > Long"))==null?void 0:a.dir)||"";n.set(s,{oid:r.oid,asset:r.coin,direction:g===""?r.dir:g,fills:o,totalSize:l,totalStartPositions:u,totalValue:d,pnl:f-x,latestFill:r.time})}}),Array.from(n.values()).sort((r,s)=>s.latestFill-r.latestFill)},Gr=m.createContext(),Lbt=({children:e})=>{const t=Ic(),{isConnected:n,address:r}=Yr(),{signMessageAsync:s}=g_e(),[a,o]=m.useState("user"),[l,c]=m.useState(null),[u,d]=m.useState(0),[f,x]=m.useState(0),[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,I]=m.useState(!1),[P,R]=m.useState(0),[F,U]=m.useState(window.localStorage.getItem("hyperToken")),[L,z]=m.useState(window.localStorage.getItem("hyperAddress")),[X,ne]=m.useState(!1),[J,Z]=m.useState(!1),[re,he]=m.useState(!1),[Y,ie]=m.useState(null),[oe,G]=m.useState(!1),[V,ee]=m.useState(null),[ae,fe]=m.useState(null),[Ae,ce]=m.useState([]),[ye,Ne]=m.useState([]),[be,je]=m.useState([]),[Ie,Re]=m.useState(""),[Qe,Be]=m.useState({activeRange:"",day:0,week:0,month:0}),[it,tt]=m.useState([]),at=m.useCallback(async()=>{const Xe=window.localStorage.getItem("hyperToken"),Vt=window.localStorage.getItem("hyperAddress");if(!Xe||!Vt){tt([]);return}try{const Yt=await Si(Vt.toLowerCase(),Xe);Yt!=null&&Yt.success&&tt((Yt==null?void 0:Yt.bot_slots_info)||[])}catch{}},[]);async function dt(){var Ve,Ke;const Xe=window.localStorage.getItem("hyperToken"),Vt=window.localStorage.getItem("hyperAddress"),Yt=Ylt(Xe);if(Xe&&Yt!==!1){const ft=await Si(Vt,Xe);ft.success?(tt((ft==null?void 0:ft.bot_slots_info)||[]),c(ft.telegram_chat_id),o(ft.subscriber_role),d((Ve=ft==null?void 0:ft.mushboomer_counts)==null?void 0:Ve.eth),x((Ke=ft==null?void 0:ft.mushboomer_counts)==null?void 0:Ke.sol),v(ft==null?void 0:ft.referral_code),C(ft==null?void 0:ft.refcode),I(ft==null?void 0:ft.whitelist),R(ft==null?void 0:ft.subs_expire_day),U(localStorage.getItem("hyperToken")),z(localStorage.getItem("hyperAddress")),cn(),tn()):tt([])}else ct(1)}async function ct(Xe){try{if(!r)throw new Error("No accounts found. Please connect your wallet.");const Vt=await kbt(r,Xe);if(!Vt.success)return{success:!1,message:Vt.error_message};const Yt=Vt.temp_password,Ve=`dextrabot.io verification code : ${Yt}`,Ke=await s({message:Ve}),ft=await Tbt(Vt.address,Yt,Ke,Xe);if(ft&&ft.token){if(window.localStorage.setItem("hyperAddress",ft.address),window.localStorage.setItem("hyperToken",ft.token),ft.trade_token){window.localStorage.setItem("hyperTradeToken",ft.trade_token);const en=Date.now()/1e3;window.localStorage.setItem("hyperTradeTokenExp",en+(ft.expires_in||259200)),Mbt(ft.address)}return dt(),window.dispatchEvent(new Event("localStorageUpdated")),{success:!0,initToken:ft.token}}else throw new Error("Failed to complete the signing process.")}catch(Vt){return console.error("Error during sign-in:",Vt),{success:!1,message:Vt.message||"An unknown error occurred."}}}const[Ut,kt]=m.useState([]);async function tn(){const Xe=window.localStorage.getItem("hyperToken"),Vt=window.localStorage.getItem("hyperAddress");try{he(!0);const Yt=await Pbt(r||Vt,Xe);if(!Yt.success){Yt.error_message!="User not verified"&&on.error(Yt.error_message),Yt.error_message=="User not verified";return}Yt.success?kt(Yt==null?void 0:Yt.data):kt([])}catch(Yt){Yt.name!=="AbortError"&&(ie(Yt.message),on.error(Yt.message)),kt([])}finally{he(!1)}}const[jt,un]=m.useState([]);async function cn(){const Xe=window.localStorage.getItem("hyperToken"),Vt=window.localStorage.getItem("hyperAddress");try{G(!0);const Yt=await Fbt(r||Vt,Xe);if(!Yt.success){Yt.error_message!="User not verified"&&on.error(Yt.error_message),Yt.error_message=="User not verified";return}Yt.success?un(Yt==null?void 0:Yt.data):un([])}catch(Yt){Yt.name!=="AbortError"&&(ee(Yt.message),on.error(Yt.message)),un([])}finally{G(!1)}}m.useEffect(()=>{window.localStorage.getItem("hyperToken")==null&&t.pathname!="/tracked-wallets"&&J&&ne(!0)},[n]),m.useEffect(()=>{!n&&!F||(t.pathname=="/wallet-management"||t.pathname.includes("referral")||t.pathname=="/leaderboard")&&F!=null&&F&&tn()},[F]),m.useRef(!1),m.useEffect(()=>{if(t.pathname==="/"||t.pathname==="/sitemap"||t.pathname==="/videos"||!window.localStorage.getItem("hyperToken"))return;const Yt=`notificationsFeedSocket_${r==null?void 0:r.toLowerCase()}`,Ve=localStorage.getItem(Yt);ce(Ve?JSON.parse(Ve):[]);const Ke=vy("https://dextrabothypesocketv2.nftinit.io/");return fe(Ke),Ke.on("connect",()=>{console.log("Socket connected")}),Ke.on("disconnect",()=>{console.log("Socket disconnected")}),Ke.on("hyper_get_trade_message",async ft=>{const en=(Array.isArray(ft)?ft:[ft]).map(Je=>({...Je,is_read:!1,trader_pnl:null}));ce(Je=>{const He=new Set(Je.map(lt=>lt==null?void 0:lt.oid)),qe=[...en==null?void 0:en.filter(lt=>!(He!=null&&He.has(lt==null?void 0:lt.oid))),...Je].slice(0,100);return localStorage.setItem(Yt,JSON.stringify(qe)),qe});const Dt=window.localStorage.getItem("hyperToken");if(!r||!Dt){console.log("User logged out before timeout - skipping PNL fetch.");return}const At=en.map(Je=>Je==null?void 0:Je.trader_wallet).filter(Boolean)[0];try{const Je=await ls.post("https://api-ui.hyperliquid.xyz/info",{aggregateByTime:!0,type:"userFills",user:At});if(Je.data){const He=Rbt(Je.data),Rt=new Map(He==null?void 0:He.map(qe=>[qe==null?void 0:qe.oid,qe==null?void 0:qe.pnl]));ce(qe=>{const lt=qe==null?void 0:qe.map(xt=>Rt!=null&&Rt.has(xt==null?void 0:xt.trader_oid)?{...xt,trader_pnl:Rt==null?void 0:Rt.get(xt==null?void 0:xt.trader_oid)}:xt);return localStorage.setItem(Yt,JSON.stringify(lt)),lt})}else console.log("Unexpected API response")}catch(Je){console.error("PNL API error:",Je)}}),()=>{Ke.disconnect()}},[F]),m.useEffect(()=>{if(!ae||!r||!Ut||Ut.length===0)return;Ut.map(Vt=>Vt.wallet_address);const Xe=window.localStorage.getItem("hyperToken");return ae.emit("subscribe",{login:r==null?void 0:r.toLowerCase(),token:Xe}),()=>{}},[ae,r,Ut]);const Pt=async()=>{try{const Xe=window.localStorage.getItem("hyperToken"),Vt="https://dextrabothypev2.nftinit.io/api/subscriber/announcement/getannouncements/";let Yt={};r&&Xe&&(Yt={address:r.toLowerCase(),token:Xe});const Ve=await fetch(Vt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(Yt)});if(!Ve.ok)throw new Error(`Server responded with status ${Ve.status}`);const Ke=await Ve.json();Ke.success?Ne(Ke):console.log(Ke.error_message)}catch(Xe){console.error("Error in handleAnnouncement:",Xe)}};return m.useEffect(()=>{Pt();const Xe=setInterval(()=>{Pt()},6e4);return()=>clearInterval(Xe)},[n,F]),m.useEffect(()=>{(async()=>{try{const Ve=(await(await fetch("https://dextradata.nftinit.io/api/hyper/terminal_coins/v2/")).json()).coins;je(Ve)}catch(Vt){console.error("Data retrieval error:",Vt),Re(Vt.message)}})()},[]),i.jsx(Gr.Provider,{value:{subscriberRole:a,setSubscriberRole:o,subsExpireDay:P,setSubsExpireDay:R,hyperToken:F,setHyperToken:U,hyperAddress:L,setHyperAddress:z,signModalOpen:X,setSignModalOpen:ne,walletLogin:dt,signIn:ct,copyTradeWatchList:Ut,setCopyTradeWatchList:kt,trackedWatchList:jt,setTrackedWatchList:un,getCopyTradeWatchList:tn,getTrackedWatchList:cn,copyWatchListLoading:re,setCopyWatchListLoading:he,trackedWatchListLoading:oe,setTrackedWatchListLoading:G,copyWatchListError:Y,setCopyWatchListError:ie,trackedWatchListError:V,setTrackedWatchListError:ee,signInConnectButtonOpen:J,setSignInConnectButtonOpen:Z,telegramChatId:l,setTelegramChatId:c,mushboomerETH:u,setMushboomerETH:d,isWhitelist:N,setIsWhitelist:I,mushboomerSOL:f,setMushboomerSOL:x,isReferralCode:g,setIsReferralCode:v,isReferralCodeName:w,setIsReferralCodeName:C,latestPnL:Qe,setLatestPnL:Be,notificationData:Ae,setNotificationData:ce,announcementData:ye,setAnnouncementData:Ne,handleAnnouncement:Pt,searchTerminalCoin:be,setSearchTerminalCoin:je,isSearchTerminalError:Ie,setIsSearchTerminalError:Re,botSlotsInfo:it,setBotSlotsInfo:tt,refreshBotSlots:at},children:e})},Dbt="data:image/svg+xml,%3csvg%20width='21'%20height='20'%20viewBox='0%200%2021%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.6758%2020C16.1986%2020%2020.6758%2015.5228%2020.6758%2010C20.6758%204.47715%2016.1986%200%2010.6758%200C5.15293%200%200.675781%204.47715%200.675781%2010C0.675781%2015.5228%205.15293%2020%2010.6758%2020Z'%20fill='url(%23paint0_linear_26_4024)'/%3e%3cpath%20d='M15.667%205.86343C15.756%205.28809%2015.209%204.83396%2014.6975%205.05857L4.50863%209.532C4.14178%209.69307%204.16862%2010.2488%204.5491%2010.3699L6.65026%2011.0391C7.05133%2011.1668%207.48554%2011.1007%207.83576%2010.8588L12.573%207.58593C12.7159%207.48721%2012.8716%207.69036%2012.7495%207.81614L9.33954%2011.3319C9.00876%2011.6729%209.0744%2012.2509%209.47233%2012.5004L13.2902%2014.8945C13.7184%2015.163%2014.2693%2014.8933%2014.3493%2014.3758L15.667%205.86343Z'%20fill='white'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_26_4024'%20x1='10.6758'%20y1='0'%20x2='10.6758'%20y2='20'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2337BBFE'/%3e%3cstop%20offset='1'%20stop-color='%23007DBB'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",Hi="/assets/dextrabotIcon-B5aLRkPC.png",Bbt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fillRule='evenodd'%20clipRule='evenodd'%20d='M9.72943%203.99268C10.8214%202.39501%2013.1782%202.39502%2014.2702%203.99268L14.7021%204.62463C17.4081%208.58385%2019.7331%2012.7905%2021.6458%2017.1881L21.736%2017.3956C22.4101%2018.9453%2021.3917%2020.705%2019.7122%2020.8927C14.5865%2021.4656%209.41304%2021.4656%204.28741%2020.8927C2.60787%2020.705%201.5895%2018.9453%202.26356%2017.3956L2.35377%2017.1881C4.2665%2012.7905%206.59147%208.58384%209.29751%204.62463L9.72943%203.99268ZM12.9998%209.00005C12.9998%209.55233%2012.5521%2010%2011.9998%2010C11.4475%2010%2010.9998%209.55233%2010.9998%209.00005C10.9998%208.44776%2011.4475%208.00005%2011.9998%208.00005C12.5521%208.00005%2012.9998%208.44776%2012.9998%209.00005ZM11.9998%2011.75C12.414%2011.75%2012.7498%2012.0858%2012.7498%2012.5V17.5C12.7498%2017.9143%2012.414%2018.25%2011.9998%2018.25C11.5856%2018.25%2011.2498%2017.9143%2011.2498%2017.5V12.5C11.2498%2012.0858%2011.5856%2011.75%2011.9998%2011.75Z'%20fill='%23FF3566'/%3e%3c/svg%3e",$bt="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M29.2932%209.61329C28.9198%205.97329%2026.0265%203.07996%2022.3865%202.70663C22.1198%202.67996%2021.8532%202.66663%2021.5865%202.66663H10.4132C10.1465%202.66663%209.87984%202.67996%209.61317%202.70663C5.97317%203.07996%203.07984%205.97329%202.7065%209.61329C2.67984%209.87996%202.6665%2010.1466%202.6665%2010.4133V21.5866C2.6665%2021.8533%202.67984%2022.12%202.7065%2022.3866C3.07984%2026.0266%205.97317%2028.92%209.61317%2029.2933C9.87984%2029.32%2010.1465%2029.3333%2010.4132%2029.3333H18.6665C19.3998%2029.3333%2019.9998%2028.7333%2019.9998%2028V24.04C19.9998%2021.8133%2021.8132%2020%2024.0398%2020H27.9998C28.7332%2020%2029.3332%2019.4%2029.3332%2018.6666V10.4133C29.3332%2010.1466%2029.3198%209.87996%2029.2932%209.61329ZM10.3332%2018C10.3332%2018.5466%209.87984%2019%209.33317%2019C8.7865%2019%208.33317%2018.5466%208.33317%2018V14C8.33317%2013.4533%208.7865%2013%209.33317%2013C9.87984%2013%2010.3332%2013.4533%2010.3332%2014V18ZM16.9998%2018C16.9998%2018.5466%2016.5465%2019%2015.9998%2019C15.4532%2019%2014.9998%2018.5466%2014.9998%2018V14C14.9998%2013.4533%2015.4532%2013%2015.9998%2013C16.5465%2013%2016.9998%2013.4533%2016.9998%2014V18Z'%20fill='%23FFA756'/%3e%3cpath%20d='M27.9602%2021.3334H24.0402C22.3468%2021.3334%2021.3335%2022.3467%2021.3335%2024.04V27.96C21.3335%2029.6534%2022.3468%2030.6667%2024.0402%2030.6667H27.9602C29.6535%2030.6667%2030.6668%2029.6534%2030.6668%2027.96V24.04C30.6668%2022.3467%2029.6535%2021.3334%2027.9602%2021.3334ZM28.6268%2027.4134C28.9602%2027.7467%2028.9602%2028.2934%2028.6268%2028.6267C28.4535%2028.7867%2028.2268%2028.8667%2028.0135%2028.8667C27.8002%2028.8667%2027.5735%2028.7867%2027.4002%2028.6267L25.9868%2027.2134L24.6002%2028.6267C24.4268%2028.7867%2024.2135%2028.8667%2023.9735%2028.8667C23.7735%2028.8667%2023.5468%2028.7867%2023.3868%2028.6267C23.0535%2028.2934%2023.0535%2027.7467%2023.3868%2027.4134L24.8002%2026L23.3868%2024.6C23.0535%2024.2667%2023.0535%2023.72%2023.3868%2023.3867C23.7202%2023.0534%2024.2668%2023.0534%2024.6002%2023.3867L25.9868%2024.8L27.4002%2023.3867C27.7335%2023.0534%2028.2935%2023.0534%2028.6268%2023.3867C28.9602%2023.72%2028.9602%2024.2667%2028.6268%2024.6L27.2135%2026L28.6268%2027.4134Z'%20fill='%23FFA756'/%3e%3c/svg%3e",Ua="data:image/svg+xml,%3csvg%20width='40'%20height='40'%20viewBox='0%200%2040%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0.5'%20y='0.5'%20width='39'%20height='39'%20rx='19.5'%20fill='%23232323'/%3e%3crect%20x='0.5'%20y='0.5'%20width='39'%20height='39'%20rx='19.5'%20stroke='%23ACACAC'%20style='mix-blend-mode:color-dodge'/%3e%3cpath%20d='M21.1515%2013.9091C21.1515%2012.3024%2022.454%2011%2024.0606%2011C25.6673%2011%2026.9697%2012.3024%2026.9697%2013.9091C26.9697%2015.5157%2025.6673%2016.8182%2024.0606%2016.8182C22.454%2016.8182%2021.1515%2015.5157%2021.1515%2013.9091Z'%20fill='%236C6C6C'/%3e%3cpath%20d='M17.5365%2017.017C17.2707%2016.5917%2016.8045%2016.3333%2016.303%2016.3333C15.8015%2016.3333%2015.3354%2016.5917%2015.0696%2017.017L10.2211%2024.7745C9.94085%2025.2229%209.92601%2025.7881%2010.1823%2026.2506C10.4387%2026.7131%2010.9258%2027%2011.4545%2027H26.9697C27.5206%2027%2028.0243%2026.6887%2028.2707%2026.1959C28.5171%2025.7032%2028.4639%2025.1135%2028.1333%2024.6727L25.2243%2020.7939C24.9496%2020.4277%2024.5184%2020.2121%2024.0606%2020.2121C23.6028%2020.2121%2023.1717%2020.4277%2022.897%2020.7939L21.2607%2022.9757L17.5365%2017.017Z'%20fill='%236C6C6C'/%3e%3c/svg%3e",Oa="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.6568%2017.6568L6.34314%206.34314'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20/%3e%3cpath%20d='M17.6569%206.34314L6.34315%2017.6568'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20/%3e%3c/svg%3e",bo="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.33342%207.52484V9.97484C9.33342%2012.0165%208.51675%2012.8332%206.47508%2012.8332H4.02508C1.98341%2012.8332%201.16675%2012.0165%201.16675%209.97484V7.52484C1.16675%205.48317%201.98341%204.6665%204.02508%204.6665H6.47508C8.51675%204.6665%209.33342%205.48317%209.33342%207.52484Z'%20fill='%23989898'/%3e%3cpath%20d='M9.97511%201.1665H7.52511C5.89748%201.1665%205.05203%201.68923%204.77585%202.93218C4.65505%203.47584%205.1276%203.93734%205.68451%203.93734H6.47511C8.92511%203.93734%2010.0626%205.07484%2010.0626%207.52484V8.31543C10.0626%208.87235%2010.5241%209.34489%2011.0678%209.22409C12.3107%208.94791%2012.8334%208.10247%2012.8334%206.47484V4.02484C12.8334%201.98317%2012.0168%201.1665%209.97511%201.1665Z'%20fill='%23989898'/%3e%3c/svg%3e",Ubt="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.53%2010.1625C13.215%2010.47%2013.035%2010.9125%2013.08%2011.385C13.1475%2012.195%2013.89%2012.7875%2014.7%2012.7875H16.125V13.68C16.125%2015.2325%2014.8575%2016.5%2013.305%2016.5H4.695C3.1425%2016.5%201.875%2015.2325%201.875%2013.68V8.63251C1.875%207.08001%203.1425%205.8125%204.695%205.8125H13.305C14.8575%205.8125%2016.125%207.08001%2016.125%208.63251V9.71251H14.61C14.19%209.71251%2013.8075%209.87749%2013.53%2010.1625Z'%20stroke='white'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M1.875%209.30748V5.88002C1.875%204.98752%202.4225%204.19248%203.255%203.87748L9.21%201.62748C10.14%201.27498%2011.1375%201.96501%2011.1375%202.96251V5.8125'%20stroke='white'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M16.9191%2010.4776V12.0227C16.9191%2012.4352%2016.5891%2012.7726%2016.1691%2012.7876H14.6991C13.8891%2012.7876%2013.1466%2012.1951%2013.0791%2011.3851C13.0341%2010.9126%2013.2141%2010.4701%2013.5291%2010.1626C13.8066%209.87763%2014.1891%209.71265%2014.6091%209.71265H16.1691C16.5891%209.72765%2016.9191%2010.0651%2016.9191%2010.4776Z'%20stroke='white'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5.25%209H10.5'%20stroke='white'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",ax="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%206.97075C14%2011.5992%2011.1675%2013.0844%209.67513%2011.762C8.44671%2010.6837%208.08122%208.40507%206.2335%208.17111C3.88832%207.87611%203.68528%2010.999%202.14214%2010.999C0.345178%2010.999%200%208.38472%200%207.04196C0%205.66867%200.385787%203.79694%201.91878%203.79694C3.70559%203.79694%203.80711%206.4723%206.04061%206.32988C8.26396%206.1773%208.30457%203.39004%209.74624%202.19986C11.0051%201.17244%2014%202.28124%2014%206.97075Z'%20fill='%2397FCE4'/%3e%3c/svg%3e",tke="data:image/svg+xml,%3csvg%20width='14'%20height='9'%20viewBox='0%200%2014%209'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.33013%201.5C5.48483%20-0.500002%208.37158%20-0.5%209.52628%201.5L13.8564%209H0L4.33013%201.5Z'%20fill='%23404040'/%3e%3c/svg%3e",zbt="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='4'%20y='4'%20width='6'%20height='6'%20rx='3'%20fill='%23D35B5B'/%3e%3c/svg%3e",Hbt="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='4'%20y='4'%20width='6'%20height='6'%20rx='3'%20fill='%230BAA60'/%3e%3c/svg%3e",ec="/assets/noDataNewIcon-D33nv6-9.svg",SA="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.2967%202.63297L11.6167%205.27297C11.7967%205.64047%2012.2767%205.99297%2012.6817%206.06047L15.0742%206.45797C16.6042%206.71297%2016.9642%207.82297%2015.8617%208.91797L14.0017%2010.778C13.6867%2011.093%2013.5142%2011.7005%2013.6117%2012.1355L14.1442%2014.438C14.5642%2016.2605%2013.5967%2016.9655%2011.9842%2016.013L9.7417%2014.6855C9.3367%2014.4455%208.6692%2014.4455%208.2567%2014.6855L6.0142%2016.013C4.4092%2016.9655%203.4342%2016.253%203.8542%2014.438L4.3867%2012.1355C4.4842%2011.7005%204.3117%2011.093%203.9967%2010.778L2.1367%208.91797C1.0417%207.82297%201.3942%206.71297%202.9242%206.45797L5.3167%206.06047C5.7142%205.99297%206.1942%205.64047%206.3742%205.27297L7.6942%202.63297C8.4142%201.20047%209.5842%201.20047%2010.2967%202.63297Z'%20stroke='%239B9B9B'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",r5="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.2967%202.63297L11.6167%205.27297C11.7967%205.64047%2012.2767%205.99297%2012.6817%206.06047L15.0742%206.45797C16.6042%206.71297%2016.9642%207.82297%2015.8617%208.91797L14.0017%2010.778C13.6867%2011.093%2013.5142%2011.7005%2013.6117%2012.1355L14.1442%2014.438C14.5642%2016.2605%2013.5967%2016.9655%2011.9842%2016.013L9.7417%2014.6855C9.3367%2014.4455%208.6692%2014.4455%208.2567%2014.6855L6.0142%2016.013C4.4092%2016.9655%203.4342%2016.253%203.8542%2014.438L4.3867%2012.1355C4.4842%2011.7005%204.3117%2011.093%203.9967%2010.778L2.1367%208.91797C1.0417%207.82297%201.3942%206.71297%202.9242%206.45797L5.3167%206.06047C5.7142%205.99297%206.1942%205.64047%206.3742%205.27297L7.6942%202.63297C8.4142%201.20047%209.5842%201.20047%2010.2967%202.63297Z'%20fill='%23FFC01F'/%3e%3c/svg%3e",Vbt="/assets/referralBgIcon-C-Csekzm.svg",s5="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1635_11489)'%3e%3cpath%20d='M7.58763%209.47632C8.45415%209.97644%208.8874%2010.2265%209.36324%2010.2269C9.83905%2010.2273%2010.2727%209.97802%2011.1401%209.47942L16.6693%206.30109C16.9189%206.15761%2017.0728%205.89166%2017.0728%205.60374C17.0728%205.31582%2016.9189%205.04987%2016.6693%204.90639L11.1381%201.7269C10.2717%201.22883%209.83844%200.979795%209.3631%200.979981C8.88773%200.980166%208.45471%201.22954%207.58863%201.72828L2.83367%204.4665C2.79841%204.4868%202.7808%204.49696%202.76438%204.50657C1.14012%205.45741%200.136601%207.19333%200.123183%209.07539C0.123047%209.09441%200.123047%209.11474%200.123047%209.15542C0.123047%209.19601%200.123047%209.21634%200.123182%209.23534C0.136571%2011.1153%201.13785%2012.8496%202.75921%2013.8012C2.7756%2013.8108%202.79321%2013.8209%202.82838%2013.8413L5.80688%2015.561C7.54244%2016.563%208.41021%2017.064%209.36318%2017.0644C10.3161%2017.0647%2011.1843%2016.5642%2012.9205%2015.5633L16.0647%2013.7508C16.9341%2013.2496%2017.3688%2012.9991%2017.6074%2012.5859C17.8461%2012.1728%2017.8461%2011.6711%2017.8461%2010.6676V8.72907C17.8461%208.4507%2017.6954%208.19416%2017.4521%208.05869C17.2168%207.92762%2016.9299%207.92956%2016.6964%208.06381L10.2491%2011.7699C9.81659%2012.0185%209.60028%2012.1429%209.36296%2012.1429C9.12561%2012.143%208.90925%2012.0188%208.47653%2011.7704L4.11289%209.2656C3.89431%209.14013%203.78501%209.07738%203.69722%209.06605C3.49709%209.04022%203.30466%209.15234%203.22842%209.33918C3.195%209.42113%203.19566%209.54715%203.19702%209.79918C3.19802%209.98472%203.19851%2010.0775%203.21585%2010.1628C3.2547%2010.3539%203.35522%2010.527%203.50202%2010.6553C3.56757%2010.7127%203.6479%2010.7591%203.80863%2010.8518L8.47406%2013.5445C8.90792%2013.7949%209.12483%2013.9201%209.36302%2013.9202C9.60122%2013.9202%209.81822%2013.7952%2010.2522%2013.545L15.9706%2010.2487C16.1189%2010.1632%2016.193%2010.1205%2016.2486%2010.1526C16.3041%2010.1847%2016.3041%2010.2703%2016.3041%2010.4414V11.3206C16.3041%2011.5715%2016.3041%2011.6969%2016.2445%2011.8002C16.1848%2011.9035%2016.0761%2011.9661%2015.8588%2012.0914L11.1422%2014.8103C10.2738%2015.3108%209.83968%2015.5611%209.36313%2015.5608C8.88654%2015.5606%208.4526%2015.31%207.58475%2014.8086L3.17196%2012.2596C3.15794%2012.2514%203.15094%2012.2474%203.1444%2012.2436C2.21916%2011.7029%201.64824%2010.7138%201.64288%209.64217C1.64285%209.63461%201.64285%209.62652%201.64285%209.61032V8.8032C1.64285%208.21161%201.95792%207.6648%202.46974%207.36813C2.92201%207.10599%203.47987%207.10547%203.93261%207.36677L7.58763%209.47632Z'%20fill='%23F2F7F7'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1635_11489'%3e%3crect%20width='18'%20height='18'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",cm="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.75%208.24998L15.9%202.09998'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M16.5%205.1V1.5H12.9'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.25%201.5H6.75C3%201.5%201.5%203%201.5%206.75V11.25C1.5%2015%203%2016.5%206.75%2016.5H11.25C15%2016.5%2016.5%2015%2016.5%2011.25V9.75'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",fM="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.6668%208.60016V11.4002C10.6668%2013.7335%209.7335%2014.6668%207.40016%2014.6668H4.60016C2.26683%2014.6668%201.3335%2013.7335%201.3335%2011.4002V8.60016C1.3335%206.26683%202.26683%205.3335%204.60016%205.3335H7.40016C9.7335%205.3335%2010.6668%206.26683%2010.6668%208.60016Z'%20stroke='white'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M14.6668%204.60016V7.40016C14.6668%209.7335%2013.7335%2010.6668%2011.4002%2010.6668H10.6668V8.60016C10.6668%206.26683%209.7335%205.3335%207.40016%205.3335H5.3335V4.60016C5.3335%202.26683%206.26683%201.3335%208.60016%201.3335H11.4002C13.7335%201.3335%2014.6668%202.26683%2014.6668%204.60016Z'%20stroke='white'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Wbt="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M35.0601%2015.54C34.9201%2015.52%2034.7801%2015.52%2034.6401%2015.54C31.5401%2015.44%2029.0801%2012.9%2029.0801%209.78C29.0801%206.6%2031.6601%204%2034.8601%204C38.0401%204%2040.6401%206.58%2040.6401%209.78C40.6201%2012.9%2038.1601%2015.44%2035.0601%2015.54Z'%20fill='white'/%3e%3cpath%20d='M41.58%2029.3998C39.34%2030.8998%2036.1999%2031.4598%2033.2999%2031.0798C34.0599%2029.4398%2034.4599%2027.6198%2034.4799%2025.6998C34.4799%2023.6998%2034.04%2021.7998%2033.2%2020.1398C36.16%2019.7398%2039.3%2020.2998%2041.56%2021.7998C44.72%2023.8798%2044.72%2027.2998%2041.58%2029.3998Z'%20fill='white'/%3e%3cpath%20d='M12.8801%2015.54C13.0201%2015.52%2013.1601%2015.52%2013.3001%2015.54C16.4001%2015.44%2018.8601%2012.9%2018.8601%209.78C18.8601%206.58%2016.2801%204%2013.0801%204C9.90007%204%207.32007%206.58%207.32007%209.78C7.32007%2012.9%209.78007%2015.44%2012.8801%2015.54Z'%20fill='white'/%3e%3cpath%20d='M13.1%2025.7002C13.1%2027.6402%2013.52%2029.4802%2014.28%2031.1402C11.46%2031.4402%208.51999%2030.8402%206.35999%2029.4202C3.19999%2027.3202%203.19999%2023.9002%206.35999%2021.8002C8.49999%2020.3602%2011.52%2019.7802%2014.36%2020.1002C13.54%2021.7802%2013.1%2023.6802%2013.1%2025.7002Z'%20fill='white'/%3e%3cpath%20d='M24.2401%2031.74C24.0801%2031.72%2023.9001%2031.72%2023.7201%2031.74C20.0401%2031.62%2017.1001%2028.6%2017.1001%2024.88C17.1201%2021.08%2020.1801%2018%2024.0001%2018C27.8001%2018%2030.8801%2021.08%2030.8801%2024.88C30.8601%2028.6%2027.9401%2031.62%2024.2401%2031.74Z'%20fill='white'/%3e%3cpath%20d='M17.7401%2035.8798C14.7201%2037.8998%2014.7201%2041.2198%2017.7401%2043.2198C21.1801%2045.5198%2026.8201%2045.5198%2030.2601%2043.2198C33.2801%2041.1998%2033.2801%2037.8798%2030.2601%2035.8798C26.8401%2033.5798%2021.2001%2033.5798%2017.7401%2035.8798Z'%20fill='white'/%3e%3c/svg%3e",qbt="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M24%204C12.98%204%204%2012.98%204%2024C4%2035.02%2012.98%2044%2024%2044C35.02%2044%2044%2035.02%2044%2024C44%2012.98%2035.02%204%2024%204ZM33.56%2019.4L22.22%2030.74C21.94%2031.02%2021.56%2031.18%2021.16%2031.18C20.76%2031.18%2020.38%2031.02%2020.1%2030.74L14.44%2025.08C13.86%2024.5%2013.86%2023.54%2014.44%2022.96C15.02%2022.38%2015.98%2022.38%2016.56%2022.96L21.16%2027.56L31.44%2017.28C32.02%2016.7%2032.98%2016.7%2033.56%2017.28C34.14%2017.86%2034.14%2018.8%2033.56%2019.4Z'%20fill='%231DE6A3'/%3e%3c/svg%3e",Gbt="data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M48.107%2039.1333C46.987%2040.2266%2046.347%2041.8%2046.507%2043.48C46.747%2046.36%2049.387%2048.4666%2052.267%2048.4666H57.3337V51.64C57.3337%2057.16%2052.827%2061.6667%2047.307%2061.6667H16.6937C11.1737%2061.6667%206.66699%2057.16%206.66699%2051.64V33.6933C6.66699%2028.1733%2011.1737%2023.6667%2016.6937%2023.6667H47.307C52.827%2023.6667%2057.3337%2028.1733%2057.3337%2033.6933V37.5334H51.947C50.4537%2037.5334%2049.0937%2038.12%2048.107%2039.1333Z'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M6.66699%2036.0933V23.9068C6.66699%2020.7334%208.61366%2017.9067%2011.5737%2016.7867L32.747%208.78666C36.0537%207.53333%2039.6003%209.98674%2039.6003%2013.5334V23.6667'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M60.1572%2040.2537V45.7472C60.1572%2047.2139%2058.9838%2048.4138%2057.4905%2048.4671H52.2638C49.3838%2048.4671%2046.7438%2046.3605%2046.5038%2043.4805C46.3438%2041.8005%2046.9838%2040.2271%2048.1038%2039.1338C49.0905%2038.1205%2050.4505%2037.5339%2051.9438%2037.5339H57.4905C58.9838%2037.5872%2060.1572%2038.7871%2060.1572%2040.2537Z'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M18.667%2035H37.3337'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Kbt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%2021C5.50558%2021%202.95666%2020.5387%202.54353%2018.2033C2.13039%2015.8679%204.77383%2011.4774%205.58842%2010.0285C8.31257%205.18408%2010.1637%203%2012%203C13.8363%203%2015.6874%205.18408%2018.4116%2010.0285C19.2262%2011.4774%2021.8696%2015.8679%2021.4565%2018.2033C21.0444%2020.5387%2018.4944%2021%2012%2021Z'%20stroke='%23FF9900'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12%208.5V12.395'%20stroke='%23FF9900'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.9955%2015.8945H12.0045'%20stroke='%23FF9900'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",hM="data:image/svg+xml,%3csvg%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.75764%205.18999L14.1826%207.15499C15.4576%207.71749%2015.4576%208.64749%2014.1826%209.20999L9.75764%2011.175C9.25514%2011.4%208.43014%2011.4%207.92764%2011.175L3.50264%209.20999C2.22764%208.64749%202.22764%207.71749%203.50264%207.15499L7.92764%205.18999C8.43014%204.96499%209.25514%204.96499%209.75764%205.18999Z'%20stroke='%2367FFBD'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.25%2011.25C2.25%2011.88%202.7225%2012.6075%203.3%2012.8625L8.3925%2015.1275C8.7825%2015.3%209.225%2015.3%209.6075%2015.1275L14.7%2012.8625C15.2775%2012.6075%2015.75%2011.88%2015.75%2011.25'%20stroke='%2367FFBD'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.25%2015C2.25%2015.6975%202.6625%2016.3275%203.3%2016.6125L8.3925%2018.8775C8.7825%2019.05%209.225%2019.05%209.6075%2018.8775L14.7%2016.6125C15.3375%2016.3275%2015.75%2015.6975%2015.75%2015'%20stroke='%2367FFBD'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3ccircle%20cx='16'%20cy='5'%20r='4.5'%20fill='%2367FFBD'%20stroke='%23273F35'/%3e%3c/svg%3e",pM="data:image/svg+xml,%3csvg%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.75764%205.18999L14.1826%207.15499C15.4576%207.71749%2015.4576%208.64749%2014.1826%209.20999L9.75764%2011.175C9.25514%2011.4%208.43014%2011.4%207.92764%2011.175L3.50264%209.20999C2.22764%208.64749%202.22764%207.71749%203.50264%207.15499L7.92764%205.18999C8.43014%204.96499%209.25514%204.96499%209.75764%205.18999Z'%20stroke='%23FF797C'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.25%2011.25C2.25%2011.88%202.7225%2012.6075%203.3%2012.8625L8.3925%2015.1275C8.7825%2015.3%209.225%2015.3%209.6075%2015.1275L14.7%2012.8625C15.2775%2012.6075%2015.75%2011.88%2015.75%2011.25'%20stroke='%23FF797C'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.25%2015C2.25%2015.6975%202.6625%2016.3275%203.3%2016.6125L8.3925%2018.8775C8.7825%2019.05%209.225%2019.05%209.6075%2018.8775L14.7%2016.6125C15.3375%2016.3275%2015.75%2015.6975%2015.75%2015'%20stroke='%23FF797C'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3ccircle%20cx='16'%20cy='5'%20r='4.5'%20fill='%23FF797C'%20stroke='%233F2A2B'/%3e%3c/svg%3e",NA="/assets/sharePnlGreenIcon-CwGFUwvO.svg",AA="/assets/sharePnlRedIcon-NsgQBTQF.svg",jA="/assets/dextrabotShareIcon-DbUzC8hq.png",Ybt="/assets/buttonHyperrIcon-BEIlirim.png",zme="/assets/mushroomRed-DlifwotO.svg",Hme="/assets/mushroomBlue-DU8qWKKQ.svg",Wc="data:image/svg+xml,%3csvg%20width='11'%20height='8'%20viewBox='0%200%2011%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1%203.83L3.83%206.66L9.5%201'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Xbt="data:image/svg+xml,%3csvg%20width='28'%20height='32'%20viewBox='0%200%2028%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_d_92_32471)'%3e%3cpath%20d='M18.4324%2015.0402H16.1149V9.64023C16.1149%208.38023%2015.4324%208.12523%2014.5999%209.07023L13.9999%209.75273L8.92239%2015.5277C8.22489%2016.3152%208.51739%2016.9602%209.56739%2016.9602H11.8849V22.3602C11.8849%2023.6202%2012.5674%2023.8752%2013.3999%2022.9302L13.9999%2022.2477L19.0774%2016.4727C19.7749%2015.6852%2019.4824%2015.0402%2018.4324%2015.0402Z'%20fill='%2367FFBD'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_92_32471'%20x='-3'%20y='-0.999756'%20width='34'%20height='34'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='4'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.403922%200%200%200%200%201%200%200%200%200%200.741176%200%200%200%200.48%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_92_32471'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_92_32471'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",Qbt="data:image/svg+xml,%3csvg%20width='35'%20height='30'%20viewBox='0%200%2035%2030'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_d_92_32478)'%3e%3cpath%20d='M20.4658%209.05899L21.6995%2011.5265C21.8658%2011.8677%2022.312%2012.1915%2022.6883%2012.2615L24.9195%2012.629C26.3458%2012.8652%2026.6783%2013.8977%2025.6545%2014.9302L23.9133%2016.6715C23.6245%2016.9602%2023.4583%2017.529%2023.5545%2017.9402L24.0533%2020.0927C24.447%2021.7902%2023.537%2022.4552%2022.0408%2021.5627L19.9495%2020.3202C19.5733%2020.0927%2018.9433%2020.0927%2018.567%2020.3202L16.4758%2021.5627C14.9795%2022.4465%2014.0695%2021.7902%2014.4633%2020.0927L14.962%2017.9402C15.0408%2017.5202%2014.8745%2016.9515%2014.5858%2016.6627L12.8445%2014.9215C11.8208%2013.8977%2012.1533%2012.8652%2013.5795%2012.6202L15.8108%2012.2527C16.187%2012.1915%2016.6333%2011.859%2016.7995%2011.5177L18.0333%209.05024C18.707%207.72024%2019.792%207.72024%2020.4658%209.05899Z'%20fill='%23D65AFF'/%3e%3cpath%20d='M14%209.53149H8.75C8.39125%209.53149%208.09375%209.23399%208.09375%208.87524C8.09375%208.51649%208.39125%208.21899%208.75%208.21899H14C14.3587%208.21899%2014.6562%208.51649%2014.6562%208.87524C14.6562%209.23399%2014.3587%209.53149%2014%209.53149Z'%20fill='%23D65AFF'/%3e%3cpath%20d='M11.375%2021.7815H8.75C8.39125%2021.7815%208.09375%2021.484%208.09375%2021.1252C8.09375%2020.7665%208.39125%2020.469%208.75%2020.469H11.375C11.7338%2020.469%2012.0312%2020.7665%2012.0312%2021.1252C12.0312%2021.484%2011.7338%2021.7815%2011.375%2021.7815Z'%20fill='%23D65AFF'/%3e%3cpath%20d='M9.625%2015.6565H8.75C8.39125%2015.6565%208.09375%2015.359%208.09375%2015.0002C8.09375%2014.6415%208.39125%2014.344%208.75%2014.344H9.625C9.98375%2014.344%2010.2812%2014.6415%2010.2812%2015.0002C10.2812%2015.359%209.98375%2015.6565%209.625%2015.6565Z'%20fill='%23D65AFF'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_92_32478'%20x='-1'%20y='-3.49976'%20width='37'%20height='37'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='4'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.839216%200%200%200%200%200.352941%200%200%200%200%201%200%200%200%200.48%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_92_32478'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_92_32478'%20result='shape'/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e",vc="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9%206.75V10.5'%20stroke='%23FF797C'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.99958%2016.0575H4.45458C1.85208%2016.0575%200.764583%2014.1975%202.02458%2011.925L4.36458%207.70996L6.56958%203.74996C7.90458%201.34246%2010.0946%201.34246%2011.4296%203.74996L13.6346%207.71746L15.9746%2011.9325C17.2346%2014.205%2016.1396%2016.065%2013.5446%2016.065H8.99958V16.0575Z'%20stroke='%23FF797C'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.99609%2012.75H9.00283'%20stroke='%23FF797C'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",eae="data:image/svg+xml,%3csvg%20width='86'%20height='86'%20viewBox='0%200%2086%2086'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='43'%20cy='43'%20r='43'%20fill='%231DE6A3'%20fill-opacity='0.16'/%3e%3cpath%20d='M42.9987%2016.3335C28.3054%2016.3335%2016.332%2028.3068%2016.332%2043.0002C16.332%2057.6935%2028.3054%2069.6668%2042.9987%2069.6668C57.692%2069.6668%2069.6654%2057.6935%2069.6654%2043.0002C69.6654%2028.3068%2057.692%2016.3335%2042.9987%2016.3335ZM55.7454%2036.8668L40.6254%2051.9868C40.252%2052.3602%2039.7454%2052.5735%2039.212%2052.5735C38.6787%2052.5735%2038.172%2052.3602%2037.7987%2051.9868L30.252%2044.4402C29.4787%2043.6668%2029.4787%2042.3868%2030.252%2041.6135C31.0254%2040.8402%2032.3054%2040.8402%2033.0787%2041.6135L39.212%2047.7468L52.9187%2034.0402C53.692%2033.2668%2054.972%2033.2668%2055.7454%2034.0402C56.5187%2034.8135%2056.5187%2036.0668%2055.7454%2036.8668Z'%20fill='%231DE6A3'/%3e%3c/svg%3e",Zbt="/assets/copyTradeBanner-Bzh6f0rX.svg",Jbt="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9%2016.5C13.1421%2016.5%2016.5%2013.1421%2016.5%209C16.5%204.85786%2013.1421%201.5%209%201.5C4.85786%201.5%201.5%204.85786%201.5%209C1.5%2013.1421%204.85786%2016.5%209%2016.5Z'%20stroke='%23FFD979'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M6.375%209H10.875'%20stroke='%23FFD979'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.375%2011.25L11.625%209L9.375%206.75'%20stroke='%23FFD979'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Vme="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2782_17351)'%3e%3cpath%20d='M5.05842%206.31754C5.6361%206.65096%205.92493%206.81767%206.24216%206.81794C6.55936%206.81822%206.84849%206.65201%207.42676%206.31961L11.1129%204.20073C11.2793%204.10508%2011.3819%203.92777%2011.3819%203.73583C11.3819%203.54388%2011.2793%203.36658%2011.1129%203.27093L7.42543%201.15127C6.84779%200.81922%206.55896%200.653197%206.24207%200.65332C5.92515%200.653444%205.63647%200.819692%205.05909%201.15219L1.88911%202.97767C1.86561%202.9912%201.85387%202.99797%201.84292%203.00438C0.76008%203.63828%200.0910671%204.79556%200.0821217%206.05026C0.0820312%206.06294%200.0820313%206.07649%200.0820313%206.10361C0.0820313%206.13068%200.0820312%206.14423%200.0821215%206.15689C0.0910473%207.41019%200.758568%208.56638%201.83948%209.20078C1.8504%209.20718%201.86214%209.21396%201.88559%209.22751L3.87125%2010.374C5.02829%2011.042%205.6068%2011.376%206.24212%2011.3762C6.87742%2011.3764%207.45617%2011.0428%208.61365%2010.3756L10.7098%209.16719C11.2894%208.83308%2011.5792%208.66604%2011.7383%208.39063C11.8974%208.11522%2011.8974%207.78073%2011.8974%207.11174V5.81938C11.8974%205.6338%2011.7969%205.46278%2011.6348%205.37246C11.4779%205.28508%2011.2866%205.28638%2011.1309%205.37588L6.83276%207.84658C6.54439%208.01235%206.40019%208.09524%206.24197%208.0953C6.08374%208.09533%205.9395%208.01253%205.65102%207.84695L2.74192%206.17707C2.59621%206.09342%202.52334%206.05159%202.46482%206.04404C2.33139%206.02681%202.20311%206.10156%202.15228%206.22612C2.13%206.28075%202.13044%206.36477%202.13135%206.53279C2.13201%206.65648%202.13234%206.71833%202.1439%206.77522C2.1698%206.90263%202.23682%207.01797%202.33468%207.10356C2.37838%207.14178%202.43194%207.1727%202.53909%207.23453L5.64938%209.02967C5.93861%209.1966%206.08322%209.28007%206.24201%209.28012C6.40082%209.28016%206.54548%209.19677%206.83479%209.03001L10.6471%206.83244C10.7459%206.77546%2010.7953%206.74698%2010.8324%206.76839C10.8694%206.78981%2010.8694%206.84684%2010.8694%206.96091V7.54708C10.8694%207.71434%2010.8694%207.79796%2010.8296%207.86682C10.7899%207.93566%2010.7174%207.97742%2010.5725%208.06096L7.42811%209.87351C6.84923%2010.2072%206.55979%2010.374%206.24208%2010.3739C5.92436%2010.3737%205.63507%2010.2067%205.0565%209.87242L2.11464%208.17304C2.1053%208.16763%202.10063%208.16494%202.09627%208.16239C1.47944%207.80194%201.09883%207.14254%201.09526%206.42811C1.09523%206.42307%201.09523%206.41768%201.09523%206.40688V5.8688C1.09523%205.47441%201.30528%205.10986%201.6465%204.91209C1.948%204.73733%202.31991%204.73698%202.62174%204.91118L5.05842%206.31754Z'%20fill='%23F2F7F7'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2782_17351'%3e%3crect%20width='12'%20height='12'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",tae="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.939%207.14668H9.87903V2.34668C9.87903%201.22668%209.27236%201.00001%208.53236%201.84001L7.99903%202.44668L3.4857%207.58001C2.8657%208.28001%203.1257%208.85335%204.05903%208.85335H6.11903V13.6533C6.11903%2014.7733%206.7257%2015%207.4657%2014.16L7.99903%2013.5533L12.5124%208.42001C13.1324%207.72001%2012.8724%207.14668%2011.939%207.14668Z'%20fill='%2367FFBD'/%3e%3c/svg%3e",eyt="/assets/introductionModalIcon-C3qCLVbZ.svg",tyt="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20opacity='0.4'%20cx='24'%20cy='24'%20r='20'%20fill='%23868686'/%3e%3cpath%20d='M34%2020C34%2021.1046%2033.1046%2022%2032%2022C30.8954%2022%2030%2021.1046%2030%2020C30%2018.8954%2030.8954%2018%2032%2018C33.1046%2018%2034%2018.8954%2034%2020Z'%20fill='%23868686'/%3e%3cpath%20d='M18%2020C18%2021.1046%2017.1046%2022%2016%2022C14.8954%2022%2014%2021.1046%2014%2020C14%2018.8954%2014.8954%2018%2016%2018C17.1046%2018%2018%2018.8954%2018%2020Z'%20fill='%23868686'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M18.9891%2028.8723C18.3698%2028.329%2017.4271%2028.3868%2016.8789%2029.0035C16.3285%2029.6226%2016.3843%2030.5708%2017.0035%2031.1211L18%2030C17.0035%2031.1211%2017.003%2031.1207%2017.0035%2031.1211L17.0054%2031.1228L17.0075%2031.1247L17.0124%2031.1291L17.0249%2031.1399L17.06%2031.1698C17.088%2031.1934%2017.125%2031.224%2017.171%2031.2605C17.263%2031.3335%2017.391%2031.4308%2017.5536%2031.5439C17.8782%2031.7697%2018.3441%2032.0611%2018.9394%2032.3497C20.13%2032.927%2021.8535%2033.5%2024%2033.5C26.1465%2033.5%2027.87%2032.927%2029.0607%2032.3497C29.656%2032.0611%2030.1218%2031.7697%2030.4465%2031.5439C30.609%2031.4308%2030.737%2031.3335%2030.829%2031.2605C30.875%2031.224%2030.9121%2031.1934%2030.94%2031.1698L30.9752%2031.1399L30.9876%2031.1291L30.9925%2031.1247L30.9946%2031.1228C30.9951%2031.1224%2030.9966%2031.1211%2030%2030L30.9966%2031.1211C31.6157%2030.5708%2031.6715%2029.6226%2031.1211%2029.0035C30.573%2028.3868%2029.6302%2028.329%2029.0109%2028.8723L29.0092%2028.8739C29.0023%2028.8796%2028.9859%2028.8933%2028.963%2028.9114C28.9173%2028.9477%2028.8402%2029.0068%2028.7333%2029.0812C28.5189%2029.2303%2028.1878%2029.4389%2027.7519%2029.6503C26.88%2030.073%2025.6035%2030.5%2024%2030.5C22.3965%2030.5%2021.12%2030.073%2020.2482%2029.6503C19.8122%2029.4389%2019.4812%2029.2303%2019.2668%2029.0812C19.1598%2029.0068%2019.0827%2028.9477%2019.037%2028.9114C19.0142%2028.8933%2018.9992%2028.8809%2018.9924%2028.8751C18.9909%2028.8739%2018.9898%2028.8729%2018.9891%2028.8723C18.9891%2028.8723%2018.9891%2028.8723%2018.9891%2028.8723ZM29.0109%2028.8723L29.0092%2028.8739L29.0067%2028.876L29.0052%2028.8774C29.0074%2028.8754%2029.0087%2028.8743%2029.0109%2028.8723Z'%20fill='%23868686'/%3e%3c/svg%3e",nyt="data:image/svg+xml,%3csvg%20width='10'%20height='10'%20viewBox='0%200%2010%2010'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.41602%204.58334L8.83268%201.16667'%20stroke='%2367FFBD'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.16602%202.83333V0.833328H7.16602'%20stroke='%2367FFBD'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M4.58398%200.833328H3.75065C1.66732%200.833328%200.833984%201.66666%200.833984%203.74999V6.24999C0.833984%208.33333%201.66732%209.16666%203.75065%209.16666H6.25065C8.33398%209.16666%209.16732%208.33333%209.16732%206.24999V5.41666'%20stroke='%2367FFBD'%20stroke-width='1.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",ryt="/assets/dextrabot-copy-trade-hyperliquid-BgdeQSj5.png",syt="/assets/dextrabot-position-copy-Ph5ntD17.png",iyt="/assets/dextrabot-referral-rewards-CvRzGBKC.png",ayt="/assets/hyperliquid-discover-wallets-CgeXGTl5.svg",oyt="/assets/dextrabot-telegram-alerts-CJHcZn29.png",lyt="/assets/hyperliquid-wallet-analysis-DwEnicpm.png",cyt="/assets/dextrabot-discover-wallets-filters-BSnYa19g.svg",uyt="/assets/hyperliquid-trading-metrics-Cwsy4rqz.svg",dyt="/assets/dextrabot-risk-parameters-DzTb7mB0.svg",fyt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.4297%205.92999L20.4997%2012L14.4297%2018.07'%20stroke='%2367FFBD'%20stroke-width='1.5'%20stroke-miterlimit='10'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M3.5%2012H20.33'%20stroke='%2367FFBD'%20stroke-width='1.5'%20stroke-miterlimit='10'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",TH="data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='32'%20cy='32'%20r='32'%20fill='%233D3D3D'/%3e%3c/svg%3e",hyt="/assets/dextrabotNewLogoIcon-V6eDxoac.png",nae="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.1425%201.5H5.8575C3.1275%201.5%201.5%203.1275%201.5%205.8575V12.135C1.5%2014.8725%203.1275%2016.5%205.8575%2016.5H12.135C14.865%2016.5%2016.4925%2014.8725%2016.4925%2012.1425V5.8575C16.5%203.1275%2014.8725%201.5%2012.1425%201.5ZM12.9375%209.2475C12.9375%209.555%2012.6825%209.81%2012.375%209.81C12.0675%209.81%2011.8125%209.555%2011.8125%209.2475V6.9825L6.0225%2012.7725C5.91%2012.885%205.7675%2012.9375%205.625%2012.9375C5.4825%2012.9375%205.34%2012.885%205.2275%2012.7725C5.01%2012.555%205.01%2012.195%205.2275%2011.9775L11.0175%206.1875H8.7525C8.445%206.1875%208.19%205.9325%208.19%205.625C8.19%205.3175%208.445%205.0625%208.7525%205.0625H12.375C12.6825%205.0625%2012.9375%205.3175%2012.9375%205.625V9.2475Z'%20fill='white'%20fill-opacity='0.32'/%3e%3c/svg%3e",pyt="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15%205.0625C16.1391%205.0625%2017.0625%204.13909%2017.0625%203C17.0625%201.86091%2016.1391%200.9375%2015%200.9375C13.8609%200.9375%2012.9375%201.86091%2012.9375%203C12.9375%204.13909%2013.8609%205.0625%2015%205.0625Z'%20fill='white'/%3e%3cpath%20d='M14.28%206.1125C13.1025%205.8575%2012.1425%204.8975%2011.8875%203.72C11.79%203.2625%2011.7825%202.82%2011.865%202.4C11.9625%201.935%2011.6175%201.5%2011.1375%201.5H5.25C3.18%201.5%201.5%203.18%201.5%205.25V10.4625C1.5%2012.5325%203.18%2014.2125%205.25%2014.2125H6.375C6.585%2014.2125%206.855%2014.3475%206.975%2014.5125L8.1%2016.005C8.595%2016.665%209.405%2016.665%209.9%2016.005L11.025%2014.5125C11.1675%2014.325%2011.385%2014.2125%2011.625%2014.2125H12.7575C14.8275%2014.2125%2016.5%2012.54%2016.5%2010.47V6.8625C16.5%206.39%2016.065%206.045%2015.6%206.135C15.18%206.21%2014.7375%206.21%2014.28%206.1125ZM6%209C5.58%209%205.25%208.6625%205.25%208.25C5.25%207.8375%205.58%207.5%206%207.5C6.4125%207.5%206.75%207.8375%206.75%208.25C6.75%208.6625%206.42%209%206%209ZM9%209C8.58%209%208.25%208.6625%208.25%208.25C8.25%207.8375%208.58%207.5%209%207.5C9.4125%207.5%209.75%207.8375%209.75%208.25C9.75%208.6625%209.42%209%209%209ZM12%209C11.58%209%2011.25%208.6625%2011.25%208.25C11.25%207.8375%2011.58%207.5%2012%207.5C12.4125%207.5%2012.75%207.8375%2012.75%208.25C12.75%208.6625%2012.42%209%2012%209Z'%20fill='white'/%3e%3c/svg%3e",myt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.0199%2020.5299C9.68987%2020.5299%207.35987%2020.1599%205.14987%2019.4199C4.30987%2019.1299%203.66987%2018.5399%203.38987%2017.7699C3.09987%2016.9999%203.19987%2016.1499%203.65987%2015.3899L4.80987%2013.4799C5.04987%2013.0799%205.26987%2012.2799%205.26987%2011.8099V8.91992C5.26987%205.19992%208.29987%202.16992%2012.0199%202.16992C15.7399%202.16992%2018.7699%205.19992%2018.7699%208.91992V11.8099C18.7699%2012.2699%2018.9899%2013.0799%2019.2299%2013.4899L20.3699%2015.3899C20.7999%2016.1099%2020.8799%2016.9799%2020.5899%2017.7699C20.2999%2018.5599%2019.6699%2019.1599%2018.8799%2019.4199C16.6799%2020.1599%2014.3499%2020.5299%2012.0199%2020.5299ZM12.0199%203.66992C9.12987%203.66992%206.76987%206.01992%206.76987%208.91992V11.8099C6.76987%2012.5399%206.46987%2013.6199%206.09987%2014.2499L4.94987%2016.1599C4.72987%2016.5299%204.66987%2016.9199%204.79987%2017.2499C4.91987%2017.5899%205.21987%2017.8499%205.62987%2017.9899C9.80987%2019.3899%2014.2399%2019.3899%2018.4199%2017.9899C18.7799%2017.8699%2019.0599%2017.5999%2019.1899%2017.2399C19.3199%2016.8799%2019.2899%2016.4899%2019.0899%2016.1599L17.9399%2014.2499C17.5599%2013.5999%2017.2699%2012.5299%2017.2699%2011.7999V8.91992C17.2699%206.01992%2014.9199%203.66992%2012.0199%203.66992Z'%20fill='white'/%3e%3cpath%20d='M13.8806%203.94018C13.8106%203.94018%2013.7406%203.93018%2013.6706%203.91018C13.3806%203.83018%2013.1006%203.77018%2012.8306%203.73018C11.9806%203.62018%2011.1606%203.68018%2010.3906%203.91018C10.1106%204.00018%209.8106%203.91018%209.6206%203.70018C9.4306%203.49018%209.3706%203.19018%209.4806%202.92018C9.8906%201.87018%2010.8906%201.18018%2012.0306%201.18018C13.1706%201.18018%2014.1706%201.86018%2014.5806%202.92018C14.6806%203.19018%2014.6306%203.49018%2014.4406%203.70018C14.2906%203.86018%2014.0806%203.94018%2013.8806%203.94018Z'%20fill='white'/%3e%3cpath%20d='M12.0195%2022.8101C11.0295%2022.8101%2010.0695%2022.4101%209.36953%2021.7101C8.66953%2021.0101%208.26953%2020.0501%208.26953%2019.0601H9.76953C9.76953%2019.6501%2010.0095%2020.2301%2010.4295%2020.6501C10.8495%2021.0701%2011.4295%2021.3101%2012.0195%2021.3101C13.2595%2021.3101%2014.2695%2020.3001%2014.2695%2019.0601H15.7695C15.7695%2021.1301%2014.0895%2022.8101%2012.0195%2022.8101Z'%20fill='white'/%3e%3c/svg%3e",xyt="data:image/svg+xml,%3csvg%20width='14'%20height='13'%20viewBox='0%200%2014%2013'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_378_2345)'%3e%3cpath%20d='M10.9574%200H13.0931L8.40386%205.51661L13.8824%2013H9.58315L6.21708%208.4524L2.3635%2013H0.22779L5.19565%207.09963L-0.0507812%200H4.35529L7.39636%204.15424L10.9574%200ZM10.2099%2011.7048H11.3939L3.73315%201.24723H2.461L10.2099%2011.7048Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_378_2345'%3e%3crect%20width='13.9286'%20height='13'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",gyt="data:image/svg+xml,%3csvg%20width='10'%20height='12'%20viewBox='0%200%2010%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%2012L10%206.00005L0%200V12Z'%20fill='white'/%3e%3c/svg%3e",nke="data:image/svg+xml,%3csvg%20width='10'%20height='12'%20viewBox='0%200%2010%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.67166%207.49665C9.67295%208.13961%209.54358%208.77482%209.29002%209.36475C9.0481%209.93526%208.6988%2010.4489%208.25377%2010.8887C7.81262%2011.3273%207.28996%2011.6753%206.71686%2011.9146C6.64441%2011.9444%206.57196%2011.9728%206.49952%2012C6.54609%2011.9599%206.59137%2011.9185%206.63407%2011.8758C6.86823%2011.6442%207.05193%2011.3738%207.18%2011.0737C7.31326%2010.7632%207.38182%2010.4282%207.38052%2010.0905C7.38052%209.73733%207.30808%209.39579%207.16448%209.07237C7.02476%208.75671%206.82036%208.47209%206.5655%208.23923L6.35463%208.04647C6.33134%208.02448%206.29383%208.02706%206.27183%208.05035C6.26665%208.05682%206.26278%208.06329%206.26019%208.06976L6.16704%208.34013C6.10883%208.50832%206.00015%208.68167%205.8475%208.85114C5.83844%208.86279%205.8268%208.86538%205.81775%208.86538C5.80998%208.86667%205.79834%208.86538%205.78669%208.85503C5.77764%208.84597%205.77246%208.83304%205.77246%208.8201C5.79963%208.38542%205.66897%207.89382%205.38435%207.35952C5.1489%206.91578%204.8216%206.57036%204.41279%206.32844L4.11395%206.1525C4.07514%206.12922%204.02468%206.16026%204.02727%206.20554L4.04279%206.55226C4.05315%206.789%204.02598%206.99987%203.96129%207.17323C3.88108%207.38668%203.76724%207.58462%203.62105%207.76315C3.52014%207.88605%203.405%207.9986%203.27822%208.09563C2.97291%208.32979%202.72452%208.63122%202.55246%208.97405C2.3804%209.32076%202.29114%209.7024%202.29114%2010.0905C2.29114%2010.4307%202.3584%2010.7619%202.49166%2011.0737C2.61973%2011.3738%202.80473%2011.6455%203.03759%2011.8745C3.08158%2011.9185%203.12686%2011.9599%203.17344%2011.9987C3.09969%2011.9728%203.02725%2011.9444%202.9548%2011.9133C2.37911%2011.6727%201.86292%2011.3273%201.41789%2010.8874C0.976737%2010.4514%200.624856%209.93397%200.381641%209.36345C0.128074%208.77223%200%208.1435%200%207.49536C0.00129499%206.76054%200.170768%206.03478%200.498069%205.37628C0.825378%204.72297%201.29628%204.15245%201.87586%203.70742C2.11648%203.52112%202.33512%203.30896%202.52788%203.07351C2.80602%202.73586%203.02207%202.35939%203.17344%201.95446C3.29763%201.62328%203.34938%201.22482%203.32867%200.774614L3.29892%200.114833C3.29504%200.0281497%203.38948%20-0.0287652%203.46322%200.015216L4.03116%200.348991C4.80866%200.806956%205.43092%201.46545%205.87855%202.30893C6.41931%203.32449%206.66641%204.25724%206.61595%205.08391C6.61466%205.10849%206.62371%205.13307%206.64312%205.14989C6.66382%205.1693%206.68711%205.17188%206.70263%205.17058C6.71815%205.1693%206.74014%205.16282%206.75955%205.14213C7.04934%204.82%207.25374%204.49139%207.365%204.17056L7.54353%203.65826C7.5487%203.64403%207.55518%203.63239%207.56552%203.62074C7.60562%203.57546%207.67549%203.57158%207.72206%203.61298L8.12182%203.9791C8.60566%204.42283%208.99376%204.96101%209.26026%205.56128C9.53323%206.17579%209.67166%206.82652%209.67166%207.49665Z'%20fill='white'/%3e%3c/svg%3e",byt="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.5733%208.48671C13.3267%208.48671%2013.12%208.30005%2013.0933%208.05338C12.9333%206.58671%2012.1467%205.26671%2010.9333%204.42671C10.7133%204.27338%2010.66%203.97338%2010.8133%203.75338C10.9667%203.53338%2011.2667%203.48005%2011.4867%203.63338C12.9333%204.64005%2013.8667%206.21338%2014.06%207.95338C14.0867%208.22005%2013.8933%208.46005%2013.6267%208.48671C13.6067%208.48671%2013.5933%208.48671%2013.5733%208.48671Z'%20fill='white'/%3e%3cpath%20d='M2.49333%208.51989C2.48%208.51989%202.46%208.51989%202.44666%208.51989C2.18%208.49322%201.98666%208.25322%202.01333%207.98656C2.19333%206.24656%203.11333%204.67322%204.54666%203.65989C4.76%203.50656%205.06666%203.55989%205.22%203.77322C5.37333%203.99322%205.32%204.29322%205.10666%204.44656C3.90666%205.29989%203.12666%206.61989%202.98%208.07989C2.95333%208.33322%202.74%208.51989%202.49333%208.51989Z'%20fill='white'/%3e%3cpath%20d='M10.66%2014.0666C9.84%2014.4599%208.96%2014.6599%208.04%2014.6599C7.08%2014.6599%206.16666%2014.4466%205.31333%2014.0132C5.07333%2013.8999%204.98%2013.6066%205.1%2013.3666C5.21333%2013.1266%205.50667%2013.0332%205.74667%2013.1466C6.16667%2013.3599%206.61333%2013.5066%207.06667%2013.5932C7.68%2013.7132%208.30667%2013.7199%208.92%2013.6132C9.37333%2013.5332%209.82%2013.3932%2010.2333%2013.1932C10.48%2013.0799%2010.7733%2013.1732%2010.88%2013.4199C11%2013.6599%2010.9067%2013.9532%2010.66%2014.0666Z'%20fill='white'/%3e%3cpath%20d='M8.03333%201.34009C7%201.34009%206.15333%202.18009%206.15333%203.22009C6.15333%204.26009%206.99333%205.10009%208.03333%205.10009C9.07333%205.10009%209.91333%204.26009%209.91333%203.22009C9.91333%202.18009%209.07333%201.34009%208.03333%201.34009Z'%20fill='white'/%3e%3cpath%20d='M3.36666%209.24658C2.33333%209.24658%201.48666%2010.0866%201.48666%2011.1266C1.48666%2012.1666%202.32666%2013.0066%203.36666%2013.0066C4.40666%2013.0066%205.24666%2012.1666%205.24666%2011.1266C5.24666%2010.0866%204.4%209.24658%203.36666%209.24658Z'%20fill='white'/%3e%3cpath%20d='M12.6333%209.24658C11.6%209.24658%2010.7533%2010.0866%2010.7533%2011.1266C10.7533%2012.1666%2011.5933%2013.0066%2012.6333%2013.0066C13.6733%2013.0066%2014.5133%2012.1666%2014.5133%2011.1266C14.5133%2010.0866%2013.6733%209.24658%2012.6333%209.24658Z'%20fill='white'/%3e%3c/svg%3e",rke="data:image/svg+xml,%3csvg%20width='18'%20height='14'%20viewBox='0%200%2018%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3194_16457)'%3e%3cpath%20d='M11.5339%200C11.358%200.32044%2011.2001%200.651933%2011.0565%200.990792C9.69238%200.78085%208.30315%200.78085%206.93547%200.990792C6.79547%200.651933%206.63392%200.32044%206.45804%200C5.1765%200.224685%203.92727%200.618785%202.74267%201.17495C0.394982%204.74402%20-0.240399%208.22099%200.075501%2011.6501C1.45036%2012.6924%202.99036%2013.488%204.63086%2013.9963C5.0006%2013.488%205.32727%2012.9466%205.60727%2012.3831C5.07599%2012.1805%204.56265%2011.9263%204.07087%2011.6317C4.20009%2011.5359%204.32573%2011.4365%204.44778%2011.3407C7.33034%2012.733%2010.6688%2012.733%2013.5549%2011.3407C13.677%2011.4438%2013.8026%2011.5433%2013.9318%2011.6317C13.4401%2011.93%2012.9267%2012.1805%2012.3919%2012.3867C12.6718%2012.9503%2012.9985%2013.4917%2013.3683%2014C15.0087%2013.4917%2016.5487%2012.6998%2017.9237%2011.6575C18.2969%207.67955%2017.2847%204.23204%2015.2492%201.17864C14.0683%200.622475%2012.819%200.22836%2011.5375%200.00736458L11.5339%200ZM6.00932%209.5396C5.12266%209.5396%204.38677%208.71455%204.38677%207.6943C4.38677%206.67405%205.09394%205.84531%206.00573%205.84531C6.91753%205.84531%207.64264%206.67772%207.62828%207.6943C7.61393%208.71087%206.91394%209.5396%206.00932%209.5396ZM11.9898%209.5396C11.0995%209.5396%2010.3708%208.71455%2010.3708%207.6943C10.3708%206.67405%2011.078%205.84531%2011.9898%205.84531C12.9016%205.84531%2013.6231%206.67772%2013.6088%207.6943C13.5944%208.71087%2012.8944%209.5396%2011.9898%209.5396Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_3194_16457'%3e%3crect%20width='18'%20height='14'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",yyt="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.1626%201.5H14.3679L9.54994%207.00667L15.2179%2014.5H10.7799L7.30394%209.95533L3.3266%2014.5H1.11994L6.27327%208.61L0.835938%201.5H5.3866L8.5286%205.654L12.1626%201.5ZM11.3886%2013.18H12.6106L4.7226%202.75067H3.41127L11.3886%2013.18Z'%20fill='white'/%3e%3c/svg%3e",vyt="data:image/svg+xml,%3csvg%20width='18'%20height='16'%20viewBox='0%200%2018%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1.24334%206.83119C5.90766%204.79901%209.01794%203.45928%2010.5742%202.81199C15.0175%200.963838%2015.9408%200.642794%2016.5426%200.632193C16.675%200.629862%2016.9709%200.662664%2017.1626%200.818215C17.3245%200.949559%2017.369%201.12699%2017.3903%201.25151C17.4117%201.37604%2017.4382%201.65972%2017.4171%201.88138C17.1763%204.41136%2016.1344%2010.5509%2015.6044%2013.3846C15.3801%2014.5836%2014.9385%2014.9856%2014.5109%2015.0249C13.5818%2015.1104%2012.8762%2014.4109%2011.9763%2013.821C10.5681%2012.8979%209.77254%2012.3233%208.40563%2011.4225C6.82593%2010.3815%207.84998%209.80933%208.75025%208.87427C8.98585%208.62956%2013.0797%204.90589%2013.1589%204.56809C13.1689%204.52584%2013.1781%204.36837%2013.0845%204.28521C12.9909%204.20206%2012.8529%204.2305%2012.7532%204.25311C12.612%204.28517%2010.3624%205.77209%206.00433%208.71388C5.36578%209.15236%204.7874%209.366%204.2692%209.3548C3.69791%209.34246%202.599%209.03179%201.78206%208.76624C0.780062%208.44052%20-0.0163084%208.26832%200.0530376%207.71516C0.0891573%207.42704%200.485924%207.13238%201.24334%206.83119Z'%20fill='white'/%3e%3c/svg%3e",wyt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M19.3697%204.89012L13.5097%202.28012C12.6497%201.90012%2011.3497%201.90012%2010.4897%202.28012L4.62969%204.89012C3.14969%205.55012%202.92969%206.45012%202.92969%206.93012C2.92969%207.41012%203.14969%208.31012%204.62969%208.97012L10.4897%2011.5801C10.9197%2011.7701%2011.4597%2011.8701%2011.9997%2011.8701C12.5397%2011.8701%2013.0797%2011.7701%2013.5097%2011.5801L19.3697%208.97012C20.8497%208.31012%2021.0697%207.41012%2021.0697%206.93012C21.0697%206.45012%2020.8597%205.55012%2019.3697%204.89012Z'%20fill='%23083C26'/%3e%3cpath%20d='M12.0003%2017.04C11.6203%2017.04%2011.2403%2016.96%2010.8903%2016.81L4.15031%2013.81C3.12031%2013.35%202.32031%2012.12%202.32031%2010.99C2.32031%2010.58%202.65031%2010.25%203.06031%2010.25C3.47031%2010.25%203.80031%2010.58%203.80031%2010.99C3.80031%2011.53%204.25031%2012.23%204.75031%2012.45L11.4903%2015.45C11.8103%2015.59%2012.1803%2015.59%2012.5003%2015.45L19.2403%2012.45C19.7403%2012.23%2020.1903%2011.54%2020.1903%2010.99C20.1903%2010.58%2020.5203%2010.25%2020.9303%2010.25C21.3403%2010.25%2021.6703%2010.58%2021.6703%2010.99C21.6703%2012.11%2020.8703%2013.35%2019.8403%2013.81L13.1003%2016.81C12.7603%2016.96%2012.3803%2017.04%2012.0003%2017.04Z'%20fill='%23083C26'/%3e%3cpath%20d='M12.0003%2022C11.6203%2022%2011.2403%2021.92%2010.8903%2021.77L4.15031%2018.77C3.04031%2018.28%202.32031%2017.17%202.32031%2015.95C2.32031%2015.54%202.65031%2015.21%203.06031%2015.21C3.47031%2015.21%203.80031%2015.54%203.80031%2015.95C3.80031%2016.58%204.17031%2017.15%204.75031%2017.41L11.4903%2020.41C11.8103%2020.55%2012.1803%2020.55%2012.5003%2020.41L19.2403%2017.41C19.8103%2017.16%2020.1903%2016.58%2020.1903%2015.95C20.1903%2015.54%2020.5203%2015.21%2020.9303%2015.21C21.3403%2015.21%2021.6703%2015.54%2021.6703%2015.95C21.6703%2017.17%2020.9503%2018.27%2019.8403%2018.77L13.1003%2021.77C12.7603%2021.92%2012.3803%2022%2012.0003%2022Z'%20fill='%23083C26'/%3e%3c/svg%3e",Cyt="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.299%202.85232L7.88065%201.32982C7.37898%201.10816%206.62065%201.10816%206.11898%201.32982L2.70065%202.85232C1.83732%203.23732%201.70898%203.76232%201.70898%204.04232C1.70898%204.32232%201.83732%204.84732%202.70065%205.23232L6.11898%206.75482C6.36982%206.86566%206.68482%206.92399%206.99982%206.92399C7.31482%206.92399%207.62982%206.86566%207.88065%206.75482L11.299%205.23232C12.1623%204.84732%2012.2907%204.32232%2012.2907%204.04232C12.2907%203.76232%2012.1682%203.23732%2011.299%202.85232Z'%20fill='%2367FFBD'/%3e%3cpath%20d='M7.00018%209.93984C6.77852%209.93984%206.55685%209.89317%206.35268%209.80567L2.42102%208.05567C1.82018%207.78734%201.35352%207.06984%201.35352%206.41067C1.35352%206.1715%201.54602%205.979%201.78518%205.979C2.02435%205.979%202.21685%206.1715%202.21685%206.41067C2.21685%206.72567%202.47935%207.134%202.77102%207.26234L6.70268%209.01234C6.88935%209.094%207.10518%209.094%207.29185%209.01234L11.2235%207.26234C11.5152%207.134%2011.7777%206.7315%2011.7777%206.41067C11.7777%206.1715%2011.9702%205.979%2012.2093%205.979C12.4485%205.979%2012.641%206.1715%2012.641%206.41067C12.641%207.064%2012.1743%207.78734%2011.5735%208.05567L7.64185%209.80567C7.44352%209.89317%207.22185%209.93984%207.00018%209.93984Z'%20fill='%2367FFBD'/%3e%3cpath%20d='M7.00018%2012.8334C6.77852%2012.8334%206.55685%2012.7867%206.35268%2012.6992L2.42102%2010.9492C1.77352%2010.6634%201.35352%2010.0159%201.35352%209.30423C1.35352%209.06506%201.54602%208.87256%201.78518%208.87256C2.02435%208.87256%202.21685%209.06506%202.21685%209.30423C2.21685%209.67173%202.43268%2010.0042%202.77102%2010.1559L6.70268%2011.9059C6.88935%2011.9876%207.10518%2011.9876%207.29185%2011.9059L11.2235%2010.1559C11.556%2010.0101%2011.7777%209.67173%2011.7777%209.30423C11.7777%209.06506%2011.9702%208.87256%2012.2093%208.87256C12.4485%208.87256%2012.641%209.06506%2012.641%209.30423C12.641%2010.0159%2012.221%2010.6576%2011.5735%2010.9492L7.64185%2012.6992C7.44352%2012.7867%207.22185%2012.8334%207.00018%2012.8334Z'%20fill='%2367FFBD'/%3e%3c/svg%3e",ske="data:image/webp;base64,UklGRjQFAABXRUJQVlA4WAoAAAAQAAAATwAATwAAQUxQSH0BAAABkFZtb91IHwRBEJRAMAQzmDCoGTQMXAaBYAiG8EEQBM3s9uLY2svPiJgAXC1pr410d7featkEC0u60weyJlljO83H1zSd3MwvZtaZ5GY+IW/zZPqkzHNo84lPneDLfGrLV8ndp79fo90X7HqB0pekDlP6otRBSl+WOkTpC1NHdF+6y2d3X/z+Ufbl9w/U1jN97/QA21vZQ8zvMAbKq5sHWV4oozB5lj3M8oxx2JPkgW6/1UhOAOKRmgApFE9AjeUAGAshHqxs0aQSzf6IprZoWo+GFo7/92U0Fk5v0bRHNHWPpqRoNolGwFgIHLFUIMWSALFQBMAZSQWALZL0GywO4mmJIz8Ti4L6DCWKgpfCGIg3cwz5HbQITryttp7pe9jXy/j0WO3Ax9LX6hioXIk6Asp1qBirXIWK0co1qBivfYWuuPSY7xBcnG0u23G9njM1xZSZszBj2sIZrAgm1syrrAhmT48L7NywpKQHR/BIgoVlK7V1+41sdU+CqwEAVlA4IJADAABwEwCdASpQAFAAPoU2lUelIyIhNbWt+KAQiWgAwcQmjtEXOZ5HT3EdLOAefDpgG8d/ufJgCf6jCvGt9C+wF+svVj9Cn9MGb35/r/3vvZgfMSDVHeAiajfoFCV6cakAkwXuHIdi1jVLDZWi77j8sJk+JjxDWiXlDvt6I8wpx4M78xMLipwjRr4qS7zgj/mcsZ7+N9mFpGVH+u8uucq/VUIgbo8haAD+9nv//1lX/+sXv//V1BzpNxdi//pSQKliFbd/die8+PJljk1dSETv/4Dv//V9v/6xe//9X4vt/T1CpqMx/9Jrs3+i7wjIfqVj0ir9/fLIHPFE/n+4kRR0tZ/6/Nz2DIp8r6foLt/8YWQ3TXVGe5Agwsl+1h/8vQHA/mhjtDMKMNJHVELwPr/sRxHahr2rUd5f6Jo2mSF/HB/3VcOqJOkapGgKidoRI6QH2gLTGlK1hC/jcfJbEmVE6ymGrd945Qw6B3neGhuFvVvX4SojZ6xzO/CzIbCO/2X7p7UPxPOEo2SxBD+I17Rl8Q6EuwFnKc2wK3x20D98b69igUaZM+cJyP9CbW270jv/PUK4CuwPXktb8oK+6kVs9P/jnHw//fuE2v1W91zgCuInucSU+hOVEXKMk+e1qYbdONQSmOug0bzt7gx94aJ6a0CQKuH90O03DvmSWJk1kGLJHXloJlj4rZLImdggYgr/kyRqAJ91d6EkOkYmBF7cPbmbx3ZK0RcjZLGBZpxXPO4VlfR3aSZqLHYMM4j0J5/PFZXvLhPP4zZbimGJ0rHCeDH2zPOAxPVxMPFX9je/PArcoYy2MF7utYELr0I0N16B0cFSuGM39Ya0jv+XoNZzMiRLJ94xOrAlE5mc9MLobRQb91AvrGdbFck8hQS5s6umsNJ/reb5eLgMGyBZOko+RT2uDpQ7eXjMuJdlVrdilTJxEMxui5E4H2R2+w30l9Ge4IJugTERWfY/dWK5IPAGneaeMvBupdYOkxAbZf+JDjYDkFw9MCWQ6qD9XvjxLBrzzvkWkVq9vYS1jjXxt52QWo/GoqTBhQfuTXxr5L/9+sehGnbJ7f8fVWUNUbjUW0j4N/qn7RyiWdXShQYKeh/FGLQSqLLqiVSu+XV8RIkoRpiXfBVFL3JChg1ifmXaGvCvGKfsiQ0f4wrAPxHL15eWF8EM9EQM/+XMNRXxz89P85wJOVelt87VZ+65wJOaz1aQyAA=",Syt="data:image/svg+xml,%3csvg%20width='14'%20height='10'%20viewBox='0%200%2014%2010'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.0572%204.79065C13.0572%205.66981%2012.3474%206.38537%2011.4753%206.38537C10.6034%206.38537%209.8961%205.66981%209.8961%204.79065C9.8961%203.90784%2010.6034%203.19229%2011.4753%203.19229C12.3455%203.19229%2013.0572%203.90911%2013.0572%204.79065ZM2.52608%203.19229C1.65388%203.19229%200.944177%203.90784%200.944177%204.79065C0.944177%205.66981%201.65388%206.38537%202.52608%206.38537C3.39561%206.38537%204.10532%205.66981%204.10532%204.79065C4.10532%203.90911%203.39561%203.19229%202.52608%203.19229ZM6.99882%200C5.71126%200%204.6618%201.0588%204.6618%202.36126C4.6618%203.66355%205.71016%204.72426%206.99882%204.72426C8.28795%204.72426%209.33648%203.66355%209.33648%202.36126C9.33726%201.0588%208.28779%200%206.99882%200ZM13.9998%209.63452C13.9998%208.1818%2012.865%207.00276%2011.473%207.00276C11.2247%207.00276%2010.9875%207.05216%2010.7619%207.12205C11.0592%207.72451%2011.2412%208.39639%2011.2412%209.1191V10H14L13.9998%209.63452ZM3.23516%207.12205C3.01027%207.05216%202.77548%207.00276%202.52718%207.00276C1.13323%207.00276%200%208.18387%200%209.63452V10H2.75584V9.1191C2.75584%208.39639%202.93892%207.72451%203.23516%207.12205ZM3.33495%2010H10.6621V9.16246C10.6621%207.06169%209.01746%205.35262%206.99882%205.35262C4.97689%205.35262%203.33511%207.06185%203.33511%209.16246L3.33495%2010Z'%20fill='%2367FFBD'/%3e%3c/svg%3e",Nyt="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6%2011C8.75%2011%2011%208.75%2011%206C11%203.25%208.75%201%206%201C3.25%201%201%203.25%201%206C1%208.75%203.25%2011%206%2011Z'%20stroke='%23FFAA47'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M6%204V6.5'%20stroke='%23FFAA47'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5.99725%208H6.00174'%20stroke='%23FFAA47'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Ayt="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.68583%202.96336C8.17833%202.81169%207.61833%202.71252%207%202.71252C4.20583%202.71252%201.9425%204.97586%201.9425%207.77002C1.9425%2010.57%204.20583%2012.8334%207%2012.8334C9.79416%2012.8334%2012.0575%2010.57%2012.0575%207.77586C12.0575%206.73752%2011.7425%205.76919%2011.2058%204.96419'%20stroke='%23FFAA47'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.40917%203.10335L7.72334%201.16669'%20stroke='%23FFAA47'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.40917%203.10333L7.44334%204.53833'%20stroke='%23FFAA47'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Wme="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.125%2019.5V12.75H9.375'%20stroke='%2334D399'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M21.375%2019.5H2.625'%20stroke='%2334D399'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M9.375%2019.5V8.25H14.625'%20stroke='%2334D399'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M19.875%203.75H14.625V19.5H19.875V3.75Z'%20stroke='%2334D399'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",xJ="data:image/svg+xml,%3csvg%20width='11'%20height='7'%20viewBox='0%200%2011%207'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.83097%200.791748L6.66431%204.00789C6.6074%204.06569%206.57869%204.09459%206.55322%204.11738C6.1419%204.48554%205.51967%204.48554%205.10835%204.11738C5.08288%204.09459%205.05417%204.06568%204.99726%204.00789C4.94036%203.95009%204.9119%203.92119%204.88643%203.8984C4.47511%203.53024%203.85288%203.53024%203.44156%203.8984C3.41609%203.92119%203.38764%203.9501%203.33073%204.00789L1.16406%206.20841M9.83097%200.791748L9.83073%204.04175M9.83097%200.791748H6.58073'%20stroke='%2334D399'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",gJ="data:image/svg+xml,%3csvg%20width='11'%20height='7'%20viewBox='0%200%2011%207'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.00496%206.41675L4.17163%203.2006C4.22854%203.14281%204.25725%203.1139%204.28271%203.09111C4.69404%202.72296%205.31627%202.72296%205.72759%203.09111C5.75306%203.1139%205.78177%203.14281%205.83868%203.20061C5.89558%203.2584%205.92404%203.28731%205.9495%203.3101C6.36083%203.67826%206.98306%203.67826%207.39438%203.3101C7.41984%203.28731%207.4483%203.2584%207.50521%203.2006L9.67188%201.00008M1.00496%206.41675L1.00521%203.16675M1.00496%206.41675L4.25521%206.41675'%20stroke='%23FB7184'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",jyt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='21'%20height='22'%20viewBox='0%200%2021%2022'%20fill='none'%3e%3cpath%20d='M2.625%206.625H18.375'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M5.25%2011H15.75'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M8.75%2015.375H12.25'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",Eyt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='21'%20height='22'%20viewBox='0%200%2021%2022'%20fill='none'%3e%3cpath%20d='M2.625%206.625H18.375'%20stroke='%2367FFBD'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M5.25%2011H15.75'%20stroke='%2367FFBD'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M8.75%2015.375H12.25'%20stroke='%2367FFBD'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",i5="/assets/dextrabotIcon64x64-CGBWeHNW.png",_yt="/assets/telegramfilterIcon-D3R-nSo1.svg",kyt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%3e%3cpath%20d='M10.5%2019.25C15.3325%2019.25%2019.25%2015.3325%2019.25%2010.5C19.25%205.66751%2015.3325%201.75%2010.5%201.75C5.66751%201.75%201.75%205.66751%201.75%2010.5C1.75%2015.3325%205.66751%2019.25%2010.5%2019.25Z'%20stroke='%236A6A6A'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M7.00039%202.625H7.87539C6.16914%207.735%206.16914%2013.265%207.87539%2018.375H7.00039'%20stroke='%236A6A6A'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.125%202.625C14.8313%207.735%2014.8313%2013.265%2013.125%2018.375'%20stroke='%236A6A6A'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.625%2014V13.125C7.735%2014.8313%2013.265%2014.8313%2018.375%2013.125V14'%20stroke='%236A6A6A'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2.625%207.8749C7.735%206.16865%2013.265%206.16865%2018.375%207.8749'%20stroke='%236A6A6A'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",iE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='9'%20height='8'%20viewBox='0%200%209%208'%20fill='none'%3e%3cpath%20d='M4.5%200L0%208L9%208L4.5%200Z'%20fill='%233DB380'/%3e%3c/svg%3e",aE="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='9'%20height='8'%20viewBox='0%200%209%208'%20fill='none'%3e%3cpath%20d='M4.5%208L9%200L0%202.0772e-08L4.5%208Z'%20fill='%23FF797C'/%3e%3c/svg%3e",C0="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.3726%207.16021L13.4726%206.10688C13.3059%205.90688%2013.1659%205.53355%2013.1659%205.26688V4.13355C13.1659%203.42688%2012.5859%202.84688%2011.8793%202.84688H10.7459C10.4793%202.84688%2010.0993%202.70688%209.89927%202.54021L8.84594%201.64021C8.38594%201.24688%207.6326%201.24688%207.1726%201.64021L6.10594%202.54021C5.90594%202.70688%205.5326%202.84688%205.26594%202.84688H4.1126C3.40594%202.84688%202.82594%203.42688%202.82594%204.13355V5.26688C2.82594%205.52688%202.6926%205.90021%202.52594%206.10021L1.62594%207.16021C1.23927%207.62688%201.23927%208.37355%201.62594%208.82688L2.52594%209.88688C2.6926%2010.0802%202.82594%2010.4602%202.82594%2010.7202V11.8602C2.82594%2012.5669%203.40594%2013.1469%204.1126%2013.1469H5.2726C5.5326%2013.1469%205.9126%2013.2869%206.1126%2013.4535L7.16594%2014.3535C7.62594%2014.7469%208.37927%2014.7469%208.83927%2014.3535L9.8926%2013.4535C10.0926%2013.2869%2010.4659%2013.1469%2010.7326%2013.1469H11.8659C12.5726%2013.1469%2013.1526%2012.5669%2013.1526%2011.8602V10.7269C13.1526%2010.4602%2013.2926%2010.0869%2013.4593%209.88688L14.3593%208.83355C14.7659%208.38022%2014.7659%207.62688%2014.3726%207.16021ZM7.49927%205.42022C7.49927%205.14688%207.72594%204.92022%207.99927%204.92022C8.2726%204.92022%208.49927%205.14688%208.49927%205.42022V8.64021C8.49927%208.91355%208.2726%209.14021%207.99927%209.14021C7.72594%209.14021%207.49927%208.91355%207.49927%208.64021V5.42022ZM7.99927%2011.2469C7.6326%2011.2469%207.3326%2010.9469%207.3326%2010.5802C7.3326%2010.2135%207.62594%209.91355%207.99927%209.91355C8.36594%209.91355%208.66594%2010.2135%208.66594%2010.5802C8.66594%2010.9469%208.3726%2011.2469%207.99927%2011.2469Z'%20fill='%23636363'/%3e%3c/svg%3e",Tyt="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_257_8126)'%3e%3cpath%20d='M1.5%201C1.36739%201%201.24021%201.05268%201.14645%201.14645C1.05268%201.24021%201%201.36739%201%201.5V5.5C1%205.63261%200.947322%205.75979%200.853553%205.85355C0.759785%205.94732%200.632608%206%200.5%206C0.367392%206%200.240215%205.94732%200.146447%205.85355C0.0526784%205.75979%200%205.63261%200%205.5V1.5C0%201.10218%200.158035%200.720644%200.43934%200.43934C0.720644%200.158035%201.10218%200%201.5%200L5.5%200C5.63261%200%205.75979%200.0526784%205.85355%200.146447C5.94732%200.240215%206%200.367392%206%200.5C6%200.632608%205.94732%200.759785%205.85355%200.853553C5.75979%200.947322%205.63261%201%205.5%201H1.5ZM10%200.5C10%200.367392%2010.0527%200.240215%2010.1464%200.146447C10.2402%200.0526784%2010.3674%200%2010.5%200L14.5%200C14.8978%200%2015.2794%200.158035%2015.5607%200.43934C15.842%200.720644%2016%201.10218%2016%201.5V5.5C16%205.63261%2015.9473%205.75979%2015.8536%205.85355C15.7598%205.94732%2015.6326%206%2015.5%206C15.3674%206%2015.2402%205.94732%2015.1464%205.85355C15.0527%205.75979%2015%205.63261%2015%205.5V1.5C15%201.36739%2014.9473%201.24021%2014.8536%201.14645C14.7598%201.05268%2014.6326%201%2014.5%201H10.5C10.3674%201%2010.2402%200.947322%2010.1464%200.853553C10.0527%200.759785%2010%200.632608%2010%200.5ZM0.5%2010C0.632608%2010%200.759785%2010.0527%200.853553%2010.1464C0.947322%2010.2402%201%2010.3674%201%2010.5V14.5C1%2014.6326%201.05268%2014.7598%201.14645%2014.8536C1.24021%2014.9473%201.36739%2015%201.5%2015H5.5C5.63261%2015%205.75979%2015.0527%205.85355%2015.1464C5.94732%2015.2402%206%2015.3674%206%2015.5C6%2015.6326%205.94732%2015.7598%205.85355%2015.8536C5.75979%2015.9473%205.63261%2016%205.5%2016H1.5C1.10218%2016%200.720644%2015.842%200.43934%2015.5607C0.158035%2015.2794%200%2014.8978%200%2014.5L0%2010.5C0%2010.3674%200.0526784%2010.2402%200.146447%2010.1464C0.240215%2010.0527%200.367392%2010%200.5%2010ZM15.5%2010C15.6326%2010%2015.7598%2010.0527%2015.8536%2010.1464C15.9473%2010.2402%2016%2010.3674%2016%2010.5V14.5C16%2014.8978%2015.842%2015.2794%2015.5607%2015.5607C15.2794%2015.842%2014.8978%2016%2014.5%2016H10.5C10.3674%2016%2010.2402%2015.9473%2010.1464%2015.8536C10.0527%2015.7598%2010%2015.6326%2010%2015.5C10%2015.3674%2010.0527%2015.2402%2010.1464%2015.1464C10.2402%2015.0527%2010.3674%2015%2010.5%2015H14.5C14.6326%2015%2014.7598%2014.9473%2014.8536%2014.8536C14.9473%2014.7598%2015%2014.6326%2015%2014.5V10.5C15%2010.3674%2015.0527%2010.2402%2015.1464%2010.1464C15.2402%2010.0527%2015.3674%2010%2015.5%2010Z'%20fill='%23929292'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_257_8126'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Iyt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%3e%3cpath%20d='M24%2011.9499C24%2019.8843%2019.1443%2022.4303%2016.5859%2020.1633C14.4801%2018.3148%2013.8535%2014.4087%2010.686%2014.0076C6.6657%2013.5019%206.31762%2018.8555%203.67223%2018.8555C0.591733%2018.8555%200%2014.3738%200%2012.0719C0%209.71772%200.661348%206.50904%203.28933%206.50904C6.35243%206.50904%206.52647%2011.0954%2010.3553%2010.8512C14.1668%2010.5897%2014.2364%205.81149%2016.7078%203.77119C18.8658%202.00989%2024%203.91069%2024%2011.9499Z'%20fill='%2397FCE4'/%3e%3c/svg%3e",Pyt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%3e%3cpath%20d='M14.1663%201.75H6.83375C3.64875%201.75%201.75%203.64875%201.75%206.83375V14.1575C1.75%2017.3513%203.64875%2019.25%206.83375%2019.25H14.1575C17.3425%2019.25%2019.2412%2017.3513%2019.2412%2014.1663V6.83375C19.25%203.64875%2017.3513%201.75%2014.1663%201.75ZM15.0938%2010.7887C15.0938%2011.1475%2014.7963%2011.445%2014.4375%2011.445C14.0787%2011.445%2013.7812%2011.1475%2013.7812%2010.7887V8.14625L7.02625%2014.9013C6.895%2015.0325%206.72875%2015.0938%206.5625%2015.0938C6.39625%2015.0938%206.23%2015.0325%206.09875%2014.9013C5.845%2014.6475%205.845%2014.2275%206.09875%2013.9738L12.8537%207.21875H10.2113C9.8525%207.21875%209.555%206.92125%209.555%206.5625C9.555%206.20375%209.8525%205.90625%2010.2113%205.90625H14.4375C14.7963%205.90625%2015.0938%206.20375%2015.0938%206.5625V10.7887Z'%20fill='%2300FF91'/%3e%3c/svg%3e",Fyt="/assets/telegramModalIcon-CwWiyADO.png",ike="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M43.1198%2021.48L40.3998%2018.32C39.8798%2017.72%2039.4598%2016.6%2039.4598%2015.8V12.4C39.4598%2010.28%2037.7198%208.53999%2035.5998%208.53999H32.1998C31.4198%208.53999%2030.2798%208.12%2029.6798%207.59999L26.5198%204.88C25.1398%203.7%2022.8798%203.7%2021.4798%204.88L18.3398%207.61999C17.7398%208.12%2016.5998%208.53999%2015.8198%208.53999H12.3598C10.2398%208.53999%208.49977%2010.28%208.49977%2012.4V15.82C8.49977%2016.6%208.07977%2017.72%207.57977%2018.32L4.87977%2021.5C3.71977%2022.88%203.71977%2025.12%204.87977%2026.5L7.57977%2029.68C8.07977%2030.28%208.49977%2031.4%208.49977%2032.18V35.6C8.49977%2037.72%2010.2398%2039.46%2012.3598%2039.46H15.8198C16.5998%2039.46%2017.7398%2039.88%2018.3398%2040.4L21.4998%2043.12C22.8798%2044.3%2025.1398%2044.3%2026.5398%2043.12L29.6998%2040.4C30.2998%2039.88%2031.4198%2039.46%2032.2198%2039.46H35.6198C37.7398%2039.46%2039.4798%2037.72%2039.4798%2035.6V32.2C39.4798%2031.42%2039.8998%2030.28%2040.4198%2029.68L43.1398%2026.52C44.2998%2025.14%2044.2998%2022.86%2043.1198%2021.48ZM32.3198%2020.22L22.6598%2029.88C22.3798%2030.16%2021.9998%2030.32%2021.5998%2030.32C21.1998%2030.32%2020.8198%2030.16%2020.5398%2029.88L15.6998%2025.04C15.1198%2024.46%2015.1198%2023.5%2015.6998%2022.92C16.2798%2022.34%2017.2398%2022.34%2017.8198%2022.92L21.5998%2026.7L30.1998%2018.1C30.7798%2017.52%2031.7398%2017.52%2032.3198%2018.1C32.8998%2018.68%2032.8998%2019.64%2032.3198%2020.22Z'%20fill='%231DE674'/%3e%3c/svg%3e",ake="data:image/svg+xml,%3csvg%20width='21'%20height='22'%20viewBox='0%200%2021%2022'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3765_9549)'%3e%3cpath%20d='M10.5%2021.5C16.299%2021.5%2021%2016.799%2021%2011C21%205.20101%2016.299%200.5%2010.5%200.5C4.70101%200.5%200%205.20101%200%2011C0%2016.799%204.70101%2021.5%2010.5%2021.5Z'%20fill='url(%23paint0_linear_3765_9549)'/%3e%3cpath%20d='M7.10742%2011.7675L8.35316%2015.2156C8.35316%2015.2156%208.50891%2015.5382%208.67568%2015.5382C8.84246%2015.5382%2011.323%2012.9576%2011.323%2012.9576L14.0814%207.62976L7.15187%2010.8775L7.10742%2011.7675Z'%20fill='%23C8DAEA'/%3e%3cpath%20d='M8.75895%2012.6519L8.51981%2015.1934C8.51981%2015.1934%208.41971%2015.9721%209.19829%2015.1934C9.97686%2014.4146%2010.7221%2013.8141%2010.7221%2013.8141'%20fill='%23A9C6D8'/%3e%3cpath%20d='M7.12957%2011.8906L4.56705%2011.0557C4.56705%2011.0557%204.2608%2010.9315%204.35941%2010.6497C4.37971%2010.5916%204.42066%2010.5422%204.54316%2010.4572C5.11095%2010.0614%2015.0524%206.4882%2015.0524%206.4882C15.0524%206.4882%2015.3331%206.39362%2015.4987%206.45653C15.5396%206.46921%2015.5765%206.49254%2015.6055%206.52413C15.6344%206.55572%2015.6545%206.59445%2015.6636%206.63634C15.6815%206.71034%2015.689%206.78647%2015.6858%206.86253C15.6851%206.92833%2015.6771%206.98932%2015.6711%207.08495C15.6105%208.06189%2013.7986%2015.3531%2013.7986%2015.3531C13.7986%2015.3531%2013.6901%2015.7797%2013.3017%2015.7944C13.2063%2015.7974%2013.1112%2015.7813%2013.0221%2015.7468C12.933%2015.7124%2012.8518%2015.6603%2012.7833%2015.5938C12.0211%2014.9382%209.38663%2013.1677%208.8045%2012.7783C8.79136%2012.7694%208.78031%2012.7577%208.77206%2012.7441C8.76382%2012.7305%208.75859%2012.7153%208.75672%2012.6996C8.74858%2012.6585%208.79321%2012.6077%208.79321%2012.6077C8.79321%2012.6077%2013.3805%208.53019%2013.5025%208.10214C13.512%208.06898%2013.4763%208.05262%2013.4283%208.06714C13.1237%208.17923%207.842%2011.5146%207.25907%2011.8828C7.21711%2011.8954%207.17276%2011.8981%207.12957%2011.8906Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_3765_9549'%20x1='10.5'%20y1='21.5'%20x2='10.5'%20y2='0.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231D93D2'/%3e%3cstop%20offset='1'%20stop-color='%2338B0E3'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_3765_9549'%3e%3crect%20width='21'%20height='21'%20fill='white'%20transform='translate(0%200.5)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",qme="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9%201.5C4.8675%201.5%201.5%204.8675%201.5%209C1.5%2013.1325%204.8675%2016.5%209%2016.5C13.1325%2016.5%2016.5%2013.1325%2016.5%209C16.5%204.8675%2013.1325%201.5%209%201.5ZM12.585%207.275L8.3325%2011.5275C8.2275%2011.6325%208.085%2011.6925%207.935%2011.6925C7.785%2011.6925%207.6425%2011.6325%207.5375%2011.5275L5.415%209.405C5.1975%209.1875%205.1975%208.8275%205.415%208.61C5.6325%208.3925%205.9925%208.3925%206.21%208.61L7.935%2010.335L11.79%206.48C12.0075%206.2625%2012.3675%206.2625%2012.585%206.48C12.8025%206.6975%2012.8025%207.05%2012.585%207.275Z'%20fill='%231DE674'/%3e%3c/svg%3e",oke="/assets/basedLogoSvgIcon-C71QETXb.png",Oyt="/assets/variationalIcon-VFI-7A--.png",Myt="/assets/apexIcon-pUC7_jPm.png",Ryt="/assets/paradexIcon-gNYlng5D.jpg",Lyt="/assets/lighterReportImg-DWBVr45f.jpeg";function Dyt({open:e,setOpen:t,setGenModalOpen:n,setGenWalletSuccess:r,setGenWalletData:s,setShowPrivateKey:a}){return i.jsx(i.Fragment,{children:i.jsxs(ga,{open:e,onClose:()=>{},className:"relative z-[9999999999] font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-[9999999999] w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full justify-center p-4 text-center items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[300px] sm:w-[480px] h-max relative bg-[#252525] rounded-3xl py-4 text-white",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Oa})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Hi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-2",children:[i.jsx("div",{className:"text-center text-white text-xl sm:text-2xl font-semibold font-manrope leading-7",children:"Last Chance to Save Your Private Key"}),i.jsx("div",{className:"w-[248px] sm:w-[348px] text-center text-white/60 text-[16px] font-medium font-manrope leading-5",children:"You will not be able to recover it later."})]}),i.jsxs("div",{className:"flex  items-center justify-center gap-4",children:[i.jsx("div",{onClick:()=>{t(!1)},className:"h-8 px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Cancel"})}),i.jsxs("div",{onClick:()=>{t(!1),r(!1),s([]),a(!1),on.success(i.jsx(i.Fragment,{children:i.jsx("span",{style:{color:"#67ffbd",paddingLeft:"5px"},children:"The process is successful."})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.32)",width:"340px",minWidth:"340px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"h-8 pl-2 pr-3.5 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"I Already Saved It"})]})]})]})})})})})]})})}const Byt=()=>i.jsxs("div",{className:"w-full flex flex-col items-center justify-center h-full gap-4 font-manrope",children:[i.jsxs("div",{role:"status",className:"flex justify-center items-center w-full",children:[i.jsxs("svg",{"aria-hidden":"true",className:"w-[48px] h-[48px] animate-spin text-gray-600 fill-white",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}),i.jsx("div",{className:"font-manrope font-medium text-sm sm:text-lg leading-5.5 text-gray-600",children:"Loading"})]}),Ma=Se.memo(Byt),$yt=({loading:e,genWalletSuccess:t,genWalletData:n,showPrivateKey:r,genWalletName:s,setGenWalletName:a,errorMessage:o,setShowPrivateKey:l,setGenWalletData:c,setGenWalletSuccess:u,setErrorMessage:d,setLoading:f,handleListRequest:x,handlePageChange:g})=>{const{setSignModalOpen:v}=m.useContext(Gr),{address:w}=Yr(),C=async()=>{const I=window.localStorage.getItem("hyperToken");if(!I){v(!0);return}if(!s){d("Please enter a name.");return}f(!0),d("");const P=window.localStorage.getItem("hyperAddress");try{const F=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/generate",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:w?w.toLowerCase():P,token:I,wallet_name:s})})).json();F.success?(c(F==null?void 0:F.wallet),u(!0),a(""),x(),g(1)):(console.log("An error has occurred. Please try again."),d(F==null?void 0:F.error_message))}catch(R){console.error("An error has occurred:",R.message),d(R==null?void 0:R.message)}finally{f(!1)}},N=()=>{l(I=>!I)};return i.jsx(i.Fragment,{children:e?i.jsx("div",{role:"status",className:"flex justify-center items-center w-full my-[30px]",children:i.jsx(Ma,{})}):t&&Object.keys(n).length>0?i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4",children:[i.jsx("div",{className:"w-full flex justify-center items-center",children:i.jsx("span",{className:"flex justify-center items-center w-[286px] sm:w-[480px] text-center text-white/60 text-[16px] leading-5 font-medium font-['Inter'] tracking-tight",children:"Please copy the private key below and store it in a secure location. This private key will not be shown again."})}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-4 py-4 text-white w-full",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#b1b1b1] text-[16px] font-medium font-inter leading-none",children:"Label"}),i.jsx("div",{className:"text-white text-[16px] font-medium font-inter leading-none",children:n==null?void 0:n.wallet_name})]}),i.jsx("div",{className:"w-full h-px bg-[#353535]"}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2 w-[286px] sm:w-[400px]",children:[i.jsx("div",{className:"text-[#b1b1b1] text-[16px] font-medium font-inter leading-none",children:"Address"}),i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"text-white text-[16px] font-medium font-inter leading-none break-all",children:n==null?void 0:n.address}),i.jsx("img",{onClick:I=>{I.stopPropagation(),navigator.clipboard.writeText(n==null?void 0:n.address),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:bo,alt:"",className:"cursor-pointer"})]})]}),i.jsx("div",{className:"w-full h-px bg-[#353535]"}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#b1b1b1] text-[16px] font-medium font-inter leading-none",children:"Private Key"}),i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"text-white text-[16px] font-medium font-inter leading-none max-w-[280px] sm:max-w-[380px] break-all",children:r?n==null?void 0:n.private_key:"••••••••••••••••••"}),i.jsx("img",{onClick:I=>{I.stopPropagation(),navigator.clipboard.writeText(n==null?void 0:n.private_key),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:bo,alt:"",className:"cursor-pointer"}),i.jsx("span",{onClick:()=>{N()},className:"p-1 rounded cursor-pointer",children:r?i.jsx(Cet,{className:"w-4 h-4"}):i.jsx(vet,{className:"w-4 h-4"})})]})]})]})]}):i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2 w-full -mt-2",children:[i.jsx("div",{className:"text-white text-sm font-medium leading-normal tracking-[-0.14px] w-full",children:"Enter a name for your follower wallet"}),i.jsx("div",{className:"w-full",children:i.jsx("input",{type:"text",value:s,onChange:I=>a(I.target.value),placeholder:"Wallet Name",className:"px-4 py-2 focus:outline-none focus:ring-0 w-full h-10 bg-[#1b1b1b] rounded-xl border border-[#303030] text-white text-sm font-medium font-['Inter'] leading-[8px] placeholder:text-[14px] placeholder:font-medium placeholder:tracking-[-0.28px] placeholder:leading-[8px] placeholder:font-inter focus:placeholder:text-white"})}),i.jsx("button",{onClick:()=>{C()},disabled:e,className:"w-full h-10 pl-2 pr-3.5 py-3 bg-[#7445ff] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] focus:ring-0 focus:outline-none justify-center items-center gap-1.5 inline-flex mt-2.5",children:i.jsx("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px]",children:"Generate"})}),o&&i.jsxs("div",{className:"mt-2 w-full h-10 p-3 bg-[#ff7171]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5",children:[i.jsx("img",{src:vc,alt:"Dextrabot"}),i.jsx("p",{className:"text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4",children:o})]})]})})},Uyt=({agentWalletData:e,setAgentWalletData:t,agentWalletName:n,setAgentWalletName:r,errorAgentMessage:s,setErrorAgentMessage:a,loadingAgent:o,setLoadingAgent:l,handleListRequest:c,handlePageChange:u,agentWalletAddress:d,setAgentWalletAddress:f,agentWalletPkey:x,setAgentWalletPkey:g})=>{const{setSignModalOpen:v}=m.useContext(Gr),{address:w}=Yr(),C=async()=>{const N=window.localStorage.getItem("hyperToken");if(!N){v(!0);return}if(!n||!d||!x){n?d?x||a("Please enter the agent wallet private key."):a("Please enter the main public address."):a("Please enter a name.");return}l(!0),a("");const I=window.localStorage.getItem("hyperAddress");try{const R=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/generate",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:w?w.toLowerCase():I,token:N,name:n,connet_wallet_address:d,agent_wallet_pkey:x})})).json();R.success?(t(R==null?void 0:R.wallet),r(""),c(),u(1)):(console.log("An error has occurred. Please try again."),a(R==null?void 0:R.error_message))}catch(P){console.error("An error has occurred:",P.message),a(P==null?void 0:P.message)}finally{l(!1)}};return i.jsx(i.Fragment,{children:o?i.jsx("div",{role:"status",className:"flex justify-center items-center w-full my-[30px]",children:i.jsx(Ma,{})}):Object.keys(e).length>0?i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4",children:[i.jsx("div",{className:"w-full flex justify-center items-center",children:i.jsx("span",{className:"flex justify-center items-center w-[400px] text-center text-white/60 text-[16px] leading-5 font-medium font-manrope tracking-tight",children:"Please copy the private key below and store it in a secure location. This private key will not be shown again."})}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-4 p-4 text-white",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#b1b1b1] text-[16px] font-medium font-inter leading-none",children:"Label"}),i.jsx("div",{className:"text-white text-[16px] font-medium font-inter leading-none",children:e==null?void 0:e.wallet_name})]}),i.jsx("div",{className:"w-[440px] h-px bg-[#353535]"}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#b1b1b1] text-[16px] font-medium font-inter leading-none",children:"Address"}),i.jsx("div",{className:"flex justify-start items-center gap-2",children:i.jsx("div",{className:"text-white text-[16px] font-medium font-inter leading-none",children:e==null?void 0:e.address})})]}),i.jsx("div",{className:"w-[440px] h-px bg-[#353535]"})]})]}):i.jsxs("div",{className:"flex flex-col items-center justify-start gap-2",children:[i.jsx("div",{className:"font-bold text-white",children:"Manually add api & secret key"}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2",children:[i.jsx("input",{type:"text",value:n,onChange:N=>r(N.target.value),placeholder:"Wallet Name",className:"px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 w-[286px] h-8 bg-[#1b1b1b] rounded-[10px] border border-[#303030] text-white"}),i.jsx("input",{type:"text",value:d,onChange:N=>f(N.target.value),placeholder:"Main Public Address",className:"px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 w-[286px] h-8 bg-[#1b1b1b] rounded-[10px] border border-[#303030] text-white"}),i.jsx("input",{type:"text",value:x,onChange:N=>g(N.target.value),placeholder:"Agent Wallet Private Key",className:"px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 w-[286px] h-8 bg-[#1b1b1b] rounded-[10px] border border-[#303030] text-white"})]}),i.jsxs("button",{onClick:()=>{C()},disabled:o,className:"w-[285px] h-8 pl-2 pr-3.5 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Connect"})]}),s&&i.jsx("p",{className:"mt-2 text-sm text-red-500",children:s})]})})},lke="6.15.0";function zyt(e,t,n){const r=t.split("|").map(a=>a.trim());for(let a=0;a<r.length;a++)switch(t){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof e===t)return}const s=new Error(`invalid value for type ${t}`);throw s.code="INVALID_ARGUMENT",s.argument=`value.${n}`,s.value=e,s}async function yu(e){const t=Object.keys(e);return(await Promise.all(t.map(r=>Promise.resolve(e[r])))).reduce((r,s,a)=>(r[t[a]]=s,r),{})}function Ps(e,t,n){for(let r in t){let s=t[r];const a=n?n[r]:null;a&&zyt(s,a,r),Object.defineProperty(e,r,{enumerable:!0,value:s,writable:!1})}}function FC(e,t){if(e==null)return"null";if(t==null&&(t=new Set),typeof e=="object"){if(t.has(e))return"[Circular]";t.add(e)}if(Array.isArray(e))return"[ "+e.map(n=>FC(n,t)).join(", ")+" ]";if(e instanceof Uint8Array){const n="0123456789abcdef";let r="0x";for(let s=0;s<e.length;s++)r+=n[e[s]>>4],r+=n[e[s]&15];return r}if(typeof e=="object"&&typeof e.toJSON=="function")return FC(e.toJSON(),t);switch(typeof e){case"boolean":case"number":case"symbol":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const n=Object.keys(e);return n.sort(),"{ "+n.map(r=>`${FC(r,t)}: ${FC(e[r],t)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Kc(e,t){return e&&e.code===t}function rae(e){return Kc(e,"CALL_EXCEPTION")}function So(e,t,n){let r=e;{const a=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${FC(n)}`);for(const o in n){if(o==="shortMessage")continue;const l=n[o];a.push(o+"="+FC(l))}}a.push(`code=${t}`),a.push(`version=${lke}`),a.length&&(e+=" ("+a.join(", ")+")")}let s;switch(t){case"INVALID_ARGUMENT":s=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":s=new RangeError(e);break;default:s=new Error(e)}return Ps(s,{code:t}),n&&Object.assign(s,n),s.shortMessage==null&&Ps(s,{shortMessage:r}),s}function Fr(e,t,n,r){if(!e)throw So(t,n,r)}function Sn(e,t,n,r){Fr(e,t,"INVALID_ARGUMENT",{argument:n,value:r})}function cke(e,t,n){n==null&&(n=""),n&&(n=": "+n),Fr(e>=t,"missing argument"+n,"MISSING_ARGUMENT",{count:e,expectedCount:t}),Fr(e<=t,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:e,expectedCount:t})}const Hyt=["NFD","NFC","NFKD","NFKC"].reduce((e,t)=>{try{if("test".normalize(t)!=="test")throw new Error("bad");if(t==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");e.push(t)}catch{}return e},[]);function uke(e){Fr(Hyt.indexOf(e)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:e}})}function a5(e,t,n){if(n==null&&(n=""),e!==t){let r=n,s="new";n&&(r+=".",s+=" "+n),Fr(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:s})}}function dke(e,t,n){if(e instanceof Uint8Array)return n?new Uint8Array(e):e;if(typeof e=="string"&&e.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((e.length-2)/2);let s=2;for(let a=0;a<r.length;a++)r[a]=parseInt(e.substring(s,s+2),16),s+=2;return r}Sn(!1,"invalid BytesLike value",t||"value",e)}function cs(e,t){return dke(e,t,!1)}function Yc(e,t){return dke(e,t,!0)}function ao(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||typeof t=="number"&&e.length!==2+2*t||t===!0&&e.length%2!==0)}function kB(e){return ao(e,!0)||e instanceof Uint8Array}const Gme="0123456789abcdef";function Hr(e){const t=cs(e);let n="0x";for(let r=0;r<t.length;r++){const s=t[r];n+=Gme[(s&240)>>4]+Gme[s&15]}return n}function Pa(e){return"0x"+e.map(t=>Hr(t).substring(2)).join("")}function e4(e){return ao(e,!0)?(e.length-2)/2:cs(e).length}function po(e,t,n){const r=cs(e);return n!=null&&n>r.length&&Fr(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),Hr(r.slice(t??0,n??r.length))}function fke(e,t,n){const r=cs(e);Fr(t>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:t,offset:t+1});const s=new Uint8Array(t);return s.fill(0),n?s.set(r,t-r.length):s.set(r,0),Hr(s)}function e1(e,t){return fke(e,t,!0)}function Vyt(e,t){return fke(e,t,!1)}const TB=BigInt(0),Yp=BigInt(1),bJ=9007199254740991;function Wyt(e,t){const n=IB(e,"value"),r=BigInt(Mi(t,"width"));if(Fr(n>>r===TB,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),n>>r-Yp){const s=(Yp<<r)-Yp;return-((~n&s)+Yp)}return n}function hke(e,t){let n=gs(e,"value");const r=BigInt(Mi(t,"width")),s=Yp<<r-Yp;if(n<TB){n=-n,Fr(n<=s,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e});const a=(Yp<<r)-Yp;return(~n&a)+Yp}else Fr(n<s,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e});return n}function fj(e,t){const n=IB(e,"value"),r=BigInt(Mi(t,"bits"));return n&(Yp<<r)-Yp}function gs(e,t){switch(typeof e){case"bigint":return e;case"number":return Sn(Number.isInteger(e),"underflow",t||"value",e),Sn(e>=-9007199254740991&&e<=bJ,"overflow",t||"value",e),BigInt(e);case"string":try{if(e==="")throw new Error("empty string");return e[0]==="-"&&e[1]!=="-"?-BigInt(e.substring(1)):BigInt(e)}catch(n){Sn(!1,`invalid BigNumberish string: ${n.message}`,t||"value",e)}}Sn(!1,"invalid BigNumberish value",t||"value",e)}function IB(e,t){const n=gs(e,t);return Fr(n>=TB,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),n}const Kme="0123456789abcdef";function PB(e){if(e instanceof Uint8Array){let t="0x0";for(const n of e)t+=Kme[n>>4],t+=Kme[n&15];return BigInt(t)}return gs(e)}function Mi(e,t){switch(typeof e){case"bigint":return Sn(e>=-9007199254740991&&e<=bJ,"overflow",t||"value",e),Number(e);case"number":return Sn(Number.isInteger(e),"underflow",t||"value",e),Sn(e>=-9007199254740991&&e<=bJ,"overflow",t||"value",e),e;case"string":try{if(e==="")throw new Error("empty string");return Mi(BigInt(e),t)}catch(n){Sn(!1,`invalid numeric string: ${n.message}`,t||"value",e)}}Sn(!1,"invalid numeric value",t||"value",e)}function qyt(e){return Mi(PB(e))}function t1(e,t){let r=IB(e,"value").toString(16);if(t==null)r.length%2&&(r="0"+r);else{const s=Mi(t,"width");for(Fr(s*2>=r.length,`value exceeds width (${s} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:e});r.length<s*2;)r="0"+r}return"0x"+r}function tl(e){const t=IB(e,"value");if(t===TB)return new Uint8Array([]);let n=t.toString(16);n.length%2&&(n="0"+n);const r=new Uint8Array(n.length/2);for(let s=0;s<r.length;s++){const a=s*2;r[s]=parseInt(n.substring(a,a+2),16)}return r}function qp(e){let t=Hr(kB(e)?e:tl(e)).substring(2);for(;t.startsWith("0");)t=t.substring(1);return t===""&&(t="0"),"0x"+t}const mM="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let WI=null;function Gyt(e){if(WI==null){WI={};for(let n=0;n<mM.length;n++)WI[mM[n]]=BigInt(n)}const t=WI[e];return Sn(t!=null,"invalid base58 value","letter",e),t}const Kyt=BigInt(0),yJ=BigInt(58);function pke(e){const t=cs(e);let n=PB(t),r="";for(;n;)r=mM[Number(n%yJ)]+r,n/=yJ;for(let s=0;s<t.length&&!t[s];s++)r=mM[0]+r;return r}function Yyt(e){let t=Kyt;for(let n=0;n<e.length;n++)t*=yJ,t+=Gyt(e[n]);return t}function Xyt(e){e=atob(e);const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return cs(t)}function Qyt(e){const t=cs(e);let n="";for(let r=0;r<t.length;r++)n+=String.fromCharCode(t[r]);return btoa(n)}var I4;class mke{constructor(t,n,r){Un(this,"filter");Un(this,"emitter");Ln(this,I4);Ht(this,I4,n),Ps(this,{emitter:t,filter:r})}async removeListener(){$e(this,I4)!=null&&await this.emitter.off(this.filter,$e(this,I4))}}I4=new WeakMap;function Zyt(e,t,n,r,s){Sn(!1,`invalid codepoint at offset ${t}; ${e}`,"bytes",n)}function xke(e,t,n,r,s){if(e==="BAD_PREFIX"||e==="UNEXPECTED_CONTINUE"){let a=0;for(let o=t+1;o<n.length&&n[o]>>6===2;o++)a++;return a}return e==="OVERRUN"?n.length-t-1:0}function Jyt(e,t,n,r,s){return e==="OVERLONG"?(Sn(typeof s=="number","invalid bad code point for replacement","badCodepoint",s),r.push(s),0):(r.push(65533),xke(e,t,n))}const e2t=Object.freeze({error:Zyt,ignore:xke,replace:Jyt});function t2t(e,t){t==null&&(t=e2t.error);const n=cs(e,"bytes"),r=[];let s=0;for(;s<n.length;){const a=n[s++];if(!(a>>7)){r.push(a);continue}let o=null,l=null;if((a&224)===192)o=1,l=127;else if((a&240)===224)o=2,l=2047;else if((a&248)===240)o=3,l=65535;else{(a&192)===128?s+=t("UNEXPECTED_CONTINUE",s-1,n,r):s+=t("BAD_PREFIX",s-1,n,r);continue}if(s-1+o>=n.length){s+=t("OVERRUN",s-1,n,r);continue}let c=a&(1<<8-o-1)-1;for(let u=0;u<o;u++){let d=n[s];if((d&192)!=128){s+=t("MISSING_CONTINUE",s,n,r),c=null;break}c=c<<6|d&63,s++}if(c!==null){if(c>1114111){s+=t("OUT_OF_RANGE",s-1-o,n,r,c);continue}if(c>=55296&&c<=57343){s+=t("UTF16_SURROGATE",s-1-o,n,r,c);continue}if(c<=l){s+=t("OVERLONG",s-1-o,n,r,c);continue}r.push(c)}}return r}function sd(e,t){Sn(typeof e=="string","invalid string value","str",e),t!=null&&(uke(t),e=e.normalize(t));let n=[];for(let r=0;r<e.length;r++){const s=e.charCodeAt(r);if(s<128)n.push(s);else if(s<2048)n.push(s>>6|192),n.push(s&63|128);else if((s&64512)==55296){r++;const a=e.charCodeAt(r);Sn(r<e.length&&(a&64512)===56320,"invalid surrogate pair","str",e);const o=65536+((s&1023)<<10)+(a&1023);n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(o&63|128)}else n.push(s>>12|224),n.push(s>>6&63|128),n.push(s&63|128)}return new Uint8Array(n)}function n2t(e){return e.map(t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10&1023)+55296,(t&1023)+56320))).join("")}function xM(e,t){return n2t(t2t(e,t))}function gke(e){async function t(n,r){Fr(r==null||!r.cancelled,"request cancelled before sending","CANCELLED");const s=n.url.split(":")[0].toLowerCase();Fr(s==="http"||s==="https",`unsupported protocol ${s}`,"UNSUPPORTED_OPERATION",{info:{protocol:s},operation:"request"}),Fr(s==="https"||!n.credentials||n.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let a=null;const o=new AbortController,l=setTimeout(()=>{a=So("request timeout","TIMEOUT"),o.abort()},n.timeout);r&&r.addListener(()=>{a=So("request cancelled","CANCELLED"),o.abort()});const c=Object.assign({},e,{method:n.method,headers:new Headers(Array.from(n)),body:n.body||void 0,signal:o.signal});let u;try{u=await fetch(n.url,c)}catch(g){throw clearTimeout(l),a||g}clearTimeout(l);const d={};u.headers.forEach((g,v)=>{d[v.toLowerCase()]=g});const f=await u.arrayBuffer(),x=f==null?null:new Uint8Array(f);return{statusCode:u.status,statusMessage:u.statusText,headers:d,body:x}}return t}const r2t=12,s2t=250;let Yme=gke();const i2t=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),a2t=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let IH=!1;async function bke(e,t){try{const n=e.match(i2t);if(!n)throw new Error("invalid data");return new wy(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?Xyt(n[3]):l2t(n[3]))}catch{return new wy(599,"BAD REQUEST (invalid data: URI)",{},null,new By(e))}}function yke(e){async function t(n,r){try{const s=n.match(a2t);if(!s)throw new Error("invalid link");return new By(`${e}${s[2]}`)}catch{return new wy(599,"BAD REQUEST (invalid IPFS URI)",{},null,new By(n))}}return t}const qI={data:bke,ipfs:yke("https://gateway.ipfs.io/ipfs/")},vke=new WeakMap;var xw,zb;class o2t{constructor(t){Ln(this,xw);Ln(this,zb);Ht(this,xw,[]),Ht(this,zb,!1),vke.set(t,()=>{if(!$e(this,zb)){Ht(this,zb,!0);for(const n of $e(this,xw))setTimeout(()=>{n()},0);Ht(this,xw,[])}})}addListener(t){Fr(!$e(this,zb),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),$e(this,xw).push(t)}get cancelled(){return $e(this,zb)}checkSignal(){Fr(!this.cancelled,"cancelled","CANCELLED",{})}}xw=new WeakMap,zb=new WeakMap;function GI(e){if(e==null)throw new Error("missing signal; should not happen");return e.checkSignal(),e}var P4,F4,Rp,fg,O4,M4,mc,Nf,hg,gw,bw,yw,n0,Lp,Hb,vw,hj;const cD=class cD{constructor(t){Ln(this,vw);Ln(this,P4);Ln(this,F4);Ln(this,Rp);Ln(this,fg);Ln(this,O4);Ln(this,M4);Ln(this,mc);Ln(this,Nf);Ln(this,hg);Ln(this,gw);Ln(this,bw);Ln(this,yw);Ln(this,n0);Ln(this,Lp);Ln(this,Hb);Ht(this,M4,String(t)),Ht(this,P4,!1),Ht(this,F4,!0),Ht(this,Rp,{}),Ht(this,fg,""),Ht(this,O4,3e5),Ht(this,Lp,{slotInterval:s2t,maxAttempts:r2t}),Ht(this,Hb,null)}get url(){return $e(this,M4)}set url(t){Ht(this,M4,String(t))}get body(){return $e(this,mc)==null?null:new Uint8Array($e(this,mc))}set body(t){if(t==null)Ht(this,mc,void 0),Ht(this,Nf,void 0);else if(typeof t=="string")Ht(this,mc,sd(t)),Ht(this,Nf,"text/plain");else if(t instanceof Uint8Array)Ht(this,mc,t),Ht(this,Nf,"application/octet-stream");else if(typeof t=="object")Ht(this,mc,sd(JSON.stringify(t))),Ht(this,Nf,"application/json");else throw new Error("invalid body")}hasBody(){return $e(this,mc)!=null}get method(){return $e(this,fg)?$e(this,fg):this.hasBody()?"POST":"GET"}set method(t){t==null&&(t=""),Ht(this,fg,String(t).toUpperCase())}get headers(){const t=Object.assign({},$e(this,Rp));return $e(this,hg)&&(t.authorization=`Basic ${Qyt(sd($e(this,hg)))}`),this.allowGzip&&(t["accept-encoding"]="gzip"),t["content-type"]==null&&$e(this,Nf)&&(t["content-type"]=$e(this,Nf)),this.body&&(t["content-length"]=String(this.body.length)),t}getHeader(t){return this.headers[t.toLowerCase()]}setHeader(t,n){$e(this,Rp)[String(t).toLowerCase()]=String(n)}clearHeaders(){Ht(this,Rp,{})}[Symbol.iterator](){const t=this.headers,n=Object.keys(t);let r=0;return{next:()=>{if(r<n.length){const s=n[r++];return{value:[s,t[s]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return $e(this,hg)||null}setCredentials(t,n){Sn(!t.match(/:/),"invalid basic authentication username","username","[REDACTED]"),Ht(this,hg,`${t}:${n}`)}get allowGzip(){return $e(this,F4)}set allowGzip(t){Ht(this,F4,!!t)}get allowInsecureAuthentication(){return!!$e(this,P4)}set allowInsecureAuthentication(t){Ht(this,P4,!!t)}get timeout(){return $e(this,O4)}set timeout(t){Sn(t>=0,"timeout must be non-zero","timeout",t),Ht(this,O4,t)}get preflightFunc(){return $e(this,gw)||null}set preflightFunc(t){Ht(this,gw,t)}get processFunc(){return $e(this,bw)||null}set processFunc(t){Ht(this,bw,t)}get retryFunc(){return $e(this,yw)||null}set retryFunc(t){Ht(this,yw,t)}get getUrlFunc(){return $e(this,Hb)||Yme}set getUrlFunc(t){Ht(this,Hb,t)}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${$e(this,mc)?Hr($e(this,mc)):"null"}>`}setThrottleParams(t){t.slotInterval!=null&&($e(this,Lp).slotInterval=t.slotInterval),t.maxAttempts!=null&&($e(this,Lp).maxAttempts=t.maxAttempts)}send(){return Fr($e(this,n0)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),Ht(this,n0,new o2t(this)),yr(this,vw,hj).call(this,0,Xme()+this.timeout,0,this,new wy(0,"",{},null,this))}cancel(){Fr($e(this,n0)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const t=vke.get(this);if(!t)throw new Error("missing signal; should not happen");t()}redirect(t){const n=this.url.split(":")[0].toLowerCase(),r=t.split(":")[0].toLowerCase();Fr(this.method==="GET"&&(n!=="https"||r!=="http")&&t.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(t)})`});const s=new cD(t);return s.method="GET",s.allowGzip=this.allowGzip,s.timeout=this.timeout,Ht(s,Rp,Object.assign({},$e(this,Rp))),$e(this,mc)&&Ht(s,mc,new Uint8Array($e(this,mc))),Ht(s,Nf,$e(this,Nf)),s}clone(){const t=new cD(this.url);return Ht(t,fg,$e(this,fg)),$e(this,mc)&&Ht(t,mc,$e(this,mc)),Ht(t,Nf,$e(this,Nf)),Ht(t,Rp,Object.assign({},$e(this,Rp))),Ht(t,hg,$e(this,hg)),this.allowGzip&&(t.allowGzip=!0),t.timeout=this.timeout,this.allowInsecureAuthentication&&(t.allowInsecureAuthentication=!0),Ht(t,gw,$e(this,gw)),Ht(t,bw,$e(this,bw)),Ht(t,yw,$e(this,yw)),Ht(t,Lp,Object.assign({},$e(this,Lp))),Ht(t,Hb,$e(this,Hb)),t}static lockConfig(){IH=!0}static getGateway(t){return qI[t.toLowerCase()]||null}static registerGateway(t,n){if(t=t.toLowerCase(),t==="http"||t==="https")throw new Error(`cannot intercept ${t}; use registerGetUrl`);if(IH)throw new Error("gateways locked");qI[t]=n}static registerGetUrl(t){if(IH)throw new Error("gateways locked");Yme=t}static createGetUrlFunc(t){return gke(t)}static createDataGateway(){return bke}static createIpfsGatewayFunc(t){return yke(t)}};P4=new WeakMap,F4=new WeakMap,Rp=new WeakMap,fg=new WeakMap,O4=new WeakMap,M4=new WeakMap,mc=new WeakMap,Nf=new WeakMap,hg=new WeakMap,gw=new WeakMap,bw=new WeakMap,yw=new WeakMap,n0=new WeakMap,Lp=new WeakMap,Hb=new WeakMap,vw=new WeakSet,hj=async function(t,n,r,s,a){var d,f,x;if(t>=$e(this,Lp).maxAttempts)return a.makeServerError("exceeded maximum retry limit");Fr(Xme()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:s}),r>0&&await c2t(r);let o=this.clone();const l=(o.url.split(":")[0]||"").toLowerCase();if(l in qI){const g=await qI[l](o.url,GI($e(s,n0)));if(g instanceof wy){let v=g;if(this.processFunc){GI($e(s,n0));try{v=await this.processFunc(o,v)}catch(w){(w.throttle==null||typeof w.stall!="number")&&v.makeServerError("error in post-processing function",w).assertOk()}}return v}o=g}this.preflightFunc&&(o=await this.preflightFunc(o));const c=await this.getUrlFunc(o,GI($e(s,n0)));let u=new wy(c.statusCode,c.statusMessage,c.headers,c.body,s);if(u.statusCode===301||u.statusCode===302){try{const g=u.headers.location||"";return yr(d=o.redirect(g),vw,hj).call(d,t+1,n,0,s,u)}catch{}return u}else if(u.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,u,t))){const g=u.headers["retry-after"];let v=$e(this,Lp).slotInterval*Math.trunc(Math.random()*Math.pow(2,t));return typeof g=="string"&&g.match(/^[1-9][0-9]*$/)&&(v=parseInt(g)),yr(f=o.clone(),vw,hj).call(f,t+1,n,v,s,u)}if(this.processFunc){GI($e(s,n0));try{u=await this.processFunc(o,u)}catch(g){(g.throttle==null||typeof g.stall!="number")&&u.makeServerError("error in post-processing function",g).assertOk();let v=$e(this,Lp).slotInterval*Math.trunc(Math.random()*Math.pow(2,t));return g.stall>=0&&(v=g.stall),yr(x=o.clone(),vw,hj).call(x,t+1,n,v,s,u)}}return u};let By=cD;var Q_,Z_,J_,Af,R4,ww;const Vue=class Vue{constructor(t,n,r,s,a){Ln(this,Q_);Ln(this,Z_);Ln(this,J_);Ln(this,Af);Ln(this,R4);Ln(this,ww);Ht(this,Q_,t),Ht(this,Z_,n),Ht(this,J_,Object.keys(r).reduce((o,l)=>(o[l.toLowerCase()]=String(r[l]),o),{})),Ht(this,Af,s==null?null:new Uint8Array(s)),Ht(this,R4,a||null),Ht(this,ww,{message:""})}toString(){return`<FetchResponse status=${this.statusCode} body=${$e(this,Af)?Hr($e(this,Af)):"null"}>`}get statusCode(){return $e(this,Q_)}get statusMessage(){return $e(this,Z_)}get headers(){return Object.assign({},$e(this,J_))}get body(){return $e(this,Af)==null?null:new Uint8Array($e(this,Af))}get bodyText(){try{return $e(this,Af)==null?"":xM($e(this,Af))}catch{Fr(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{Fr(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const t=this.headers,n=Object.keys(t);let r=0;return{next:()=>{if(r<n.length){const s=n[r++];return{value:[s,t[s]],done:!1}}return{value:void 0,done:!0}}}}makeServerError(t,n){let r;t?r=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${t})`:(t=`${this.statusCode} ${this.statusMessage}`,r=`CLIENT ESCALATED SERVER ERROR (${t})`);const s=new Vue(599,r,this.headers,this.body,$e(this,R4)||void 0);return Ht(s,ww,{message:t,error:n}),s}throwThrottleError(t,n){n==null?n=-1:Sn(Number.isInteger(n)&&n>=0,"invalid stall timeout","stall",n);const r=new Error(t||"throttling requests");throw Ps(r,{stall:n,throttle:!0}),r}getHeader(t){return this.headers[t.toLowerCase()]}hasBody(){return $e(this,Af)!=null}get request(){return $e(this,R4)}ok(){return $e(this,ww).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:t,error:n}=$e(this,ww);t===""&&(t=`server response ${this.statusCode} ${this.statusMessage}`);let r=null;this.request&&(r=this.request.url);let s=null;try{$e(this,Af)&&(s=xM($e(this,Af)))}catch{}Fr(!1,t,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:n,info:{requestUrl:r,responseBody:s,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}};Q_=new WeakMap,Z_=new WeakMap,J_=new WeakMap,Af=new WeakMap,R4=new WeakMap,ww=new WeakMap;let wy=Vue;function Xme(){return new Date().getTime()}function l2t(e){return sd(e.replace(/%([0-9a-f][0-9a-f])/gi,(t,n)=>String.fromCharCode(parseInt(n,16))))}function c2t(e){return new Promise(t=>setTimeout(t,e))}function u2t(e){let t=e.toString(16);for(;t.length<2;)t="0"+t;return"0x"+t}function Qme(e,t,n){let r=0;for(let s=0;s<n;s++)r=r*256+e[t+s];return r}function Zme(e,t,n,r){const s=[];for(;n<t+1+r;){const a=wke(e,n);s.push(a.result),n+=a.consumed,Fr(n<=t+1+r,"child data too short","BUFFER_OVERRUN",{buffer:e,length:r,offset:t})}return{consumed:1+r,result:s}}function wke(e,t){Fr(e.length!==0,"data too short","BUFFER_OVERRUN",{buffer:e,length:0,offset:1});const n=r=>{Fr(r<=e.length,"data short segment too short","BUFFER_OVERRUN",{buffer:e,length:e.length,offset:r})};if(e[t]>=248){const r=e[t]-247;n(t+1+r);const s=Qme(e,t+1,r);return n(t+1+r+s),Zme(e,t,t+1+r,r+s)}else if(e[t]>=192){const r=e[t]-192;return n(t+1+r),Zme(e,t,t+1,r)}else if(e[t]>=184){const r=e[t]-183;n(t+1+r);const s=Qme(e,t+1,r);n(t+1+r+s);const a=Hr(e.slice(t+1+r,t+1+r+s));return{consumed:1+r+s,result:a}}else if(e[t]>=128){const r=e[t]-128;n(t+1+r);const s=Hr(e.slice(t+1,t+1+r));return{consumed:1+r,result:s}}return{consumed:1,result:u2t(e[t])}}function Dk(e){const t=cs(e,"data"),n=wke(t,0);return Sn(n.consumed===t.length,"unexpected junk after rlp payload","data",e),n.result}function Jme(e){const t=[];for(;e;)t.unshift(e&255),e>>=8;return t}function Cke(e){if(Array.isArray(e)){let r=[];if(e.forEach(function(a){r=r.concat(Cke(a))}),r.length<=55)return r.unshift(192+r.length),r;const s=Jme(r.length);return s.unshift(247+s.length),s.concat(r)}const t=Array.prototype.slice.call(cs(e,"object"));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const n=Jme(t.length);return n.unshift(183+n.length),n.concat(t)}const e0e="0123456789abcdef";function n1(e){let t="0x";for(const n of Cke(e))t+=e0e[n>>4],t+=e0e[n&15];return t}function d2t(e){const t=cs(e,"randomBytes");t[6]=t[6]&15|64,t[8]=t[8]&63|128;const n=Hr(t);return[n.substring(2,10),n.substring(10,14),n.substring(14,18),n.substring(18,22),n.substring(22,34)].join("-")}const Ju=32,vJ=new Uint8Array(Ju),f2t=["then"],KI={},Ske=new WeakMap;function Pv(e){return Ske.get(e)}function t0e(e,t){Ske.set(e,t)}function w7(e,t){const n=new Error(`deferred error during ABI decoding triggered accessing ${e}`);throw n.error=t,n}function wJ(e,t,n){return e.indexOf(null)>=0?t.map((r,s)=>r instanceof gM?wJ(Pv(r),r,n):r):e.reduce((r,s,a)=>{let o=t.getValue(s);return s in r||(n&&o instanceof gM&&(o=wJ(Pv(o),o,n)),r[s]=o),r},{})}var L4,Mg;let gM=(Mg=class extends Array{constructor(...n){const r=n[0];let s=n[1],a=(n[2]||[]).slice(),o=!0;r!==KI&&(s=n,a=[],o=!1);super(s.length);Ln(this,L4);s.forEach((u,d)=>{this[d]=u});const l=a.reduce((u,d)=>(typeof d=="string"&&u.set(d,(u.get(d)||0)+1),u),new Map);if(t0e(this,Object.freeze(s.map((u,d)=>{const f=a[d];return f!=null&&l.get(f)===1?f:null}))),Ht(this,L4,[]),$e(this,L4)==null&&$e(this,L4),!o)return;Object.freeze(this);const c=new Proxy(this,{get:(u,d,f)=>{if(typeof d=="string"){if(d.match(/^[0-9]+$/)){const g=Mi(d,"%index");if(g<0||g>=this.length)throw new RangeError("out of result range");const v=u[g];return v instanceof Error&&w7(`index ${g}`,v),v}if(f2t.indexOf(d)>=0)return Reflect.get(u,d,f);const x=u[d];if(x instanceof Function)return function(...g){return x.apply(this===f?u:this,g)};if(!(d in u))return u.getValue.apply(this===f?u:this,[d])}return Reflect.get(u,d,f)}});return t0e(c,Pv(this)),c}toArray(n){const r=[];return this.forEach((s,a)=>{s instanceof Error&&w7(`index ${a}`,s),n&&s instanceof Mg&&(s=s.toArray(n)),r.push(s)}),r}toObject(n){const r=Pv(this);return r.reduce((s,a,o)=>(Fr(a!=null,`value at index ${o} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),wJ(r,this,n)),{})}slice(n,r){n==null&&(n=0),n<0&&(n+=this.length,n<0&&(n=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const s=Pv(this),a=[],o=[];for(let l=n;l<r;l++)a.push(this[l]),o.push(s[l]);return new Mg(KI,a,o)}filter(n,r){const s=Pv(this),a=[],o=[];for(let l=0;l<this.length;l++){const c=this[l];c instanceof Error&&w7(`index ${l}`,c),n.call(r,c,l,this)&&(a.push(c),o.push(s[l]))}return new Mg(KI,a,o)}map(n,r){const s=[];for(let a=0;a<this.length;a++){const o=this[a];o instanceof Error&&w7(`index ${a}`,o),s.push(n.call(r,o,a,this))}return s}getValue(n){const r=Pv(this).indexOf(n);if(r===-1)return;const s=this[r];return s instanceof Error&&w7(`property ${JSON.stringify(n)}`,s.error),s}static fromItems(n,r){return new Mg(KI,n,r)}},L4=new WeakMap,Mg);function n0e(e){let t=tl(e);return Fr(t.length<=Ju,"value out-of-bounds","BUFFER_OVERRUN",{buffer:t,length:Ju,offset:t.length}),t.length!==Ju&&(t=Yc(Pa([vJ.slice(t.length%Ju),t]))),t}class b1{constructor(t,n,r,s){Un(this,"name");Un(this,"type");Un(this,"localName");Un(this,"dynamic");Ps(this,{name:t,type:n,localName:r,dynamic:s},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(t,n){Sn(!1,t,this.localName,n)}}var pg,Cw,D4,qF;class CJ{constructor(){Ln(this,D4);Ln(this,pg);Ln(this,Cw);Ht(this,pg,[]),Ht(this,Cw,0)}get data(){return Pa($e(this,pg))}get length(){return $e(this,Cw)}appendWriter(t){return yr(this,D4,qF).call(this,Yc(t.data))}writeBytes(t){let n=Yc(t);const r=n.length%Ju;return r&&(n=Yc(Pa([n,vJ.slice(r)]))),yr(this,D4,qF).call(this,n)}writeValue(t){return yr(this,D4,qF).call(this,n0e(t))}writeUpdatableValue(){const t=$e(this,pg).length;return $e(this,pg).push(vJ),Ht(this,Cw,$e(this,Cw)+Ju),n=>{$e(this,pg)[t]=n0e(n)}}}pg=new WeakMap,Cw=new WeakMap,D4=new WeakSet,qF=function(t){return $e(this,pg).push(t),Ht(this,Cw,$e(this,Cw)+t.length),t.length};var Pd,jf,Sw,Nw,Vb,Q3,NJ,Nke;const Wue=class Wue{constructor(t,n,r){Ln(this,Q3);Un(this,"allowLoose");Ln(this,Pd);Ln(this,jf);Ln(this,Sw);Ln(this,Nw);Ln(this,Vb);Ps(this,{allowLoose:!!n}),Ht(this,Pd,Yc(t)),Ht(this,Sw,0),Ht(this,Nw,null),Ht(this,Vb,r??1024),Ht(this,jf,0)}get data(){return Hr($e(this,Pd))}get dataLength(){return $e(this,Pd).length}get consumed(){return $e(this,jf)}get bytes(){return new Uint8Array($e(this,Pd))}subReader(t){const n=new Wue($e(this,Pd).slice($e(this,jf)+t),this.allowLoose,$e(this,Vb));return Ht(n,Nw,this),n}readBytes(t,n){let r=yr(this,Q3,Nke).call(this,0,t,!!n);return yr(this,Q3,NJ).call(this,t),Ht(this,jf,$e(this,jf)+r.length),r.slice(0,t)}readValue(){return PB(this.readBytes(Ju))}readIndex(){return qyt(this.readBytes(Ju))}};Pd=new WeakMap,jf=new WeakMap,Sw=new WeakMap,Nw=new WeakMap,Vb=new WeakMap,Q3=new WeakSet,NJ=function(t){var n;if($e(this,Nw))return yr(n=$e(this,Nw),Q3,NJ).call(n,t);Ht(this,Sw,$e(this,Sw)+t),Fr($e(this,Vb)<1||$e(this,Sw)<=$e(this,Vb)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${$e(this,Vb)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Yc($e(this,Pd)),offset:$e(this,jf),length:t,info:{bytesRead:$e(this,Sw),dataLength:this.dataLength}})},Nke=function(t,n,r){let s=Math.ceil(n/Ju)*Ju;return $e(this,jf)+s>$e(this,Pd).length&&(this.allowLoose&&r&&$e(this,jf)+n<=$e(this,Pd).length?s=n:Fr(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Yc($e(this,Pd)),length:$e(this,Pd).length,offset:$e(this,jf)+s})),$e(this,Pd).slice($e(this,jf),$e(this,jf)+s)};let SJ=Wue;function Tf(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function sae(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Ake(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Tf(e.outputLen),Tf(e.blockLen)}function OS(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 jke(e,t){sae(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const PH=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Eke=e=>e instanceof Uint8Array,GF=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),KF=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Vm=(e,t)=>e<<32-t|e>>>t,h2t=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!h2t)throw new Error("Non little-endian hardware is not supported");const p2t=async()=>{};async function r0e(e,t,n){let r=Date.now();for(let s=0;s<e;s++){n(s);const a=Date.now()-r;a>=0&&a<t||(await p2t(),r+=a)}}function m2t(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function MS(e){if(typeof e=="string"&&(e=m2t(e)),!Eke(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function x2t(...e){const t=new Uint8Array(e.reduce((r,s)=>r+s.length,0));let n=0;return e.forEach(r=>{if(!Eke(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}let iae=class{clone(){return this._cloneInto()}};const g2t={}.toString;function _ke(e,t){if(t!==void 0&&g2t.call(t)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(e,t)}function FB(e){const t=r=>e().update(MS(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function b2t(e=32){if(PH&&typeof PH.getRandomValues=="function")return PH.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}let kke=class extends iae{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,Ake(t);const r=MS(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,a=new Uint8Array(s);a.set(r.length>s?t.create().update(r).digest():r);for(let o=0;o<a.length;o++)a[o]^=54;this.iHash.update(a),this.oHash=t.create();for(let o=0;o<a.length;o++)a[o]^=106;this.oHash.update(a),a.fill(0)}update(t){return OS(this),this.iHash.update(t),this}digestInto(t){OS(this),sae(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:a,blockLen:o,outputLen:l}=this;return t=t,t.finished=s,t.destroyed=a,t.blockLen=o,t.outputLen=l,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const OB=(e,t,n)=>new kke(e,t).update(n).digest();OB.create=(e,t)=>new kke(e,t);function y2t(e,t,n,r){Ake(e);const s=_ke({dkLen:32,asyncTick:10},r),{c:a,dkLen:o,asyncTick:l}=s;if(Tf(a),Tf(o),Tf(l),a<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const c=MS(t),u=MS(n),d=new Uint8Array(o),f=OB.create(e,c),x=f._cloneInto().update(u);return{c:a,dkLen:o,asyncTick:l,DK:d,PRF:f,PRFSalt:x}}function v2t(e,t,n,r,s){return e.destroy(),t.destroy(),r&&r.destroy(),s.fill(0),n}function aae(e,t,n,r){const{c:s,dkLen:a,DK:o,PRF:l,PRFSalt:c}=y2t(e,t,n,r);let u;const d=new Uint8Array(4),f=KF(d),x=new Uint8Array(l.outputLen);for(let g=1,v=0;v<a;g++,v+=l.outputLen){const w=o.subarray(v,v+l.outputLen);f.setInt32(0,g,!1),(u=c._cloneInto(u)).update(d).digestInto(x),w.set(x.subarray(0,w.length));for(let C=1;C<s;C++){l._cloneInto(u).update(x).digestInto(x);for(let N=0;N<w.length;N++)w[N]^=x[N]}}return v2t(l,c,o,u,x)}function w2t(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),a=BigInt(4294967295),o=Number(n>>s&a),l=Number(n&a),c=r?4:0,u=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+u,l,r)}class oae extends iae{constructor(t,n,r,s){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=KF(this.buffer)}update(t){OS(this);const{view:n,buffer:r,blockLen:s}=this;t=MS(t);const a=t.length;for(let o=0;o<a;){const l=Math.min(s-this.pos,a-o);if(l===s){const c=KF(t);for(;s<=a-o;o+=s)this.process(c,o);continue}r.set(t.subarray(o,o+l),this.pos),this.pos+=l,o+=l,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){OS(this),jke(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:a}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let f=o;f<s;f++)n[f]=0;w2t(r,s-8,BigInt(this.length*8),a),this.process(r,0);const l=KF(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)l.setUint32(4*f,d[f],a)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:a,destroyed:o,pos:l}=this;return t.length=s,t.pos=l,t.finished=a,t.destroyed=o,s%n&&t.buffer.set(r),t}}const C2t=(e,t,n)=>e&t^~e&n,S2t=(e,t,n)=>e&t^e&n^t&n,N2t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),rb=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),sb=new Uint32Array(64);let A2t=class extends oae{constructor(){super(64,32,8,!1),this.A=rb[0]|0,this.B=rb[1]|0,this.C=rb[2]|0,this.D=rb[3]|0,this.E=rb[4]|0,this.F=rb[5]|0,this.G=rb[6]|0,this.H=rb[7]|0}get(){const{A:t,B:n,C:r,D:s,E:a,F:o,G:l,H:c}=this;return[t,n,r,s,a,o,l,c]}set(t,n,r,s,a,o,l,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=a|0,this.F=o|0,this.G=l|0,this.H=c|0}process(t,n){for(let f=0;f<16;f++,n+=4)sb[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const x=sb[f-15],g=sb[f-2],v=Vm(x,7)^Vm(x,18)^x>>>3,w=Vm(g,17)^Vm(g,19)^g>>>10;sb[f]=w+sb[f-7]+v+sb[f-16]|0}let{A:r,B:s,C:a,D:o,E:l,F:c,G:u,H:d}=this;for(let f=0;f<64;f++){const x=Vm(l,6)^Vm(l,11)^Vm(l,25),g=d+x+C2t(l,c,u)+N2t[f]+sb[f]|0,w=(Vm(r,2)^Vm(r,13)^Vm(r,22))+S2t(r,s,a)|0;d=u,u=c,c=l,l=o+g|0,o=a,a=s,s=r,r=g+w|0}r=r+this.A|0,s=s+this.B|0,a=a+this.C|0,o=o+this.D|0,l=l+this.E|0,c=c+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(r,s,a,o,l,c,u,d)}roundClean(){sb.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const EA=FB(()=>new A2t),YI=BigInt(2**32-1),AJ=BigInt(32);function Tke(e,t=!1){return t?{h:Number(e&YI),l:Number(e>>AJ&YI)}:{h:Number(e>>AJ&YI)|0,l:Number(e&YI)|0}}function Ike(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:a,l:o}=Tke(e[s],t);[n[s],r[s]]=[a,o]}return[n,r]}const j2t=(e,t)=>BigInt(e>>>0)<<AJ|BigInt(t>>>0),E2t=(e,t,n)=>e>>>n,_2t=(e,t,n)=>e<<32-n|t>>>n,k2t=(e,t,n)=>e>>>n|t<<32-n,T2t=(e,t,n)=>e<<32-n|t>>>n,I2t=(e,t,n)=>e<<64-n|t>>>n-32,P2t=(e,t,n)=>e>>>n-32|t<<64-n,F2t=(e,t)=>t,O2t=(e,t)=>e,Pke=(e,t,n)=>e<<n|t>>>32-n,Fke=(e,t,n)=>t<<n|e>>>32-n,Oke=(e,t,n)=>t<<n-32|e>>>64-n,Mke=(e,t,n)=>e<<n-32|t>>>64-n;function M2t(e,t,n,r){const s=(t>>>0)+(r>>>0);return{h:e+n+(s/2**32|0)|0,l:s|0}}const R2t=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),L2t=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,D2t=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),B2t=(e,t,n,r,s)=>t+n+r+s+(e/2**32|0)|0,$2t=(e,t,n,r,s)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(s>>>0),U2t=(e,t,n,r,s,a)=>t+n+r+s+a+(e/2**32|0)|0,Fi={fromBig:Tke,split:Ike,toBig:j2t,shrSH:E2t,shrSL:_2t,rotrSH:k2t,rotrSL:T2t,rotrBH:I2t,rotrBL:P2t,rotr32H:F2t,rotr32L:O2t,rotlSH:Pke,rotlSL:Fke,rotlBH:Oke,rotlBL:Mke,add:M2t,add3L:R2t,add3H:L2t,add4L:D2t,add4H:B2t,add5H:U2t,add5L:$2t},[z2t,H2t]=Fi.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),ib=new Uint32Array(80),ab=new Uint32Array(80);class V2t extends oae{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:n,Bh:r,Bl:s,Ch:a,Cl:o,Dh:l,Dl:c,Eh:u,El:d,Fh:f,Fl:x,Gh:g,Gl:v,Hh:w,Hl:C}=this;return[t,n,r,s,a,o,l,c,u,d,f,x,g,v,w,C]}set(t,n,r,s,a,o,l,c,u,d,f,x,g,v,w,C){this.Ah=t|0,this.Al=n|0,this.Bh=r|0,this.Bl=s|0,this.Ch=a|0,this.Cl=o|0,this.Dh=l|0,this.Dl=c|0,this.Eh=u|0,this.El=d|0,this.Fh=f|0,this.Fl=x|0,this.Gh=g|0,this.Gl=v|0,this.Hh=w|0,this.Hl=C|0}process(t,n){for(let P=0;P<16;P++,n+=4)ib[P]=t.getUint32(n),ab[P]=t.getUint32(n+=4);for(let P=16;P<80;P++){const R=ib[P-15]|0,F=ab[P-15]|0,U=Fi.rotrSH(R,F,1)^Fi.rotrSH(R,F,8)^Fi.shrSH(R,F,7),L=Fi.rotrSL(R,F,1)^Fi.rotrSL(R,F,8)^Fi.shrSL(R,F,7),z=ib[P-2]|0,X=ab[P-2]|0,ne=Fi.rotrSH(z,X,19)^Fi.rotrBH(z,X,61)^Fi.shrSH(z,X,6),J=Fi.rotrSL(z,X,19)^Fi.rotrBL(z,X,61)^Fi.shrSL(z,X,6),Z=Fi.add4L(L,J,ab[P-7],ab[P-16]),re=Fi.add4H(Z,U,ne,ib[P-7],ib[P-16]);ib[P]=re|0,ab[P]=Z|0}let{Ah:r,Al:s,Bh:a,Bl:o,Ch:l,Cl:c,Dh:u,Dl:d,Eh:f,El:x,Fh:g,Fl:v,Gh:w,Gl:C,Hh:N,Hl:I}=this;for(let P=0;P<80;P++){const R=Fi.rotrSH(f,x,14)^Fi.rotrSH(f,x,18)^Fi.rotrBH(f,x,41),F=Fi.rotrSL(f,x,14)^Fi.rotrSL(f,x,18)^Fi.rotrBL(f,x,41),U=f&g^~f&w,L=x&v^~x&C,z=Fi.add5L(I,F,L,H2t[P],ab[P]),X=Fi.add5H(z,N,R,U,z2t[P],ib[P]),ne=z|0,J=Fi.rotrSH(r,s,28)^Fi.rotrBH(r,s,34)^Fi.rotrBH(r,s,39),Z=Fi.rotrSL(r,s,28)^Fi.rotrBL(r,s,34)^Fi.rotrBL(r,s,39),re=r&a^r&l^a&l,he=s&o^s&c^o&c;N=w|0,I=C|0,w=g|0,C=v|0,g=f|0,v=x|0,{h:f,l:x}=Fi.add(u|0,d|0,X|0,ne|0),u=l|0,d=c|0,l=a|0,c=o|0,a=r|0,o=s|0;const Y=Fi.add3L(ne,Z,he);r=Fi.add3H(Y,X,J,re),s=Y|0}({h:r,l:s}=Fi.add(this.Ah|0,this.Al|0,r|0,s|0)),{h:a,l:o}=Fi.add(this.Bh|0,this.Bl|0,a|0,o|0),{h:l,l:c}=Fi.add(this.Ch|0,this.Cl|0,l|0,c|0),{h:u,l:d}=Fi.add(this.Dh|0,this.Dl|0,u|0,d|0),{h:f,l:x}=Fi.add(this.Eh|0,this.El|0,f|0,x|0),{h:g,l:v}=Fi.add(this.Fh|0,this.Fl|0,g|0,v|0),{h:w,l:C}=Fi.add(this.Gh|0,this.Gl|0,w|0,C|0),{h:N,l:I}=Fi.add(this.Hh|0,this.Hl|0,N|0,I|0),this.set(r,s,a,o,l,c,u,d,f,x,g,v,w,C,N,I)}roundClean(){ib.fill(0),ab.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const lae=FB(()=>new V2t);function W2t(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const s0e=W2t(),i0e=s0e.crypto||s0e.msCrypto;function q2t(e){switch(e){case"sha256":return EA.create();case"sha512":return lae.create()}Sn(!1,"invalid hashing algorithm name","algorithm",e)}function G2t(e,t){const n={sha256:EA,sha512:lae}[e];return Sn(n!=null,"invalid hmac algorithm","algorithm",e),OB.create(n,t)}function K2t(e,t,n,r,s){const a={sha256:EA,sha512:lae}[s];return Sn(a!=null,"invalid pbkdf2 algorithm","algorithm",s),aae(a,e,t,{c:n,dkLen:r})}function Y2t(e){Fr(i0e!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),Sn(Number.isInteger(e)&&e>0&&e<=1024,"invalid length","length",e);const t=new Uint8Array(e);return i0e.getRandomValues(t),t}let Rke=!1;const Lke=function(e,t,n){return G2t(e,t).update(n).digest()};let Dke=Lke;function _A(e,t,n){const r=cs(t,"key"),s=cs(n,"data");return Hr(Dke(e,r,s))}_A._=Lke;_A.lock=function(){Rke=!0};_A.register=function(e){if(Rke)throw new Error("computeHmac is locked");Dke=e};Object.freeze(_A);const[Bke,$ke,Uke]=[[],[],[]],X2t=BigInt(0),C7=BigInt(1),Q2t=BigInt(2),Z2t=BigInt(7),J2t=BigInt(256),evt=BigInt(113);for(let e=0,t=C7,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Bke.push(2*(5*r+n)),$ke.push((e+1)*(e+2)/2%64);let s=X2t;for(let a=0;a<7;a++)t=(t<<C7^(t>>Z2t)*evt)%J2t,t&Q2t&&(s^=C7<<(C7<<BigInt(a))-C7);Uke.push(s)}const[tvt,nvt]=Ike(Uke,!0),a0e=(e,t,n)=>n>32?Oke(e,t,n):Pke(e,t,n),o0e=(e,t,n)=>n>32?Mke(e,t,n):Fke(e,t,n);function rvt(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const l=(o+8)%10,c=(o+2)%10,u=n[c],d=n[c+1],f=a0e(u,d,1)^n[l],x=o0e(u,d,1)^n[l+1];for(let g=0;g<50;g+=10)e[o+g]^=f,e[o+g+1]^=x}let s=e[2],a=e[3];for(let o=0;o<24;o++){const l=$ke[o],c=a0e(s,a,l),u=o0e(s,a,l),d=Bke[o];s=e[d],a=e[d+1],e[d]=c,e[d+1]=u}for(let o=0;o<50;o+=10){for(let l=0;l<10;l++)n[l]=e[o+l];for(let l=0;l<10;l++)e[o+l]^=~n[(l+2)%10]&n[(l+4)%10]}e[0]^=tvt[r],e[1]^=nvt[r]}n.fill(0)}let svt=class zke extends iae{constructor(t,n,r,s=!1,a=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Tf(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=GF(this.state)}keccak(){rvt(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){OS(this);const{blockLen:n,state:r}=this;t=MS(t);const s=t.length;for(let a=0;a<s;){const o=Math.min(n-this.pos,s-a);for(let l=0;l<o;l++)r[this.pos++]^=t[a++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){OS(this,!1),sae(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,a=t.length;s<a;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,a-s);t.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Tf(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(jke(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:a,enableXOF:o}=this;return t||(t=new zke(n,r,s,o,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=s,t.enableXOF=o,t.destroyed=this.destroyed,t}};const ivt=(e,t,n)=>FB(()=>new svt(t,e,n)),avt=ivt(1,136,256/8);let Hke=!1;const Vke=function(e){return avt(e)};let Wke=Vke;function io(e){const t=cs(e,"data");return Hr(Wke(t))}io._=Vke;io.lock=function(){Hke=!0};io.register=function(e){if(Hke)throw new TypeError("keccak256 is locked");Wke=e};Object.freeze(io);const ovt=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),qke=Uint8Array.from({length:16},(e,t)=>t),lvt=qke.map(e=>(9*e+5)%16);let cae=[qke],uae=[lvt];for(let e=0;e<4;e++)for(let t of[cae,uae])t.push(t[e].map(n=>ovt[n]));const Gke=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>new Uint8Array(e)),cvt=cae.map((e,t)=>e.map(n=>Gke[t][n])),uvt=uae.map((e,t)=>e.map(n=>Gke[t][n])),dvt=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),fvt=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),XI=(e,t)=>e<<t|e>>>32-t;function l0e(e,t,n,r){return e===0?t^n^r:e===1?t&n|~t&r:e===2?(t|~n)^r:e===3?t&r|n&~r:t^(n|~r)}const QI=new Uint32Array(16);class hvt extends oae{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:t,h1:n,h2:r,h3:s,h4:a}=this;return[t,n,r,s,a]}set(t,n,r,s,a){this.h0=t|0,this.h1=n|0,this.h2=r|0,this.h3=s|0,this.h4=a|0}process(t,n){for(let g=0;g<16;g++,n+=4)QI[g]=t.getUint32(n,!0);let r=this.h0|0,s=r,a=this.h1|0,o=a,l=this.h2|0,c=l,u=this.h3|0,d=u,f=this.h4|0,x=f;for(let g=0;g<5;g++){const v=4-g,w=dvt[g],C=fvt[g],N=cae[g],I=uae[g],P=cvt[g],R=uvt[g];for(let F=0;F<16;F++){const U=XI(r+l0e(g,a,l,u)+QI[N[F]]+w,P[F])+f|0;r=f,f=u,u=XI(l,10)|0,l=a,a=U}for(let F=0;F<16;F++){const U=XI(s+l0e(v,o,c,d)+QI[I[F]]+C,R[F])+x|0;s=x,x=d,d=XI(c,10)|0,c=o,o=U}}this.set(this.h1+l+d|0,this.h2+u+x|0,this.h3+f+s|0,this.h4+r+o|0,this.h0+a+c|0)}roundClean(){QI.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const pvt=FB(()=>new hvt);let Kke=!1;const Yke=function(e){return pvt(e)};let Xke=Yke;function kA(e){const t=cs(e,"data");return Hr(Xke(t))}kA._=Yke;kA.lock=function(){Kke=!0};kA.register=function(e){if(Kke)throw new TypeError("ripemd160 is locked");Xke=e};Object.freeze(kA);let Qke=!1;const Zke=function(e,t,n,r,s){return K2t(e,t,n,r,s)};let Jke=Zke;function n2(e,t,n,r,s){const a=cs(e,"password"),o=cs(t,"salt");return Hr(Jke(a,o,n,r,s))}n2._=Zke;n2.lock=function(){Qke=!0};n2.register=function(e){if(Qke)throw new Error("pbkdf2 is locked");Jke=e};Object.freeze(n2);let eTe=!1;const tTe=function(e){return new Uint8Array(Y2t(e))};let nTe=tTe;function Bg(e){return nTe(e)}Bg._=tTe;Bg.lock=function(){eTe=!0};Bg.register=function(e){if(eTe)throw new Error("randomBytes is locked");nTe=e};Object.freeze(Bg);const fa=(e,t)=>e<<t|e>>>32-t;function c0e(e,t,n,r,s,a){let o=e[t++]^n[r++],l=e[t++]^n[r++],c=e[t++]^n[r++],u=e[t++]^n[r++],d=e[t++]^n[r++],f=e[t++]^n[r++],x=e[t++]^n[r++],g=e[t++]^n[r++],v=e[t++]^n[r++],w=e[t++]^n[r++],C=e[t++]^n[r++],N=e[t++]^n[r++],I=e[t++]^n[r++],P=e[t++]^n[r++],R=e[t++]^n[r++],F=e[t++]^n[r++],U=o,L=l,z=c,X=u,ne=d,J=f,Z=x,re=g,he=v,Y=w,ie=C,oe=N,G=I,V=P,ee=R,ae=F;for(let fe=0;fe<8;fe+=2)ne^=fa(U+G|0,7),he^=fa(ne+U|0,9),G^=fa(he+ne|0,13),U^=fa(G+he|0,18),Y^=fa(J+L|0,7),V^=fa(Y+J|0,9),L^=fa(V+Y|0,13),J^=fa(L+V|0,18),ee^=fa(ie+Z|0,7),z^=fa(ee+ie|0,9),Z^=fa(z+ee|0,13),ie^=fa(Z+z|0,18),X^=fa(ae+oe|0,7),re^=fa(X+ae|0,9),oe^=fa(re+X|0,13),ae^=fa(oe+re|0,18),L^=fa(U+X|0,7),z^=fa(L+U|0,9),X^=fa(z+L|0,13),U^=fa(X+z|0,18),Z^=fa(J+ne|0,7),re^=fa(Z+J|0,9),ne^=fa(re+Z|0,13),J^=fa(ne+re|0,18),oe^=fa(ie+Y|0,7),he^=fa(oe+ie|0,9),Y^=fa(he+oe|0,13),ie^=fa(Y+he|0,18),G^=fa(ae+ee|0,7),V^=fa(G+ae|0,9),ee^=fa(V+G|0,13),ae^=fa(ee+V|0,18);s[a++]=o+U|0,s[a++]=l+L|0,s[a++]=c+z|0,s[a++]=u+X|0,s[a++]=d+ne|0,s[a++]=f+J|0,s[a++]=x+Z|0,s[a++]=g+re|0,s[a++]=v+he|0,s[a++]=w+Y|0,s[a++]=C+ie|0,s[a++]=N+oe|0,s[a++]=I+G|0,s[a++]=P+V|0,s[a++]=R+ee|0,s[a++]=F+ae|0}function t4(e,t,n,r,s){let a=r+0,o=r+16*s;for(let l=0;l<16;l++)n[o+l]=e[t+(2*s-1)*16+l];for(let l=0;l<s;l++,a+=16,t+=16)c0e(n,o,e,t,n,a),l>0&&(o+=16),c0e(n,a,e,t+=16,n,o)}function rTe(e,t,n){const r=_ke({dkLen:32,asyncTick:10,maxmem:1073742848},n),{N:s,r:a,p:o,dkLen:l,asyncTick:c,maxmem:u,onProgress:d}=r;if(Tf(s),Tf(a),Tf(o),Tf(l),Tf(c),Tf(u),d!==void 0&&typeof d!="function")throw new Error("progressCb should be function");const f=128*a,x=f/4;if(s<=1||s&s-1||s>=2**(f/8)||s>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(o<0||o>(2**32-1)*32/f)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(l<0||l>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const g=f*(s+o);if(g>u)throw new Error(`Scrypt: parameters too large, ${g} (128 * r * (N + p)) > ${u} (maxmem)`);const v=aae(EA,e,t,{c:1,dkLen:f*o}),w=GF(v),C=GF(new Uint8Array(f*s)),N=GF(new Uint8Array(f));let I=()=>{};if(d){const P=2*s*o,R=Math.max(Math.floor(P/1e4),1);let F=0;I=()=>{F++,d&&(!(F%R)||F===P)&&d(F/P)}}return{N:s,r:a,p:o,dkLen:l,blockSize32:x,V:C,B32:w,B:v,tmp:N,blockMixCb:I,asyncTick:c}}function sTe(e,t,n,r,s){const a=aae(EA,e,n,{c:1,dkLen:t});return n.fill(0),r.fill(0),s.fill(0),a}function mvt(e,t,n){const{N:r,r:s,p:a,dkLen:o,blockSize32:l,V:c,B32:u,B:d,tmp:f,blockMixCb:x}=rTe(e,t,n);for(let g=0;g<a;g++){const v=l*g;for(let w=0;w<l;w++)c[w]=u[v+w];for(let w=0,C=0;w<r-1;w++)t4(c,C,c,C+=l,s),x();t4(c,(r-1)*l,u,v,s),x();for(let w=0;w<r;w++){const C=u[v+l-16]%r;for(let N=0;N<l;N++)f[N]=u[v+N]^c[C*l+N];t4(f,0,u,v,s),x()}}return sTe(e,o,d,c,f)}async function xvt(e,t,n){const{N:r,r:s,p:a,dkLen:o,blockSize32:l,V:c,B32:u,B:d,tmp:f,blockMixCb:x,asyncTick:g}=rTe(e,t,n);for(let v=0;v<a;v++){const w=l*v;for(let N=0;N<l;N++)c[N]=u[w+N];let C=0;await r0e(r-1,g,()=>{t4(c,C,c,C+=l,s),x()}),t4(c,(r-1)*l,u,w,s),x(),await r0e(r,g,()=>{const N=u[w+l-16]%r;for(let I=0;I<l;I++)f[I]=u[w+I]^c[N*l+I];t4(f,0,u,w,s),x()})}return sTe(e,o,d,c,f)}let iTe=!1,aTe=!1;const oTe=async function(e,t,n,r,s,a,o){return await xvt(e,t,{N:n,r,p:s,dkLen:a,onProgress:o})},lTe=function(e,t,n,r,s,a){return mvt(e,t,{N:n,r,p:s,dkLen:a})};let cTe=oTe,uTe=lTe;async function TA(e,t,n,r,s,a,o){const l=cs(e,"passwd"),c=cs(t,"salt");return Hr(await cTe(l,c,n,r,s,a,o))}TA._=oTe;TA.lock=function(){aTe=!0};TA.register=function(e){if(aTe)throw new Error("scrypt is locked");cTe=e};Object.freeze(TA);function IA(e,t,n,r,s,a){const o=cs(e,"passwd"),l=cs(t,"salt");return Hr(uTe(o,l,n,r,s,a))}IA._=lTe;IA.lock=function(){iTe=!0};IA.register=function(e){if(iTe)throw new Error("scryptSync is locked");uTe=e};Object.freeze(IA);const dTe=function(e){return q2t("sha256").update(e).digest()};let fTe=dTe,hTe=!1;function ep(e){const t=cs(e,"data");return Hr(fTe(t))}ep._=dTe;ep.lock=function(){hTe=!0};ep.register=function(e){if(hTe)throw new Error("sha256 is locked");fTe=e};Object.freeze(ep);Object.freeze(ep);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const pTe=BigInt(0),MB=BigInt(1),gvt=BigInt(2),RB=e=>e instanceof Uint8Array,bvt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function RS(e){if(!RB(e))throw new Error("Uint8Array expected");let t="";for(let n=0;n<e.length;n++)t+=bvt[e[n]];return t}function mTe(e){const t=e.toString(16);return t.length&1?`0${t}`:t}function dae(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}function LS(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(t/2);for(let r=0;r<n.length;r++){const s=r*2,a=e.slice(s,s+2),o=Number.parseInt(a,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");n[r]=o}return n}function qw(e){return dae(RS(e))}function fae(e){if(!RB(e))throw new Error("Uint8Array expected");return dae(RS(Uint8Array.from(e).reverse()))}function DS(e,t){return LS(e.toString(16).padStart(t*2,"0"))}function hae(e,t){return DS(e,t).reverse()}function yvt(e){return LS(mTe(e))}function Pp(e,t,n){let r;if(typeof t=="string")try{r=LS(t)}catch(a){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${a}`)}else if(RB(t))r=Uint8Array.from(t);else throw new Error(`${e} must be hex string or Uint8Array`);const s=r.length;if(typeof n=="number"&&s!==n)throw new Error(`${e} expected ${n} bytes, got ${s}`);return r}function oE(...e){const t=new Uint8Array(e.reduce((r,s)=>r+s.length,0));let n=0;return e.forEach(r=>{if(!RB(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}function vvt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function wvt(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Cvt(e){let t;for(t=0;e>pTe;e>>=MB,t+=1);return t}function Svt(e,t){return e>>BigInt(t)&MB}const Nvt=(e,t,n)=>e|(n?MB:pTe)<<BigInt(t),pae=e=>(gvt<<BigInt(e-1))-MB,FH=e=>new Uint8Array(e),u0e=e=>Uint8Array.from(e);function xTe(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=FH(e),s=FH(e),a=0;const o=()=>{r.fill(1),s.fill(0),a=0},l=(...f)=>n(s,r,...f),c=(f=FH())=>{s=l(u0e([0]),f),r=l(),f.length!==0&&(s=l(u0e([1]),f),r=l())},u=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const x=[];for(;f<t;){r=l();const g=r.slice();x.push(g),f+=r.length}return oE(...x)};return(f,x)=>{o(),c(f);let g;for(;!(g=x(u()));)c();return o(),g}}const Avt={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Bk(e,t,n={}){const r=(s,a,o)=>{const l=Avt[a];if(typeof l!="function")throw new Error(`Invalid validator "${a}", expected function`);const c=e[s];if(!(o&&c===void 0)&&!l(c,e))throw new Error(`Invalid param ${String(s)}=${c} (${typeof c}), expected ${a}`)};for(const[s,a]of Object.entries(t))r(s,a,!1);for(const[s,a]of Object.entries(n))r(s,a,!0);return e}const jvt=Object.freeze(Object.defineProperty({__proto__:null,bitGet:Svt,bitLen:Cvt,bitMask:pae,bitSet:Nvt,bytesToHex:RS,bytesToNumberBE:qw,bytesToNumberLE:fae,concatBytes:oE,createHmacDrbg:xTe,ensureBytes:Pp,equalBytes:vvt,hexToBytes:LS,hexToNumber:dae,numberToBytesBE:DS,numberToBytesLE:hae,numberToHexUnpadded:mTe,numberToVarBytesBE:yvt,utf8ToBytes:wvt,validateObject:Bk},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Sc=BigInt(0),xl=BigInt(1),Fv=BigInt(2),Evt=BigInt(3),jJ=BigInt(4),d0e=BigInt(5),f0e=BigInt(8);BigInt(9);BigInt(16);function Md(e,t){const n=e%t;return n>=Sc?n:t+n}function _vt(e,t,n){if(n<=Sc||t<Sc)throw new Error("Expected power/modulo > 0");if(n===xl)return Sc;let r=xl;for(;t>Sc;)t&xl&&(r=r*e%n),e=e*e%n,t>>=xl;return r}function ch(e,t,n){let r=e;for(;t-- >Sc;)r*=r,r%=n;return r}function EJ(e,t){if(e===Sc||t<=Sc)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=Md(e,t),r=t,s=Sc,a=xl;for(;n!==Sc;){const l=r/n,c=r%n,u=s-a*l;r=n,n=c,s=a,a=u}if(r!==xl)throw new Error("invert: does not exist");return Md(s,t)}function kvt(e){const t=(e-xl)/Fv;let n,r,s;for(n=e-xl,r=0;n%Fv===Sc;n/=Fv,r++);for(s=Fv;s<e&&_vt(s,t,e)!==e-xl;s++);if(r===1){const o=(e+xl)/jJ;return function(c,u){const d=c.pow(u,o);if(!c.eql(c.sqr(d),u))throw new Error("Cannot find square root");return d}}const a=(n+xl)/Fv;return function(l,c){if(l.pow(c,t)===l.neg(l.ONE))throw new Error("Cannot find square root");let u=r,d=l.pow(l.mul(l.ONE,s),n),f=l.pow(c,a),x=l.pow(c,n);for(;!l.eql(x,l.ONE);){if(l.eql(x,l.ZERO))return l.ZERO;let g=1;for(let w=l.sqr(x);g<u&&!l.eql(w,l.ONE);g++)w=l.sqr(w);const v=l.pow(d,xl<<BigInt(u-g-1));d=l.sqr(v),f=l.mul(f,v),x=l.mul(x,d),u=g}return f}}function Tvt(e){if(e%jJ===Evt){const t=(e+xl)/jJ;return function(r,s){const a=r.pow(s,t);if(!r.eql(r.sqr(a),s))throw new Error("Cannot find square root");return a}}if(e%f0e===d0e){const t=(e-d0e)/f0e;return function(r,s){const a=r.mul(s,Fv),o=r.pow(a,t),l=r.mul(s,o),c=r.mul(r.mul(l,Fv),o),u=r.mul(l,r.sub(c,r.ONE));if(!r.eql(r.sqr(u),s))throw new Error("Cannot find square root");return u}}return kvt(e)}const Ivt=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Pvt(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Ivt.reduce((r,s)=>(r[s]="function",r),t);return Bk(e,n)}function Fvt(e,t,n){if(n<Sc)throw new Error("Expected power > 0");if(n===Sc)return e.ONE;if(n===xl)return t;let r=e.ONE,s=t;for(;n>Sc;)n&xl&&(r=e.mul(r,s)),s=e.sqr(s),n>>=xl;return r}function Ovt(e,t){const n=new Array(t.length),r=t.reduce((a,o,l)=>e.is0(o)?a:(n[l]=a,e.mul(a,o)),e.ONE),s=e.inv(r);return t.reduceRight((a,o,l)=>e.is0(o)?a:(n[l]=e.mul(a,n[l]),e.mul(a,o)),s),n}function gTe(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Mvt(e,t,n=!1,r={}){if(e<=Sc)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:a}=gTe(e,t);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=Tvt(e),l=Object.freeze({ORDER:e,BITS:s,BYTES:a,MASK:pae(s),ZERO:Sc,ONE:xl,create:c=>Md(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Sc<=c&&c<e},is0:c=>c===Sc,isOdd:c=>(c&xl)===xl,neg:c=>Md(-c,e),eql:(c,u)=>c===u,sqr:c=>Md(c*c,e),add:(c,u)=>Md(c+u,e),sub:(c,u)=>Md(c-u,e),mul:(c,u)=>Md(c*u,e),pow:(c,u)=>Fvt(l,c,u),div:(c,u)=>Md(c*EJ(u,e),e),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>EJ(c,e),sqrt:r.sqrt||(c=>o(l,c)),invertBatch:c=>Ovt(l,c),cmov:(c,u,d)=>d?u:c,toBytes:c=>n?hae(c,a):DS(c,a),fromBytes:c=>{if(c.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${c.length}`);return n?fae(c):qw(c)}});return Object.freeze(l)}function bTe(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function yTe(e){const t=bTe(e);return t+Math.ceil(t/2)}function Rvt(e,t,n=!1){const r=e.length,s=bTe(t),a=yTe(t);if(r<16||r<a||r>1024)throw new Error(`expected ${a}-1024 bytes of input, got ${r}`);const o=n?qw(e):fae(e),l=Md(o,t-xl)+xl;return n?hae(l,s):DS(l,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Lvt=BigInt(0),OH=BigInt(1);function Dvt(e,t){const n=(s,a)=>{const o=a.negate();return s?o:a},r=s=>{const a=Math.ceil(t/s)+1,o=2**(s-1);return{windows:a,windowSize:o}};return{constTimeNegate:n,unsafeLadder(s,a){let o=e.ZERO,l=s;for(;a>Lvt;)a&OH&&(o=o.add(l)),l=l.double(),a>>=OH;return o},precomputeWindow(s,a){const{windows:o,windowSize:l}=r(a),c=[];let u=s,d=u;for(let f=0;f<o;f++){d=u,c.push(d);for(let x=1;x<l;x++)d=d.add(u),c.push(d);u=d.double()}return c},wNAF(s,a,o){const{windows:l,windowSize:c}=r(s);let u=e.ZERO,d=e.BASE;const f=BigInt(2**s-1),x=2**s,g=BigInt(s);for(let v=0;v<l;v++){const w=v*c;let C=Number(o&f);o>>=g,C>c&&(C-=x,o+=OH);const N=w,I=w+Math.abs(C)-1,P=v%2!==0,R=C<0;C===0?d=d.add(n(P,a[N])):u=u.add(n(R,a[I]))}return{p:u,f:d}},wNAFCached(s,a,o,l){const c=s._WINDOW_SIZE||1;let u=a.get(s);return u||(u=this.precomputeWindow(s,c),c!==1&&a.set(s,l(u))),this.wNAF(c,u,o)}}}function vTe(e){return Pvt(e.Fp),Bk(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...gTe(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Bvt(e){const t=vTe(e);Bk(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:$vt,hexToBytes:Uvt}=jvt,Vv={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=Vv;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:$vt(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=Vv,n=typeof e=="string"?Uvt(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:s,l:a}=Vv._parseInt(n.subarray(2)),{d:o,l}=Vv._parseInt(a);if(l.length)throw new t("Invalid signature: left bytes after parsing");return{r:s,s:o}},hexFromSig(e){const t=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const d=u.toString(16);return d.length&1?`0${d}`:d},r=t(n(e.s)),s=t(n(e.r)),a=r.length/2,o=s.length/2,l=n(a),c=n(o);return`30${n(o+a+4)}02${c}${s}02${l}${r}`}},Ng=BigInt(0),Mh=BigInt(1);BigInt(2);const h0e=BigInt(3);BigInt(4);function zvt(e){const t=Bvt(e),{Fp:n}=t,r=t.toBytes||((v,w,C)=>{const N=w.toAffine();return oE(Uint8Array.from([4]),n.toBytes(N.x),n.toBytes(N.y))}),s=t.fromBytes||(v=>{const w=v.subarray(1),C=n.fromBytes(w.subarray(0,n.BYTES)),N=n.fromBytes(w.subarray(n.BYTES,2*n.BYTES));return{x:C,y:N}});function a(v){const{a:w,b:C}=t,N=n.sqr(v),I=n.mul(N,v);return n.add(n.add(I,n.mul(v,w)),C)}if(!n.eql(n.sqr(t.Gy),a(t.Gx)))throw new Error("bad generator point: equation left != right");function o(v){return typeof v=="bigint"&&Ng<v&&v<t.n}function l(v){if(!o(v))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(v){const{allowedPrivateKeyLengths:w,nByteLength:C,wrapPrivateKey:N,n:I}=t;if(w&&typeof v!="bigint"){if(v instanceof Uint8Array&&(v=RS(v)),typeof v!="string"||!w.includes(v.length))throw new Error("Invalid key");v=v.padStart(C*2,"0")}let P;try{P=typeof v=="bigint"?v:qw(Pp("private key",v,C))}catch{throw new Error(`private key must be ${C} bytes, hex or bigint, not ${typeof v}`)}return N&&(P=Md(P,I)),l(P),P}const u=new Map;function d(v){if(!(v instanceof f))throw new Error("ProjectivePoint expected")}class f{constructor(w,C,N){if(this.px=w,this.py=C,this.pz=N,w==null||!n.isValid(w))throw new Error("x required");if(C==null||!n.isValid(C))throw new Error("y required");if(N==null||!n.isValid(N))throw new Error("z required")}static fromAffine(w){const{x:C,y:N}=w||{};if(!w||!n.isValid(C)||!n.isValid(N))throw new Error("invalid affine point");if(w instanceof f)throw new Error("projective point not allowed");const I=P=>n.eql(P,n.ZERO);return I(C)&&I(N)?f.ZERO:new f(C,N,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(w){const C=n.invertBatch(w.map(N=>N.pz));return w.map((N,I)=>N.toAffine(C[I])).map(f.fromAffine)}static fromHex(w){const C=f.fromAffine(s(Pp("pointHex",w)));return C.assertValidity(),C}static fromPrivateKey(w){return f.BASE.multiply(c(w))}_setWindowSize(w){this._WINDOW_SIZE=w,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:w,y:C}=this.toAffine();if(!n.isValid(w)||!n.isValid(C))throw new Error("bad point: x or y not FE");const N=n.sqr(C),I=a(w);if(!n.eql(N,I))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:w}=this.toAffine();if(n.isOdd)return!n.isOdd(w);throw new Error("Field doesn't support isOdd")}equals(w){d(w);const{px:C,py:N,pz:I}=this,{px:P,py:R,pz:F}=w,U=n.eql(n.mul(C,F),n.mul(P,I)),L=n.eql(n.mul(N,F),n.mul(R,I));return U&&L}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:w,b:C}=t,N=n.mul(C,h0e),{px:I,py:P,pz:R}=this;let F=n.ZERO,U=n.ZERO,L=n.ZERO,z=n.mul(I,I),X=n.mul(P,P),ne=n.mul(R,R),J=n.mul(I,P);return J=n.add(J,J),L=n.mul(I,R),L=n.add(L,L),F=n.mul(w,L),U=n.mul(N,ne),U=n.add(F,U),F=n.sub(X,U),U=n.add(X,U),U=n.mul(F,U),F=n.mul(J,F),L=n.mul(N,L),ne=n.mul(w,ne),J=n.sub(z,ne),J=n.mul(w,J),J=n.add(J,L),L=n.add(z,z),z=n.add(L,z),z=n.add(z,ne),z=n.mul(z,J),U=n.add(U,z),ne=n.mul(P,R),ne=n.add(ne,ne),z=n.mul(ne,J),F=n.sub(F,z),L=n.mul(ne,X),L=n.add(L,L),L=n.add(L,L),new f(F,U,L)}add(w){d(w);const{px:C,py:N,pz:I}=this,{px:P,py:R,pz:F}=w;let U=n.ZERO,L=n.ZERO,z=n.ZERO;const X=t.a,ne=n.mul(t.b,h0e);let J=n.mul(C,P),Z=n.mul(N,R),re=n.mul(I,F),he=n.add(C,N),Y=n.add(P,R);he=n.mul(he,Y),Y=n.add(J,Z),he=n.sub(he,Y),Y=n.add(C,I);let ie=n.add(P,F);return Y=n.mul(Y,ie),ie=n.add(J,re),Y=n.sub(Y,ie),ie=n.add(N,I),U=n.add(R,F),ie=n.mul(ie,U),U=n.add(Z,re),ie=n.sub(ie,U),z=n.mul(X,Y),U=n.mul(ne,re),z=n.add(U,z),U=n.sub(Z,z),z=n.add(Z,z),L=n.mul(U,z),Z=n.add(J,J),Z=n.add(Z,J),re=n.mul(X,re),Y=n.mul(ne,Y),Z=n.add(Z,re),re=n.sub(J,re),re=n.mul(X,re),Y=n.add(Y,re),J=n.mul(Z,Y),L=n.add(L,J),J=n.mul(ie,Y),U=n.mul(he,U),U=n.sub(U,J),J=n.mul(he,Z),z=n.mul(ie,z),z=n.add(z,J),new f(U,L,z)}subtract(w){return this.add(w.negate())}is0(){return this.equals(f.ZERO)}wNAF(w){return g.wNAFCached(this,u,w,C=>{const N=n.invertBatch(C.map(I=>I.pz));return C.map((I,P)=>I.toAffine(N[P])).map(f.fromAffine)})}multiplyUnsafe(w){const C=f.ZERO;if(w===Ng)return C;if(l(w),w===Mh)return this;const{endo:N}=t;if(!N)return g.unsafeLadder(this,w);let{k1neg:I,k1:P,k2neg:R,k2:F}=N.splitScalar(w),U=C,L=C,z=this;for(;P>Ng||F>Ng;)P&Mh&&(U=U.add(z)),F&Mh&&(L=L.add(z)),z=z.double(),P>>=Mh,F>>=Mh;return I&&(U=U.negate()),R&&(L=L.negate()),L=new f(n.mul(L.px,N.beta),L.py,L.pz),U.add(L)}multiply(w){l(w);let C=w,N,I;const{endo:P}=t;if(P){const{k1neg:R,k1:F,k2neg:U,k2:L}=P.splitScalar(C);let{p:z,f:X}=this.wNAF(F),{p:ne,f:J}=this.wNAF(L);z=g.constTimeNegate(R,z),ne=g.constTimeNegate(U,ne),ne=new f(n.mul(ne.px,P.beta),ne.py,ne.pz),N=z.add(ne),I=X.add(J)}else{const{p:R,f:F}=this.wNAF(C);N=R,I=F}return f.normalizeZ([N,I])[0]}multiplyAndAddUnsafe(w,C,N){const I=f.BASE,P=(F,U)=>U===Ng||U===Mh||!F.equals(I)?F.multiplyUnsafe(U):F.multiply(U),R=P(this,C).add(P(w,N));return R.is0()?void 0:R}toAffine(w){const{px:C,py:N,pz:I}=this,P=this.is0();w==null&&(w=P?n.ONE:n.inv(I));const R=n.mul(C,w),F=n.mul(N,w),U=n.mul(I,w);if(P)return{x:n.ZERO,y:n.ZERO};if(!n.eql(U,n.ONE))throw new Error("invZ was invalid");return{x:R,y:F}}isTorsionFree(){const{h:w,isTorsionFree:C}=t;if(w===Mh)return!0;if(C)return C(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:w,clearCofactor:C}=t;return w===Mh?this:C?C(f,this):this.multiplyUnsafe(t.h)}toRawBytes(w=!0){return this.assertValidity(),r(f,this,w)}toHex(w=!0){return RS(this.toRawBytes(w))}}f.BASE=new f(t.Gx,t.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const x=t.nBitLength,g=Dvt(f,t.endo?Math.ceil(x/2):x);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:c,weierstrassEquation:a,isWithinCurveOrder:o}}function Hvt(e){const t=vTe(e);return Bk(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Vvt(e){const t=Hvt(e),{Fp:n,n:r}=t,s=n.BYTES+1,a=2*n.BYTES+1;function o(Y){return Ng<Y&&Y<n.ORDER}function l(Y){return Md(Y,r)}function c(Y){return EJ(Y,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:x}=zvt({...t,toBytes(Y,ie,oe){const G=ie.toAffine(),V=n.toBytes(G.x),ee=oE;return oe?ee(Uint8Array.from([ie.hasEvenY()?2:3]),V):ee(Uint8Array.from([4]),V,n.toBytes(G.y))},fromBytes(Y){const ie=Y.length,oe=Y[0],G=Y.subarray(1);if(ie===s&&(oe===2||oe===3)){const V=qw(G);if(!o(V))throw new Error("Point is not on curve");const ee=f(V);let ae=n.sqrt(ee);const fe=(ae&Mh)===Mh;return(oe&1)===1!==fe&&(ae=n.neg(ae)),{x:V,y:ae}}else if(ie===a&&oe===4){const V=n.fromBytes(G.subarray(0,n.BYTES)),ee=n.fromBytes(G.subarray(n.BYTES,2*n.BYTES));return{x:V,y:ee}}else throw new Error(`Point of length ${ie} was invalid. Expected ${s} compressed bytes or ${a} uncompressed bytes`)}}),g=Y=>RS(DS(Y,t.nByteLength));function v(Y){const ie=r>>Mh;return Y>ie}function w(Y){return v(Y)?l(-Y):Y}const C=(Y,ie,oe)=>qw(Y.slice(ie,oe));class N{constructor(ie,oe,G){this.r=ie,this.s=oe,this.recovery=G,this.assertValidity()}static fromCompact(ie){const oe=t.nByteLength;return ie=Pp("compactSignature",ie,oe*2),new N(C(ie,0,oe),C(ie,oe,2*oe))}static fromDER(ie){const{r:oe,s:G}=Vv.toSig(Pp("DER",ie));return new N(oe,G)}assertValidity(){if(!x(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!x(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(ie){return new N(this.r,this.s,ie)}recoverPublicKey(ie){const{r:oe,s:G,recovery:V}=this,ee=L(Pp("msgHash",ie));if(V==null||![0,1,2,3].includes(V))throw new Error("recovery id invalid");const ae=V===2||V===3?oe+t.n:oe;if(ae>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const fe=V&1?"03":"02",Ae=u.fromHex(fe+g(ae)),ce=c(ae),ye=l(-ee*ce),Ne=l(G*ce),be=u.BASE.multiplyAndAddUnsafe(Ae,ye,Ne);if(!be)throw new Error("point at infinify");return be.assertValidity(),be}hasHighS(){return v(this.s)}normalizeS(){return this.hasHighS()?new N(this.r,l(-this.s),this.recovery):this}toDERRawBytes(){return LS(this.toDERHex())}toDERHex(){return Vv.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return LS(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}const I={isValidPrivateKey(Y){try{return d(Y),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const Y=yTe(t.n);return Rvt(t.randomBytes(Y),t.n)},precompute(Y=8,ie=u.BASE){return ie._setWindowSize(Y),ie.multiply(BigInt(3)),ie}};function P(Y,ie=!0){return u.fromPrivateKey(Y).toRawBytes(ie)}function R(Y){const ie=Y instanceof Uint8Array,oe=typeof Y=="string",G=(ie||oe)&&Y.length;return ie?G===s||G===a:oe?G===2*s||G===2*a:Y instanceof u}function F(Y,ie,oe=!0){if(R(Y))throw new Error("first arg must be private key");if(!R(ie))throw new Error("second arg must be public key");return u.fromHex(ie).multiply(d(Y)).toRawBytes(oe)}const U=t.bits2int||function(Y){const ie=qw(Y),oe=Y.length*8-t.nBitLength;return oe>0?ie>>BigInt(oe):ie},L=t.bits2int_modN||function(Y){return l(U(Y))},z=pae(t.nBitLength);function X(Y){if(typeof Y!="bigint")throw new Error("bigint expected");if(!(Ng<=Y&&Y<z))throw new Error(`bigint expected < 2^${t.nBitLength}`);return DS(Y,t.nByteLength)}function ne(Y,ie,oe=J){if(["recovered","canonical"].some(Ie=>Ie in oe))throw new Error("sign() legacy options not supported");const{hash:G,randomBytes:V}=t;let{lowS:ee,prehash:ae,extraEntropy:fe}=oe;ee==null&&(ee=!0),Y=Pp("msgHash",Y),ae&&(Y=Pp("prehashed msgHash",G(Y)));const Ae=L(Y),ce=d(ie),ye=[X(ce),X(Ae)];if(fe!=null){const Ie=fe===!0?V(n.BYTES):fe;ye.push(Pp("extraEntropy",Ie))}const Ne=oE(...ye),be=Ae;function je(Ie){const Re=U(Ie);if(!x(Re))return;const Qe=c(Re),Be=u.BASE.multiply(Re).toAffine(),it=l(Be.x);if(it===Ng)return;const tt=l(Qe*l(be+it*ce));if(tt===Ng)return;let at=(Be.x===it?0:2)|Number(Be.y&Mh),dt=tt;return ee&&v(tt)&&(dt=w(tt),at^=1),new N(it,dt,at)}return{seed:Ne,k2sig:je}}const J={lowS:t.lowS,prehash:!1},Z={lowS:t.lowS,prehash:!1};function re(Y,ie,oe=J){const{seed:G,k2sig:V}=ne(Y,ie,oe),ee=t;return xTe(ee.hash.outputLen,ee.nByteLength,ee.hmac)(G,V)}u.BASE._setWindowSize(8);function he(Y,ie,oe,G=Z){var Be;const V=Y;if(ie=Pp("msgHash",ie),oe=Pp("publicKey",oe),"strict"in G)throw new Error("options.strict was renamed to lowS");const{lowS:ee,prehash:ae}=G;let fe,Ae;try{if(typeof V=="string"||V instanceof Uint8Array)try{fe=N.fromDER(V)}catch(it){if(!(it instanceof Vv.Err))throw it;fe=N.fromCompact(V)}else if(typeof V=="object"&&typeof V.r=="bigint"&&typeof V.s=="bigint"){const{r:it,s:tt}=V;fe=new N(it,tt)}else throw new Error("PARSE");Ae=u.fromHex(oe)}catch(it){if(it.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(ee&&fe.hasHighS())return!1;ae&&(ie=t.hash(ie));const{r:ce,s:ye}=fe,Ne=L(ie),be=c(ye),je=l(Ne*be),Ie=l(ce*be),Re=(Be=u.BASE.multiplyAndAddUnsafe(Ae,je,Ie))==null?void 0:Be.toAffine();return Re?l(Re.x)===ce:!1}return{CURVE:t,getPublicKey:P,getSharedSecret:F,sign:re,verify:he,ProjectivePoint:u,Signature:N,utils:I}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Wvt(e){return{hash:e,hmac:(t,...n)=>OB(e,t,x2t(...n)),randomBytes:b2t}}function qvt(e,t){const n=r=>Vvt({...e,...Wvt(r)});return Object.freeze({...n(t),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const wTe=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),p0e=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Gvt=BigInt(1),_J=BigInt(2),m0e=(e,t)=>(e+t/_J)/t;function Kvt(e){const t=wTe,n=BigInt(3),r=BigInt(6),s=BigInt(11),a=BigInt(22),o=BigInt(23),l=BigInt(44),c=BigInt(88),u=e*e*e%t,d=u*u*e%t,f=ch(d,n,t)*d%t,x=ch(f,n,t)*d%t,g=ch(x,_J,t)*u%t,v=ch(g,s,t)*g%t,w=ch(v,a,t)*v%t,C=ch(w,l,t)*w%t,N=ch(C,c,t)*C%t,I=ch(N,l,t)*w%t,P=ch(I,n,t)*d%t,R=ch(P,o,t)*v%t,F=ch(R,r,t)*u%t,U=ch(F,_J,t);if(!kJ.eql(kJ.sqr(U),e))throw new Error("Cannot find square root");return U}const kJ=Mvt(wTe,void 0,void 0,{sqrt:Kvt}),vb=qvt({a:BigInt(0),b:BigInt(7),Fp:kJ,n:p0e,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=p0e,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Gvt*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),l=m0e(a*e,t),c=m0e(-r*e,t);let u=Md(e-l*n-c*s,t),d=Md(-l*r-c*a,t);const f=u>o,x=d>o;if(f&&(u=t-u),x&&(d=t-d),u>o||d>o)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:x,k2:d}}}},EA);BigInt(0);vb.ProjectivePoint;const lE="0x0000000000000000000000000000000000000000",x0e="0x0000000000000000000000000000000000000000000000000000000000000000",Yvt=`Ethereum Signed Message:
`,g0e=BigInt(0),b0e=BigInt(1),y0e=BigInt(2),v0e=BigInt(27),w0e=BigInt(28),ZI=BigInt(35),L6={};function C0e(e){return e1(tl(e),32)}var B4,r0,$4,Aw;const kp=class kp{constructor(t,n,r,s){Ln(this,B4);Ln(this,r0);Ln(this,$4);Ln(this,Aw);a5(t,L6,"Signature"),Ht(this,B4,n),Ht(this,r0,r),Ht(this,$4,s),Ht(this,Aw,null)}get r(){return $e(this,B4)}set r(t){Sn(e4(t)===32,"invalid r","value",t),Ht(this,B4,Hr(t))}get s(){return Sn(parseInt($e(this,r0).substring(0,3))<8,"non-canonical s; use ._s","s",$e(this,r0)),$e(this,r0)}set s(t){Sn(e4(t)===32,"invalid s","value",t),Ht(this,r0,Hr(t))}get _s(){return $e(this,r0)}isValid(){return parseInt($e(this,r0).substring(0,3))<8}get v(){return $e(this,$4)}set v(t){const n=Mi(t,"value");Sn(n===27||n===28,"invalid v","v",t),Ht(this,$4,n)}get networkV(){return $e(this,Aw)}get legacyChainId(){const t=this.networkV;return t==null?null:kp.getChainId(t)}get yParity(){return this.v===27?0:1}get yParityAndS(){const t=cs(this.s);return this.yParity&&(t[0]|=128),Hr(t)}get compactSerialized(){return Pa([this.r,this.yParityAndS])}get serialized(){return Pa([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this._s}"${this.isValid()?"":', valid: "false"'}, yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const t=new kp(L6,this.r,this._s,this.v);return this.networkV&&Ht(t,Aw,this.networkV),t}toJSON(){const t=this.networkV;return{_type:"signature",networkV:t!=null?t.toString():null,r:this.r,s:this._s,v:this.v}}static getChainId(t){const n=gs(t,"v");return n==v0e||n==w0e?g0e:(Sn(n>=ZI,"invalid EIP-155 v","v",t),(n-ZI)/y0e)}static getChainIdV(t,n){return gs(t)*y0e+BigInt(35+n-27)}static getNormalizedV(t){const n=gs(t);return n===g0e||n===v0e?27:n===b0e||n===w0e?28:(Sn(n>=ZI,"invalid v","v",t),n&b0e?27:28)}static from(t){function n(u,d){Sn(u,d,"signature",t)}if(t==null)return new kp(L6,x0e,x0e,27);if(typeof t=="string"){const u=cs(t,"signature");if(u.length===64){const d=Hr(u.slice(0,32)),f=u.slice(32,64),x=f[0]&128?28:27;return f[0]&=127,new kp(L6,d,Hr(f),x)}if(u.length===65){const d=Hr(u.slice(0,32)),f=Hr(u.slice(32,64)),x=kp.getNormalizedV(u[64]);return new kp(L6,d,f,x)}n(!1,"invalid raw signature length")}if(t instanceof kp)return t.clone();const r=t.r;n(r!=null,"missing r");const s=C0e(r),a=function(u,d){if(u!=null)return C0e(u);if(d!=null){n(ao(d,32),"invalid yParityAndS");const f=cs(d);return f[0]&=127,Hr(f)}n(!1,"missing s")}(t.s,t.yParityAndS),{networkV:o,v:l}=function(u,d,f){if(u!=null){const x=gs(u);return{networkV:x>=ZI?x:void 0,v:kp.getNormalizedV(x)}}if(d!=null)return n(ao(d,32),"invalid yParityAndS"),{v:cs(d)[0]&128?28:27};if(f!=null){switch(Mi(f,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")}(t.v,t.yParityAndS,t.yParity),c=new kp(L6,s,a,l);return o&&Ht(c,Aw,o),n(t.yParity==null||Mi(t.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),n(t.yParityAndS==null||t.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}};B4=new WeakMap,r0=new WeakMap,$4=new WeakMap,Aw=new WeakMap;let Zc=kp;var mg;const Mv=class Mv{constructor(t){Ln(this,mg);Sn(e4(t)===32,"invalid private key","privateKey","[REDACTED]"),Ht(this,mg,Hr(t))}get privateKey(){return $e(this,mg)}get publicKey(){return Mv.computePublicKey($e(this,mg))}get compressedPublicKey(){return Mv.computePublicKey($e(this,mg),!0)}sign(t){Sn(e4(t)===32,"invalid digest length","digest",t);const n=vb.sign(Yc(t),Yc($e(this,mg)),{lowS:!0});return Zc.from({r:t1(n.r,32),s:t1(n.s,32),v:n.recovery?28:27})}computeSharedSecret(t){const n=Mv.computePublicKey(t);return Hr(vb.getSharedSecret(Yc($e(this,mg)),cs(n),!1))}static computePublicKey(t,n){let r=cs(t,"key");if(r.length===32){const a=vb.getPublicKey(r,!!n);return Hr(a)}if(r.length===64){const a=new Uint8Array(65);a[0]=4,a.set(r,1),r=a}const s=vb.ProjectivePoint.fromHex(r);return Hr(s.toRawBytes(n))}static recoverPublicKey(t,n){Sn(e4(t)===32,"invalid digest length","digest",t);const r=Zc.from(n);let s=vb.Signature.fromCompact(Yc(Pa([r.r,r.s])));s=s.addRecoveryBit(r.yParity);const a=s.recoverPublicKey(Yc(t));return Sn(a!=null,"invalid signature for digest","signature",n),"0x"+a.toHex(!1)}static addPoints(t,n,r){const s=vb.ProjectivePoint.fromHex(Mv.computePublicKey(t).substring(2)),a=vb.ProjectivePoint.fromHex(Mv.computePublicKey(n).substring(2));return"0x"+s.add(a).toHex(!!r)}};mg=new WeakMap;let P0=Mv;const Xvt=BigInt(0),Qvt=BigInt(36);function S0e(e){e=e.toLowerCase();const t=e.substring(2).split(""),n=new Uint8Array(40);for(let s=0;s<40;s++)n[s]=t[s].charCodeAt(0);const r=cs(io(n));for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&(t[s]=t[s].toUpperCase()),(r[s>>1]&15)>=8&&(t[s+1]=t[s+1].toUpperCase());return"0x"+t.join("")}const mae={};for(let e=0;e<10;e++)mae[String(e)]=String(e);for(let e=0;e<26;e++)mae[String.fromCharCode(65+e)]=String(10+e);const N0e=15;function Zvt(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+"00";let t=e.split("").map(r=>mae[r]).join("");for(;t.length>=N0e;){let r=t.substring(0,N0e);t=parseInt(r,10)%97+t.substring(r.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n="0"+n;return n}const Jvt=function(){const e={};for(let t=0;t<36;t++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[t];e[n]=BigInt(t)}return e}();function ewt(e){e=e.toLowerCase();let t=Xvt;for(let n=0;n<e.length;n++)t=t*Qvt+Jvt[e[n]];return t}function Ji(e){if(Sn(typeof e=="string","invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith("0x")||(e="0x"+e);const t=S0e(e);return Sn(!e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||t===e,"bad address checksum","address",e),t}if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){Sn(e.substring(2,4)===Zvt(e),"bad icap checksum","address",e);let t=ewt(e.substring(4)).toString(16);for(;t.length<40;)t="0"+t;return S0e("0x"+t)}Sn(!1,"invalid address","address",e)}function twt(e){const t=Ji(e.from);let r=gs(e.nonce,"tx.nonce").toString(16);return r==="0"?r="0x":r.length%2?r="0x0"+r:r="0x"+r,Ji(po(io(n1([t,r])),12))}function CTe(e){return e&&typeof e.getAddress=="function"}async function MH(e,t){const n=await t;return(n==null||n==="0x0000000000000000000000000000000000000000")&&(Fr(typeof e!="string","unconfigured name","UNCONFIGURED_NAME",{value:e}),Sn(!1,"invalid AddressLike value; did not resolve to a value address","target",e)),Ji(n)}function Nc(e,t){if(typeof e=="string")return e.match(/^0x[0-9a-f]{40}$/i)?Ji(e):(Fr(t!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),MH(e,t.resolveName(e)));if(CTe(e))return MH(e,e.getAddress());if(e&&typeof e.then=="function")return MH(e,e);Sn(!1,"unsupported addressable value","target",e)}const ng={};function ws(e,t){let n=!1;return t<0&&(n=!0,t*=-1),new Iu(ng,`${n?"":"u"}int${t}`,e,{signed:n,width:t})}function ha(e,t){return new Iu(ng,`bytes${t||""}`,e,{size:t})}const A0e=Symbol.for("_ethers_typed");var jw;const sg=class sg{constructor(t,n,r,s){Un(this,"type");Un(this,"value");Ln(this,jw);Un(this,"_typedSymbol");s==null&&(s=null),a5(ng,t,"Typed"),Ps(this,{_typedSymbol:A0e,type:n,value:r}),Ht(this,jw,s),this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(t=>t.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return $e(this,jw)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return $e(this,jw)===!0?-1:$e(this,jw)===!1?this.value.length:null}static from(t,n){return new sg(ng,t,n)}static uint8(t){return ws(t,8)}static uint16(t){return ws(t,16)}static uint24(t){return ws(t,24)}static uint32(t){return ws(t,32)}static uint40(t){return ws(t,40)}static uint48(t){return ws(t,48)}static uint56(t){return ws(t,56)}static uint64(t){return ws(t,64)}static uint72(t){return ws(t,72)}static uint80(t){return ws(t,80)}static uint88(t){return ws(t,88)}static uint96(t){return ws(t,96)}static uint104(t){return ws(t,104)}static uint112(t){return ws(t,112)}static uint120(t){return ws(t,120)}static uint128(t){return ws(t,128)}static uint136(t){return ws(t,136)}static uint144(t){return ws(t,144)}static uint152(t){return ws(t,152)}static uint160(t){return ws(t,160)}static uint168(t){return ws(t,168)}static uint176(t){return ws(t,176)}static uint184(t){return ws(t,184)}static uint192(t){return ws(t,192)}static uint200(t){return ws(t,200)}static uint208(t){return ws(t,208)}static uint216(t){return ws(t,216)}static uint224(t){return ws(t,224)}static uint232(t){return ws(t,232)}static uint240(t){return ws(t,240)}static uint248(t){return ws(t,248)}static uint256(t){return ws(t,256)}static uint(t){return ws(t,256)}static int8(t){return ws(t,-8)}static int16(t){return ws(t,-16)}static int24(t){return ws(t,-24)}static int32(t){return ws(t,-32)}static int40(t){return ws(t,-40)}static int48(t){return ws(t,-48)}static int56(t){return ws(t,-56)}static int64(t){return ws(t,-64)}static int72(t){return ws(t,-72)}static int80(t){return ws(t,-80)}static int88(t){return ws(t,-88)}static int96(t){return ws(t,-96)}static int104(t){return ws(t,-104)}static int112(t){return ws(t,-112)}static int120(t){return ws(t,-120)}static int128(t){return ws(t,-128)}static int136(t){return ws(t,-136)}static int144(t){return ws(t,-144)}static int152(t){return ws(t,-152)}static int160(t){return ws(t,-160)}static int168(t){return ws(t,-168)}static int176(t){return ws(t,-176)}static int184(t){return ws(t,-184)}static int192(t){return ws(t,-192)}static int200(t){return ws(t,-200)}static int208(t){return ws(t,-208)}static int216(t){return ws(t,-216)}static int224(t){return ws(t,-224)}static int232(t){return ws(t,-232)}static int240(t){return ws(t,-240)}static int248(t){return ws(t,-248)}static int256(t){return ws(t,-256)}static int(t){return ws(t,-256)}static bytes1(t){return ha(t,1)}static bytes2(t){return ha(t,2)}static bytes3(t){return ha(t,3)}static bytes4(t){return ha(t,4)}static bytes5(t){return ha(t,5)}static bytes6(t){return ha(t,6)}static bytes7(t){return ha(t,7)}static bytes8(t){return ha(t,8)}static bytes9(t){return ha(t,9)}static bytes10(t){return ha(t,10)}static bytes11(t){return ha(t,11)}static bytes12(t){return ha(t,12)}static bytes13(t){return ha(t,13)}static bytes14(t){return ha(t,14)}static bytes15(t){return ha(t,15)}static bytes16(t){return ha(t,16)}static bytes17(t){return ha(t,17)}static bytes18(t){return ha(t,18)}static bytes19(t){return ha(t,19)}static bytes20(t){return ha(t,20)}static bytes21(t){return ha(t,21)}static bytes22(t){return ha(t,22)}static bytes23(t){return ha(t,23)}static bytes24(t){return ha(t,24)}static bytes25(t){return ha(t,25)}static bytes26(t){return ha(t,26)}static bytes27(t){return ha(t,27)}static bytes28(t){return ha(t,28)}static bytes29(t){return ha(t,29)}static bytes30(t){return ha(t,30)}static bytes31(t){return ha(t,31)}static bytes32(t){return ha(t,32)}static address(t){return new sg(ng,"address",t)}static bool(t){return new sg(ng,"bool",!!t)}static bytes(t){return new sg(ng,"bytes",t)}static string(t){return new sg(ng,"string",t)}static array(t,n){throw new Error("not implemented yet")}static tuple(t,n){throw new Error("not implemented yet")}static overrides(t){return new sg(ng,"overrides",Object.assign({},t))}static isTyped(t){return t&&typeof t=="object"&&"_typedSymbol"in t&&t._typedSymbol===A0e}static dereference(t,n){if(sg.isTyped(t)){if(t.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${t.type}`);return t.value}return t}};jw=new WeakMap;let Iu=sg;class nwt extends b1{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,n){let r=Iu.dereference(n,"string");try{r=Ji(r)}catch(s){return this._throwError(s.message,n)}return t.writeValue(r)}decode(t){return Ji(t1(t.readValue(),20))}}class rwt extends b1{constructor(n){super(n.name,n.type,"_",n.dynamic);Un(this,"coder");this.coder=n}defaultValue(){return this.coder.defaultValue()}encode(n,r){return this.coder.encode(n,r)}decode(n){return this.coder.decode(n)}}function STe(e,t,n){let r=[];if(Array.isArray(n))r=n;else if(n&&typeof n=="object"){let c={};r=t.map(u=>{const d=u.localName;return Fr(d,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:n}),Fr(!c[d],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:n}),c[d]=!0,n[d]})}else Sn(!1,"invalid tuple value","tuple",n);Sn(t.length===r.length,"types/value length mismatch","tuple",n);let s=new CJ,a=new CJ,o=[];t.forEach((c,u)=>{let d=r[u];if(c.dynamic){let f=a.length;c.encode(a,d);let x=s.writeUpdatableValue();o.push(g=>{x(g+f)})}else c.encode(s,d)}),o.forEach(c=>{c(s.length)});let l=e.appendWriter(s);return l+=e.appendWriter(a),l}function NTe(e,t){let n=[],r=[],s=e.subReader(0);return t.forEach(a=>{let o=null;if(a.dynamic){let l=e.readIndex(),c=s.subReader(l);try{o=a.decode(c)}catch(u){if(Kc(u,"BUFFER_OVERRUN"))throw u;o=u,o.baseType=a.name,o.name=a.localName,o.type=a.type}}else try{o=a.decode(e)}catch(l){if(Kc(l,"BUFFER_OVERRUN"))throw l;o=l,o.baseType=a.name,o.name=a.localName,o.type=a.type}if(o==null)throw new Error("investigate");n.push(o),r.push(a.localName||null)}),gM.fromItems(n,r)}class swt extends b1{constructor(n,r,s){const a=n.type+"["+(r>=0?r:"")+"]",o=r===-1||n.dynamic;super("array",a,s,o);Un(this,"coder");Un(this,"length");Ps(this,{coder:n,length:r})}defaultValue(){const n=this.coder.defaultValue(),r=[];for(let s=0;s<this.length;s++)r.push(n);return r}encode(n,r){const s=Iu.dereference(r,"array");Array.isArray(s)||this._throwError("expected array value",s);let a=this.length;a===-1&&(a=s.length,n.writeValue(s.length)),cke(s.length,a,"coder array"+(this.localName?" "+this.localName:""));let o=[];for(let l=0;l<s.length;l++)o.push(this.coder);return STe(n,o,s)}decode(n){let r=this.length;r===-1&&(r=n.readIndex(),Fr(r*Ju<=n.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:n.bytes,offset:r*Ju,length:n.dataLength}));let s=[];for(let a=0;a<r;a++)s.push(new rwt(this.coder));return NTe(n,s)}}class iwt extends b1{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,n){const r=Iu.dereference(n,"bool");return t.writeValue(r?1:0)}decode(t){return!!t.readValue()}}class ATe extends b1{constructor(t,n){super(t,t,n,!0)}defaultValue(){return"0x"}encode(t,n){n=Yc(n);let r=t.writeValue(n.length);return r+=t.writeBytes(n),r}decode(t){return t.readBytes(t.readIndex(),!0)}}class awt extends ATe{constructor(t){super("bytes",t)}decode(t){return Hr(super.decode(t))}}class owt extends b1{constructor(n,r){let s="bytes"+String(n);super(s,s,r,!1);Un(this,"size");Ps(this,{size:n},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(n,r){let s=Yc(Iu.dereference(r,this.type));return s.length!==this.size&&this._throwError("incorrect data length",r),n.writeBytes(s)}decode(n){return Hr(n.readBytes(this.size))}}const lwt=new Uint8Array([]);class cwt extends b1{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,n){return n!=null&&this._throwError("not null",n),t.writeBytes(lwt)}decode(t){return t.readBytes(0),null}}const uwt=BigInt(0),dwt=BigInt(1),fwt=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class hwt extends b1{constructor(n,r,s){const a=(r?"int":"uint")+n*8;super(a,a,s,!1);Un(this,"size");Un(this,"signed");Ps(this,{size:n,signed:r},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(n,r){let s=gs(Iu.dereference(r,this.type)),a=fj(fwt,Ju*8);if(this.signed){let o=fj(a,this.size*8-1);(s>o||s<-(o+dwt))&&this._throwError("value out-of-bounds",r),s=hke(s,8*Ju)}else(s<uwt||s>fj(a,this.size*8))&&this._throwError("value out-of-bounds",r);return n.writeValue(s)}decode(n){let r=fj(n.readValue(),this.size*8);return this.signed&&(r=Wyt(r,this.size*8)),r}}class pwt extends ATe{constructor(t){super("string",t)}defaultValue(){return""}encode(t,n){return super.encode(t,sd(Iu.dereference(n,"string")))}decode(t){return xM(super.decode(t))}}class JI extends b1{constructor(n,r){let s=!1;const a=[];n.forEach(l=>{l.dynamic&&(s=!0),a.push(l.type)});const o="tuple("+a.join(",")+")";super("tuple",o,r,s);Un(this,"coders");Ps(this,{coders:Object.freeze(n.slice())})}defaultValue(){const n=[];this.coders.forEach(s=>{n.push(s.defaultValue())});const r=this.coders.reduce((s,a)=>{const o=a.localName;return o&&(s[o]||(s[o]=0),s[o]++),s},{});return this.coders.forEach((s,a)=>{let o=s.localName;!o||r[o]!==1||(o==="length"&&(o="_length"),n[o]==null&&(n[o]=n[a]))}),Object.freeze(n)}encode(n,r){const s=Iu.dereference(r,"tuple");return STe(n,this.coders,s)}decode(n){return NTe(n,this.coders)}}function RH(e,t){return{address:Ji(e),storageKeys:t.map((n,r)=>(Sn(ao(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function o5(e){if(Array.isArray(e))return e.map((n,r)=>Array.isArray(n)?(Sn(n.length===2,"invalid slot set",`value[${r}]`,n),RH(n[0],n[1])):(Sn(n!=null&&typeof n=="object","invalid address-slot set","value",e),RH(n.address,n.storageKeys)));Sn(e!=null&&typeof e=="object","invalid access list","value",e);const t=Object.keys(e).map(n=>{const r=e[n].reduce((s,a)=>(s[a]=!0,s),{});return RH(n,Object.keys(r).sort())});return t.sort((n,r)=>n.address.localeCompare(r.address)),t}function jTe(e){return{address:Ji(e.address),nonce:gs(e.nonce!=null?e.nonce:0),chainId:gs(e.chainId!=null?e.chainId:0),signature:Zc.from(e.signature)}}function $k(e){let t;return typeof e=="string"?t=P0.computePublicKey(e,!1):t=e.publicKey,Ji(io("0x"+t.substring(4)).substring(26))}function mwt(e,t){return $k(P0.recoverPublicKey(e,t))}const yc=BigInt(0),xwt=BigInt(2),gwt=BigInt(27),bwt=BigInt(28),ywt=BigInt(35),vwt=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),LH=4096*32;function wwt(e){return{blobToKzgCommitment:r=>{if("computeBlobProof"in e){if("blobToKzgCommitment"in e&&typeof e.blobToKzgCommitment=="function")return cs(e.blobToKzgCommitment(Hr(r)))}else if("blobToKzgCommitment"in e&&typeof e.blobToKzgCommitment=="function")return cs(e.blobToKzgCommitment(r));if("blobToKZGCommitment"in e&&typeof e.blobToKZGCommitment=="function")return cs(e.blobToKZGCommitment(Hr(r)));Sn(!1,"unsupported KZG library","kzg",e)},computeBlobKzgProof:(r,s)=>{if("computeBlobProof"in e&&typeof e.computeBlobProof=="function")return cs(e.computeBlobProof(Hr(r),Hr(s)));if("computeBlobKzgProof"in e&&typeof e.computeBlobKzgProof=="function")return e.computeBlobKzgProof(r,s);if("computeBlobKZGProof"in e&&typeof e.computeBlobKZGProof=="function")return cs(e.computeBlobKZGProof(Hr(r),Hr(s)));Sn(!1,"unsupported KZG library","kzg",e)}}}function j0e(e,t){let n=e.toString(16);for(;n.length<2;)n="0"+n;return n+=ep(t).substring(4),"0x"+n}function PA(e){return e==="0x"?null:Ji(e)}function LB(e,t){try{return o5(e)}catch(n){Sn(!1,n.message,t,e)}}function Cwt(e,t){try{if(!Array.isArray(e))throw new Error("authorizationList: invalid array");const n=[];for(let r=0;r<e.length;r++){const s=e[r];if(!Array.isArray(s))throw new Error(`authorization[${r}]: invalid array`);if(s.length!==6)throw new Error(`authorization[${r}]: wrong length`);if(!s[1])throw new Error(`authorization[${r}]: null address`);n.push({address:PA(s[1]),nonce:Ba(s[2],"nonce"),chainId:Ba(s[0],"chainId"),signature:Zc.from({yParity:l5(s[3],"yParity"),r:e1(s[4],32),s:e1(s[5],32)})})}return n}catch(n){Sn(!1,n.message,t,e)}}function l5(e,t){return e==="0x"?0:Mi(e,t)}function Ba(e,t){if(e==="0x")return yc;const n=gs(e,t);return Sn(n<=vwt,"value exceeds uint size",t,n),n}function Zi(e,t){const n=gs(e,"value"),r=tl(n);return Sn(r.length<=32,"value too large",`tx.${t}`,n),r}function DB(e){return o5(e).map(t=>[t.address,t.storageKeys])}function Swt(e){return e.map(t=>[Zi(t.chainId,"chainId"),t.address,Zi(t.nonce,"nonce"),Zi(t.signature.yParity,"yParity"),tl(t.signature.r),tl(t.signature.s)])}function Nwt(e,t){Sn(Array.isArray(e),`invalid ${t}`,"value",e);for(let n=0;n<e.length;n++)Sn(ao(e[n],32),"invalid ${ param } hash",`value[${n}]`,e[n]);return e}function Awt(e){const t=Dk(e);Sn(Array.isArray(t)&&(t.length===9||t.length===6),"invalid field count for legacy transaction","data",e);const n={type:0,nonce:l5(t[0],"nonce"),gasPrice:Ba(t[1],"gasPrice"),gasLimit:Ba(t[2],"gasLimit"),to:PA(t[3]),value:Ba(t[4],"value"),data:Hr(t[5]),chainId:yc};if(t.length===6)return n;const r=Ba(t[6],"v"),s=Ba(t[7],"r"),a=Ba(t[8],"s");if(s===yc&&a===yc)n.chainId=r;else{let o=(r-ywt)/xwt;o<yc&&(o=yc),n.chainId=o,Sn(o!==yc||r===gwt||r===bwt,"non-canonical legacy v","v",t[6]),n.signature=Zc.from({r:e1(t[7],32),s:e1(t[8],32),v:r})}return n}function jwt(e,t){const n=[Zi(e.nonce,"nonce"),Zi(e.gasPrice||0,"gasPrice"),Zi(e.gasLimit,"gasLimit"),e.to||"0x",Zi(e.value,"value"),e.data];let r=yc;if(e.chainId!=yc)r=gs(e.chainId,"tx.chainId"),Sn(!t||t.networkV==null||t.legacyChainId===r,"tx.chainId/sig.v mismatch","sig",t);else if(e.signature){const a=e.signature.legacyChainId;a!=null&&(r=a)}if(!t)return r!==yc&&(n.push(tl(r)),n.push("0x"),n.push("0x")),n1(n);let s=BigInt(27+t.yParity);return r!==yc?s=Zc.getChainIdV(r,t.v):BigInt(t.v)!==s&&Sn(!1,"tx.chainId/sig.v mismatch","sig",t),n.push(tl(s)),n.push(tl(t.r)),n.push(tl(t.s)),n1(n)}function BB(e,t){let n;try{if(n=l5(t[0],"yParity"),n!==0&&n!==1)throw new Error("bad yParity")}catch{Sn(!1,"invalid yParity","yParity",t[0])}const r=e1(t[1],32),s=e1(t[2],32),a=Zc.from({r,s,yParity:n});e.signature=a}function Ewt(e){const t=Dk(cs(e).slice(1));Sn(Array.isArray(t)&&(t.length===9||t.length===12),"invalid field count for transaction type: 2","data",Hr(e));const n={type:2,chainId:Ba(t[0],"chainId"),nonce:l5(t[1],"nonce"),maxPriorityFeePerGas:Ba(t[2],"maxPriorityFeePerGas"),maxFeePerGas:Ba(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:Ba(t[4],"gasLimit"),to:PA(t[5]),value:Ba(t[6],"value"),data:Hr(t[7]),accessList:LB(t[8],"accessList")};return t.length===9||BB(n,t.slice(9)),n}function _wt(e,t){const n=[Zi(e.chainId,"chainId"),Zi(e.nonce,"nonce"),Zi(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Zi(e.maxFeePerGas||0,"maxFeePerGas"),Zi(e.gasLimit,"gasLimit"),e.to||"0x",Zi(e.value,"value"),e.data,DB(e.accessList||[])];return t&&(n.push(Zi(t.yParity,"yParity")),n.push(tl(t.r)),n.push(tl(t.s))),Pa(["0x02",n1(n)])}function kwt(e){const t=Dk(cs(e).slice(1));Sn(Array.isArray(t)&&(t.length===8||t.length===11),"invalid field count for transaction type: 1","data",Hr(e));const n={type:1,chainId:Ba(t[0],"chainId"),nonce:l5(t[1],"nonce"),gasPrice:Ba(t[2],"gasPrice"),gasLimit:Ba(t[3],"gasLimit"),to:PA(t[4]),value:Ba(t[5],"value"),data:Hr(t[6]),accessList:LB(t[7],"accessList")};return t.length===8||BB(n,t.slice(8)),n}function Twt(e,t){const n=[Zi(e.chainId,"chainId"),Zi(e.nonce,"nonce"),Zi(e.gasPrice||0,"gasPrice"),Zi(e.gasLimit,"gasLimit"),e.to||"0x",Zi(e.value,"value"),e.data,DB(e.accessList||[])];return t&&(n.push(Zi(t.yParity,"recoveryParam")),n.push(tl(t.r)),n.push(tl(t.s))),Pa(["0x01",n1(n)])}function Iwt(e){let t=Dk(cs(e).slice(1)),n="3",r=null;if(t.length===4&&Array.isArray(t[0])){n="3 (network format)";const a=t[1],o=t[2],l=t[3];Sn(Array.isArray(a),"invalid network format: blobs not an array","fields[1]",a),Sn(Array.isArray(o),"invalid network format: commitments not an array","fields[2]",o),Sn(Array.isArray(l),"invalid network format: proofs not an array","fields[3]",l),Sn(a.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",t),Sn(a.length===l.length,"invalid network format: blobs/proofs length mismatch","fields",t),r=[];for(let c=0;c<t[1].length;c++)r.push({data:a[c],commitment:o[c],proof:l[c]});t=t[0]}Sn(Array.isArray(t)&&(t.length===11||t.length===14),`invalid field count for transaction type: ${n}`,"data",Hr(e));const s={type:3,chainId:Ba(t[0],"chainId"),nonce:l5(t[1],"nonce"),maxPriorityFeePerGas:Ba(t[2],"maxPriorityFeePerGas"),maxFeePerGas:Ba(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:Ba(t[4],"gasLimit"),to:PA(t[5]),value:Ba(t[6],"value"),data:Hr(t[7]),accessList:LB(t[8],"accessList"),maxFeePerBlobGas:Ba(t[9],"maxFeePerBlobGas"),blobVersionedHashes:t[10]};r&&(s.blobs=r),Sn(s.to!=null,`invalid address for transaction type: ${n}`,"data",e),Sn(Array.isArray(s.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",e);for(let a=0;a<s.blobVersionedHashes.length;a++)Sn(ao(s.blobVersionedHashes[a],32),`invalid blobVersionedHash at index ${a}: must be length 32`,"data",e);return t.length===11||BB(s,t.slice(11)),s}function Pwt(e,t,n){const r=[Zi(e.chainId,"chainId"),Zi(e.nonce,"nonce"),Zi(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Zi(e.maxFeePerGas||0,"maxFeePerGas"),Zi(e.gasLimit,"gasLimit"),e.to||lE,Zi(e.value,"value"),e.data,DB(e.accessList||[]),Zi(e.maxFeePerBlobGas||0,"maxFeePerBlobGas"),Nwt(e.blobVersionedHashes||[],"blobVersionedHashes")];return t&&(r.push(Zi(t.yParity,"yParity")),r.push(tl(t.r)),r.push(tl(t.s)),n)?Pa(["0x03",n1([r,n.map(s=>s.data),n.map(s=>s.commitment),n.map(s=>s.proof)])]):Pa(["0x03",n1(r)])}function Fwt(e){const t=Dk(cs(e).slice(1));Sn(Array.isArray(t)&&(t.length===10||t.length===13),"invalid field count for transaction type: 4","data",Hr(e));const n={type:4,chainId:Ba(t[0],"chainId"),nonce:l5(t[1],"nonce"),maxPriorityFeePerGas:Ba(t[2],"maxPriorityFeePerGas"),maxFeePerGas:Ba(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:Ba(t[4],"gasLimit"),to:PA(t[5]),value:Ba(t[6],"value"),data:Hr(t[7]),accessList:LB(t[8],"accessList"),authorizationList:Cwt(t[9],"authorizationList")};return t.length===10||BB(n,t.slice(10)),n}function Owt(e,t){const n=[Zi(e.chainId,"chainId"),Zi(e.nonce,"nonce"),Zi(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Zi(e.maxFeePerGas||0,"maxFeePerGas"),Zi(e.gasLimit,"gasLimit"),e.to||"0x",Zi(e.value,"value"),e.data,DB(e.accessList||[]),Swt(e.authorizationList||[])];return t&&(n.push(Zi(t.yParity,"yParity")),n.push(tl(t.r)),n.push(tl(t.s))),Pa(["0x04",n1(n)])}var Dp,U4,z4,H4,V4,W4,q4,G4,K4,Y4,X4,Q4,Ew,Wb,s0,qb,Z4,J4,YF,kf;let xae=(kf=class{constructor(){Ln(this,J4);Ln(this,Dp);Ln(this,U4);Ln(this,z4);Ln(this,H4);Ln(this,V4);Ln(this,W4);Ln(this,q4);Ln(this,G4);Ln(this,K4);Ln(this,Y4);Ln(this,X4);Ln(this,Q4);Ln(this,Ew);Ln(this,Wb);Ln(this,s0);Ln(this,qb);Ln(this,Z4);Ht(this,Dp,null),Ht(this,U4,null),Ht(this,H4,0),Ht(this,V4,yc),Ht(this,W4,null),Ht(this,q4,null),Ht(this,G4,null),Ht(this,z4,"0x"),Ht(this,K4,yc),Ht(this,Y4,yc),Ht(this,X4,null),Ht(this,Q4,null),Ht(this,Ew,null),Ht(this,Wb,null),Ht(this,s0,null),Ht(this,qb,null),Ht(this,Z4,null)}get type(){return $e(this,Dp)}set type(t){switch(t){case null:Ht(this,Dp,null);break;case 0:case"legacy":Ht(this,Dp,0);break;case 1:case"berlin":case"eip-2930":Ht(this,Dp,1);break;case 2:case"london":case"eip-1559":Ht(this,Dp,2);break;case 3:case"cancun":case"eip-4844":Ht(this,Dp,3);break;case 4:case"pectra":case"eip-7702":Ht(this,Dp,4);break;default:Sn(!1,"unsupported transaction type","type",t)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844";case 4:return"eip-7702"}return null}get to(){const t=$e(this,U4);return t==null&&this.type===3?lE:t}set to(t){Ht(this,U4,t==null?null:Ji(t))}get nonce(){return $e(this,H4)}set nonce(t){Ht(this,H4,Mi(t,"value"))}get gasLimit(){return $e(this,V4)}set gasLimit(t){Ht(this,V4,gs(t))}get gasPrice(){const t=$e(this,W4);return t==null&&(this.type===0||this.type===1)?yc:t}set gasPrice(t){Ht(this,W4,t==null?null:gs(t,"gasPrice"))}get maxPriorityFeePerGas(){const t=$e(this,q4);return t??(this.type===2||this.type===3?yc:null)}set maxPriorityFeePerGas(t){Ht(this,q4,t==null?null:gs(t,"maxPriorityFeePerGas"))}get maxFeePerGas(){const t=$e(this,G4);return t??(this.type===2||this.type===3?yc:null)}set maxFeePerGas(t){Ht(this,G4,t==null?null:gs(t,"maxFeePerGas"))}get data(){return $e(this,z4)}set data(t){Ht(this,z4,Hr(t))}get value(){return $e(this,K4)}set value(t){Ht(this,K4,gs(t,"value"))}get chainId(){return $e(this,Y4)}set chainId(t){Ht(this,Y4,gs(t))}get signature(){return $e(this,X4)||null}set signature(t){Ht(this,X4,t==null?null:Zc.from(t))}get accessList(){const t=$e(this,Q4)||null;return t??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(t){Ht(this,Q4,t==null?null:o5(t))}get authorizationList(){const t=$e(this,Z4)||null;return t==null&&this.type===4?[]:t}set authorizationList(t){Ht(this,Z4,t==null?null:t.map(n=>jTe(n)))}get maxFeePerBlobGas(){const t=$e(this,Ew);return t==null&&this.type===3?yc:t}set maxFeePerBlobGas(t){Ht(this,Ew,t==null?null:gs(t,"maxFeePerBlobGas"))}get blobVersionedHashes(){let t=$e(this,Wb);return t==null&&this.type===3?[]:t}set blobVersionedHashes(t){if(t!=null){Sn(Array.isArray(t),"blobVersionedHashes must be an Array","value",t),t=t.slice();for(let n=0;n<t.length;n++)Sn(ao(t[n],32),"invalid blobVersionedHash",`value[${n}]`,t[n])}Ht(this,Wb,t)}get blobs(){return $e(this,qb)==null?null:$e(this,qb).map(t=>Object.assign({},t))}set blobs(t){if(t==null){Ht(this,qb,null);return}const n=[],r=[];for(let s=0;s<t.length;s++){const a=t[s];if(kB(a)){Fr($e(this,s0),"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let o=cs(a);if(Sn(o.length<=LH,"blob is too large",`blobs[${s}]`,a),o.length!==LH){const u=new Uint8Array(LH);u.set(o),o=u}const l=$e(this,s0).blobToKzgCommitment(o),c=Hr($e(this,s0).computeBlobKzgProof(o,l));n.push({data:Hr(o),commitment:Hr(l),proof:c}),r.push(j0e(1,l))}else{const o=Hr(a.commitment);n.push({data:Hr(a.data),commitment:o,proof:Hr(a.proof)}),r.push(j0e(1,o))}}Ht(this,qb,n),Ht(this,Wb,r)}get kzg(){return $e(this,s0)}set kzg(t){t==null?Ht(this,s0,null):Ht(this,s0,wwt(t))}get hash(){return this.signature==null?null:io(yr(this,J4,YF).call(this,!0,!1))}get unsignedHash(){return io(this.unsignedSerialized)}get from(){return this.signature==null?null:mwt(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:P0.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){return yr(this,J4,YF).call(this,!0,!0)}get unsignedSerialized(){return yr(this,J4,YF).call(this,!1,!1)}inferType(){const t=this.inferTypes();return t.indexOf(2)>=0?2:t.pop()}inferTypes(){const t=this.gasPrice!=null,n=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,r=this.accessList!=null,s=$e(this,Ew)!=null||$e(this,Wb);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&Fr(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),Fr(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),Fr(this.type!==0||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const a=[];return this.type!=null?a.push(this.type):this.authorizationList&&this.authorizationList.length?a.push(4):n?a.push(2):t?(a.push(1),r||a.push(0)):r?(a.push(1),a.push(2)):(s&&this.to||(a.push(0),a.push(1),a.push(2)),a.push(3)),a.sort(),a}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return kf.from(this)}toJSON(){const t=n=>n==null?null:n.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:t(this.gasLimit),gasPrice:t(this.gasPrice),maxPriorityFeePerGas:t(this.maxPriorityFeePerGas),maxFeePerGas:t(this.maxFeePerGas),value:t(this.value),chainId:t(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(t){if(t==null)return new kf;if(typeof t=="string"){const r=cs(t);if(r[0]>=127)return kf.from(Awt(r));switch(r[0]){case 1:return kf.from(kwt(r));case 2:return kf.from(Ewt(r));case 3:return kf.from(Iwt(r));case 4:return kf.from(Fwt(r))}Fr(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new kf;return t.type!=null&&(n.type=t.type),t.to!=null&&(n.to=t.to),t.nonce!=null&&(n.nonce=t.nonce),t.gasLimit!=null&&(n.gasLimit=t.gasLimit),t.gasPrice!=null&&(n.gasPrice=t.gasPrice),t.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=t.maxPriorityFeePerGas),t.maxFeePerGas!=null&&(n.maxFeePerGas=t.maxFeePerGas),t.maxFeePerBlobGas!=null&&(n.maxFeePerBlobGas=t.maxFeePerBlobGas),t.data!=null&&(n.data=t.data),t.value!=null&&(n.value=t.value),t.chainId!=null&&(n.chainId=t.chainId),t.signature!=null&&(n.signature=Zc.from(t.signature)),t.accessList!=null&&(n.accessList=t.accessList),t.authorizationList!=null&&(n.authorizationList=t.authorizationList),t.blobVersionedHashes!=null&&(n.blobVersionedHashes=t.blobVersionedHashes),t.kzg!=null&&(n.kzg=t.kzg),t.blobs!=null&&(n.blobs=t.blobs),t.hash!=null&&(Sn(n.isSigned(),"unsigned transaction cannot define '.hash'","tx",t),Sn(n.hash===t.hash,"hash mismatch","tx",t)),t.from!=null&&(Sn(n.isSigned(),"unsigned transaction cannot define '.from'","tx",t),Sn(n.from.toLowerCase()===(t.from||"").toLowerCase(),"from mismatch","tx",t)),n}},Dp=new WeakMap,U4=new WeakMap,z4=new WeakMap,H4=new WeakMap,V4=new WeakMap,W4=new WeakMap,q4=new WeakMap,G4=new WeakMap,K4=new WeakMap,Y4=new WeakMap,X4=new WeakMap,Q4=new WeakMap,Ew=new WeakMap,Wb=new WeakMap,s0=new WeakMap,qb=new WeakMap,Z4=new WeakMap,J4=new WeakSet,YF=function(t,n){Fr(!t||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const r=t?this.signature:null;switch(this.inferType()){case 0:return jwt(this,r);case 1:return Twt(this,r);case 2:return _wt(this,r);case 3:return Pwt(this,r,n?this.blobs:null);case 4:return Owt(this,r)}Fr(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})},kf);function Mwt(e){return Sn(typeof e.address=="string","invalid address for hashAuthorization","auth.address",e),io(Pa(["0x05",n1([e.chainId!=null?tl(e.chainId):"0x",Ji(e.address),e.nonce!=null?tl(e.nonce):"0x"])]))}function r1(e){return io(sd(e))}var Rwt="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const E0e=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),_0e=4;function Lwt(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),s=1,a=[0,1];for(let F=1;F<r;F++)a.push(s+=n());let o=n(),l=t;t+=o;let c=0,u=0;function d(){return c==0&&(u=u<<8|e[t++],c=8),u>>--c&1}const f=31,x=2**f,g=x>>>1,v=g>>1,w=x-1;let C=0;for(let F=0;F<f;F++)C=C<<1|d();let N=[],I=0,P=x;for(;;){let F=Math.floor(((C-I+1)*s-1)/P),U=0,L=r;for(;L-U>1;){let ne=U+L>>>1;F<a[ne]?L=ne:U=ne}if(U==0)break;N.push(U);let z=I+Math.floor(P*a[U]/s),X=I+Math.floor(P*a[U+1]/s)-1;for(;!((z^X)&g);)C=C<<1&w|d(),z=z<<1&w,X=X<<1&w|1;for(;z&~X&v;)C=C&g|C<<1&w>>>1|d(),z=z<<1^g,X=(X^g)<<1|g|1;I=z,P=1+X-z}let R=r-4;return N.map(F=>{switch(F-R){case 3:return R+65792+(e[l++]<<16|e[l++]<<8|e[l++]);case 2:return R+256+(e[l++]<<8|e[l++]);case 1:return R+e[l++];default:return F-1}})}function Dwt(e){let t=0;return()=>e[t++]}function ETe(e){return Dwt(Lwt(Bwt(e)))}function Bwt(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,a)=>t[s.charCodeAt(0)]=a);let n=e.length,r=new Uint8Array(6*n>>3);for(let s=0,a=0,o=0,l=0;s<n;s++)l=l<<6|t[e.charCodeAt(s)],o+=6,o>=8&&(r[a++]=l>>(o-=8));return r}function $wt(e){return e&1?~e>>1:e>>1}function Uwt(e,t){let n=Array(e);for(let r=0,s=0;r<e;r++)n[r]=s+=$wt(t());return n}function cE(e,t=0){let n=[];for(;;){let r=e(),s=e();if(!s)break;t+=r;for(let a=0;a<s;a++)n.push(t+a);t+=s+1}return n}function _Te(e){return uE(()=>{let t=cE(e);if(t.length)return t})}function kTe(e){let t=[];for(;;){let n=e();if(n==0)break;t.push(zwt(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(Hwt(n,e))}return t.flat()}function uE(e){let t=[];for(;;){let n=e(t.length);if(!n)break;t.push(n)}return t}function TTe(e,t,n){let r=Array(e).fill().map(()=>[]);for(let s=0;s<t;s++)Uwt(e,n).forEach((a,o)=>r[o].push(a));return r}function zwt(e,t){let n=1+t(),r=t(),s=uE(t);return TTe(s.length,1+e,t).flatMap((o,l)=>{let[c,...u]=o;return Array(s[l]).fill().map((d,f)=>{let x=f*r;return[c+f*n,u.map(g=>g+x)]})})}function Hwt(e,t){let n=1+t();return TTe(n,1+e,t).map(s=>[s[0],s.slice(1)])}function Vwt(e){let t=[],n=cE(e);return s(r([]),[]),t;function r(a){let o=e(),l=uE(()=>{let c=cE(e).map(u=>n[u]);if(c.length)return r(c)});return{S:o,B:l,Q:a}}function s({S:a,B:o},l,c){if(!(a&4&&c===l[l.length-1])){a&2&&(c=l[l.length-1]),a&1&&t.push(l);for(let u of o)for(let d of u.Q)s(u,[...l,d],c)}}}function Wwt(e){return e.toString(16).toUpperCase().padStart(2,"0")}function ITe(e){return`{${Wwt(e)}}`}function qwt(e){let t=[];for(let n=0,r=e.length;n<r;){let s=e.codePointAt(n);n+=s<65536?1:2,t.push(s)}return t}function BS(e){let n=e.length;if(n<4096)return String.fromCodePoint(...e);let r=[];for(let s=0;s<n;)r.push(String.fromCodePoint(...e.slice(s,s+=4096)));return r.join("")}function Gwt(e,t){let n=e.length,r=n-t.length;for(let s=0;r==0&&s<n;s++)r=e[s]-t[s];return r}var Kwt="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g";const dE=44032,bM=4352,yM=4449,vM=4519,PTe=19,FTe=21,$S=28,wM=FTe*$S,Ywt=PTe*wM,Xwt=dE+Ywt,Qwt=bM+PTe,Zwt=yM+FTe,Jwt=vM+$S;function pj(e){return e>>24&255}function OTe(e){return e&16777215}let TJ,k0e,IJ,XF;function e3t(){let e=ETe(Kwt);TJ=new Map(_Te(e).flatMap((t,n)=>t.map(r=>[r,n+1<<24]))),k0e=new Set(cE(e)),IJ=new Map,XF=new Map;for(let[t,n]of kTe(e)){if(!k0e.has(t)&&n.length==2){let[r,s]=n,a=XF.get(r);a||(a=new Map,XF.set(r,a)),a.set(s,t)}IJ.set(t,n.reverse())}}function MTe(e){return e>=dE&&e<Xwt}function t3t(e,t){if(e>=bM&&e<Qwt&&t>=yM&&t<Zwt)return dE+(e-bM)*wM+(t-yM)*$S;if(MTe(e)&&t>vM&&t<Jwt&&(e-dE)%$S==0)return e+(t-vM);{let n=XF.get(e);return n&&(n=n.get(t),n)?n:-1}}function RTe(e){TJ||e3t();let t=[],n=[],r=!1;function s(a){let o=TJ.get(a);o&&(r=!0,a|=o),t.push(a)}for(let a of e)for(;;){if(a<128)t.push(a);else if(MTe(a)){let o=a-dE,l=o/wM|0,c=o%wM/$S|0,u=o%$S;s(bM+l),s(yM+c),u>0&&s(vM+u)}else{let o=IJ.get(a);o?n.push(...o):s(a)}if(!n.length)break;a=n.pop()}if(r&&t.length>1){let a=pj(t[0]);for(let o=1;o<t.length;o++){let l=pj(t[o]);if(l==0||a<=l){a=l;continue}let c=o-1;for(;;){let u=t[c+1];if(t[c+1]=t[c],t[c]=u,!c||(a=pj(t[--c]),a<=l))break}a=pj(t[o])}}return t}function n3t(e){let t=[],n=[],r=-1,s=0;for(let a of e){let o=pj(a),l=OTe(a);if(r==-1)o==0?r=l:t.push(l);else if(s>0&&s>=o)o==0?(t.push(r,...n),n.length=0,r=l):n.push(l),s=o;else{let c=t3t(r,l);c>=0?r=c:s==0&&o==0?(t.push(r),r=l):(n.push(l),s=o)}}return r>=0&&t.push(r,...n),t}function LTe(e){return RTe(e).map(OTe)}function r3t(e){return n3t(RTe(e))}const T0e=45,DTe=".",BTe=65039,$Te=1,CM=e=>Array.from(e);function fE(e,t){return e.P.has(t)||e.Q.has(t)}let s3t=class extends Array{get is_emoji(){return!0}},PJ,UTe,Wv,FJ,zTe,n4,DH,xC,wv,I0e,OJ;function gae(){if(PJ)return;let e=ETe(Rwt);const t=()=>cE(e),n=()=>new Set(t()),r=(d,f)=>f.forEach(x=>d.add(x));PJ=new Map(kTe(e)),UTe=n(),Wv=t(),FJ=new Set(t().map(d=>Wv[d])),Wv=new Set(Wv),zTe=n(),n();let s=_Te(e),a=e();const o=()=>{let d=new Set;return t().forEach(f=>r(d,s[f])),r(d,t()),d};n4=uE(d=>{let f=uE(e).map(x=>x+96);if(f.length){let x=d>=a;f[0]-=32,f=BS(f),x&&(f=`Restricted[${f}]`);let g=o(),v=o(),w=!e();return{N:f,P:g,Q:v,M:w,R:x}}}),DH=n(),xC=new Map;let l=t().concat(CM(DH)).sort((d,f)=>d-f);l.forEach((d,f)=>{let x=e(),g=l[f]=x?l[f-x]:{V:[],M:new Map};g.V.push(d),DH.has(d)||xC.set(d,g)});for(let{V:d,M:f}of new Set(xC.values())){let x=[];for(let v of d){let w=n4.filter(N=>fE(N,v)),C=x.find(({G:N})=>w.some(I=>N.has(I)));C||(C={G:new Set,V:[]},x.push(C)),C.V.push(v),r(C.G,w)}let g=x.flatMap(v=>CM(v.G));for(let{G:v,V:w}of x){let C=new Set(g.filter(N=>!v.has(N)));for(let N of w)f.set(N,C)}}wv=new Set;let c=new Set;const u=d=>wv.has(d)?c.add(d):wv.add(d);for(let d of n4){for(let f of d.P)u(f);for(let f of d.Q)u(f)}for(let d of wv)!xC.has(d)&&!c.has(d)&&xC.set(d,$Te);r(wv,LTe(wv)),I0e=Vwt(e).map(d=>s3t.from(d)).sort(Gwt),OJ=new Map;for(let d of I0e){let f=[OJ];for(let x of d){let g=f.map(v=>{let w=v.get(x);return w||(w=new Map,v.set(x,w)),w});x===BTe?f.push(...g):f=g}for(let x of f)x.V=d}}function bae(e){return(HTe(e)?"":`${yae($B([e]))} `)+ITe(e)}function yae(e){return`"${e}"‎`}function i3t(e){if(e.length>=4&&e[2]==T0e&&e[3]==T0e)throw new Error(`invalid label extension: "${BS(e.slice(0,4))}"`)}function a3t(e){for(let n=e.lastIndexOf(95);n>0;)if(e[--n]!==95)throw new Error("underscore allowed only at start")}function o3t(e){let t=e[0],n=E0e.get(t);if(n)throw Hj(`leading ${n}`);let r=e.length,s=-1;for(let a=1;a<r;a++){t=e[a];let o=E0e.get(t);if(o){if(s==a)throw Hj(`${n} + ${o}`);s=a+1,n=o}}if(s==r)throw Hj(`trailing ${n}`)}function $B(e,t=1/0,n=ITe){let r=[];l3t(e[0])&&r.push("◌"),e.length>t&&(t>>=1,e=[...e.slice(0,t),8230,...e.slice(-t)]);let s=0,a=e.length;for(let o=0;o<a;o++){let l=e[o];HTe(l)&&(r.push(BS(e.slice(s,o))),r.push(n(l)),s=o+1)}return r.push(BS(e.slice(s,a))),r.join("")}function l3t(e){return gae(),Wv.has(e)}function HTe(e){return gae(),zTe.has(e)}function c3t(e){return h3t(u3t(e,r3t,x3t))}function u3t(e,t,n){if(!e)return[];gae();let r=0;return e.split(DTe).map(s=>{let a=qwt(s),o={input:a,offset:r};r+=a.length+1;try{let l=o.tokens=m3t(a,t,n),c=l.length,u;if(!c)throw new Error("empty label");let d=o.output=l.flat();if(a3t(d),!(o.emoji=c>1||l[0].is_emoji)&&d.every(x=>x<128))i3t(d),u="ASCII";else{let x=l.flatMap(g=>g.is_emoji?[]:g);if(!x.length)u="Emoji";else{if(Wv.has(d[0]))throw Hj("leading combining mark");for(let w=1;w<c;w++){let C=l[w];if(!C.is_emoji&&Wv.has(C[0]))throw Hj(`emoji + combining mark: "${BS(l[w-1])} + ${$B([C[0]])}"`)}o3t(d);let g=CM(new Set(x)),[v]=f3t(g);p3t(v,x),d3t(v,g),u=v.N}}o.type=u}catch(l){o.error=l}return o})}function d3t(e,t){let n,r=[];for(let s of t){let a=xC.get(s);if(a===$Te)return;if(a){let o=a.M.get(s);if(n=n?n.filter(l=>o.has(l)):CM(o),!n.length)return}else r.push(s)}if(n){for(let s of n)if(r.every(a=>fE(s,a)))throw new Error(`whole-script confusable: ${e.N}/${s.N}`)}}function f3t(e){let t=n4;for(let n of e){let r=t.filter(s=>fE(s,n));if(!r.length)throw n4.some(s=>fE(s,n))?WTe(t[0],n):VTe(n);if(t=r,r.length==1)break}return t}function h3t(e){return e.map(({input:t,error:n,output:r})=>{if(n){let s=n.message;throw new Error(e.length==1?s:`Invalid label ${yae($B(t,63))}: ${s}`)}return BS(r)}).join(DTe)}function VTe(e){return new Error(`disallowed character: ${bae(e)}`)}function WTe(e,t){let n=bae(t),r=n4.find(s=>s.P.has(t));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${e.N} + ${n}`)}function Hj(e){return new Error(`illegal placement: ${e}`)}function p3t(e,t){for(let n of t)if(!fE(e,n))throw WTe(e,n);if(e.M){let n=LTe(t);for(let r=1,s=n.length;r<s;r++)if(FJ.has(n[r])){let a=r+1;for(let o;a<s&&FJ.has(o=n[a]);a++)for(let l=r;l<a;l++)if(n[l]==o)throw new Error(`duplicate non-spacing marks: ${bae(o)}`);if(a-r>_0e)throw new Error(`excessive non-spacing marks: ${yae($B(n.slice(r-1,a)))} (${a-r}/${_0e})`);r=a}}}function m3t(e,t,n){let r=[],s=[];for(e=e.slice().reverse();e.length;){let a=g3t(e);if(a)s.length&&(r.push(t(s)),s=[]),r.push(n(a));else{let o=e.pop();if(wv.has(o))s.push(o);else{let l=PJ.get(o);if(l)s.push(...l);else if(!UTe.has(o))throw VTe(o)}}}return s.length&&r.push(t(s)),r}function x3t(e){return e.filter(t=>t!=BTe)}function g3t(e,t){let n=OJ,r,s=e.length;for(;s&&(n=n.get(e[--s]),!!n);){let{V:a}=n;a&&(r=a,e.length=s)}return r}const qTe=new Uint8Array(32);qTe.fill(0);function P0e(e){return Sn(e.length!==0,"invalid ENS name; empty component","comp",e),e}function GTe(e){const t=sd(b3t(e)),n=[];if(e.length===0)return n;let r=0;for(let s=0;s<t.length;s++)t[s]===46&&(n.push(P0e(t.slice(r,s))),r=s+1);return Sn(r<t.length,"invalid ENS name; empty component","name",e),n.push(P0e(t.slice(r))),n}function b3t(e){try{if(e.length===0)throw new Error("empty label");return c3t(e)}catch(t){Sn(!1,`invalid ENS name (${t.message})`,"name",e)}}function MJ(e){Sn(typeof e=="string","invalid ENS name; not a string","name",e),Sn(e.length,"invalid ENS name (empty label)","name",e);let t=qTe;const n=GTe(e);for(;n.length;)t=io(Pa([t,io(n.pop())]));return Hr(t)}function y3t(e,t){const n=t;return Sn(n<=255,"DNS encoded label cannot exceed 255","length",n),Hr(Pa(GTe(e).map(r=>{Sn(r.length<=n,`label ${JSON.stringify(e)} exceeds ${n} bytes`,"name",e);const s=new Uint8Array(r.length+1);return s.set(r,1),s[0]=s.length-1,s})))+"00"}function v3t(e){return typeof e=="string"&&(e=sd(e)),io(Pa([sd(Yvt),sd(String(e.length)),e]))}const KTe=new Uint8Array(32);KTe.fill(0);const w3t=BigInt(-1),YTe=BigInt(0),XTe=BigInt(1),C3t=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function S3t(e){const t=cs(e),n=t.length%32;return n?Pa([t,KTe.slice(n)]):Hr(t)}const N3t=t1(XTe,32),A3t=t1(YTe,32),F0e={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},BH=["name","version","chainId","verifyingContract","salt"];function O0e(e){return function(t){return Sn(typeof t=="string",`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const j3t={name:O0e("name"),version:O0e("version"),chainId:function(e){const t=gs(e,"domain.chainId");return Sn(t>=0,"invalid chain ID","domain.chainId",e),Number.isSafeInteger(t)?Number(t):qp(t)},verifyingContract:function(e){try{return Ji(e).toLowerCase()}catch{}Sn(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){const t=cs(e,"domain.salt");return Sn(t.length===32,'invalid domain value "salt"',"domain.salt",e),Hr(t)}};function $H(e){{const t=e.match(/^(u?)int(\d+)$/);if(t){const n=t[1]==="",r=parseInt(t[2]);Sn(r%8===0&&r!==0&&r<=256&&t[2]===String(r),"invalid numeric width","type",e);const s=fj(C3t,n?r-1:r),a=n?(s+XTe)*w3t:YTe;return function(o){const l=gs(o,"value");return Sn(l>=a&&l<=s,`value out-of-bounds for ${e}`,"value",l),t1(n?hke(l,256):l,32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const n=parseInt(t[1]);return Sn(n!==0&&n<=32&&t[1]===String(n),"invalid bytes width","type",e),function(r){const s=cs(r);return Sn(s.length===n,`invalid length for ${e}`,"value",r),S3t(r)}}}switch(e){case"address":return function(t){return e1(Ji(t),32)};case"bool":return function(t){return t?N3t:A3t};case"bytes":return function(t){return io(t)};case"string":return function(t){return r1(t)}}return null}function M0e(e,t){return`${e}(${t.map(({name:n,type:r})=>r+" "+n).join(",")})`}function eP(e){const t=e.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return t?{base:t[1],index:t[2]+t[4],array:{base:t[1],prefix:t[1]+t[2],count:t[5]?parseInt(t[5]):-1}}:{base:e}}var ek,xg,eS,uD,QTe;const Ah=class Ah{constructor(t){Ln(this,uD);Un(this,"primaryType");Ln(this,ek);Ln(this,xg);Ln(this,eS);Ht(this,xg,new Map),Ht(this,eS,new Map);const n=new Map,r=new Map,s=new Map,a={};Object.keys(t).forEach(c=>{a[c]=t[c].map(({name:u,type:d})=>{let{base:f,index:x}=eP(d);return f==="int"&&!t.int&&(f="int256"),f==="uint"&&!t.uint&&(f="uint256"),{name:u,type:f+(x||"")}}),n.set(c,new Set),r.set(c,[]),s.set(c,new Set)}),Ht(this,ek,JSON.stringify(a));for(const c in a){const u=new Set;for(const d of a[c]){Sn(!u.has(d.name),`duplicate variable name ${JSON.stringify(d.name)} in ${JSON.stringify(c)}`,"types",t),u.add(d.name);const f=eP(d.type).base;Sn(f!==c,`circular type reference to ${JSON.stringify(f)}`,"types",t),!$H(f)&&(Sn(r.has(f),`unknown type ${JSON.stringify(f)}`,"types",t),r.get(f).push(c),n.get(c).add(f))}}const o=Array.from(r.keys()).filter(c=>r.get(c).length===0);Sn(o.length!==0,"missing primary type","types",t),Sn(o.length===1,`ambiguous primary types or unused types: ${o.map(c=>JSON.stringify(c)).join(", ")}`,"types",t),Ps(this,{primaryType:o[0]});function l(c,u){Sn(!u.has(c),`circular type reference to ${JSON.stringify(c)}`,"types",t),u.add(c);for(const d of n.get(c))if(r.has(d)){l(d,u);for(const f of u)s.get(f).add(d)}u.delete(c)}l(this.primaryType,new Set);for(const[c,u]of s){const d=Array.from(u);d.sort(),$e(this,xg).set(c,M0e(c,a[c])+d.map(f=>M0e(f,a[f])).join(""))}}get types(){return JSON.parse($e(this,ek))}getEncoder(t){let n=$e(this,eS).get(t);return n||(n=yr(this,uD,QTe).call(this,t),$e(this,eS).set(t,n)),n}encodeType(t){const n=$e(this,xg).get(t);return Sn(n,`unknown type: ${JSON.stringify(t)}`,"name",t),n}encodeData(t,n){return this.getEncoder(t)(n)}hashStruct(t,n){return io(this.encodeData(t,n))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,n,r){if($H(t))return r(t,n);const s=eP(t).array;if(s)return Sn(s.count===-1||s.count===n.length,`array length mismatch; expected length ${s.count}`,"value",n),n.map(o=>this._visit(s.prefix,o,r));const a=this.types[t];if(a)return a.reduce((o,{name:l,type:c})=>(o[l]=this._visit(c,n[l],r),o),{});Sn(!1,`unknown type: ${t}`,"type",t)}visit(t,n){return this._visit(this.primaryType,t,n)}static from(t){return new Ah(t)}static getPrimaryType(t){return Ah.from(t).primaryType}static hashStruct(t,n,r){return Ah.from(n).hashStruct(t,r)}static hashDomain(t){const n=[];for(const r in t){if(t[r]==null)continue;const s=F0e[r];Sn(s,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),n.push({name:r,type:s})}return n.sort((r,s)=>BH.indexOf(r.name)-BH.indexOf(s.name)),Ah.hashStruct("EIP712Domain",{EIP712Domain:n},t)}static encode(t,n,r){return Pa(["0x1901",Ah.hashDomain(t),Ah.from(n).hash(r)])}static hash(t,n,r){return io(Ah.encode(t,n,r))}static async resolveNames(t,n,r,s){t=Object.assign({},t);for(const l in t)t[l]==null&&delete t[l];const a={};t.verifyingContract&&!ao(t.verifyingContract,20)&&(a[t.verifyingContract]="0x");const o=Ah.from(n);o.visit(r,(l,c)=>(l==="address"&&!ao(c,20)&&(a[c]="0x"),c));for(const l in a)a[l]=await s(l);return t.verifyingContract&&a[t.verifyingContract]&&(t.verifyingContract=a[t.verifyingContract]),r=o.visit(r,(l,c)=>l==="address"&&a[c]?a[c]:c),{domain:t,value:r}}static getPayload(t,n,r){Ah.hashDomain(t);const s={},a=[];BH.forEach(c=>{const u=t[c];u!=null&&(s[c]=j3t[c](u),a.push({name:c,type:F0e[c]}))});const o=Ah.from(n);n=o.types;const l=Object.assign({},n);return Sn(l.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),l.EIP712Domain=a,o.encode(r),{types:l,domain:s,primaryType:o.primaryType,message:o.visit(r,(c,u)=>{if(c.match(/^bytes(\d*)/))return Hr(cs(u));if(c.match(/^u?int/))return gs(u).toString();switch(c){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return Sn(typeof u=="string","invalid string","value",u),u}Sn(!1,"unsupported type","type",c)})}}};ek=new WeakMap,xg=new WeakMap,eS=new WeakMap,uD=new WeakSet,QTe=function(t){{const s=$H(t);if(s)return s}const n=eP(t).array;if(n){const s=n.prefix,a=this.getEncoder(s);return o=>{Sn(n.count===-1||n.count===o.length,`array length mismatch; expected length ${n.count}`,"value",o);let l=o.map(a);return $e(this,xg).has(s)&&(l=l.map(io)),io(Pa(l))}}const r=this.types[t];if(r){const s=r1($e(this,xg).get(t));return a=>{const o=r.map(({name:l,type:c})=>{const u=this.getEncoder(c)(a[l]);return $e(this,xg).has(c)?io(u):u});return o.unshift(s),Pa(o)}}Sn(!1,`unknown type: ${t}`,"type",t)};let US=Ah;function ed(e){const t=new Set;return e.forEach(n=>t.add(n)),Object.freeze(t)}const E3t="external public payable override",_3t=ed(E3t.split(" ")),ZTe="constant external internal payable private public pure view override",k3t=ed(ZTe.split(" ")),JTe="constructor error event fallback function receive struct",eIe=ed(JTe.split(" ")),tIe="calldata memory storage payable indexed",T3t=ed(tIe.split(" ")),I3t="tuple returns",P3t=[JTe,tIe,I3t,ZTe].join(" "),F3t=ed(P3t.split(" ")),O3t={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},M3t=new RegExp("^(\\s*)"),R3t=new RegExp("^([0-9]+)"),L3t=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),nIe=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),rIe=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var Uc,Bp,tk,RJ;const dD=class dD{constructor(t){Ln(this,tk);Ln(this,Uc);Ln(this,Bp);Ht(this,Uc,0),Ht(this,Bp,t.slice())}get offset(){return $e(this,Uc)}get length(){return $e(this,Bp).length-$e(this,Uc)}clone(){return new dD($e(this,Bp))}reset(){Ht(this,Uc,0)}popKeyword(t){const n=this.peek();if(n.type!=="KEYWORD"||!t.has(n.text))throw new Error(`expected keyword ${n.text}`);return this.pop().text}popType(t){if(this.peek().type!==t){const n=this.peek();throw new Error(`expected ${t}; got ${n.type} ${JSON.stringify(n.text)}`)}return this.pop().text}popParen(){const t=this.peek();if(t.type!=="OPEN_PAREN")throw new Error("bad start");const n=yr(this,tk,RJ).call(this,$e(this,Uc)+1,t.match+1);return Ht(this,Uc,t.match+1),n}popParams(){const t=this.peek();if(t.type!=="OPEN_PAREN")throw new Error("bad start");const n=[];for(;$e(this,Uc)<t.match-1;){const r=this.peek().linkNext;n.push(yr(this,tk,RJ).call(this,$e(this,Uc)+1,r)),Ht(this,Uc,r)}return Ht(this,Uc,t.match+1),n}peek(){if($e(this,Uc)>=$e(this,Bp).length)throw new Error("out-of-bounds");return $e(this,Bp)[$e(this,Uc)]}peekKeyword(t){const n=this.peekType("KEYWORD");return n!=null&&t.has(n)?n:null}peekType(t){if(this.length===0)return null;const n=this.peek();return n.type===t?n.text:null}pop(){const t=this.peek();return eb(this,Uc)._++,t}toString(){const t=[];for(let n=$e(this,Uc);n<$e(this,Bp).length;n++){const r=$e(this,Bp)[n];t.push(`${r.type}:${r.text}`)}return`<TokenString ${t.join(" ")}>`}};Uc=new WeakMap,Bp=new WeakMap,tk=new WeakSet,RJ=function(t=0,n=0){return new dD($e(this,Bp).slice(t,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-t,linkBack:r.linkBack-t,linkNext:r.linkNext-t}))))};let um=dD;function r2(e){const t=[],n=o=>{const l=a<e.length?JSON.stringify(e[a]):"$EOI";throw new Error(`invalid token ${l} at ${a}: ${o}`)};let r=[],s=[],a=0;for(;a<e.length;){let o=e.substring(a),l=o.match(M3t);l&&(a+=l[1].length,o=e.substring(a));const c={depth:r.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:a,value:-1};t.push(c);let u=O3t[o[0]]||"";if(u){if(c.type=u,c.text=o[0],a++,u==="OPEN_PAREN")r.push(t.length-1),s.push(t.length-1);else if(u=="CLOSE_PAREN")r.length===0&&n("no matching open bracket"),c.match=r.pop(),t[c.match].match=t.length-1,c.depth--,c.linkBack=s.pop(),t[c.linkBack].linkNext=t.length-1;else if(u==="COMMA")c.linkBack=s.pop(),t[c.linkBack].linkNext=t.length-1,s.push(t.length-1);else if(u==="OPEN_BRACKET")c.type="BRACKET";else if(u==="CLOSE_BRACKET"){let d=t.pop().text;if(t.length>0&&t[t.length-1].type==="NUMBER"){const f=t.pop().text;d=f+d,t[t.length-1].value=Mi(f)}if(t.length===0||t[t.length-1].type!=="BRACKET")throw new Error("missing opening bracket");t[t.length-1].text+=d}continue}if(l=o.match(L3t),l){if(c.text=l[1],a+=c.text.length,F3t.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(rIe)){c.type="TYPE";continue}c.type="ID";continue}if(l=o.match(R3t),l){c.text=l[1],c.type="NUMBER",a+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${a}`)}return new um(t.map(o=>Object.freeze(o)))}function R0e(e,t){let n=[];for(const r in t.keys())e.has(r)&&n.push(r);if(n.length>1)throw new Error(`conflicting types: ${n.join(", ")}`)}function UB(e,t){if(t.peekKeyword(eIe)){const n=t.pop().text;if(n!==e)throw new Error(`expected ${e}, got ${n}`)}return t.popType("ID")}function s1(e,t){const n=new Set;for(;;){const r=e.peekType("KEYWORD");if(r==null||t&&!t.has(r))break;if(e.pop(),n.has(r))throw new Error(`duplicate keywords: ${JSON.stringify(r)}`);n.add(r)}return Object.freeze(n)}function sIe(e){let t=s1(e,k3t);return R0e(t,ed("constant payable nonpayable".split(" "))),R0e(t,ed("pure view payable nonpayable".split(" "))),t.has("view")?"view":t.has("pure")?"pure":t.has("payable")?"payable":t.has("nonpayable")?"nonpayable":t.has("constant")?"view":"nonpayable"}function $g(e,t){return e.popParams().map(n=>Jc.from(n,t))}function iIe(e){if(e.peekType("AT")){if(e.pop(),e.peekType("NUMBER"))return gs(e.pop().text);throw new Error("invalid gas")}return null}function N3(e){if(e.length)throw new Error(`unexpected tokens at offset ${e.offset}: ${e.toString()}`)}const D3t=new RegExp(/^(.*)\[([0-9]*)\]$/);function L0e(e){const t=e.match(rIe);if(Sn(t,"invalid type","type",e),e==="uint")return"uint256";if(e==="int")return"int256";if(t[2]){const n=parseInt(t[2]);Sn(n!==0&&n<=32,"invalid bytes length","type",e)}else if(t[3]){const n=parseInt(t[3]);Sn(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",e)}return e}const Ro={},ef=Symbol.for("_ethers_internal"),D0e="_ParamTypeInternal",B0e="_ErrorInternal",$0e="_EventInternal",U0e="_ConstructorInternal",z0e="_FallbackInternal",H0e="_FunctionInternal",V0e="_StructInternal";var tS,QF;const jh=class jh{constructor(t,n,r,s,a,o,l,c){Ln(this,tS);Un(this,"name");Un(this,"type");Un(this,"baseType");Un(this,"indexed");Un(this,"components");Un(this,"arrayLength");Un(this,"arrayChildren");if(a5(t,Ro,"ParamType"),Object.defineProperty(this,ef,{value:D0e}),o&&(o=Object.freeze(o.slice())),s==="array"){if(l==null||c==null)throw new Error("")}else if(l!=null||c!=null)throw new Error("");if(s==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");Ps(this,{name:n,type:r,baseType:s,indexed:a,components:o,arrayLength:l,arrayChildren:c})}format(t){if(t==null&&(t="sighash"),t==="json"){const r=this.name||"";if(this.isArray()){const a=JSON.parse(this.arrayChildren.format("json"));return a.name=r,a.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(a)}const s={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(s.indexed=this.indexed),this.isTuple()&&(s.components=this.components.map(a=>JSON.parse(a.format(t)))),JSON.stringify(s)}let n="";return this.isArray()?(n+=this.arrayChildren.format(t),n+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?n+="("+this.components.map(r=>r.format(t)).join(t==="full"?", ":",")+")":n+=this.type,t!=="sighash"&&(this.indexed===!0&&(n+=" indexed"),t==="full"&&this.name&&(n+=" "+this.name)),n}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(t,n){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return t.map(s=>r.arrayChildren.walk(s,n))}if(this.isTuple()){if(!Array.isArray(t))throw new Error("invalid tuple value");if(t.length!==this.components.length)throw new Error("array is wrong length");const r=this;return t.map((s,a)=>r.components[a].walk(s,n))}return n(this.type,t)}async walkAsync(t,n){const r=[],s=[t];return yr(this,tS,QF).call(this,r,t,n,a=>{s[0]=a}),r.length&&await Promise.all(r),s[0]}static from(t,n){if(jh.isParamType(t))return t;if(typeof t=="string")try{return jh.from(r2(t),n)}catch{Sn(!1,"invalid param type","obj",t)}else if(t instanceof um){let l="",c="",u=null;s1(t,ed(["tuple"])).has("tuple")||t.peekType("OPEN_PAREN")?(c="tuple",u=t.popParams().map(w=>jh.from(w)),l=`tuple(${u.map(w=>w.format()).join(",")})`):(l=L0e(t.popType("TYPE")),c=l);let d=null,f=null;for(;t.length&&t.peekType("BRACKET");){const w=t.pop();d=new jh(Ro,"",l,c,null,u,f,d),f=w.value,l+=w.text,c="array",u=null}let x=null;if(s1(t,T3t).has("indexed")){if(!n)throw new Error("");x=!0}const v=t.peekType("ID")?t.pop().text:"";if(t.length)throw new Error("leftover tokens");return new jh(Ro,v,l,c,x,u,f,d)}const r=t.name;Sn(!r||typeof r=="string"&&r.match(nIe),"invalid name","obj.name",r);let s=t.indexed;s!=null&&(Sn(n,"parameter cannot be indexed","obj.indexed",t.indexed),s=!!s);let a=t.type,o=a.match(D3t);if(o){const l=parseInt(o[2]||"-1"),c=jh.from({type:o[1],components:t.components});return new jh(Ro,r||"",a,"array",s,null,l,c)}if(a==="tuple"||a.startsWith("tuple(")||a.startsWith("(")){const l=t.components!=null?t.components.map(u=>jh.from(u)):null;return new jh(Ro,r||"",a,"tuple",s,l,null,null)}return a=L0e(t.type),new jh(Ro,r||"",a,a,s,null,null,null)}static isParamType(t){return t&&t[ef]===D0e}};tS=new WeakSet,QF=function(t,n,r,s){if(this.isArray()){if(!Array.isArray(n))throw new Error("invalid array value");if(this.arrayLength!==-1&&n.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,l=n.slice();l.forEach((c,u)=>{var d;yr(d=o,tS,QF).call(d,t,c,r,f=>{l[u]=f})}),s(l);return}if(this.isTuple()){const o=this.components;let l;if(Array.isArray(n))l=n.slice();else{if(n==null||typeof n!="object")throw new Error("invalid tuple value");l=o.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in n))throw new Error(`missing value for component ${c.name}`);return n[c.name]})}if(l.length!==this.components.length)throw new Error("array is wrong length");l.forEach((c,u)=>{var d;yr(d=o[u],tS,QF).call(d,t,c,r,f=>{l[u]=f})}),s(l);return}const a=r(this.type,n);a.then?t.push(async function(){s(await a)}()):s(a)};let Jc=jh;class A3{constructor(t,n,r){Un(this,"type");Un(this,"inputs");a5(t,Ro,"Fragment"),r=Object.freeze(r.slice()),Ps(this,{type:n,inputs:r})}static from(t){if(typeof t=="string"){try{A3.from(JSON.parse(t))}catch{}return A3.from(r2(t))}if(t instanceof um)switch(t.peekKeyword(eIe)){case"constructor":return Tg.from(t);case"error":return Dd.from(t);case"event":return x0.from(t);case"fallback":case"receive":return ag.from(t);case"function":return g0.from(t);case"struct":return Gw.from(t)}else if(typeof t=="object"){switch(t.type){case"constructor":return Tg.from(t);case"error":return Dd.from(t);case"event":return x0.from(t);case"fallback":case"receive":return ag.from(t);case"function":return g0.from(t);case"struct":return Gw.from(t)}Fr(!1,`unsupported type: ${t.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}Sn(!1,"unsupported frgament object","obj",t)}static isConstructor(t){return Tg.isFragment(t)}static isError(t){return Dd.isFragment(t)}static isEvent(t){return x0.isFragment(t)}static isFunction(t){return g0.isFragment(t)}static isStruct(t){return Gw.isFragment(t)}}class zB extends A3{constructor(n,r,s,a){super(n,r,a);Un(this,"name");Sn(typeof s=="string"&&s.match(nIe),"invalid identifier","name",s),a=Object.freeze(a.slice()),Ps(this,{name:s})}}function hE(e,t){return"("+t.map(n=>n.format(e)).join(e==="full"?", ":",")+")"}class Dd extends zB{constructor(t,n,r){super(t,"error",n,r),Object.defineProperty(this,ef,{value:B0e})}get selector(){return r1(this.format("sighash")).substring(0,10)}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(t)))});const n=[];return t!=="sighash"&&n.push("error"),n.push(this.name+hE(t,this.inputs)),n.join(" ")}static from(t){if(Dd.isFragment(t))return t;if(typeof t=="string")return Dd.from(r2(t));if(t instanceof um){const n=UB("error",t),r=$g(t);return N3(t),new Dd(Ro,n,r)}return new Dd(Ro,t.name,t.inputs?t.inputs.map(Jc.from):[])}static isFragment(t){return t&&t[ef]===B0e}}class x0 extends zB{constructor(n,r,s,a){super(n,"event",r,s);Un(this,"anonymous");Object.defineProperty(this,ef,{value:$0e}),Ps(this,{anonymous:a})}get topicHash(){return r1(this.format("sighash"))}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(s=>JSON.parse(s.format(n)))});const r=[];return n!=="sighash"&&r.push("event"),r.push(this.name+hE(n,this.inputs)),n!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(n,r){return r=(r||[]).map(a=>Jc.from(a)),new x0(Ro,n,r,!1).topicHash}static from(n){if(x0.isFragment(n))return n;if(typeof n=="string")try{return x0.from(r2(n))}catch{Sn(!1,"invalid event fragment","obj",n)}else if(n instanceof um){const r=UB("event",n),s=$g(n,!0),a=!!s1(n,ed(["anonymous"])).has("anonymous");return N3(n),new x0(Ro,r,s,a)}return new x0(Ro,n.name,n.inputs?n.inputs.map(r=>Jc.from(r,!0)):[],!!n.anonymous)}static isFragment(n){return n&&n[ef]===$0e}}class Tg extends A3{constructor(n,r,s,a,o){super(n,r,s);Un(this,"payable");Un(this,"gas");Object.defineProperty(this,ef,{value:U0e}),Ps(this,{payable:a,gas:o})}format(n){if(Fr(n!=null&&n!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),n==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(s=>JSON.parse(s.format(n)))});const r=[`constructor${hE(n,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(n){if(Tg.isFragment(n))return n;if(typeof n=="string")try{return Tg.from(r2(n))}catch{Sn(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof um){s1(n,ed(["constructor"]));const r=$g(n),s=!!s1(n,_3t).has("payable"),a=iIe(n);return N3(n),new Tg(Ro,"constructor",r,s,a)}return new Tg(Ro,"constructor",n.inputs?n.inputs.map(Jc.from):[],!!n.payable,n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[ef]===U0e}}class ag extends A3{constructor(n,r,s){super(n,"fallback",r);Un(this,"payable");Object.defineProperty(this,ef,{value:z0e}),Ps(this,{payable:s})}format(n){const r=this.inputs.length===0?"receive":"fallback";if(n==="json"){const s=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:s})}return`${r}()${this.payable?" payable":""}`}static from(n){if(ag.isFragment(n))return n;if(typeof n=="string")try{return ag.from(r2(n))}catch{Sn(!1,"invalid fallback fragment","obj",n)}else if(n instanceof um){const r=n.toString(),s=n.peekKeyword(ed(["fallback","receive"]));if(Sn(s,"type must be fallback or receive","obj",r),n.popKeyword(ed(["fallback","receive"]))==="receive"){const c=$g(n);return Sn(c.length===0,"receive cannot have arguments","obj.inputs",c),s1(n,ed(["payable"])),N3(n),new ag(Ro,[],!0)}let o=$g(n);o.length?Sn(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(c=>c.format("minimal")).join(", ")):o=[Jc.from("bytes")];const l=sIe(n);if(Sn(l==="nonpayable"||l==="payable","fallback cannot be constants","obj.stateMutability",l),s1(n,ed(["returns"])).has("returns")){const c=$g(n);Sn(c.length===1&&c[0].type==="bytes","invalid fallback outputs","obj.outputs",c.map(u=>u.format("minimal")).join(", "))}return N3(n),new ag(Ro,o,l==="payable")}if(n.type==="receive")return new ag(Ro,[],!0);if(n.type==="fallback"){const r=[Jc.from("bytes")],s=n.stateMutability==="payable";return new ag(Ro,r,s)}Sn(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[ef]===z0e}}class g0 extends zB{constructor(n,r,s,a,o,l){super(n,"function",r,a);Un(this,"constant");Un(this,"outputs");Un(this,"stateMutability");Un(this,"payable");Un(this,"gas");Object.defineProperty(this,ef,{value:H0e}),o=Object.freeze(o.slice()),Ps(this,{constant:s==="view"||s==="pure",gas:l,outputs:o,payable:s==="payable",stateMutability:s})}get selector(){return r1(this.format("sighash")).substring(0,10)}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(s=>JSON.parse(s.format(n))),outputs:this.outputs.map(s=>JSON.parse(s.format(n)))});const r=[];return n!=="sighash"&&r.push("function"),r.push(this.name+hE(n,this.inputs)),n!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(hE(n,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(n,r){return r=(r||[]).map(a=>Jc.from(a)),new g0(Ro,n,"view",r,[],null).selector}static from(n){if(g0.isFragment(n))return n;if(typeof n=="string")try{return g0.from(r2(n))}catch{Sn(!1,"invalid function fragment","obj",n)}else if(n instanceof um){const s=UB("function",n),a=$g(n),o=sIe(n);let l=[];s1(n,ed(["returns"])).has("returns")&&(l=$g(n));const c=iIe(n);return N3(n),new g0(Ro,s,o,a,l,c)}let r=n.stateMutability;return r==null&&(r="payable",typeof n.constant=="boolean"?(r="view",n.constant||(r="payable",typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable"))):typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable")),new g0(Ro,n.name,r,n.inputs?n.inputs.map(Jc.from):[],n.outputs?n.outputs.map(Jc.from):[],n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[ef]===H0e}}class Gw extends zB{constructor(t,n,r){super(t,"struct",n,r),Object.defineProperty(this,ef,{value:V0e})}format(){throw new Error("@TODO")}static from(t){if(typeof t=="string")try{return Gw.from(r2(t))}catch{Sn(!1,"invalid struct fragment","obj",t)}else if(t instanceof um){const n=UB("struct",t),r=$g(t);return N3(t),new Gw(Ro,n,r)}return new Gw(Ro,t.name,t.inputs?t.inputs.map(Jc.from):[])}static isFragment(t){return t&&t[ef]===V0e}}const bm=new Map;bm.set(0,"GENERIC_PANIC");bm.set(1,"ASSERT_FALSE");bm.set(17,"OVERFLOW");bm.set(18,"DIVIDE_BY_ZERO");bm.set(33,"ENUM_RANGE_ERROR");bm.set(34,"BAD_STORAGE_DATA");bm.set(49,"STACK_UNDERFLOW");bm.set(50,"ARRAY_RANGE_ERROR");bm.set(65,"OUT_OF_MEMORY");bm.set(81,"UNINITIALIZED_FUNCTION_CALL");const B3t=new RegExp(/^bytes([0-9]*)$/),$3t=new RegExp(/^(u?int)([0-9]*)$/);let UH=null,W0e=1024;function U3t(e,t,n,r){let s="missing revert data",a=null;const o=null;let l=null;if(n){s="execution reverted";const u=cs(n);if(n=Hr(n),u.length===0)s+=" (no data present; likely require(false) occurred",a="require(false)";else if(u.length%32!==4)s+=" (could not decode reason; invalid data length)";else if(Hr(u.slice(0,4))==="0x08c379a0")try{a=r.decode(["string"],u.slice(4))[0],l={signature:"Error(string)",name:"Error",args:[a]},s+=`: ${JSON.stringify(a)}`}catch{s+=" (could not decode reason; invalid string data)"}else if(Hr(u.slice(0,4))==="0x4e487b71")try{const d=Number(r.decode(["uint256"],u.slice(4))[0]);l={signature:"Panic(uint256)",name:"Panic",args:[d]},a=`Panic due to ${bm.get(d)||"UNKNOWN"}(${d})`,s+=`: ${a}`}catch{s+=" (could not decode panic code)"}else s+=" (unknown custom error)"}const c={to:t.to?Ji(t.to):null,data:t.data||"0x"};return t.from&&(c.from=Ji(t.from)),So(s,"CALL_EXCEPTION",{action:e,data:n,reason:a,transaction:c,invocation:o,revert:l})}var Gb,gC;const fD=class fD{constructor(){Ln(this,Gb)}getDefaultValue(t){const n=t.map(s=>yr(this,Gb,gC).call(this,Jc.from(s)));return new JI(n,"_").defaultValue()}encode(t,n){cke(n.length,t.length,"types/values length mismatch");const r=t.map(o=>yr(this,Gb,gC).call(this,Jc.from(o))),s=new JI(r,"_"),a=new CJ;return s.encode(a,n),a.data}decode(t,n,r){const s=t.map(o=>yr(this,Gb,gC).call(this,Jc.from(o)));return new JI(s,"_").decode(new SJ(n,r,W0e))}static _setDefaultMaxInflation(t){Sn(typeof t=="number"&&Number.isInteger(t),"invalid defaultMaxInflation factor","value",t),W0e=t}static defaultAbiCoder(){return UH==null&&(UH=new fD),UH}static getBuiltinCallException(t,n,r){return U3t(t,n,r,fD.defaultAbiCoder())}};Gb=new WeakSet,gC=function(t){if(t.isArray())return new swt(yr(this,Gb,gC).call(this,t.arrayChildren),t.arrayLength,t.name);if(t.isTuple())return new JI(t.components.map(r=>yr(this,Gb,gC).call(this,r)),t.name);switch(t.baseType){case"address":return new nwt(t.name);case"bool":return new iwt(t.name);case"string":return new pwt(t.name);case"bytes":return new awt(t.name);case"":return new cwt(t.name)}let n=t.type.match($3t);if(n){let r=parseInt(n[2]||"256");return Sn(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",t),new hwt(r/8,n[1]==="int",t.name)}if(n=t.type.match(B3t),n){let r=parseInt(n[1]);return Sn(r!==0&&r<=32,"invalid bytes length","param",t),new owt(r,t.name)}Sn(!1,"invalid type","type",t.type)};let pE=fD;class z3t{constructor(t,n,r){Un(this,"fragment");Un(this,"name");Un(this,"signature");Un(this,"topic");Un(this,"args");const s=t.name,a=t.format();Ps(this,{fragment:t,name:s,signature:a,topic:n,args:r})}}class H3t{constructor(t,n,r,s){Un(this,"fragment");Un(this,"name");Un(this,"args");Un(this,"signature");Un(this,"selector");Un(this,"value");const a=t.name,o=t.format();Ps(this,{fragment:t,name:a,args:r,signature:o,selector:n,value:s})}}class V3t{constructor(t,n,r){Un(this,"fragment");Un(this,"name");Un(this,"args");Un(this,"signature");Un(this,"selector");const s=t.name,a=t.format();Ps(this,{fragment:t,name:s,args:r,signature:a,selector:n})}}class q0e{constructor(t){Un(this,"hash");Un(this,"_isIndexed");Ps(this,{hash:t,_isIndexed:!0})}static isIndexed(t){return!!(t&&t._isIndexed)}}const G0e={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},K0e={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:e=>`reverted with reason string ${JSON.stringify(e)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:e=>{let t="unknown panic code";return e>=0&&e<=255&&G0e[e.toString()]&&(t=G0e[e.toString()]),`reverted with panic code 0x${e.toString(16)} (${t})`}}};var i0,a0,o0,mu,$0,ZF,JF;const Rv=class Rv{constructor(t){Ln(this,$0);Un(this,"fragments");Un(this,"deploy");Un(this,"fallback");Un(this,"receive");Ln(this,i0);Ln(this,a0);Ln(this,o0);Ln(this,mu);let n=[];typeof t=="string"?n=JSON.parse(t):n=t,Ht(this,o0,new Map),Ht(this,i0,new Map),Ht(this,a0,new Map);const r=[];for(const o of n)try{r.push(A3.from(o))}catch(l){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,l.message)}Ps(this,{fragments:Object.freeze(r)});let s=null,a=!1;Ht(this,mu,this.getAbiCoder()),this.fragments.forEach((o,l)=>{let c;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Ps(this,{deploy:o});return;case"fallback":o.inputs.length===0?a=!0:(Sn(!s||o.payable!==s.payable,"conflicting fallback fragments",`fragments[${l}]`,o),s=o,a=s.payable);return;case"function":c=$e(this,o0);break;case"event":c=$e(this,a0);break;case"error":c=$e(this,i0);break;default:return}const u=o.format();c.has(u)||c.set(u,o)}),this.deploy||Ps(this,{deploy:Tg.from("constructor()")}),Ps(this,{fallback:s,receive:a})}format(t){const n=t?"minimal":"full";return this.fragments.map(s=>s.format(n))}formatJson(){const t=this.fragments.map(n=>n.format("json"));return JSON.stringify(t.map(n=>JSON.parse(n)))}getAbiCoder(){return pE.defaultAbiCoder()}getFunctionName(t){const n=yr(this,$0,ZF).call(this,t,null,!1);return Sn(n,"no matching function","key",t),n.name}hasFunction(t){return!!yr(this,$0,ZF).call(this,t,null,!1)}getFunction(t,n){return yr(this,$0,ZF).call(this,t,n||null,!0)}forEachFunction(t){const n=Array.from($e(this,o0).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];t($e(this,o0).get(s),r)}}getEventName(t){const n=yr(this,$0,JF).call(this,t,null,!1);return Sn(n,"no matching event","key",t),n.name}hasEvent(t){return!!yr(this,$0,JF).call(this,t,null,!1)}getEvent(t,n){return yr(this,$0,JF).call(this,t,n||null,!0)}forEachEvent(t){const n=Array.from($e(this,a0).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];t($e(this,a0).get(s),r)}}getError(t,n){if(ao(t)){const s=t.toLowerCase();if(K0e[s])return Dd.from(K0e[s].signature);for(const a of $e(this,i0).values())if(s===a.selector)return a;return null}if(t.indexOf("(")===-1){const s=[];for(const[a,o]of $e(this,i0))a.split("(")[0]===t&&s.push(o);if(s.length===0)return t==="Error"?Dd.from("error Error(string)"):t==="Panic"?Dd.from("error Panic(uint256)"):null;if(s.length>1){const a=s.map(o=>JSON.stringify(o.format())).join(", ");Sn(!1,`ambiguous error description (i.e. ${a})`,"name",t)}return s[0]}if(t=Dd.from(t).format(),t==="Error(string)")return Dd.from("error Error(string)");if(t==="Panic(uint256)")return Dd.from("error Panic(uint256)");const r=$e(this,i0).get(t);return r||null}forEachError(t){const n=Array.from($e(this,i0).keys());n.sort((r,s)=>r.localeCompare(s));for(let r=0;r<n.length;r++){const s=n[r];t($e(this,i0).get(s),r)}}_decodeParams(t,n){return $e(this,mu).decode(t,n)}_encodeParams(t,n){return $e(this,mu).encode(t,n)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,n){if(typeof t=="string"){const r=this.getError(t);Sn(r,"unknown error","fragment",t),t=r}return Sn(po(n,0,4)===t.selector,`data signature does not match error ${t.name}.`,"data",n),this._decodeParams(t.inputs,po(n,4))}encodeErrorResult(t,n){if(typeof t=="string"){const r=this.getError(t);Sn(r,"unknown error","fragment",t),t=r}return Pa([t.selector,this._encodeParams(t.inputs,n||[])])}decodeFunctionData(t,n){if(typeof t=="string"){const r=this.getFunction(t);Sn(r,"unknown function","fragment",t),t=r}return Sn(po(n,0,4)===t.selector,`data signature does not match function ${t.name}.`,"data",n),this._decodeParams(t.inputs,po(n,4))}encodeFunctionData(t,n){if(typeof t=="string"){const r=this.getFunction(t);Sn(r,"unknown function","fragment",t),t=r}return Pa([t.selector,this._encodeParams(t.inputs,n||[])])}decodeFunctionResult(t,n){if(typeof t=="string"){const a=this.getFunction(t);Sn(a,"unknown function","fragment",t),t=a}let r="invalid length for result data";const s=Yc(n);if(s.length%32===0)try{return $e(this,mu).decode(t.outputs,s)}catch{r="could not decode result data"}Fr(!1,r,"BAD_DATA",{value:Hr(s),info:{method:t.name,signature:t.format()}})}makeError(t,n){const r=cs(t,"data"),s=pE.getBuiltinCallException("call",n,r);if(s.message.startsWith("execution reverted (unknown custom error)")){const l=Hr(r.slice(0,4)),c=this.getError(l);if(c)try{const u=$e(this,mu).decode(c.inputs,r.slice(4));s.revert={name:c.name,signature:c.format(),args:u},s.reason=s.revert.signature,s.message=`execution reverted: ${s.reason}`}catch{s.message="execution reverted (coult not decode custom error)"}}const o=this.parseTransaction(n);return o&&(s.invocation={method:o.name,signature:o.signature,args:o.args}),s}encodeFunctionResult(t,n){if(typeof t=="string"){const r=this.getFunction(t);Sn(r,"unknown function","fragment",t),t=r}return Hr($e(this,mu).encode(t.outputs,n||[]))}encodeFilterTopics(t,n){if(typeof t=="string"){const a=this.getEvent(t);Sn(a,"unknown event","eventFragment",t),t=a}Fr(n.length<=t.inputs.length,`too many arguments for ${t.format()}`,"UNEXPECTED_ARGUMENT",{count:n.length,expectedCount:t.inputs.length});const r=[];t.anonymous||r.push(t.topicHash);const s=(a,o)=>a.type==="string"?r1(o):a.type==="bytes"?io(Hr(o)):(a.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":a.type.match(/^u?int/)?o=t1(o):a.type.match(/^bytes/)?o=Vyt(o,32):a.type==="address"&&$e(this,mu).encode(["address"],[o]),e1(Hr(o),32));for(n.forEach((a,o)=>{const l=t.inputs[o];if(!l.indexed){Sn(a==null,"cannot filter non-indexed parameters; must be null","contract."+l.name,a);return}a==null?r.push(null):l.baseType==="array"||l.baseType==="tuple"?Sn(!1,"filtering with tuples or arrays not supported","contract."+l.name,a):Array.isArray(a)?r.push(a.map(c=>s(l,c))):r.push(s(l,a))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(t,n){if(typeof t=="string"){const o=this.getEvent(t);Sn(o,"unknown event","eventFragment",t),t=o}const r=[],s=[],a=[];return t.anonymous||r.push(t.topicHash),Sn(n.length===t.inputs.length,"event arguments/values mismatch","values",n),t.inputs.forEach((o,l)=>{const c=n[l];if(o.indexed)if(o.type==="string")r.push(r1(c));else if(o.type==="bytes")r.push(io(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");r.push($e(this,mu).encode([o.type],[c]))}else s.push(o),a.push(c)}),{data:$e(this,mu).encode(s,a),topics:r}}decodeEventLog(t,n,r){if(typeof t=="string"){const g=this.getEvent(t);Sn(g,"unknown event","eventFragment",t),t=g}if(r!=null&&!t.anonymous){const g=t.topicHash;Sn(ao(r[0],32)&&r[0].toLowerCase()===g,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const s=[],a=[],o=[];t.inputs.forEach((g,v)=>{g.indexed?g.type==="string"||g.type==="bytes"||g.baseType==="tuple"||g.baseType==="array"?(s.push(Jc.from({type:"bytes32",name:g.name})),o.push(!0)):(s.push(g),o.push(!1)):(a.push(g),o.push(!1))});const l=r!=null?$e(this,mu).decode(s,Pa(r)):null,c=$e(this,mu).decode(a,n,!0),u=[],d=[];let f=0,x=0;return t.inputs.forEach((g,v)=>{let w=null;if(g.indexed)if(l==null)w=new q0e(null);else if(o[v])w=new q0e(l[x++]);else try{w=l[x++]}catch(C){w=C}else try{w=c[f++]}catch(C){w=C}u.push(w),d.push(g.name||null)}),gM.fromItems(u,d)}parseTransaction(t){const n=cs(t.data,"tx.data"),r=gs(t.value!=null?t.value:0,"tx.value"),s=this.getFunction(Hr(n.slice(0,4)));if(!s)return null;const a=$e(this,mu).decode(s.inputs,n.slice(4));return new H3t(s,s.selector,a,r)}parseCallResult(t){throw new Error("@TODO")}parseLog(t){const n=this.getEvent(t.topics[0]);return!n||n.anonymous?null:new z3t(n,n.topicHash,this.decodeEventLog(n,t.data,t.topics))}parseError(t){const n=Hr(t),r=this.getError(po(n,0,4));if(!r)return null;const s=$e(this,mu).decode(r.inputs,po(n,4));return new V3t(r,r.selector,s)}static from(t){return t instanceof Rv?t:typeof t=="string"?new Rv(JSON.parse(t)):typeof t.formatJson=="function"?new Rv(t.formatJson()):typeof t.format=="function"?new Rv(t.format("json")):new Rv(t)}};i0=new WeakMap,a0=new WeakMap,o0=new WeakMap,mu=new WeakMap,$0=new WeakSet,ZF=function(t,n,r){if(ao(t)){const a=t.toLowerCase();for(const o of $e(this,o0).values())if(a===o.selector)return o;return null}if(t.indexOf("(")===-1){const a=[];for(const[o,l]of $e(this,o0))o.split("(")[0]===t&&a.push(l);if(n){const o=n.length>0?n[n.length-1]:null;let l=n.length,c=!0;Iu.isTyped(o)&&o.type==="overrides"&&(c=!1,l--);for(let u=a.length-1;u>=0;u--){const d=a[u].inputs.length;d!==l&&(!c||d!==l-1)&&a.splice(u,1)}for(let u=a.length-1;u>=0;u--){const d=a[u].inputs;for(let f=0;f<n.length;f++)if(Iu.isTyped(n[f])){if(f>=d.length){if(n[f].type==="overrides")continue;a.splice(u,1);break}if(n[f].type!==d[f].baseType){a.splice(u,1);break}}}}if(a.length===1&&n&&n.length!==a[0].inputs.length){const o=n[n.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&a.splice(0,1)}if(a.length===0)return null;if(a.length>1&&r){const o=a.map(l=>JSON.stringify(l.format())).join(", ");Sn(!1,`ambiguous function description (i.e. matches ${o})`,"key",t)}return a[0]}const s=$e(this,o0).get(g0.from(t).format());return s||null},JF=function(t,n,r){if(ao(t)){const a=t.toLowerCase();for(const o of $e(this,a0).values())if(a===o.topicHash)return o;return null}if(t.indexOf("(")===-1){const a=[];for(const[o,l]of $e(this,a0))o.split("(")[0]===t&&a.push(l);if(n){for(let o=a.length-1;o>=0;o--)a[o].inputs.length<n.length&&a.splice(o,1);for(let o=a.length-1;o>=0;o--){const l=a[o].inputs;for(let c=0;c<n.length;c++)if(Iu.isTyped(n[c])&&n[c].type!==l[c].baseType){a.splice(o,1);break}}}if(a.length===0)return null;if(a.length>1&&r){const o=a.map(l=>JSON.stringify(l.format())).join(", ");Sn(!1,`ambiguous event description (i.e. matches ${o})`,"key",t)}return a[0]}const s=$e(this,a0).get(x0.from(t).format());return s||null};let LJ=Rv;const aIe=BigInt(0);function r4(e){return e??null}function pl(e){return e==null?null:e.toString()}class Y0e{constructor(t,n,r){Un(this,"gasPrice");Un(this,"maxFeePerGas");Un(this,"maxPriorityFeePerGas");Ps(this,{gasPrice:r4(t),maxFeePerGas:r4(n),maxPriorityFeePerGas:r4(r)})}toJSON(){const{gasPrice:t,maxFeePerGas:n,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:pl(t),maxFeePerGas:pl(n),maxPriorityFeePerGas:pl(r)}}}function mE(e){const t={};e.to&&(t.to=e.to),e.from&&(t.from=e.from),e.data&&(t.data=Hr(e.data));const n="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const s of n)!(s in e)||e[s]==null||(t[s]=gs(e[s],`request.${s}`));const r="type,nonce".split(/,/);for(const s of r)!(s in e)||e[s]==null||(t[s]=Mi(e[s],`request.${s}`));return e.accessList&&(t.accessList=o5(e.accessList)),e.authorizationList&&(t.authorizationList=e.authorizationList.slice()),"blockTag"in e&&(t.blockTag=e.blockTag),"enableCcipRead"in e&&(t.enableCcipRead=!!e.enableCcipRead),"customData"in e&&(t.customData=e.customData),"blobVersionedHashes"in e&&e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.slice()),"kzg"in e&&(t.kzg=e.kzg),"blobs"in e&&e.blobs&&(t.blobs=e.blobs.map(s=>kB(s)?Hr(s):Object.assign({},s))),t}var gg;class W3t{constructor(t,n){Un(this,"provider");Un(this,"number");Un(this,"hash");Un(this,"timestamp");Un(this,"parentHash");Un(this,"parentBeaconBlockRoot");Un(this,"nonce");Un(this,"difficulty");Un(this,"gasLimit");Un(this,"gasUsed");Un(this,"stateRoot");Un(this,"receiptsRoot");Un(this,"blobGasUsed");Un(this,"excessBlobGas");Un(this,"miner");Un(this,"prevRandao");Un(this,"extraData");Un(this,"baseFeePerGas");Ln(this,gg);Ht(this,gg,t.transactions.map(r=>typeof r!="string"?new xE(r,n):r)),Ps(this,{provider:n,hash:r4(t.hash),number:t.number,timestamp:t.timestamp,parentHash:t.parentHash,parentBeaconBlockRoot:t.parentBeaconBlockRoot,nonce:t.nonce,difficulty:t.difficulty,gasLimit:t.gasLimit,gasUsed:t.gasUsed,blobGasUsed:t.blobGasUsed,excessBlobGas:t.excessBlobGas,miner:t.miner,prevRandao:r4(t.prevRandao),extraData:t.extraData,baseFeePerGas:r4(t.baseFeePerGas),stateRoot:t.stateRoot,receiptsRoot:t.receiptsRoot})}get transactions(){return $e(this,gg).map(t=>typeof t=="string"?t:t.hash)}get prefetchedTransactions(){const t=$e(this,gg).slice();return t.length===0?[]:(Fr(typeof t[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),t)}toJSON(){const{baseFeePerGas:t,difficulty:n,extraData:r,gasLimit:s,gasUsed:a,hash:o,miner:l,prevRandao:c,nonce:u,number:d,parentHash:f,parentBeaconBlockRoot:x,stateRoot:g,receiptsRoot:v,timestamp:w,transactions:C}=this;return{_type:"Block",baseFeePerGas:pl(t),difficulty:pl(n),extraData:r,gasLimit:pl(s),gasUsed:pl(a),blobGasUsed:pl(this.blobGasUsed),excessBlobGas:pl(this.excessBlobGas),hash:o,miner:l,prevRandao:c,nonce:u,number:d,parentHash:f,timestamp:w,parentBeaconBlockRoot:x,stateRoot:g,receiptsRoot:v,transactions:C}}[Symbol.iterator](){let t=0;const n=this.transactions;return{next:()=>t<this.length?{value:n[t++],done:!1}:{value:void 0,done:!0}}}get length(){return $e(this,gg).length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(t){let n;if(typeof t=="number")n=$e(this,gg)[t];else{const r=t.toLowerCase();for(const s of $e(this,gg))if(typeof s=="string"){if(s!==r)continue;n=s;break}else{if(s.hash!==r)continue;n=s;break}}if(n==null)throw new Error("no such tx");return typeof n=="string"?await this.provider.getTransaction(n):n}getPrefetchedTransaction(t){const n=this.prefetchedTransactions;if(typeof t=="number")return n[t];t=t.toLowerCase();for(const r of n)if(r.hash===t)return r;Sn(!1,"no matching transaction","indexOrHash",t)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return q3t(this)}}gg=new WeakMap;class Uk{constructor(t,n){Un(this,"provider");Un(this,"transactionHash");Un(this,"blockHash");Un(this,"blockNumber");Un(this,"removed");Un(this,"address");Un(this,"data");Un(this,"topics");Un(this,"index");Un(this,"transactionIndex");this.provider=n;const r=Object.freeze(t.topics.slice());Ps(this,{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,removed:t.removed,address:t.address,data:t.data,topics:r,index:t.index,transactionIndex:t.transactionIndex})}toJSON(){const{address:t,blockHash:n,blockNumber:r,data:s,index:a,removed:o,topics:l,transactionHash:c,transactionIndex:u}=this;return{_type:"log",address:t,blockHash:n,blockNumber:r,data:s,index:a,removed:o,topics:l,transactionHash:c,transactionIndex:u}}async getBlock(){const t=await this.provider.getBlock(this.blockHash);return Fr(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransaction(){const t=await this.provider.getTransaction(this.transactionHash);return Fr(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransactionReceipt(){const t=await this.provider.getTransactionReceipt(this.transactionHash);return Fr(!!t,"failed to find transaction receipt","UNKNOWN_ERROR",{}),t}removedEvent(){return G3t(this)}}var nk;class oIe{constructor(t,n){Un(this,"provider");Un(this,"to");Un(this,"from");Un(this,"contractAddress");Un(this,"hash");Un(this,"index");Un(this,"blockHash");Un(this,"blockNumber");Un(this,"logsBloom");Un(this,"gasUsed");Un(this,"blobGasUsed");Un(this,"cumulativeGasUsed");Un(this,"gasPrice");Un(this,"blobGasPrice");Un(this,"type");Un(this,"status");Un(this,"root");Ln(this,nk);Ht(this,nk,Object.freeze(t.logs.map(s=>new Uk(s,n))));let r=aIe;t.effectiveGasPrice!=null?r=t.effectiveGasPrice:t.gasPrice!=null&&(r=t.gasPrice),Ps(this,{provider:n,to:t.to,from:t.from,contractAddress:t.contractAddress,hash:t.hash,index:t.index,blockHash:t.blockHash,blockNumber:t.blockNumber,logsBloom:t.logsBloom,gasUsed:t.gasUsed,cumulativeGasUsed:t.cumulativeGasUsed,blobGasUsed:t.blobGasUsed,gasPrice:r,blobGasPrice:t.blobGasPrice,type:t.type,status:t.status,root:t.root})}get logs(){return $e(this,nk)}toJSON(){const{to:t,from:n,contractAddress:r,hash:s,index:a,blockHash:o,blockNumber:l,logsBloom:c,logs:u,status:d,root:f}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:l,contractAddress:r,cumulativeGasUsed:pl(this.cumulativeGasUsed),from:n,gasPrice:pl(this.gasPrice),blobGasUsed:pl(this.blobGasUsed),blobGasPrice:pl(this.blobGasPrice),gasUsed:pl(this.gasUsed),hash:s,index:a,logs:u,logsBloom:c,root:f,status:d,to:t}}get length(){return this.logs.length}[Symbol.iterator](){let t=0;return{next:()=>t<this.length?{value:this.logs[t++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const t=await this.provider.getBlock(this.blockHash);if(t==null)throw new Error("TODO");return t}async getTransaction(){const t=await this.provider.getTransaction(this.hash);if(t==null)throw new Error("TODO");return t}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return cIe(this)}reorderedEvent(t){return Fr(!t||t.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),lIe(this,t)}}nk=new WeakMap;var Kb;const que=class que{constructor(t,n){Un(this,"provider");Un(this,"blockNumber");Un(this,"blockHash");Un(this,"index");Un(this,"hash");Un(this,"type");Un(this,"to");Un(this,"from");Un(this,"nonce");Un(this,"gasLimit");Un(this,"gasPrice");Un(this,"maxPriorityFeePerGas");Un(this,"maxFeePerGas");Un(this,"maxFeePerBlobGas");Un(this,"data");Un(this,"value");Un(this,"chainId");Un(this,"signature");Un(this,"accessList");Un(this,"blobVersionedHashes");Un(this,"authorizationList");Ln(this,Kb);this.provider=n,this.blockNumber=t.blockNumber!=null?t.blockNumber:null,this.blockHash=t.blockHash!=null?t.blockHash:null,this.hash=t.hash,this.index=t.index,this.type=t.type,this.from=t.from,this.to=t.to||null,this.gasLimit=t.gasLimit,this.nonce=t.nonce,this.data=t.data,this.value=t.value,this.gasPrice=t.gasPrice,this.maxPriorityFeePerGas=t.maxPriorityFeePerGas!=null?t.maxPriorityFeePerGas:null,this.maxFeePerGas=t.maxFeePerGas!=null?t.maxFeePerGas:null,this.maxFeePerBlobGas=t.maxFeePerBlobGas!=null?t.maxFeePerBlobGas:null,this.chainId=t.chainId,this.signature=t.signature,this.accessList=t.accessList!=null?t.accessList:null,this.blobVersionedHashes=t.blobVersionedHashes!=null?t.blobVersionedHashes:null,this.authorizationList=t.authorizationList!=null?t.authorizationList:null,Ht(this,Kb,-1)}toJSON(){const{blockNumber:t,blockHash:n,index:r,hash:s,type:a,to:o,from:l,nonce:c,data:u,signature:d,accessList:f,blobVersionedHashes:x}=this;return{_type:"TransactionResponse",accessList:f,blockNumber:t,blockHash:n,blobVersionedHashes:x,chainId:pl(this.chainId),data:u,from:l,gasLimit:pl(this.gasLimit),gasPrice:pl(this.gasPrice),hash:s,maxFeePerGas:pl(this.maxFeePerGas),maxPriorityFeePerGas:pl(this.maxPriorityFeePerGas),maxFeePerBlobGas:pl(this.maxFeePerBlobGas),nonce:c,signature:d,to:o,index:r,type:a,value:pl(this.value)}}async getBlock(){let t=this.blockNumber;if(t==null){const r=await this.getTransaction();r&&(t=r.blockNumber)}if(t==null)return null;const n=this.provider.getBlock(t);if(n==null)throw new Error("TODO");return n}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:n,blockNumber:r}=await yu({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return n==null||n.blockNumber==null?0:r-n.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(t,n){const r=t??1,s=n??0;let a=$e(this,Kb),o=-1,l=a===-1;const c=async()=>{if(l)return null;const{blockNumber:x,nonce:g}=await yu({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(g<this.nonce){a=x;return}if(l)return null;const v=await this.getTransaction();if(!(v&&v.blockNumber!=null))for(o===-1&&(o=a-3,o<$e(this,Kb)&&(o=$e(this,Kb)));o<=x;){if(l)return null;const w=await this.provider.getBlock(o,!0);if(w==null)return;for(const C of w)if(C===this.hash)return;for(let C=0;C<w.length;C++){const N=await w.getTransaction(C);if(N.from===this.from&&N.nonce===this.nonce){if(l)return null;const I=await this.provider.getTransactionReceipt(N.hash);if(I==null||x-I.blockNumber+1<r)return;let P="replaced";N.data===this.data&&N.to===this.to&&N.value===this.value?P="repriced":N.data==="0x"&&N.from===N.to&&N.value===aIe&&(P="cancelled"),Fr(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:P==="replaced"||P==="cancelled",reason:P,replacement:N.replaceableTransaction(a),hash:N.hash,receipt:I})}}o++}},u=x=>{if(x==null||x.status!==0)return x;Fr(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:x.to,from:x.from,data:""},receipt:x})},d=await this.provider.getTransactionReceipt(this.hash);if(r===0)return u(d);if(d){if(r===1||await d.confirmations()>=r)return u(d)}else if(await c(),r===0)return null;return await new Promise((x,g)=>{const v=[],w=()=>{v.forEach(N=>N())};if(v.push(()=>{l=!0}),s>0){const N=setTimeout(()=>{w(),g(So("wait for transaction timeout","TIMEOUT"))},s);v.push(()=>{clearTimeout(N)})}const C=async N=>{if(await N.confirmations()>=r){w();try{x(u(N))}catch(I){g(I)}}};if(v.push(()=>{this.provider.off(this.hash,C)}),this.provider.on(this.hash,C),a>=0){const N=async()=>{try{await c()}catch(I){if(Kc(I,"TRANSACTION_REPLACED")){w(),g(I);return}}l||this.provider.once("block",N)};v.push(()=>{this.provider.off("block",N)}),this.provider.once("block",N)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return Fr(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),cIe(this)}reorderedEvent(t){return Fr(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Fr(!t||t.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),lIe(this,t)}replaceableTransaction(t){Sn(Number.isInteger(t)&&t>=0,"invalid startBlock","startBlock",t);const n=new que(this,this.provider);return Ht(n,Kb,t),n}};Kb=new WeakMap;let xE=que;function q3t(e){return{orphan:"drop-block",hash:e.hash,number:e.number}}function lIe(e,t){return{orphan:"reorder-transaction",tx:e,other:t}}function cIe(e){return{orphan:"drop-transaction",tx:e}}function G3t(e){return{orphan:"drop-log",log:{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,address:e.address,data:e.data,topics:Object.freeze(e.topics.slice()),index:e.index}}}class vae extends Uk{constructor(n,r,s){super(n,n.provider);Un(this,"interface");Un(this,"fragment");Un(this,"args");const a=r.decodeEventLog(s,n.data,n.topics);Ps(this,{args:a,fragment:s,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class uIe extends Uk{constructor(n,r){super(n,n.provider);Un(this,"error");Ps(this,{error:r})}}var nS;class K3t extends oIe{constructor(n,r,s){super(s,r);Ln(this,nS);Ht(this,nS,n)}get logs(){return super.logs.map(n=>{const r=n.topics.length?$e(this,nS).getEvent(n.topics[0]):null;if(r)try{return new vae(n,$e(this,nS),r)}catch(s){return new uIe(n,s)}return n})}}nS=new WeakMap;var rk;class wae extends xE{constructor(n,r,s){super(s,r);Ln(this,rk);Ht(this,rk,n)}async wait(n,r){const s=await super.wait(n,r);return s==null?null:new K3t($e(this,rk),this.provider,s)}}rk=new WeakMap;class dIe extends mke{constructor(n,r,s,a){super(n,r,s);Un(this,"log");Ps(this,{log:a})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class Y3t extends dIe{constructor(t,n,r,s,a){super(t,n,r,new vae(a,t.interface,s));const o=t.interface.decodeEventLog(s,this.log.data,this.log.topics);Ps(this,{args:o,fragment:s})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const X0e=BigInt(0);function fIe(e){return e&&typeof e.call=="function"}function hIe(e){return e&&typeof e.estimateGas=="function"}function HB(e){return e&&typeof e.resolveName=="function"}function pIe(e){return e&&typeof e.sendTransaction=="function"}function mIe(e){if(e!=null){if(HB(e))return e;if(e.provider)return e.provider}}var sk;class X3t{constructor(t,n,r){Ln(this,sk);Un(this,"fragment");if(Ps(this,{fragment:n}),n.inputs.length<r.length)throw new Error("too many arguments");const s=j3(t.runner,"resolveName"),a=HB(s)?s:null;Ht(this,sk,async function(){const o=await Promise.all(n.inputs.map((l,c)=>r[c]==null?null:l.walkAsync(r[c],(d,f)=>d==="address"?Array.isArray(f)?Promise.all(f.map(x=>Nc(x,a))):Nc(f,a):f)));return t.interface.encodeFilterTopics(n,o)}())}getTopicFilter(){return $e(this,sk)}}sk=new WeakMap;function j3(e,t){return e==null?null:typeof e[t]=="function"?e:e.provider&&typeof e.provider[t]=="function"?e.provider:null}function qv(e){return e==null?null:e.provider||null}async function xIe(e,t){const n=Iu.dereference(e,"overrides");Sn(typeof n=="object","invalid overrides parameter","overrides",e);const r=mE(n);return Sn(r.to==null||(t||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),Sn(r.data==null||(t||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function Q3t(e,t,n){const r=j3(e,"resolveName"),s=HB(r)?r:null;return await Promise.all(t.map((a,o)=>a.walkAsync(n[o],(l,c)=>(c=Iu.dereference(c,l),l==="address"?Nc(c,s):c))))}function Z3t(e){const t=async function(o){const l=await xIe(o,["data"]);l.to=await e.getAddress(),l.from&&(l.from=await Nc(l.from,mIe(e.runner)));const c=e.interface,u=gs(l.value||X0e,"overrides.value")===X0e,d=(l.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!d&&!u&&Sn(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),Sn(c.fallback||d,"cannot send data to receive-only contract","overrides.data",l.data);const f=c.receive||c.fallback&&c.fallback.payable;return Sn(f||u,"cannot send value to non-payable fallback","overrides.value",l.value),Sn(c.fallback||d,"cannot send data to receive-only contract","overrides.data",l.data),l},n=async function(o){const l=j3(e.runner,"call");Fr(fIe(l),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const c=await t(o);try{return await l.call(c)}catch(u){throw rae(u)&&u.data?e.interface.makeError(u.data,c):u}},r=async function(o){const l=e.runner;Fr(pIe(l),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await l.sendTransaction(await t(o)),u=qv(e.runner);return new wae(e.interface,u,c)},s=async function(o){const l=j3(e.runner,"estimateGas");return Fr(hIe(l),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await l.estimateGas(await t(o))},a=async o=>await r(o);return Ps(a,{_contract:e,estimateGas:s,populateTransaction:t,send:r,staticCall:n}),a}function J3t(e,t){const n=function(...u){const d=e.interface.getFunction(t,u);return Fr(d,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:u}}),d},r=async function(...u){const d=n(...u);let f={};if(d.inputs.length+1===u.length&&(f=await xIe(u.pop()),f.from&&(f.from=await Nc(f.from,mIe(e.runner)))),d.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const x=await Q3t(e.runner,d.inputs,u);return Object.assign({},f,await yu({to:e.getAddress(),data:e.interface.encodeFunctionData(d,x)}))},s=async function(...u){const d=await l(...u);return d.length===1?d[0]:d},a=async function(...u){const d=e.runner;Fr(pIe(d),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await d.sendTransaction(await r(...u)),x=qv(e.runner);return new wae(e.interface,x,f)},o=async function(...u){const d=j3(e.runner,"estimateGas");return Fr(hIe(d),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await d.estimateGas(await r(...u))},l=async function(...u){const d=j3(e.runner,"call");Fr(fIe(d),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await r(...u);let x="0x";try{x=await d.call(f)}catch(v){throw rae(v)&&v.data?e.interface.makeError(v.data,f):v}const g=n(...u);return e.interface.decodeFunctionResult(g,x)},c=async(...u)=>n(...u).constant?await s(...u):await a(...u);return Ps(c,{name:e.interface.getFunctionName(t),_contract:e,_key:t,getFragment:n,estimateGas:o,populateTransaction:r,send:a,staticCall:s,staticCallResult:l}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{const u=e.interface.getFunction(t);return Fr(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),u}}),c}function e5t(e,t){const n=function(...s){const a=e.interface.getEvent(t,s);return Fr(a,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:s}}),a},r=function(...s){return new X3t(e,n(...s),s)};return Ps(r,{name:e.interface.getEventName(t),_contract:e,_key:t,getFragment:n}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const s=e.interface.getEvent(t);return Fr(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),s}}),r}const SM=Symbol.for("_ethersInternal_contract"),gIe=new WeakMap;function t5t(e,t){gIe.set(e[SM],t)}function Cf(e){return gIe.get(e[SM])}function n5t(e){return e&&typeof e=="object"&&"getTopicFilter"in e&&typeof e.getTopicFilter=="function"&&e.fragment}async function Cae(e,t){let n,r=null;if(Array.isArray(t)){const a=function(o){if(ao(o,32))return o;const l=e.interface.getEvent(o);return Sn(l,"unknown fragment","name",o),l.topicHash};n=t.map(o=>o==null?null:Array.isArray(o)?o.map(a):a(o))}else t==="*"?n=[null]:typeof t=="string"?ao(t,32)?n=[t]:(r=e.interface.getEvent(t),Sn(r,"unknown fragment","event",t),n=[r.topicHash]):n5t(t)?n=await t.getTopicFilter():"fragment"in t?(r=t.fragment,n=[r.topicHash]):Sn(!1,"unknown event name","event",t);n=n.map(a=>{if(a==null)return null;if(Array.isArray(a)){const o=Array.from(new Set(a.map(l=>l.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return a.toLowerCase()});const s=n.map(a=>a==null?"null":Array.isArray(a)?a.join("|"):a).join("&");return{fragment:r,tag:s,topics:n}}async function mj(e,t){const{subs:n}=Cf(e);return n.get((await Cae(e,t)).tag)||null}async function Q0e(e,t,n){const r=qv(e.runner);Fr(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:t});const{fragment:s,tag:a,topics:o}=await Cae(e,n),{addr:l,subs:c}=Cf(e);let u=c.get(a);if(!u){const f={address:l||e,topics:o},x=C=>{let N=s;if(N==null)try{N=e.interface.getEvent(C.topics[0])}catch{}if(N){const I=N,P=s?e.interface.decodeEventLog(s,C.data,C.topics):[];BJ(e,n,P,R=>new Y3t(e,R,n,I,C))}else BJ(e,n,[],I=>new dIe(e,I,n,C))};let g=[];u={tag:a,listeners:[],start:()=>{g.length||g.push(r.on(f,x))},stop:async()=>{if(g.length==0)return;let C=g;g=[],await Promise.all(C),r.off(f,x)}},c.set(a,u)}return u}let DJ=Promise.resolve();async function r5t(e,t,n,r){await DJ;const s=await mj(e,t);if(!s)return!1;const a=s.listeners.length;return s.listeners=s.listeners.filter(({listener:o,once:l})=>{const c=Array.from(n);r&&c.push(r(l?null:o));try{o.call(e,...c)}catch{}return!l}),s.listeners.length===0&&(s.stop(),Cf(e).subs.delete(s.tag)),a>0}async function BJ(e,t,n,r){try{await DJ}catch{}const s=r5t(e,t,n,r);return DJ=s,await s}const tP=["then"];var TNe;TNe=SM;const x9=class x9{constructor(t,n,r,s){Un(this,"target");Un(this,"interface");Un(this,"runner");Un(this,"filters");Un(this,TNe);Un(this,"fallback");Sn(typeof t=="string"||CTe(t),"invalid value for Contract target","target",t),r==null&&(r=null);const a=LJ.from(n);Ps(this,{target:t,runner:r,interface:a}),Object.defineProperty(this,SM,{value:{}});let o,l=null,c=null;if(s){const f=qv(r);c=new wae(this.interface,f,s)}let u=new Map;if(typeof t=="string")if(ao(t))l=t,o=Promise.resolve(t);else{const f=j3(r,"resolveName");if(!HB(f))throw So("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(t).then(x=>{if(x==null)throw So("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:t});return Cf(this).addr=x,x})}else o=t.getAddress().then(f=>{if(f==null)throw new Error("TODO");return Cf(this).addr=f,f});t5t(this,{addrPromise:o,addr:l,deployTx:c,subs:u});const d=new Proxy({},{get:(f,x,g)=>{if(typeof x=="symbol"||tP.indexOf(x)>=0)return Reflect.get(f,x,g);try{return this.getEvent(x)}catch(v){if(!Kc(v,"INVALID_ARGUMENT")||v.argument!=="key")throw v}},has:(f,x)=>tP.indexOf(x)>=0?Reflect.has(f,x):Reflect.has(f,x)||this.interface.hasEvent(String(x))});return Ps(this,{filters:d}),Ps(this,{fallback:a.receive||a.fallback?Z3t(this):null}),new Proxy(this,{get:(f,x,g)=>{if(typeof x=="symbol"||x in f||tP.indexOf(x)>=0)return Reflect.get(f,x,g);try{return f.getFunction(x)}catch(v){if(!Kc(v,"INVALID_ARGUMENT")||v.argument!=="key")throw v}},has:(f,x)=>typeof x=="symbol"||x in f||tP.indexOf(x)>=0?Reflect.has(f,x):f.interface.hasFunction(x)})}connect(t){return new x9(this.target,this.interface,t)}attach(t){return new x9(t,this.interface,this.runner)}async getAddress(){return await Cf(this).addrPromise}async getDeployedCode(){const t=qv(this.runner);Fr(t,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const n=await t.getCode(await this.getAddress());return n==="0x"?null:n}async waitForDeployment(){const t=this.deploymentTransaction();if(t)return await t.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=qv(this.runner);return Fr(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((s,a)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return s(this);r.once("block",o)}catch(l){a(l)}};o()})}deploymentTransaction(){return Cf(this).deployTx}getFunction(t){return typeof t!="string"&&(t=t.format()),J3t(this,t)}getEvent(t){return typeof t!="string"&&(t=t.format()),e5t(this,t)}async queryTransaction(t){throw new Error("@TODO")}async queryFilter(t,n,r){n==null&&(n=0),r==null&&(r="latest");const{addr:s,addrPromise:a}=Cf(this),o=s||await a,{fragment:l,topics:c}=await Cae(this,t),u={address:o,topics:c,fromBlock:n,toBlock:r},d=qv(this.runner);return Fr(d,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await d.getLogs(u)).map(f=>{let x=l;if(x==null)try{x=this.interface.getEvent(f.topics[0])}catch{}if(x)try{return new vae(f,this.interface,x)}catch(g){return new uIe(f,g)}return new Uk(f,d)})}async on(t,n){const r=await Q0e(this,"on",t);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(t,n){const r=await Q0e(this,"once",t);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(t,...n){return await BJ(this,t,n,null)}async listenerCount(t){if(t){const s=await mj(this,t);return s?s.listeners.length:0}const{subs:n}=Cf(this);let r=0;for(const{listeners:s}of n.values())r+=s.length;return r}async listeners(t){if(t){const s=await mj(this,t);return s?s.listeners.map(({listener:a})=>a):[]}const{subs:n}=Cf(this);let r=[];for(const{listeners:s}of n.values())r=r.concat(s.map(({listener:a})=>a));return r}async off(t,n){const r=await mj(this,t);if(!r)return this;if(n){const s=r.listeners.map(({listener:a})=>a).indexOf(n);s>=0&&r.listeners.splice(s,1)}return(n==null||r.listeners.length===0)&&(r.stop(),Cf(this).subs.delete(r.tag)),this}async removeAllListeners(t){if(t){const n=await mj(this,t);if(!n)return this;n.stop(),Cf(this).subs.delete(n.tag)}else{const{subs:n}=Cf(this);for(const{tag:r,stop:s}of n.values())s(),n.delete(r)}return this}async addListener(t,n){return await this.on(t,n)}async removeListener(t,n){return await this.off(t,n)}static buildClass(t){class n extends x9{constructor(s,a=null){super(s,t,a)}}return n}static from(t,n,r){return r==null&&(r=null),new this(t,n,r)}};let $J=x9;function s5t(){return $J}let Vj=class extends s5t(){};function zH(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Sn(!1,"unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}class i5t{constructor(t){Un(this,"name");Ps(this,{name:t})}connect(t){return this}supportsCoinType(t){return!1}async encodeAddress(t,n){throw new Error("unsupported coin")}async decodeAddress(t,n){throw new Error("unsupported coin")}}const bIe=new RegExp("^(ipfs)://(.*)$","i"),Z0e=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),bIe,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Yb,_w,Xb,bC,hD,yIe;const WC=class WC{constructor(t,n,r){Ln(this,Xb);Un(this,"provider");Un(this,"address");Un(this,"name");Ln(this,Yb);Ln(this,_w);Ps(this,{provider:t,address:n,name:r}),Ht(this,Yb,null),Ht(this,_w,new Vj(n,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],t))}async supportsWildcard(){return $e(this,Yb)==null&&Ht(this,Yb,(async()=>{try{return await $e(this,_w).supportsInterface("0x9061b923")}catch(t){if(Kc(t,"CALL_EXCEPTION"))return!1;throw Ht(this,Yb,null),t}})()),await $e(this,Yb)}async getAddress(t){if(t==null&&(t=60),t===60)try{const a=await yr(this,Xb,bC).call(this,"addr(bytes32)");return a==null||a===lE?null:a}catch(a){if(Kc(a,"CALL_EXCEPTION"))return null;throw a}if(t>=0&&t<2147483648){let a=t+2147483648;const o=await yr(this,Xb,bC).call(this,"addr(bytes32,uint)",[a]);if(ao(o,20))return Ji(o)}let n=null;for(const a of this.provider.plugins)if(a instanceof i5t&&a.supportsCoinType(t)){n=a;break}if(n==null)return null;const r=await yr(this,Xb,bC).call(this,"addr(bytes32,uint)",[t]);if(r==null||r==="0x")return null;const s=await n.decodeAddress(t,r);if(s!=null)return s;Fr(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${t})`,info:{coinType:t,data:r}})}async getText(t){const n=await yr(this,Xb,bC).call(this,"text(bytes32,string)",[t]);return n==null||n==="0x"?null:n}async getContentHash(){const t=await yr(this,Xb,bC).call(this,"contenthash(bytes32)");if(t==null||t==="0x")return null;const n=t.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const s=n[1]==="e3010170"?"ipfs":"ipns",a=parseInt(n[4],16);if(n[5].length===a*2)return`${s}://${pke("0x"+n[2])}`}const r=t.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;Fr(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:t}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const t=[{type:"name",value:this.name}];try{const n=await this.getText("avatar");if(n==null)return t.push({type:"!avatar",value:""}),{url:null,linkage:t};t.push({type:"avatar",value:n});for(let r=0;r<Z0e.length;r++){const s=n.match(Z0e[r]);if(s==null)continue;const a=s[1].toLowerCase();switch(a){case"https":case"data":return t.push({type:"url",value:n}),{linkage:t,url:n};case"ipfs":{const o=zH(n);return t.push({type:"ipfs",value:n}),t.push({type:"url",value:o}),{linkage:t,url:o}}case"erc721":case"erc1155":{const o=a==="erc721"?"tokenURI(uint256)":"uri(uint256)";t.push({type:a,value:n});const l=await this.getAddress();if(l==null)return t.push({type:"!owner",value:""}),{url:null,linkage:t};const c=(s[2]||"").split("/");if(c.length!==2)return t.push({type:`!${a}caip`,value:s[2]||""}),{url:null,linkage:t};const u=c[1],d=new Vj(c[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(a==="erc721"){const w=await d.ownerOf(u);if(l!==w)return t.push({type:"!owner",value:w}),{url:null,linkage:t};t.push({type:"owner",value:w})}else if(a==="erc1155"){const w=await d.balanceOf(l,u);if(!w)return t.push({type:"!balance",value:"0"}),{url:null,linkage:t};t.push({type:"balance",value:w.toString()})}let f=await d[o](u);if(f==null||f==="0x")return t.push({type:"!metadata-url",value:""}),{url:null,linkage:t};t.push({type:"metadata-url-base",value:f}),a==="erc1155"&&(f=f.replace("{id}",t1(u,32).substring(2)),t.push({type:"metadata-url-expanded",value:f})),f.match(/^ipfs:/i)&&(f=zH(f)),t.push({type:"metadata-url",value:f});let x={};const g=await new By(f).send();g.assertOk();try{x=g.bodyJson}catch{try{t.push({type:"!metadata",value:g.bodyText})}catch{const N=g.body;return N&&t.push({type:"!metadata",value:Hr(N)}),{url:null,linkage:t}}return{url:null,linkage:t}}if(!x)return t.push({type:"!metadata",value:""}),{url:null,linkage:t};t.push({type:"metadata",value:JSON.stringify(x)});let v=x.image;if(typeof v!="string")return t.push({type:"!imageUrl",value:""}),{url:null,linkage:t};if(!v.match(/^(https:\/\/|data:)/i)){if(v.match(bIe)==null)return t.push({type:"!imageUrl-ipfs",value:v}),{url:null,linkage:t};t.push({type:"imageUrl-ipfs",value:v}),v=zH(v)}return t.push({type:"url",value:v}),{linkage:t,url:v}}}}}catch{}return{linkage:t,url:null}}static async getEnsAddress(t){const n=await t.getNetwork(),r=n.getPlugin("org.ethers.plugins.network.Ens");return Fr(r,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:n}}),r.address}static async fromName(t,n){var s;let r=n;for(;;){if(r===""||r==="."||n!=="eth"&&r==="eth")return null;const a=await yr(s=WC,hD,yIe).call(s,t,r);if(a!=null){const o=new WC(t,a,n);return r!==n&&!await o.supportsWildcard()?null:o}r=r.split(".").slice(1).join(".")}}};Yb=new WeakMap,_w=new WeakMap,Xb=new WeakSet,bC=async function(t,n){n=(n||[]).slice();const r=$e(this,_w).interface;n.unshift(MJ(this.name));let s=null;await this.supportsWildcard()&&(s=r.getFunction(t),Fr(s,"missing fragment","UNKNOWN_ERROR",{info:{funcName:t}}),n=[y3t(this.name,255),r.encodeFunctionData(s,n)],t="resolve(bytes,bytes)"),n.push({enableCcipRead:!0});try{const a=await $e(this,_w)[t](...n);return s?r.decodeFunctionResult(s,a)[0]:a}catch(a){if(!Kc(a,"CALL_EXCEPTION"))throw a}return null},hD=new WeakSet,yIe=async function(t,n){const r=await WC.getEnsAddress(t);try{const a=await new Vj(r,["function resolver(bytes32) view returns (address)"],t).resolver(MJ(n),{enableCcipRead:!0});return a===lE?null:a}catch(s){throw s}return null},Ln(WC,hD);let NM=WC;const J0e=BigInt(0);function Qi(e,t){return function(n){return n==null?t:e(n)}}function gE(e,t){return n=>{if(t&&n==null)return null;if(!Array.isArray(n))throw new Error("not an array");return n.map(r=>e(r))}}function zk(e,t){return n=>{const r={};for(const s in e){let a=s;if(t&&s in t&&!(a in n)){for(const o of t[s])if(o in n){a=o;break}}try{const o=e[s](n[a]);o!==void 0&&(r[s]=o)}catch(o){const l=o instanceof Error?o.message:"not-an-error";Fr(!1,`invalid value for value.${s} (${l})`,"BAD_DATA",{value:n})}}return r}}function a5t(e){switch(e){case!0:case"true":return!0;case!1:case"false":return!1}Sn(!1,`invalid boolean; ${JSON.stringify(e)}`,"value",e)}function zS(e){return Sn(ao(e,!0),"invalid data","value",e),e}function Gc(e){return Sn(ao(e,32),"invalid hash","value",e),e}const o5t=zk({address:Ji,blockHash:Gc,blockNumber:Mi,data:zS,index:Mi,removed:Qi(a5t,!1),topics:gE(Gc),transactionHash:Gc,transactionIndex:Mi},{index:["logIndex"]});function l5t(e){return o5t(e)}const c5t=zk({hash:Qi(Gc),parentHash:Gc,parentBeaconBlockRoot:Qi(Gc,null),number:Mi,timestamp:Mi,nonce:Qi(zS),difficulty:gs,gasLimit:gs,gasUsed:gs,stateRoot:Qi(Gc,null),receiptsRoot:Qi(Gc,null),blobGasUsed:Qi(gs,null),excessBlobGas:Qi(gs,null),miner:Qi(Ji),prevRandao:Qi(Gc,null),extraData:zS,baseFeePerGas:Qi(gs)},{prevRandao:["mixHash"]});function u5t(e){const t=c5t(e);return t.transactions=e.transactions.map(n=>typeof n=="string"?n:vIe(n)),t}const d5t=zk({transactionIndex:Mi,blockNumber:Mi,transactionHash:Gc,address:Ji,topics:gE(Gc),data:zS,index:Mi,blockHash:Gc},{index:["logIndex"]});function f5t(e){return d5t(e)}const h5t=zk({to:Qi(Ji,null),from:Qi(Ji,null),contractAddress:Qi(Ji,null),index:Mi,root:Qi(Hr),gasUsed:gs,blobGasUsed:Qi(gs,null),logsBloom:Qi(zS),blockHash:Gc,hash:Gc,logs:gE(f5t),blockNumber:Mi,cumulativeGasUsed:gs,effectiveGasPrice:Qi(gs),blobGasPrice:Qi(gs,null),status:Qi(Mi),type:Qi(Mi,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function p5t(e){return h5t(e)}function vIe(e){e.to&&gs(e.to)===J0e&&(e.to="0x0000000000000000000000000000000000000000");const t=zk({hash:Gc,index:Qi(Mi,void 0),type:n=>n==="0x"||n==null?0:Mi(n),accessList:Qi(o5,null),blobVersionedHashes:Qi(gE(Gc,!0),null),authorizationList:Qi(gE(n=>{let r;if(n.signature)r=n.signature;else{let s=n.yParity;s==="0x1b"?s=0:s==="0x1c"&&(s=1),r=Object.assign({},n,{yParity:s})}return{address:Ji(n.address),chainId:gs(n.chainId),nonce:gs(n.nonce),signature:Zc.from(r)}},!1),null),blockHash:Qi(Gc,null),blockNumber:Qi(Mi,null),transactionIndex:Qi(Mi,null),from:Ji,gasPrice:Qi(gs),maxPriorityFeePerGas:Qi(gs),maxFeePerGas:Qi(gs),maxFeePerBlobGas:Qi(gs,null),gasLimit:gs,to:Qi(Ji,null),value:gs,nonce:Mi,data:zS,creates:Qi(Ji,null),chainId:Qi(gs,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(e);if(t.to==null&&t.creates==null&&(t.creates=twt(t)),(e.type===1||e.type===2)&&e.accessList==null&&(t.accessList=[]),e.signature?t.signature=Zc.from(e.signature):t.signature=Zc.from(e),t.chainId==null){const n=t.signature.legacyChainId;n!=null&&(t.chainId=n)}return t.blockHash&&gs(t.blockHash)===J0e&&(t.blockHash=null),t}const m5t="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class Hk{constructor(t){Un(this,"name");Ps(this,{name:t})}clone(){return new Hk(this.name)}}class VB extends Hk{constructor(n,r){n==null&&(n=0);super(`org.ethers.network.plugins.GasCost#${n||0}`);Un(this,"effectiveBlock");Un(this,"txBase");Un(this,"txCreate");Un(this,"txDataZero");Un(this,"txDataNonzero");Un(this,"txAccessListStorageKey");Un(this,"txAccessListAddress");const s={effectiveBlock:n};function a(o,l){let c=(r||{})[o];c==null&&(c=l),Sn(typeof c=="number",`invalud value for ${o}`,"costs",r),s[o]=c}a("txBase",21e3),a("txCreate",32e3),a("txDataZero",4),a("txDataNonzero",16),a("txAccessListStorageKey",1900),a("txAccessListAddress",2400),Ps(this,s)}clone(){return new VB(this.effectiveBlock,this)}}class WB extends Hk{constructor(n,r){super("org.ethers.plugins.network.Ens");Un(this,"address");Un(this,"targetNetwork");Ps(this,{address:n||m5t,targetNetwork:r??1})}clone(){return new WB(this.address,this.targetNetwork)}}var ik,ak;class x5t extends Hk{constructor(n,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");Ln(this,ik);Ln(this,ak);Ht(this,ik,n),Ht(this,ak,r)}get url(){return $e(this,ik)}get processFunc(){return $e(this,ak)}clone(){return this}}ik=new WeakMap,ak=new WeakMap;const HH=new Map;var rS,sS,Qb,Rg;let cy=(Rg=class{constructor(t,n){Ln(this,rS);Ln(this,sS);Ln(this,Qb);Ht(this,rS,t),Ht(this,sS,gs(n)),Ht(this,Qb,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return $e(this,rS)}set name(t){Ht(this,rS,t)}get chainId(){return $e(this,sS)}set chainId(t){Ht(this,sS,gs(t,"chainId"))}matches(t){if(t==null)return!1;if(typeof t=="string"){try{return this.chainId===gs(t)}catch{}return this.name===t}if(typeof t=="number"||typeof t=="bigint"){try{return this.chainId===gs(t)}catch{}return!1}if(typeof t=="object"){if(t.chainId!=null){try{return this.chainId===gs(t.chainId)}catch{}return!1}return t.name!=null?this.name===t.name:!1}return!1}get plugins(){return Array.from($e(this,Qb).values())}attachPlugin(t){if($e(this,Qb).get(t.name))throw new Error(`cannot replace existing plugin: ${t.name} `);return $e(this,Qb).set(t.name,t.clone()),this}getPlugin(t){return $e(this,Qb).get(t)||null}getPlugins(t){return this.plugins.filter(n=>n.name.split("#")[0]===t)}clone(){const t=new Rg(this.name,this.chainId);return this.plugins.forEach(n=>{t.attachPlugin(n.clone())}),t}computeIntrinsicGas(t){const n=this.getPlugin("org.ethers.plugins.network.GasCost")||new VB;let r=n.txBase;if(t.to==null&&(r+=n.txCreate),t.data)for(let s=2;s<t.data.length;s+=2)t.data.substring(s,s+2)==="00"?r+=n.txDataZero:r+=n.txDataNonzero;if(t.accessList){const s=o5(t.accessList);for(const a in s)r+=n.txAccessListAddress+n.txAccessListStorageKey*s[a].storageKeys.length}return r}static from(t){if(g5t(),t==null)return Rg.from("mainnet");if(typeof t=="number"&&(t=BigInt(t)),typeof t=="string"||typeof t=="bigint"){const n=HH.get(t);if(n)return n();if(typeof t=="bigint")return new Rg("unknown",t);Sn(!1,"unknown network","network",t)}if(typeof t.clone=="function")return t.clone();if(typeof t=="object"){Sn(typeof t.name=="string"&&typeof t.chainId=="number","invalid network object name or chainId","network",t);const n=new Rg(t.name,t.chainId);return(t.ensAddress||t.ensNetwork!=null)&&n.attachPlugin(new WB(t.ensAddress,t.ensNetwork)),n}Sn(!1,"invalid network","network",t)}static register(t,n){typeof t=="number"&&(t=BigInt(t));const r=HH.get(t);r&&Sn(!1,`conflicting network for ${JSON.stringify(r.name)}`,"nameOrChainId",t),HH.set(t,n)}},rS=new WeakMap,sS=new WeakMap,Qb=new WeakMap,Rg);function exe(e,t){const n=String(e);if(!n.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${e}`);const r=n.split(".");if(r.length===1&&r.push(""),r.length!==2)throw new Error(`invalid gwei value: ${e}`);for(;r[1].length<t;)r[1]+="0";if(r[1].length>9){let s=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||s++,r[1]=s.toString()}return BigInt(r[0]+r[1])}function txe(e){return new x5t(e,async(t,n,r)=>{r.setHeader("User-Agent","ethers");let s;try{const[a,o]=await Promise.all([r.send(),t()]);s=a;const l=s.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:exe(l.maxFee,9),maxPriorityFeePerGas:exe(l.maxPriorityFee,9)}}catch(a){Fr(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:s,error:a})}})}let nxe=!1;function g5t(){if(nxe)return;nxe=!0;function e(t,n,r){const s=function(){const a=new cy(t,n);return r.ensNetwork!=null&&a.attachPlugin(new WB(null,r.ensNetwork)),a.attachPlugin(new VB),(r.plugins||[]).forEach(o=>{a.attachPlugin(o)}),a};cy.register(t,s),cy.register(n,s),r.altNames&&r.altNames.forEach(a=>{cy.register(a,s)})}e("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),e("ropsten",3,{ensNetwork:3}),e("rinkeby",4,{ensNetwork:4}),e("goerli",5,{ensNetwork:5}),e("kovan",42,{ensNetwork:42}),e("sepolia",11155111,{ensNetwork:11155111}),e("holesky",17e3,{ensNetwork:17e3}),e("classic",61,{}),e("classicKotti",6,{}),e("arbitrum",42161,{ensNetwork:1}),e("arbitrum-goerli",421613,{}),e("arbitrum-sepolia",421614,{}),e("base",8453,{ensNetwork:1}),e("base-goerli",84531,{}),e("base-sepolia",84532,{}),e("bnb",56,{ensNetwork:1}),e("bnbt",97,{}),e("linea",59144,{ensNetwork:1}),e("linea-goerli",59140,{}),e("linea-sepolia",59141,{}),e("matic",137,{ensNetwork:1,plugins:[txe("https://gasstation.polygon.technology/v2")]}),e("matic-amoy",80002,{}),e("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[txe("https://gasstation-testnet.polygon.technology/v2")]}),e("optimism",10,{ensNetwork:1,plugins:[]}),e("optimism-goerli",420,{}),e("optimism-sepolia",11155420,{}),e("xdai",100,{ensNetwork:1})}function UJ(e){return JSON.parse(JSON.stringify(e))}var bg,Th,Zb,l0,iS,eO;class b5t{constructor(t){Ln(this,iS);Ln(this,bg);Ln(this,Th);Ln(this,Zb);Ln(this,l0);Ht(this,bg,t),Ht(this,Th,null),Ht(this,Zb,4e3),Ht(this,l0,-2)}get pollingInterval(){return $e(this,Zb)}set pollingInterval(t){Ht(this,Zb,t)}start(){$e(this,Th)||(Ht(this,Th,$e(this,bg)._setTimeout(yr(this,iS,eO).bind(this),$e(this,Zb))),yr(this,iS,eO).call(this))}stop(){$e(this,Th)&&($e(this,bg)._clearTimeout($e(this,Th)),Ht(this,Th,null))}pause(t){this.stop(),t&&Ht(this,l0,-2)}resume(){this.start()}}bg=new WeakMap,Th=new WeakMap,Zb=new WeakMap,l0=new WeakMap,iS=new WeakSet,eO=async function(){try{const t=await $e(this,bg).getBlockNumber();if($e(this,l0)===-2){Ht(this,l0,t);return}if(t!==$e(this,l0)){for(let n=$e(this,l0)+1;n<=t;n++){if($e(this,Th)==null)return;await $e(this,bg).emit("block",n)}Ht(this,l0,t)}}catch{}$e(this,Th)!=null&&Ht(this,Th,$e(this,bg)._setTimeout(yr(this,iS,eO).bind(this),$e(this,Zb)))};var kw,Tw,Jb;class Sae{constructor(t){Ln(this,kw);Ln(this,Tw);Ln(this,Jb);Ht(this,kw,t),Ht(this,Jb,!1),Ht(this,Tw,n=>{this._poll(n,$e(this,kw))})}async _poll(t,n){throw new Error("sub-classes must override this")}start(){$e(this,Jb)||(Ht(this,Jb,!0),$e(this,Tw).call(this,-2),$e(this,kw).on("block",$e(this,Tw)))}stop(){$e(this,Jb)&&(Ht(this,Jb,!1),$e(this,kw).off("block",$e(this,Tw)))}pause(t){this.stop()}resume(){this.start()}}kw=new WeakMap,Tw=new WeakMap,Jb=new WeakMap;var aS,yg;class y5t extends Sae{constructor(n,r){super(n);Ln(this,aS);Ln(this,yg);Ht(this,aS,r),Ht(this,yg,-2)}pause(n){n&&Ht(this,yg,-2),super.pause(n)}async _poll(n,r){const s=await r.getBlock($e(this,aS));s!=null&&($e(this,yg)===-2?Ht(this,yg,s.number):s.number>$e(this,yg)&&(r.emit($e(this,aS),s.number),Ht(this,yg,s.number)))}}aS=new WeakMap,yg=new WeakMap;var pD;class v5t extends Sae{constructor(n,r){super(n);Ln(this,pD);Ht(this,pD,UJ(r))}async _poll(n,r){throw new Error("@TODO")}}pD=new WeakMap;var oS;class w5t extends Sae{constructor(n,r){super(n);Ln(this,oS);Ht(this,oS,r)}async _poll(n,r){const s=await r.getTransactionReceipt($e(this,oS));s&&r.emit($e(this,oS),s)}}oS=new WeakMap;var vg,lS,cS,ey,Ih,mD,wIe;class Nae{constructor(t,n){Ln(this,mD);Ln(this,vg);Ln(this,lS);Ln(this,cS);Ln(this,ey);Ln(this,Ih);Ht(this,vg,t),Ht(this,lS,UJ(n)),Ht(this,cS,yr(this,mD,wIe).bind(this)),Ht(this,ey,!1),Ht(this,Ih,-2)}start(){$e(this,ey)||(Ht(this,ey,!0),$e(this,Ih)===-2&&$e(this,vg).getBlockNumber().then(t=>{Ht(this,Ih,t)}),$e(this,vg).on("block",$e(this,cS)))}stop(){$e(this,ey)&&(Ht(this,ey,!1),$e(this,vg).off("block",$e(this,cS)))}pause(t){this.stop(),t&&Ht(this,Ih,-2)}resume(){this.start()}}vg=new WeakMap,lS=new WeakMap,cS=new WeakMap,ey=new WeakMap,Ih=new WeakMap,mD=new WeakSet,wIe=async function(t){if($e(this,Ih)===-2)return;const n=UJ($e(this,lS));n.fromBlock=$e(this,Ih)+1,n.toBlock=t;const r=await $e(this,vg).getLogs(n);if(r.length===0){$e(this,Ih)<t-60&&Ht(this,Ih,t-60);return}for(const s of r)$e(this,vg).emit($e(this,lS),s),Ht(this,Ih,s.blockNumber)};const C5t=BigInt(2),S5t=10;function nP(e){return e&&typeof e.then=="function"}function tO(e,t){return e+":"+JSON.stringify(t,(n,r)=>{if(r==null)return"null";if(typeof r=="bigint")return`bigint:${r.toString()}`;if(typeof r=="string")return r.toLowerCase();if(typeof r=="object"&&!Array.isArray(r)){const s=Object.keys(r);return s.sort(),s.reduce((a,o)=>(a[o]=r[o],a),{})}return r})}class CIe{constructor(t){Un(this,"name");Ps(this,{name:t})}start(){}stop(){}pause(t){}resume(){}}function N5t(e){return JSON.parse(JSON.stringify(e))}function zJ(e){return e=Array.from(new Set(e).values()),e.sort(),e}async function VH(e,t){if(e==null)throw new Error("invalid event");if(Array.isArray(e)&&(e={topics:e}),typeof e=="string")switch(e){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:e,tag:e}}if(ao(e,32)){const n=e.toLowerCase();return{type:"transaction",tag:tO("tx",{hash:n}),hash:n}}if(e.orphan){const n=e;return{type:"orphan",tag:tO("orphan",n),filter:N5t(n)}}if(e.address||e.topics){const n=e,r={topics:(n.topics||[]).map(s=>s==null?null:Array.isArray(s)?zJ(s.map(a=>a.toLowerCase())):s.toLowerCase())};if(n.address){const s=[],a=[],o=l=>{ao(l)?s.push(l):a.push((async()=>{s.push(await Nc(l,t))})())};Array.isArray(n.address)?n.address.forEach(o):o(n.address),a.length&&await Promise.all(a),r.address=zJ(s.map(l=>l.toLowerCase()))}return{filter:r,tag:tO("event",r),type:"event"}}Sn(!1,"unknown ProviderEvent","event",e)}function WH(){return new Date().getTime()}const A5t={cacheTimeout:250,pollingInterval:4e3};var xu,ty,gu,uS,Ef,Iw,ny,wg,ok,Ph,dS,fS,Bi,yf,HJ,VJ,xj,WJ,gj,nO;class j5t{constructor(t,n){Ln(this,Bi);Ln(this,xu);Ln(this,ty);Ln(this,gu);Ln(this,uS);Ln(this,Ef);Ln(this,Iw);Ln(this,ny);Ln(this,wg);Ln(this,ok);Ln(this,Ph);Ln(this,dS);Ln(this,fS);if(Ht(this,fS,Object.assign({},A5t,n||{})),t==="any")Ht(this,Iw,!0),Ht(this,Ef,null);else if(t){const r=cy.from(t);Ht(this,Iw,!1),Ht(this,Ef,Promise.resolve(r)),setTimeout(()=>{this.emit("network",r,null)},0)}else Ht(this,Iw,!1),Ht(this,Ef,null);Ht(this,wg,-1),Ht(this,ny,new Map),Ht(this,xu,new Map),Ht(this,ty,new Map),Ht(this,gu,null),Ht(this,uS,!1),Ht(this,ok,1),Ht(this,Ph,new Map),Ht(this,dS,!1)}get pollingInterval(){return $e(this,fS).pollingInterval}get provider(){return this}get plugins(){return Array.from($e(this,ty).values())}attachPlugin(t){if($e(this,ty).get(t.name))throw new Error(`cannot replace existing plugin: ${t.name} `);return $e(this,ty).set(t.name,t.connect(this)),this}getPlugin(t){return $e(this,ty).get(t)||null}get disableCcipRead(){return $e(this,dS)}set disableCcipRead(t){Ht(this,dS,!!t)}async ccipReadFetch(t,n,r){if(this.disableCcipRead||r.length===0||t.to==null)return null;const s=t.to.toLowerCase(),a=n.toLowerCase(),o=[];for(let l=0;l<r.length;l++){const c=r[l],u=c.replace("{sender}",s).replace("{data}",a),d=new By(u);c.indexOf("{data}")===-1&&(d.body={data:a,sender:s}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:d,index:l,urls:r});let f="unknown error",x;try{x=await d.send()}catch(g){o.push(g.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:d,result:{error:g}});continue}try{const g=x.bodyJson;if(g.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:d,result:g}),g.data;g.message&&(f=g.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:d,result:g})}catch{}Fr(x.statusCode<400||x.statusCode>=500,`response not found during CCIP fetch: ${f}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:t,info:{url:c,errorMessage:f}}),o.push(f)}Fr(!1,`error encountered during CCIP fetch: ${o.map(l=>JSON.stringify(l)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:t,info:{urls:r,errorMessages:o}})}_wrapBlock(t,n){return new W3t(u5t(t),this)}_wrapLog(t,n){return new Uk(l5t(t),this)}_wrapTransactionReceipt(t,n){return new oIe(p5t(t),this)}_wrapTransactionResponse(t,n){return new xE(vIe(t),this)}_detectNetwork(){Fr(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(t){Fr(!1,`unsupported method: ${t.method}`,"UNSUPPORTED_OPERATION",{operation:t.method,info:t})}async getBlockNumber(){const t=Mi(await yr(this,Bi,yf).call(this,{method:"getBlockNumber"}),"%response");return $e(this,wg)>=0&&Ht(this,wg,t),t}_getAddress(t){return Nc(t,this)}_getBlockTag(t){if(t==null)return"latest";switch(t){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return t}if(ao(t))return ao(t,32)?t:qp(t);if(typeof t=="bigint"&&(t=Mi(t,"blockTag")),typeof t=="number")return t>=0?qp(t):$e(this,wg)>=0?qp($e(this,wg)+t):this.getBlockNumber().then(n=>qp(n+t));Sn(!1,"invalid blockTag","blockTag",t)}_getFilter(t){const n=(t.topics||[]).map(c=>c==null?null:Array.isArray(c)?zJ(c.map(u=>u.toLowerCase())):c.toLowerCase()),r="blockHash"in t?t.blockHash:void 0,s=(c,u,d)=>{let f;switch(c.length){case 0:break;case 1:f=c[0];break;default:c.sort(),f=c}if(r&&(u!=null||d!=null))throw new Error("invalid filter");const x={};return f&&(x.address=f),n.length&&(x.topics=n),u&&(x.fromBlock=u),d&&(x.toBlock=d),r&&(x.blockHash=r),x};let a=[];if(t.address)if(Array.isArray(t.address))for(const c of t.address)a.push(this._getAddress(c));else a.push(this._getAddress(t.address));let o;"fromBlock"in t&&(o=this._getBlockTag(t.fromBlock));let l;return"toBlock"in t&&(l=this._getBlockTag(t.toBlock)),a.filter(c=>typeof c!="string").length||o!=null&&typeof o!="string"||l!=null&&typeof l!="string"?Promise.all([Promise.all(a),o,l]).then(c=>s(c[0],c[1],c[2])):s(a,o,l)}_getTransactionRequest(t){const n=mE(t),r=[];if(["to","from"].forEach(s=>{if(n[s]==null)return;const a=Nc(n[s],this);nP(a)?r.push(async function(){n[s]=await a}()):n[s]=a}),n.blockTag!=null){const s=this._getBlockTag(n.blockTag);nP(s)?r.push(async function(){n.blockTag=await s}()):n.blockTag=s}return r.length?async function(){return await Promise.all(r),n}():n}async getNetwork(){if($e(this,Ef)==null){const s=(async()=>{try{const a=await this._detectNetwork();return this.emit("network",a,null),a}catch(a){throw $e(this,Ef)===s&&Ht(this,Ef,null),a}})();return Ht(this,Ef,s),(await s).clone()}const t=$e(this,Ef),[n,r]=await Promise.all([t,this._detectNetwork()]);return n.chainId!==r.chainId&&($e(this,Iw)?(this.emit("network",r,n),$e(this,Ef)===t&&Ht(this,Ef,Promise.resolve(r))):Fr(!1,`network changed: ${n.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),n.clone()}async getFeeData(){const t=await this.getNetwork(),n=async()=>{const{_block:s,gasPrice:a,priorityFee:o}=await yu({_block:yr(this,Bi,WJ).call(this,"latest",!1),gasPrice:(async()=>{try{const d=await yr(this,Bi,yf).call(this,{method:"getGasPrice"});return gs(d,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const d=await yr(this,Bi,yf).call(this,{method:"getPriorityFee"});return gs(d,"%response")}catch{}return null})()});let l=null,c=null;const u=this._wrapBlock(s,t);return u&&u.baseFeePerGas&&(c=o??BigInt("1000000000"),l=u.baseFeePerGas*C5t+c),new Y0e(a,l,c)},r=t.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const s=new By(r.url),a=await r.processFunc(n,this,s);return new Y0e(a.gasPrice,a.maxFeePerGas,a.maxPriorityFeePerGas)}return await n()}async estimateGas(t){let n=this._getTransactionRequest(t);return nP(n)&&(n=await n),gs(await yr(this,Bi,yf).call(this,{method:"estimateGas",transaction:n}),"%response")}async call(t){const{tx:n,blockTag:r}=await yu({tx:this._getTransactionRequest(t),blockTag:this._getBlockTag(t.blockTag)});return await yr(this,Bi,VJ).call(this,yr(this,Bi,HJ).call(this,n,r,t.enableCcipRead?0:-1))}async getBalance(t,n){return gs(await yr(this,Bi,xj).call(this,{method:"getBalance"},t,n),"%response")}async getTransactionCount(t,n){return Mi(await yr(this,Bi,xj).call(this,{method:"getTransactionCount"},t,n),"%response")}async getCode(t,n){return Hr(await yr(this,Bi,xj).call(this,{method:"getCode"},t,n))}async getStorage(t,n,r){const s=gs(n,"position");return Hr(await yr(this,Bi,xj).call(this,{method:"getStorage",position:s},t,r))}async broadcastTransaction(t){const{blockNumber:n,hash:r,network:s}=await yu({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:t}),network:this.getNetwork()}),a=xae.from(t);if(a.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(a,s).replaceableTransaction(n)}async getBlock(t,n){const{network:r,params:s}=await yu({network:this.getNetwork(),params:yr(this,Bi,WJ).call(this,t,!!n)});return s==null?null:this._wrapBlock(s,r)}async getTransaction(t){const{network:n,params:r}=await yu({network:this.getNetwork(),params:yr(this,Bi,yf).call(this,{method:"getTransaction",hash:t})});return r==null?null:this._wrapTransactionResponse(r,n)}async getTransactionReceipt(t){const{network:n,params:r}=await yu({network:this.getNetwork(),params:yr(this,Bi,yf).call(this,{method:"getTransactionReceipt",hash:t})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){const s=await yr(this,Bi,yf).call(this,{method:"getTransaction",hash:t});if(s==null)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=s.gasPrice}return this._wrapTransactionReceipt(r,n)}async getTransactionResult(t){const{result:n}=await yu({network:this.getNetwork(),result:yr(this,Bi,yf).call(this,{method:"getTransactionResult",hash:t})});return n==null?null:Hr(n)}async getLogs(t){let n=this._getFilter(t);nP(n)&&(n=await n);const{network:r,params:s}=await yu({network:this.getNetwork(),params:yr(this,Bi,yf).call(this,{method:"getLogs",filter:n})});return s.map(a=>this._wrapLog(a,r))}_getProvider(t){Fr(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(t){return await NM.fromName(this,t)}async getAvatar(t){const n=await this.getResolver(t);return n?await n.getAvatar():null}async resolveName(t){const n=await this.getResolver(t);return n?await n.getAddress():null}async lookupAddress(t){t=Ji(t);const n=MJ(t.substring(2).toLowerCase()+".addr.reverse");try{const r=await NM.getEnsAddress(this),a=await new Vj(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(a==null||a===lE)return null;const l=await new Vj(a,["function name(bytes32) view returns (string)"],this).name(n);return await this.resolveName(l)!==t?null:l}catch(r){if(Kc(r,"BAD_DATA")&&r.value==="0x"||Kc(r,"CALL_EXCEPTION"))return null;throw r}return null}async waitForTransaction(t,n,r){const s=n??1;return s===0?this.getTransactionReceipt(t):new Promise(async(a,o)=>{let l=null;const c=async u=>{try{const d=await this.getTransactionReceipt(t);if(d!=null&&u-d.blockNumber+1>=s){a(d),l&&(clearTimeout(l),l=null);return}}catch(d){console.log("EEE",d)}this.once("block",c)};r!=null&&(l=setTimeout(()=>{l!=null&&(l=null,this.off("block",c),o(So("timeout","TIMEOUT",{reason:"timeout"})))},r)),c(await this.getBlockNumber())})}async waitForBlock(t){Fr(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(t){const n=$e(this,Ph).get(t);n&&(n.timer&&clearTimeout(n.timer),$e(this,Ph).delete(t))}_setTimeout(t,n){n==null&&(n=0);const r=eb(this,ok)._++,s=()=>{$e(this,Ph).delete(r),t()};if(this.paused)$e(this,Ph).set(r,{timer:null,func:s,time:n});else{const a=setTimeout(s,n);$e(this,Ph).set(r,{timer:a,func:s,time:WH()})}return r}_forEachSubscriber(t){for(const n of $e(this,xu).values())t(n.subscriber)}_getSubscriber(t){switch(t.type){case"debug":case"error":case"network":return new CIe(t.type);case"block":{const n=new b5t(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new y5t(this,t.type);case"event":return new Nae(this,t.filter);case"transaction":return new w5t(this,t.hash);case"orphan":return new v5t(this,t.filter)}throw new Error(`unsupported event: ${t.type}`)}_recoverSubscriber(t,n){for(const r of $e(this,xu).values())if(r.subscriber===t){r.started&&r.subscriber.stop(),r.subscriber=n,r.started&&n.start(),$e(this,gu)!=null&&n.pause($e(this,gu));break}}async on(t,n){const r=await yr(this,Bi,nO).call(this,t);return r.listeners.push({listener:n,once:!1}),r.started||(r.subscriber.start(),r.started=!0,$e(this,gu)!=null&&r.subscriber.pause($e(this,gu))),this}async once(t,n){const r=await yr(this,Bi,nO).call(this,t);return r.listeners.push({listener:n,once:!0}),r.started||(r.subscriber.start(),r.started=!0,$e(this,gu)!=null&&r.subscriber.pause($e(this,gu))),this}async emit(t,...n){const r=await yr(this,Bi,gj).call(this,t,n);if(!r||r.listeners.length===0)return!1;const s=r.listeners.length;return r.listeners=r.listeners.filter(({listener:a,once:o})=>{const l=new mke(this,o?null:a,t);try{a.call(this,...n,l)}catch{}return!o}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),$e(this,xu).delete(r.tag)),s>0}async listenerCount(t){if(t){const r=await yr(this,Bi,gj).call(this,t);return r?r.listeners.length:0}let n=0;for(const{listeners:r}of $e(this,xu).values())n+=r.length;return n}async listeners(t){if(t){const r=await yr(this,Bi,gj).call(this,t);return r?r.listeners.map(({listener:s})=>s):[]}let n=[];for(const{listeners:r}of $e(this,xu).values())n=n.concat(r.map(({listener:s})=>s));return n}async off(t,n){const r=await yr(this,Bi,gj).call(this,t);if(!r)return this;if(n){const s=r.listeners.map(({listener:a})=>a).indexOf(n);s>=0&&r.listeners.splice(s,1)}return(!n||r.listeners.length===0)&&(r.started&&r.subscriber.stop(),$e(this,xu).delete(r.tag)),this}async removeAllListeners(t){if(t){const{tag:n,started:r,subscriber:s}=await yr(this,Bi,nO).call(this,t);r&&s.stop(),$e(this,xu).delete(n)}else for(const[n,{started:r,subscriber:s}]of $e(this,xu))r&&s.stop(),$e(this,xu).delete(n);return this}async addListener(t,n){return await this.on(t,n)}async removeListener(t,n){return this.off(t,n)}get destroyed(){return $e(this,uS)}destroy(){this.removeAllListeners();for(const t of $e(this,Ph).keys())this._clearTimeout(t);Ht(this,uS,!0)}get paused(){return $e(this,gu)!=null}set paused(t){!!t!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(t){if(Ht(this,wg,-1),$e(this,gu)!=null){if($e(this,gu)==!!t)return;Fr(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(n=>n.pause(t)),Ht(this,gu,!!t);for(const n of $e(this,Ph).values())n.timer&&clearTimeout(n.timer),n.time=WH()-n.time}resume(){if($e(this,gu)!=null){this._forEachSubscriber(t=>t.resume()),Ht(this,gu,null);for(const t of $e(this,Ph).values()){let n=t.time;n<0&&(n=0),t.time=WH(),setTimeout(t.func,n)}}}}xu=new WeakMap,ty=new WeakMap,gu=new WeakMap,uS=new WeakMap,Ef=new WeakMap,Iw=new WeakMap,ny=new WeakMap,wg=new WeakMap,ok=new WeakMap,Ph=new WeakMap,dS=new WeakMap,fS=new WeakMap,Bi=new WeakSet,yf=async function(t){const n=$e(this,fS).cacheTimeout;if(n<0)return await this._perform(t);const r=tO(t.method,t);let s=$e(this,ny).get(r);return s||(s=this._perform(t),$e(this,ny).set(r,s),setTimeout(()=>{$e(this,ny).get(r)===s&&$e(this,ny).delete(r)},n)),await s},HJ=async function(t,n,r){Fr(r<S5t,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},t,{blockTag:n,enableCcipRead:!0})});const s=mE(t);try{return Hr(await this._perform({method:"call",transaction:s,blockTag:n}))}catch(a){if(!this.disableCcipRead&&rae(a)&&a.data&&r>=0&&n==="latest"&&s.to!=null&&po(a.data,0,4)==="0x556f1830"){const o=a.data,l=await Nc(s.to,this);let c;try{c=I5t(po(a.data,4))}catch(f){Fr(!1,f.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:s,info:{data:o}})}Fr(c.sender.toLowerCase()===l.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:s,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:c.errorArgs}});const u=await this.ccipReadFetch(s,c.calldata,c.urls);Fr(u!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:s,info:{data:a.data,errorArgs:c.errorArgs}});const d={to:l,data:Pa([c.selector,T5t([u,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:d});try{const f=await yr(this,Bi,HJ).call(this,d,n,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},d),result:f}),f}catch(f){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},d),error:f}),f}}throw a}},VJ=async function(t){const{value:n}=await yu({network:this.getNetwork(),value:t});return n},xj=async function(t,n,r){let s=this._getAddress(n),a=this._getBlockTag(r);return(typeof s!="string"||typeof a!="string")&&([s,a]=await Promise.all([s,a])),await yr(this,Bi,VJ).call(this,yr(this,Bi,yf).call(this,Object.assign(t,{address:s,blockTag:a})))},WJ=async function(t,n){if(ao(t,32))return await yr(this,Bi,yf).call(this,{method:"getBlock",blockHash:t,includeTransactions:n});let r=this._getBlockTag(t);return typeof r!="string"&&(r=await r),await yr(this,Bi,yf).call(this,{method:"getBlock",blockTag:r,includeTransactions:n})},gj=async function(t,n){let r=await VH(t,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await VH({orphan:"drop-log",log:n[0]},this)),$e(this,xu).get(r.tag)||null},nO=async function(t){const n=await VH(t,this),r=n.tag;let s=$e(this,xu).get(r);return s||(s={subscriber:this._getSubscriber(n),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},$e(this,xu).set(r,s)),s};function E5t(e,t){try{const n=qJ(e,t);if(n)return xM(n)}catch{}return null}function qJ(e,t){if(e==="0x")return null;try{const n=Mi(po(e,t,t+32)),r=Mi(po(e,n,n+32));return po(e,n+32,n+32+r)}catch{}return null}function rxe(e){const t=tl(e);if(t.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(t,32-t.length),n}function _5t(e){if(e.length%32===0)return e;const t=new Uint8Array(Math.ceil(e.length/32)*32);return t.set(e),t}const k5t=new Uint8Array([]);function T5t(e){const t=[];let n=0;for(let r=0;r<e.length;r++)t.push(k5t),n+=32;for(let r=0;r<e.length;r++){const s=cs(e[r]);t[r]=rxe(n),t.push(rxe(s.length)),t.push(_5t(s)),n+=32+Math.ceil(s.length/32)*32}return Pa(t)}const sxe="0x0000000000000000000000000000000000000000000000000000000000000000";function I5t(e){const t={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};Fr(e4(e)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=po(e,0,32);Fr(po(n,0,12)===po(sxe,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),t.sender=po(n,12);try{const r=[],s=Mi(po(e,32,64)),a=Mi(po(e,s,s+32)),o=po(e,s+32);for(let l=0;l<a;l++){const c=E5t(o,l*32);if(c==null)throw new Error("abort");r.push(c)}t.urls=r}catch{Fr(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const r=qJ(e,64);if(r==null)throw new Error("abort");t.calldata=r}catch{Fr(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}Fr(po(e,100,128)===po(sxe,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),t.selector=po(e,96,100);try{const r=qJ(e,128);if(r==null)throw new Error("abort");t.extraData=r}catch{Fr(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return t.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(r=>t[r]),t}function sv(e,t){if(e.provider)return e.provider;Fr(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:t})}async function ixe(e,t){let n=mE(t);if(n.to!=null&&(n.to=Nc(n.to,e)),n.from!=null){const r=n.from;n.from=Promise.all([e.getAddress(),Nc(r,e)]).then(([s,a])=>(Sn(s.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),s))}else n.from=e.getAddress();return await yu(n)}class Aae{constructor(t){Un(this,"provider");Ps(this,{provider:t||null})}async getNonce(t){return sv(this,"getTransactionCount").getTransactionCount(await this.getAddress(),t)}async populateCall(t){return await ixe(this,t)}async populateTransaction(t){const n=sv(this,"populateTransaction"),r=await ixe(this,t);r.nonce==null&&(r.nonce=await this.getNonce("pending")),r.gasLimit==null&&(r.gasLimit=await this.estimateGas(r));const s=await this.provider.getNetwork();if(r.chainId!=null){const o=gs(r.chainId);Sn(o===s.chainId,"transaction chainId mismatch","tx.chainId",t.chainId)}else r.chainId=s.chainId;const a=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||a)?Sn(!1,"eip-1559 transaction do not support gasPrice","tx",t):(r.type===0||r.type===1)&&a&&Sn(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",t),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1){const o=await n.getFeeData();Fr(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice)}else{const o=await n.getFeeData();if(r.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(r.authorizationList&&r.authorizationList.length?r.type=4:r.type=2,r.gasPrice!=null){const l=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=l,r.maxPriorityFeePerGas=l}else r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(Fr(!a,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice),r.type=0):Fr(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(r.type===2||r.type===3||r.type===4)&&(r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await yu(r)}async populateAuthorization(t){const n=Object.assign({},t);return n.chainId==null&&(n.chainId=(await sv(this,"getNetwork").getNetwork()).chainId),n.nonce==null&&(n.nonce=await this.getNonce()),n}async estimateGas(t){return sv(this,"estimateGas").estimateGas(await this.populateCall(t))}async call(t){return sv(this,"call").call(await this.populateCall(t))}async resolveName(t){return await sv(this,"resolveName").resolveName(t)}async sendTransaction(t){const n=sv(this,"sendTransaction"),r=await this.populateTransaction(t);delete r.from;const s=xae.from(r);return await n.broadcastTransaction(await this.signTransaction(s))}authorize(t){Fr(!1,"authorization not implemented for this signer","UNSUPPORTED_OPERATION",{operation:"authorize"})}}var hS,rO;const Gue=class Gue extends Aae{constructor(n,r){super(r);Ln(this,hS);Un(this,"address");Ps(this,{address:n})}async getAddress(){return this.address}connect(n){return new Gue(this.address,n)}async signTransaction(n){yr(this,hS,rO).call(this,"transactions","signTransaction")}async signMessage(n){yr(this,hS,rO).call(this,"messages","signMessage")}async signTypedData(n,r,s){yr(this,hS,rO).call(this,"typed-data","signTypedData")}};hS=new WeakSet,rO=function(n,r){Fr(!1,`VoidSigner cannot sign ${n}`,"UNSUPPORTED_OPERATION",{operation:r})};let GJ=Gue;function P5t(e){return JSON.parse(JSON.stringify(e))}var Wu,c0,Pw,ry,Fw,pS,Yy,KJ,YJ;class SIe{constructor(t){Ln(this,Yy);Ln(this,Wu);Ln(this,c0);Ln(this,Pw);Ln(this,ry);Ln(this,Fw);Ln(this,pS);Ht(this,Wu,t),Ht(this,c0,null),Ht(this,Pw,yr(this,Yy,KJ).bind(this)),Ht(this,ry,!1),Ht(this,Fw,null),Ht(this,pS,!1)}_subscribe(t){throw new Error("subclasses must override this")}_emitResults(t,n){throw new Error("subclasses must override this")}_recover(t){throw new Error("subclasses must override this")}start(){$e(this,ry)||(Ht(this,ry,!0),yr(this,Yy,KJ).call(this,-2))}stop(){$e(this,ry)&&(Ht(this,ry,!1),Ht(this,pS,!0),yr(this,Yy,YJ).call(this),$e(this,Wu).off("block",$e(this,Pw)))}pause(t){t&&yr(this,Yy,YJ).call(this),$e(this,Wu).off("block",$e(this,Pw))}resume(){this.start()}}Wu=new WeakMap,c0=new WeakMap,Pw=new WeakMap,ry=new WeakMap,Fw=new WeakMap,pS=new WeakMap,Yy=new WeakSet,KJ=async function(t){try{$e(this,c0)==null&&Ht(this,c0,this._subscribe($e(this,Wu)));let n=null;try{n=await $e(this,c0)}catch(a){if(!Kc(a,"UNSUPPORTED_OPERATION")||a.operation!=="eth_newFilter")throw a}if(n==null){Ht(this,c0,null),$e(this,Wu)._recoverSubscriber(this,this._recover($e(this,Wu)));return}const r=await $e(this,Wu).getNetwork();if($e(this,Fw)||Ht(this,Fw,r),$e(this,Fw).chainId!==r.chainId)throw new Error("chaid changed");if($e(this,pS))return;const s=await $e(this,Wu).send("eth_getFilterChanges",[n]);await this._emitResults($e(this,Wu),s)}catch(n){console.log("@TODO",n)}$e(this,Wu).once("block",$e(this,Pw))},YJ=function(){const t=$e(this,c0);t&&(Ht(this,c0,null),t.then(n=>{$e(this,Wu).destroyed||$e(this,Wu).send("eth_uninstallFilter",[n])}))};var Ow;class F5t extends SIe{constructor(n,r){super(n);Ln(this,Ow);Ht(this,Ow,P5t(r))}_recover(n){return new Nae(n,$e(this,Ow))}async _subscribe(n){return await n.send("eth_newFilter",[$e(this,Ow)])}async _emitResults(n,r){for(const s of r)n.emit($e(this,Ow),n._wrapLog(s,n._network))}}Ow=new WeakMap;class O5t extends SIe{async _subscribe(t){return await t.send("eth_newPendingTransactionFilter",[])}async _emitResults(t,n){for(const r of n)t.emit("pending",r)}}const M5t="bigint,boolean,function,number,string,symbol".split(/,/g);function sO(e){if(e==null||M5t.indexOf(typeof e)>=0||typeof e.getAddress=="function")return e;if(Array.isArray(e))return e.map(sO);if(typeof e=="object")return Object.keys(e).reduce((t,n)=>(t[n]=e[n],t),{});throw new Error(`should not happen: ${e} (${typeof e})`)}function R5t(e){return new Promise(t=>{setTimeout(t,e)})}function D6(e){return e&&e.toLowerCase()}function axe(e){return e&&typeof e.pollingInterval=="number"}const NIe={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class qH extends Aae{constructor(n,r){super(n);Un(this,"address");r=Ji(r),Ps(this,{address:r})}connect(n){Fr(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(n){return await this.populateCall(n)}async sendUncheckedTransaction(n){const r=sO(n),s=[];if(r.from){const o=r.from;s.push((async()=>{const l=await Nc(o,this.provider);Sn(l!=null&&l.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=l})())}else r.from=this.address;if(r.gasLimit==null&&s.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const o=r.to;s.push((async()=>{r.to=await Nc(o,this.provider)})())}s.length&&await Promise.all(s);const a=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[a])}async sendTransaction(n){const r=await this.provider.getBlockNumber(),s=await this.sendUncheckedTransaction(n);return await new Promise((a,o)=>{const l=[1e3,100];let c=0;const u=async()=>{try{const d=await this.provider.getTransaction(s);if(d!=null){a(d.replaceableTransaction(r));return}}catch(d){if(Kc(d,"CANCELLED")||Kc(d,"BAD_DATA")||Kc(d,"NETWORK_ERROR")||Kc(d,"UNSUPPORTED_OPERATION")){d.info==null&&(d.info={}),d.info.sendTransactionHash=s,o(d);return}if(Kc(d,"INVALID_ARGUMENT")&&(c++,d.info==null&&(d.info={}),d.info.sendTransactionHash=s,c>10)){o(d);return}this.provider.emit("error",So("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:d}))}this.provider._setTimeout(()=>{u()},l.pop()||4e3)};u()})}async signTransaction(n){const r=sO(n);if(r.from){const a=await Nc(r.from,this.provider);Sn(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=a}else r.from=this.address;const s=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[s])}async signMessage(n){const r=typeof n=="string"?sd(n):n;return await this.provider.send("personal_sign",[Hr(r),this.address.toLowerCase()])}async signTypedData(n,r,s){const a=sO(s),o=await US.resolveNames(n,r,a,async l=>{const c=await Nc(l);return Sn(c!=null,"TypedData does not support null address","value",l),c});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(US.getPayload(o.domain,r,o.value))])}async unlock(n){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),n,null])}async _legacySignMessage(n){const r=typeof n=="string"?sd(n):n;return await this.provider.send("eth_sign",[this.address.toLowerCase(),Hr(r)])}}var Mw,mS,Cg,u0,$p,Fh,Fd,lk,XJ;class L5t extends j5t{constructor(n,r){super(n,r);Ln(this,lk);Ln(this,Mw);Ln(this,mS);Ln(this,Cg);Ln(this,u0);Ln(this,$p);Ln(this,Fh);Ln(this,Fd);Ht(this,mS,1),Ht(this,Mw,Object.assign({},NIe,r||{})),Ht(this,Cg,[]),Ht(this,u0,null),Ht(this,Fh,null),Ht(this,Fd,null);{let a=null;const o=new Promise(l=>{a=l});Ht(this,$p,{promise:o,resolve:a})}const s=this._getOption("staticNetwork");typeof s=="boolean"?(Sn(!s||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),s&&n!=null&&Ht(this,Fh,cy.from(n))):s&&(Sn(n==null||s.matches(n),"staticNetwork MUST match network object","options",r),Ht(this,Fh,s))}_getOption(n){return $e(this,Mw)[n]}get _network(){return Fr($e(this,Fh),"network is not available yet","NETWORK_ERROR"),$e(this,Fh)}async _perform(n){if(n.method==="call"||n.method==="estimateGas"){let s=n.transaction;if(s&&s.type!=null&&gs(s.type)&&s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null){const a=await this.getFeeData();a.maxFeePerGas==null&&a.maxPriorityFeePerGas==null&&(n=Object.assign({},n,{transaction:Object.assign({},s,{type:void 0})}))}}const r=this.getRpcRequest(n);return r!=null?await this.send(r.method,r.args):super._perform(n)}async _detectNetwork(){const n=this._getOption("staticNetwork");if(n)if(n===!0){if($e(this,Fh))return $e(this,Fh)}else return n;return $e(this,Fd)?await $e(this,Fd):this.ready?(Ht(this,Fd,(async()=>{try{const r=cy.from(gs(await this.send("eth_chainId",[])));return Ht(this,Fd,null),r}catch(r){throw Ht(this,Fd,null),r}})()),await $e(this,Fd)):(Ht(this,Fd,(async()=>{const r={id:eb(this,mS)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let s;try{s=(await this._send(r))[0],Ht(this,Fd,null)}catch(a){throw Ht(this,Fd,null),this.emit("debug",{action:"receiveRpcError",error:a}),a}if(this.emit("debug",{action:"receiveRpcResult",result:s}),"result"in s)return cy.from(gs(s.result));throw this.getRpcError(r,s)})()),await $e(this,Fd))}_start(){$e(this,$p)==null||$e(this,$p).resolve==null||($e(this,$p).resolve(),Ht(this,$p,null),(async()=>{for(;$e(this,Fh)==null&&!this.destroyed;)try{Ht(this,Fh,await this._detectNetwork())}catch(n){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",So("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await R5t(1e3)}yr(this,lk,XJ).call(this)})())}async _waitUntilReady(){if($e(this,$p)!=null)return await $e(this,$p).promise}_getSubscriber(n){return n.type==="pending"?new O5t(this):n.type==="event"?this._getOption("polling")?new Nae(this,n.filter):new F5t(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new CIe("orphan"):super._getSubscriber(n)}get ready(){return $e(this,$p)==null}getRpcTransaction(n){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(s=>{if(n[s]==null)return;let a=s;s==="gasLimit"&&(a="gas"),r[a]=qp(gs(n[s],`tx.${s}`))}),["from","to","data"].forEach(s=>{n[s]!=null&&(r[s]=Hr(n[s]))}),n.accessList&&(r.accessList=o5(n.accessList)),n.blobVersionedHashes&&(r.blobVersionedHashes=n.blobVersionedHashes.map(s=>s.toLowerCase())),n.authorizationList&&(r.authorizationList=n.authorizationList.map(s=>{const a=jTe(s);return{address:a.address,nonce:qp(a.nonce),chainId:qp(a.chainId),yParity:qp(a.signature.yParity),r:qp(a.signature.r),s:qp(a.signature.s)}})),r}getRpcRequest(n){switch(n.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[D6(n.address),n.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[D6(n.address),n.blockTag]};case"getCode":return{method:"eth_getCode",args:[D6(n.address),n.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[D6(n.address),"0x"+n.position.toString(16),n.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[n.signedTransaction]};case"getBlock":if("blockTag"in n)return{method:"eth_getBlockByNumber",args:[n.blockTag,!!n.includeTransactions]};if("blockHash"in n)return{method:"eth_getBlockByHash",args:[n.blockHash,!!n.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[n.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[n.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(n.transaction),n.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(n.transaction)]};case"getLogs":return n.filter&&n.filter.address!=null&&(Array.isArray(n.filter.address)?n.filter.address=n.filter.address.map(D6):n.filter.address=D6(n.filter.address)),{method:"eth_getLogs",args:[n.filter]}}return null}getRpcError(n,r){const{method:s}=n,{error:a}=r;if(s==="eth_estimateGas"&&a.message){const c=a.message;if(!c.match(/revert/i)&&c.match(/insufficient funds/i))return So("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:a}});if(c.match(/nonce/i)&&c.match(/too low/i))return So("nonce has already been used","NONCE_EXPIRED",{transaction:n.params[0],info:{payload:n,error:a}})}if(s==="eth_call"||s==="eth_estimateGas"){const c=QJ(a),u=pE.getBuiltinCallException(s==="eth_call"?"call":"estimateGas",n.params[0],c?c.data:null);return u.info={error:a,payload:n},u}const o=JSON.stringify(B5t(a));if(typeof a.message=="string"&&a.message.match(/user denied|ethers-user-denied/i))return So("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[s]||"unknown",reason:"rejected",info:{payload:n,error:a}});if(s==="eth_sendRawTransaction"||s==="eth_sendTransaction"){const c=n.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return So("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:c,info:{error:a}});if(o.match(/nonce/i)&&o.match(/too low/i))return So("nonce has already been used","NONCE_EXPIRED",{transaction:c,info:{error:a}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return So("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:c,info:{error:a}});if(o.match(/only replay-protected/i))return So("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:s,info:{transaction:c,info:{error:a}}})}let l=!!o.match(/the method .* does not exist/i);return l||a&&a.details&&a.details.startsWith("Unauthorized method:")&&(l=!0),l?So("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:a,payload:n}}):So("could not coalesce error","UNKNOWN_ERROR",{error:a,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(So("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const s=eb(this,mS)._++,a=new Promise((o,l)=>{$e(this,Cg).push({resolve:o,reject:l,payload:{method:n,params:r,id:s,jsonrpc:"2.0"}})});return yr(this,lk,XJ).call(this),a}async getSigner(n){n==null&&(n=0);const r=this.send("eth_accounts",[]);if(typeof n=="number"){const a=await r;if(n>=a.length)throw new Error("no such account");return new qH(this,a[n])}const{accounts:s}=await yu({network:this.getNetwork(),accounts:r});n=Ji(n);for(const a of s)if(Ji(a)===n)return new qH(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new qH(this,r))}destroy(){$e(this,u0)&&(clearTimeout($e(this,u0)),Ht(this,u0,null));for(const{payload:n,reject:r}of $e(this,Cg))r(So("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));Ht(this,Cg,[]),super.destroy()}}Mw=new WeakMap,mS=new WeakMap,Cg=new WeakMap,u0=new WeakMap,$p=new WeakMap,Fh=new WeakMap,Fd=new WeakMap,lk=new WeakSet,XJ=function(){if($e(this,u0))return;const n=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");Ht(this,u0,setTimeout(()=>{Ht(this,u0,null);const r=$e(this,Cg);for(Ht(this,Cg,[]);r.length;){const s=[r.shift()];for(;r.length&&s.length!==$e(this,Mw).batchMaxCount;)if(s.push(r.shift()),JSON.stringify(s.map(o=>o.payload)).length>$e(this,Mw).batchMaxSize){r.unshift(s.pop());break}(async()=>{const a=s.length===1?s[0].payload:s.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:a});try{const o=await this._send(a);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:l,reject:c,payload:u}of s){if(this.destroyed){c(So("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:u.method}));continue}const d=o.filter(f=>f.id===u.id)[0];if(d==null){const f=So("missing response for request","BAD_DATA",{value:o,info:{payload:u}});this.emit("error",f),c(f);continue}if("error"in d){c(this.getRpcError(u,d));continue}l(d.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:l}of s)l(o)}})()}},n))};var sy;class D5t extends L5t{constructor(n,r){super(n,r);Ln(this,sy);let s=this._getOption("pollingInterval");s==null&&(s=NIe.pollingInterval),Ht(this,sy,s)}_getSubscriber(n){const r=super._getSubscriber(n);return axe(r)&&(r.pollingInterval=$e(this,sy)),r}get pollingInterval(){return $e(this,sy)}set pollingInterval(n){if(!Number.isInteger(n)||n<0)throw new Error("invalid interval");Ht(this,sy,n),this._forEachSubscriber(r=>{axe(r)&&(r.pollingInterval=$e(this,sy))})}}sy=new WeakMap;function QJ(e){if(e==null)return null;if(typeof e.message=="string"&&e.message.match(/revert/i)&&ao(e.data))return{message:e.message,data:e.data};if(typeof e=="object"){for(const t in e){const n=QJ(e[t]);if(n)return n}return null}if(typeof e=="string")try{return QJ(JSON.parse(e))}catch{}return null}function ZJ(e,t){if(e!=null){if(typeof e.message=="string"&&t.push(e.message),typeof e=="object")for(const n in e)ZJ(e[n],t);if(typeof e=="string")try{return ZJ(JSON.parse(e),t)}catch{}}}function B5t(e){const t=[];return ZJ(e,t),t}var xS,gS;const Lv=class Lv extends D5t{constructor(n,r,s){const a=Object.assign({},s??{},{batchMaxCount:1});Sn(n&&n.request,"invalid EIP-1193 provider","ethereum",n);super(r,a);Ln(this,xS);Ln(this,gS);Ht(this,gS,null),s&&s.providerInfo&&Ht(this,gS,s.providerInfo),Ht(this,xS,async(o,l)=>{const c={method:o,params:l};this.emit("debug",{action:"sendEip1193Request",payload:c});try{const u=await n.request(c);return this.emit("debug",{action:"receiveEip1193Result",result:u}),u}catch(u){const d=new Error(u.message);throw d.code=u.code,d.data=u.data,d.payload=c,this.emit("debug",{action:"receiveEip1193Error",error:d}),d}})}get providerInfo(){return $e(this,gS)}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){Sn(!Array.isArray(n),"EIP-1193 does not support batch request","payload",n);try{const r=await $e(this,xS).call(this,n.method,n.params||[]);return[{id:n.id,result:r}]}catch(r){return[{id:n.id,error:{code:r.code,data:r.data,message:r.message}}]}}getRpcError(n,r){switch(r=JSON.parse(JSON.stringify(r)),r.error.code||-1){case 4001:r.error.message=`ethers-user-denied: ${r.error.message}`;break;case 4200:r.error.message=`ethers-unsupported: ${r.error.message}`;break}return super.getRpcError(n,r)}async hasSigner(n){n==null&&(n=0);const r=await this.send("eth_accounts",[]);return typeof n=="number"?r.length>n:(n=n.toLowerCase(),r.filter(s=>s.toLowerCase()===n).length!==0)}async getSigner(n){if(n==null&&(n=0),!await this.hasSigner(n))try{await $e(this,xS).call(this,"eth_requestAccounts",[])}catch(r){const s=r.payload;throw this.getRpcError(s,{id:s.id,error:r})}return await super.getSigner(n)}static async discover(n){if(n==null&&(n={}),n.provider)return new Lv(n.provider);const r=n.window?n.window:typeof window<"u"?window:null;if(r==null)return null;const s=n.anyProvider;if(s&&r.ethereum)return new Lv(r.ethereum);if(!("addEventListener"in r&&"dispatchEvent"in r&&"removeEventListener"in r))return null;const a=n.timeout?n.timeout:300;return a===0?null:await new Promise((o,l)=>{let c=[];const u=x=>{c.push(x.detail),s&&d()},d=()=>{if(clearTimeout(f),c.length)if(n&&n.filter){const x=n.filter(c.map(g=>Object.assign({},g.info)));if(x==null)o(null);else if(x instanceof Lv)o(x);else{let g=null;if(x.uuid&&(g=c.filter(w=>x.uuid===w.info.uuid)[0]),g){const{provider:v,info:w}=g;o(new Lv(v,void 0,{providerInfo:w}))}else l(So("filter returned unknown info","UNSUPPORTED_OPERATION",{value:x}))}}else{const{provider:x,info:g}=c[0];o(new Lv(x,void 0,{providerInfo:g}))}else o(null);r.removeEventListener("eip6963:announceProvider",u)},f=setTimeout(()=>{d()},a);r.addEventListener("eip6963:announceProvider",u),r.dispatchEvent(new Event("eip6963:requestProvider"))})}};xS=new WeakMap,gS=new WeakMap;let AM=Lv;var bS;const Kue=class Kue extends Aae{constructor(n,r){super(r);Un(this,"address");Ln(this,bS);Sn(n&&typeof n.sign=="function","invalid private key","privateKey","[ REDACTED ]"),Ht(this,bS,n);const s=$k(this.signingKey.publicKey);Ps(this,{address:s})}get signingKey(){return $e(this,bS)}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(n){return new Kue($e(this,bS),n)}async signTransaction(n){n=mE(n);const{to:r,from:s}=await yu({to:n.to?Nc(n.to,this):void 0,from:n.from?Nc(n.from,this):void 0});r!=null&&(n.to=r),s!=null&&(n.from=s),n.from!=null&&(Sn(Ji(n.from)===this.address,"transaction from address mismatch","tx.from",n.from),delete n.from);const a=xae.from(n);return a.signature=this.signingKey.sign(a.unsignedHash),a.serialized}async signMessage(n){return this.signMessageSync(n)}signMessageSync(n){return this.signingKey.sign(v3t(n)).serialized}authorizeSync(n){Sn(typeof n.address=="string","invalid address for authorizeSync","auth.address",n);const r=this.signingKey.sign(Mwt(n));return Object.assign({},{address:Ji(n.address),nonce:gs(n.nonce||0),chainId:gs(n.chainId||0)},{signature:r})}async authorize(n){return n=Object.assign({},n,{address:await Nc(n.address,this)}),this.authorizeSync(await this.populateAuthorization(n))}async signTypedData(n,r,s){const a=await US.resolveNames(n,r,s,async o=>{Fr(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:o}});const l=await this.provider.resolveName(o);return Fr(l!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:o}),l});return this.signingKey.sign(US.hash(a.domain,r,a.value)).serialized}};bS=new WeakMap;let jM=Kue;const EM=" !#$%&'()*+,-./<=>?@[]^_`{|}~",$5t=/^[a-z]*$/i;function oxe(e,t){let n=97;return e.reduce((r,s)=>(s===t?n++:s.match($5t)?r.push(String.fromCharCode(n)+s):(n=97,r.push(s)),r),[])}function U5t(e,t){for(let s=EM.length-1;s>=0;s--)e=e.split(EM[s]).join(t.substring(2*s,2*s+2));const n=[],r=e.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(s,a,o,l)=>{if(o)for(let c=parseInt(o);c>=0;c--)n.push(";");else n.push(a.toLowerCase());return""});if(r)throw new Error(`leftovers: ${JSON.stringify(r)}`);return oxe(oxe(n,";"),":")}function z5t(e){return Sn(e[0]==="0","unsupported auwl data","data",e),U5t(e.substring(1+2*EM.length),e.substring(1,1+2*EM.length))}class H5t{constructor(t){Un(this,"locale");Ps(this,{locale:t})}split(t){return t.toLowerCase().split(/\s+/g)}join(t){return t.join(" ")}}var yS,ck,Rw,uk,JJ;class V5t extends H5t{constructor(n,r,s){super(n);Ln(this,uk);Ln(this,yS);Ln(this,ck);Ln(this,Rw);Ht(this,yS,r),Ht(this,ck,s),Ht(this,Rw,null)}get _data(){return $e(this,yS)}_decodeWords(){return z5t($e(this,yS))}getWord(n){const r=yr(this,uk,JJ).call(this);return Sn(n>=0&&n<r.length,`invalid word index: ${n}`,"index",n),r[n]}getWordIndex(n){return yr(this,uk,JJ).call(this).indexOf(n)}}yS=new WeakMap,ck=new WeakMap,Rw=new WeakMap,uk=new WeakSet,JJ=function(){if($e(this,Rw)==null){const n=this._decodeWords();if(r1(n.join(`
`)+`
`)!==$e(this,ck))throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);Ht(this,Rw,n)}return $e(this,Rw)};const W5t="0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO",q5t="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60";let GH=null;class E3 extends V5t{constructor(){super("en",W5t,q5t)}static wordlist(){return GH==null&&(GH=new E3),GH}}function AIe(e){return(1<<e)-1<<8-e&255}function G5t(e){return(1<<e)-1&255}function KH(e,t){uke("NFKD"),t==null&&(t=E3.wordlist());const n=t.split(e);Sn(n.length%3===0&&n.length>=12&&n.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const r=new Uint8Array(Math.ceil(11*n.length/8));let s=0;for(let u=0;u<n.length;u++){let d=t.getWordIndex(n[u].normalize("NFKD"));Sn(d>=0,`invalid mnemonic word at index ${u}`,"mnemonic","[ REDACTED ]");for(let f=0;f<11;f++)d&1<<10-f&&(r[s>>3]|=1<<7-s%8),s++}const a=32*n.length/3,o=n.length/3,l=AIe(o),c=cs(ep(r.slice(0,a/8)))[0]&l;return Sn(c===(r[r.length-1]&l),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),Hr(r.slice(0,a/8))}function YH(e,t){Sn(e.length%4===0&&e.length>=16&&e.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),t==null&&(t=E3.wordlist());const n=[0];let r=11;for(let o=0;o<e.length;o++)r>8?(n[n.length-1]<<=8,n[n.length-1]|=e[o],r-=8):(n[n.length-1]<<=r,n[n.length-1]|=e[o]>>8-r,n.push(e[o]&G5t(8-r)),r+=3);const s=e.length/4,a=parseInt(ep(e).substring(2,4),16)&AIe(s);return n[n.length-1]<<=s,n[n.length-1]|=a>>8-s,t.join(n.map(o=>t.getWord(o)))}const XH={};class HS{constructor(t,n,r,s,a){Un(this,"phrase");Un(this,"password");Un(this,"wordlist");Un(this,"entropy");s==null&&(s=""),a==null&&(a=E3.wordlist()),a5(t,XH,"Mnemonic"),Ps(this,{phrase:r,password:s,wordlist:a,entropy:n})}computeSeed(){const t=sd("mnemonic"+this.password,"NFKD");return n2(sd(this.phrase,"NFKD"),t,2048,64,"sha512")}static fromPhrase(t,n,r){const s=KH(t,r);return t=YH(cs(s),r),new HS(XH,s,t,n,r)}static fromEntropy(t,n,r){const s=cs(t,"entropy"),a=YH(s,r);return new HS(XH,Hr(s),a,n,r)}static entropyToPhrase(t,n){const r=cs(t,"entropy");return YH(r,n)}static phraseToEntropy(t,n){return KH(t,n)}static isValidMnemonic(t,n){try{return KH(t,n),!0}catch{}return!1}}/*! MIT License. Copyright 2015-2022 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */var $c=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},QH=function(e,t,n,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(e,n):s?s.value=n:t.set(e,n),n},iO,vh,Ym;const K5t={16:10,24:12,32:14},Y5t=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],uh=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],rP=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],X5t=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],Q5t=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],Z5t=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],J5t=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],e6t=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],t6t=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],n6t=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],r6t=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],s6t=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],i6t=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],a6t=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],o6t=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function ZH(e){const t=[];for(let n=0;n<e.length;n+=4)t.push(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]);return t}class jae{get key(){return $c(this,iO,"f").slice()}constructor(t){if(iO.set(this,void 0),vh.set(this,void 0),Ym.set(this,void 0),!(this instanceof jae))throw Error("AES must be instanitated with `new`");QH(this,iO,new Uint8Array(t),"f");const n=K5t[this.key.length];if(n==null)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");QH(this,Ym,[],"f"),QH(this,vh,[],"f");for(let d=0;d<=n;d++)$c(this,Ym,"f").push([0,0,0,0]),$c(this,vh,"f").push([0,0,0,0]);const r=(n+1)*4,s=this.key.length/4,a=ZH(this.key);let o;for(let d=0;d<s;d++)o=d>>2,$c(this,Ym,"f")[o][d%4]=a[d],$c(this,vh,"f")[n-o][d%4]=a[d];let l=0,c=s,u;for(;c<r;){if(u=a[s-1],a[0]^=uh[u>>16&255]<<24^uh[u>>8&255]<<16^uh[u&255]<<8^uh[u>>24&255]^Y5t[l]<<24,l+=1,s!=8)for(let g=1;g<s;g++)a[g]^=a[g-1];else{for(let g=1;g<s/2;g++)a[g]^=a[g-1];u=a[s/2-1],a[s/2]^=uh[u&255]^uh[u>>8&255]<<8^uh[u>>16&255]<<16^uh[u>>24&255]<<24;for(let g=s/2+1;g<s;g++)a[g]^=a[g-1]}let d=0,f,x;for(;d<s&&c<r;)f=c>>2,x=c%4,$c(this,Ym,"f")[f][x]=a[d],$c(this,vh,"f")[n-f][x]=a[d++],c++}for(let d=1;d<n;d++)for(let f=0;f<4;f++)u=$c(this,vh,"f")[d][f],$c(this,vh,"f")[d][f]=s6t[u>>24&255]^i6t[u>>16&255]^a6t[u>>8&255]^o6t[u&255]}encrypt(t){if(t.length!=16)throw new TypeError("invalid plaintext size (must be 16 bytes)");const n=$c(this,Ym,"f").length-1,r=[0,0,0,0];let s=ZH(t);for(let l=0;l<4;l++)s[l]^=$c(this,Ym,"f")[0][l];for(let l=1;l<n;l++){for(let c=0;c<4;c++)r[c]=X5t[s[c]>>24&255]^Q5t[s[(c+1)%4]>>16&255]^Z5t[s[(c+2)%4]>>8&255]^J5t[s[(c+3)%4]&255]^$c(this,Ym,"f")[l][c];s=r.slice()}const a=new Uint8Array(16);let o=0;for(let l=0;l<4;l++)o=$c(this,Ym,"f")[n][l],a[4*l]=(uh[s[l]>>24&255]^o>>24)&255,a[4*l+1]=(uh[s[(l+1)%4]>>16&255]^o>>16)&255,a[4*l+2]=(uh[s[(l+2)%4]>>8&255]^o>>8)&255,a[4*l+3]=(uh[s[(l+3)%4]&255]^o)&255;return a}decrypt(t){if(t.length!=16)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const n=$c(this,vh,"f").length-1,r=[0,0,0,0];let s=ZH(t);for(let l=0;l<4;l++)s[l]^=$c(this,vh,"f")[0][l];for(let l=1;l<n;l++){for(let c=0;c<4;c++)r[c]=e6t[s[c]>>24&255]^t6t[s[(c+3)%4]>>16&255]^n6t[s[(c+2)%4]>>8&255]^r6t[s[(c+1)%4]&255]^$c(this,vh,"f")[l][c];s=r.slice()}const a=new Uint8Array(16);let o=0;for(let l=0;l<4;l++)o=$c(this,vh,"f")[n][l],a[4*l]=(rP[s[l]>>24&255]^o>>24)&255,a[4*l+1]=(rP[s[(l+3)%4]>>16&255]^o>>16)&255,a[4*l+2]=(rP[s[(l+2)%4]>>8&255]^o>>8)&255,a[4*l+3]=(rP[s[(l+1)%4]&255]^o)&255;return a}}iO=new WeakMap,vh=new WeakMap,Ym=new WeakMap;class jIe{constructor(t,n,r){if(r&&!(this instanceof r))throw new Error(`${t} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new jae(n)},name:{enumerable:!0,value:t}})}}var sP=function(e,t,n,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(e,n):s?s.value=n:t.set(e,n),n},B6=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},bj,Jx;class Eae extends jIe{constructor(t,n){if(super("ECC",t,Eae),bj.set(this,void 0),Jx.set(this,void 0),n){if(n.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");sP(this,bj,new Uint8Array(n),"f")}else sP(this,bj,new Uint8Array(16),"f");sP(this,Jx,this.iv,"f")}get iv(){return new Uint8Array(B6(this,bj,"f"))}encrypt(t){if(t.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const n=new Uint8Array(t.length);for(let r=0;r<t.length;r+=16){for(let s=0;s<16;s++)B6(this,Jx,"f")[s]^=t[r+s];sP(this,Jx,this.aes.encrypt(B6(this,Jx,"f")),"f"),n.set(B6(this,Jx,"f"),r)}return n}decrypt(t){if(t.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");const n=new Uint8Array(t.length);for(let r=0;r<t.length;r+=16){const s=this.aes.decrypt(t.subarray(r,r+16));for(let a=0;a<16;a++)n[r+a]=s[a]^B6(this,Jx,"f")[a],B6(this,Jx,"f")[a]=t[r+a]}return n}}bj=new WeakMap,Jx=new WeakMap;var $6=function(e,t,n,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(e,n):s?s.value=n:t.set(e,n),n},dh=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},yj,Cv,wh;class VS extends jIe{constructor(t,n){super("CTR",t,VS),yj.set(this,void 0),Cv.set(this,void 0),wh.set(this,void 0),$6(this,wh,new Uint8Array(16),"f"),dh(this,wh,"f").fill(0),$6(this,yj,dh(this,wh,"f"),"f"),$6(this,Cv,16,"f"),n==null&&(n=1),typeof n=="number"?this.setCounterValue(n):this.setCounterBytes(n)}get counter(){return new Uint8Array(dh(this,wh,"f"))}setCounterValue(t){if(!Number.isInteger(t)||t<0||t>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let n=15;n>=0;--n)dh(this,wh,"f")[n]=t%256,t=Math.floor(t/256)}setCounterBytes(t){if(t.length!==16)throw new TypeError("invalid counter initial Uint8Array value length");dh(this,wh,"f").set(t)}increment(){for(let t=15;t>=0;t--)if(dh(this,wh,"f")[t]===255)dh(this,wh,"f")[t]=0;else{dh(this,wh,"f")[t]++;break}}encrypt(t){var n,r;const s=new Uint8Array(t);for(let a=0;a<s.length;a++)dh(this,Cv,"f")===16&&($6(this,yj,this.aes.encrypt(dh(this,wh,"f")),"f"),$6(this,Cv,0,"f"),this.increment()),s[a]^=dh(this,yj,"f")[$6(this,Cv,(r=dh(this,Cv,"f"),n=r++,r),"f"),n];return s}decrypt(t){return this.encrypt(t)}}yj=new WeakMap,Cv=new WeakMap,wh=new WeakMap;function l6t(e){if(e.length<16)throw new TypeError("PKCS#7 invalid length");const t=e[e.length-1];if(t>16)throw new TypeError("PKCS#7 padding byte out of range");const n=e.length-t;for(let r=0;r<t;r++)if(e[n+r]!==t)throw new TypeError("PKCS#7 invalid padding byte");return new Uint8Array(e.subarray(0,n))}function EIe(e){return typeof e=="string"&&!e.startsWith("0x")&&(e="0x"+e),Yc(e)}function S7(e,t){for(e=String(e);e.length<t;)e="0"+e;return e}function Vk(e){return typeof e=="string"?sd(e,"NFKC"):Yc(e)}function hl(e,t){const n=t.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);Sn(n!=null,"invalid path","path",t);const r=n[1],s=n[3],a=n[4]==="!";let o=e;for(const l of r.toLowerCase().split(".")){if(Array.isArray(o)){if(!l.match(/^[0-9]+$/))break;o=o[parseInt(l)]}else if(typeof o=="object"){let c=null;for(const u in o)if(u.toLowerCase()===l){c=o[u];break}o=c}else o=null;if(o==null)break}if(Sn(!a||o!=null,"missing required value","path",r),s&&o!=null){if(s==="int"){if(typeof o=="string"&&o.match(/^-?[0-9]+$/))return parseInt(o);if(Number.isSafeInteger(o))return o}if(s==="number"&&typeof o=="string"&&o.match(/^-?[0-9.]*$/))return parseFloat(o);if(s==="data"&&typeof o=="string")return EIe(o);if(s==="array"&&Array.isArray(o)||s===typeof o)return o;Sn(!1,`wrong type found for ${s} `,"path",r)}return o}const _Ie="m/44'/60'/0'/0/0";function lxe(e){try{const t=JSON.parse(e);if((t.version!=null?parseInt(t.version):0)===3)return!0}catch{}return!1}function c6t(e,t,n){if(hl(e,"crypto.cipher:string")==="aes-128-ctr"){const s=hl(e,"crypto.cipherparams.iv:data!"),a=new VS(t,s);return Hr(a.decrypt(n))}Fr(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}function _M(e,t){const n=cs(t),r=hl(e,"crypto.ciphertext:data!"),s=Hr(io(Pa([n.slice(16,32),r]))).substring(2);Sn(s===hl(e,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");const a=c6t(e,n.slice(0,16),r),o=$k(a);if(e.address){let u=e.address.toLowerCase();u.startsWith("0x")||(u="0x"+u),Sn(Ji(u)===o,"keystore address/privateKey mismatch","address",e.address)}const l={address:o,privateKey:a};if(hl(e,"x-ethers.version:string")==="0.1"){const u=n.slice(32,64),d=hl(e,"x-ethers.mnemonicCiphertext:data!"),f=hl(e,"x-ethers.mnemonicCounter:data!"),x=new VS(u,f);l.mnemonic={path:hl(e,"x-ethers.path:string")||_Ie,locale:hl(e,"x-ethers.locale:string")||"en",entropy:Hr(cs(x.decrypt(d)))}}return l}function kIe(e){const t=hl(e,"crypto.kdf:string");if(t&&typeof t=="string"){if(t.toLowerCase()==="scrypt"){const n=hl(e,"crypto.kdfparams.salt:data!"),r=hl(e,"crypto.kdfparams.n:int!"),s=hl(e,"crypto.kdfparams.r:int!"),a=hl(e,"crypto.kdfparams.p:int!");Sn(r>0&&(r&r-1)===0,"invalid kdf.N","kdf.N",r),Sn(s>0&&a>0,"invalid kdf","kdf",t);const o=hl(e,"crypto.kdfparams.dklen:int!");return Sn(o===32,"invalid kdf.dklen","kdf.dflen",o),{name:"scrypt",salt:n,N:r,r:s,p:a,dkLen:64}}else if(t.toLowerCase()==="pbkdf2"){const n=hl(e,"crypto.kdfparams.salt:data!"),r=hl(e,"crypto.kdfparams.prf:string!"),s=r.split("-").pop();Sn(s==="sha256"||s==="sha512","invalid kdf.pdf","kdf.pdf",r);const a=hl(e,"crypto.kdfparams.c:int!"),o=hl(e,"crypto.kdfparams.dklen:int!");return Sn(o===32,"invalid kdf.dklen","kdf.dklen",o),{name:"pbkdf2",salt:n,count:a,dkLen:o,algorithm:s}}}Sn(!1,"unsupported key-derivation function","kdf",t)}function u6t(e,t){const n=JSON.parse(e),r=Vk(t),s=kIe(n);if(s.name==="pbkdf2"){const{salt:f,count:x,dkLen:g,algorithm:v}=s,w=n2(r,f,x,g,v);return _M(n,w)}Fr(s.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:s});const{salt:a,N:o,r:l,p:c,dkLen:u}=s,d=IA(r,a,o,l,c,u);return _M(n,d)}function cxe(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}async function d6t(e,t,n){const r=JSON.parse(e),s=Vk(t),a=kIe(r);if(a.name==="pbkdf2"){n&&(n(0),await cxe(0));const{salt:x,count:g,dkLen:v,algorithm:w}=a,C=n2(s,x,g,v,w);return n&&(n(1),await cxe(0)),_M(r,C)}Fr(a.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:a});const{salt:o,N:l,r:c,p:u,dkLen:d}=a,f=await TA(s,o,l,c,u,d,n);return _M(r,f)}function TIe(e){const t=e.salt!=null?cs(e.salt,"options.salt"):Bg(32);let n=1<<17,r=8,s=1;return e.scrypt&&(e.scrypt.N&&(n=e.scrypt.N),e.scrypt.r&&(r=e.scrypt.r),e.scrypt.p&&(s=e.scrypt.p)),Sn(typeof n=="number"&&n>0&&Number.isSafeInteger(n)&&(BigInt(n)&BigInt(n-1))===BigInt(0),"invalid scrypt N parameter","options.N",n),Sn(typeof r=="number"&&r>0&&Number.isSafeInteger(r),"invalid scrypt r parameter","options.r",r),Sn(typeof s=="number"&&s>0&&Number.isSafeInteger(s),"invalid scrypt p parameter","options.p",s),{name:"scrypt",dkLen:32,salt:t,N:n,r,p:s}}function IIe(e,t,n,r){const s=cs(n.privateKey,"privateKey"),a=r.iv!=null?cs(r.iv,"options.iv"):Bg(16);Sn(a.length===16,"invalid options.iv length","options.iv",r.iv);const o=r.uuid!=null?cs(r.uuid,"options.uuid"):Bg(16);Sn(o.length===16,"invalid options.uuid length","options.uuid",r.iv);const l=e.slice(0,16),c=e.slice(16,32),u=new VS(l,a),d=cs(u.encrypt(s)),f=io(Pa([c,d])),x={address:n.address.substring(2).toLowerCase(),id:d2t(o),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Hr(a).substring(2)},ciphertext:Hr(d).substring(2),kdf:"scrypt",kdfparams:{salt:Hr(t.salt).substring(2),n:t.N,dklen:32,p:t.p,r:t.r},mac:f.substring(2)}};if(n.mnemonic){const g=r.client!=null?r.client:`ethers/${lke}`,v=n.mnemonic.path||_Ie,w=n.mnemonic.locale||"en",C=e.slice(32,64),N=cs(n.mnemonic.entropy,"account.mnemonic.entropy"),I=Bg(16),P=new VS(C,I),R=cs(P.encrypt(N)),F=new Date,L="UTC--"+(F.getUTCFullYear()+"-"+S7(F.getUTCMonth()+1,2)+"-"+S7(F.getUTCDate(),2)+"T"+S7(F.getUTCHours(),2)+"-"+S7(F.getUTCMinutes(),2)+"-"+S7(F.getUTCSeconds(),2)+".0Z")+"--"+x.address;x["x-ethers"]={client:g,gethFilename:L,path:v,locale:w,mnemonicCounter:Hr(I).substring(2),mnemonicCiphertext:Hr(R).substring(2),version:"0.1"}}return JSON.stringify(x)}function PIe(e,t,n){n==null&&(n={});const r=Vk(t),s=TIe(n),a=IA(r,s.salt,s.N,s.r,s.p,64);return IIe(cs(a),s,e,n)}async function FIe(e,t,n){n==null&&(n={});const r=Vk(t),s=TIe(n),a=await TA(r,s.salt,s.N,s.r,s.p,64,n.progressCallback);return IIe(cs(a),s,e,n)}const JH="m/44'/60'/0'/0/0",f6t=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),s4=2147483648,h6t=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),p6t="0123456789abcdef";function kM(e,t){let n="";for(;e;)n=p6t[e%16]+n,e=Math.trunc(e/16);for(;n.length<t*2;)n="0"+n;return"0x"+n}function eee(e){const t=cs(e),n=po(ep(ep(t)),0,4),r=Pa([t,n]);return pke(r)}const Xm={};function OIe(e,t,n,r){const s=new Uint8Array(37);e&s4?(Fr(r!=null,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),s.set(cs(r),1)):s.set(cs(n));for(let o=24;o>=0;o-=8)s[33+(o>>3)]=e>>24-o&255;const a=cs(_A("sha512",t,s));return{IL:a.slice(0,32),IR:a.slice(32)}}function MIe(e,t){const n=t.split("/");Sn(n.length>0,"invalid path","path",t),n[0]==="m"&&(Sn(e.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${e.depth}`,"path",t),n.shift());let r=e;for(let s=0;s<n.length;s++){const a=n[s];if(a.match(/^[0-9]+'$/)){const o=parseInt(a.substring(0,a.length-1));Sn(o<s4,"invalid path index",`path[${s}]`,a),r=r.deriveChild(s4+o)}else if(a.match(/^[0-9]+$/)){const o=parseInt(a);Sn(o<s4,"invalid path index",`path[${s}]`,a),r=r.deriveChild(o)}else Sn(!1,"invalid path component",`path[${s}]`,a)}return r}var dk,tee,Lw,vj;const Tp=class Tp extends jM{constructor(n,r,s,a,o,l,c,u,d){super(r,d);Ln(this,dk);Un(this,"publicKey");Un(this,"fingerprint");Un(this,"parentFingerprint");Un(this,"mnemonic");Un(this,"chainCode");Un(this,"path");Un(this,"index");Un(this,"depth");a5(n,Xm,"HDNodeWallet"),Ps(this,{publicKey:r.compressedPublicKey});const f=po(kA(ep(this.publicKey)),0,4);Ps(this,{parentFingerprint:s,fingerprint:f,chainCode:a,path:o,index:l,depth:c}),Ps(this,{mnemonic:u})}connect(n){return new Tp(Xm,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,n)}async encrypt(n,r){return await FIe(yr(this,dk,tee).call(this),n,{progressCallback:r})}encryptSync(n){return PIe(yr(this,dk,tee).call(this),n)}get extendedKey(){return Fr(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),eee(Pa(["0x0488ADE4",kM(this.depth,1),this.parentFingerprint,kM(this.index,4),this.chainCode,Pa(["0x00",this.privateKey])]))}hasPath(){return this.path!=null}neuter(){return new bE(Xm,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(n){const r=Mi(n,"index");Sn(r<=4294967295,"invalid index","index",r);let s=this.path;s&&(s+="/"+(r&2147483647),r&s4&&(s+="'"));const{IR:a,IL:o}=OIe(r,this.chainCode,this.publicKey,this.privateKey),l=new P0(t1((PB(o)+BigInt(this.privateKey))%h6t,32));return new Tp(Xm,l,this.fingerprint,Hr(a),s,r,this.depth+1,this.mnemonic,this.provider)}derivePath(n){return MIe(this,n)}static fromExtendedKey(n){const r=tl(Yyt(n));Sn(r.length===82||eee(r.slice(0,78))===n,"invalid extended key","extendedKey","[ REDACTED ]");const s=r[4],a=Hr(r.slice(5,9)),o=parseInt(Hr(r.slice(9,13)).substring(2),16),l=Hr(r.slice(13,45)),c=r.slice(45,78);switch(Hr(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const u=Hr(c);return new bE(Xm,$k(u),u,a,l,null,o,s,null)}case"0x0488ade4":case"0x04358394 ":if(c[0]!==0)break;return new Tp(Xm,new P0(c.slice(1)),a,l,null,o,s,null,null)}Sn(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(n,r,s){var o;n==null&&(n=""),r==null&&(r=JH),s==null&&(s=E3.wordlist());const a=HS.fromEntropy(Bg(16),n,s);return yr(o=Tp,Lw,vj).call(o,a.computeSeed(),a).derivePath(r)}static fromMnemonic(n,r){var s;return r||(r=JH),yr(s=Tp,Lw,vj).call(s,n.computeSeed(),n).derivePath(r)}static fromPhrase(n,r,s,a){var l;r==null&&(r=""),s==null&&(s=JH),a==null&&(a=E3.wordlist());const o=HS.fromPhrase(n,r,a);return yr(l=Tp,Lw,vj).call(l,o.computeSeed(),o).derivePath(s)}static fromSeed(n){var r;return yr(r=Tp,Lw,vj).call(r,n,null)}};dk=new WeakSet,tee=function(){const n={address:this.address,privateKey:this.privateKey},r=this.mnemonic;return this.path&&r&&r.wordlist.locale==="en"&&r.password===""&&(n.mnemonic={path:this.path,locale:"en",entropy:r.entropy}),n},Lw=new WeakSet,vj=function(n,r){Sn(kB(n),"invalid seed","seed","[REDACTED]");const s=cs(n,"seed");Sn(s.length>=16&&s.length<=64,"invalid seed","seed","[REDACTED]");const a=cs(_A("sha512",f6t,s)),o=new P0(Hr(a.slice(0,32)));return new Tp(Xm,o,"0x00000000",Hr(a.slice(32)),"m",0,0,r,null)},Ln(Tp,Lw);let Wj=Tp;class bE extends GJ{constructor(n,r,s,a,o,l,c,u,d){super(r,d);Un(this,"publicKey");Un(this,"fingerprint");Un(this,"parentFingerprint");Un(this,"chainCode");Un(this,"path");Un(this,"index");Un(this,"depth");a5(n,Xm,"HDNodeVoidWallet"),Ps(this,{publicKey:s});const f=po(kA(ep(s)),0,4);Ps(this,{publicKey:s,fingerprint:f,parentFingerprint:a,chainCode:o,path:l,index:c,depth:u})}connect(n){return new bE(Xm,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,n)}get extendedKey(){return Fr(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),eee(Pa(["0x0488B21E",kM(this.depth,1),this.parentFingerprint,kM(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(n){const r=Mi(n,"index");Sn(r<=4294967295,"invalid index","index",r);let s=this.path;s&&(s+="/"+(r&2147483647),r&s4&&(s+="'"));const{IR:a,IL:o}=OIe(r,this.chainCode,this.publicKey,null),l=P0.addPoints(o,this.publicKey,!0),c=$k(l);return new bE(Xm,c,l,this.fingerprint,Hr(a),s,r,this.depth+1,this.provider)}derivePath(n){return MIe(this,n)}}function uxe(e){try{if(JSON.parse(e).encseed)return!0}catch{}return!1}function dxe(e,t){const n=JSON.parse(e),r=Vk(t),s=Ji(hl(n,"ethaddr:string!")),a=EIe(hl(n,"encseed:string!"));Sn(a&&a.length%16===0,"invalid encseed","json",e);const o=cs(n2(r,r,2e3,32,"sha256")).slice(0,16),l=a.slice(0,16),c=a.slice(16),u=new Eae(o,l),d=l6t(cs(u.decrypt(c)));let f="";for(let x=0;x<d.length;x++)f+=String.fromCharCode(d[x]);return{address:s,privateKey:r1(f)}}function fxe(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}var fk,_0,nee;let _ae=(_0=class extends jM{constructor(t,n){typeof t=="string"&&!t.startsWith("0x")&&(t="0x"+t);let r=typeof t=="string"?new P0(t):t;super(r,n)}connect(t){return new _0(this.signingKey,t)}async encrypt(t,n){const r={address:this.address,privateKey:this.privateKey};return await FIe(r,t,{progressCallback:n})}encryptSync(t){const n={address:this.address,privateKey:this.privateKey};return PIe(n,t)}static async fromEncryptedJson(t,n,r){var a;let s=null;return lxe(t)?s=await d6t(t,n,r):uxe(t)&&(r&&(r(0),await fxe(0)),s=dxe(t,n),r&&(r(1),await fxe(0))),yr(a=_0,fk,nee).call(a,s)}static fromEncryptedJsonSync(t,n){var s;let r=null;return lxe(t)?r=u6t(t,n):uxe(t)?r=dxe(t,n):Sn(!1,"invalid JSON wallet","json","[ REDACTED ]"),yr(s=_0,fk,nee).call(s,r)}static createRandom(t){const n=Wj.createRandom();return t?n.connect(t):n}static fromPhrase(t,n){const r=Wj.fromPhrase(t);return n?r.connect(n):r}},fk=new WeakSet,nee=function(t){if(Sn(t,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in t&&t.mnemonic&&t.mnemonic.locale==="en"){const r=HS.fromEntropy(t.mnemonic.entropy),s=Wj.fromMnemonic(r,t.mnemonic.path);if(s.address===t.address&&s.privateKey===t.privateKey)return s;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const n=new _0(t.privateKey);return Sn(n.address===t.address,"address/privateKey mismatch","json","[ REDACTED ]"),n},Ln(_0,fk),_0);async function hxe(e,t,n){let r;if(e===2?r=t==null?void 0:t.builder_sign_data:e===1?r=t==null?void 0:t.sign_data:r=(t==null?void 0:t.builder_sign_data)??(t==null?void 0:t.sign_data),!r)throw new Error("No data found to sign (no sign_data / builder_sign_data).");const{domain:s,types:a,message:o,primaryType:l}=r,{EIP712Domain:c,primary_type:u,...d}=a||{},f={[l]:u||[],...d},x={...o,nonce:(o==null?void 0:o.nonce)!=null?o.nonce.toString():o==null?void 0:o.nonce};if(typeof n.signTypedData!="function")throw new Error("Signer does not support EIP-712 typed data signing");const g=await n.signTypedData(s,f,x),v=Zc.from(g);return{signature:{r:v.r,s:v.s,v:v.v},action:{...x,nonce:Number(x==null?void 0:x.nonce)},nonce:(x==null?void 0:x.nonce)||""}}const TM=({className:e})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",className:e,children:i.jsx("path",{d:"M9 1.5C4.8675 1.5 1.5 4.8675 1.5 9C1.5 13.1325 4.8675 16.5 9 16.5C13.1325 16.5 16.5 13.1325 16.5 9C16.5 4.8675 13.1325 1.5 9 1.5ZM8.4375 6C8.4375 5.6925 8.6925 5.4375 9 5.4375C9.3075 5.4375 9.5625 5.6925 9.5625 6V9.75C9.5625 10.0575 9.3075 10.3125 9 10.3125C8.6925 10.3125 8.4375 10.0575 8.4375 9.75V6ZM9.69 12.285C9.6525 12.3825 9.6 12.4575 9.5325 12.5325C9.4575 12.6 9.375 12.6525 9.285 12.69C9.195 12.7275 9.0975 12.75 9 12.75C8.9025 12.75 8.805 12.7275 8.715 12.69C8.625 12.6525 8.5425 12.6 8.4675 12.5325C8.4 12.4575 8.3475 12.3825 8.31 12.285C8.2725 12.195 8.25 12.0975 8.25 12C8.25 11.9025 8.2725 11.805 8.31 11.715C8.3475 11.625 8.4 11.5425 8.4675 11.4675C8.5425 11.4 8.625 11.3475 8.715 11.31C8.895 11.235 9.105 11.235 9.285 11.31C9.375 11.3475 9.4575 11.4 9.5325 11.4675C9.6 11.5425 9.6525 11.625 9.69 11.715C9.7275 11.805 9.75 11.9025 9.75 12C9.75 12.0975 9.7275 12.195 9.69 12.285Z",fill:"currentColor"})});var RIe={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},pxe=Se.createContext&&Se.createContext(RIe),m6t=["attr","size","title"];function x6t(e,t){if(e==null)return{};var n=g6t(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function g6t(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function IM(){return IM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},IM.apply(this,arguments)}function mxe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function PM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mxe(Object(n),!0).forEach(function(r){b6t(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mxe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function b6t(e,t,n){return t=y6t(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y6t(e){var t=v6t(e,"string");return typeof t=="symbol"?t:t+""}function v6t(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function LIe(e){return e&&e.map((t,n)=>Se.createElement(t.tag,PM({key:n},t.attr),LIe(t.child)))}function Cl(e){return t=>Se.createElement(w6t,IM({attr:PM({},e.attr)},t),LIe(e.child))}function w6t(e){var t=n=>{var{attr:r,size:s,title:a}=e,o=x6t(e,m6t),l=s||n.size||"1em",c;return n.className&&(c=n.className),e.className&&(c=(c?c+" ":"")+e.className),Se.createElement("svg",IM({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,o,{className:c,style:PM(PM({color:e.color||n.color},n.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),a&&Se.createElement("title",null,a),e.children)};return pxe!==void 0?Se.createElement(pxe.Consumer,null,n=>t(n)):t(RIe)}function C6t(e){return Cl({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M446.7 98.6l-67.6 318.8c-5.1 22.5-18.4 28.1-37.3 17.5l-103-75.9-49.7 47.8c-5.5 5.5-10.1 10.1-20.7 10.1l7.4-104.9 190.9-172.5c8.3-7.4-1.8-11.5-12.9-4.1L117.8 284 16.2 252.2c-22.1-6.9-22.5-22.1 4.6-32.7L418.2 66.4c18.4-6.9 34.5 4.1 28.5 32.2z"},child:[]}]})(e)}function Wk(e){return Cl({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"},child:[]}]})(e)}function S6t(e){return Cl({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"},child:[]}]})(e)}function kae(e){return Cl({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M0 168v-16c0-13.255 10.745-24 24-24h360V80c0-21.367 25.899-32.042 40.971-16.971l80 80c9.372 9.373 9.372 24.569 0 33.941l-80 80C409.956 271.982 384 261.456 384 240v-48H24c-13.255 0-24-10.745-24-24zm488 152H128v-48c0-21.314-25.862-32.08-40.971-16.971l-80 80c-9.372 9.373-9.372 24.569 0 33.941l80 80C102.057 463.997 128 453.437 128 432v-48h360c13.255 0 24-10.745 24-24v-16c0-13.255-10.745-24-24-24z"},child:[]}]})(e)}function ia(e){return Cl({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"},child:[]}]})(e)}function aa(e){return Cl({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"},child:[]}]})(e)}function N6t(e){return Cl({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M487.976 0H24.028C2.71 0-8.047 25.866 7.058 40.971L192 225.941V432c0 7.831 3.821 15.17 10.237 19.662l80 55.98C298.02 518.69 320 507.493 320 487.98V225.941l184.947-184.97C520.021 25.896 509.338 0 487.976 0z"},child:[]}]})(e)}function A6t(e){return Cl({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M480 416v16c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V176c0-26.51 21.49-48 48-48h16v208c0 44.112 35.888 80 80 80h336zm96-80V80c0-26.51-21.49-48-48-48H144c-26.51 0-48 21.49-48 48v256c0 26.51 21.49 48 48 48h384c26.51 0 48-21.49 48-48zM256 128c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-96 144l55.515-55.515c4.686-4.686 12.284-4.686 16.971 0L272 256l135.515-135.515c4.686-4.686 12.284-4.686 16.971 0L512 208v112H160v-48z"},child:[]}]})(e)}function j6t(e){return Cl({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M272 0H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h224c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zM160 480c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm112-108c0 6.6-5.4 12-12 12H60c-6.6 0-12-5.4-12-12V60c0-6.6 5.4-12 12-12h200c6.6 0 12 5.4 12 12v312z"},child:[]}]})(e)}function E6t(e){return Cl({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M476 3.2L12.5 270.6c-18.1 10.4-15.8 35.6 2.2 43.2L121 358.4l287.3-253.2c5.5-4.9 13.3 2.6 8.6 8.3L176 407v80.5c0 23.6 28.5 32.9 42.5 15.8L282 426l124.6 52.2c14.2 6 30.4-2.9 33-18.2l72-432C515 7.8 493.3-6.8 476 3.2z"},child:[]}]})(e)}function _6t(e){return Cl({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"},child:[]}]})(e)}function _3(e){return Cl({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9 0L24 329c-15.1-15.1-4.4-41 17-41z"},child:[]}]})(e)}function k3(e){return Cl({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M279 224H41c-21.4 0-32.1-25.9-17-41L143 64c9.4-9.4 24.6-9.4 33.9 0l119 119c15.2 15.1 4.5 41-16.9 41z"},child:[]}]})(e)}function T3(e){return Cl({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9 0L24 329c-15.1-15.1-4.4-41 17-41zm255-105L177 64c-9.4-9.4-24.6-9.4-33.9 0L24 183c-15.1 15.1-4.4 41 17 41h238c21.4 0 32.1-25.9 17-41z"},child:[]}]})(e)}function DIe(e){return Cl({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(e)}const k6t=({handleListRequest:e,isLighterInfoValue:t,handleLighterWalletInfo:n})=>{var he;const r="https://dextrabothypev2.nftinit.io",{setSignModalOpen:s}=m.useContext(Gr),[a,o]=m.useState(""),[l,c]=m.useState(""),[u,d]=m.useState(""),[f,x]=m.useState(""),[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,I]=m.useState(""),[P,R]=m.useState(""),[F,U]=m.useState(!0),[L,z]=m.useState({}),X=Y=>/^\d*$/.test(Y),ne=Y=>{["e","E","+","-"].includes(Y.key)&&Y.preventDefault()},J=a.trim()!==""&&l.trim()!==""&&u.trim()!==""&&f.trim()!=="",Z=async()=>{if(!J){I("Please fill in all fields.");return}try{C(!0),I(""),R("");const Y=window.localStorage.getItem("hyperToken"),ie=window.localStorage.getItem("hyperAddress");if(!Y||!ie){s(!0),C(!1);return}const oe={address:ie.toLowerCase(),token:Y,wallet_name:a,main_wallet:l,api_wallet_idx:f,api_wallet_private_key:u},V=await(await fetch(`${r}/api/wallet/generate-lighter`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(oe)})).json();V!=null&&V.success?(on.success("Wallet created successfully.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}),e(),n(ie),o(""),c(""),d(""),x(""),I(""),R(V==null?void 0:V.message)):I((V==null?void 0:V.error_message)||"An error has occurred.")}catch(Y){I(Y.message||"An error has occurred.")}finally{C(!1)}},re=async(Y,ie)=>{console.log("id :>> ",Y);const oe=`${Y}_${ie}`;try{z(Ae=>({...Ae,[oe]:!0})),I(""),R("");const G=window.localStorage.getItem("hyperToken"),V=window.localStorage.getItem("hyperAddress");if(!G||!V){s(!0),z(Ae=>({...Ae,[oe]:!1}));return}const ee={address:V.toLowerCase(),token:G,wallet_id:Number(Y)},fe=await(await fetch(`${r}/api/wallet/delete-lighter`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(ee)})).json();fe!=null&&fe.success?(on.success("Wallet deleted successfully.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}),n(V),I(""),R(fe==null?void 0:fe.message)):I((fe==null?void 0:fe.error_message)||"An error has occurred.")}catch(G){I(G.message||"An error has occurred.")}finally{C(!1)}};return i.jsxs("div",{className:"flex flex-col items-start gap-2 w-full relative",children:[w&&i.jsx("div",{role:"status",className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 flex justify-center items-center w-full z-[60] -mt-20 h-full min-h-[450px] sm:min-h-[280px]",children:i.jsx(Ma,{})}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 w-full",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Wallet Name"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:a,onChange:Y=>o(Y.target.value),autoComplete:"off",placeholder:"Wallet Name",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#1b1b1b] text-white border text-[13px] outline-none placeholder:text-[#7F7F7F] ${a===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:w})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Login Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:l,onChange:Y=>c(Y.target.value),autoComplete:"off",placeholder:"Login Address",type:"text",className:`w-full h-8 px-3 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${l===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:w})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"})}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:u,onChange:Y=>d(Y.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:g?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${u===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:w}),i.jsx("button",{type:"button",onClick:()=>v(Y=>!Y),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:w,children:g?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:f,onChange:Y=>{const ie=Y.target.value.trim();if(ie==="")return x("");X(ie)&&x(ie)},onKeyDown:ne,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX",className:`w-full h-8 px-3 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${f===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:w})})]})]}),i.jsx("button",{onClick:()=>{!w&&Z()},disabled:w,className:"w-full h-10 pl-2 pr-3.5 py-3 bg-[#7445ff] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] focus:ring-0 focus:outline-none justify-center items-center gap-1.5 inline-flex mt-2.5",children:i.jsx("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px]",children:"Generate"})}),i.jsx("div",{className:"w-full mt-2",children:(t==null?void 0:t.length)>0?i.jsxs("div",{className:"flex flex-col items-start gap-3 w-full ",children:[i.jsxs("div",{className:"flex justify-between items-center gap-2 cursor-pointer text-sm text-zinc-300 w-full",onClick:()=>U(!F),children:[i.jsx("span",{className:"text-white text-sm font-medium font-['Inter'] leading-normal",children:"Lighter Wallets"}),i.jsx(rse,{className:`w-3.5 h-3.5 transition-transform text-white ${F?"":"rotate-180"}`})]}),i.jsx("div",{className:"flex flex-col items-start gap-1 sm:gap-1.5 w-full max-h-[80px] overflow-y-auto",children:F&&((he=[...t].sort((Y,ie)=>(ie==null?void 0:ie.wallet_created_data)-(Y==null?void 0:Y.wallet_created_data)))==null?void 0:he.map((Y,ie)=>{var oe,G;return i.jsx("div",{className:"flex flex-col items-start w-full",children:i.jsxs("div",{className:"flex justify-between items-center gap-2 w-full",children:[i.jsx("div",{className:"flex justify-start items-center gap-2",children:i.jsx("span",{className:"text-[#929292] text-[11px] font-normal min-w-[110px]",children:((oe=Y==null?void 0:Y.wallet_name)==null?void 0:oe.length)>18?((G=Y==null?void 0:Y.wallet_name)==null?void 0:G.slice(0,18))+"...":Y==null?void 0:Y.wallet_name})}),i.jsxs("div",{className:"flex justify-start items-center w-max",children:[i.jsx("span",{className:"text-[#929292] text-[11px] font-normal min-w-[75px]",children:(Y==null?void 0:Y.wallet_address.slice(0,6))+"..."+(Y==null?void 0:Y.wallet_address.slice(-4))}),i.jsx("img",{onClick:V=>{V.stopPropagation(),navigator.clipboard.writeText(Y==null?void 0:Y.wallet_address),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:bo,alt:"",className:"cursor-pointer"})]}),i.jsx("span",{className:"text-[#929292] text-[11px] font-normal font-['Inter'] leading-4 min-w-max hidden sm:flex",children:eu(Y==null?void 0:Y.wallet_created_data)}),L[`${Y==null?void 0:Y.wallet_id}_${Y==null?void 0:Y.wallet_name.toLowerCase()}`]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[90px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{onClick:()=>{re(Y==null?void 0:Y.wallet_id,Y==null?void 0:Y.wallet_name)},className:"w-[70px] sm:w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Delete"})})]})},ie)}))})]}):""}),N&&i.jsxs("div",{className:"mt-2 w-full min-h-10 p-3 bg-[#ff7171]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 max-w-[480px]",children:[i.jsx("img",{src:vc,alt:"Dextrabot"}),i.jsx("p",{className:"text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4",children:N})]}),P&&i.jsxs("div",{className:"mt-2 w-full min-h-10 p-3 bg-[#67ffbd]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 max-w-[480px]",children:[i.jsx("img",{src:eae,alt:"Dextrabot",className:"w-4 h-4"}),i.jsx("p",{className:"text-[#67FFBD] text-[13px] font-normal font-['Inter'] leading-4",children:P})]})]})},T6t=({handleListRequest:e,isExtendedInfoValue:t,handleExtendedWalletInfo:n})=>{var ce;const r="https://dextrabothypev2.nftinit.io",{setSignModalOpen:s}=m.useContext(Gr),[a,o]=m.useState(""),[l,c]=m.useState(""),[u,d]=m.useState(""),[f,x]=m.useState(""),[g,v]=m.useState(""),[w,C]=m.useState(""),[N,I]=m.useState(!1),[P,R]=m.useState(!1),[F,U]=m.useState(!1),[L,z]=m.useState(!1),[X,ne]=m.useState(!1),[J,Z]=m.useState(""),[re,he]=m.useState(""),[Y,ie]=m.useState(!0),[oe,G]=m.useState({}),V=ye=>/^\d*$/.test(ye),ee=ye=>{["e","E","+","-"].includes(ye.key)&&ye.preventDefault()},ae=a.trim()!==""&&l.trim()!==""&&u.trim()!==""&&f.trim()!==""&&g.trim()!==""&&w.trim()!=="",fe=async()=>{if(!ae){Z("Please fill in all fields.");return}try{ne(!0),Z(""),he("");const ye=window.localStorage.getItem("hyperToken"),Ne=window.localStorage.getItem("hyperAddress");if(!ye||!Ne){s(!0),ne(!1);return}const be={address:Ne.toLowerCase(),token:ye,wallet_name:a,main_wallet:l,api_key:f,stark_public:u,stark_private:g,vault_number:w},Ie=await(await fetch(`${r}/api/wallet/generate-extended`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(be)})).json();Ie!=null&&Ie.success?(on.success("Wallet created successfully.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}),e(),n(Ne),o(""),c(""),d(""),x(""),v(""),C(""),Z(""),he(Ie==null?void 0:Ie.message)):Z((Ie==null?void 0:Ie.error_message)||"An error has occurred.")}catch(ye){Z(ye.message||"An error has occurred.")}finally{ne(!1)}},Ae=async(ye,Ne)=>{console.log("id :>> ",ye);const be=`${ye}_${Ne}`;try{G(it=>({...it,[be]:!0})),Z(""),he("");const je=window.localStorage.getItem("hyperToken"),Ie=window.localStorage.getItem("hyperAddress");if(!je||!Ie){s(!0),G(it=>({...it,[be]:!1}));return}const Re={address:Ie.toLowerCase(),token:je,wallet_id:Number(ye)},Be=await(await fetch(`${r}/api/wallet/delete-extended`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(Re)})).json();Be!=null&&Be.success?(e(),on.success("Wallet deleted successfully.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}),n(Ie),Z(""),he(Be==null?void 0:Be.message)):Z((Be==null?void 0:Be.error_message)||"An error has occurred.")}catch(je){Z(je.message||"An error has occurred.")}finally{ne(!1)}};return i.jsxs("div",{className:"flex flex-col items-start gap-2 w-full relative",children:[X&&i.jsx("div",{role:"status",className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 flex justify-center items-center w-full z-[60] -mt-20 h-full min-h-[450px] sm:min-h-[280px]",children:i.jsx(Ma,{})}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 w-full",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Wallet Name"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:a,onChange:ye=>o(ye.target.value),autoComplete:"off",placeholder:"Wallet Name",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#1b1b1b] text-white border text-[13px] outline-none placeholder:text-[#7F7F7F] ${a===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:X})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Login Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:l,onChange:ye=>c(ye.target.value),autoComplete:"off",placeholder:"Login Address",type:"text",className:`w-full h-8 px-3 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${l===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:X})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key"})}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:f,onChange:ye=>x(ye.target.value),autoComplete:"off",placeholder:"API_KEY",type:N?"text":"password",className:`w-full h-8 px-3 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${f===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:X}),i.jsx("button",{type:"button",onClick:()=>I(ye=>!ye),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:X,children:N?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stark Key Public"})}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:u,onChange:ye=>d(ye.target.value),autoComplete:"off",placeholder:"STARK_KEY_PUBLIC",type:P?"text":"password",className:`w-full h-8 px-3 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${u===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:X}),i.jsx("button",{type:"button",onClick:()=>R(ye=>!ye),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:X,children:P?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stark Key Private"})}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:g,onChange:ye=>v(ye.target.value),autoComplete:"off",placeholder:"STARK_KEY_PRIVATE",type:F?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${g===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:X}),i.jsx("button",{type:"button",onClick:()=>U(ye=>!ye),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:X,children:F?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Vault Number"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:w,onChange:ye=>{const Ne=ye.target.value.trim();if(Ne==="")return C("");V(Ne)&&C(Ne)},onKeyDown:ee,inputMode:"numeric",autoComplete:"off",type:L?"text":"password",placeholder:"VAULT_NUMBER",className:`w-full h-8 px-3 rounded-md text-white bg-[#1b1b1b] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${w===""?"border-[#303030]":"border-[#303030] focus:border-[#67FFBD]"}`,disabled:X}),i.jsx("button",{type:"button",onClick:()=>z(ye=>!ye),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:X,children:L?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]})]}),i.jsx("button",{onClick:()=>{!X&&fe()},disabled:X,className:"w-full h-10 pl-2 pr-3.5 py-3 bg-[#7445ff] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] focus:ring-0 focus:outline-none justify-center items-center gap-1.5 inline-flex mt-2.5",children:i.jsx("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px]",children:"Generate"})}),i.jsx("div",{className:"w-full mt-2",children:(t==null?void 0:t.length)>0?i.jsxs("div",{className:"flex flex-col items-start gap-3 w-full ",children:[i.jsxs("div",{className:"flex justify-between items-center gap-2 cursor-pointer text-sm text-zinc-300 w-full",onClick:()=>ie(!Y),children:[i.jsx("span",{className:"text-white text-sm font-medium font-['Inter'] leading-normal",children:"Extended Wallets"}),i.jsx(rse,{className:`w-3.5 h-3.5 transition-transform text-white ${Y?"":"rotate-180"}`})]}),i.jsx("div",{className:"flex flex-col items-start gap-1 sm:gap-1.5 w-full max-h-[80px] overflow-y-auto",children:Y&&((ce=[...t].sort((ye,Ne)=>(Ne==null?void 0:Ne.wallet_created_data)-(ye==null?void 0:ye.wallet_created_data)))==null?void 0:ce.map((ye,Ne)=>{var be,je;return i.jsx("div",{className:"flex flex-col items-start w-full",children:i.jsxs("div",{className:"flex justify-between items-center gap-2 w-full",children:[i.jsx("div",{className:"flex justify-start items-center gap-2",children:i.jsx("span",{className:"text-[#929292] text-[11px] font-normal min-w-[110px]",children:((be=ye==null?void 0:ye.wallet_name)==null?void 0:be.length)>18?((je=ye==null?void 0:ye.wallet_name)==null?void 0:je.slice(0,18))+"...":ye==null?void 0:ye.wallet_name})}),i.jsxs("div",{className:"flex justify-start items-center w-max",children:[i.jsx("span",{className:"text-[#929292] text-[11px] font-normal min-w-[75px]",children:(ye==null?void 0:ye.wallet_address.slice(0,6))+"..."+(ye==null?void 0:ye.wallet_address.slice(-4))}),i.jsx("img",{onClick:Ie=>{Ie.stopPropagation(),navigator.clipboard.writeText(ye==null?void 0:ye.wallet_address),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:bo,alt:"",className:"cursor-pointer"})]}),i.jsx("span",{className:"text-[#929292] text-[11px] font-normal font-['Inter'] leading-4 min-w-max hidden sm:flex",children:eu(ye==null?void 0:ye.wallet_created_data)}),oe[`${ye==null?void 0:ye.wallet_id}_${ye==null?void 0:ye.wallet_name.toLowerCase()}`]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[90px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{onClick:()=>{Ae(ye==null?void 0:ye.wallet_id,ye==null?void 0:ye.wallet_name)},className:"w-[70px] sm:w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Delete"})})]})},Ne)}))})]}):""}),J&&i.jsxs("div",{className:"mt-2 w-full min-h-10 p-3 bg-[#ff7171]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 max-w-[480px]",children:[i.jsx("img",{src:vc,alt:"Dextrabot"}),i.jsx("p",{className:"text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4",children:J})]}),re&&i.jsxs("div",{className:"mt-2 w-full min-h-10 p-3 bg-[#67ffbd]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 max-w-[480px]",children:[i.jsx("img",{src:eae,alt:"Dextrabot",className:"w-4 h-4"}),i.jsx("p",{className:"text-[#67FFBD] text-[13px] font-normal font-['Inter'] leading-4",children:re})]})]})},I6t=({className:e})=>i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("path",{d:"M10.5001 6.31166C10.3454 6.31166 10.197 6.37312 10.0876 6.48252C9.97821 6.59191 9.91675 6.74029 9.91675 6.895V11.0833C9.91675 11.238 9.85529 11.3864 9.74589 11.4958C9.6365 11.6052 9.48812 11.6667 9.33341 11.6667H2.91675C2.76204 11.6667 2.61367 11.6052 2.50427 11.4958C2.39487 11.3864 2.33341 11.238 2.33341 11.0833V4.66666C2.33341 4.51195 2.39487 4.36358 2.50427 4.25419C2.61367 4.14479 2.76204 4.08333 2.91675 4.08333H7.10508C7.25979 4.08333 7.40816 4.02187 7.51756 3.91248C7.62696 3.80308 7.68841 3.65471 7.68841 3.5C7.68841 3.34529 7.62696 3.19691 7.51756 3.08752C7.40816 2.97812 7.25979 2.91666 7.10508 2.91666H2.91675C2.45262 2.91666 2.0075 3.10104 1.67931 3.42923C1.35112 3.75742 1.16675 4.20254 1.16675 4.66666V11.0833C1.16675 11.5475 1.35112 11.9926 1.67931 12.3208C2.0075 12.649 2.45262 12.8333 2.91675 12.8333H9.33341C9.79754 12.8333 10.2427 12.649 10.5709 12.3208C10.899 11.9926 11.0834 11.5475 11.0834 11.0833V6.895C11.0834 6.74029 11.022 6.59191 10.9126 6.48252C10.8032 6.37312 10.6548 6.31166 10.5001 6.31166ZM12.7867 1.52833C12.7276 1.38579 12.6143 1.27252 12.4717 1.21333C12.4016 1.18344 12.3263 1.16759 12.2501 1.16666H8.75008C8.59537 1.16666 8.447 1.22812 8.3376 1.33752C8.22821 1.44691 8.16675 1.59529 8.16675 1.75C8.16675 1.90471 8.22821 2.05308 8.3376 2.16248C8.447 2.27187 8.59537 2.33333 8.75008 2.33333H10.8442L4.83591 8.33583C4.78124 8.39006 4.73784 8.45458 4.70823 8.52566C4.67861 8.59675 4.66337 8.67299 4.66337 8.75C4.66337 8.827 4.67861 8.90325 4.70823 8.97433C4.73784 9.04542 4.78124 9.10994 4.83591 9.16416C4.89014 9.21884 4.95466 9.26224 5.02574 9.29185C5.09683 9.32147 5.17307 9.33671 5.25008 9.33671C5.32709 9.33671 5.40333 9.32147 5.47442 9.29185C5.5455 9.26224 5.61002 9.21884 5.66425 9.16416L11.6667 3.15583V5.25C11.6667 5.40471 11.7282 5.55308 11.8376 5.66248C11.947 5.77187 12.0954 5.83333 12.2501 5.83333C12.4048 5.83333 12.5532 5.77187 12.6626 5.66248C12.772 5.55308 12.8334 5.40471 12.8334 5.25V1.75C12.8325 1.67377 12.8166 1.59846 12.7867 1.52833Z",fill:"currentColor"})}),P6t=({errorConnectMessage:e,setErrorConnectMessage:t,loadingConnect:n,setLoadingConnect:r,handleListRequest:s,handlePageChange:a,isBalanceValue:o,isBalanceLoading:l,isAgentInfoLoading:c,isAgentInfoValue:u,handleAgentWalletInfo:d,isBuilderFeeLoading:f,isBuilderFeeValue:x,refreshAgent:g,handleBuilderFeeInfo:v,isLighterInfoValue:w,handleLighterWalletInfo:C,isExtendedInfoValue:N,handleExtendedWalletInfo:I})=>{var fe,Ae;const{setSignModalOpen:P}=m.useContext(Gr),{address:R}=Yr(),F=Ic(),[U,L]=m.useState(!0),[z,X]=m.useState(!1),[ne,J]=m.useState(!1),[Z,re]=m.useState("HYPERLIQUID");m.useEffect(()=>{const ce=F.hash,ye=localStorage.getItem("isWalletSelectMenu");if(ce){const Ne=ce.split("#").filter(Boolean);Ne[2]&&re(Ne[2].toUpperCase()),ye==="LIGHTER"?re("LIGHTER"):ye==="EXTENDED"?re("EXTENDED"):ye==="HYPER"&&re("HYPERLIQUID")}},[F.hash]),m.useEffect(()=>{(async()=>{var be;const ye=window.localStorage.getItem("hyperToken"),Ne=(be=R||window.localStorage.getItem("hyperAddress"))==null?void 0:be.toLowerCase();if(!ye){P(!0);return}if(Ne&&ye)try{const je=await Si(Ne,ye);X(!!(je!=null&&je.is_generated))}catch{X(!1)}finally{J(!0)}})()},[R,P]);const he=ce=>{var Ie,Re,Qe,Be,it,tt;const ye=(ce==null?void 0:ce.code)||((Ie=ce==null?void 0:ce.error)==null?void 0:Ie.code)||((Qe=(Re=ce==null?void 0:ce.info)==null?void 0:Re.error)==null?void 0:Qe.code)||((Be=ce==null?void 0:ce.cause)==null?void 0:Be.code)||"",Ne=typeof ye=="string"?ye.toUpperCase():String(ye).toUpperCase(),be=String((ce==null?void 0:ce.message)||"").toUpperCase();if(Ne==="ACTION_REJECTED"||Ne==="4001"||be.includes("USER REJECT")||be.includes("USER DENIED")){t("Request cancelled by user.");return}if([typeof ce=="string"?ce:"",ce==null?void 0:ce.message,ce==null?void 0:ce.code,ce==null?void 0:ce.name,ce==null?void 0:ce.shortMessage,(it=ce==null?void 0:ce.cause)==null?void 0:it.message,(tt=ce==null?void 0:ce.cause)==null?void 0:tt.code].filter(Boolean).join(" ").toUpperCase().includes("UNSUPPORTED_OPERATION")){t(i.jsxs(i.Fragment,{children:[i.jsx("b",{children:"Wallet Extension Conflict Detected"})," — It looks like you are using multiple wallet extensions at the same time, which is causing a conflict."," ",i.jsx("a",{href:"https://docs.dextrabot.com/errors/wallet-extension-conflict-fix",target:"_blank",rel:"noreferrer",className:"underline",children:"Read Guide"})]}));return}t(typeof ce=="string"?ce:(ce==null?void 0:ce.message)||"Something went wrong.")},Y=()=>{if(!window.ethereum)throw new Error("MetaMask not found.");return window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0xa4b1"}]})},ie=async ce=>{var be,je;if(z)return;const ye=window.localStorage.getItem("hyperToken");if(!ye||!R){P(!0);return}r(!0),t("");const Ne=window.localStorage.getItem("hyperAddress");try{await window.ethereum.request({method:"eth_chainId"})!=="0xa4b1"&&await Y();const Qe=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/generate-agent",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:R?R.toLowerCase():Ne,token:ye})})).json();if(!(Qe!=null&&Qe.success)){he((Qe==null?void 0:Qe.error_message)||"Agent could not be produced.");return}if(!window.ethereum)throw new Error("MetaMask not found.");const it=await new AM(window.ethereum).getSigner(),tt=await hxe(ce,Qe,it),dt=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/complete-agent",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({signature:tt.signature,action:tt.action,nonce:tt.nonce,address:R?R.toLowerCase():Ne,token:ye})})).json();if(dt!=null&&dt.success){if(((be=dt==null?void 0:dt.result)==null?void 0:be.status)==="err"){he(((je=dt==null?void 0:dt.result)==null?void 0:je.response)||"Approval failed."),r(!1);return}s(),a(1),d(R||Ne)}else he((dt==null?void 0:dt.error_message)||"Approval failed.")}catch(Ie){he(Ie)}finally{r(!1)}},oe=async ce=>{var be,je;if(z)return;const ye=window.localStorage.getItem("hyperToken");if(!ye||!R){P(!0);return}r(!0),t("");const Ne=window.localStorage.getItem("hyperAddress");try{await window.ethereum.request({method:"eth_chainId"})!=="0xa4b1"&&await Y();const Qe=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/generate-agent",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:R?R.toLowerCase():Ne,token:ye})})).json();if(!(Qe!=null&&Qe.success))throw new Error((Qe==null?void 0:Qe.error_message)||"Generate builder fee failed");if(!window.ethereum)throw new Error("MetaMask not found.");const it=await new AM(window.ethereum).getSigner(),tt=await hxe(ce,Qe,it),dt=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/complete-builder",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({signature:tt.signature,action:tt.action,nonce:tt.nonce,address:R?R.toLowerCase():Ne,token:ye})})).json();if(dt!=null&&dt.success){if(((be=dt==null?void 0:dt.result)==null?void 0:be.status)==="err"){he(((je=dt==null?void 0:dt.result)==null?void 0:je.response)||"Approve builder fee failed"),r(!1);return}ie(1),v(R||Ne)}else he((dt==null?void 0:dt.error_message)||"Approval failed."),r(!1)}catch(Ie){he(Ie),r(!1)}},G=m.useMemo(()=>u?u.some(ce=>{var ye;return((ye=(ce==null?void 0:ce.name)??"")==null?void 0:ye.trim().toLowerCase())==="dextrabot"}):!1,[u]),V=Number(((fe=o==null?void 0:o.marginSummary)==null?void 0:fe.accountValue)??0),ee=`You can’t create an API Wallet while logged in with a Dextrabot-generated wallet.

How To Login: Log in with a non Dextrabot-generated wallet and try again.`,ae=n||c||l||f||!ne&&R;return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"w-full",children:i.jsxs("div",{className:"flex flex-col items-start justify-center sm:flex-row  sm:justify-between sm:items-center w-full gap-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(eV,{title:"HYPERLIQUID",set_click:()=>re("HYPERLIQUID"),isSelectAPIMenu:Z}),i.jsx(eV,{title:"LIGHTER",set_click:()=>re("LIGHTER"),isSelectAPIMenu:Z}),i.jsx(eV,{title:"EXTENDED",set_click:()=>re("EXTENDED"),isSelectAPIMenu:Z})]}),Z==="EXTENDED"&&i.jsxs("button",{onClick:()=>window.open("https://app.extended.exchange/join/DEXTRABOT","_blank"),className:" group px-3 py-1.5 rounded-full border border-[#3ec78c] text-[#3ec78c] text-sm font-medium flex items-center gap-2 transition-all duration-200 hover:bg-[#3ec78c]/15 hover:border-[#3ec78c]/80 active:scale-95",children:[i.jsx("span",{children:"Go To API Page"}),i.jsx(I6t,{className:"w-4 h-4"})]})]})}),ae?i.jsx("div",{role:"status",className:"flex justify-center items-center w-full my-[30px]",children:i.jsx(Ma,{})}):Z==="HYPERLIQUID"?i.jsxs("div",{className:"flex flex-col items-center justify-start gap-[24px] w-full",children:[i.jsxs("div",{className:"flex flex-col items-start gap-2 -mt-[8px] w-full",children:[i.jsx("label",{htmlFor:"address",className:"text-center justify-start text-white text-sm font-medium font-['Inter']",children:"Connected Wallet"}),i.jsxs("div",{id:"address",className:"min-h-10 px-2.5 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] outline outline-1 outline-offset-[-1px] outline-[#2a2a2a] gap-2 flex justify-start items-center w-full text-white text-sm font-medium font-['Inter'] leading-[16px] break-all",children:[R&&i.jsx("img",{src:qme,alt:"agent icon"}),R||"--"]}),!z&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex justify-start items-center gap-4 w-full mt-2",children:i.jsxs("div",{className:"flex flex-col items-start gap-1.5 text-[#929292] text-[13px] font-normal font-['Inter'] leading-4 w-full",children:[i.jsxs("div",{className:"flex justify-between items-center w-full",children:[i.jsx("span",{className:"text-[#929292]",children:"USDC Available "}),i.jsxs("div",{className:"flex justify-center items-center gap-4",children:[i.jsx("div",{onClick:()=>{g()},className:"flex justify-center items-center cursor-pointer",children:i.jsx(NS,{className:"w-4 h-4 text-[#929292] hover:text-white"})}),i.jsx("span",{className:`${V>=5?"text-[#1DE674]":"text-[#929292]"} `,children:V===0||V?"$"+Er(V):"--"})]})]}),(V===0&&!G||V<5&&!G)&&i.jsxs("div",{className:"flex justify-between items-center w-full",children:[i.jsx("span",{className:"text-text-[#929292]",children:"Min. Deposit"}),i.jsx("span",{className:"text-[#929292]",children:"5 USDC"})]})]})}),i.jsx("div",{className:"w-full flex justify-center items-center mt-2",children:x!=null&&Number(x)>0?G?i.jsxs("div",{className:"px-3 py-2.5 bg-[#1de674]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 w-full max-w-[480px] text-[#1DE674] text-[13px] font-normal font-['Inter'] leading-4",children:[i.jsx("img",{src:qme,alt:"agent icon"}),"You’re ready to trade!"]}):"":V>0?V>=5?"":i.jsxs("div",{className:"px-3 py-2.5 bg-[#ffb14b]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 w-full max-w-[480px] text-[#FFB14B] text-[13px] font-normal font-['Inter'] leading-4",children:[i.jsx(TM,{className:"text-[#FFB14B] w-[18px] h-[18px] min-w-[18px] min-h-[18px]"}),"Your Hyperliquid perps balance is $",Er(V)," USDC. A minimum of 5 USDC is required."]}):i.jsxs("div",{className:"px-3 py-2.5 bg-[#ffb14b]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 w-full max-w-[480px] text-[#FFB14B] text-[13px] font-normal font-['Inter'] leading-4",children:[i.jsx(TM,{className:"text-[#FFB14B] w-[18px] h-[18px] min-w-[18px] min-h-[18px]"}),"Please fund your Hyperliquid Perpetual balance to start trading"]})})]})]}),z?i.jsxs("div",{className:"-mt-2.5 w-full p-3 bg-[#ff7171]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] max-w-[480px] flex justify-start items-center gap-2.5",children:[i.jsx("img",{src:vc,alt:"Dextrabot"}),i.jsx("p",{className:"whitespace-pre-line text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4",children:ee})]}):i.jsxs(i.Fragment,{children:[x!=null&&Number(x)>0?G?"":i.jsx("div",{onClick:()=>{ie(1)},className:`${!n&&!c&&!f?"cursor-pointer bg-[#7445ff] border border-[#8860ff] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)]":"bg-[#6B7280] text-[#D1D5DB] cursor-auto"} w-full h-10 px-6 py-3  rounded-xl  inline-flex justify-center items-center gap-2.5 text-white text-sm font-semibold font-['Inter'] leading-[8px] -mt-4`,children:i.jsx("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px]",children:"Enable Trading"})}):i.jsx("div",{onClick:ce=>{ce.preventDefault(),V>=5&&!l&&oe(2)},className:`${V>=5&&!l?"cursor-pointer bg-[#7445ff] border border-[#8860ff] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)]":"bg-[#6B7280] text-[#D1D5DB] cursor-auto"} w-full h-10 px-6 py-3  rounded-xl  inline-flex justify-center items-center gap-2.5 text-white text-sm font-semibold font-['Inter'] leading-[8px] -mt-4`,children:i.jsx("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px]",children:"Enable Trading"})}),i.jsx("div",{className:"w-full",children:(u==null?void 0:u.length)>0?i.jsxs("div",{className:"flex flex-col items-start gap-3 w-full ",children:[i.jsxs("div",{className:"flex justify-between items-center gap-2 cursor-pointer text-sm text-zinc-300 w-full",onClick:()=>L(!U),children:[i.jsx("span",{className:"text-white text-sm font-medium font-['Inter'] leading-normal",children:"API Wallets"}),i.jsx(rse,{className:`w-3.5 h-3.5 transition-transform text-white ${U?"":"rotate-180"}`})]}),i.jsx("div",{className:"flex flex-col items-start gap-1 sm:gap-1.5 w-full max-h-[80px] overflow-y-auto",children:U&&((Ae=[...u].sort((ce,ye)=>(ye==null?void 0:ye.validUntil)-(ce==null?void 0:ce.validUntil)))==null?void 0:Ae.map((ce,ye)=>i.jsx("div",{className:"flex flex-col items-start w-full",children:i.jsxs("div",{className:"flex justify-between items-center gap-2 w-full",children:[i.jsx("div",{className:"flex justify-start items-center gap-2 sm:gap-6",children:i.jsx("span",{className:`${(ce==null?void 0:ce.name)==="dextrabot"?"text-white":"text-[#929292]"}  text-[11px] font-normal min-w-[110px]`,children:ce==null?void 0:ce.name})}),i.jsxs("span",{className:`${(ce==null?void 0:ce.name)==="dextrabot"?"text-white":"text-[#929292]"} text-[11px] font-normal font-['Inter'] leading-4 min-w-max`,children:["Valid until:"," ",Glt(ce==null?void 0:ce.validUntil)]})]})},ye)))})]}):""}),e&&i.jsxs("div",{className:"-mt-2.5 w-full h-10 p-3 bg-[#ff7171]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] max-w-[480px] flex justify-start items-center gap-2.5",children:[i.jsx("img",{src:vc,alt:"Dextrabot"}),i.jsx("p",{className:"text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4",children:e})]})]})]}):Z==="LIGHTER"?i.jsx("div",{className:"flex items-center justify-start w-full",children:i.jsx(k6t,{handleListRequest:s,isLighterInfoValue:w,handleLighterWalletInfo:C})}):i.jsx("div",{className:"flex items-center justify-start w-full",children:i.jsx(T6t,{handleListRequest:s,isExtendedInfoValue:N,handleExtendedWalletInfo:I})})]})},eV=({title:e,set_click:t,isSelectAPIMenu:n})=>i.jsx("div",{onClick:t,className:`${n==e?"bg-[#67ffbd]/20 text-[#67FFBD]":"bg-transparent text-[#9b9b9b]"}  text-[13px] font-medium font-manrope leading-[8px] cursor-pointer flex justify-center items-center min-w-max rounded-md px-[6px] sm:px-[10px] h-[22px]`,children:e}),xxe=({className:e})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",className:e,children:[i.jsx("path",{d:"M3.75 11.25C3.045 11.25 2.3925 11.4975 1.875 11.91C1.185 12.4575 0.75 13.305 0.75 14.25C0.75 15.9075 2.0925 17.25 3.75 17.25C4.5075 17.25 5.1975 16.965 5.73 16.5C6.3525 15.9525 6.75 15.15 6.75 14.25C6.75 12.5925 5.4075 11.25 3.75 11.25ZM4.5 14.4375C4.5 14.6325 4.395 14.82 4.23 14.9175L3.2925 15.48C3.2025 15.54 3.0975 15.5625 3 15.5625C2.8125 15.5625 2.625 15.465 2.52 15.2925C2.3625 15.0225 2.445 14.6775 2.715 14.52L3.3825 14.1225V13.3125C3.375 13.005 3.63 12.75 3.9375 12.75C4.245 12.75 4.5 13.005 4.5 13.3125V14.4375Z",fill:"currentColor"}),i.jsx("path",{d:"M11.1375 2.96251V5.81251H10.0125V2.96251C10.0125 2.76001 9.8325 2.66251 9.7125 2.66251C9.675 2.66251 9.6375 2.67001 9.6 2.68501L3.6525 4.92751C3.255 5.07751 3 5.45251 3 5.88001V6.38251C2.3175 6.89251 1.875 7.71001 1.875 8.63251V5.88001C1.875 4.98751 2.4225 4.19251 3.255 3.87751L9.21 1.62751C9.375 1.56751 9.5475 1.53751 9.7125 1.53751C10.4625 1.53751 11.1375 2.14501 11.1375 2.96251Z",fill:"currentColor"}),i.jsx("path",{d:"M16.1245 10.875V11.625C16.1245 11.8275 15.967 11.9925 15.757 12H14.662C14.2645 12 13.9045 11.7075 13.8745 11.3175C13.852 11.085 13.942 10.8675 14.092 10.7175C14.227 10.575 14.4145 10.5 14.617 10.5H15.7495C15.967 10.5075 16.1245 10.6725 16.1245 10.875Z",fill:"currentColor"}),i.jsx("path",{d:"M14.61 9.7125H15.375C15.7875 9.7125 16.125 9.375 16.125 8.9625V8.6325C16.125 7.08 14.8575 5.8125 13.305 5.8125H4.695C4.0575 5.8125 3.4725 6.0225 3 6.3825C2.3175 6.8925 1.875 7.71 1.875 8.6325V9.9675C1.875 10.2525 2.175 10.4325 2.445 10.3425C2.865 10.2 3.3075 10.125 3.75 10.125C6.0225 10.125 7.875 11.9775 7.875 14.25C7.875 14.79 7.7325 15.3825 7.5075 15.9075C7.3875 16.1775 7.575 16.5 7.8675 16.5H13.305C14.8575 16.5 16.125 15.2325 16.125 13.68V13.5375C16.125 13.125 15.7875 12.7875 15.375 12.7875H14.7225C14.0025 12.7875 13.3125 12.345 13.125 11.6475C12.975 11.0775 13.155 10.5225 13.53 10.1625C13.8075 9.8775 14.19 9.7125 14.61 9.7125ZM10.5 9.5625H6.75C6.4425 9.5625 6.1875 9.3075 6.1875 9C6.1875 8.6925 6.4425 8.4375 6.75 8.4375H10.5C10.8075 8.4375 11.0625 8.6925 11.0625 9C11.0625 9.3075 10.8075 9.5625 10.5 9.5625Z",fill:"currentColor"})]});function FA({open:e,setOpen:t,handleListRequest:n,handlePageChange:r}){const{isConnected:s,address:a}=Yr(),{hyperToken:o}=m.useContext(Gr);Ic();const[l,c]=m.useState([]),[u,d]=m.useState(""),[f,x]=m.useState(!1),[g,v]=m.useState(""),[w,C]=m.useState(!1),[N,I]=m.useState(!1),[P,R]=m.useState(!1),[F,U]=m.useState("account"),[L,z]=m.useState(!1),X=m.useRef(null),[ne,J]=m.useState([]),[Z,re]=m.useState(""),[he,Y]=m.useState(""),[ie,oe]=m.useState(!1),[G,V]=m.useState(""),[ee,ae]=m.useState(""),[fe,Ae]=m.useState(""),[ce,ye]=m.useState(!1),[Ne,be]=m.useState(!1),[je,Ie]=m.useState(null),[Re,Qe]=m.useState(!1),[Be,it]=m.useState([]),[tt,at]=m.useState([]),[dt,ct]=m.useState([]),[Ut,kt]=m.useState(!1),[tn,jt]=m.useState(null),un=[{id:"account",name:"Add API Wallet",href:"#account",icon:xxe},{id:"generate",name:"Generate HL Wallet",href:"#generate",icon:xxe}];function cn(...ft){return ft.filter(Boolean).join(" ")}const Pt=async(ft,en)=>{try{en===1&&be(!0);const Dt=await fetch("https://api-ui.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"clearinghouseState",user:ft})});if(!Dt.ok)throw new Error("Network response was not ok");const At=await Dt.json();At&&(Ie(At),be(!1))}catch(Dt){console.error("Error fetching user balance info:",Dt),be(!1)}},Xe=async ft=>{try{Qe(!0);const en=await fetch("https://api-ui.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"extraAgents",user:ft})});if(!en.ok)throw new Error("Network response was not ok");const Dt=await en.json();Dt&&(it(Dt),Qe(!1))}catch(en){console.error("Error fetching user balance info:",en),Qe(!1)}},Vt=async ft=>{const en=window.localStorage.getItem("hyperToken"),Dt=window.localStorage.getItem("hyperAddress");if(!(!en||!ft))try{const At=await fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:ft?ft.toLowerCase():Dt,token:en})});if(!At.ok)throw new Error("Network response was not ok");const Je=await At.json();Je.success&&at((Je==null?void 0:Je.data)||[])}catch(At){console.error("Error fetching user balance info:",At)}},Yt=async ft=>{const en=window.localStorage.getItem("hyperToken"),Dt=window.localStorage.getItem("hyperAddress");if(!(!en||!ft))try{const At=await fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-extended",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:ft?ft.toLowerCase():Dt,token:en})});if(!At.ok)throw new Error("Network response was not ok");const Je=await At.json();Je.success&&ct((Je==null?void 0:Je.data)||[])}catch(At){console.error("Error fetching user balance info:",At)}},Ve=async ft=>{try{kt(!0);const en=await fetch("https://api-ui.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"maxBuilderFee",user:ft,builder:"0x49ae63056b3a0be0b166813ee687309ab653c07c"})});if(!en.ok)throw new Error("Network response was not ok");const Dt=await en.text(),At=parseInt(Dt,10);jt(At),kt(!1)}catch(en){console.error("Error fetching user balance info:",en),kt(!1)}};m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&a&&e&&(Pt(a,1),Xe(a),Vt(a),Yt(a),Ve(a))},[e]),m.useEffect(()=>{var Dt;return!e||F!="account"||(Be==null?void 0:Be.some(At=>((At==null?void 0:At.name)??"").trim().toLowerCase()==="dextrabot"))?void 0:(Number(((Dt=je==null?void 0:je.marginSummary)==null?void 0:Dt.accountValue)??0)<5?X.current||(X.current=setInterval(()=>{Pt(a,2)},1e4)):X.current&&(clearInterval(X.current),X.current=null),()=>{X.current&&(clearInterval(X.current),X.current=null)})},[je,e,F,a]),m.useEffect(()=>{const ft=window.localStorage.getItem("hyperToken");(!a||!s||!ft)&&(t(!1),d(""),v(""),Ae(""))},[a,s,o]);const Ke=()=>{window.localStorage.getItem("hyperToken")&&a&&e?(Pt(a,1),Xe(a),Ve(a)):on.error("Please connect wallet")};return m.useEffect(()=>{if(e&&!L)if((Be==null?void 0:Be.length)>0){const ft=Be==null?void 0:Be.some(Dt=>((Dt==null?void 0:Dt.name)??"").trim().toLowerCase()==="dextrabot"),en=localStorage.getItem("isWalletSelectMenu");U(en==="LIGHTER"||en==="EXTENDED"?"account":en==="HYPER"?ft?"generate":"account":ft&&(tt==null?void 0:tt.length)>0&&(dt==null?void 0:dt.length)>0?"generate":"account"),z(!0)}else U("account"),z(!0)},[Be,L]),i.jsxs(i.Fragment,{children:[i.jsx(Dyt,{open:P,setOpen:R,setGenModalOpen:t,setGenWalletSuccess:I,setGenWalletData:c,setShowPrivateKey:C}),i.jsxs(ga,{open:e,onClose:()=>{},className:"relative z-[9999999998] font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-[9999999998] w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full justify-center p-4 text-center items-center sm:p-0",children:i.jsx(da,{transition:!0,style:{boxShadow:"0 4px 24px 0 #000",backdropFilter:"blur(16px)"},className:"relative transform overflow-hidden bg-[rgba(16,16,16,0.64)] border  border-[rgba(46,46,46,0.32)] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:`${N&&Object.keys(l).length>0?"w-max":"w-[400px]"} flex flex-col justify-start items-center gap-[26px] h-max relative bg-[#0f0f0f]/60 rounded-3xl pt-[29px] pb-[24px] px-[26px] w-full min-w-[320px]`,children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:ft=>{ft.preventDefault(),f&&F==="generate"||F==="account"&&ce?on.success(i.jsx(i.Fragment,{children:i.jsx("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:"Please wait until completion."})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"300px",minWidth:"300px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}}):F==="generate"&&N&&Object.keys(l).length>0?(R(!0),C(!1)):(t(!1),d(""),v(""),Ae(""),it([]),jt(null),z(!1))},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-3.5",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Oa})})}),i.jsx("div",{className:"flex justify-start text-white text-base font-medium font-manrope w-full",children:"Generate your wallet"}),i.jsxs("div",{className:"flex justify-start items-center w-full",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:hidden w-full",children:[i.jsx("select",{value:F,onChange:ft=>{const en=ft.target.value;if(!f){if(F==="generate"&&en!=="generate"&&N&&Object.keys(l).length>0){C(!1),R(!0);return}if(F==="account"&&en!=="account"&&ce){on.success(i.jsx(i.Fragment,{children:i.jsx("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:"Please wait until completion."})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"300px",minWidth:"300px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}U(en),d("")}},"aria-label":"Select a tab",className:"col-start-1 row-start-1 w-full appearance-none rounded-md bg-white py-2 pl-3 pr-8 text-base text-gray-900 outline outline-1 -outline-offset-1 outline-gray-300 focus:outline focus:outline-2 focus:-outline-offset-2 dark:bg-white/5 dark:text-gray-100 dark:outline-white/10 dark:*:bg-gray-800",children:un==null?void 0:un.map(ft=>i.jsx("option",{value:ft==null?void 0:ft.id,children:ft==null?void 0:ft.name},ft==null?void 0:ft.id))}),i.jsx(N9,{"aria-hidden":"true",className:"pointer-events-none col-start-1 row-start-1 mr-2 size-5 self-center justify-self-end fill-gray-500 dark:fill-gray-400"})]}),i.jsx("div",{style:{boxShadow:"0 2px 4px 0 rgba(0, 0, 0, 0.16)"},className:"hidden sm:flex w-full justify-center items-center border border-[#2A2A2A] rounded-2xl p-1 h-10",children:i.jsx("nav",{"aria-label":"Tabs",role:"tablist",className:"flex items-center space-x-8",children:un==null?void 0:un.map(ft=>{const en=(ft==null?void 0:ft.id)===F;return i.jsxs("a",{href:ft==null?void 0:ft.href,onClick:Dt=>{Dt.preventDefault();const At=ft==null?void 0:ft.id;if(f)return;if(F==="generate"&&At!=="generate"&&N&&Object.keys(l).length>0){C(!1),R(!0);return}if(F==="account"&&At!=="account"&&ce){on.success(i.jsx(i.Fragment,{children:i.jsx("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:"Please wait until completion."})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"300px",minWidth:"300px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}U(At);const Je=document.querySelector(ft.href);Je&&Je.scrollIntoView({behavior:"smooth",block:"start"}),d("")},"aria-current":en?"page":void 0,className:cn(en?"bg-[#2e2e2e] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] h-8 px-6 py-3 text-white":"text-[#878787]","group flex justify-center items-center px-1 py-4 text-[13px] font-medium tracking-[-0.13px] w-[220px] hover:text-white group"),children:[i.jsx(ft.icon,{"aria-hidden":"true",className:cn(en?"text-white group-hover:text-white":"text-[#878787] group-hover:text-white","-ml-0.5 mr-2 size-[18px]")}),i.jsx("span",{children:ft==null?void 0:ft.name})]},ft==null?void 0:ft.id)})})})]}),F==="generate"?i.jsx($yt,{loading:f,genWalletSuccess:N,genWalletData:l,showPrivateKey:w,genWalletName:u,setGenWalletName:d,errorMessage:g,setShowPrivateKey:C,setErrorMessage:v,setLoading:x,setGenWalletData:c,setGenWalletSuccess:I,handleListRequest:n,handlePageChange:r}):F==="agent"?i.jsx(Uyt,{agentWalletData:ne,setAgentWalletData:J,agentWalletName:Z,setAgentWalletName:re,errorAgentMessage:he,setErrorAgentMessage:Y,loadingAgent:ie,setLoadingAgent:oe,handleListRequest:n,handlePageChange:r,agentWalletAddress:G,setAgentWalletAddress:V,agentWalletPkey:ee,setAgentWalletPkey:ae}):F==="account"?i.jsx(P6t,{errorConnectMessage:fe,setErrorConnectMessage:Ae,loadingConnect:ce,setLoadingConnect:ye,handleListRequest:n,handlePageChange:r,isBalanceValue:je,isBalanceLoading:Ne,isAgentInfoLoading:Re,isAgentInfoValue:Be,handleAgentWalletInfo:Xe,isBuilderFeeLoading:Ut,isBuilderFeeValue:tn,refreshAgent:Ke,handleBuilderFeeInfo:Ve,isLighterInfoValue:tt,handleLighterWalletInfo:Vt,isExtendedInfoValue:dt,handleExtendedWalletInfo:Yt}):""]})})})})})]})]})}var Yd="top",tp="bottom",np="right",Xd="left",Tae="auto",qk=[Yd,tp,np,Xd],WS="start",yE="end",F6t="clippingParents",BIe="viewport",N7="popper",O6t="reference",gxe=qk.reduce(function(e,t){return e.concat([t+"-"+WS,t+"-"+yE])},[]),$Ie=[].concat(qk,[Tae]).reduce(function(e,t){return e.concat([t,t+"-"+WS,t+"-"+yE])},[]),M6t="beforeRead",R6t="read",L6t="afterRead",D6t="beforeMain",B6t="main",$6t="afterMain",U6t="beforeWrite",z6t="write",H6t="afterWrite",V6t=[M6t,R6t,L6t,D6t,B6t,$6t,U6t,z6t,H6t];function Y0(e){return e?(e.nodeName||"").toLowerCase():null}function $f(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function I3(e){var t=$f(e).Element;return e instanceof t||e instanceof Element}function Gh(e){var t=$f(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Iae(e){if(typeof ShadowRoot>"u")return!1;var t=$f(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function W6t(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},s=t.attributes[n]||{},a=t.elements[n];!Gh(a)||!Y0(a)||(Object.assign(a.style,r),Object.keys(s).forEach(function(o){var l=s[o];l===!1?a.removeAttribute(o):a.setAttribute(o,l===!0?"":l)}))})}function q6t(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var s=t.elements[r],a=t.attributes[r]||{},o=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),l=o.reduce(function(c,u){return c[u]="",c},{});!Gh(s)||!Y0(s)||(Object.assign(s.style,l),Object.keys(a).forEach(function(c){s.removeAttribute(c)}))})}}const UIe={name:"applyStyles",enabled:!0,phase:"write",fn:W6t,effect:q6t,requires:["computeStyles"]};function F0(e){return e.split("-")[0]}var Kw=Math.max,FM=Math.min,qS=Math.round;function ree(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function zIe(){return!/^((?!chrome|android).)*safari/i.test(ree())}function GS(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),s=1,a=1;t&&Gh(e)&&(s=e.offsetWidth>0&&qS(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&qS(r.height)/e.offsetHeight||1);var o=I3(e)?$f(e):window,l=o.visualViewport,c=!zIe()&&n,u=(r.left+(c&&l?l.offsetLeft:0))/s,d=(r.top+(c&&l?l.offsetTop:0))/a,f=r.width/s,x=r.height/a;return{width:f,height:x,top:d,right:u+f,bottom:d+x,left:u,x:u,y:d}}function Pae(e){var t=GS(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function HIe(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Iae(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function i1(e){return $f(e).getComputedStyle(e)}function G6t(e){return["table","td","th"].indexOf(Y0(e))>=0}function s2(e){return((I3(e)?e.ownerDocument:e.document)||window.document).documentElement}function qB(e){return Y0(e)==="html"?e:e.assignedSlot||e.parentNode||(Iae(e)?e.host:null)||s2(e)}function bxe(e){return!Gh(e)||i1(e).position==="fixed"?null:e.offsetParent}function K6t(e){var t=/firefox/i.test(ree()),n=/Trident/i.test(ree());if(n&&Gh(e)){var r=i1(e);if(r.position==="fixed")return null}var s=qB(e);for(Iae(s)&&(s=s.host);Gh(s)&&["html","body"].indexOf(Y0(s))<0;){var a=i1(s);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return s;s=s.parentNode}return null}function Gk(e){for(var t=$f(e),n=bxe(e);n&&G6t(n)&&i1(n).position==="static";)n=bxe(n);return n&&(Y0(n)==="html"||Y0(n)==="body"&&i1(n).position==="static")?t:n||K6t(e)||t}function Fae(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function qj(e,t,n){return Kw(e,FM(t,n))}function Y6t(e,t,n){var r=qj(e,t,n);return r>n?n:r}function VIe(){return{top:0,right:0,bottom:0,left:0}}function WIe(e){return Object.assign({},VIe(),e)}function qIe(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var X6t=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,WIe(typeof t!="number"?t:qIe(t,qk))};function Q6t(e){var t,n=e.state,r=e.name,s=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,l=F0(n.placement),c=Fae(l),u=[Xd,np].indexOf(l)>=0,d=u?"height":"width";if(!(!a||!o)){var f=X6t(s.padding,n),x=Pae(a),g=c==="y"?Yd:Xd,v=c==="y"?tp:np,w=n.rects.reference[d]+n.rects.reference[c]-o[c]-n.rects.popper[d],C=o[c]-n.rects.reference[c],N=Gk(a),I=N?c==="y"?N.clientHeight||0:N.clientWidth||0:0,P=w/2-C/2,R=f[g],F=I-x[d]-f[v],U=I/2-x[d]/2+P,L=qj(R,U,F),z=c;n.modifiersData[r]=(t={},t[z]=L,t.centerOffset=L-U,t)}}function Z6t(e){var t=e.state,n=e.options,r=n.element,s=r===void 0?"[data-popper-arrow]":r;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||HIe(t.elements.popper,s)&&(t.elements.arrow=s))}const J6t={name:"arrow",enabled:!0,phase:"main",fn:Q6t,effect:Z6t,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function KS(e){return e.split("-")[1]}var eCt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function tCt(e,t){var n=e.x,r=e.y,s=t.devicePixelRatio||1;return{x:qS(n*s)/s||0,y:qS(r*s)/s||0}}function yxe(e){var t,n=e.popper,r=e.popperRect,s=e.placement,a=e.variation,o=e.offsets,l=e.position,c=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,f=e.isFixed,x=o.x,g=x===void 0?0:x,v=o.y,w=v===void 0?0:v,C=typeof d=="function"?d({x:g,y:w}):{x:g,y:w};g=C.x,w=C.y;var N=o.hasOwnProperty("x"),I=o.hasOwnProperty("y"),P=Xd,R=Yd,F=window;if(u){var U=Gk(n),L="clientHeight",z="clientWidth";if(U===$f(n)&&(U=s2(n),i1(U).position!=="static"&&l==="absolute"&&(L="scrollHeight",z="scrollWidth")),U=U,s===Yd||(s===Xd||s===np)&&a===yE){R=tp;var X=f&&U===F&&F.visualViewport?F.visualViewport.height:U[L];w-=X-r.height,w*=c?1:-1}if(s===Xd||(s===Yd||s===tp)&&a===yE){P=np;var ne=f&&U===F&&F.visualViewport?F.visualViewport.width:U[z];g-=ne-r.width,g*=c?1:-1}}var J=Object.assign({position:l},u&&eCt),Z=d===!0?tCt({x:g,y:w},$f(n)):{x:g,y:w};if(g=Z.x,w=Z.y,c){var re;return Object.assign({},J,(re={},re[R]=I?"0":"",re[P]=N?"0":"",re.transform=(F.devicePixelRatio||1)<=1?"translate("+g+"px, "+w+"px)":"translate3d("+g+"px, "+w+"px, 0)",re))}return Object.assign({},J,(t={},t[R]=I?w+"px":"",t[P]=N?g+"px":"",t.transform="",t))}function nCt(e){var t=e.state,n=e.options,r=n.gpuAcceleration,s=r===void 0?!0:r,a=n.adaptive,o=a===void 0?!0:a,l=n.roundOffsets,c=l===void 0?!0:l,u={placement:F0(t.placement),variation:KS(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,yxe(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,yxe(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const rCt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:nCt,data:{}};var iP={passive:!0};function sCt(e){var t=e.state,n=e.instance,r=e.options,s=r.scroll,a=s===void 0?!0:s,o=r.resize,l=o===void 0?!0:o,c=$f(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&u.forEach(function(d){d.addEventListener("scroll",n.update,iP)}),l&&c.addEventListener("resize",n.update,iP),function(){a&&u.forEach(function(d){d.removeEventListener("scroll",n.update,iP)}),l&&c.removeEventListener("resize",n.update,iP)}}const iCt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:sCt,data:{}};var aCt={left:"right",right:"left",bottom:"top",top:"bottom"};function aO(e){return e.replace(/left|right|bottom|top/g,function(t){return aCt[t]})}var oCt={start:"end",end:"start"};function vxe(e){return e.replace(/start|end/g,function(t){return oCt[t]})}function Oae(e){var t=$f(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Mae(e){return GS(s2(e)).left+Oae(e).scrollLeft}function lCt(e,t){var n=$f(e),r=s2(e),s=n.visualViewport,a=r.clientWidth,o=r.clientHeight,l=0,c=0;if(s){a=s.width,o=s.height;var u=zIe();(u||!u&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:a,height:o,x:l+Mae(e),y:c}}function cCt(e){var t,n=s2(e),r=Oae(e),s=(t=e.ownerDocument)==null?void 0:t.body,a=Kw(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Kw(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),l=-r.scrollLeft+Mae(e),c=-r.scrollTop;return i1(s||n).direction==="rtl"&&(l+=Kw(n.clientWidth,s?s.clientWidth:0)-a),{width:a,height:o,x:l,y:c}}function Rae(e){var t=i1(e),n=t.overflow,r=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+r)}function GIe(e){return["html","body","#document"].indexOf(Y0(e))>=0?e.ownerDocument.body:Gh(e)&&Rae(e)?e:GIe(qB(e))}function Gj(e,t){var n;t===void 0&&(t=[]);var r=GIe(e),s=r===((n=e.ownerDocument)==null?void 0:n.body),a=$f(r),o=s?[a].concat(a.visualViewport||[],Rae(r)?r:[]):r,l=t.concat(o);return s?l:l.concat(Gj(qB(o)))}function see(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function uCt(e,t){var n=GS(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function wxe(e,t,n){return t===BIe?see(lCt(e,n)):I3(t)?uCt(t,n):see(cCt(s2(e)))}function dCt(e){var t=Gj(qB(e)),n=["absolute","fixed"].indexOf(i1(e).position)>=0,r=n&&Gh(e)?Gk(e):e;return I3(r)?t.filter(function(s){return I3(s)&&HIe(s,r)&&Y0(s)!=="body"}):[]}function fCt(e,t,n,r){var s=t==="clippingParents"?dCt(e):[].concat(t),a=[].concat(s,[n]),o=a[0],l=a.reduce(function(c,u){var d=wxe(e,u,r);return c.top=Kw(d.top,c.top),c.right=FM(d.right,c.right),c.bottom=FM(d.bottom,c.bottom),c.left=Kw(d.left,c.left),c},wxe(e,o,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function KIe(e){var t=e.reference,n=e.element,r=e.placement,s=r?F0(r):null,a=r?KS(r):null,o=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,c;switch(s){case Yd:c={x:o,y:t.y-n.height};break;case tp:c={x:o,y:t.y+t.height};break;case np:c={x:t.x+t.width,y:l};break;case Xd:c={x:t.x-n.width,y:l};break;default:c={x:t.x,y:t.y}}var u=s?Fae(s):null;if(u!=null){var d=u==="y"?"height":"width";switch(a){case WS:c[u]=c[u]-(t[d]/2-n[d]/2);break;case yE:c[u]=c[u]+(t[d]/2-n[d]/2);break}}return c}function vE(e,t){t===void 0&&(t={});var n=t,r=n.placement,s=r===void 0?e.placement:r,a=n.strategy,o=a===void 0?e.strategy:a,l=n.boundary,c=l===void 0?F6t:l,u=n.rootBoundary,d=u===void 0?BIe:u,f=n.elementContext,x=f===void 0?N7:f,g=n.altBoundary,v=g===void 0?!1:g,w=n.padding,C=w===void 0?0:w,N=WIe(typeof C!="number"?C:qIe(C,qk)),I=x===N7?O6t:N7,P=e.rects.popper,R=e.elements[v?I:x],F=fCt(I3(R)?R:R.contextElement||s2(e.elements.popper),c,d,o),U=GS(e.elements.reference),L=KIe({reference:U,element:P,strategy:"absolute",placement:s}),z=see(Object.assign({},P,L)),X=x===N7?z:U,ne={top:F.top-X.top+N.top,bottom:X.bottom-F.bottom+N.bottom,left:F.left-X.left+N.left,right:X.right-F.right+N.right},J=e.modifiersData.offset;if(x===N7&&J){var Z=J[s];Object.keys(ne).forEach(function(re){var he=[np,tp].indexOf(re)>=0?1:-1,Y=[Yd,tp].indexOf(re)>=0?"y":"x";ne[re]+=Z[Y]*he})}return ne}function hCt(e,t){t===void 0&&(t={});var n=t,r=n.placement,s=n.boundary,a=n.rootBoundary,o=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,u=c===void 0?$Ie:c,d=KS(r),f=d?l?gxe:gxe.filter(function(v){return KS(v)===d}):qk,x=f.filter(function(v){return u.indexOf(v)>=0});x.length===0&&(x=f);var g=x.reduce(function(v,w){return v[w]=vE(e,{placement:w,boundary:s,rootBoundary:a,padding:o})[F0(w)],v},{});return Object.keys(g).sort(function(v,w){return g[v]-g[w]})}function pCt(e){if(F0(e)===Tae)return[];var t=aO(e);return[vxe(e),t,vxe(t)]}function mCt(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var s=n.mainAxis,a=s===void 0?!0:s,o=n.altAxis,l=o===void 0?!0:o,c=n.fallbackPlacements,u=n.padding,d=n.boundary,f=n.rootBoundary,x=n.altBoundary,g=n.flipVariations,v=g===void 0?!0:g,w=n.allowedAutoPlacements,C=t.options.placement,N=F0(C),I=N===C,P=c||(I||!v?[aO(C)]:pCt(C)),R=[C].concat(P).reduce(function(ce,ye){return ce.concat(F0(ye)===Tae?hCt(t,{placement:ye,boundary:d,rootBoundary:f,padding:u,flipVariations:v,allowedAutoPlacements:w}):ye)},[]),F=t.rects.reference,U=t.rects.popper,L=new Map,z=!0,X=R[0],ne=0;ne<R.length;ne++){var J=R[ne],Z=F0(J),re=KS(J)===WS,he=[Yd,tp].indexOf(Z)>=0,Y=he?"width":"height",ie=vE(t,{placement:J,boundary:d,rootBoundary:f,altBoundary:x,padding:u}),oe=he?re?np:Xd:re?tp:Yd;F[Y]>U[Y]&&(oe=aO(oe));var G=aO(oe),V=[];if(a&&V.push(ie[Z]<=0),l&&V.push(ie[oe]<=0,ie[G]<=0),V.every(function(ce){return ce})){X=J,z=!1;break}L.set(J,V)}if(z)for(var ee=v?3:1,ae=function(ye){var Ne=R.find(function(be){var je=L.get(be);if(je)return je.slice(0,ye).every(function(Ie){return Ie})});if(Ne)return X=Ne,"break"},fe=ee;fe>0;fe--){var Ae=ae(fe);if(Ae==="break")break}t.placement!==X&&(t.modifiersData[r]._skip=!0,t.placement=X,t.reset=!0)}}const xCt={name:"flip",enabled:!0,phase:"main",fn:mCt,requiresIfExists:["offset"],data:{_skip:!1}};function Cxe(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Sxe(e){return[Yd,np,tp,Xd].some(function(t){return e[t]>=0})}function gCt(e){var t=e.state,n=e.name,r=t.rects.reference,s=t.rects.popper,a=t.modifiersData.preventOverflow,o=vE(t,{elementContext:"reference"}),l=vE(t,{altBoundary:!0}),c=Cxe(o,r),u=Cxe(l,s,a),d=Sxe(c),f=Sxe(u);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}const bCt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:gCt};function yCt(e,t,n){var r=F0(e),s=[Xd,Yd].indexOf(r)>=0?-1:1,a=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=a[0],l=a[1];return o=o||0,l=(l||0)*s,[Xd,np].indexOf(r)>=0?{x:l,y:o}:{x:o,y:l}}function vCt(e){var t=e.state,n=e.options,r=e.name,s=n.offset,a=s===void 0?[0,0]:s,o=$Ie.reduce(function(d,f){return d[f]=yCt(f,t.rects,a),d},{}),l=o[t.placement],c=l.x,u=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=o}const wCt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:vCt};function CCt(e){var t=e.state,n=e.name;t.modifiersData[n]=KIe({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const SCt={name:"popperOffsets",enabled:!0,phase:"read",fn:CCt,data:{}};function NCt(e){return e==="x"?"y":"x"}function ACt(e){var t=e.state,n=e.options,r=e.name,s=n.mainAxis,a=s===void 0?!0:s,o=n.altAxis,l=o===void 0?!1:o,c=n.boundary,u=n.rootBoundary,d=n.altBoundary,f=n.padding,x=n.tether,g=x===void 0?!0:x,v=n.tetherOffset,w=v===void 0?0:v,C=vE(t,{boundary:c,rootBoundary:u,padding:f,altBoundary:d}),N=F0(t.placement),I=KS(t.placement),P=!I,R=Fae(N),F=NCt(R),U=t.modifiersData.popperOffsets,L=t.rects.reference,z=t.rects.popper,X=typeof w=="function"?w(Object.assign({},t.rects,{placement:t.placement})):w,ne=typeof X=="number"?{mainAxis:X,altAxis:X}:Object.assign({mainAxis:0,altAxis:0},X),J=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,Z={x:0,y:0};if(U){if(a){var re,he=R==="y"?Yd:Xd,Y=R==="y"?tp:np,ie=R==="y"?"height":"width",oe=U[R],G=oe+C[he],V=oe-C[Y],ee=g?-z[ie]/2:0,ae=I===WS?L[ie]:z[ie],fe=I===WS?-z[ie]:-L[ie],Ae=t.elements.arrow,ce=g&&Ae?Pae(Ae):{width:0,height:0},ye=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:VIe(),Ne=ye[he],be=ye[Y],je=qj(0,L[ie],ce[ie]),Ie=P?L[ie]/2-ee-je-Ne-ne.mainAxis:ae-je-Ne-ne.mainAxis,Re=P?-L[ie]/2+ee+je+be+ne.mainAxis:fe+je+be+ne.mainAxis,Qe=t.elements.arrow&&Gk(t.elements.arrow),Be=Qe?R==="y"?Qe.clientTop||0:Qe.clientLeft||0:0,it=(re=J==null?void 0:J[R])!=null?re:0,tt=oe+Ie-it-Be,at=oe+Re-it,dt=qj(g?FM(G,tt):G,oe,g?Kw(V,at):V);U[R]=dt,Z[R]=dt-oe}if(l){var ct,Ut=R==="x"?Yd:Xd,kt=R==="x"?tp:np,tn=U[F],jt=F==="y"?"height":"width",un=tn+C[Ut],cn=tn-C[kt],Pt=[Yd,Xd].indexOf(N)!==-1,Xe=(ct=J==null?void 0:J[F])!=null?ct:0,Vt=Pt?un:tn-L[jt]-z[jt]-Xe+ne.altAxis,Yt=Pt?tn+L[jt]+z[jt]-Xe-ne.altAxis:cn,Ve=g&&Pt?Y6t(Vt,tn,Yt):qj(g?Vt:un,tn,g?Yt:cn);U[F]=Ve,Z[F]=Ve-tn}t.modifiersData[r]=Z}}const jCt={name:"preventOverflow",enabled:!0,phase:"main",fn:ACt,requiresIfExists:["offset"]};function ECt(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function _Ct(e){return e===$f(e)||!Gh(e)?Oae(e):ECt(e)}function kCt(e){var t=e.getBoundingClientRect(),n=qS(t.width)/e.offsetWidth||1,r=qS(t.height)/e.offsetHeight||1;return n!==1||r!==1}function TCt(e,t,n){n===void 0&&(n=!1);var r=Gh(t),s=Gh(t)&&kCt(t),a=s2(t),o=GS(e,s,n),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((Y0(t)!=="body"||Rae(a))&&(l=_Ct(t)),Gh(t)?(c=GS(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=Mae(a))),{x:o.left+l.scrollLeft-c.x,y:o.top+l.scrollTop-c.y,width:o.width,height:o.height}}function ICt(e){var t=new Map,n=new Set,r=[];e.forEach(function(a){t.set(a.name,a)});function s(a){n.add(a.name);var o=[].concat(a.requires||[],a.requiresIfExists||[]);o.forEach(function(l){if(!n.has(l)){var c=t.get(l);c&&s(c)}}),r.push(a)}return e.forEach(function(a){n.has(a.name)||s(a)}),r}function PCt(e){var t=ICt(e);return V6t.reduce(function(n,r){return n.concat(t.filter(function(s){return s.phase===r}))},[])}function FCt(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function OCt(e){var t=e.reduce(function(n,r){var s=n[r.name];return n[r.name]=s?Object.assign({},s,r,{options:Object.assign({},s.options,r.options),data:Object.assign({},s.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Nxe={placement:"bottom",modifiers:[],strategy:"absolute"};function Axe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function MCt(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,s=t.defaultOptions,a=s===void 0?Nxe:s;return function(l,c,u){u===void 0&&(u=a);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},Nxe,a),modifiersData:{},elements:{reference:l,popper:c},attributes:{},styles:{}},f=[],x=!1,g={state:d,setOptions:function(N){var I=typeof N=="function"?N(d.options):N;w(),d.options=Object.assign({},a,d.options,I),d.scrollParents={reference:I3(l)?Gj(l):l.contextElement?Gj(l.contextElement):[],popper:Gj(c)};var P=PCt(OCt([].concat(r,d.options.modifiers)));return d.orderedModifiers=P.filter(function(R){return R.enabled}),v(),g.update()},forceUpdate:function(){if(!x){var N=d.elements,I=N.reference,P=N.popper;if(Axe(I,P)){d.rects={reference:TCt(I,Gk(P),d.options.strategy==="fixed"),popper:Pae(P)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(ne){return d.modifiersData[ne.name]=Object.assign({},ne.data)});for(var R=0;R<d.orderedModifiers.length;R++){if(d.reset===!0){d.reset=!1,R=-1;continue}var F=d.orderedModifiers[R],U=F.fn,L=F.options,z=L===void 0?{}:L,X=F.name;typeof U=="function"&&(d=U({state:d,options:z,name:X,instance:g})||d)}}}},update:FCt(function(){return new Promise(function(C){g.forceUpdate(),C(d)})}),destroy:function(){w(),x=!0}};if(!Axe(l,c))return g;g.setOptions(u).then(function(C){!x&&u.onFirstUpdate&&u.onFirstUpdate(C)});function v(){d.orderedModifiers.forEach(function(C){var N=C.name,I=C.options,P=I===void 0?{}:I,R=C.effect;if(typeof R=="function"){var F=R({state:d,name:N,instance:g,options:P}),U=function(){};f.push(F||U)}})}function w(){f.forEach(function(C){return C()}),f=[]}return g}}var RCt=[iCt,SCt,rCt,UIe,wCt,xCt,jCt,J6t,bCt],LCt=MCt({defaultModifiers:RCt}),DCt="tippy-box",YIe="tippy-content",BCt="tippy-backdrop",XIe="tippy-arrow",QIe="tippy-svg-arrow",Sv={passive:!0,capture:!0},ZIe=function(){return document.body};function tV(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function Lae(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function JIe(e,t){return typeof e=="function"?e.apply(void 0,t):e}function jxe(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function $Ct(e){return e.split(/\s+/).filter(Boolean)}function yC(e){return[].concat(e)}function Exe(e,t){e.indexOf(t)===-1&&e.push(t)}function UCt(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function zCt(e){return e.split("-")[0]}function OM(e){return[].slice.call(e)}function _xe(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function Kj(){return document.createElement("div")}function GB(e){return["Element","Fragment"].some(function(t){return Lae(e,t)})}function HCt(e){return Lae(e,"NodeList")}function ePe(e){return Lae(e,"MouseEvent")}function VCt(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function WCt(e){return GB(e)?[e]:HCt(e)?OM(e):Array.isArray(e)?e:OM(document.querySelectorAll(e))}function nV(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function kxe(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function tPe(e){var t,n=yC(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function qCt(e,t){var n=t.clientX,r=t.clientY;return e.every(function(s){var a=s.popperRect,o=s.popperState,l=s.props,c=l.interactiveBorder,u=zCt(o.placement),d=o.modifiersData.offset;if(!d)return!0;var f=u==="bottom"?d.top.y:0,x=u==="top"?d.bottom.y:0,g=u==="right"?d.left.x:0,v=u==="left"?d.right.x:0,w=a.top-r+f>c,C=r-a.bottom-x>c,N=a.left-n+g>c,I=n-a.right-v>c;return w||C||N||I})}function rV(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(s){e[r](s,n)})}function Txe(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var h0={isTouch:!1},Ixe=0;function GCt(){h0.isTouch||(h0.isTouch=!0,window.performance&&document.addEventListener("mousemove",nPe))}function nPe(){var e=performance.now();e-Ixe<20&&(h0.isTouch=!1,document.removeEventListener("mousemove",nPe)),Ixe=e}function KCt(){var e=document.activeElement;if(VCt(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function YCt(){document.addEventListener("touchstart",GCt,Sv),window.addEventListener("blur",KCt)}var XCt=typeof window<"u"&&typeof document<"u",QCt=XCt?!!window.msCrypto:!1,ZCt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},JCt={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Zp=Object.assign({appendTo:ZIe,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},ZCt,JCt),e4t=Object.keys(Zp),t4t=function(t){var n=Object.keys(t);n.forEach(function(r){Zp[r]=t[r]})};function rPe(e){var t=e.plugins||[],n=t.reduce(function(r,s){var a=s.name,o=s.defaultValue;if(a){var l;r[a]=e[a]!==void 0?e[a]:(l=Zp[a])!=null?l:o}return r},{});return Object.assign({},e,n)}function n4t(e,t){var n=t?Object.keys(rPe(Object.assign({},Zp,{plugins:t}))):e4t,r=n.reduce(function(s,a){var o=(e.getAttribute("data-tippy-"+a)||"").trim();if(!o)return s;if(a==="content")s[a]=o;else try{s[a]=JSON.parse(o)}catch{s[a]=o}return s},{});return r}function Pxe(e,t){var n=Object.assign({},t,{content:JIe(t.content,[e])},t.ignoreAttributes?{}:n4t(e,t.plugins));return n.aria=Object.assign({},Zp.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}var r4t=function(){return"innerHTML"};function iee(e,t){e[r4t()]=t}function Fxe(e){var t=Kj();return e===!0?t.className=XIe:(t.className=QIe,GB(e)?t.appendChild(e):iee(t,e)),t}function Oxe(e,t){GB(t.content)?(iee(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?iee(e,t.content):e.textContent=t.content)}function aee(e){var t=e.firstElementChild,n=OM(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(YIe)}),arrow:n.find(function(r){return r.classList.contains(XIe)||r.classList.contains(QIe)}),backdrop:n.find(function(r){return r.classList.contains(BCt)})}}function sPe(e){var t=Kj(),n=Kj();n.className=DCt,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Kj();r.className=YIe,r.setAttribute("data-state","hidden"),Oxe(r,e.props),t.appendChild(n),n.appendChild(r),s(e.props,e.props);function s(a,o){var l=aee(t),c=l.box,u=l.content,d=l.arrow;o.theme?c.setAttribute("data-theme",o.theme):c.removeAttribute("data-theme"),typeof o.animation=="string"?c.setAttribute("data-animation",o.animation):c.removeAttribute("data-animation"),o.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?c.setAttribute("role",o.role):c.removeAttribute("role"),(a.content!==o.content||a.allowHTML!==o.allowHTML)&&Oxe(u,e.props),o.arrow?d?a.arrow!==o.arrow&&(c.removeChild(d),c.appendChild(Fxe(o.arrow))):c.appendChild(Fxe(o.arrow)):d&&c.removeChild(d)}return{popper:t,onUpdate:s}}sPe.$$tippy=!0;var s4t=1,aP=[],sV=[];function i4t(e,t){var n=Pxe(e,Object.assign({},Zp,rPe(_xe(t)))),r,s,a,o=!1,l=!1,c=!1,u=!1,d,f,x,g=[],v=jxe(tt,n.interactiveDebounce),w,C=s4t++,N=null,I=UCt(n.plugins),P={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},R={id:C,reference:e,popper:Kj(),popperInstance:N,props:n,state:P,plugins:I,clearDelayTimeouts:Vt,setProps:Yt,setContent:Ve,show:Ke,hide:ft,hideWithInteractivity:en,enable:Pt,disable:Xe,unmount:Dt,destroy:At};if(!n.render)return R;var F=n.render(R),U=F.popper,L=F.onUpdate;U.setAttribute("data-tippy-root",""),U.id="tippy-"+R.id,R.popper=U,e._tippy=R,U._tippy=R;var z=I.map(function(Je){return Je.fn(R)}),X=e.hasAttribute("aria-expanded");return Qe(),ee(),oe(),G("onCreate",[R]),n.showOnCreate&&un(),U.addEventListener("mouseenter",function(){R.props.interactive&&R.state.isVisible&&R.clearDelayTimeouts()}),U.addEventListener("mouseleave",function(){R.props.interactive&&R.props.trigger.indexOf("mouseenter")>=0&&he().addEventListener("mousemove",v)}),R;function ne(){var Je=R.props.touch;return Array.isArray(Je)?Je:[Je,0]}function J(){return ne()[0]==="hold"}function Z(){var Je;return!!((Je=R.props.render)!=null&&Je.$$tippy)}function re(){return w||e}function he(){var Je=re().parentNode;return Je?tPe(Je):document}function Y(){return aee(U)}function ie(Je){return R.state.isMounted&&!R.state.isVisible||h0.isTouch||d&&d.type==="focus"?0:tV(R.props.delay,Je?0:1,Zp.delay)}function oe(Je){Je===void 0&&(Je=!1),U.style.pointerEvents=R.props.interactive&&!Je?"":"none",U.style.zIndex=""+R.props.zIndex}function G(Je,He,Rt){if(Rt===void 0&&(Rt=!0),z.forEach(function(lt){lt[Je]&&lt[Je].apply(lt,He)}),Rt){var qe;(qe=R.props)[Je].apply(qe,He)}}function V(){var Je=R.props.aria;if(Je.content){var He="aria-"+Je.content,Rt=U.id,qe=yC(R.props.triggerTarget||e);qe.forEach(function(lt){var xt=lt.getAttribute(He);if(R.state.isVisible)lt.setAttribute(He,xt?xt+" "+Rt:Rt);else{var Nt=xt&&xt.replace(Rt,"").trim();Nt?lt.setAttribute(He,Nt):lt.removeAttribute(He)}})}}function ee(){if(!(X||!R.props.aria.expanded)){var Je=yC(R.props.triggerTarget||e);Je.forEach(function(He){R.props.interactive?He.setAttribute("aria-expanded",R.state.isVisible&&He===re()?"true":"false"):He.removeAttribute("aria-expanded")})}}function ae(){he().removeEventListener("mousemove",v),aP=aP.filter(function(Je){return Je!==v})}function fe(Je){if(!(h0.isTouch&&(c||Je.type==="mousedown"))){var He=Je.composedPath&&Je.composedPath()[0]||Je.target;if(!(R.props.interactive&&Txe(U,He))){if(yC(R.props.triggerTarget||e).some(function(Rt){return Txe(Rt,He)})){if(h0.isTouch||R.state.isVisible&&R.props.trigger.indexOf("click")>=0)return}else G("onClickOutside",[R,Je]);R.props.hideOnClick===!0&&(R.clearDelayTimeouts(),R.hide(),l=!0,setTimeout(function(){l=!1}),R.state.isMounted||Ne())}}}function Ae(){c=!0}function ce(){c=!1}function ye(){var Je=he();Je.addEventListener("mousedown",fe,!0),Je.addEventListener("touchend",fe,Sv),Je.addEventListener("touchstart",ce,Sv),Je.addEventListener("touchmove",Ae,Sv)}function Ne(){var Je=he();Je.removeEventListener("mousedown",fe,!0),Je.removeEventListener("touchend",fe,Sv),Je.removeEventListener("touchstart",ce,Sv),Je.removeEventListener("touchmove",Ae,Sv)}function be(Je,He){Ie(Je,function(){!R.state.isVisible&&U.parentNode&&U.parentNode.contains(U)&&He()})}function je(Je,He){Ie(Je,He)}function Ie(Je,He){var Rt=Y().box;function qe(lt){lt.target===Rt&&(rV(Rt,"remove",qe),He())}if(Je===0)return He();rV(Rt,"remove",f),rV(Rt,"add",qe),f=qe}function Re(Je,He,Rt){Rt===void 0&&(Rt=!1);var qe=yC(R.props.triggerTarget||e);qe.forEach(function(lt){lt.addEventListener(Je,He,Rt),g.push({node:lt,eventType:Je,handler:He,options:Rt})})}function Qe(){J()&&(Re("touchstart",it,{passive:!0}),Re("touchend",at,{passive:!0})),$Ct(R.props.trigger).forEach(function(Je){if(Je!=="manual")switch(Re(Je,it),Je){case"mouseenter":Re("mouseleave",at);break;case"focus":Re(QCt?"focusout":"blur",dt);break;case"focusin":Re("focusout",dt);break}})}function Be(){g.forEach(function(Je){var He=Je.node,Rt=Je.eventType,qe=Je.handler,lt=Je.options;He.removeEventListener(Rt,qe,lt)}),g=[]}function it(Je){var He,Rt=!1;if(!(!R.state.isEnabled||ct(Je)||l)){var qe=((He=d)==null?void 0:He.type)==="focus";d=Je,w=Je.currentTarget,ee(),!R.state.isVisible&&ePe(Je)&&aP.forEach(function(lt){return lt(Je)}),Je.type==="click"&&(R.props.trigger.indexOf("mouseenter")<0||o)&&R.props.hideOnClick!==!1&&R.state.isVisible?Rt=!0:un(Je),Je.type==="click"&&(o=!Rt),Rt&&!qe&&cn(Je)}}function tt(Je){var He=Je.target,Rt=re().contains(He)||U.contains(He);if(!(Je.type==="mousemove"&&Rt)){var qe=jt().concat(U).map(function(lt){var xt,Nt=lt._tippy,It=(xt=Nt.popperInstance)==null?void 0:xt.state;return It?{popperRect:lt.getBoundingClientRect(),popperState:It,props:n}:null}).filter(Boolean);qCt(qe,Je)&&(ae(),cn(Je))}}function at(Je){var He=ct(Je)||R.props.trigger.indexOf("click")>=0&&o;if(!He){if(R.props.interactive){R.hideWithInteractivity(Je);return}cn(Je)}}function dt(Je){R.props.trigger.indexOf("focusin")<0&&Je.target!==re()||R.props.interactive&&Je.relatedTarget&&U.contains(Je.relatedTarget)||cn(Je)}function ct(Je){return h0.isTouch?J()!==Je.type.indexOf("touch")>=0:!1}function Ut(){kt();var Je=R.props,He=Je.popperOptions,Rt=Je.placement,qe=Je.offset,lt=Je.getReferenceClientRect,xt=Je.moveTransition,Nt=Z()?aee(U).arrow:null,It=lt?{getBoundingClientRect:lt,contextElement:lt.contextElement||re()}:e,xn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(_n){var kn=_n.state;if(Z()){var vn=Y(),Qn=vn.box;["placement","reference-hidden","escaped"].forEach(function(Hn){Hn==="placement"?Qn.setAttribute("data-placement",kn.placement):kn.attributes.popper["data-popper-"+Hn]?Qn.setAttribute("data-"+Hn,""):Qn.removeAttribute("data-"+Hn)}),kn.attributes.popper={}}}},dn=[{name:"offset",options:{offset:qe}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!xt}},xn];Z()&&Nt&&dn.push({name:"arrow",options:{element:Nt,padding:3}}),dn.push.apply(dn,(He==null?void 0:He.modifiers)||[]),R.popperInstance=LCt(It,U,Object.assign({},He,{placement:Rt,onFirstUpdate:x,modifiers:dn}))}function kt(){R.popperInstance&&(R.popperInstance.destroy(),R.popperInstance=null)}function tn(){var Je=R.props.appendTo,He,Rt=re();R.props.interactive&&Je===ZIe||Je==="parent"?He=Rt.parentNode:He=JIe(Je,[Rt]),He.contains(U)||He.appendChild(U),R.state.isMounted=!0,Ut()}function jt(){return OM(U.querySelectorAll("[data-tippy-root]"))}function un(Je){R.clearDelayTimeouts(),Je&&G("onTrigger",[R,Je]),ye();var He=ie(!0),Rt=ne(),qe=Rt[0],lt=Rt[1];h0.isTouch&&qe==="hold"&&lt&&(He=lt),He?r=setTimeout(function(){R.show()},He):R.show()}function cn(Je){if(R.clearDelayTimeouts(),G("onUntrigger",[R,Je]),!R.state.isVisible){Ne();return}if(!(R.props.trigger.indexOf("mouseenter")>=0&&R.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(Je.type)>=0&&o)){var He=ie(!1);He?s=setTimeout(function(){R.state.isVisible&&R.hide()},He):a=requestAnimationFrame(function(){R.hide()})}}function Pt(){R.state.isEnabled=!0}function Xe(){R.hide(),R.state.isEnabled=!1}function Vt(){clearTimeout(r),clearTimeout(s),cancelAnimationFrame(a)}function Yt(Je){if(!R.state.isDestroyed){G("onBeforeUpdate",[R,Je]),Be();var He=R.props,Rt=Pxe(e,Object.assign({},He,_xe(Je),{ignoreAttributes:!0}));R.props=Rt,Qe(),He.interactiveDebounce!==Rt.interactiveDebounce&&(ae(),v=jxe(tt,Rt.interactiveDebounce)),He.triggerTarget&&!Rt.triggerTarget?yC(He.triggerTarget).forEach(function(qe){qe.removeAttribute("aria-expanded")}):Rt.triggerTarget&&e.removeAttribute("aria-expanded"),ee(),oe(),L&&L(He,Rt),R.popperInstance&&(Ut(),jt().forEach(function(qe){requestAnimationFrame(qe._tippy.popperInstance.forceUpdate)})),G("onAfterUpdate",[R,Je])}}function Ve(Je){R.setProps({content:Je})}function Ke(){var Je=R.state.isVisible,He=R.state.isDestroyed,Rt=!R.state.isEnabled,qe=h0.isTouch&&!R.props.touch,lt=tV(R.props.duration,0,Zp.duration);if(!(Je||He||Rt||qe)&&!re().hasAttribute("disabled")&&(G("onShow",[R],!1),R.props.onShow(R)!==!1)){if(R.state.isVisible=!0,Z()&&(U.style.visibility="visible"),oe(),ye(),R.state.isMounted||(U.style.transition="none"),Z()){var xt=Y(),Nt=xt.box,It=xt.content;nV([Nt,It],0)}x=function(){var dn;if(!(!R.state.isVisible||u)){if(u=!0,U.offsetHeight,U.style.transition=R.props.moveTransition,Z()&&R.props.animation){var Mn=Y(),_n=Mn.box,kn=Mn.content;nV([_n,kn],lt),kxe([_n,kn],"visible")}V(),ee(),Exe(sV,R),(dn=R.popperInstance)==null||dn.forceUpdate(),G("onMount",[R]),R.props.animation&&Z()&&je(lt,function(){R.state.isShown=!0,G("onShown",[R])})}},tn()}}function ft(){var Je=!R.state.isVisible,He=R.state.isDestroyed,Rt=!R.state.isEnabled,qe=tV(R.props.duration,1,Zp.duration);if(!(Je||He||Rt)&&(G("onHide",[R],!1),R.props.onHide(R)!==!1)){if(R.state.isVisible=!1,R.state.isShown=!1,u=!1,o=!1,Z()&&(U.style.visibility="hidden"),ae(),Ne(),oe(!0),Z()){var lt=Y(),xt=lt.box,Nt=lt.content;R.props.animation&&(nV([xt,Nt],qe),kxe([xt,Nt],"hidden"))}V(),ee(),R.props.animation?Z()&&be(qe,R.unmount):R.unmount()}}function en(Je){he().addEventListener("mousemove",v),Exe(aP,v),v(Je)}function Dt(){R.state.isVisible&&R.hide(),R.state.isMounted&&(kt(),jt().forEach(function(Je){Je._tippy.unmount()}),U.parentNode&&U.parentNode.removeChild(U),sV=sV.filter(function(Je){return Je!==R}),R.state.isMounted=!1,G("onHidden",[R]))}function At(){R.state.isDestroyed||(R.clearDelayTimeouts(),R.unmount(),Be(),delete e._tippy,R.state.isDestroyed=!0,G("onDestroy",[R]))}}function Kk(e,t){t===void 0&&(t={});var n=Zp.plugins.concat(t.plugins||[]);YCt();var r=Object.assign({},t,{plugins:n}),s=WCt(e),a=s.reduce(function(o,l){var c=l&&i4t(l,r);return c&&o.push(c),o},[]);return GB(e)?a[0]:a}Kk.defaultProps=Zp;Kk.setDefaultProps=t4t;Kk.currentInput=h0;Object.assign({},UIe,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});var oee={clientX:0,clientY:0},oP=[];function iPe(e){var t=e.clientX,n=e.clientY;oee={clientX:t,clientY:n}}function a4t(e){e.addEventListener("mousemove",iPe)}function o4t(e){e.removeEventListener("mousemove",iPe)}var l4t={name:"followCursor",defaultValue:!1,fn:function(t){var n=t.reference,r=tPe(t.props.triggerTarget||n),s=!1,a=!1,o=!0,l=t.props;function c(){return t.props.followCursor==="initial"&&t.state.isVisible}function u(){r.addEventListener("mousemove",x)}function d(){r.removeEventListener("mousemove",x)}function f(){s=!0,t.setProps({getReferenceClientRect:null}),s=!1}function x(w){var C=w.target?n.contains(w.target):!0,N=t.props.followCursor,I=w.clientX,P=w.clientY,R=n.getBoundingClientRect(),F=I-R.left,U=P-R.top;(C||!t.props.interactive)&&t.setProps({getReferenceClientRect:function(){var z=n.getBoundingClientRect(),X=I,ne=P;N==="initial"&&(X=z.left+F,ne=z.top+U);var J=N==="horizontal"?z.top:ne,Z=N==="vertical"?z.right:X,re=N==="horizontal"?z.bottom:ne,he=N==="vertical"?z.left:X;return{width:Z-he,height:re-J,top:J,right:Z,bottom:re,left:he}}})}function g(){t.props.followCursor&&(oP.push({instance:t,doc:r}),a4t(r))}function v(){oP=oP.filter(function(w){return w.instance!==t}),oP.filter(function(w){return w.doc===r}).length===0&&o4t(r)}return{onCreate:g,onDestroy:v,onBeforeUpdate:function(){l=t.props},onAfterUpdate:function(C,N){var I=N.followCursor;s||I!==void 0&&l.followCursor!==I&&(v(),I?(g(),t.state.isMounted&&!a&&!c()&&u()):(d(),f()))},onMount:function(){t.props.followCursor&&!a&&(o&&(x(oee),o=!1),c()||u())},onTrigger:function(C,N){ePe(N)&&(oee={clientX:N.clientX,clientY:N.clientY}),a=N.type==="focus"},onHidden:function(){t.props.followCursor&&(f(),d(),o=!0)}}}};Kk.setDefaultProps({render:sPe});function fi({content:e,children:t,align:n="center"}){const r=m.useRef(null),s=m.useRef(null),a=m.useRef(null),o=m.useRef(null);return m.useEffect(()=>{const l=()=>{o.current.hide()},c=document.querySelectorAll("*");return c.forEach(u=>{u.addEventListener("scroll",l,{passive:!0})}),()=>{c.forEach(u=>{u.removeEventListener("scroll",l)})}},[]),m.useEffect(()=>{if(!r.current)return;const l=typeof e!="string";l&&(s.current=document.createElement("div"),a.current=FNe.createRoot(s.current),a.current.render(e));const c=Kk(r.current,{content:l?s.current:`
          <div style="
            border-radius: 12px;
            border: 0.8px solid rgba(133, 133, 133, 0.32);
            background: rgba(255, 255, 255, 0.08);
            box-shadow: 0 4px 4px 0 #050505;
            backdrop-filter: blur(43px);
            color: #FFF;
            text-align: ${n};
            font-family: Inter, sans-serif;
            font-size: 12px;
            font-style: normal;
            font-weight: 400;
            line-height: 14px;
            letter-spacing: -0.12px;
            padding: 6px 10px;
          ">
            ${e}
          </div>
        `,allowHTML:!l,followCursor:!0,plugins:[l4t],delay:[0,0],offset:[10,10],animation:"scale-subtle",duration:[50,100],placement:"top",popperOptions:{modifiers:[{name:"flip",options:{fallbackPlacements:["right","bottom","left"]}},{name:"preventOverflow",options:{padding:8}}]},interactive:!1,moveTransition:"",trigger:"mouseenter mousemove",theme:"custom",onShow(){setTimeout(()=>{window.dispatchEvent(new Event("resize"))},50)}});return o.current=c,()=>{a.current&&Promise.resolve().then(()=>{var u;(u=a.current)==null||u.unmount()})}},[e]),m.isValidElement(t)?m.cloneElement(t,{ref:r}):i.jsx("span",{ref:r,children:t})}var Vh;(function(e){e.NUMBER="NUMBER_NUMBER",e.HEX="NUMBER_HEX",e.STR="NUMBER_STR",e.BIGINT="NUMBER_BIGINT"})(Vh||(Vh={}));var a1;(function(e){e.HEX="BYTES_HEX",e.UINT8ARRAY="BYTES_UINT8ARRAY"})(a1||(a1={}));const id={number:Vh.BIGINT,bytes:a1.HEX},ui={number:Vh.HEX,bytes:a1.HEX};var Ag;(function(e){e.EARLIEST="earliest",e.LATEST="latest",e.PENDING="pending",e.SAFE="safe",e.FINALIZED="finalized",e.COMMITTED="committed"})(Ag||(Ag={}));var Yj;(function(e){e.chainstart="chainstart",e.frontier="frontier",e.homestead="homestead",e.dao="dao",e.tangerineWhistle="tangerineWhistle",e.spuriousDragon="spuriousDragon",e.byzantium="byzantium",e.constantinople="constantinople",e.petersburg="petersburg",e.istanbul="istanbul",e.muirGlacier="muirGlacier",e.berlin="berlin",e.london="london",e.altair="altair",e.arrowGlacier="arrowGlacier",e.grayGlacier="grayGlacier",e.bellatrix="bellatrix",e.merge="merge",e.capella="capella",e.shanghai="shanghai"})(Yj||(Yj={}));const Dae=Object.getPrototypeOf(Uint8Array);var Mxe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const Rxe=Symbol.for("web3/base-provider");class Yk{static isWeb3Provider(t){return t instanceof Yk||!!(t&&t[Rxe])}get[Rxe](){return!0}send(t,n){this.request(t).then(r=>{n(null,r)}).catch(r=>{n(r)})}sendAsync(t){return Mxe(this,void 0,void 0,function*(){return this.request(t)})}asEIP1193Provider(){const t=Object.create(this),n=t.request;return t.request=function(s){return Mxe(this,void 0,void 0,function*(){return(yield n(s)).result})},t.asEIP1193Provider=void 0,t}}class c4t extends Array{constructor(t){super(),this._accountProvider=t}}const u4t=100,d4t=101,f4t=201,h4t=202,p4t=203,m4t=204,x4t=205,g4t=206,b4t=207,y4t=208,v4t=300,w4t=301,C4t=310,S4t=311,N4t=400,A4t=402,j4t=405,E4t=407,_4t=408,k4t=410,T4t=411,I4t=412,P4t=413,F4t=414,O4t=415,M4t=416,R4t=417,L4t=418,D4t=419,B4t=420,$4t=421,U4t=422,z4t=423,H4t=424,V4t=425,W4t=426,q4t=427,G4t=428,K4t=429,Y4t=430,X4t=431,Q4t=432,Z4t=433,J4t=434,eSt=435,tSt=436,nSt=437,rSt=438,sSt=439,iSt=440,aSt=441,oSt=500,lSt=503,cSt=505,uSt=506,dSt=507,fSt=600,hSt=602,pSt=603,mSt=604,xSt=701,gSt=702,bSt=703,ySt=704,vSt=705,wSt=706,CSt=707,SSt=709,NSt=801,ASt=802,jSt=4001,ESt=4100,_St=4200,kSt=4900,TSt=4901,ISt=902,PSt=903,FSt=1001,OSt=1002,MSt=1003,RSt=1004,LSt=1005,DSt=1006,BSt=1008,$St=1009,USt=1010,zSt=1011,HSt=1012,VSt=1014,WSt=1015,qSt=1100,aPe=1101,GSt=1200,MM=-32700,RM=-32600,LM=-32601,DM=-32602,BM=-32603,$M=-32e3,UM=-32001,zM=-32002,HM=-32003,VM=-32004,WM=-32005,qM=-32006;class ii extends Error{get innerError(){return this.cause instanceof Xj?this.cause.errors:this.cause}set innerError(t){Array.isArray(t)?this.cause=new Xj(t):this.cause=t}constructor(t,n){super(t),Array.isArray(n)?this.cause=new Xj(n):this.cause=n,this.name=this.constructor.name,typeof Error.captureStackTrace=="function"?Error.captureStackTrace(new.target.constructor):this.stack=new Error().stack}static convertToString(t,n=!1){if(t==null)return"undefined";const r=JSON.stringify(t,(s,a)=>typeof a=="bigint"?a.toString():a);return n&&["bigint","string"].includes(typeof t)?r.replace(/['\\"]+/g,""):r}toJSON(){return{name:this.name,code:this.code,message:this.message,cause:this.cause,innerError:this.cause}}}class Xj extends ii{constructor(t){super(`Multiple errors occurred: [${t.map(n=>n.message).join("], [")}]`),this.code=y4t,this.errors=t}}class Li extends ii{constructor(t,n){super(`Invalid value given "${ii.convertToString(t,!0)}". Error: ${n}.`),this.name=this.constructor.name}}class Lxe extends ii{constructor(){super("Private key must be 32 bytes."),this.code=xSt}}class KSt extends ii{constructor(){super("Invalid Private Key, Not a valid string or uint8Array"),this.code=gSt}}class YSt extends ii{constructor(t){super(`"${t}"`),this.code=ASt}}class oPe extends ii{constructor(){super("Invalid key derivation function"),this.code=bSt}}class XSt extends ii{constructor(){super("Key derivation failed - possibly wrong password"),this.code=ySt}}class QSt extends ii{constructor(){super("Unsupported key store version"),this.code=vSt}}class ZSt extends ii{constructor(){super("Password cannot be empty"),this.code=wSt}}class JSt extends ii{constructor(){super("Initialization vector must be 16 bytes"),this.code=CSt}}class eNt extends ii{constructor(){super("c > 1000, pbkdf2 is less secure with less iterations"),this.code=SSt}}class Xk extends ii{constructor(t,n){super(t),this.code=oSt,n&&(this.errorCode=n.code,this.errorReason=n.reason)}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{errorCode:this.errorCode,errorReason:this.errorReason})}}class lee extends Xk{constructor(t){super("Connection not open",t),this.code=lSt}}class tNt extends Xk{constructor(t){super(`Maximum number of reconnect attempts reached! (${t})`),this.code=cSt}}class nNt extends Xk{constructor(){super("CONNECTION ERROR: Provider started to reconnect before the response got received!"),this.code=uSt}}class rNt extends Xk{constructor(t){super(`Request already sent with following id: ${t}`),this.code=dSt}}class ad extends ii{constructor(t,n){super(t),this.code=v4t,this.receipt=n}}class Dxe extends ii{constructor(t,n){super(`The resolver at ${t} does not implement requested method: "${n}".`),this.address=t,this.name=n,this.code=w4t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{address:this.address,name:this.name})}}class KB extends ad{constructor(t){if(super(t.message||"Error"),this.name="name"in t&&t.name||this.constructor.name,this.stack="stack"in t&&t.stack||void 0,this.code=t.code,typeof t.data=="object"){let n;t.data&&"originalError"in t.data?n=t.data.originalError:n=t.data,this.data=n.data,this.cause=new KB(n)}else this.data=t.data}setDecodedProperties(t,n,r){this.errorName=t,this.errorSignature=n,this.errorArgs=r}toJSON(){let t=Object.assign(Object.assign({},super.toJSON()),{data:this.data});return this.errorName&&(t=Object.assign(Object.assign({},t),{errorName:this.errorName,errorSignature:this.errorSignature,errorArgs:this.errorArgs})),t}}class Yw extends ad{constructor(t){super("Error happened while trying to execute a function inside a smart contract"),this.code=C4t,this.cause=new KB(t)}}class sNt extends Li{constructor(t){var n,r;super(`data: ${(n=t.data)!==null&&n!==void 0?n:"undefined"}, input: ${(r=t.input)!==null&&r!==void 0?r:"undefined"}`,`You can't have "data" and "input" as properties of a contract at the same time, please use either "data" or "input" instead.`),this.code=S4t}}class iNt extends ii{constructor(t){super(`ENS is not supported on network ${t}`),this.code=ISt}}class aNt extends ii{constructor(){super("Network not synced"),this.code=PSt}}class Bxe extends ii{constructor(t){super(`Invalid parameters passed. "${typeof t<"u"?t:""}"`),this.hint=t,this.code=b4t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{hint:this.hint})}}class cee extends ii{constructor(){super(...arguments),this.code=f4t}}class Rx extends ii{constructor(){super("The method you're trying to call is not implemented."),this.code=h4t}}class lPe extends ii{constructor(){super(...arguments),this.code=p4t}}class oNt extends ii{constructor(){super(...arguments),this.code=m4t}}class Wi extends ii{constructor(t,n){super(t),this.code=x4t,this.props=n??{}}}class lNt extends ii{constructor(t){super(`A plugin with the namespace: ${t} has already been registered.`),this.code=g4t}}class oO extends ii{constructor(){super(...arguments),this.code=fSt}}class uee extends ii{constructor(t){super(`Client URL "${t}" is invalid.`),this.code=hSt}}class rg extends ii{constructor(){super(...arguments),this.code=pSt}}class cNt extends ii{constructor(){super(...arguments),this.code=mSt}}class uNt extends Li{constructor(){super(...arguments),this.code=NSt}}class Bae extends ii{constructor(t,n){super(t),this.receipt=n,this.code=N4t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{receipt:this.receipt})}}class GM extends ii{constructor(t,n,r,s){super(`Transaction has been reverted by the EVM${r===void 0?"":`:
 ${ii.convertToString(r)}`}`),this.reason=t,this.signature=n,this.receipt=r,this.data=s,this.code=A4t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reason:this.reason,signature:this.signature,receipt:this.receipt,data:this.data})}}class cPe extends GM{constructor(t,n,r,s,a,o,l){super(t),this.reason=t,this.customErrorName=n,this.customErrorDecodedSignature=r,this.customErrorArguments=s,this.signature=a,this.receipt=o,this.data=l,this.code=rSt}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reason:this.reason,customErrorName:this.customErrorName,customErrorDecodedSignature:this.customErrorDecodedSignature,customErrorArguments:this.customErrorArguments,signature:this.signature,receipt:this.receipt,data:this.data})}}class uPe extends Bae{constructor(t){super(`Transaction has been reverted by the EVM${t===void 0?"":`:
 ${ii.convertToString(t)}`}`,t),this.code=j4t}}class dNt extends Bae{constructor(){super("Raw transaction undefined"),this.code=E4t}}class $xe extends Bae{constructor(){super("Transaction not found"),this.code=Y4t}}class fNt extends Li{constructor(t){super(t,"invalid transaction with invalid sender"),this.code=_4t}}class hNt extends Li{constructor(t){super(t,"invalid transaction with invalid receiver"),this.code=nSt}}class pNt extends Li{constructor(){super("MissingCustomChainError","If tx.common is provided it must have tx.common.customChain"),this.code=k4t}}class mNt extends Li{constructor(){super("MissingCustomChainIdError","If tx.common is provided it must have tx.common.customChain and tx.common.customChain.chainId"),this.code=T4t}}class xNt extends Li{constructor(t){super(JSON.stringify(t),"Chain Id doesnt match in tx.chainId tx.common.customChain.chainId"),this.code=I4t}}class gNt extends Li{constructor(t){super(JSON.stringify(t),"Chain doesnt match in tx.chain tx.common.basechain"),this.code=eSt}}class bNt extends Li{constructor(t){super(JSON.stringify(t),"hardfork doesnt match in tx.hardfork tx.common.hardfork"),this.code=tSt}}class yNt extends Li{constructor(){super("CommonOrChainAndHardforkError","Please provide the common object or the chain and hardfork property but not all together."),this.code=P4t}}class vNt extends Li{constructor(t){var n,r;super("MissingChainOrHardforkError",`When specifying chain and hardfork, both values must be defined. Received "chain": ${(n=t.chain)!==null&&n!==void 0?n:"undefined"}, "hardfork": ${(r=t.hardfork)!==null&&r!==void 0?r:"undefined"}`),this.code=F4t}}class wNt extends ii{constructor(){super('Missing properties in transaction, either define "gas" and "gasPrice" for type 0 transactions or "gas", "maxPriorityFeePerGas" and "maxFeePerGas" for type 2 transactions'),this.code=iSt}}class CNt extends Li{constructor(t){var n,r,s,a;super(`gas: ${(n=t.gas)!==null&&n!==void 0?n:"undefined"}, gasPrice: ${(r=t.gasPrice)!==null&&r!==void 0?r:"undefined"}, maxPriorityFeePerGas: ${(s=t.maxPriorityFeePerGas)!==null&&s!==void 0?s:"undefined"}, maxFeePerGas: ${(a=t.maxFeePerGas)!==null&&a!==void 0?a:"undefined"}`,'"gas" is missing'),this.code=O4t,this.cause=new wNt}}class SNt extends ii{constructor(){super('Missing properties in transaction, either define "gas" and "gasPrice" for type 0 transactions or "gas", "maxPriorityFeePerGas" and "maxFeePerGas" for type 2 transactions, not both'),this.code=aSt}}class NNt extends Li{constructor(t){var n,r,s,a;super(`gas: ${(n=t.gas)!==null&&n!==void 0?n:"undefined"}, gasPrice: ${(r=t.gasPrice)!==null&&r!==void 0?r:"undefined"}, maxPriorityFeePerGas: ${(s=t.maxPriorityFeePerGas)!==null&&s!==void 0?s:"undefined"}, maxFeePerGas: ${(a=t.maxFeePerGas)!==null&&a!==void 0?a:"undefined"}`,"transaction must specify legacy or fee market gas properties, not both"),this.code=J4t,this.cause=new SNt}}class ANt extends Li{constructor(t){var n,r;super(`gas: ${(n=t.gas)!==null&&n!==void 0?n:"undefined"}, gasPrice: ${(r=t.gasPrice)!==null&&r!==void 0?r:"undefined"}`,"Gas or gasPrice is lower than 0"),this.code=M4t}}class jNt extends Li{constructor(t){var n,r;super(`maxPriorityFeePerGas: ${(n=t.maxPriorityFeePerGas)!==null&&n!==void 0?n:"undefined"}, maxFeePerGas: ${(r=t.maxFeePerGas)!==null&&r!==void 0?r:"undefined"}`,"maxPriorityFeePerGas or maxFeePerGas is lower than 0"),this.code=R4t}}class ENt extends Li{constructor(t){super(t,"eip-1559 transactions don't support gasPrice"),this.code=L4t}}class dPe extends Li{constructor(t){var n,r;super(`maxPriorityFeePerGas: ${(n=t.maxPriorityFeePerGas)!==null&&n!==void 0?n:"undefined"}, maxFeePerGas: ${(r=t.maxFeePerGas)!==null&&r!==void 0?r:"undefined"}`,"pre-eip-1559 transaction don't support maxFeePerGas/maxPriorityFeePerGas"),this.code=D4t}}class _Nt extends Li{constructor(t){super(t,"invalid transaction object"),this.code=B4t}}class kNt extends Li{constructor(t){var n,r;super(`nonce: ${(n=t.nonce)!==null&&n!==void 0?n:"undefined"}, chainId: ${(r=t.chainId)!==null&&r!==void 0?r:"undefined"}`,"Nonce or chainId is lower than 0"),this.code=$4t}}class TNt extends Li{constructor(){super("UnableToPopulateNonceError","unable to populate nonce, no from address available"),this.code=U4t}}class INt extends Li{constructor(){super("Eip1559NotSupportedError","Network doesn't support eip-1559"),this.code=z4t}}class Uxe extends Li{constructor(t){super(t,"unsupported transaction type"),this.code=H4t}}class fPe extends Li{constructor(t){var n,r;super(`data: ${(n=t.data)!==null&&n!==void 0?n:"undefined"}, input: ${(r=t.input)!==null&&r!==void 0?r:"undefined"}`,`You can't have "data" and "input" as properties of transactions at the same time, please use either "data" or "input" instead.`),this.code=V4t}}class PNt extends ii{constructor(t){super(`The connected Ethereum Node did not respond within ${t.numberOfSeconds} seconds, please make sure your transaction was properly sent and you are connected to a healthy Node. Be aware that transaction might still be pending or mined!
	Transaction Hash: ${t.transactionHash?t.transactionHash.toString():"not available"}`),this.code=X4t}}function hPe(e){return`Please make sure your transaction was properly sent and there are no previous pending transaction for the same account. However, be aware that it might still be mined!
	Transaction Hash: ${e?e.toString():"not available"}`}class pPe extends ii{constructor(t){super(`Transaction was not mined within ${t.numberOfSeconds} seconds. ${hPe(t.transactionHash)}`),this.code=W4t}}class mPe extends ii{constructor(t){super(`Transaction started at ${t.starterBlockNumber} but was not mined within ${t.numberOfBlocks} blocks. ${hPe(t.transactionHash)}`),this.code=Q4t}}class FNt extends Li{constructor(t){var n,r;super(`receipt: ${JSON.stringify(t.receipt)}, blockHash: ${(n=t.blockHash)===null||n===void 0?void 0:n.toString()}, transactionHash: ${(r=t.transactionHash)===null||r===void 0?void 0:r.toString()}`,"Receipt missing or blockHash null"),this.code=q4t}}class ONt extends Li{constructor(t){super(`receipt: ${JSON.stringify(t.receipt)}`,"Receipt missing block number"),this.code=G4t}}class dee extends ii{constructor(t){super(`Invalid signature. "${t}"`),this.code=Z4t}}class zxe extends Li{constructor(){super("LocalWalletNotAvailableError","Attempted to index account in local wallet, but no wallet is available"),this.code=K4t}}class MNt extends ii{constructor(t,n){const r=[];t.forEach(s=>r.push(s.keyword)),super(`The following properties are invalid for the transaction type ${n}: ${r.join(", ")}`),this.code=sSt}}class i4 extends Li{constructor(t){super(t,"can not parse as byte data"),this.code=OSt}}class $ae extends Li{constructor(t){super(t,"can not parse as number data"),this.code=MSt}}class Uae extends Li{constructor(t){super(t,"invalid ethereum address"),this.code=LSt}}class RNt extends Li{constructor(t){super(t,"not a valid string"),this.code=FSt}}class xPe extends Li{constructor(t){super(t,"invalid unit"),this.code=RSt}}class gPe extends Li{constructor(t){super(t,"not a valid unit. Must be a positive integer"),this.code=WSt}}class LNt extends Li{constructor(t){super(t,"can not be converted to hex"),this.code=DSt}}class bPe extends Li{constructor(t){super(t,"value greater than the nibble width"),this.code=VSt}}class zae extends Li{constructor(t){super(t,"not a valid boolean."),this.code=BSt}}class DNt extends Li{constructor(t){super(t,"not a valid unsigned integer."),this.code=$St}}class Hxe extends Li{constructor(t){super(t,"invalid size given."),this.code=USt}}class Vxe extends Li{constructor(t){super(t,"value is larger than size."),this.code=zSt}}class BNt extends Li{constructor(t){super(t,"invalid string given"),this.code=HSt}}const $Nt=e=>!Array.isArray(e)&&e.jsonrpc==="2.0"&&!!e&&(e.result===void 0||e.result===null)&&"error"in e&&(typeof e.id=="number"||typeof e.id=="string"),Wxe=e=>$Nt(e)?e.error.message:"";class b0 extends ii{constructor(t,n,r,s){var a;super(n??`Returned error: ${Array.isArray(t)?t.map(l=>Wxe(l)).join(","):Wxe(t)}`),this.code=u4t,n||(this.data=Array.isArray(t)?t.map(l=>{var c;return(c=l.error)===null||c===void 0?void 0:c.data}):(a=t==null?void 0:t.error)===null||a===void 0?void 0:a.data),this.statusCode=s,this.request=r;let o;"error"in t?o=t.error:t instanceof Array&&(o=t.filter(l=>l.error).map(l=>l.error)),Array.isArray(o)&&o.length>0?this.cause=new Xj(o):this.cause=o}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{data:this.data,request:this.request,statusCode:this.statusCode})}}class YB extends b0{constructor(t,n){super(t,void 0,n),this.code=d4t;let r;"error"in t?r=t.error:t instanceof Array&&(r=t.map(s=>s.error)),Array.isArray(r)?this.cause=new Xj(r):this.cause=r}}class qxe extends ii{constructor(t,n){super(`Web3Config hardfork doesnt match in defaultHardfork ${t} and common.hardfork ${n}`),this.code=aPe}}class Gxe extends ii{constructor(t,n){super(`Web3Config chain doesnt match in defaultHardfork ${t} and common.hardfork ${n}`),this.code=aPe}}const yPe="An Rpc error has occured with a code of *code*",_u={[MM]:{message:"Parse error",description:"Invalid JSON"},[RM]:{message:"Invalid request",description:"JSON is not a valid request object	"},[LM]:{message:"Method not found",description:"Method does not exist	"},[DM]:{message:"Invalid params",description:"Invalid method parameters"},[BM]:{message:"Internal error",description:"Internal JSON-RPC error"},[$M]:{message:"Invalid input",description:"Missing or invalid parameters"},[UM]:{message:"Resource not found",description:"Requested resource not found"},[zM]:{message:"Resource unavailable",description:"Requested resource not available"},[HM]:{message:"Transaction rejected",description:"Transaction creation failed"},[VM]:{message:"Method not supported",description:"Method is not implemented"},[WM]:{message:"Limit exceeded",description:"Request exceeds defined limit"},[qM]:{message:"JSON-RPC version not supported",description:"Version of JSON-RPC protocol is not supported"},[jSt]:{name:"User Rejected Request",message:"The user rejected the request."},[ESt]:{name:"Unauthorized",message:"The requested method and/or account has not been authorized by the user."},[_St]:{name:"Unsupported Method",message:"The Provider does not support the requested method."},[kSt]:{name:"Disconnected",message:"The Provider is disconnected from all chains."},[TSt]:{name:"Chain Disconnected",message:"The Provider is not connected to the requested chain."},"0-999":{name:"",message:"Not used."},1e3:{name:"Normal Closure",message:"The connection successfully completed the purpose for which it was created."},1001:{name:"Going Away",message:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection."},1002:{name:"Protocol error",message:"The endpoint is terminating the connection due to a protocol error."},1003:{name:"Unsupported Data",message:"The connection is being terminated because the endpoint received data of a type it cannot accept. (For example, a text-only endpoint received binary data.)"},1004:{name:"Reserved",message:"Reserved. A meaning might be defined in the future."},1005:{name:"No Status Rcvd",message:"Reserved. Indicates that no status code was provided even though one was expected."},1006:{name:"Abnormal Closure",message:"Reserved. Indicates that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected."},1007:{name:"Invalid frame payload data",message:"The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message)."},1008:{name:"Policy Violation",message:"The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable."},1009:{name:"Message Too Big",message:"The endpoint is terminating the connection because a data frame was received that is too large."},1010:{name:"Mandatory Ext.",message:"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't."},1011:{name:"Internal Error",message:"The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."},1012:{name:"Service Restart",message:"The server is terminating the connection because it is restarting."},1013:{name:"Try Again Later",message:"The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients."},1014:{name:"Bad Gateway",message:"The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code."},1015:{name:"TLS handshake",message:"Reserved. Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."},"1016-2999":{name:"",message:"For definition by future revisions of the WebSocket Protocol specification, and for definition by extension specifications."},"3000-3999":{name:"",message:"For use by libraries, frameworks, and applications. These status codes are registered directly with IANA. The interpretation of these codes is undefined by the WebSocket protocol."},"4000-4999":{name:"",message:"For private use, and thus can't be registered. Such codes can be used by prior agreements between WebSocket applications. The interpretation of these codes is undefined by the WebSocket protocol."}};class qf extends ii{constructor(t,n){super(n??yPe.replace("*code*",t.error.code.toString())),this.code=t.error.code,this.id=t.id,this.jsonrpc=t.jsonrpc,this.jsonRpcError=t.error}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{error:this.jsonRpcError,id:this.id,jsonRpc:this.jsonrpc})}}class UNt extends ii{constructor(t,n){var r,s,a,o;if(!t)super();else if(!((r=_u[t])===null||r===void 0)&&r.message)super(_u[t].message);else{const l=Object.keys(_u).find(c=>typeof c=="string"&&t>=parseInt(c.split("-")[0],10)&&t<=parseInt(c.split("-")[1],10));super((a=(s=_u[l??""])===null||s===void 0?void 0:s.message)!==null&&a!==void 0?a:yPe.replace("*code*",(o=t==null?void 0:t.toString())!==null&&o!==void 0?o:'""'))}this.code=t,this.data=n}}class zNt extends qf{constructor(t){super(t,_u[MM].message),this.code=MM}}class HNt extends qf{constructor(t){super(t,_u[RM].message),this.code=RM}}class VNt extends qf{constructor(t){super(t,_u[LM].message),this.code=LM}}class WNt extends qf{constructor(t){super(t,_u[DM].message),this.code=DM}}class qNt extends qf{constructor(t){super(t,_u[BM].message),this.code=BM}}class GNt extends qf{constructor(t){super(t,_u[$M].message),this.code=$M}}class KNt extends qf{constructor(t){super(t,_u[VM].message),this.code=VM}}class YNt extends qf{constructor(t){super(t,_u[zM].message),this.code=zM}}class XNt extends qf{constructor(t){super(t,_u[UM].message),this.code=UM}}class QNt extends qf{constructor(t){super(t,_u[qM].message),this.code=qM}}class ZNt extends qf{constructor(t){super(t,_u[HM].message),this.code=HM}}class JNt extends qf{constructor(t){super(t,_u[WM].message),this.code=WM}}const cd=new Map;cd.set(MM,{error:zNt});cd.set(RM,{error:HNt});cd.set(LM,{error:VNt});cd.set(DM,{error:WNt});cd.set(BM,{error:qNt});cd.set($M,{error:GNt});cd.set(VM,{error:KNt});cd.set(zM,{error:YNt});cd.set(HM,{error:ZNt});cd.set(UM,{error:XNt});cd.set(qM,{error:QNt});cd.set(WM,{error:JNt});class eAt extends ii{constructor(t){super(`Format for the type ${t} is unsupported`),this.type=t,this.code=GSt}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type})}}function Bd(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function tAt(e){if(typeof e!="boolean")throw new Error(`boolean expected, not ${e}`)}function nAt(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function OA(e,...t){if(!nAt(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function Hae(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Bd(e.outputLen),Bd(e.blockLen)}function P3(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 Vae(e,t){OA(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const vPe={number:Bd,bool:tAt,bytes:OA,hash:Hae,exists:P3,output:Vae},lP=BigInt(2**32-1),Kxe=BigInt(32);function rAt(e,t=!1){return t?{h:Number(e&lP),l:Number(e>>Kxe&lP)}:{h:Number(e>>Kxe&lP)|0,l:Number(e&lP)|0}}function sAt(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:a,l:o}=rAt(e[s],t);[n[s],r[s]]=[a,o]}return[n,r]}const iAt=(e,t,n)=>e<<n|t>>>32-n,aAt=(e,t,n)=>t<<n|e>>>32-n,oAt=(e,t,n)=>t<<n-32|e>>>64-n,lAt=(e,t,n)=>e<<n-32|t>>>64-n,lO=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const cO=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),uO=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Wm=(e,t)=>e<<32-t|e>>>t,pa=(e,t)=>e<<t|e>>>32-t>>>0,KM=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,cAt=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function YM(e){for(let t=0;t<e.length;t++)e[t]=cAt(e[t])}function YS(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function XS(e){return typeof e=="string"&&(e=YS(e)),OA(e),e}function XM(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];OA(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const a=e[r];n.set(a,s),s+=a.length}return n}class Wae{clone(){return this._cloneInto()}}const uAt={}.toString;function wPe(e,t){if(t!==void 0&&uAt.call(t)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(e,t)}function CPe(e){const t=r=>e().update(XS(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function SPe(e=32){if(lO&&typeof lO.getRandomValues=="function")return lO.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const NPe=[],APe=[],jPe=[],dAt=BigInt(0),A7=BigInt(1),fAt=BigInt(2),hAt=BigInt(7),pAt=BigInt(256),mAt=BigInt(113);for(let e=0,t=A7,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],NPe.push(2*(5*r+n)),APe.push((e+1)*(e+2)/2%64);let s=dAt;for(let a=0;a<7;a++)t=(t<<A7^(t>>hAt)*mAt)%pAt,t&fAt&&(s^=A7<<(A7<<BigInt(a))-A7);jPe.push(s)}const[xAt,gAt]=sAt(jPe,!0),Yxe=(e,t,n)=>n>32?oAt(e,t,n):iAt(e,t,n),Xxe=(e,t,n)=>n>32?lAt(e,t,n):aAt(e,t,n);function bAt(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const l=(o+8)%10,c=(o+2)%10,u=n[c],d=n[c+1],f=Yxe(u,d,1)^n[l],x=Xxe(u,d,1)^n[l+1];for(let g=0;g<50;g+=10)e[o+g]^=f,e[o+g+1]^=x}let s=e[2],a=e[3];for(let o=0;o<24;o++){const l=APe[o],c=Yxe(s,a,l),u=Xxe(s,a,l),d=NPe[o];s=e[d],a=e[d+1],e[d]=c,e[d+1]=u}for(let o=0;o<50;o+=10){for(let l=0;l<10;l++)n[l]=e[o+l];for(let l=0;l<10;l++)e[o+l]^=~n[(l+2)%10]&n[(l+4)%10]}e[0]^=xAt[r],e[1]^=gAt[r]}n.fill(0)}class qae extends Wae{constructor(t,n,r,s=!1,a=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Bd(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=cO(this.state)}keccak(){KM||YM(this.state32),bAt(this.state32,this.rounds),KM||YM(this.state32),this.posOut=0,this.pos=0}update(t){P3(this);const{blockLen:n,state:r}=this;t=XS(t);const s=t.length;for(let a=0;a<s;){const o=Math.min(n-this.pos,s-a);for(let l=0;l<o;l++)r[this.pos++]^=t[a++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:s}=this;t[r]^=n,n&128&&r===s-1&&this.keccak(),t[s-1]^=128,this.keccak()}writeInto(t){P3(this,!1),OA(t),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,a=t.length;s<a;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,a-s);t.set(n.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Bd(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Vae(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:s,rounds:a,enableXOF:o}=this;return t||(t=new qae(n,r,s,o,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=s,t.enableXOF=o,t.destroyed=this.destroyed,t}}const yAt=(e,t,n)=>CPe(()=>new qae(t,e,n)),Qxe=yAt(1,136,256/8),QM=vPe.bytes;function EPe(e){if(!(e instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof e}`);return new TextDecoder().decode(e)}function vAt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function wAt(e){return t=>(vPe.bytes(t),e(t))}(()=>{const e=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,t=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);return{node:t&&!e?t("crypto"):void 0,web:e}})();const td=(()=>{const e=wAt(Qxe);return e.create=Qxe.create,e})();var oa;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const a={};for(const o of s)a[o]=o;return a},e.getValidEnumValues=s=>{const a=e.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),o={};for(const l of a)o[l]=s[l];return e.objectValues(o)},e.objectValues=s=>e.objectKeys(s).map(function(a){return s[a]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&a.push(o);return a},e.find=(s,a)=>{for(const o of s)if(a(o))return o},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,a=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=r,e.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(oa||(oa={}));var fee;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(fee||(fee={}));const hs=oa.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),og=e=>{switch(typeof e){case"undefined":return hs.undefined;case"string":return hs.string;case"number":return Number.isNaN(e)?hs.nan:hs.number;case"boolean":return hs.boolean;case"function":return hs.function;case"bigint":return hs.bigint;case"symbol":return hs.symbol;case"object":return Array.isArray(e)?hs.array:e===null?hs.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?hs.promise:typeof Map<"u"&&e instanceof Map?hs.map:typeof Set<"u"&&e instanceof Set?hs.set:typeof Date<"u"&&e instanceof Date?hs.date:hs.object;default:return hs.unknown}},zr=oa.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),CAt=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Df extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(a){return a.message},r={_errors:[]},s=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let l=r,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(n(o))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}};return s(this),r}static assert(t){if(!(t instanceof Df))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,oa.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const a=s.path[0];n[a]=n[a]||[],n[a].push(t(s))}else r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Df.create=e=>new Df(e);const QS=(e,t)=>{let n;switch(e.code){case zr.invalid_type:e.received===hs.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case zr.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,oa.jsonStringifyReplacer)}`;break;case zr.unrecognized_keys:n=`Unrecognized key(s) in object: ${oa.joinValues(e.keys,", ")}`;break;case zr.invalid_union:n="Invalid input";break;case zr.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${oa.joinValues(e.options)}`;break;case zr.invalid_enum_value:n=`Invalid enum value. Expected ${oa.joinValues(e.options)}, received '${e.received}'`;break;case zr.invalid_arguments:n="Invalid function arguments";break;case zr.invalid_return_type:n="Invalid function return type";break;case zr.invalid_date:n="Invalid date";break;case zr.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:oa.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case zr.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case zr.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case zr.custom:n="Invalid input";break;case zr.invalid_intersection_types:n="Intersection results could not be merged";break;case zr.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case zr.not_finite:n="Number must be finite";break;default:n=t.defaultError,oa.assertNever(e)}return{message:n}};let _Pe=QS;function SAt(e){_Pe=e}function ZM(){return _Pe}const JM=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,a=[...n,...s.path||[]],o={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let l="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)l=u(o,{data:t,defaultError:l}).message;return{...s,path:a,message:l}},NAt=[];function is(e,t){const n=ZM(),r=JM({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===QS?void 0:QS].filter(s=>!!s)});e.common.issues.push(r)}class Fu{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return Qs;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const a=await s.key,o=await s.value;r.push({key:a,value:o})}return Fu.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:a,value:o}=s;if(a.status==="aborted"||o.status==="aborted")return Qs;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[a.value]=o.value)}return{status:t.value,value:r}}}const Qs=Object.freeze({status:"aborted"}),OC=e=>({status:"dirty",value:e}),ud=e=>({status:"valid",value:e}),hee=e=>e.status==="aborted",pee=e=>e.status==="dirty",F3=e=>e.status==="valid",wE=e=>typeof Promise<"u"&&e instanceof Promise;var Is;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Is||(Is={}));class X0{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Zxe=(e,t)=>{if(F3(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Df(e.common.issues);return this._error=n,this._error}}};function Ai(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(o,l)=>{const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??r??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:c??n??l.defaultError}},description:s}}class Ri{get description(){return this._def.description}_getType(t){return og(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:og(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Fu,ctx:{common:t.parent.common,data:t.data,parsedType:og(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(wE(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:og(t)},s=this._parseSync({data:t,path:r.path,parent:r});return Zxe(r,s)}"~validate"(t){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:og(t)};if(!this["~standard"].async)try{const a=this._parseSync({data:t,path:[],parent:n});return F3(a)?{value:a.value}:{issues:n.common.issues}}catch(a){(s=(r=a==null?void 0:a.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(a=>F3(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:og(t)},s=this._parse({data:t,path:r.path,parent:r}),a=await(wE(s)?s:Promise.resolve(s));return Zxe(r,a)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,a)=>{const o=t(s),l=()=>a.addIssue({code:zr.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new dm({schema:this,typeName:Js.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return O0.create(this,this._def)}nullable(){return Hy.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return rm.create(this)}promise(){return JS.create(this,this._def)}or(t){return AE.create([this,t],this._def)}and(t){return jE.create(this,t,this._def)}transform(t){return new dm({...Ai(this._def),schema:this,typeName:Js.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new IE({...Ai(this._def),innerType:this,defaultValue:n,typeName:Js.ZodDefault})}brand(){return new Gae({typeName:Js.ZodBranded,type:this,...Ai(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new PE({...Ai(this._def),innerType:this,catchValue:n,typeName:Js.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Qk.create(this,t)}readonly(){return FE.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const AAt=/^c[^\s-]{8,}$/i,jAt=/^[0-9a-z]+$/,EAt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,_At=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,kAt=/^[a-z0-9_-]{21}$/i,TAt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,IAt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,PAt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,FAt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let iV;const OAt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,MAt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,RAt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,LAt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,DAt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,BAt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,kPe="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",$At=new RegExp(`^${kPe}$`);function TPe(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function UAt(e){return new RegExp(`^${TPe(e)}$`)}function IPe(e){let t=`${kPe}T${TPe(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function zAt(e,t){return!!((t==="v4"||!t)&&OAt.test(e)||(t==="v6"||!t)&&RAt.test(e))}function HAt(e,t){if(!TAt.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function VAt(e,t){return!!((t==="v4"||!t)&&MAt.test(e)||(t==="v6"||!t)&&LAt.test(e))}class Jp extends Ri{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==hs.string){const a=this._getOrReturnCtx(t);return is(a,{code:zr.invalid_type,expected:hs.string,received:a.parsedType}),Qs}const r=new Fu;let s;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(s=this._getOrReturnCtx(t,s),is(s,{code:zr.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")t.data.length>a.value&&(s=this._getOrReturnCtx(t,s),is(s,{code:zr.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const o=t.data.length>a.value,l=t.data.length<a.value;(o||l)&&(s=this._getOrReturnCtx(t,s),o?is(s,{code:zr.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):l&&is(s,{code:zr.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")PAt.test(t.data)||(s=this._getOrReturnCtx(t,s),is(s,{validation:"email",code:zr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")iV||(iV=new RegExp(FAt,"u")),iV.test(t.data)||(s=this._getOrReturnCtx(t,s),is(s,{validation:"emoji",code:zr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")_At.test(t.data)||(s=this._getOrReturnCtx(t,s),is(s,{validation:"uuid",code:zr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")kAt.test(t.data)||(s=this._getOrReturnCtx(t,s),is(s,{validation:"nanoid",code:zr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")AAt.test(t.data)||(s=this._getOrReturnCtx(t,s),is(s,{validation:"cuid",code:zr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")jAt.test(t.data)||(s=this._getOrReturnCtx(t,s),is(s,{validation:"cuid2",code:zr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")EAt.test(t.data)||(s=this._getOrReturnCtx(t,s),is(s,{validation:"ulid",code:zr.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),is(s,{validation:"url",code:zr.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),is(s,{validation:"regex",code:zr.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(t,s),is(s,{code:zr.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(s=this._getOrReturnCtx(t,s),is(s,{code:zr.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(s=this._getOrReturnCtx(t,s),is(s,{code:zr.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?IPe(a).test(t.data)||(s=this._getOrReturnCtx(t,s),is(s,{code:zr.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?$At.test(t.data)||(s=this._getOrReturnCtx(t,s),is(s,{code:zr.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?UAt(a).test(t.data)||(s=this._getOrReturnCtx(t,s),is(s,{code:zr.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?IAt.test(t.data)||(s=this._getOrReturnCtx(t,s),is(s,{validation:"duration",code:zr.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?zAt(t.data,a.version)||(s=this._getOrReturnCtx(t,s),is(s,{validation:"ip",code:zr.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?HAt(t.data,a.alg)||(s=this._getOrReturnCtx(t,s),is(s,{validation:"jwt",code:zr.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?VAt(t.data,a.version)||(s=this._getOrReturnCtx(t,s),is(s,{validation:"cidr",code:zr.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?DAt.test(t.data)||(s=this._getOrReturnCtx(t,s),is(s,{validation:"base64",code:zr.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?BAt.test(t.data)||(s=this._getOrReturnCtx(t,s),is(s,{validation:"base64url",code:zr.invalid_string,message:a.message}),r.dirty()):oa.assertNever(a);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:zr.invalid_string,...Is.errToObj(r)})}_addCheck(t){return new Jp({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Is.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Is.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Is.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Is.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Is.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Is.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Is.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Is.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Is.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Is.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Is.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Is.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Is.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...Is.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Is.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Is.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Is.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Is.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Is.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Is.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Is.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Is.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Is.errToObj(n)})}nonempty(t){return this.min(1,Is.errToObj(t))}trim(){return new Jp({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Jp({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Jp({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Jp.create=e=>new Jp({checks:[],typeName:Js.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Ai(e)});function WAt(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,a=Number.parseInt(e.toFixed(s).replace(".","")),o=Number.parseInt(t.toFixed(s).replace(".",""));return a%o/10**s}class $y extends Ri{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==hs.number){const a=this._getOrReturnCtx(t);return is(a,{code:zr.invalid_type,expected:hs.number,received:a.parsedType}),Qs}let r;const s=new Fu;for(const a of this._def.checks)a.kind==="int"?oa.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),is(r,{code:zr.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),is(r,{code:zr.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),is(r,{code:zr.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?WAt(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),is(r,{code:zr.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),is(r,{code:zr.not_finite,message:a.message}),s.dirty()):oa.assertNever(a);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Is.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Is.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Is.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Is.toString(n))}setLimit(t,n,r,s){return new $y({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Is.toString(s)}]})}_addCheck(t){return new $y({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Is.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Is.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Is.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Is.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Is.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Is.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Is.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Is.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Is.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&oa.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}$y.create=e=>new $y({checks:[],typeName:Js.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ai(e)});class Uy extends Ri{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==hs.bigint)return this._getInvalidInput(t);let r;const s=new Fu;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),is(r,{code:zr.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),is(r,{code:zr.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),is(r,{code:zr.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):oa.assertNever(a);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return is(n,{code:zr.invalid_type,expected:hs.bigint,received:n.parsedType}),Qs}gte(t,n){return this.setLimit("min",t,!0,Is.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Is.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Is.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Is.toString(n))}setLimit(t,n,r,s){return new Uy({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Is.toString(s)}]})}_addCheck(t){return new Uy({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Is.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Is.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Is.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Is.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Is.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Uy.create=e=>new Uy({checks:[],typeName:Js.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Ai(e)});class CE extends Ri{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==hs.boolean){const r=this._getOrReturnCtx(t);return is(r,{code:zr.invalid_type,expected:hs.boolean,received:r.parsedType}),Qs}return ud(t.data)}}CE.create=e=>new CE({typeName:Js.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ai(e)});class O3 extends Ri{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==hs.date){const a=this._getOrReturnCtx(t);return is(a,{code:zr.invalid_type,expected:hs.date,received:a.parsedType}),Qs}if(Number.isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return is(a,{code:zr.invalid_date}),Qs}const r=new Fu;let s;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(s=this._getOrReturnCtx(t,s),is(s,{code:zr.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(s=this._getOrReturnCtx(t,s),is(s,{code:zr.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):oa.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new O3({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Is.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Is.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}O3.create=e=>new O3({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Js.ZodDate,...Ai(e)});class eR extends Ri{_parse(t){if(this._getType(t)!==hs.symbol){const r=this._getOrReturnCtx(t);return is(r,{code:zr.invalid_type,expected:hs.symbol,received:r.parsedType}),Qs}return ud(t.data)}}eR.create=e=>new eR({typeName:Js.ZodSymbol,...Ai(e)});class SE extends Ri{_parse(t){if(this._getType(t)!==hs.undefined){const r=this._getOrReturnCtx(t);return is(r,{code:zr.invalid_type,expected:hs.undefined,received:r.parsedType}),Qs}return ud(t.data)}}SE.create=e=>new SE({typeName:Js.ZodUndefined,...Ai(e)});class NE extends Ri{_parse(t){if(this._getType(t)!==hs.null){const r=this._getOrReturnCtx(t);return is(r,{code:zr.invalid_type,expected:hs.null,received:r.parsedType}),Qs}return ud(t.data)}}NE.create=e=>new NE({typeName:Js.ZodNull,...Ai(e)});class ZS extends Ri{constructor(){super(...arguments),this._any=!0}_parse(t){return ud(t.data)}}ZS.create=e=>new ZS({typeName:Js.ZodAny,...Ai(e)});class Xw extends Ri{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ud(t.data)}}Xw.create=e=>new Xw({typeName:Js.ZodUnknown,...Ai(e)});class o1 extends Ri{_parse(t){const n=this._getOrReturnCtx(t);return is(n,{code:zr.invalid_type,expected:hs.never,received:n.parsedType}),Qs}}o1.create=e=>new o1({typeName:Js.ZodNever,...Ai(e)});class tR extends Ri{_parse(t){if(this._getType(t)!==hs.undefined){const r=this._getOrReturnCtx(t);return is(r,{code:zr.invalid_type,expected:hs.void,received:r.parsedType}),Qs}return ud(t.data)}}tR.create=e=>new tR({typeName:Js.ZodVoid,...Ai(e)});class rm extends Ri{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==hs.array)return is(n,{code:zr.invalid_type,expected:hs.array,received:n.parsedType}),Qs;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,l=n.data.length<s.exactLength.value;(o||l)&&(is(n,{code:o?zr.too_big:zr.too_small,minimum:l?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(is(n,{code:zr.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(is(n,{code:zr.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,l)=>s.type._parseAsync(new X0(n,o,n.path,l)))).then(o=>Fu.mergeArray(r,o));const a=[...n.data].map((o,l)=>s.type._parseSync(new X0(n,o,n.path,l)));return Fu.mergeArray(r,a)}get element(){return this._def.type}min(t,n){return new rm({...this._def,minLength:{value:t,message:Is.toString(n)}})}max(t,n){return new rm({...this._def,maxLength:{value:t,message:Is.toString(n)}})}length(t,n){return new rm({...this._def,exactLength:{value:t,message:Is.toString(n)}})}nonempty(t){return this.min(1,t)}}rm.create=(e,t)=>new rm({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Js.ZodArray,...Ai(t)});function vC(e){if(e instanceof Mo){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=O0.create(vC(r))}return new Mo({...e._def,shape:()=>t})}else return e instanceof rm?new rm({...e._def,type:vC(e.element)}):e instanceof O0?O0.create(vC(e.unwrap())):e instanceof Hy?Hy.create(vC(e.unwrap())):e instanceof Q0?Q0.create(e.items.map(t=>vC(t))):e}class Mo extends Ri{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=oa.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==hs.object){const u=this._getOrReturnCtx(t);return is(u,{code:zr.invalid_type,expected:hs.object,received:u.parsedType}),Qs}const{status:r,ctx:s}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof o1&&this._def.unknownKeys==="strip"))for(const u in s.data)o.includes(u)||l.push(u);const c=[];for(const u of o){const d=a[u],f=s.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new X0(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof o1){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")l.length>0&&(is(s,{code:zr.unrecognized_keys,keys:l}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of l){const f=s.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new X0(s,f,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const f=await d.key,x=await d.value;u.push({key:f,value:x,alwaysSet:d.alwaysSet})}return u}).then(u=>Fu.mergeObjectSync(r,u)):Fu.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return Is.errToObj,new Mo({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var a,o;const s=((o=(a=this._def).errorMap)==null?void 0:o.call(a,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Is.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new Mo({...this._def,unknownKeys:"strip"})}passthrough(){return new Mo({...this._def,unknownKeys:"passthrough"})}extend(t){return new Mo({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Mo({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Js.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Mo({...this._def,catchall:t})}pick(t){const n={};for(const r of oa.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Mo({...this._def,shape:()=>n})}omit(t){const n={};for(const r of oa.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Mo({...this._def,shape:()=>n})}deepPartial(){return vC(this)}partial(t){const n={};for(const r of oa.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new Mo({...this._def,shape:()=>n})}required(t){const n={};for(const r of oa.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof O0;)a=a._def.innerType;n[r]=a}return new Mo({...this._def,shape:()=>n})}keyof(){return PPe(oa.objectKeys(this.shape))}}Mo.create=(e,t)=>new Mo({shape:()=>e,unknownKeys:"strip",catchall:o1.create(),typeName:Js.ZodObject,...Ai(t)});Mo.strictCreate=(e,t)=>new Mo({shape:()=>e,unknownKeys:"strict",catchall:o1.create(),typeName:Js.ZodObject,...Ai(t)});Mo.lazycreate=(e,t)=>new Mo({shape:e,unknownKeys:"strip",catchall:o1.create(),typeName:Js.ZodObject,...Ai(t)});class AE extends Ri{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(a){for(const l of a)if(l.result.status==="valid")return l.result;for(const l of a)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const o=a.map(l=>new Df(l.ctx.common.issues));return is(n,{code:zr.invalid_union,unionErrors:o}),Qs}if(n.common.async)return Promise.all(r.map(async a=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let a;const o=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const l=o.map(c=>new Df(c));return is(n,{code:zr.invalid_union,unionErrors:l}),Qs}}get options(){return this._def.options}}AE.create=(e,t)=>new AE({options:e,typeName:Js.ZodUnion,...Ai(t)});const eg=e=>e instanceof _E?eg(e.schema):e instanceof dm?eg(e.innerType()):e instanceof kE?[e.value]:e instanceof zy?e.options:e instanceof TE?oa.objectValues(e.enum):e instanceof IE?eg(e._def.innerType):e instanceof SE?[void 0]:e instanceof NE?[null]:e instanceof O0?[void 0,...eg(e.unwrap())]:e instanceof Hy?[null,...eg(e.unwrap())]:e instanceof Gae||e instanceof FE?eg(e.unwrap()):e instanceof PE?eg(e._def.innerType):[];class XB extends Ri{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==hs.object)return is(n,{code:zr.invalid_type,expected:hs.object,received:n.parsedType}),Qs;const r=this.discriminator,s=n.data[r],a=this.optionsMap.get(s);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(is(n,{code:zr.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Qs)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const a of n){const o=eg(a.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const l of o){if(s.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);s.set(l,a)}}return new XB({typeName:Js.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...Ai(r)})}}function mee(e,t){const n=og(e),r=og(t);if(e===t)return{valid:!0,data:e};if(n===hs.object&&r===hs.object){const s=oa.objectKeys(t),a=oa.objectKeys(e).filter(l=>s.indexOf(l)!==-1),o={...e,...t};for(const l of a){const c=mee(e[l],t[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(n===hs.array&&r===hs.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let a=0;a<e.length;a++){const o=e[a],l=t[a],c=mee(o,l);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return n===hs.date&&r===hs.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class jE extends Ri{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(a,o)=>{if(hee(a)||hee(o))return Qs;const l=mee(a.value,o.value);return l.valid?((pee(a)||pee(o))&&n.dirty(),{status:n.value,value:l.data}):(is(r,{code:zr.invalid_intersection_types}),Qs)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,o])=>s(a,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}jE.create=(e,t,n)=>new jE({left:e,right:t,typeName:Js.ZodIntersection,...Ai(n)});class Q0 extends Ri{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==hs.array)return is(r,{code:zr.invalid_type,expected:hs.array,received:r.parsedType}),Qs;if(r.data.length<this._def.items.length)return is(r,{code:zr.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Qs;!this._def.rest&&r.data.length>this._def.items.length&&(is(r,{code:zr.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new X0(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(a).then(o=>Fu.mergeArray(n,o)):Fu.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new Q0({...this._def,rest:t})}}Q0.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Q0({items:e,typeName:Js.ZodTuple,rest:null,...Ai(t)})};class EE extends Ri{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==hs.object)return is(r,{code:zr.invalid_type,expected:hs.object,received:r.parsedType}),Qs;const s=[],a=this._def.keyType,o=this._def.valueType;for(const l in r.data)s.push({key:a._parse(new X0(r,l,r.path,l)),value:o._parse(new X0(r,r.data[l],r.path,l)),alwaysSet:l in r.data});return r.common.async?Fu.mergeObjectAsync(n,s):Fu.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Ri?new EE({keyType:t,valueType:n,typeName:Js.ZodRecord,...Ai(r)}):new EE({keyType:Jp.create(),valueType:t,typeName:Js.ZodRecord,...Ai(n)})}}class nR extends Ri{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==hs.map)return is(r,{code:zr.invalid_type,expected:hs.map,received:r.parsedType}),Qs;const s=this._def.keyType,a=this._def.valueType,o=[...r.data.entries()].map(([l,c],u)=>({key:s._parse(new X0(r,l,r.path,[u,"key"])),value:a._parse(new X0(r,c,r.path,[u,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return Qs;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const c of o){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return Qs;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}}}}nR.create=(e,t,n)=>new nR({valueType:t,keyType:e,typeName:Js.ZodMap,...Ai(n)});class M3 extends Ri{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==hs.set)return is(r,{code:zr.invalid_type,expected:hs.set,received:r.parsedType}),Qs;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(is(r,{code:zr.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(is(r,{code:zr.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const a=this._def.valueType;function o(c){const u=new Set;for(const d of c){if(d.status==="aborted")return Qs;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const l=[...r.data.values()].map((c,u)=>a._parse(new X0(r,c,r.path,u)));return r.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(t,n){return new M3({...this._def,minSize:{value:t,message:Is.toString(n)}})}max(t,n){return new M3({...this._def,maxSize:{value:t,message:Is.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}M3.create=(e,t)=>new M3({valueType:e,minSize:null,maxSize:null,typeName:Js.ZodSet,...Ai(t)});class a4 extends Ri{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==hs.function)return is(n,{code:zr.invalid_type,expected:hs.function,received:n.parsedType}),Qs;function r(l,c){return JM({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ZM(),QS].filter(u=>!!u),issueData:{code:zr.invalid_arguments,argumentsError:c}})}function s(l,c){return JM({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ZM(),QS].filter(u=>!!u),issueData:{code:zr.invalid_return_type,returnTypeError:c}})}const a={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof JS){const l=this;return ud(async function(...c){const u=new Df([]),d=await l._def.args.parseAsync(c,a).catch(g=>{throw u.addIssue(r(c,g)),u}),f=await Reflect.apply(o,this,d);return await l._def.returns._def.type.parseAsync(f,a).catch(g=>{throw u.addIssue(s(f,g)),u})})}else{const l=this;return ud(function(...c){const u=l._def.args.safeParse(c,a);if(!u.success)throw new Df([r(c,u.error)]);const d=Reflect.apply(o,this,u.data),f=l._def.returns.safeParse(d,a);if(!f.success)throw new Df([s(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new a4({...this._def,args:Q0.create(t).rest(Xw.create())})}returns(t){return new a4({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new a4({args:t||Q0.create([]).rest(Xw.create()),returns:n||Xw.create(),typeName:Js.ZodFunction,...Ai(r)})}}class _E extends Ri{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}_E.create=(e,t)=>new _E({getter:e,typeName:Js.ZodLazy,...Ai(t)});class kE extends Ri{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return is(n,{received:n.data,code:zr.invalid_literal,expected:this._def.value}),Qs}return{status:"valid",value:t.data}}get value(){return this._def.value}}kE.create=(e,t)=>new kE({value:e,typeName:Js.ZodLiteral,...Ai(t)});function PPe(e,t){return new zy({values:e,typeName:Js.ZodEnum,...Ai(t)})}class zy extends Ri{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return is(n,{expected:oa.joinValues(r),received:n.parsedType,code:zr.invalid_type}),Qs}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return is(n,{received:n.data,code:zr.invalid_enum_value,options:r}),Qs}return ud(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return zy.create(t,{...this._def,...n})}exclude(t,n=this._def){return zy.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}zy.create=PPe;class TE extends Ri{_parse(t){const n=oa.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==hs.string&&r.parsedType!==hs.number){const s=oa.objectValues(n);return is(r,{expected:oa.joinValues(s),received:r.parsedType,code:zr.invalid_type}),Qs}if(this._cache||(this._cache=new Set(oa.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=oa.objectValues(n);return is(r,{received:r.data,code:zr.invalid_enum_value,options:s}),Qs}return ud(t.data)}get enum(){return this._def.values}}TE.create=(e,t)=>new TE({values:e,typeName:Js.ZodNativeEnum,...Ai(t)});class JS extends Ri{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==hs.promise&&n.common.async===!1)return is(n,{code:zr.invalid_type,expected:hs.promise,received:n.parsedType}),Qs;const r=n.parsedType===hs.promise?n.data:Promise.resolve(n.data);return ud(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}JS.create=(e,t)=>new JS({type:e,typeName:Js.ZodPromise,...Ai(t)});class dm extends Ri{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Js.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,a={addIssue:o=>{is(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const o=s.transform(r.data,a);if(r.common.async)return Promise.resolve(o).then(async l=>{if(n.value==="aborted")return Qs;const c=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return c.status==="aborted"?Qs:c.status==="dirty"||n.value==="dirty"?OC(c.value):c});{if(n.value==="aborted")return Qs;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?Qs:l.status==="dirty"||n.value==="dirty"?OC(l.value):l}}if(s.type==="refinement"){const o=l=>{const c=s.refinement(l,a);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?Qs:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?Qs:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!F3(o))return Qs;const l=s.transform(o.value,a);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>F3(o)?Promise.resolve(s.transform(o.value,a)).then(l=>({status:n.value,value:l})):Qs);oa.assertNever(s)}}dm.create=(e,t,n)=>new dm({schema:e,typeName:Js.ZodEffects,effect:t,...Ai(n)});dm.createWithPreprocess=(e,t,n)=>new dm({schema:t,effect:{type:"preprocess",transform:e},typeName:Js.ZodEffects,...Ai(n)});class O0 extends Ri{_parse(t){return this._getType(t)===hs.undefined?ud(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}O0.create=(e,t)=>new O0({innerType:e,typeName:Js.ZodOptional,...Ai(t)});class Hy extends Ri{_parse(t){return this._getType(t)===hs.null?ud(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Hy.create=(e,t)=>new Hy({innerType:e,typeName:Js.ZodNullable,...Ai(t)});class IE extends Ri{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===hs.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}IE.create=(e,t)=>new IE({innerType:e,typeName:Js.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ai(t)});class PE extends Ri{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return wE(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Df(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Df(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}PE.create=(e,t)=>new PE({innerType:e,typeName:Js.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ai(t)});class rR extends Ri{_parse(t){if(this._getType(t)!==hs.nan){const r=this._getOrReturnCtx(t);return is(r,{code:zr.invalid_type,expected:hs.nan,received:r.parsedType}),Qs}return{status:"valid",value:t.data}}}rR.create=e=>new rR({typeName:Js.ZodNaN,...Ai(e)});const qAt=Symbol("zod_brand");class Gae extends Ri{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Qk extends Ri{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Qs:a.status==="dirty"?(n.dirty(),OC(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Qs:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new Qk({in:t,out:n,typeName:Js.ZodPipeline})}}class FE extends Ri{_parse(t){const n=this._def.innerType._parse(t),r=s=>(F3(s)&&(s.value=Object.freeze(s.value)),s);return wE(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}FE.create=(e,t)=>new FE({innerType:e,typeName:Js.ZodReadonly,...Ai(t)});function Jxe(e,t){const n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function FPe(e,t={},n){return e?ZS.create().superRefine((r,s)=>{const a=e(r);if(a instanceof Promise)return a.then(o=>{if(!o){const l=Jxe(t,r),c=l.fatal??n??!0;s.addIssue({code:"custom",...l,fatal:c})}});if(!a){const o=Jxe(t,r),l=o.fatal??n??!0;s.addIssue({code:"custom",...o,fatal:l})}}):ZS.create()}const GAt={object:Mo.lazycreate};var Js;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Js||(Js={}));const KAt=(e,t={message:`Input not instance of ${e.name}`})=>FPe(n=>n instanceof e,t),OPe=Jp.create,MPe=$y.create,YAt=rR.create,XAt=Uy.create,RPe=CE.create,QAt=O3.create,ZAt=eR.create,JAt=SE.create,e8t=NE.create,xee=ZS.create,t8t=Xw.create,n8t=o1.create,r8t=tR.create,LPe=rm.create,dO=Mo.create,s8t=Mo.strictCreate,DPe=AE.create,i8t=XB.create,a8t=jE.create,BPe=Q0.create,o8t=EE.create,l8t=nR.create,c8t=M3.create,u8t=a4.create,d8t=_E.create,f8t=kE.create,h8t=zy.create,p8t=TE.create,m8t=JS.create,ege=dm.create,x8t=O0.create,g8t=Hy.create,b8t=dm.createWithPreprocess,y8t=Qk.create,v8t=()=>OPe().optional(),w8t=()=>MPe().optional(),C8t=()=>RPe().optional(),S8t={string:e=>Jp.create({...e,coerce:!0}),number:e=>$y.create({...e,coerce:!0}),boolean:e=>CE.create({...e,coerce:!0}),bigint:e=>Uy.create({...e,coerce:!0}),date:e=>O3.create({...e,coerce:!0})},N8t=Qs,tge=Object.freeze(Object.defineProperty({__proto__:null,BRAND:qAt,DIRTY:OC,EMPTY_PATH:NAt,INVALID:Qs,NEVER:N8t,OK:ud,ParseStatus:Fu,Schema:Ri,ZodAny:ZS,ZodArray:rm,ZodBigInt:Uy,ZodBoolean:CE,ZodBranded:Gae,ZodCatch:PE,ZodDate:O3,ZodDefault:IE,ZodDiscriminatedUnion:XB,ZodEffects:dm,ZodEnum:zy,ZodError:Df,get ZodFirstPartyTypeKind(){return Js},ZodFunction:a4,ZodIntersection:jE,ZodIssueCode:zr,ZodLazy:_E,ZodLiteral:kE,ZodMap:nR,ZodNaN:rR,ZodNativeEnum:TE,ZodNever:o1,ZodNull:NE,ZodNullable:Hy,ZodNumber:$y,ZodObject:Mo,ZodOptional:O0,ZodParsedType:hs,ZodPipeline:Qk,ZodPromise:JS,ZodReadonly:FE,ZodRecord:EE,ZodSchema:Ri,ZodSet:M3,ZodString:Jp,ZodSymbol:eR,ZodTransformer:dm,ZodTuple:Q0,ZodType:Ri,ZodUndefined:SE,ZodUnion:AE,ZodUnknown:Xw,ZodVoid:tR,addIssueToContext:is,any:xee,array:LPe,bigint:XAt,boolean:RPe,coerce:S8t,custom:FPe,date:QAt,datetimeRegex:IPe,defaultErrorMap:QS,discriminatedUnion:i8t,effect:ege,enum:h8t,function:u8t,getErrorMap:ZM,getParsedType:og,instanceof:KAt,intersection:a8t,isAborted:hee,isAsync:wE,isDirty:pee,isValid:F3,late:GAt,lazy:d8t,literal:f8t,makeIssue:JM,map:l8t,nan:YAt,nativeEnum:p8t,never:n8t,null:e8t,nullable:g8t,number:MPe,object:dO,get objectUtil(){return fee},oboolean:C8t,onumber:w8t,optional:x8t,ostring:v8t,pipeline:y8t,preprocess:b8t,promise:m8t,quotelessJson:CAt,record:o8t,set:c8t,setErrorMap:SAt,strictObject:s8t,string:OPe,symbol:ZAt,transformer:ege,tuple:BPe,undefined:JAt,union:DPe,unknown:t8t,get util(){return oa},void:r8t},Symbol.toStringTag,{value:"Module"})),A8t=e=>e.message?e.message:"unspecified error";class eN extends ii{constructor(t){super(),this.code=qSt,this.errors=t,super.message=`Web3 validator found ${t.length} error[s]:
${this._compileErrors().join(`
`)}`}_compileErrors(){return this.errors.map(A8t)}}const j8t=["bool","int","uint","bytes","string","address","tuple"],$Pe=e=>typeof e=="object"&&"type"in e&&"name"in e,Kae=e=>typeof e=="string",Ca=e=>typeof e=="string"&&/^((-)?0x[0-9a-f]+|(0x))$/i.test(e);function UPe(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/))}const sR=e=>typeof e=="number"||typeof e=="bigint"||typeof e=="string"&&/^((-0x|0x|-)?[0-9a-f]+|(0x))$/i.test(e);function Yae(e){if(typeof e!="string")throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof e}`);return e.startsWith("0x")}const Xae=function(e){for(const[t,n]of Object.entries(e))if(n!==void 0&&n.length>0&&n[0]===0)throw new Error(`${t} cannot have leading zeroes, received: ${n.toString()}`)},E8t=["hex","number","blockNumber","blockNumberOrTag","filter","bloom"],c5=e=>{let t=e.replace(/ /,""),n,r=!1,s=[];if(e.includes("[")&&(t=t.slice(0,t.indexOf("[")),s=[...e.matchAll(/(?:\[(\d*)\])/g)].map(a=>parseInt(a[1],10)).map(a=>Number.isNaN(a)?-1:a),r=s.length>0),j8t.includes(t))return{baseType:t,isArray:r,baseTypeSize:n,arraySizes:s};if(t.startsWith("int"))n=parseInt(t.substring(3),10),t="int";else if(t.startsWith("uint"))n=parseInt(e.substring(4),10),t="uint";else if(t.startsWith("bytes"))n=parseInt(t.substring(5),10),t="bytes";else return{baseType:void 0,isArray:!1,baseTypeSize:void 0,arraySizes:s};return{baseType:t,isArray:r,baseTypeSize:n,arraySizes:s}},aV=(e,t={})=>{if(Object.keys(t).includes("type"))throw new eN([{keyword:"eth",message:'Either "eth" or "type" can be presented in schema',params:{eth:e},instancePath:"",schemaPath:""}]);const{baseType:r,baseTypeSize:s}=c5(e);if(!r&&!E8t.includes(e))throw new eN([{keyword:"eth",message:`Eth data type "${e}" is not valid`,params:{eth:e},instancePath:"",schemaPath:""}]);if(r){if(r==="tuple")throw new Error('"tuple" type is not implemented directly.');return{format:`${r}${s??""}`,required:!0}}return e?{format:e,required:!0}:{}},iR=(e,t="/0")=>{const n={type:"array",items:[],maxItems:e.length,minItems:e.length};for(const[r,s]of e.entries()){let a,o,l=[];$Pe(s)?(a=s.type,o=s.name||`${t}/${r}`,l=s.components):typeof s=="string"?(a=s,o=`${t}/${r}`):Array.isArray(s)&&(s[0]&&typeof s[0]=="string"&&s[0].startsWith("tuple")&&!Array.isArray(s[0])&&s[1]&&Array.isArray(s[1])?(a=s[0],o=`${t}/${r}`,l=s[1]):(a="tuple",o=`${t}/${r}`,l=s));const{baseType:c,isArray:u,arraySizes:d}=c5(a);let f,x=n;for(let g=d.length-1;g>0;g-=1)f={type:"array",$id:o,items:[],maxItems:d[g],minItems:d[g]},d[g]<0&&(delete f.maxItems,delete f.minItems),Array.isArray(x.items)?x.items.length===0?x.items=[f]:x.items.push(f):x.items=[x.items,f],x=f;if(c==="tuple"&&!u){const g=iR(l,o);g.$id=o,x.items.push(g)}else if(c==="tuple"&&u){const g=d[0],v=Object.assign({type:"array",$id:o,items:iR(l,o)},g>=0&&{minItems:g,maxItems:g});x.items.push(v)}else if(u){const g=d[0],v=Object.assign({type:"array",$id:o,items:aV(a)},g>=0&&{minItems:g,maxItems:g});x.items.push(v)}else Array.isArray(x.items)?x.items.push(Object.assign({$id:o},aV(a))):x.items.push(Object.assign({$id:o},aV(a)));x=n}return n},Qae=e=>iR(e),Zae=(e,t)=>t===1?e:Zae(e[0],t-1),Qj=(e,t,n)=>{const r=[];for(const[s,a]of e.entries()){let o,l,c=[];$Pe(a)?(o=a.type,l=a.name,c=a.components):typeof a=="string"?o=a:Array.isArray(a)&&(a[1]&&Array.isArray(a[1])?(o=a[0],c=a[1]):(o="tuple",c=a));const{baseType:u,isArray:d,arraySizes:f}=c5(o),x=Array.isArray(t)?t[s]:t[l];if(u==="tuple"&&!d)r.push(Qj(c,x,n));else if(u==="tuple"&&d){const g=[];for(const v of x)if(f.length>1){const w=Zae(v,f.length-1),C=[];for(const N of w)C.push(Qj(c,N,n));g.push(C)}else g.push(Qj(c,v,n));r.push(g)}else r.push(x)}return n=n??[],n.push(...r),n},zPe=e=>{if(e>=48&&e<=57)return e-48;if(e>=65&&e<=70)return e-55;if(e>=97&&e<=102)return e-87;throw new Error(`Invalid code point: ${e}`)},QB=e=>{if(!Ca(e))throw new Error("Invalid hex string");const[t,n]=e.startsWith("-")?[!0,e.slice(1)]:[!1,e],r=BigInt(n);return r>Number.MAX_SAFE_INTEGER?t?-r:r:r<Number.MIN_SAFE_INTEGER?r:t?-1*Number(r):Number(r)},ZB=e=>{if((typeof e=="number"||typeof e=="bigint")&&e<0)return`-0x${e.toString(16).slice(1)}`;if((typeof e=="number"||typeof e=="bigint")&&e>=0)return`0x${e.toString(16)}`;if(typeof e=="string"&&Ca(e)){const[t,n]=e.startsWith("-")?[!0,e.slice(1)]:[!1,e],r=n.split(/^(-)?0(x|X)/).slice(-1)[0];return`${t?"-":""}0x${r.replace(/^0+/,"").toLowerCase()}`}if(typeof e=="string"&&!Ca(e))return ZB(BigInt(e));throw new $ae(e)},aR=(e,t,n="0")=>{if(typeof e=="string"&&!Ca(e))return e.padStart(t,n);const r=typeof e=="string"&&Ca(e)?e:ZB(e),[s,a]=r.startsWith("-")?["-0x",r.slice(3)]:["0x",r.slice(2)];return`${s}${a.padStart(t,n)}`};function y1(e){let t="0x";for(const n of e){const r=n.toString(16);t+=r.length===1?`0${r}`:r}return t}const Lx={zero:48,nine:57,A:65,F:70,a:97,f:102};function nge(e){if(e>=Lx.zero&&e<=Lx.nine)return e-Lx.zero;if(e>=Lx.A&&e<=Lx.F)return e-(Lx.A-10);if(e>=Lx.a&&e<=Lx.f)return e-(Lx.a-10)}function u5(e){let t=0;if(e.startsWith("0")&&(e[1]==="x"||e[1]==="X")&&(t=2),e.length%2!==0)throw new i4(`hex string has odd length: ${e}`);const n=(e.length-t)/2,r=new Uint8Array(n);for(let s=0,a=t;s<n;s+=1){const o=nge(e.charCodeAt(a++)),l=nge(e.charCodeAt(a++));if(o===void 0||l===void 0)throw new i4(`Invalid byte sequence ("${e[a-2]}${e[a-1]}" in "${e}").`);r[s]=o*16+l}return r}function JB(e){var t;return!(e instanceof Uint8Array)&&((t=e==null?void 0:e.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"?Uint8Array.from(e):e}const HPe=Object.freeze(Object.defineProperty({__proto__:null,abiSchemaToJsonSchema:iR,codePointToInt:zPe,ensureIfUint8Array:JB,ethAbiToJsonSchema:Qae,fetchArrayElement:Zae,hexToNumber:QB,hexToUint8Array:u5,numberToHex:ZB,padLeft:aR,parseBaseType:c5,transformJsonDataToAbiFormat:Qj,uint8ArrayToHexString:y1},Symbol.toStringTag,{value:"Module"})),gee=e=>{var t,n;return e instanceof Uint8Array||((t=e==null?void 0:e.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"||((n=e==null?void 0:e.constructor)===null||n===void 0?void 0:n.name)==="Buffer"},i2=(e,t={abiType:"bytes"})=>{if(typeof e!="string"&&!Array.isArray(e)&&!gee(e)||typeof e=="string"&&Ca(e)&&e.startsWith("-")||typeof e=="string"&&!Ca(e))return!1;let n;if(typeof e=="string"){if(e.length%2!==0)return!1;n=u5(e)}else if(Array.isArray(e)){if(e.some(r=>r<0||r>255||!Number.isInteger(r)))return!1;n=new Uint8Array(e)}else n=e;if(t!=null&&t.abiType){const{baseTypeSize:r}=c5(t.abiType);return r?n.length===r:!0}return t!=null&&t.size?n.length===(t==null?void 0:t.size):!0},VPe=e=>{if(!/^(0x)?[0-9a-f]{40}$/i.test(e))return!1;const t=e.slice(2),n=YS(t.toLowerCase()),r=y1(td(JB(n))).slice(2);for(let s=0;s<40;s+=1)if(parseInt(r[s],16)>7&&t[s].toUpperCase()!==t[s]||parseInt(r[s],16)<=7&&t[s].toLowerCase()!==t[s])return!1;return!0},Uf=(e,t=!0)=>{if(typeof e!="string"&&!gee(e))return!1;let n;return gee(e)?n=y1(e):typeof e=="string"&&!Ca(e)?n=e.toLowerCase().startsWith("0x")?e:`0x${e}`:n=e,/^(0x)?[0-9a-f]{40}$/i.test(n)?/^(0x|0X)?[0-9a-f]{40}$/.test(n)||/^(0x|0X)?[0-9A-F]{40}$/.test(n)?!0:t?VPe(n):!0:!1},R3=(e,t)=>{if(t===BigInt(0))return BigInt(1);let n=e;for(let r=1;r<t;r+=1)n*=e;return n},l1=(e,t={abiType:"uint"})=>{if(!["number","string","bigint"].includes(typeof e)||typeof e=="string"&&e.length===0)return!1;let n;if(t!=null&&t.abiType){const{baseTypeSize:s}=c5(t.abiType);s&&(n=s)}else t.bitSize&&(n=t.bitSize);const r=R3(BigInt(2),BigInt(n??256))-BigInt(1);try{const s=typeof e=="string"&&Ca(e)?BigInt(QB(e)):BigInt(e);return s>=0&&s<=r}catch{return!1}},OE=(e,t={abiType:"int"})=>{if(!["number","string","bigint"].includes(typeof e)||typeof e=="number"&&e>Number.MAX_SAFE_INTEGER)return!1;let n;if(t!=null&&t.abiType){const{baseTypeSize:a,baseType:o}=c5(t.abiType);if(o!=="int")return!1;a&&(n=a)}else t.bitSize&&(n=t.bitSize);const r=R3(BigInt(2),BigInt((n??256)-1)),s=BigInt(-1)*R3(BigInt(2),BigInt((n??256)-1));try{const a=typeof e=="string"&&Ca(e)?BigInt(QB(e)):BigInt(e);return a>=s&&a<=r}catch{return!1}},WPe=e=>!!(OE(e)||typeof e=="string"&&/[0-9.]/.test(e)&&e.indexOf(".")===e.lastIndexOf(".")||typeof e=="number"),qPe=e=>l1(e),Tc=e=>Object.values(Ag).includes(e),bee=e=>Tc(e)||qPe(e),MA=e=>typeof e!="string"||!/^(0x)?[0-9a-f]{512}$/i.test(e)?!1:!!(/^(0x)?[0-9a-f]{512}$/.test(e)||/^(0x)?[0-9A-F]{512}$/.test(e)),e$=(e,t)=>{if(typeof t=="string"&&!Ca(t)||!MA(e))return!1;const n=typeof t=="string"?u5(t):t,r=y1(td(n)).slice(2);for(let s=0;s<12;s+=4){const a=(parseInt(r.slice(s,s+2),16)<<8)+parseInt(r.slice(s+2,s+4),16)&2047,o=zPe(e.charCodeAt(e.length-1-Math.floor(a/4))),l=1<<a%4;if((o&l)!==l)return!1}return!0},_8t=(e,t)=>{if(!MA(e)||!Uf(t))return!1;const n=aR(t,64);return e$(e,n)},k8t=(e,t)=>!MA(e)||!Uf(t)?!1:e$(e,t),T8t=e=>["number","string","boolean"].includes(typeof e)?typeof e=="boolean"?!0:typeof e=="string"&&!Ca(e)?e==="1"||e==="0":typeof e=="string"&&Ca(e)?e==="0x1"||e==="0x0":e===1||e===0:!1,ar=e=>e==null,tN=e=>typeof e=="object"&&!ar(e)&&!Array.isArray(e)&&!(e instanceof Dae),oR=e=>typeof e!="string"||!/^(0x)?[0-9a-f]{64}$/i.test(e)?!1:!!(/^(0x)?[0-9a-f]{64}$/.test(e)||/^(0x)?[0-9A-F]{64}$/.test(e)),I8t=(e,t)=>!MA(e)||!oR(t)?!1:e$(e,t),P8t=e=>{const t=["fromBlock","toBlock","address","topics","blockHash"];if(ar(e)||typeof e!="object"||!Object.keys(e).every(n=>t.includes(n))||!ar(e.fromBlock)&&!bee(e.fromBlock)||!ar(e.toBlock)&&!bee(e.toBlock))return!1;if(!ar(e.address)){if(Array.isArray(e.address)){if(!e.address.every(n=>Uf(n)))return!1}else if(!Uf(e.address))return!1}return!(!ar(e.topics)&&!e.topics.every(n=>ar(n)?!0:Array.isArray(n)?n.every(r=>oR(r)):!!oR(n)))},L3={address:e=>Uf(e),bloom:e=>MA(e),blockNumber:e=>qPe(e),blockTag:e=>Tc(e),blockNumberOrTag:e=>bee(e),bool:e=>T8t(e),bytes:e=>i2(e),filter:e=>P8t(e),hex:e=>Ca(e),uint:e=>l1(e),int:e=>OE(e),number:e=>WPe(e),string:e=>Kae(e)};for(let e=8;e<=256;e+=8)L3[`int${e}`]=t=>OE(t,{bitSize:e}),L3[`uint${e}`]=t=>l1(t,{bitSize:e});for(let e=1;e<=32;e+=1)L3[`bytes${e}`]=t=>i2(t,{size:e});L3.bytes256=L3.bytes;const wj=e=>{if((!(e!=null&&e.type)||(e==null?void 0:e.type)==="object")&&(e!=null&&e.properties)){const t={};for(const n of Object.keys(e.properties)){const r=wj(e.properties[n]);r&&(t[n]=r)}return Array.isArray(e.required)?dO(t).partial().required(e.required.reduce((n,r)=>Object.assign(Object.assign({},n),{[r]:!0}),{})):dO(t).partial()}if((e==null?void 0:e.type)==="array"&&(e!=null&&e.items)){if(Array.isArray(e.items)&&e.items.length>1&&e.maxItems!==void 0&&new Set(e.items.map(r=>r.$id)).size===e.items.length){const r=[];for(const s of e.items){const a=wj(s);a&&r.push(a)}return BPe(r)}const t=Array.isArray(e.items)?e.items[0]:e.items;let n=LPe(wj(t));return n=e.minItems!==void 0?n.min(e.minItems):n,n=e.maxItems!==void 0?n.max(e.maxItems):n,n}if(e.oneOf&&Array.isArray(e.oneOf))return DPe(e.oneOf.map(t=>wj(t)));if(e!=null&&e.format){if(!L3[e.format])throw new eAt(e.format);return xee().refine(L3[e.format],t=>({params:{value:t,format:e.format}}))}return e!=null&&e.type&&(e==null?void 0:e.type)!=="object"&&typeof tge[String(e.type)]=="function"?tge[String(e.type)]():dO({data:xee()}).partial()};class MC{static factory(){return MC.validatorInstance||(MC.validatorInstance=new MC),MC.validatorInstance}validate(t,n,r){var s,a;const l=wj(t).safeParse(n);if(!l.success){const c=this.convertErrors((a=(s=l.error)===null||s===void 0?void 0:s.issues)!==null&&a!==void 0?a:[]);if(c){if(r!=null&&r.silent)return c;throw new eN(c)}}}convertErrors(t){if(t&&Array.isArray(t)&&t.length>0)return t.map(n=>{var r;let s,a,o,l;l=n.path.join("/");const c=String(n.path[n.path.length-1]),u=n.path.join("/");if(n.code===zr.too_big)a="maxItems",l=`${u}/maxItems`,o={limit:n.maximum},s=`must NOT have more than ${n.maximum} items`;else if(n.code===zr.too_small)a="minItems",l=`${u}/minItems`,o={limit:n.minimum},s=`must NOT have fewer than ${n.minimum} items`;else if(n.code===zr.custom){const{value:d,format:f}=(r=n.params)!==null&&r!==void 0?r:{};typeof d>"u"?s=`value at "/${l}" is required`:s=`value "${typeof d=="object"?JSON.stringify(d):d}" at "/${l}" must pass "${f}" validation`,o={value:d}}return{keyword:a??c,instancePath:u?`/${u}`:"",schemaPath:l?`#${l}`:"#",params:o??{value:n.message},message:s??n.message}})}}class F8t{constructor(){this._validator=MC.factory()}validateJSONSchema(t,n,r){return this._validator.validate(t,n,r)}validate(t,n,r={silent:!1}){var s,a;const o=Qae(t);if(!(Array.isArray(o.items)&&((s=o.items)===null||s===void 0?void 0:s.length)===0&&n.length===0)){if(Array.isArray(o.items)&&((a=o.items)===null||a===void 0?void 0:a.length)===0&&n.length!==0)throw new eN([{instancePath:"/0",schemaPath:"/",keyword:"required",message:"empty schema against data can not be validated",params:n}]);return this._validator.validate(o,n,r)}}}const Us=new F8t;function a2(e){var t,n;return e instanceof Uint8Array||((t=e==null?void 0:e.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"||((n=e==null?void 0:e.constructor)===null||n===void 0?void 0:n.name)==="Buffer"}function dd(...e){const t=e.reduce((s,a)=>s+a.length,0),n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function t$(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n+=1)if(e[n]!==t[n])return!1;return!0}const n$={noether:BigInt(0),wei:BigInt(1),kwei:BigInt(1e3),Kwei:BigInt(1e3),babbage:BigInt(1e3),femtoether:BigInt(1e3),mwei:BigInt(1e6),Mwei:BigInt(1e6),lovelace:BigInt(1e6),picoether:BigInt(1e6),gwei:BigInt(1e9),Gwei:BigInt(1e9),shannon:BigInt(1e9),nanoether:BigInt(1e9),nano:BigInt(1e9),szabo:BigInt(1e12),microether:BigInt(1e12),micro:BigInt(1e12),finney:BigInt(1e15),milliether:BigInt(1e15),milli:BigInt(1e15),ether:BigInt("1000000000000000000"),kether:BigInt("1000000000000000000000"),grand:BigInt("1000000000000000000000"),mether:BigInt("1000000000000000000000000"),gether:BigInt("1000000000000000000000000000"),tether:BigInt("1000000000000000000000000000000")},yee="Warning: Using type `number` with values that are large or contain many decimals may cause loss of precision, it is recommended to use type `string` or `BigInt` when using conversion methods",Z0=e=>{if(Us.validate(["bytes"],[e]),a2(e))return e;if(Array.isArray(e))return new Uint8Array(e);if(typeof e=="string")return u5(e);throw new i4(e)},{uint8ArrayToHexString:O8t}=HPe,Ui=e=>O8t(Z0(e)),so=e=>typeof e=="string"&&e.slice(0,2).toLowerCase()!=="0x"?Z0(`0x${e}`):Z0(e),Zk=e=>(Us.validate(["hex"],[e]),QB(e)),M8t=Zk,Yl=(e,t)=>{typeof e!="bigint"&&Us.validate(["int"],[e]);let n=ZB(e);return t&&(!n.startsWith("-")&&n.length%2===1?n="0x0".concat(n.slice(2)):n.length%2===0&&n.startsWith("-")&&(n="-0x0".concat(n.slice(3)))),n},R8t=Yl,L8t=e=>Zk(e).toString(),fm=e=>{Us.validate(["string"],[e]);let t=e.replace(/^(?:\u0000)/,"");return t=t.replace(/(?:\u0000)$/,""),Ui(new TextEncoder().encode(t))},GPe=fm,D8t=fm,r$=e=>EPe(so(e)),B8t=e=>typeof e=="string"?r$(e):(Us.validate(["bytes"],[e]),EPe(e)),Jae=YS,$8t=r$,KPe=e=>{Us.validate(["string"],[e]);let t="";for(let n=0;n<e.length;n+=1){const r=e.charCodeAt(n).toString(16);t+=r.length%2!==0?`0${r}`:r}return`0x${t}`},U8t=KPe,YPe=e=>new TextDecoder("ascii").decode(so(e)),z8t=YPe,c1=(e,t)=>{if(typeof e=="string"&&Uf(e))return t?"address":`0x${e.toLowerCase().replace(/^0x/i,"")}`;if(typeof e=="boolean")return t?"bool":e?"0x01":"0x00";if(typeof e=="number")return t?e<0?"int256":"uint256":Yl(e);if(typeof e=="bigint")return t?"bigint":Yl(e);if(a2(e))return t?"bytes":Ui(e);if(typeof e=="object"&&e)return t?"string":fm(JSON.stringify(e));if(typeof e=="string"){if(e.startsWith("-0x")||e.startsWith("-0X"))return t?"int256":Yl(e);if(Ca(e))return t?"bytes":e;if(sR(e)&&!OE(e)&&!l1(e))return t?"bytes":`0x${e}`;if(sR(e)&&!OE(e)&&l1(e))return t?"uint":Yl(e);if(!Number.isFinite(e))return t?"string":fm(e)}throw new LNt(e)},Hd=e=>{if(typeof e=="number")return e>1e20?(console.warn(yee),BigInt(e)):e;if(typeof e=="bigint")return e>=Number.MIN_SAFE_INTEGER&&e<=Number.MAX_SAFE_INTEGER?Number(e):e;if(typeof e=="string"&&Ca(e))return Zk(e);try{return Hd(BigInt(e))}catch{throw new $ae(e)}},Gv=e=>{if(typeof e=="number")return BigInt(e);if(typeof e=="bigint")return e;if(typeof e=="string"&&sR(e))return e.startsWith("-")?-BigInt(e.substring(1)):BigInt(e);throw new $ae(e)},H8t=(e,t)=>{let n;if(typeof t=="string"){if(n=n$[t],!n)throw new xPe(t)}else{if(t<0||!Number.isInteger(t))throw new gPe(t);n=R3(BigInt(10),BigInt(t))}const r=String(Hd(e)),s=n.toString().length-1;if(s<=0)return r.toString();const a=r.padStart(s,"0"),o=a.slice(0,-s),l=a.slice(-s).replace(/\.?0+$/,"");return o===""?l?`0.${l}`:"0":l===""?o:`${o}.${l}`.slice(0,o.length+s+1)},V8t=(e,t)=>{Us.validate(["number"],[e]);let n;if(typeof t=="string"){if(n=n$[t],!n)throw new xPe(t)}else{if(t<0||!Number.isInteger(t))throw new gPe(t);n=R3(BigInt(10),BigInt(t))}let r=e;typeof r=="number"&&(r<1e-15&&console.warn(yee),r>1e20?(console.warn(yee),r=BigInt(r)):r=r.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20}));const[s,a]=String(typeof r=="string"&&!Ca(r)?r:Hd(r)).split(".").concat(""),l=BigInt(`${s}${a}`)*n,c=a.length;return c===0?l.toString():l.toString().slice(0,-c)},ox=e=>{if(!Uf(e,!1))throw new Uae(e);const t=e.toLowerCase().replace(/^0x/i,""),n=y1(td(JB(Jae(t))));if(ar(n)||n==="0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470")return"";let r="0x";const s=n.replace(/^0x/i,"");for(let a=0;a<t.length;a+=1)parseInt(s[a],16)>7?r+=t[a].toUpperCase():r+=t[a];return r},XPe=e=>{if(typeof e=="boolean")return e;if(typeof e=="number"&&(e===0||e===1)||typeof e=="bigint"&&(e===BigInt(0)||e===BigInt(1)))return!!e;if(typeof e=="string"&&!Ca(e)&&(e==="1"||e==="0"||e==="false"||e==="true"))return e==="true"?!0:e==="false"?!1:!!Number(e);if(typeof e=="string"&&Ca(e)&&(e==="0x1"||e==="0x0"))return!!Hd(e);throw new zae(e)};let eoe=class extends Die{constructor(){super(...arguments),this.maxListeners=Number.MAX_SAFE_INTEGER}setMaxListeners(t){return this.maxListeners=t,this}getMaxListeners(){return this.maxListeners}};const W8t=Ca,q8t=sR,G8t=VPe,K8t=Uf,Y8t=MA,X8t=e$,Q8t=_8t,Z8t=k8t,J8t=oR,e7t=I8t,t7t=(e,t)=>{const n=typeof e=="string"&&Tc(e),r=typeof t=="string"&&Tc(t);if(e===t||(e==="earliest"||e===0)&&(t==="earliest"||t===0))return 0;if(e==="earliest")return-1;if(t==="earliest")return 1;if(n&&r){const o={[Ag.EARLIEST]:1,[Ag.FINALIZED]:2,[Ag.SAFE]:3,[Ag.LATEST]:4,[Ag.PENDING]:5};return o[e]<o[t]?-1:1}if(n&&!r||!n&&r)throw new BNt("Cannot compare blocktag with provided non-blocktag input.");const s=BigInt(e),a=BigInt(t);return s<a?-1:s===a?0:1},uy=e=>typeof e=="object"&&!ar(e)&&Object.keys(e).length!==0&&["input","data","from","gas","gasPrice","gasLimit","address","jsonInterface","syncWithContext","dataInputFill"].some(t=>t in e),Xs=ar,rge=e=>typeof e=="object"&&!ar(e)&&!Array.isArray(e)&&!(e instanceof Dae),o2=(e,...t)=>{if(!rge(e))return e;const n=Object.assign({},e);for(const r of t)for(const s in r)rge(r[s])?(n[s]||(n[s]={}),n[s]=o2(n[s],r[s])):!ar(r[s])&&Object.hasOwnProperty.call(r,s)&&(Array.isArray(r[s])||r[s]instanceof Dae?n[s]=r[s].slice(0):n[s]=r[s]);return n},nN=(e,t,n="0")=>typeof e=="string"?Ca(e)?aR(e,t,n):e.padStart(t,n):(Us.validate(["int"],[e]),aR(e,t,n)),QPe=(e,t,n="0")=>{if(typeof e=="string"&&!Ca(e))return e.padEnd(t,n);const r=typeof e=="string"&&Ca(e)?e:Yl(e),s=r.startsWith("-")?3:2;return Us.validate([r.startsWith("-")?"int":"uint"],[e]),r.padEnd(t+s,n)},ZPe=QPe,ME=nN,JPe=(e,t=64)=>{Us.validate(["int"],[e]);const n=Hd(e);if(n>=0)return nN(c1(n),t);const r=R3(BigInt(2),BigInt(t*4));if(-n>=r)throw new bPe(`value: ${e}, nibbleWidth: ${t}`);const a=BigInt(n)+r;return nN(Yl(a),t)},n7t=(e,t=64)=>{Us.validate(["int"],[e]);const n=Hd(e);if(n<0)return n;const r=Math.ceil(Math.log(Number(n))/Math.log(2));if(r>t*4)throw new bPe(`value: "${e}", nibbleWidth: "${t}"`);if(t*4!==r)return n;const s=R3(BigInt(2),BigInt(t)*BigInt(4));return Hd(BigInt(n)-s)},{parseBaseType:r7t}=HPe,lg=e=>typeof e=="object"&&!ar(e)&&"number"in e&&"bytes"in e,s7t=(e,t,n=[])=>{let r=Object.assign({},e),s;for(const a of t){if(r.oneOf&&s){const o=s,l=n.find(([c])=>c===o);l&&l[0]===s&&(r=r.oneOf[l[1]])}if(!r.properties&&!r.items)return;r.properties?r=r.properties[a]:r.items&&r.items.properties?r=r.items.properties[a]:r.items&&tN(r.items)?r=r.items:r.items&&Array.isArray(r.items)&&(r=r.items[parseInt(a,10)]),r&&a&&(s=a)}return r},RE=(e,t,n)=>{try{const{baseType:r,baseTypeSize:s}=r7t(t);if(r==="int"||r==="uint")switch(n.number){case Vh.NUMBER:return Number(Gv(e));case Vh.HEX:return Yl(Gv(e));case Vh.STR:return Gv(e).toString();case Vh.BIGINT:return Gv(e);default:throw new cee(`Invalid format: ${String(n.number)}`)}if(r==="bytes"){let a;switch(s?typeof e=="string"?a=nN(e,s*2):a2(e)&&(a=dd(new Uint8Array(s-e.length),e)):a=e,n.bytes){case a1.HEX:return Ui(Z0(a));case a1.UINT8ARRAY:return Z0(a);default:throw new cee(`Invalid format: ${String(n.bytes)}`)}}if(r==="string")return String(e)}catch{return e}return e},sge=({value:e,schemaProp:t,schema:n,object:r,key:s,dataPath:a,format:o,oneOfPath:l=[]})=>{var c,u;if(Array.isArray(e)){let d=t;if((t==null?void 0:t.oneOf)!==void 0&&t.oneOf.forEach((f,x)=>{var g,v;!Array.isArray(t==null?void 0:t.items)&&(typeof e[0]=="object"&&((g=f==null?void 0:f.items)===null||g===void 0?void 0:g.type)==="object"||typeof e[0]=="string"&&((v=f==null?void 0:f.items)===null||v===void 0?void 0:v.type)!=="object")&&(d=f,l.push([s,x]))}),ar(d==null?void 0:d.items))return delete r[s],a.pop(),!0;if(tN(d.items)&&!ar(d.items.format)){for(let f=0;f<e.length;f+=1)r[s][f]=RE(e[f],(c=d==null?void 0:d.items)===null||c===void 0?void 0:c.format,o);return a.pop(),!0}if(!Array.isArray(d==null?void 0:d.items)&&((u=d==null?void 0:d.items)===null||u===void 0?void 0:u.type)==="object"){for(const f of e)s$(f,n,a,o,l);return a.pop(),!0}if(Array.isArray(d==null?void 0:d.items)){for(let f=0;f<e.length;f+=1)r[s][f]=RE(e[f],d.items[f].format,o);return a.pop(),!0}}return!1},s$=(e,t,n,r,s=[])=>{var a;if(!tN(e)&&!Array.isArray(e))return RE(e,t==null?void 0:t.format,r);const o=e;if(Array.isArray(o)&&(t==null?void 0:t.type)==="array"&&((a=t==null?void 0:t.items)===null||a===void 0?void 0:a.type)==="object")sge({value:o,schemaProp:t,schema:t,object:o,key:"",dataPath:n,format:r,oneOfPath:s});else for(const[l,c]of Object.entries(o)){n.push(l);let u=s7t(t,n,s);if(ar(u)){delete o[l],n.pop();continue}if(tN(c)){s$(c,t,n,r,s),n.pop();continue}if(!sge({value:c,schemaProp:u,schema:t,object:o,key:l,dataPath:n,format:r,oneOfPath:s})){if((u==null?void 0:u.format)===void 0&&(u==null?void 0:u.oneOf)!==void 0){for(const[d,f]of u.oneOf.entries())if((f==null?void 0:f.format)!==void 0){u=f;break}}o[l]=RE(c,u.format,r),n.pop()}}return o},Ur=(e,t,n=id)=>{let r;tN(t)?r=o2({},t):Array.isArray(t)?r=[...t]:r=t;const s=tN(e)?e:Qae(e);if(!s.properties&&!s.items&&!s.format)throw new cee("Invalid json schema for formatting");return s$(r,s,[],n)},eFe="0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",rN=e=>{let t;return typeof e=="bigint"||typeof e=="number"?t=YS(e.toString()):Array.isArray(e)?t=new Uint8Array(e):typeof e=="string"&&!Ca(e)?t=YS(e):t=Z0(e),Ui(td(JB(t)))},Jk=e=>{let t;typeof e=="string"?e.startsWith("0x")&&Ca(e)?t=so(e):t=YS(e):t=e;const n=rN(t);return n===eFe?void 0:n},zf=e=>{const t=Jk(e);return ar(t)?eFe:t},i7t=e=>{if(Array.isArray(e))throw new Error("Autodetection of array types is not supported.");let t,n;if(typeof e=="object"&&("t"in e||"type"in e)&&("v"in e||"value"in e))t="t"in e?e.t:e.type,n="v"in e?e.v:e.value,t=t.toLowerCase()==="bigint"?"int":t;else{if(typeof e=="bigint")return["int",e];t=c1(e,!0),n=c1(e),!t.startsWith("int")&&!t.startsWith("uint")&&(t="bytes")}return(t.startsWith("int")||t.startsWith("uint"))&&typeof n=="string"&&!/^(-)?0x/i.test(n)&&(n=Gv(n)),[t,n]},a7t=e=>e.startsWith("int[")?`int256${e.slice(3)}`:e==="int"?"int256":e.startsWith("uint[")?`uint256'${e.slice(4)}`:e==="uint"?"uint256":e,oV=(e,t)=>{const n=/^(\d+).*$/.exec(e.slice(t));return n?parseInt(n[1],10):0},ige=e=>e.toString(2).length,age=(e,t)=>{const n=t.toString();if(e==="string"){if(typeof t=="string")return fm(t);throw new RNt(t)}if(e==="bool"||e==="boolean"){if(typeof t=="boolean")return t?"01":"00";throw new zae(t)}if(e==="address"){if(!Uf(n))throw new Uae(n);return n}const r=a7t(e);if(e.startsWith("uint")){const s=oV(r,4);if(s%8||s<8||s>256)throw new Hxe(n);const a=Hd(n);if(ige(a)>s)throw new Vxe(n);if(a<BigInt(0))throw new DNt(n);return s?ME(a.toString(16),s/8*2):a.toString(16)}if(e.startsWith("int")){const s=oV(r,3);if(s%8||s<8||s>256)throw new Hxe(e);const a=Hd(n);if(ige(a)>s)throw new Vxe(n);return a<BigInt(0)?JPe(a.toString(),s/8*2):s?ME(a.toString(16),s/4):a.toString(16)}if(r==="bytes"){if(n.replace(/^0x/i,"").length%2!==0)throw new i4(n);return n}if(e.startsWith("bytes")){if(n.replace(/^0x/i,"").length%2!==0)throw new i4(n);const s=oV(e,5);if(!s||s<1||s>64||s<n.replace(/^0x/i,"").length/2)throw new i4(n);return ZPe(n,s*2)}return""},tFe=e=>{const[t,n]=i7t(e);return Array.isArray(n)?n.map(a=>age(t,a).replace("0x","")).join(""):age(t,n).replace("0x","")},toe=(...e)=>`0x${e.map(tFe).join("").toLowerCase()}`,o7t=(...e)=>Jk(toe(...e)),l7t=(...e)=>zf(toe(...e)),c7t=e=>Jk(`0x${(typeof e=="number"?e.toString():e).padStart(64,"0")}`);function u7t(e){return SPe(e)}const LE=e=>u7t(e),d7t=e=>Ui(LE(e));var i$=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function nFe(e){return(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function rFe(e,t,n){return i$(this,void 0,void 0,function*(){let r;const s=yield Promise.race([e instanceof Promise?e:e(),new Promise((a,o)=>{r=setTimeout(()=>n?o(n):a(void 0),t)})]);if(r&&clearTimeout(r),s instanceof Error)throw s;return s})}function noe(e,t){let n;return[new Promise((s,a)=>{n=setInterval(function o(){return i$(this,void 0,void 0,function*(){try{const l=yield rFe(e,t);ar(l)||(clearInterval(n),s(l))}catch(l){clearInterval(n),a(l)}}),o}(),t)}),n]}function f7t(e,t){return i$(this,void 0,void 0,function*(){return noe(e,t)[0]})}function roe(e,t){let n;const r=new Promise((s,a)=>{n=setTimeout(()=>{a(t)},e)});return[n,r]}function sFe(e,t){let n;const r=new Promise((s,a)=>{n=setInterval(()=>{i$(this,void 0,void 0,function*(){const o=yield e();o&&(clearInterval(n),a(o))})},t)});return[n,r]}const soe=()=>{const e=LE(16);e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=Ui(e);return[t.substring(2,10),t.substring(10,14),t.substring(14,18),t.substring(18,22),t.substring(22,34)].join("-")},ioe=e=>{const t=e.error.code;return cd.has(t)||t>=-32099&&t<=-32e3},Cy=e=>!Array.isArray(e)&&!!e&&e.jsonrpc==="2.0"&&"result"in e&&ar(e.error)&&(typeof e.id=="number"||typeof e.id=="string"),Sy=e=>!Array.isArray(e)&&e.jsonrpc==="2.0"&&!!e&&ar(e.result)&&"error"in e&&(typeof e.id=="number"||typeof e.id=="string"),a$=e=>!Array.isArray(e)&&!!e&&e.jsonrpc==="2.0"&&!ar(e.params)&&!ar(e.method),iFe=e=>!Array.isArray(e)&&!!e&&e.jsonrpc==="2.0"&&"id"in e&&"result"in e,lR=e=>Cy(e)||Sy(e),aoe=e=>Array.isArray(e)?e.every(lR):lR(e),DE=e=>Array.isArray(e)&&e.length>0&&aoe(e);let fO;const aFe=e=>{fO=e},D3=e=>{var t,n,r,s;return typeof fO<"u"&&(fO+=1),{jsonrpc:(t=e.jsonrpc)!==null&&t!==void 0?t:"2.0",id:(r=(n=e.id)!==null&&n!==void 0?n:fO)!==null&&r!==void 0?r:soe(),method:e.method,params:(s=e.params)!==null&&s!==void 0?s:void 0}},ooe=e=>e.map(t=>D3(t)),Qm=e=>Array.isArray(e)&&e.length>0,h7t=Object.freeze(Object.defineProperty({__proto__:null,isBatchRequest:Qm,isBatchResponse:DE,isResponseRpcError:ioe,isResponseWithError:Sy,isResponseWithNotification:a$,isResponseWithResult:Cy,isSubscriptionResult:iFe,isValidResponse:aoe,setRequestIdStart:aFe,toBatchPayload:ooe,toPayload:D3,validateResponse:lR},Symbol.toStringTag,{value:"Module"}));var lV=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},oFe;class cR{constructor({timeout:t,eagerStart:n,timeoutMessage:r}={timeout:0,eagerStart:!1,timeoutMessage:"DeferredPromise timed out"}){this[oFe]="Promise",this._state="pending",this._promise=new Promise((s,a)=>{this._resolve=s,this._reject=a}),this._timeoutMessage=r,this._timeoutInterval=t,n&&this.startTimer()}get state(){return this._state}then(t,n){return lV(this,void 0,void 0,function*(){return this._promise.then(t,n)})}catch(t){return lV(this,void 0,void 0,function*(){return this._promise.catch(t)})}finally(t){return lV(this,void 0,void 0,function*(){return this._promise.finally(t)})}resolve(t){this._resolve(t),this._state="fulfilled",this._clearTimeout()}reject(t){this._reject(t),this._state="rejected",this._clearTimeout()}startTimer(){this._timeoutInterval&&this._timeoutInterval>0&&(this._timeoutId=setTimeout(this._checkTimeout.bind(this),this._timeoutInterval))}_checkTimeout(){this._state==="pending"&&this._timeoutId&&this.reject(new lPe(this._timeoutMessage))}_clearTimeout(){this._timeoutId&&clearTimeout(this._timeoutId)}}oFe=Symbol.toStringTag;class lFe{constructor(t,n){this.eventEmitter=t,this.autoReconnect=n,this.chunkTimeout=1e3*15}clearQueues(){typeof this._clearQueues=="function"&&this._clearQueues()}onError(t){this._clearQueues=t}parseResponse(t){const n=[];return t.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach(s=>{let a=s;this.lastChunk&&(a=this.lastChunk+a);let o;try{o=JSON.parse(a)}catch{this.lastChunk=a,this.lastChunkTimeout&&clearTimeout(this.lastChunkTimeout),this.lastChunkTimeout=setTimeout(()=>{this.autoReconnect||(this.clearQueues(),this.eventEmitter.emit("error",new YB({id:1,jsonrpc:"2.0",error:{code:2,message:"Chunk timeout"}})))},this.chunkTimeout);return}clearTimeout(this.lastChunkTimeout),this.lastChunk=void 0,o&&n.push(o)}),n}}var oge=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class loe extends Yk{constructor(){super(...arguments),this._eventEmitter=new Die,this._chainId="",this._accounts=[]}_getChainId(){return oge(this,void 0,void 0,function*(){var t;const n=yield this.request(D3({method:"eth_chainId",params:[]}));return(t=n==null?void 0:n.result)!==null&&t!==void 0?t:""})}_getAccounts(){return oge(this,void 0,void 0,function*(){var t;const n=yield this.request(D3({method:"eth_accounts",params:[]}));return(t=n==null?void 0:n.result)!==null&&t!==void 0?t:[]})}_onConnect(){Promise.all([this._getChainId().then(t=>{t!==this._chainId&&(this._chainId=t,this._eventEmitter.emit("chainChanged",this._chainId))}).catch(t=>{console.error(t)}),this._getAccounts().then(t=>{this._accounts.length===t.length&&t.every(n=>t.includes(n))||(this._accounts=t,this._onAccountsChanged())}).catch(t=>{console.error(t)})]).then(()=>this._eventEmitter.emit("connect",{chainId:this._chainId})).catch(t=>{console.error(t)})}_onDisconnect(t,n){this._eventEmitter.emit("disconnect",new UNt(t,n))}_onAccountsChanged(){this._eventEmitter.emit("accountsChanged",this._accounts)}}var cV=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const p7t={autoReconnect:!0,delay:5e3,maxAttempts:5},m7t=1e3;class cFe extends loe{get SocketConnection(){return this._socketConnection}constructor(t,n,r){if(super(),this._connectionStatus="connecting",this._onMessageHandler=this._onMessage.bind(this),this._onOpenHandler=this._onConnect.bind(this),this._onCloseHandler=this._onCloseEvent.bind(this),this._onErrorHandler=this._onError.bind(this),!this._validateProviderPath(t))throw new uee(t);this._socketPath=t,this._socketOptions=n,this._reconnectOptions=Object.assign(Object.assign({},p7t),r??{}),this._pendingRequestsQueue=new Map,this._sentRequestsQueue=new Map,this._init(),this.connect(),this.chunkResponseParser=new lFe(this._eventEmitter,this._reconnectOptions.autoReconnect),this.chunkResponseParser.onError(()=>{this._clearQueues()}),this.isReconnecting=!1}_init(){this._reconnectAttempts=0}connect(){try{this._openSocketConnection(),this._connectionStatus="connecting",this._addSocketListeners()}catch(t){if(this.isReconnecting)setImmediate(()=>{this._reconnect()});else throw this._connectionStatus="disconnected",t&&t.message?new Xk(`Error while connecting to ${this._socketPath}. Reason: ${t.message}`):new uee(this._socketPath)}}_validateProviderPath(t){return!!t}getPendingRequestQueueSize(){return this._pendingRequestsQueue.size}getSentRequestsQueueSize(){return this._sentRequestsQueue.size}supportsSubscriptions(){return!0}on(t,n){this._eventEmitter.on(t,n)}once(t,n){this._eventEmitter.once(t,n)}removeListener(t,n){this._eventEmitter.removeListener(t,n)}_onDisconnect(t,n){this._connectionStatus="disconnected",super._onDisconnect(t,n)}disconnect(t,n){const r=t??m7t;this._removeSocketListeners(),this.getStatus()!=="disconnected"&&this._closeSocketConnection(r,n),this._onDisconnect(r,n)}safeDisconnect(t,n){return cV(this,arguments,void 0,function*(r,s,a=!1,o=1e3){let l=0;yield cV(this,void 0,void 0,function*(){return new Promise(u=>{const d=setInterval(()=>{a&&l>=5&&this.clearQueues(),this.getPendingRequestQueueSize()===0&&this.getSentRequestsQueueSize()===0&&(clearInterval(d),u(!0)),l+=1},o)})}),this.disconnect(r,s)})}removeAllListeners(t){this._eventEmitter.removeAllListeners(t)}_onError(t){this.isReconnecting?this._reconnect():this._eventEmitter.emit("error",t)}reset(){this._sentRequestsQueue.clear(),this._pendingRequestsQueue.clear(),this._init(),this._removeSocketListeners(),this._addSocketListeners()}_reconnect(){this.isReconnecting||(this.isReconnecting=!0,this._sentRequestsQueue.size>0&&this._sentRequestsQueue.forEach((t,n)=>{t.deferredPromise.reject(new nNt),this._sentRequestsQueue.delete(n)}),this._reconnectAttempts<this._reconnectOptions.maxAttempts?(this._reconnectAttempts+=1,setTimeout(()=>{this._removeSocketListeners(),this.connect(),this.isReconnecting=!1},this._reconnectOptions.delay)):(this.isReconnecting=!1,this._clearQueues(),this._removeSocketListeners(),this._eventEmitter.emit("error",new tNt(this._reconnectOptions.maxAttempts))))}request(t){return cV(this,void 0,void 0,function*(){if(Xs(this._socketConnection))throw new Error("Connection is undefined");this.getStatus()==="disconnected"&&this.connect();const n=Qm(t)?t[0].id:t.id;if(!n)throw new cNt("Request Id not defined");if(this._sentRequestsQueue.has(n))throw new rNt(n);const r=new cR;r.catch(a=>{this._eventEmitter.emit("error",a)});const s={payload:t,deferredPromise:r};if(this.getStatus()==="connecting")return this._pendingRequestsQueue.set(n,s),s.deferredPromise;this._sentRequestsQueue.set(n,s);try{this._sendToSocket(s.payload)}catch(a){this._sentRequestsQueue.delete(n),this._eventEmitter.emit("error",a)}return r})}_onConnect(){this._connectionStatus="connected",this._reconnectAttempts=0,super._onConnect(),this._sendPendingRequests()}_sendPendingRequests(){for(const[t,n]of this._pendingRequestsQueue.entries())try{this._sendToSocket(n.payload),this._pendingRequestsQueue.delete(t),this._sentRequestsQueue.set(t,n)}catch(r){this._pendingRequestsQueue.delete(t),this._eventEmitter.emit("error",r)}}_onMessage(t){const n=this._parseResponses(t);if(!(Xs(n)||n.length===0))for(const r of n){if(a$(r)&&r.method.endsWith("_subscription")){this._eventEmitter.emit("message",r);return}const s=DE(r)?r[0].id:r.id,a=this._sentRequestsQueue.get(s);if(!a)return;(DE(r)||Cy(r)||Sy(r))&&(this._eventEmitter.emit("message",r),a.deferredPromise.resolve(r)),this._sentRequestsQueue.delete(s)}}clearQueues(t){this._clearQueues(t)}_clearQueues(t){this._pendingRequestsQueue.size>0&&this._pendingRequestsQueue.forEach((n,r)=>{n.deferredPromise.reject(new lee(t)),this._pendingRequestsQueue.delete(r)}),this._sentRequestsQueue.size>0&&this._sentRequestsQueue.forEach((n,r)=>{n.deferredPromise.reject(new lee(t)),this._sentRequestsQueue.delete(r)}),this._removeSocketListeners()}}const uFe=Object.freeze(Object.defineProperty({__proto__:null,ChunkResponseParser:lFe,Eip1193Provider:loe,EventEmitter:eoe,SocketProvider:cFe,Web3DeferredPromise:cR,asciiToHex:KPe,bytesToHex:Ui,bytesToUint8Array:Z0,checkAddressCheckSum:G8t,compareBlockNumbers:t7t,convert:s$,convertScalarValue:RE,encodePacked:toe,ethUnitMap:n$,format:Ur,fromAscii:U8t,fromDecimal:R8t,fromTwosComplement:n7t,fromUtf8:GPe,fromWei:H8t,getStorageSlotNumForLongString:c7t,hexToAscii:YPe,hexToBytes:so,hexToNumber:Zk,hexToNumberString:L8t,hexToString:$8t,hexToUtf8:r$,isAddress:K8t,isBatchRequest:Qm,isBatchResponse:DE,isBloom:Y8t,isContractAddressInBloom:Z8t,isContractInitOptions:uy,isDataFormat:lg,isHex:q8t,isHexStrict:W8t,isInBloom:X8t,isNullish:Xs,isPromise:nFe,isResponseRpcError:ioe,isResponseWithError:Sy,isResponseWithNotification:a$,isResponseWithResult:Cy,isSubscriptionResult:iFe,isTopic:J8t,isTopicInBloom:e7t,isUint8Array:a2,isUserEthereumAddressInBloom:Q8t,isValidResponse:aoe,jsonRpc:h7t,keccak256:rN,keccak256Wrapper:rN,leftPad:ME,mergeDeep:o2,numberToHex:Yl,padLeft:nN,padRight:QPe,pollTillDefined:f7t,pollTillDefinedAndReturnIntervalId:noe,processSolidityEncodePackedArgs:tFe,randomBytes:LE,randomHex:d7t,rejectIfConditionAtInterval:sFe,rejectIfTimeout:roe,rightPad:ZPe,setRequestIdStart:aFe,sha3:Jk,sha3Raw:zf,soliditySha3:o7t,soliditySha3Raw:l7t,stringToHex:D8t,toAscii:z8t,toBatchPayload:ooe,toBigInt:Gv,toBool:XPe,toChecksumAddress:ox,toDecimal:M8t,toHex:c1,toNumber:Hd,toPayload:D3,toTwosComplement:JPe,toUtf8:B8t,toWei:V8t,uint8ArrayConcat:dd,uint8ArrayEquals:t$,utf8ToBytes:Jae,utf8ToHex:fm,uuidV4:soe,validateResponse:lR,waitWithTimeout:rFe},Symbol.toStringTag,{value:"Module"}));class o${constructor(){this._emitter=new eoe}on(t,n){this._emitter.on(t,n)}once(t,n){this._emitter.once(t,n)}off(t,n){this._emitter.off(t,n)}emit(t,n){this._emitter.emit(t,n)}listenerCount(t){return this._emitter.listenerCount(t)}listeners(t){return this._emitter.listeners(t)}eventNames(){return this._emitter.eventNames()}removeAllListeners(){return this._emitter.removeAllListeners()}setMaxListenerWarningThreshold(t){this._emitter.setMaxListeners(t)}getMaxListeners(){return this._emitter.getMaxListeners()}}var B3;(function(e){e.CONFIG_CHANGE="CONFIG_CHANGE"})(B3||(B3={}));class x7t extends o${constructor(t){super(),this.config={handleRevert:!1,defaultAccount:void 0,defaultBlock:"latest",transactionBlockTimeout:50,transactionConfirmationBlocks:24,transactionPollingInterval:1e3,transactionPollingTimeout:750*1e3,transactionReceiptPollingInterval:void 0,transactionSendTimeout:750*1e3,transactionConfirmationPollingInterval:void 0,blockHeaderTimeout:10,maxListenersWarningThreshold:100,contractDataInputFill:"data",defaultNetworkId:void 0,defaultChain:"mainnet",defaultHardfork:"london",defaultCommon:void 0,defaultTransactionType:"0x2",defaultMaxPriorityFeePerGas:c1(25e8),enableExperimentalFeatures:{useSubscriptionWhenCheckingBlockTimeout:!1,useRpcCallSpecification:!1},transactionBuilder:void 0,transactionTypeParser:void 0,customTransactionSchema:void 0,defaultReturnFormat:id,ignoreGasPricing:!1},this.setConfig(t??{})}setConfig(t){const n=Object.keys(t);for(const r of n)this._triggerConfigChange(r,t[r]),!Xs(t[r])&&typeof t[r]=="number"&&r==="maxListenersWarningThreshold"&&this.setMaxListenerWarningThreshold(Number(t[r]));Object.assign(this.config,t)}get handleRevert(){return this.config.handleRevert}set handleRevert(t){this._triggerConfigChange("handleRevert",t),this.config.handleRevert=t}get contractDataInputFill(){return this.config.contractDataInputFill}set contractDataInputFill(t){this._triggerConfigChange("contractDataInputFill",t),this.config.contractDataInputFill=t}get defaultAccount(){return this.config.defaultAccount}set defaultAccount(t){this._triggerConfigChange("defaultAccount",t),this.config.defaultAccount=t}get defaultBlock(){return this.config.defaultBlock}set defaultBlock(t){this._triggerConfigChange("defaultBlock",t),this.config.defaultBlock=t}get transactionSendTimeout(){return this.config.transactionSendTimeout}set transactionSendTimeout(t){this._triggerConfigChange("transactionSendTimeout",t),this.config.transactionSendTimeout=t}get transactionBlockTimeout(){return this.config.transactionBlockTimeout}set transactionBlockTimeout(t){this._triggerConfigChange("transactionBlockTimeout",t),this.config.transactionBlockTimeout=t}get transactionConfirmationBlocks(){return this.config.transactionConfirmationBlocks}set transactionConfirmationBlocks(t){this._triggerConfigChange("transactionConfirmationBlocks",t),this.config.transactionConfirmationBlocks=t}get transactionPollingInterval(){return this.config.transactionPollingInterval}set transactionPollingInterval(t){this._triggerConfigChange("transactionPollingInterval",t),this.config.transactionPollingInterval=t,this.transactionReceiptPollingInterval=t,this.transactionConfirmationPollingInterval=t}get transactionPollingTimeout(){return this.config.transactionPollingTimeout}set transactionPollingTimeout(t){this._triggerConfigChange("transactionPollingTimeout",t),this.config.transactionPollingTimeout=t}get transactionReceiptPollingInterval(){return this.config.transactionReceiptPollingInterval}set transactionReceiptPollingInterval(t){this._triggerConfigChange("transactionReceiptPollingInterval",t),this.config.transactionReceiptPollingInterval=t}get transactionConfirmationPollingInterval(){return this.config.transactionConfirmationPollingInterval}set transactionConfirmationPollingInterval(t){this._triggerConfigChange("transactionConfirmationPollingInterval",t),this.config.transactionConfirmationPollingInterval=t}get blockHeaderTimeout(){return this.config.blockHeaderTimeout}set blockHeaderTimeout(t){this._triggerConfigChange("blockHeaderTimeout",t),this.config.blockHeaderTimeout=t}get enableExperimentalFeatures(){return this.config.enableExperimentalFeatures}set enableExperimentalFeatures(t){this._triggerConfigChange("enableExperimentalFeatures",t),this.config.enableExperimentalFeatures=t}get maxListenersWarningThreshold(){return this.config.maxListenersWarningThreshold}set maxListenersWarningThreshold(t){this._triggerConfigChange("maxListenersWarningThreshold",t),this.setMaxListenerWarningThreshold(t),this.config.maxListenersWarningThreshold=t}get defaultReturnFormat(){return this.config.defaultReturnFormat}set defaultReturnFormat(t){this._triggerConfigChange("defaultReturnFormat",t),this.config.defaultReturnFormat=t}get defaultNetworkId(){return this.config.defaultNetworkId}set defaultNetworkId(t){this._triggerConfigChange("defaultNetworkId",t),this.config.defaultNetworkId=t}get defaultChain(){return this.config.defaultChain}set defaultChain(t){if(!Xs(this.config.defaultCommon)&&!Xs(this.config.defaultCommon.baseChain)&&t!==this.config.defaultCommon.baseChain)throw new Gxe(this.config.defaultChain,t);this._triggerConfigChange("defaultChain",t),this.config.defaultChain=t}get defaultHardfork(){return this.config.defaultHardfork}set defaultHardfork(t){if(!Xs(this.config.defaultCommon)&&!Xs(this.config.defaultCommon.hardfork)&&t!==this.config.defaultCommon.hardfork)throw new qxe(this.config.defaultCommon.hardfork,t);this._triggerConfigChange("defaultHardfork",t),this.config.defaultHardfork=t}get defaultCommon(){return this.config.defaultCommon}set defaultCommon(t){if(!Xs(this.config.defaultHardfork)&&!Xs(t)&&!Xs(t.hardfork)&&this.config.defaultHardfork!==t.hardfork)throw new qxe(this.config.defaultHardfork,t.hardfork);if(!Xs(this.config.defaultChain)&&!Xs(t)&&!Xs(t.baseChain)&&this.config.defaultChain!==t.baseChain)throw new Gxe(this.config.defaultChain,t.baseChain);this._triggerConfigChange("defaultCommon",t),this.config.defaultCommon=t}get ignoreGasPricing(){return this.config.ignoreGasPricing}set ignoreGasPricing(t){this._triggerConfigChange("ignoreGasPricing",t),this.config.ignoreGasPricing=t}get defaultTransactionType(){return this.config.defaultTransactionType}set defaultTransactionType(t){this._triggerConfigChange("defaultTransactionType",t),this.config.defaultTransactionType=t}get defaultMaxPriorityFeePerGas(){return this.config.defaultMaxPriorityFeePerGas}set defaultMaxPriorityFeePerGas(t){this._triggerConfigChange("defaultMaxPriorityFeePerGas",t),this.config.defaultMaxPriorityFeePerGas=t}get transactionBuilder(){return this.config.transactionBuilder}set transactionBuilder(t){this._triggerConfigChange("transactionBuilder",t),this.config.transactionBuilder=t}get transactionTypeParser(){return this.config.transactionTypeParser}set transactionTypeParser(t){this._triggerConfigChange("transactionTypeParser",t),this.config.transactionTypeParser=t}get customTransactionSchema(){return this.config.customTransactionSchema}set customTransactionSchema(t){this._triggerConfigChange("customTransactionSchema",t),this.config.customTransactionSchema=t}_triggerConfigChange(t,n){this.emit(B3.CONFIG_CHANGE,{name:t,oldValue:this.config[t],newValue:n})}}var cP={exports:{}},lge;function g7t(){return lge||(lge=1,function(e,t){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof ju<"u"&&ju,r=function(){function a(){this.fetch=!1,this.DOMException=n.DOMException}return a.prototype=n,new a}();(function(a){(function(o){var l=typeof a<"u"&&a||typeof self<"u"&&self||typeof l<"u"&&l,c={searchParams:"URLSearchParams"in l,iterable:"Symbol"in l&&"iterator"in Symbol,blob:"FileReader"in l&&"Blob"in l&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in l,arrayBuffer:"ArrayBuffer"in l};function u(Y){return Y&&DataView.prototype.isPrototypeOf(Y)}if(c.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(Y){return Y&&d.indexOf(Object.prototype.toString.call(Y))>-1};function x(Y){if(typeof Y!="string"&&(Y=String(Y)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(Y)||Y==="")throw new TypeError('Invalid character in header field name: "'+Y+'"');return Y.toLowerCase()}function g(Y){return typeof Y!="string"&&(Y=String(Y)),Y}function v(Y){var ie={next:function(){var oe=Y.shift();return{done:oe===void 0,value:oe}}};return c.iterable&&(ie[Symbol.iterator]=function(){return ie}),ie}function w(Y){this.map={},Y instanceof w?Y.forEach(function(ie,oe){this.append(oe,ie)},this):Array.isArray(Y)?Y.forEach(function(ie){this.append(ie[0],ie[1])},this):Y&&Object.getOwnPropertyNames(Y).forEach(function(ie){this.append(ie,Y[ie])},this)}w.prototype.append=function(Y,ie){Y=x(Y),ie=g(ie);var oe=this.map[Y];this.map[Y]=oe?oe+", "+ie:ie},w.prototype.delete=function(Y){delete this.map[x(Y)]},w.prototype.get=function(Y){return Y=x(Y),this.has(Y)?this.map[Y]:null},w.prototype.has=function(Y){return this.map.hasOwnProperty(x(Y))},w.prototype.set=function(Y,ie){this.map[x(Y)]=g(ie)},w.prototype.forEach=function(Y,ie){for(var oe in this.map)this.map.hasOwnProperty(oe)&&Y.call(ie,this.map[oe],oe,this)},w.prototype.keys=function(){var Y=[];return this.forEach(function(ie,oe){Y.push(oe)}),v(Y)},w.prototype.values=function(){var Y=[];return this.forEach(function(ie){Y.push(ie)}),v(Y)},w.prototype.entries=function(){var Y=[];return this.forEach(function(ie,oe){Y.push([oe,ie])}),v(Y)},c.iterable&&(w.prototype[Symbol.iterator]=w.prototype.entries);function C(Y){if(Y.bodyUsed)return Promise.reject(new TypeError("Already read"));Y.bodyUsed=!0}function N(Y){return new Promise(function(ie,oe){Y.onload=function(){ie(Y.result)},Y.onerror=function(){oe(Y.error)}})}function I(Y){var ie=new FileReader,oe=N(ie);return ie.readAsArrayBuffer(Y),oe}function P(Y){var ie=new FileReader,oe=N(ie);return ie.readAsText(Y),oe}function R(Y){for(var ie=new Uint8Array(Y),oe=new Array(ie.length),G=0;G<ie.length;G++)oe[G]=String.fromCharCode(ie[G]);return oe.join("")}function F(Y){if(Y.slice)return Y.slice(0);var ie=new Uint8Array(Y.byteLength);return ie.set(new Uint8Array(Y)),ie.buffer}function U(){return this.bodyUsed=!1,this._initBody=function(Y){this.bodyUsed=this.bodyUsed,this._bodyInit=Y,Y?typeof Y=="string"?this._bodyText=Y:c.blob&&Blob.prototype.isPrototypeOf(Y)?this._bodyBlob=Y:c.formData&&FormData.prototype.isPrototypeOf(Y)?this._bodyFormData=Y:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(Y)?this._bodyText=Y.toString():c.arrayBuffer&&c.blob&&u(Y)?(this._bodyArrayBuffer=F(Y.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(Y)||f(Y))?this._bodyArrayBuffer=F(Y):this._bodyText=Y=Object.prototype.toString.call(Y):this._bodyText="",this.headers.get("content-type")||(typeof Y=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(Y)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var Y=C(this);if(Y)return Y;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var Y=C(this);return Y||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(I)}),this.text=function(){var Y=C(this);if(Y)return Y;if(this._bodyBlob)return P(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(R(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c.formData&&(this.formData=function(){return this.text().then(ne)}),this.json=function(){return this.text().then(JSON.parse)},this}var L=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function z(Y){var ie=Y.toUpperCase();return L.indexOf(ie)>-1?ie:Y}function X(Y,ie){if(!(this instanceof X))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');ie=ie||{};var oe=ie.body;if(Y instanceof X){if(Y.bodyUsed)throw new TypeError("Already read");this.url=Y.url,this.credentials=Y.credentials,ie.headers||(this.headers=new w(Y.headers)),this.method=Y.method,this.mode=Y.mode,this.signal=Y.signal,!oe&&Y._bodyInit!=null&&(oe=Y._bodyInit,Y.bodyUsed=!0)}else this.url=String(Y);if(this.credentials=ie.credentials||this.credentials||"same-origin",(ie.headers||!this.headers)&&(this.headers=new w(ie.headers)),this.method=z(ie.method||this.method||"GET"),this.mode=ie.mode||this.mode||null,this.signal=ie.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&oe)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(oe),(this.method==="GET"||this.method==="HEAD")&&(ie.cache==="no-store"||ie.cache==="no-cache")){var G=/([?&])_=[^&]*/;if(G.test(this.url))this.url=this.url.replace(G,"$1_="+new Date().getTime());else{var V=/\?/;this.url+=(V.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}X.prototype.clone=function(){return new X(this,{body:this._bodyInit})};function ne(Y){var ie=new FormData;return Y.trim().split("&").forEach(function(oe){if(oe){var G=oe.split("="),V=G.shift().replace(/\+/g," "),ee=G.join("=").replace(/\+/g," ");ie.append(decodeURIComponent(V),decodeURIComponent(ee))}}),ie}function J(Y){var ie=new w,oe=Y.replace(/\r?\n[\t ]+/g," ");return oe.split("\r").map(function(G){return G.indexOf(`
`)===0?G.substr(1,G.length):G}).forEach(function(G){var V=G.split(":"),ee=V.shift().trim();if(ee){var ae=V.join(":").trim();ie.append(ee,ae)}}),ie}U.call(X.prototype);function Z(Y,ie){if(!(this instanceof Z))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');ie||(ie={}),this.type="default",this.status=ie.status===void 0?200:ie.status,this.ok=this.status>=200&&this.status<300,this.statusText=ie.statusText===void 0?"":""+ie.statusText,this.headers=new w(ie.headers),this.url=ie.url||"",this._initBody(Y)}U.call(Z.prototype),Z.prototype.clone=function(){return new Z(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new w(this.headers),url:this.url})},Z.error=function(){var Y=new Z(null,{status:0,statusText:""});return Y.type="error",Y};var re=[301,302,303,307,308];Z.redirect=function(Y,ie){if(re.indexOf(ie)===-1)throw new RangeError("Invalid status code");return new Z(null,{status:ie,headers:{location:Y}})},o.DOMException=l.DOMException;try{new o.DOMException}catch{o.DOMException=function(ie,oe){this.message=ie,this.name=oe;var G=Error(ie);this.stack=G.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function he(Y,ie){return new Promise(function(oe,G){var V=new X(Y,ie);if(V.signal&&V.signal.aborted)return G(new o.DOMException("Aborted","AbortError"));var ee=new XMLHttpRequest;function ae(){ee.abort()}ee.onload=function(){var Ae={status:ee.status,statusText:ee.statusText,headers:J(ee.getAllResponseHeaders()||"")};Ae.url="responseURL"in ee?ee.responseURL:Ae.headers.get("X-Request-URL");var ce="response"in ee?ee.response:ee.responseText;setTimeout(function(){oe(new Z(ce,Ae))},0)},ee.onerror=function(){setTimeout(function(){G(new TypeError("Network request failed"))},0)},ee.ontimeout=function(){setTimeout(function(){G(new TypeError("Network request failed"))},0)},ee.onabort=function(){setTimeout(function(){G(new o.DOMException("Aborted","AbortError"))},0)};function fe(Ae){try{return Ae===""&&l.location.href?l.location.href:Ae}catch{return Ae}}ee.open(V.method,fe(V.url),!0),V.credentials==="include"?ee.withCredentials=!0:V.credentials==="omit"&&(ee.withCredentials=!1),"responseType"in ee&&(c.blob?ee.responseType="blob":c.arrayBuffer&&V.headers.get("Content-Type")&&V.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(ee.responseType="arraybuffer")),ie&&typeof ie.headers=="object"&&!(ie.headers instanceof w)?Object.getOwnPropertyNames(ie.headers).forEach(function(Ae){ee.setRequestHeader(Ae,g(ie.headers[Ae]))}):V.headers.forEach(function(Ae,ce){ee.setRequestHeader(ce,Ae)}),V.signal&&(V.signal.addEventListener("abort",ae),ee.onreadystatechange=function(){ee.readyState===4&&V.signal.removeEventListener("abort",ae)}),ee.send(typeof V._bodyInit>"u"?null:V._bodyInit)})}return he.polyfill=!0,l.fetch||(l.fetch=he,l.Headers=w,l.Request=X,l.Response=Z),o.Headers=w,o.Request=X,o.Response=Z,o.fetch=he,o})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var s=n.fetch?n:r;t=s.fetch,t.default=s.fetch,t.fetch=s.fetch,t.Headers=s.Headers,t.Request=s.Request,t.Response=s.Response,e.exports=t}(cP,cP.exports)),cP.exports}var b7t=g7t();const y7t=ji(b7t);var v7t=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class l$ extends Yk{constructor(t,n){if(super(),!l$.validateClientUrl(t))throw new uee(t);this.clientUrl=t,this.httpProviderOptions=n}static validateClientUrl(t){return typeof t=="string"?/^http(s)?:\/\//i.test(t):!1}getStatus(){throw new Rx}supportsSubscriptions(){return!1}request(t,n){var r;return v7t(this,void 0,void 0,function*(){const s=Object.assign(Object.assign({},(r=this.httpProviderOptions)===null||r===void 0?void 0:r.providerOptions),n),a=yield y7t(this.clientUrl,Object.assign(Object.assign({},s),{method:"POST",headers:Object.assign(Object.assign({},s.headers),{"Content-Type":"application/json"}),body:JSON.stringify(t)}));if(!a.ok)throw new b0(yield a.json(),void 0,void 0,a.status);return yield a.json()})}on(){throw new Rx}removeListener(){throw new Rx}once(){throw new Rx}removeAllListeners(){throw new Rx}connect(){throw new Rx}disconnect(){throw new Rx}reset(){throw new Rx}reconnect(){throw new Rx}}var wC=null;typeof WebSocket<"u"?wC=WebSocket:typeof MozWebSocket<"u"?wC=MozWebSocket:typeof global<"u"?wC=global.WebSocket||global.MozWebSocket:typeof window<"u"?wC=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(wC=self.WebSocket||self.MozWebSocket);const w7t=wC;class dFe extends cFe{constructor(t,n,r){super(t,n,r)}_validateProviderPath(t){return typeof t=="string"?/^ws(s)?:\/\//i.test(t):!1}getStatus(){if(this._socketConnection&&!Xs(this._socketConnection))switch(this._socketConnection.readyState){case this._socketConnection.CONNECTING:return"connecting";case this._socketConnection.OPEN:return"connected";default:return"disconnected"}return"disconnected"}_openSocketConnection(){this._socketConnection=new w7t(this._socketPath,void 0,this._socketOptions&&Object.keys(this._socketOptions).length===0?void 0:this._socketOptions)}_closeSocketConnection(t,n){var r;(r=this._socketConnection)===null||r===void 0||r.close(t,n)}_sendToSocket(t){var n;if(this.getStatus()==="disconnected")throw new lee;(n=this._socketConnection)===null||n===void 0||n.send(JSON.stringify(t))}_parseResponses(t){return this.chunkResponseParser.parseResponse(t.data)}_addSocketListeners(){var t,n,r,s;(t=this._socketConnection)===null||t===void 0||t.addEventListener("open",this._onOpenHandler),(n=this._socketConnection)===null||n===void 0||n.addEventListener("message",this._onMessageHandler),(r=this._socketConnection)===null||r===void 0||r.addEventListener("close",a=>this._onCloseHandler(a)),(s=this._socketConnection)===null||s===void 0||s.addEventListener("error",this._onErrorHandler)}_removeSocketListeners(){var t,n,r;(t=this._socketConnection)===null||t===void 0||t.removeEventListener("message",this._onMessageHandler),(n=this._socketConnection)===null||n===void 0||n.removeEventListener("open",this._onOpenHandler),(r=this._socketConnection)===null||r===void 0||r.removeEventListener("close",this._onCloseHandler)}_onCloseEvent(t){var n;if(this._reconnectOptions.autoReconnect&&(![1e3,1001].includes(t.code)||!t.wasClean)){this._reconnect();return}this._clearQueues(t),this._removeSocketListeners(),this._onDisconnect(t.code,t.reason),(n=this._socketConnection)===null||n===void 0||n.removeEventListener("error",this._onErrorHandler)}}const fFe=e=>Yk.isWeb3Provider(e),hFe=e=>typeof e!="string"&&"request"in e&&e.request.constructor.name==="Function",pFe=e=>typeof e!="string"&&"request"in e&&e.request.constructor.name==="AsyncFunction",mFe=e=>typeof e!="string"&&"send"in e,xFe=e=>typeof e!="string"&&"sendAsync"in e,uR=e=>e&&(fFe(e)||pFe(e)||hFe(e)||xFe(e)||mFe(e)),C7t=e=>e&&"supportsSubscriptions"in e?e.supportsSubscriptions():!!(e&&typeof e!="string"&&"on"in e);var uV=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},sN;(function(e){e.PROVIDER_CHANGED="PROVIDER_CHANGED",e.BEFORE_PROVIDER_CHANGE="BEFORE_PROVIDER_CHANGE"})(sN||(sN={}));const cge={HttpProvider:l$,WebsocketProvider:dFe};class Qw extends o${constructor(t,n,r){super(),Xs(t)||this.setProvider(t),this.useRpcCallSpecification=n,Xs(r)||(this.middleware=r)}static get providers(){return cge}get provider(){return this._provider}get providers(){return cge}setProvider(t){let n;if(t&&typeof t=="string"&&this.providers)if(/^http(s)?:\/\//i.test(t))n=new this.providers.HttpProvider(t);else if(/^ws(s)?:\/\//i.test(t))n=new this.providers.WebsocketProvider(t);else throw new oO(`Can't autodetect provider for "${t}"`);else Xs(t)?n=void 0:n=t;return this.emit(sN.BEFORE_PROVIDER_CHANGE,this._provider),this._provider=n,this.emit(sN.PROVIDER_CHANGED,this._provider),!0}setMiddleware(t){this.middleware=t}send(t){return uV(this,void 0,void 0,function*(){const n=Object.assign({},t);let r=yield this._sendRequest(n);if(Xs(this.middleware)||(r=yield this.middleware.processResponse(r)),Cy(r))return r.result;throw new b0(r)})}sendBatch(t){return uV(this,void 0,void 0,function*(){return yield this._sendRequest(t)})}_sendRequest(t){return uV(this,void 0,void 0,function*(){const{provider:n}=this;if(Xs(n))throw new oO("Provider not available. Use `.setProvider` or `.provider=` to initialize the provider.");let r=Qm(t)?ooe(t):D3(t);if(Xs(this.middleware)||(r=yield this.middleware.processRequest(r)),fFe(n)){let s;try{s=yield n.request(r)}catch(a){s=a}return this._processJsonRpcResponse(r,s,{legacy:!1,error:!1})}if(pFe(n))return n.request(r).then(s=>this._processJsonRpcResponse(r,s,{legacy:!0,error:!1})).catch(s=>this._processJsonRpcResponse(r,s,{legacy:!0,error:!0}));if(hFe(n))return new Promise((s,a)=>{const o=u=>{a(this._processJsonRpcResponse(r,u,{legacy:!0,error:!0}))},l=u=>s(this._processJsonRpcResponse(r,u,{legacy:!0,error:!1})),c=n.request(r,(u,d)=>u?o(u):l(d));nFe(c)&&c.then(l).catch(d=>{try{const f=this._processJsonRpcResponse(r,d,{legacy:!0,error:!0});a(f)}catch(f){a(f)}})});if(mFe(n))return new Promise((s,a)=>{n.send(r,(o,l)=>{if(o)return a(this._processJsonRpcResponse(r,o,{legacy:!0,error:!0}));if(Xs(l))throw new b0({},'Got a "nullish" response from provider.');return s(this._processJsonRpcResponse(r,l,{legacy:!0,error:!1}))})});if(xFe(n))return n.sendAsync(r).then(s=>this._processJsonRpcResponse(r,s,{legacy:!0,error:!1})).catch(s=>this._processJsonRpcResponse(r,s,{legacy:!0,error:!0}));throw new oO("Provider does not have a request or send method to use.")})}_processJsonRpcResponse(t,n,{legacy:r,error:s}){if(Xs(n))return this._buildResponse(t,null,s);if(Sy(n)){if(this.useRpcCallSpecification&&ioe(n)){const a=n;if(cd.get(a.error.code)){const o=cd.get(a.error.code).error;throw new o(a)}else throw new qf(a)}else if(!Qw._isReverted(n))throw new YB(n,t)}if(Cy(n))return n;if(n instanceof Error)throw Qw._isReverted(n),n;if(!r&&Qm(t)&&DE(n)||r&&!s&&Qm(t))return n;if(r&&s&&Qm(t))throw n;if(r&&!Sy(n)&&!Cy(n))return this._buildResponse(t,n,s);throw Qm(t)&&!Array.isArray(n)?new b0(n,"Got normal response for a batch request."):!Qm(t)&&Array.isArray(n)?new b0(n,"Got batch response for a normal request."):new b0(n,"Invalid response")}static _isReverted(t){let n;if(Sy(t)?n=t.error:t instanceof Error&&(n=t),n!=null&&n.message.includes("revert"))throw new Yw(n);return!1}_buildResponse(t,n,r){const s={jsonrpc:"2.0",id:Qm(t)?t[0].id:"id"in t?t.id:null};return r?Object.assign(Object.assign({},s),{error:n}):Object.assign(Object.assign({},s),{result:n})}}var j7=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class dR{constructor(t,n,r=!1){this.requestManager=t,this.registeredSubscriptions=n,this.tolerateUnlinkedSubscription=r,this._subscriptions=new Map,this.requestManager.on(sN.BEFORE_PROVIDER_CHANGE,()=>j7(this,void 0,void 0,function*(){yield this.unsubscribe()})),this.requestManager.on(sN.PROVIDER_CHANGED,()=>{this.clear(),this.listenToProviderEvents()}),this.listenToProviderEvents()}listenToProviderEvents(){const t=this.requestManager.provider;!this.requestManager.provider||typeof(t==null?void 0:t.supportsSubscriptions)=="function"&&!(t!=null&&t.supportsSubscriptions())||typeof this.requestManager.provider.on=="function"&&(typeof this.requestManager.provider.request=="function"?this.requestManager.provider.on("message",n=>this.messageListener(n)):t.on("data",n=>this.messageListener(n)))}messageListener(t){var n,r,s;if(!t)throw new rg("Should not call messageListener with no data. Type was");const a=((n=t.params)===null||n===void 0?void 0:n.subscription)||((r=t.data)===null||r===void 0?void 0:r.subscription)||((s=t.id)===null||s===void 0?void 0:s.toString(16));if(a){const o=this._subscriptions.get(a);o==null||o.processSubscriptionData(t)}}subscribe(t,n){return j7(this,arguments,void 0,function*(r,s,a=id){const o=this.registeredSubscriptions[r];if(!o)throw new rg("Invalid subscription type");const l=new o(s??void 0,{subscriptionManager:this,returnFormat:a});return yield this.addSubscription(l),l})}get subscriptions(){return this._subscriptions}addSubscription(t){return j7(this,void 0,void 0,function*(){if(!this.requestManager.provider)throw new oO("Provider not available");if(!this.supportsSubscriptions())throw new rg("The current provider does not support subscriptions");if(t.id&&this._subscriptions.has(t.id))throw new rg(`Subscription with id "${t.id}" already exists`);if(yield t.sendSubscriptionRequest(),Xs(t.id))throw new rg("Subscription is not subscribed yet.");return this._subscriptions.set(t.id,t),t.id})}removeSubscription(t){return j7(this,void 0,void 0,function*(){const{id:n}=t;if(Xs(n))throw new rg("Subscription is not subscribed yet. Or, had already been unsubscribed but not through the Subscription Manager.");if(!this._subscriptions.has(n)&&!this.tolerateUnlinkedSubscription)throw new rg(`Subscription with id "${n.toString()}" does not exists`);return yield t.sendUnsubscribeRequest(),this._subscriptions.delete(n),n})}unsubscribe(t){return j7(this,void 0,void 0,function*(){const n=[];for(const[r,s]of this.subscriptions.entries())(!t||typeof t=="function"&&t({id:r,sub:s}))&&n.push(this.removeSubscription(s));return Promise.all(n)})}clear(){this._subscriptions.clear()}supportsSubscriptions(){return Xs(this.requestManager.provider)?!1:C7t(this.requestManager.provider)}}var E7=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class eT extends o${constructor(t,n){var r;super(),this.args=t;const{requestManager:s}=n,{subscriptionManager:a}=n;s?this._subscriptionManager=new dR(s,{},!0):this._subscriptionManager=a,this._returnFormat=(r=n==null?void 0:n.returnFormat)!==null&&r!==void 0?r:id}get id(){return this._id}get lastBlock(){return this._lastBlock}subscribe(){return E7(this,void 0,void 0,function*(){return this._subscriptionManager.addSubscription(this)})}processSubscriptionData(t){var n,r;t!=null&&t.data?this._processSubscriptionResult((r=(n=t==null?void 0:t.data)===null||n===void 0?void 0:n.result)!==null&&r!==void 0?r:t==null?void 0:t.data):t&&a$(t)&&this._processSubscriptionResult(t==null?void 0:t.params.result)}sendSubscriptionRequest(){return E7(this,void 0,void 0,function*(){return this._id=yield this._subscriptionManager.requestManager.send({method:"eth_subscribe",params:this._buildSubscriptionParams()}),this.emit("connected",this._id),this._id})}get returnFormat(){return this._returnFormat}get subscriptionManager(){return this._subscriptionManager}resubscribe(){return E7(this,void 0,void 0,function*(){yield this.unsubscribe(),yield this.subscribe()})}unsubscribe(){return E7(this,void 0,void 0,function*(){this.id&&(yield this._subscriptionManager.removeSubscription(this))})}sendUnsubscribeRequest(){return E7(this,void 0,void 0,function*(){yield this._subscriptionManager.requestManager.send({method:"eth_unsubscribe",params:[this.id]}),this._id=void 0})}formatSubscriptionResult(t){return t}_processSubscriptionResult(t){this.emit("data",this.formatSubscriptionResult(t))}_processSubscriptionError(t){this.emit("error",t)}_buildSubscriptionParams(){throw new Error("Implement in the child class")}}var U6=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class fR extends c4t{constructor(){super(...arguments),this._addressMap=new Map,this._defaultKeyName="web3js_wallet"}static getStorage(){let t;try{t=window.localStorage;const n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(n){return n&&(n.code===22||n.code===1014||n.name==="QuotaExceededError"||n.name==="NS_ERROR_DOM_QUOTA_REACHED")&&!ar(t)&&t.length!==0?t:void 0}}create(t){for(let n=0;n<t;n+=1)this.add(this._accountProvider.create());return this}add(t){var n;if(typeof t=="string")return this.add(this._accountProvider.privateKeyToAccount(t));let r=this.length;return this.get(t.address)&&(console.warn(`Account ${t.address.toLowerCase()} already exists.`),r=(n=this._addressMap.get(t.address.toLowerCase()))!==null&&n!==void 0?n:r),this._addressMap.set(t.address.toLowerCase(),r),this[r]=t,this}get(t){if(typeof t=="string"){const n=this._addressMap.get(t.toLowerCase());return ar(n)?void 0:this[n]}return this[t]}remove(t){if(typeof t=="string"){const n=this._addressMap.get(t.toLowerCase());return ar(n)?!1:(this._addressMap.delete(t.toLowerCase()),this.splice(n,1),!0)}return this[t]?(this.splice(t,1),!0):!1}clear(){return this._addressMap.clear(),this.length=0,this}encrypt(t,n){return U6(this,void 0,void 0,function*(){return Promise.all(this.map(r=>U6(this,void 0,void 0,function*(){return r.encrypt(t,n)})))})}decrypt(t,n,r){return U6(this,void 0,void 0,function*(){const s=yield Promise.all(t.map(a=>U6(this,void 0,void 0,function*(){return this._accountProvider.decrypt(a,n,r)})));for(const a of s)this.add(a);return this})}save(t,n){return U6(this,void 0,void 0,function*(){const r=fR.getStorage();if(!r)throw new Error("Local storage not available.");return r.setItem(n??this._defaultKeyName,JSON.stringify(yield this.encrypt(t))),!0})}load(t,n){return U6(this,void 0,void 0,function*(){const r=fR.getStorage();if(!r)throw new Error("Local storage not available.");const s=r.getItem(n??this._defaultKeyName);return s&&(yield this.decrypt(JSON.parse(s)||[],t)),this})}}const S0={web:lO};function gFe(e,t,n){if(!n.startsWith("aes-"))throw new Error(`AES submodule doesn't support mode ${n}`);if(t.length!==16)throw new Error("AES: wrong IV length");if(n.startsWith("aes-128")&&e.length!==16||n.startsWith("aes-256")&&e.length!==32)throw new Error("AES: wrong key length")}async function bFe(e,t,n){if(!S0.web)throw new Error("Browser crypto not available.");let r;if(["aes-128-cbc","aes-256-cbc"].includes(e)&&(r="cbc"),["aes-128-ctr","aes-256-ctr"].includes(e)&&(r="ctr"),!r)throw new Error("AES: unsupported mode");return[await S0.web.subtle.importKey("raw",t,{name:`AES-${r.toUpperCase()}`,length:t.length*8},!0,["encrypt","decrypt"]),{name:`aes-${r}`,iv:n,counter:n,length:128}]}async function coe(e,t,n,r="aes-128-ctr",s=!0){if(gFe(t,n,r),S0.web){const[a,o]=await bFe(r,t,n),l=await S0.web.subtle.encrypt(o,a,e);let c=new Uint8Array(l);return!s&&o.name==="aes-cbc"&&!(e.length%16)&&(c=c.slice(0,-16)),c}else if(S0.node){const a=S0.node.createCipheriv(r,t,n);return a.setAutoPadding(s),XM(a.update(e),a.final())}else throw new Error("The environment doesn't have AES module")}async function S7t(e,t,n,r){const s=e.slice(-16);for(let o=0;o<16;o++)s[o]^=n[o]^16;return(await coe(s,t,n,r)).slice(0,16)}async function N7t(e,t,n,r="aes-128-ctr",s=!0){if(gFe(t,n,r),S0.web){const[a,o]=await bFe(r,t,n);if(!s&&o.name==="aes-cbc"){const u=await S7t(e,t,n,r);e=XM(e,u)}const l=await S0.web.subtle.decrypt(o,a,e),c=new Uint8Array(l);if(o.name==="aes-cbc"){const u=await coe(c,t,n,r);if(!vAt(u,e))throw new Error("AES: wrong padding")}return c}else if(S0.node){const a=S0.node.createDecipheriv(r,t,n);return a.setAutoPadding(s),XM(a.update(e),a.final())}else throw new Error("The environment doesn't have AES module")}class yFe extends Wae{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,Hae(t);const r=XS(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,a=new Uint8Array(s);a.set(r.length>s?t.create().update(r).digest():r);for(let o=0;o<a.length;o++)a[o]^=54;this.iHash.update(a),this.oHash=t.create();for(let o=0;o<a.length;o++)a[o]^=106;this.oHash.update(a),a.fill(0)}update(t){return P3(this),this.iHash.update(t),this}digestInto(t){P3(this),OA(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:a,blockLen:o,outputLen:l}=this;return t=t,t.finished=s,t.destroyed=a,t.blockLen=o,t.outputLen=l,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const uoe=(e,t,n)=>new yFe(e,t).update(n).digest();uoe.create=(e,t)=>new yFe(e,t);function A7t(e,t,n,r){Hae(e);const s=wPe({dkLen:32,asyncTick:10},r),{c:a,dkLen:o,asyncTick:l}=s;if(Bd(a),Bd(o),Bd(l),a<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const c=XS(t),u=XS(n),d=new Uint8Array(o),f=uoe.create(e,c),x=f._cloneInto().update(u);return{c:a,dkLen:o,asyncTick:l,DK:d,PRF:f,PRFSalt:x}}function j7t(e,t,n,r,s){return e.destroy(),t.destroy(),r&&r.destroy(),s.fill(0),n}function doe(e,t,n,r){const{c:s,dkLen:a,DK:o,PRF:l,PRFSalt:c}=A7t(e,t,n,r);let u;const d=new Uint8Array(4),f=uO(d),x=new Uint8Array(l.outputLen);for(let g=1,v=0;v<a;g++,v+=l.outputLen){const w=o.subarray(v,v+l.outputLen);f.setInt32(0,g,!1),(u=c._cloneInto(u)).update(d).digestInto(x),w.set(x.subarray(0,w.length));for(let C=1;C<s;C++){l._cloneInto(u).update(x).digestInto(x);for(let N=0;N<w.length;N++)w[N]^=x[N]}}return j7t(l,c,o,u,x)}function E7t(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),a=BigInt(4294967295),o=Number(n>>s&a),l=Number(n&a),c=r?4:0,u=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+u,l,r)}const _7t=(e,t,n)=>e&t^~e&n,k7t=(e,t,n)=>e&t^e&n^t&n;class T7t extends Wae{constructor(t,n,r,s){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=uO(this.buffer)}update(t){P3(this);const{view:n,buffer:r,blockLen:s}=this;t=XS(t);const a=t.length;for(let o=0;o<a;){const l=Math.min(s-this.pos,a-o);if(l===s){const c=uO(t);for(;s<=a-o;o+=s)this.process(c,o);continue}r.set(t.subarray(o,o+l),this.pos),this.pos+=l,o+=l,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){P3(this),Vae(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:a}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let f=o;f<s;f++)n[f]=0;E7t(r,s-8,BigInt(this.length*8),a),this.process(r,0);const l=uO(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)l.setUint32(4*f,d[f],a)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:a,destroyed:o,pos:l}=this;return t.length=s,t.pos=l,t.finished=a,t.destroyed=o,s%n&&t.buffer.set(r),t}}const I7t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ob=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),lb=new Uint32Array(64);class P7t extends T7t{constructor(){super(64,32,8,!1),this.A=ob[0]|0,this.B=ob[1]|0,this.C=ob[2]|0,this.D=ob[3]|0,this.E=ob[4]|0,this.F=ob[5]|0,this.G=ob[6]|0,this.H=ob[7]|0}get(){const{A:t,B:n,C:r,D:s,E:a,F:o,G:l,H:c}=this;return[t,n,r,s,a,o,l,c]}set(t,n,r,s,a,o,l,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=a|0,this.F=o|0,this.G=l|0,this.H=c|0}process(t,n){for(let f=0;f<16;f++,n+=4)lb[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const x=lb[f-15],g=lb[f-2],v=Wm(x,7)^Wm(x,18)^x>>>3,w=Wm(g,17)^Wm(g,19)^g>>>10;lb[f]=w+lb[f-7]+v+lb[f-16]|0}let{A:r,B:s,C:a,D:o,E:l,F:c,G:u,H:d}=this;for(let f=0;f<64;f++){const x=Wm(l,6)^Wm(l,11)^Wm(l,25),g=d+x+_7t(l,c,u)+I7t[f]+lb[f]|0,w=(Wm(r,2)^Wm(r,13)^Wm(r,22))+k7t(r,s,a)|0;d=u,u=c,c=l,l=o+g|0,o=a,a=s,s=r,r=g+w|0}r=r+this.A|0,s=s+this.B|0,a=a+this.C|0,o=o+this.D|0,l=l+this.E|0,c=c+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(r,s,a,o,l,c,u,d)}roundClean(){lb.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const c$=CPe(()=>new P7t);function vFe(e,t,n,r,s){if(!["sha256","sha512"].includes(s))throw new Error("Only sha256 and sha512 are supported");return QM(e),QM(t),doe(c$,e,t,{c:n,dkLen:r})}function uge(e,t,n,r,s,a){let o=e[t++]^n[r++],l=e[t++]^n[r++],c=e[t++]^n[r++],u=e[t++]^n[r++],d=e[t++]^n[r++],f=e[t++]^n[r++],x=e[t++]^n[r++],g=e[t++]^n[r++],v=e[t++]^n[r++],w=e[t++]^n[r++],C=e[t++]^n[r++],N=e[t++]^n[r++],I=e[t++]^n[r++],P=e[t++]^n[r++],R=e[t++]^n[r++],F=e[t++]^n[r++],U=o,L=l,z=c,X=u,ne=d,J=f,Z=x,re=g,he=v,Y=w,ie=C,oe=N,G=I,V=P,ee=R,ae=F;for(let fe=0;fe<8;fe+=2)ne^=pa(U+G|0,7),he^=pa(ne+U|0,9),G^=pa(he+ne|0,13),U^=pa(G+he|0,18),Y^=pa(J+L|0,7),V^=pa(Y+J|0,9),L^=pa(V+Y|0,13),J^=pa(L+V|0,18),ee^=pa(ie+Z|0,7),z^=pa(ee+ie|0,9),Z^=pa(z+ee|0,13),ie^=pa(Z+z|0,18),X^=pa(ae+oe|0,7),re^=pa(X+ae|0,9),oe^=pa(re+X|0,13),ae^=pa(oe+re|0,18),L^=pa(U+X|0,7),z^=pa(L+U|0,9),X^=pa(z+L|0,13),U^=pa(X+z|0,18),Z^=pa(J+ne|0,7),re^=pa(Z+J|0,9),ne^=pa(re+Z|0,13),J^=pa(ne+re|0,18),oe^=pa(ie+Y|0,7),he^=pa(oe+ie|0,9),Y^=pa(he+oe|0,13),ie^=pa(Y+he|0,18),G^=pa(ae+ee|0,7),V^=pa(G+ae|0,9),ee^=pa(V+G|0,13),ae^=pa(ee+V|0,18);s[a++]=o+U|0,s[a++]=l+L|0,s[a++]=c+z|0,s[a++]=u+X|0,s[a++]=d+ne|0,s[a++]=f+J|0,s[a++]=x+Z|0,s[a++]=g+re|0,s[a++]=v+he|0,s[a++]=w+Y|0,s[a++]=C+ie|0,s[a++]=N+oe|0,s[a++]=I+G|0,s[a++]=P+V|0,s[a++]=R+ee|0,s[a++]=F+ae|0}function dV(e,t,n,r,s){let a=r+0,o=r+16*s;for(let l=0;l<16;l++)n[o+l]=e[t+(2*s-1)*16+l];for(let l=0;l<s;l++,a+=16,t+=16)uge(n,o,e,t,n,a),l>0&&(o+=16),uge(n,a,e,t+=16,n,o)}function F7t(e,t,n){const r=wPe({dkLen:32,asyncTick:10,maxmem:1073742848},n),{N:s,r:a,p:o,dkLen:l,asyncTick:c,maxmem:u,onProgress:d}=r;if(Bd(s),Bd(a),Bd(o),Bd(l),Bd(c),Bd(u),d!==void 0&&typeof d!="function")throw new Error("progressCb should be function");const f=128*a,x=f/4;if(s<=1||s&s-1||s>=2**(f/8)||s>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(o<0||o>(2**32-1)*32/f)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(l<0||l>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const g=f*(s+o);if(g>u)throw new Error(`Scrypt: parameters too large, ${g} (128 * r * (N + p)) > ${u} (maxmem)`);const v=doe(c$,e,t,{c:1,dkLen:f*o}),w=cO(v),C=cO(new Uint8Array(f*s)),N=cO(new Uint8Array(f));let I=()=>{};if(d){const P=2*s*o,R=Math.max(Math.floor(P/1e4),1);let F=0;I=()=>{F++,d&&(!(F%R)||F===P)&&d(F/P)}}return{N:s,r:a,p:o,dkLen:l,blockSize32:x,V:C,B32:w,B:v,tmp:N,blockMixCb:I,asyncTick:c}}function O7t(e,t,n,r,s){const a=doe(c$,e,n,{c:1,dkLen:t});return n.fill(0),r.fill(0),s.fill(0),a}function M7t(e,t,n){const{N:r,r:s,p:a,dkLen:o,blockSize32:l,V:c,B32:u,B:d,tmp:f,blockMixCb:x}=F7t(e,t,n);KM||YM(u);for(let g=0;g<a;g++){const v=l*g;for(let w=0;w<l;w++)c[w]=u[v+w];for(let w=0,C=0;w<r-1;w++)dV(c,C,c,C+=l,s),x();dV(c,(r-1)*l,u,v,s),x();for(let w=0;w<r;w++){const C=u[v+l-16]%r;for(let N=0;N<l;N++)f[N]=u[v+N]^c[C*l+N];dV(f,0,u,v,s),x()}}return KM||YM(u),O7t(e,o,d,c,f)}function wFe(e,t,n,r,s,a,o){return QM(e),QM(t),M7t(e,t,{N:n,r:s,p:r,dkLen:a,onProgress:o})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const CFe=BigInt(0),u$=BigInt(1),R7t=BigInt(2);function $3(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function tT(e){if(!$3(e))throw new Error("Uint8Array expected")}const L7t=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function iN(e){tT(e);let t="";for(let n=0;n<e.length;n++)t+=L7t[e[n]];return t}function SFe(e){const t=e.toString(16);return t.length&1?`0${t}`:t}function foe(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}const Dx={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function dge(e){if(e>=Dx._0&&e<=Dx._9)return e-Dx._0;if(e>=Dx._A&&e<=Dx._F)return e-(Dx._A-10);if(e>=Dx._a&&e<=Dx._f)return e-(Dx._a-10)}function aN(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let s=0,a=0;s<n;s++,a+=2){const o=dge(e.charCodeAt(a)),l=dge(e.charCodeAt(a+1));if(o===void 0||l===void 0){const c=e[a]+e[a+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+a)}r[s]=o*16+l}return r}function Zw(e){return foe(iN(e))}function hoe(e){return tT(e),foe(iN(Uint8Array.from(e).reverse()))}function oN(e,t){return aN(e.toString(16).padStart(t*2,"0"))}function poe(e,t){return oN(e,t).reverse()}function D7t(e){return aN(SFe(e))}function Fp(e,t,n){let r;if(typeof t=="string")try{r=aN(t)}catch(a){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${a}`)}else if($3(t))r=Uint8Array.from(t);else throw new Error(`${e} must be hex string or Uint8Array`);const s=r.length;if(typeof n=="number"&&s!==n)throw new Error(`${e} expected ${n} bytes, got ${s}`);return r}function BE(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];tT(s),t+=s.length}const n=new Uint8Array(t);for(let r=0,s=0;r<e.length;r++){const a=e[r];n.set(a,s),s+=a.length}return n}function B7t(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}function $7t(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function U7t(e){let t;for(t=0;e>CFe;e>>=u$,t+=1);return t}function z7t(e,t){return e>>BigInt(t)&u$}function H7t(e,t,n){return e|(n?u$:CFe)<<BigInt(t)}const moe=e=>(R7t<<BigInt(e-1))-u$,fV=e=>new Uint8Array(e),fge=e=>Uint8Array.from(e);function NFe(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=fV(e),s=fV(e),a=0;const o=()=>{r.fill(1),s.fill(0),a=0},l=(...f)=>n(s,r,...f),c=(f=fV())=>{s=l(fge([0]),f),r=l(),f.length!==0&&(s=l(fge([1]),f),r=l())},u=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const x=[];for(;f<t;){r=l();const g=r.slice();x.push(g),f+=r.length}return BE(...x)};return(f,x)=>{o(),c(f);let g;for(;!(g=x(u()));)c();return o(),g}}const V7t={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||$3(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function nT(e,t,n={}){const r=(s,a,o)=>{const l=V7t[a];if(typeof l!="function")throw new Error(`Invalid validator "${a}", expected function`);const c=e[s];if(!(o&&c===void 0)&&!l(c,e))throw new Error(`Invalid param ${String(s)}=${c} (${typeof c}), expected ${a}`)};for(const[s,a]of Object.entries(t))r(s,a,!1);for(const[s,a]of Object.entries(n))r(s,a,!0);return e}const W7t=Object.freeze(Object.defineProperty({__proto__:null,abytes:tT,bitGet:z7t,bitLen:U7t,bitMask:moe,bitSet:H7t,bytesToHex:iN,bytesToNumberBE:Zw,bytesToNumberLE:hoe,concatBytes:BE,createHmacDrbg:NFe,ensureBytes:Fp,equalBytes:B7t,hexToBytes:aN,hexToNumber:foe,isBytes:$3,numberToBytesBE:oN,numberToBytesLE:poe,numberToHexUnpadded:SFe,numberToVarBytesBE:D7t,utf8ToBytes:$7t,validateObject:nT},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ac=BigInt(0),gl=BigInt(1),Ov=BigInt(2),q7t=BigInt(3),vee=BigInt(4),hge=BigInt(5),pge=BigInt(8);BigInt(9);BigInt(16);function Rd(e,t){const n=e%t;return n>=Ac?n:t+n}function G7t(e,t,n){if(n<=Ac||t<Ac)throw new Error("Expected power/modulo > 0");if(n===gl)return Ac;let r=gl;for(;t>Ac;)t&gl&&(r=r*e%n),e=e*e%n,t>>=gl;return r}function fh(e,t,n){let r=e;for(;t-- >Ac;)r*=r,r%=n;return r}function wee(e,t){if(e===Ac||t<=Ac)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=Rd(e,t),r=t,s=Ac,a=gl;for(;n!==Ac;){const l=r/n,c=r%n,u=s-a*l;r=n,n=c,s=a,a=u}if(r!==gl)throw new Error("invert: does not exist");return Rd(s,t)}function K7t(e){const t=(e-gl)/Ov;let n,r,s;for(n=e-gl,r=0;n%Ov===Ac;n/=Ov,r++);for(s=Ov;s<e&&G7t(s,t,e)!==e-gl;s++);if(r===1){const o=(e+gl)/vee;return function(c,u){const d=c.pow(u,o);if(!c.eql(c.sqr(d),u))throw new Error("Cannot find square root");return d}}const a=(n+gl)/Ov;return function(l,c){if(l.pow(c,t)===l.neg(l.ONE))throw new Error("Cannot find square root");let u=r,d=l.pow(l.mul(l.ONE,s),n),f=l.pow(c,a),x=l.pow(c,n);for(;!l.eql(x,l.ONE);){if(l.eql(x,l.ZERO))return l.ZERO;let g=1;for(let w=l.sqr(x);g<u&&!l.eql(w,l.ONE);g++)w=l.sqr(w);const v=l.pow(d,gl<<BigInt(u-g-1));d=l.sqr(v),f=l.mul(f,v),x=l.mul(x,d),u=g}return f}}function Y7t(e){if(e%vee===q7t){const t=(e+gl)/vee;return function(r,s){const a=r.pow(s,t);if(!r.eql(r.sqr(a),s))throw new Error("Cannot find square root");return a}}if(e%pge===hge){const t=(e-hge)/pge;return function(r,s){const a=r.mul(s,Ov),o=r.pow(a,t),l=r.mul(s,o),c=r.mul(r.mul(l,Ov),o),u=r.mul(l,r.sub(c,r.ONE));if(!r.eql(r.sqr(u),s))throw new Error("Cannot find square root");return u}}return K7t(e)}const X7t=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Q7t(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=X7t.reduce((r,s)=>(r[s]="function",r),t);return nT(e,n)}function Z7t(e,t,n){if(n<Ac)throw new Error("Expected power > 0");if(n===Ac)return e.ONE;if(n===gl)return t;let r=e.ONE,s=t;for(;n>Ac;)n&gl&&(r=e.mul(r,s)),s=e.sqr(s),n>>=gl;return r}function J7t(e,t){const n=new Array(t.length),r=t.reduce((a,o,l)=>e.is0(o)?a:(n[l]=a,e.mul(a,o)),e.ONE),s=e.inv(r);return t.reduceRight((a,o,l)=>e.is0(o)?a:(n[l]=e.mul(a,n[l]),e.mul(a,o)),s),n}function AFe(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function ejt(e,t,n=!1,r={}){if(e<=Ac)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:a}=AFe(e,t);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=Y7t(e),l=Object.freeze({ORDER:e,BITS:s,BYTES:a,MASK:moe(s),ZERO:Ac,ONE:gl,create:c=>Rd(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Ac<=c&&c<e},is0:c=>c===Ac,isOdd:c=>(c&gl)===gl,neg:c=>Rd(-c,e),eql:(c,u)=>c===u,sqr:c=>Rd(c*c,e),add:(c,u)=>Rd(c+u,e),sub:(c,u)=>Rd(c-u,e),mul:(c,u)=>Rd(c*u,e),pow:(c,u)=>Z7t(l,c,u),div:(c,u)=>Rd(c*wee(u,e),e),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>wee(c,e),sqrt:r.sqrt||(c=>o(l,c)),invertBatch:c=>J7t(l,c),cmov:(c,u,d)=>d?u:c,toBytes:c=>n?poe(c,a):oN(c,a),fromBytes:c=>{if(c.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${c.length}`);return n?hoe(c):Zw(c)}});return Object.freeze(l)}function jFe(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function EFe(e){const t=jFe(e);return t+Math.ceil(t/2)}function tjt(e,t,n=!1){const r=e.length,s=jFe(t),a=EFe(t);if(r<16||r<a||r>1024)throw new Error(`expected ${a}-1024 bytes of input, got ${r}`);const o=n?Zw(e):hoe(e),l=Rd(o,t-gl)+gl;return n?poe(l,s):oN(l,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const njt=BigInt(0),hV=BigInt(1);function rjt(e,t){const n=(s,a)=>{const o=a.negate();return s?o:a},r=s=>{const a=Math.ceil(t/s)+1,o=2**(s-1);return{windows:a,windowSize:o}};return{constTimeNegate:n,unsafeLadder(s,a){let o=e.ZERO,l=s;for(;a>njt;)a&hV&&(o=o.add(l)),l=l.double(),a>>=hV;return o},precomputeWindow(s,a){const{windows:o,windowSize:l}=r(a),c=[];let u=s,d=u;for(let f=0;f<o;f++){d=u,c.push(d);for(let x=1;x<l;x++)d=d.add(u),c.push(d);u=d.double()}return c},wNAF(s,a,o){const{windows:l,windowSize:c}=r(s);let u=e.ZERO,d=e.BASE;const f=BigInt(2**s-1),x=2**s,g=BigInt(s);for(let v=0;v<l;v++){const w=v*c;let C=Number(o&f);o>>=g,C>c&&(C-=x,o+=hV);const N=w,I=w+Math.abs(C)-1,P=v%2!==0,R=C<0;C===0?d=d.add(n(P,a[N])):u=u.add(n(R,a[I]))}return{p:u,f:d}},wNAFCached(s,a,o,l){const c=s._WINDOW_SIZE||1;let u=a.get(s);return u||(u=this.precomputeWindow(s,c),c!==1&&a.set(s,l(u))),this.wNAF(c,u,o)}}}function _Fe(e){return Q7t(e.Fp),nT(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...AFe(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function sjt(e){const t=_Fe(e);nT(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:ijt,hexToBytes:ajt}=W7t,Kv={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=Kv;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:ijt(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=Kv,n=typeof e=="string"?ajt(e):e;tT(n);let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:s,l:a}=Kv._parseInt(n.subarray(2)),{d:o,l}=Kv._parseInt(a);if(l.length)throw new t("Invalid signature: left bytes after parsing");return{r:s,s:o}},hexFromSig(e){const t=u=>Number.parseInt(u[0],16)&8?"00"+u:u,n=u=>{const d=u.toString(16);return d.length&1?`0${d}`:d},r=t(n(e.s)),s=t(n(e.r)),a=r.length/2,o=s.length/2,l=n(a),c=n(o);return`30${n(o+a+4)}02${c}${s}02${l}${r}`}},jg=BigInt(0),Rh=BigInt(1);BigInt(2);const mge=BigInt(3);BigInt(4);function ojt(e){const t=sjt(e),{Fp:n}=t,r=t.toBytes||((v,w,C)=>{const N=w.toAffine();return BE(Uint8Array.from([4]),n.toBytes(N.x),n.toBytes(N.y))}),s=t.fromBytes||(v=>{const w=v.subarray(1),C=n.fromBytes(w.subarray(0,n.BYTES)),N=n.fromBytes(w.subarray(n.BYTES,2*n.BYTES));return{x:C,y:N}});function a(v){const{a:w,b:C}=t,N=n.sqr(v),I=n.mul(N,v);return n.add(n.add(I,n.mul(v,w)),C)}if(!n.eql(n.sqr(t.Gy),a(t.Gx)))throw new Error("bad generator point: equation left != right");function o(v){return typeof v=="bigint"&&jg<v&&v<t.n}function l(v){if(!o(v))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(v){const{allowedPrivateKeyLengths:w,nByteLength:C,wrapPrivateKey:N,n:I}=t;if(w&&typeof v!="bigint"){if($3(v)&&(v=iN(v)),typeof v!="string"||!w.includes(v.length))throw new Error("Invalid key");v=v.padStart(C*2,"0")}let P;try{P=typeof v=="bigint"?v:Zw(Fp("private key",v,C))}catch{throw new Error(`private key must be ${C} bytes, hex or bigint, not ${typeof v}`)}return N&&(P=Rd(P,I)),l(P),P}const u=new Map;function d(v){if(!(v instanceof f))throw new Error("ProjectivePoint expected")}class f{constructor(w,C,N){if(this.px=w,this.py=C,this.pz=N,w==null||!n.isValid(w))throw new Error("x required");if(C==null||!n.isValid(C))throw new Error("y required");if(N==null||!n.isValid(N))throw new Error("z required")}static fromAffine(w){const{x:C,y:N}=w||{};if(!w||!n.isValid(C)||!n.isValid(N))throw new Error("invalid affine point");if(w instanceof f)throw new Error("projective point not allowed");const I=P=>n.eql(P,n.ZERO);return I(C)&&I(N)?f.ZERO:new f(C,N,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(w){const C=n.invertBatch(w.map(N=>N.pz));return w.map((N,I)=>N.toAffine(C[I])).map(f.fromAffine)}static fromHex(w){const C=f.fromAffine(s(Fp("pointHex",w)));return C.assertValidity(),C}static fromPrivateKey(w){return f.BASE.multiply(c(w))}_setWindowSize(w){this._WINDOW_SIZE=w,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:w,y:C}=this.toAffine();if(!n.isValid(w)||!n.isValid(C))throw new Error("bad point: x or y not FE");const N=n.sqr(C),I=a(w);if(!n.eql(N,I))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:w}=this.toAffine();if(n.isOdd)return!n.isOdd(w);throw new Error("Field doesn't support isOdd")}equals(w){d(w);const{px:C,py:N,pz:I}=this,{px:P,py:R,pz:F}=w,U=n.eql(n.mul(C,F),n.mul(P,I)),L=n.eql(n.mul(N,F),n.mul(R,I));return U&&L}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:w,b:C}=t,N=n.mul(C,mge),{px:I,py:P,pz:R}=this;let F=n.ZERO,U=n.ZERO,L=n.ZERO,z=n.mul(I,I),X=n.mul(P,P),ne=n.mul(R,R),J=n.mul(I,P);return J=n.add(J,J),L=n.mul(I,R),L=n.add(L,L),F=n.mul(w,L),U=n.mul(N,ne),U=n.add(F,U),F=n.sub(X,U),U=n.add(X,U),U=n.mul(F,U),F=n.mul(J,F),L=n.mul(N,L),ne=n.mul(w,ne),J=n.sub(z,ne),J=n.mul(w,J),J=n.add(J,L),L=n.add(z,z),z=n.add(L,z),z=n.add(z,ne),z=n.mul(z,J),U=n.add(U,z),ne=n.mul(P,R),ne=n.add(ne,ne),z=n.mul(ne,J),F=n.sub(F,z),L=n.mul(ne,X),L=n.add(L,L),L=n.add(L,L),new f(F,U,L)}add(w){d(w);const{px:C,py:N,pz:I}=this,{px:P,py:R,pz:F}=w;let U=n.ZERO,L=n.ZERO,z=n.ZERO;const X=t.a,ne=n.mul(t.b,mge);let J=n.mul(C,P),Z=n.mul(N,R),re=n.mul(I,F),he=n.add(C,N),Y=n.add(P,R);he=n.mul(he,Y),Y=n.add(J,Z),he=n.sub(he,Y),Y=n.add(C,I);let ie=n.add(P,F);return Y=n.mul(Y,ie),ie=n.add(J,re),Y=n.sub(Y,ie),ie=n.add(N,I),U=n.add(R,F),ie=n.mul(ie,U),U=n.add(Z,re),ie=n.sub(ie,U),z=n.mul(X,Y),U=n.mul(ne,re),z=n.add(U,z),U=n.sub(Z,z),z=n.add(Z,z),L=n.mul(U,z),Z=n.add(J,J),Z=n.add(Z,J),re=n.mul(X,re),Y=n.mul(ne,Y),Z=n.add(Z,re),re=n.sub(J,re),re=n.mul(X,re),Y=n.add(Y,re),J=n.mul(Z,Y),L=n.add(L,J),J=n.mul(ie,Y),U=n.mul(he,U),U=n.sub(U,J),J=n.mul(he,Z),z=n.mul(ie,z),z=n.add(z,J),new f(U,L,z)}subtract(w){return this.add(w.negate())}is0(){return this.equals(f.ZERO)}wNAF(w){return g.wNAFCached(this,u,w,C=>{const N=n.invertBatch(C.map(I=>I.pz));return C.map((I,P)=>I.toAffine(N[P])).map(f.fromAffine)})}multiplyUnsafe(w){const C=f.ZERO;if(w===jg)return C;if(l(w),w===Rh)return this;const{endo:N}=t;if(!N)return g.unsafeLadder(this,w);let{k1neg:I,k1:P,k2neg:R,k2:F}=N.splitScalar(w),U=C,L=C,z=this;for(;P>jg||F>jg;)P&Rh&&(U=U.add(z)),F&Rh&&(L=L.add(z)),z=z.double(),P>>=Rh,F>>=Rh;return I&&(U=U.negate()),R&&(L=L.negate()),L=new f(n.mul(L.px,N.beta),L.py,L.pz),U.add(L)}multiply(w){l(w);let C=w,N,I;const{endo:P}=t;if(P){const{k1neg:R,k1:F,k2neg:U,k2:L}=P.splitScalar(C);let{p:z,f:X}=this.wNAF(F),{p:ne,f:J}=this.wNAF(L);z=g.constTimeNegate(R,z),ne=g.constTimeNegate(U,ne),ne=new f(n.mul(ne.px,P.beta),ne.py,ne.pz),N=z.add(ne),I=X.add(J)}else{const{p:R,f:F}=this.wNAF(C);N=R,I=F}return f.normalizeZ([N,I])[0]}multiplyAndAddUnsafe(w,C,N){const I=f.BASE,P=(F,U)=>U===jg||U===Rh||!F.equals(I)?F.multiplyUnsafe(U):F.multiply(U),R=P(this,C).add(P(w,N));return R.is0()?void 0:R}toAffine(w){const{px:C,py:N,pz:I}=this,P=this.is0();w==null&&(w=P?n.ONE:n.inv(I));const R=n.mul(C,w),F=n.mul(N,w),U=n.mul(I,w);if(P)return{x:n.ZERO,y:n.ZERO};if(!n.eql(U,n.ONE))throw new Error("invZ was invalid");return{x:R,y:F}}isTorsionFree(){const{h:w,isTorsionFree:C}=t;if(w===Rh)return!0;if(C)return C(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:w,clearCofactor:C}=t;return w===Rh?this:C?C(f,this):this.multiplyUnsafe(t.h)}toRawBytes(w=!0){return this.assertValidity(),r(f,this,w)}toHex(w=!0){return iN(this.toRawBytes(w))}}f.BASE=new f(t.Gx,t.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const x=t.nBitLength,g=rjt(f,t.endo?Math.ceil(x/2):x);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:c,weierstrassEquation:a,isWithinCurveOrder:o}}function ljt(e){const t=_Fe(e);return nT(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function cjt(e){const t=ljt(e),{Fp:n,n:r}=t,s=n.BYTES+1,a=2*n.BYTES+1;function o(Y){return jg<Y&&Y<n.ORDER}function l(Y){return Rd(Y,r)}function c(Y){return wee(Y,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:x}=ojt({...t,toBytes(Y,ie,oe){const G=ie.toAffine(),V=n.toBytes(G.x),ee=BE;return oe?ee(Uint8Array.from([ie.hasEvenY()?2:3]),V):ee(Uint8Array.from([4]),V,n.toBytes(G.y))},fromBytes(Y){const ie=Y.length,oe=Y[0],G=Y.subarray(1);if(ie===s&&(oe===2||oe===3)){const V=Zw(G);if(!o(V))throw new Error("Point is not on curve");const ee=f(V);let ae;try{ae=n.sqrt(ee)}catch(ce){const ye=ce instanceof Error?": "+ce.message:"";throw new Error("Point is not on curve"+ye)}const fe=(ae&Rh)===Rh;return(oe&1)===1!==fe&&(ae=n.neg(ae)),{x:V,y:ae}}else if(ie===a&&oe===4){const V=n.fromBytes(G.subarray(0,n.BYTES)),ee=n.fromBytes(G.subarray(n.BYTES,2*n.BYTES));return{x:V,y:ee}}else throw new Error(`Point of length ${ie} was invalid. Expected ${s} compressed bytes or ${a} uncompressed bytes`)}}),g=Y=>iN(oN(Y,t.nByteLength));function v(Y){const ie=r>>Rh;return Y>ie}function w(Y){return v(Y)?l(-Y):Y}const C=(Y,ie,oe)=>Zw(Y.slice(ie,oe));class N{constructor(ie,oe,G){this.r=ie,this.s=oe,this.recovery=G,this.assertValidity()}static fromCompact(ie){const oe=t.nByteLength;return ie=Fp("compactSignature",ie,oe*2),new N(C(ie,0,oe),C(ie,oe,2*oe))}static fromDER(ie){const{r:oe,s:G}=Kv.toSig(Fp("DER",ie));return new N(oe,G)}assertValidity(){if(!x(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!x(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(ie){return new N(this.r,this.s,ie)}recoverPublicKey(ie){const{r:oe,s:G,recovery:V}=this,ee=L(Fp("msgHash",ie));if(V==null||![0,1,2,3].includes(V))throw new Error("recovery id invalid");const ae=V===2||V===3?oe+t.n:oe;if(ae>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const fe=V&1?"03":"02",Ae=u.fromHex(fe+g(ae)),ce=c(ae),ye=l(-ee*ce),Ne=l(G*ce),be=u.BASE.multiplyAndAddUnsafe(Ae,ye,Ne);if(!be)throw new Error("point at infinify");return be.assertValidity(),be}hasHighS(){return v(this.s)}normalizeS(){return this.hasHighS()?new N(this.r,l(-this.s),this.recovery):this}toDERRawBytes(){return aN(this.toDERHex())}toDERHex(){return Kv.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return aN(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}const I={isValidPrivateKey(Y){try{return d(Y),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const Y=EFe(t.n);return tjt(t.randomBytes(Y),t.n)},precompute(Y=8,ie=u.BASE){return ie._setWindowSize(Y),ie.multiply(BigInt(3)),ie}};function P(Y,ie=!0){return u.fromPrivateKey(Y).toRawBytes(ie)}function R(Y){const ie=$3(Y),oe=typeof Y=="string",G=(ie||oe)&&Y.length;return ie?G===s||G===a:oe?G===2*s||G===2*a:Y instanceof u}function F(Y,ie,oe=!0){if(R(Y))throw new Error("first arg must be private key");if(!R(ie))throw new Error("second arg must be public key");return u.fromHex(ie).multiply(d(Y)).toRawBytes(oe)}const U=t.bits2int||function(Y){const ie=Zw(Y),oe=Y.length*8-t.nBitLength;return oe>0?ie>>BigInt(oe):ie},L=t.bits2int_modN||function(Y){return l(U(Y))},z=moe(t.nBitLength);function X(Y){if(typeof Y!="bigint")throw new Error("bigint expected");if(!(jg<=Y&&Y<z))throw new Error(`bigint expected < 2^${t.nBitLength}`);return oN(Y,t.nByteLength)}function ne(Y,ie,oe=J){if(["recovered","canonical"].some(Ie=>Ie in oe))throw new Error("sign() legacy options not supported");const{hash:G,randomBytes:V}=t;let{lowS:ee,prehash:ae,extraEntropy:fe}=oe;ee==null&&(ee=!0),Y=Fp("msgHash",Y),ae&&(Y=Fp("prehashed msgHash",G(Y)));const Ae=L(Y),ce=d(ie),ye=[X(ce),X(Ae)];if(fe!=null&&fe!==!1){const Ie=fe===!0?V(n.BYTES):fe;ye.push(Fp("extraEntropy",Ie))}const Ne=BE(...ye),be=Ae;function je(Ie){const Re=U(Ie);if(!x(Re))return;const Qe=c(Re),Be=u.BASE.multiply(Re).toAffine(),it=l(Be.x);if(it===jg)return;const tt=l(Qe*l(be+it*ce));if(tt===jg)return;let at=(Be.x===it?0:2)|Number(Be.y&Rh),dt=tt;return ee&&v(tt)&&(dt=w(tt),at^=1),new N(it,dt,at)}return{seed:Ne,k2sig:je}}const J={lowS:t.lowS,prehash:!1},Z={lowS:t.lowS,prehash:!1};function re(Y,ie,oe=J){const{seed:G,k2sig:V}=ne(Y,ie,oe),ee=t;return NFe(ee.hash.outputLen,ee.nByteLength,ee.hmac)(G,V)}u.BASE._setWindowSize(8);function he(Y,ie,oe,G=Z){var Be;const V=Y;if(ie=Fp("msgHash",ie),oe=Fp("publicKey",oe),"strict"in G)throw new Error("options.strict was renamed to lowS");const{lowS:ee,prehash:ae}=G;let fe,Ae;try{if(typeof V=="string"||$3(V))try{fe=N.fromDER(V)}catch(it){if(!(it instanceof Kv.Err))throw it;fe=N.fromCompact(V)}else if(typeof V=="object"&&typeof V.r=="bigint"&&typeof V.s=="bigint"){const{r:it,s:tt}=V;fe=new N(it,tt)}else throw new Error("PARSE");Ae=u.fromHex(oe)}catch(it){if(it.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(ee&&fe.hasHighS())return!1;ae&&(ie=t.hash(ie));const{r:ce,s:ye}=fe,Ne=L(ie),be=c(ye),je=l(Ne*be),Ie=l(ce*be),Re=(Be=u.BASE.multiplyAndAddUnsafe(Ae,je,Ie))==null?void 0:Be.toAffine();return Re?l(Re.x)===ce:!1}return{CURVE:t,getPublicKey:P,getSharedSecret:F,sign:re,verify:he,ProjectivePoint:u,Signature:N,utils:I}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function ujt(e){return{hash:e,hmac:(t,...n)=>uoe(e,t,XM(...n)),randomBytes:SPe}}function djt(e,t){const n=r=>cjt({...e,...ujt(r)});return Object.freeze({...n(t),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const kFe=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),xge=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),fjt=BigInt(1),Cee=BigInt(2),gge=(e,t)=>(e+t/Cee)/t;function hjt(e){const t=kFe,n=BigInt(3),r=BigInt(6),s=BigInt(11),a=BigInt(22),o=BigInt(23),l=BigInt(44),c=BigInt(88),u=e*e*e%t,d=u*u*e%t,f=fh(d,n,t)*d%t,x=fh(f,n,t)*d%t,g=fh(x,Cee,t)*u%t,v=fh(g,s,t)*g%t,w=fh(v,a,t)*v%t,C=fh(w,l,t)*w%t,N=fh(C,c,t)*C%t,I=fh(N,l,t)*w%t,P=fh(I,n,t)*d%t,R=fh(P,o,t)*v%t,F=fh(R,r,t)*u%t,U=fh(F,Cee,t);if(!See.eql(See.sqr(U),e))throw new Error("Cannot find square root");return U}const See=ejt(kFe,void 0,void 0,{sqrt:hjt}),xoe=djt({a:BigInt(0),b:BigInt(7),Fp:See,n:xge,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=xge,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-fjt*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),l=gge(a*e,t),c=gge(-r*e,t);let u=Rd(e-l*n-c*s,t),d=Rd(-l*r-c*a,t);const f=u>o,x=d>o;if(f&&(u=t-u),x&&(d=t-d),u>o||d>o)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:x,k2:d}}}},c$);BigInt(0);xoe.ProjectivePoint;const pjt=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:xoe},Symbol.toStringTag,{value:"Module"}));var pV;const v1=(pV=xoe)!==null&&pV!==void 0?pV:pjt,bge=BigInt("0xffffffffffffffff"),$E=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),mjt=v1.CURVE.n,xjt=mjt/BigInt(2),gjt={type:"object",required:["crypto","id","version","address"],properties:{crypto:{type:"object",required:["cipher","ciphertext","cipherparams","kdf","kdfparams","mac"],properties:{cipher:{type:"string"},ciphertext:{type:"string"},cipherparams:{type:"object"},kdf:{type:"string"},kdfparams:{type:"object"},salt:{type:"string"},mac:{type:"string"}}},id:{type:"string"},version:{type:"number"},address:{type:"string"}}};var hR;(function(e){e[e.Mainnet=1]="Mainnet",e[e.Goerli=5]="Goerli",e[e.Sepolia=11155111]="Sepolia"})(hR||(hR={}));var to;(function(e){e.Chainstart="chainstart",e.Homestead="homestead",e.Dao="dao",e.TangerineWhistle="tangerineWhistle",e.SpuriousDragon="spuriousDragon",e.Byzantium="byzantium",e.Constantinople="constantinople",e.Petersburg="petersburg",e.Istanbul="istanbul",e.MuirGlacier="muirGlacier",e.Berlin="berlin",e.London="london",e.ArrowGlacier="arrowGlacier",e.GrayGlacier="grayGlacier",e.MergeForkIdTransition="mergeForkIdTransition",e.Merge="merge",e.Shanghai="shanghai",e.ShardingForkDev="shardingFork"})(to||(to={}));var yge;(function(e){e.ProofOfStake="pos",e.ProofOfWork="pow",e.ProofOfAuthority="poa"})(yge||(yge={}));var vge;(function(e){e.Ethash="ethash",e.Clique="clique",e.Casper="casper"})(vge||(vge={}));var fu;(function(e){e.PolygonMainnet="polygon-mainnet",e.PolygonMumbai="polygon-mumbai",e.ArbitrumRinkebyTestnet="arbitrum-rinkeby-testnet",e.ArbitrumOne="arbitrum-one",e.xDaiChain="x-dai-chain",e.OptimisticKovan="optimistic-kovan",e.OptimisticEthereum="optimistic-ethereum"})(fu||(fu={}));var $h;(function(e){e[e.Number=0]="Number",e[e.BigInt=1]="BigInt",e[e.Uint8Array=2]="Uint8Array",e[e.PrefixedHexString=3]="PrefixedHexString"})($h||($h={}));const TFe=e=>{if(typeof e!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof e}`);return Yae(e)?e.slice(2):e};function bjt(e){return!e||e==="0x0"?"0x0000000000000000":Yae(e)?`0x${TFe(e).padStart(16,"0")}`:`0x${e.padStart(16,"0")}`}const IFe=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Received an invalid integer type: ${e}`);return`0x${e.toString(16)}`};function yjt(e,t=!0){var n,r;const{name:s,config:a,difficulty:o,mixHash:l,gasLimit:c,coinbase:u,baseFeePerGas:d}=e;let{extraData:f,timestamp:x,nonce:g}=e;const v=Number(x),{chainId:w}=a;if(f===""&&(f="0x"),Yae(x)||(x=IFe(parseInt(x))),g.length!==18&&(g=bjt(g)),a.eip155Block!==a.eip158Block)throw new Error("EIP155 block number must equal EIP 158 block number since both are part of SpuriousDragon hardfork and the client only supports activating the full hardfork");const C={name:s,chainId:w,networkId:w,genesis:{timestamp:x,gasLimit:parseInt(c),difficulty:parseInt(o),nonce:g,extraData:f,mixHash:l,coinbase:u,baseFeePerGas:d},hardfork:void 0,hardforks:[],bootstrapNodes:[],consensus:a.clique!==void 0?{type:"poa",algorithm:"clique",clique:{period:(n=a.clique.period)!==null&&n!==void 0?n:a.clique.blockperiodseconds,epoch:(r=a.clique.epoch)!==null&&r!==void 0?r:a.clique.epochlength}}:{type:"pow",algorithm:"ethash",ethash:{}}},N={[to.Homestead]:{name:"homesteadBlock"},[to.Dao]:{name:"daoForkBlock"},[to.TangerineWhistle]:{name:"eip150Block"},[to.SpuriousDragon]:{name:"eip155Block"},[to.Byzantium]:{name:"byzantiumBlock"},[to.Constantinople]:{name:"constantinopleBlock"},[to.Petersburg]:{name:"petersburgBlock"},[to.Istanbul]:{name:"istanbulBlock"},[to.MuirGlacier]:{name:"muirGlacierBlock"},[to.Berlin]:{name:"berlinBlock"},[to.London]:{name:"londonBlock"},[to.MergeForkIdTransition]:{name:"mergeForkBlock",postMerge:t},[to.Shanghai]:{name:"shanghaiTime",postMerge:!0,isTimestamp:!0},[to.ShardingForkDev]:{name:"shardingForkTime",postMerge:!0,isTimestamp:!0}},I=Object.keys(N).reduce((F,U)=>(F[N[U].name]=U,F),{}),P=Object.keys(a).filter(F=>I[F]!==void 0&&a[F]!==void 0&&a[F]!==null);if(C.hardforks=P.map(F=>({name:I[F],block:N[I[F]].isTimestamp===!0||typeof a[F]!="number"?null:a[F],timestamp:N[I[F]].isTimestamp===!0&&typeof a[F]=="number"?a[F]:void 0})).filter(F=>F.block!==null||F.timestamp!==void 0),C.hardforks.sort((F,U)=>{var L,z;return((L=F.block)!==null&&L!==void 0?L:1/0)-((z=U.block)!==null&&z!==void 0?z:1/0)}),C.hardforks.sort((F,U)=>{var L,z;return((L=F.timestamp)!==null&&L!==void 0?L:v)-((z=U.timestamp)!==null&&z!==void 0?z:v)}),a.terminalTotalDifficulty!==void 0){const F={name:to.Merge,ttd:a.terminalTotalDifficulty,block:null},U=C.hardforks.findIndex(L=>{var z;return((z=N[L.name])===null||z===void 0?void 0:z.postMerge)===!0});U!==-1?C.hardforks.splice(U,0,F):C.hardforks.push(F)}const R=C.hardforks.length>0?C.hardforks.slice(-1)[0]:void 0;return C.hardfork=R==null?void 0:R.name,C.hardforks.unshift({name:to.Chainstart,block:0}),C}function vjt(e,t,n){try{if(["config","difficulty","gasLimit","alloc"].some(r=>!(r in e)))throw new Error("Invalid format, expected geth genesis fields missing");return t!==void 0&&(e.name=t),yjt(e,n)}catch(r){throw new Error(`Error parsing parameters file: ${r.message}`)}}function PFe(e){let t=e;if(typeof t!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof t}`);return t.length%2&&(t=`0${t}`),t}const wjt=function(e){const t=IFe(e);return so(`0x${PFe(t.slice(2))}`)},No=function(e){var t;if(e==null)return new Uint8Array;if(e instanceof Uint8Array)return e;if(((t=e==null?void 0:e.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"||Array.isArray(e))return Uint8Array.from(e);if(typeof e=="string"){if(!UPe(e))throw new Error(`Cannot convert string to Uint8Array. only supports 0x-prefixed hex strings and this string was given: ${e}`);return so(PFe(TFe(e)))}if(typeof e=="number")return No(Yl(e));if(typeof e=="bigint"){if(e<BigInt(0))throw new Error(`Cannot convert negative bigint to Uint8Array. Given: ${e}`);let n=e.toString(16);return n.length%2&&(n=`0${n}`),No(`0x${n}`)}if(e.toArray)return Uint8Array.from(e.toArray());throw new Error("invalid type")};function Wa(e){const t=Ui(e);return BigInt(t==="0x"?0:t)}function Cjt(e){return No(`0x${e.toString(16)}`)}const FFe=function(e){return new Uint8Array(e).fill(0)},Sjt=function(e,t,n){const r=FFe(t);return e.length<t?(r.set(e,t-e.length),r):e.subarray(-t)};function goe(e){if(!a2(e)){const t=`This method only supports Uint8Array but input was: ${e}`;throw new Error(t)}}const wge=function(e,t){return goe(e),Sjt(e,t)};function Njt(e){let t=e[0];for(;e.length>0&&t.toString()==="0";)e=e.slice(1),t=e[0];return e}const pR=function(e){return goe(e),Njt(e)},Ao=e=>`0x${e.toString(16)}`;function sa(e){return pR(Cjt(e))}function Ajt(e,t){return e===BigInt(0)||e===BigInt(1)?e:t===void 0?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}function jjt(e){return e===BigInt(0)||e===BigInt(1)}const boe=function(e,t,n,r,s){const a=Ajt(t,s);if(!jjt(a))throw new Error("Invalid signature v value");return new v1.Signature(Wa(n),Wa(r)).addRecoveryBit(Number(a)).recoverPublicKey(e).toRawBytes(!1).slice(1)};function z6(e,t){if(e===null)return null;if(e===void 0)return;if(typeof e=="string"&&!UPe(e))throw new Error(`A string must be provided with a 0x-prefix, given: ${e}`);if(typeof e=="number"&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const n=No(e);switch(t){case $h.Uint8Array:return n;case $h.BigInt:return Wa(n);case $h.Number:{const r=Wa(n);if(r>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(r)}case $h.PrefixedHexString:return Ui(n);default:throw new Error("unknown outputType")}}var Sp={},Cge;function Ejt(){if(Cge)return Sp;Cge=1,Object.defineProperty(Sp,"__esModule",{value:!0}),Sp.RLP=Sp.utils=Sp.decode=Sp.encode=void 0;function e(N){if(Array.isArray(N)){const P=[];let R=0;for(let F=0;F<N.length;F++){const U=e(N[F]);P.push(U),R+=U.length}return d(r(R,192),...P)}const I=C(N);return I.length===1&&I[0]<128?I:d(r(I.length,128),I)}Sp.encode=e;function t(N,I,P){if(P>N.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return N.slice(I,P)}function n(N){if(N[0]===0)throw new Error("invalid RLP: extra zeros");return c(l(N))}function r(N,I){if(N<56)return Uint8Array.from([N+I]);const P=x(N),R=P.length/2,F=x(I+55+R);return Uint8Array.from(u(F+P))}function s(N,I=!1){if(typeof N>"u"||N===null||N.length===0)return Uint8Array.from([]);const P=C(N),R=a(P);if(I)return R;if(R.remainder.length!==0)throw new Error("invalid RLP: remainder must be zero");return R.data}Sp.decode=s;function a(N){let I,P,R,F,U;const L=[],z=N[0];if(z<=127)return{data:N.slice(0,1),remainder:N.slice(1)};if(z<=183){if(I=z-127,z===128?R=Uint8Array.from([]):R=t(N,1,I),I===2&&R[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:R,remainder:N.slice(I)}}else if(z<=191){if(P=z-182,N.length-1<P)throw new Error("invalid RLP: not enough bytes for string length");if(I=n(t(N,1,P)),I<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return R=t(N,P,I+P),{data:R,remainder:N.slice(I+P)}}else if(z<=247){for(I=z-191,F=t(N,1,I);F.length;)U=a(F),L.push(U.data),F=U.remainder;return{data:L,remainder:N.slice(I)}}else{if(P=z-246,I=n(t(N,1,P)),I<56)throw new Error("invalid RLP: encoded list too short");const X=P+I;if(X>N.length)throw new Error("invalid RLP: total length is larger than the data");for(F=t(N,P,X);F.length;)U=a(F),L.push(U.data),F=U.remainder;return{data:L,remainder:N.slice(X)}}}const o=Array.from({length:256},(N,I)=>I.toString(16).padStart(2,"0"));function l(N){let I="";for(let P=0;P<N.length;P++)I+=o[N[P]];return I}function c(N){const I=Number.parseInt(N,16);if(Number.isNaN(I))throw new Error("Invalid byte sequence");return I}function u(N){if(typeof N!="string")throw new TypeError("hexToBytes: expected string, got "+typeof N);if(N.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const I=new Uint8Array(N.length/2);for(let P=0;P<I.length;P++){const R=P*2;I[P]=c(N.slice(R,R+2))}return I}function d(...N){if(N.length===1)return N[0];const I=N.reduce((R,F)=>R+F.length,0),P=new Uint8Array(I);for(let R=0,F=0;R<N.length;R++){const U=N[R];P.set(U,F),F+=U.length}return P}function f(N){return new TextEncoder().encode(N)}function x(N){if(N<0)throw new Error("Invalid integer as argument, must be unsigned!");const I=N.toString(16);return I.length%2?`0${I}`:I}function g(N){return N.length%2?`0${N}`:N}function v(N){return N.length>=2&&N[0]==="0"&&N[1]==="x"}function w(N){return typeof N!="string"?N:v(N)?N.slice(2):N}function C(N){if(N instanceof Uint8Array)return N;if(typeof N=="string")return v(N)?u(g(w(N))):f(N);if(typeof N=="number"||typeof N=="bigint")return N?u(x(N)):Uint8Array.from([]);if(N==null)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof N)}return Sp.utils={bytesToHex:l,concatBytes:d,hexToBytes:u,utf8ToBytes:f},Sp.RLP={encode:e,decode:s},Sp}var Uh=Ejt(),mV={};/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */var Sge;function _jt(){return Sge||(Sge=1,function(e){(function(t){t(typeof DO_NOT_EXPORT_CRC>"u"?e:{})})(function(t){t.version="1.2.2";function n(){for(var z=0,X=new Array(256),ne=0;ne!=256;++ne)z=ne,z=z&1?-306674912^z>>>1:z>>>1,z=z&1?-306674912^z>>>1:z>>>1,z=z&1?-306674912^z>>>1:z>>>1,z=z&1?-306674912^z>>>1:z>>>1,z=z&1?-306674912^z>>>1:z>>>1,z=z&1?-306674912^z>>>1:z>>>1,z=z&1?-306674912^z>>>1:z>>>1,z=z&1?-306674912^z>>>1:z>>>1,X[ne]=z;return typeof Int32Array<"u"?new Int32Array(X):X}var r=n();function s(z){var X=0,ne=0,J=0,Z=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(J=0;J!=256;++J)Z[J]=z[J];for(J=0;J!=256;++J)for(ne=z[J],X=256+J;X<4096;X+=256)ne=Z[X]=ne>>>8^z[ne&255];var re=[];for(J=1;J!=16;++J)re[J-1]=typeof Int32Array<"u"?Z.subarray(J*256,J*256+256):Z.slice(J*256,J*256+256);return re}var a=s(r),o=a[0],l=a[1],c=a[2],u=a[3],d=a[4],f=a[5],x=a[6],g=a[7],v=a[8],w=a[9],C=a[10],N=a[11],I=a[12],P=a[13],R=a[14];function F(z,X){for(var ne=X^-1,J=0,Z=z.length;J<Z;)ne=ne>>>8^r[(ne^z.charCodeAt(J++))&255];return~ne}function U(z,X){for(var ne=X^-1,J=z.length-15,Z=0;Z<J;)ne=R[z[Z++]^ne&255]^P[z[Z++]^ne>>8&255]^I[z[Z++]^ne>>16&255]^N[z[Z++]^ne>>>24]^C[z[Z++]]^w[z[Z++]]^v[z[Z++]]^g[z[Z++]]^x[z[Z++]]^f[z[Z++]]^d[z[Z++]]^u[z[Z++]]^c[z[Z++]]^l[z[Z++]]^o[z[Z++]]^r[z[Z++]];for(J+=15;Z<J;)ne=ne>>>8^r[(ne^z[Z++])&255];return~ne}function L(z,X){for(var ne=X^-1,J=0,Z=z.length,re=0,he=0;J<Z;)re=z.charCodeAt(J++),re<128?ne=ne>>>8^r[(ne^re)&255]:re<2048?(ne=ne>>>8^r[(ne^(192|re>>6&31))&255],ne=ne>>>8^r[(ne^(128|re&63))&255]):re>=55296&&re<57344?(re=(re&1023)+64,he=z.charCodeAt(J++)&1023,ne=ne>>>8^r[(ne^(240|re>>8&7))&255],ne=ne>>>8^r[(ne^(128|re>>2&63))&255],ne=ne>>>8^r[(ne^(128|he>>6&15|(re&3)<<4))&255],ne=ne>>>8^r[(ne^(128|he&63))&255]):(ne=ne>>>8^r[(ne^(224|re>>12&15))&255],ne=ne>>>8^r[(ne^(128|re>>6&63))&255],ne=ne>>>8^r[(ne^(128|re&63))&255]);return~ne}t.table=r,t.bstr=F,t.buf=U,t.str=L})}(mV)),mV}var kjt=_jt();const Tjt=ji(kjt),Ijt={name:"goerli",chainId:5,networkId:5,defaultHardfork:"merge",consensus:{type:"poa",algorithm:"clique",clique:{period:15,epoch:3e4}},comment:"Cross-client PoA test network",url:"https://github.com/goerli/testnet",genesis:{timestamp:"0x5c51a607",gasLimit:10485760,difficulty:1,nonce:"0x0000000000000000",extraData:"0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},hardforks:[{name:"chainstart",block:0,forkHash:"0xa3f5ab08"},{name:"homestead",block:0,forkHash:"0xa3f5ab08"},{name:"tangerineWhistle",block:0,forkHash:"0xa3f5ab08"},{name:"spuriousDragon",block:0,forkHash:"0xa3f5ab08"},{name:"byzantium",block:0,forkHash:"0xa3f5ab08"},{name:"constantinople",block:0,forkHash:"0xa3f5ab08"},{name:"petersburg",block:0,forkHash:"0xa3f5ab08"},{name:"istanbul",block:1561651,forkHash:"0xc25efa5c"},{name:"berlin",block:4460644,forkHash:"0x757a1c47"},{name:"london",block:5062605,forkHash:"0xb8c6299d"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://goerli.etherscan.io/block/7382818",name:"merge",ttd:"10790000",block:7382819,forkHash:"0xb8c6299d"},{name:"mergeForkIdTransition",block:null,forkHash:null},{name:"shanghai",block:null,forkHash:null}],bootstrapNodes:[],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net"]},Pjt={name:"mainnet",chainId:1,networkId:1,defaultHardfork:"merge",consensus:{type:"pow",algorithm:"ethash",ethash:{}},comment:"The Ethereum main chain",url:"https://ethstats.net/",genesis:{gasLimit:5e3,difficulty:17179869184,nonce:"0x0000000000000042",extraData:"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"},hardforks:[{name:"chainstart",block:0,forkHash:"0xfc64ec04"},{name:"homestead",block:115e4,forkHash:"0x97c2c34c"},{name:"dao",block:192e4,forkHash:"0x91d1f948"},{name:"tangerineWhistle",block:2463e3,forkHash:"0x7a64da13"},{name:"spuriousDragon",block:2675e3,forkHash:"0x3edd5b10"},{name:"byzantium",block:437e4,forkHash:"0xa00bc324"},{name:"constantinople",block:728e4,forkHash:"0x668db0af"},{name:"petersburg",block:728e4,forkHash:"0x668db0af"},{name:"istanbul",block:9069e3,forkHash:"0x879d6e30"},{name:"muirGlacier",block:92e5,forkHash:"0xe029e991"},{name:"berlin",block:12244e3,forkHash:"0x0eb440f6"},{name:"london",block:12965e3,forkHash:"0xb715077d"},{name:"arrowGlacier",block:13773e3,forkHash:"0x20c327fc"},{name:"grayGlacier",block:1505e4,forkHash:"0xf0afd0e3"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://etherscan.io/block/15537393",name:"merge",ttd:"58750000000000000000000",block:15537394,forkHash:"0xf0afd0e3"},{name:"mergeForkIdTransition",block:null,forkHash:null},{name:"shanghai",block:null,forkHash:null}],bootstrapNodes:[],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.mainnet.ethdisco.net"]},Fjt={name:"sepolia",chainId:11155111,networkId:11155111,defaultHardfork:"merge",consensus:{type:"pow",algorithm:"ethash",ethash:{}},comment:"PoW test network to replace Ropsten",url:"https://github.com/ethereum/go-ethereum/pull/23730",genesis:{timestamp:"0x6159af19",gasLimit:3e7,difficulty:131072,nonce:"0x0000000000000000",extraData:"0x5365706f6c69612c20417468656e732c204174746963612c2047726565636521"},hardforks:[{name:"chainstart",block:0,forkHash:"0xfe3366e7"},{name:"homestead",block:0,forkHash:"0xfe3366e7"},{name:"tangerineWhistle",block:0,forkHash:"0xfe3366e7"},{name:"spuriousDragon",block:0,forkHash:"0xfe3366e7"},{name:"byzantium",block:0,forkHash:"0xfe3366e7"},{name:"constantinople",block:0,forkHash:"0xfe3366e7"},{name:"petersburg",block:0,forkHash:"0xfe3366e7"},{name:"istanbul",block:0,forkHash:"0xfe3366e7"},{name:"muirGlacier",block:0,forkHash:"0xfe3366e7"},{name:"berlin",block:0,forkHash:"0xfe3366e7"},{name:"london",block:0,forkHash:"0xfe3366e7"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://sepolia.etherscan.io/block/1450408",name:"merge",ttd:"17000000000000000",block:1450409,forkHash:"0xfe3366e7"},{name:"mergeForkIdTransition",block:1735371,forkHash:"0xb96cbd13"},{name:"shanghai",block:null,timestamp:"1677557088",forkHash:"0xf7f9bc08"}],bootstrapNodes:[],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.sepolia.ethdisco.net"]},Ojt={name:"EIP-1153",number:1153,comment:"Transient Storage",url:"https://eips.ethereum.org/EIPS/eip-1153",status:"Review",minimumHardfork:"chainstart",requiredEIPs:[],gasConfig:{},gasPrices:{tstore:{v:100,d:"Base fee of the TSTORE opcode"},tload:{v:100,d:"Base fee of the TLOAD opcode"}},vm:{},pow:{}},Mjt={name:"EIP-1559",number:1559,comment:"Fee market change for ETH 1.0 chain",url:"https://eips.ethereum.org/EIPS/eip-1559",status:"Final",minimumHardfork:"berlin",requiredEIPs:[2930],gasConfig:{baseFeeMaxChangeDenominator:{v:8,d:"Maximum base fee change denominator"},elasticityMultiplier:{v:2,d:"Maximum block gas target elasticity"},initialBaseFee:{v:1e9,d:"Initial base fee on first EIP1559 block"}},gasPrices:{},vm:{},pow:{}},Rjt={name:"EIP-2315",number:2315,comment:"Simple subroutines for the EVM",url:"https://eips.ethereum.org/EIPS/eip-2315",status:"Draft",minimumHardfork:"istanbul",gasConfig:{},gasPrices:{beginsub:{v:2,d:"Base fee of the BEGINSUB opcode"},returnsub:{v:5,d:"Base fee of the RETURNSUB opcode"},jumpsub:{v:10,d:"Base fee of the JUMPSUB opcode"}},vm:{},pow:{}},Ljt={name:"EIP-2537",number:2537,comment:"BLS12-381 precompiles",url:"https://eips.ethereum.org/EIPS/eip-2537",status:"Draft",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{Bls12381G1AddGas:{v:600,d:"Gas cost of a single BLS12-381 G1 addition precompile-call"},Bls12381G1MulGas:{v:12e3,d:"Gas cost of a single BLS12-381 G1 multiplication precompile-call"},Bls12381G2AddGas:{v:4500,d:"Gas cost of a single BLS12-381 G2 addition precompile-call"},Bls12381G2MulGas:{v:55e3,d:"Gas cost of a single BLS12-381 G2 multiplication precompile-call"},Bls12381PairingBaseGas:{v:115e3,d:"Base gas cost of BLS12-381 pairing check"},Bls12381PairingPerPairGas:{v:23e3,d:"Per-pair gas cost of BLS12-381 pairing check"},Bls12381MapG1Gas:{v:5500,d:"Gas cost of BLS12-381 map field element to G1"},Bls12381MapG2Gas:{v:11e4,d:"Gas cost of BLS12-381 map field element to G2"},Bls12381MultiExpGasDiscount:{v:[[1,1200],[2,888],[3,764],[4,641],[5,594],[6,547],[7,500],[8,453],[9,438],[10,423],[11,408],[12,394],[13,379],[14,364],[15,349],[16,334],[17,330],[18,326],[19,322],[20,318],[21,314],[22,310],[23,306],[24,302],[25,298],[26,294],[27,289],[28,285],[29,281],[30,277],[31,273],[32,269],[33,268],[34,266],[35,265],[36,263],[37,262],[38,260],[39,259],[40,257],[41,256],[42,254],[43,253],[44,251],[45,250],[46,248],[47,247],[48,245],[49,244],[50,242],[51,241],[52,239],[53,238],[54,236],[55,235],[56,233],[57,232],[58,231],[59,229],[60,228],[61,226],[62,225],[63,223],[64,222],[65,221],[66,220],[67,219],[68,219],[69,218],[70,217],[71,216],[72,216],[73,215],[74,214],[75,213],[76,213],[77,212],[78,211],[79,211],[80,210],[81,209],[82,208],[83,208],[84,207],[85,206],[86,205],[87,205],[88,204],[89,203],[90,202],[91,202],[92,201],[93,200],[94,199],[95,199],[96,198],[97,197],[98,196],[99,196],[100,195],[101,194],[102,193],[103,193],[104,192],[105,191],[106,191],[107,190],[108,189],[109,188],[110,188],[111,187],[112,186],[113,185],[114,185],[115,184],[116,183],[117,182],[118,182],[119,181],[120,180],[121,179],[122,179],[123,178],[124,177],[125,176],[126,176],[127,175],[128,174]],d:"Discount gas costs of calls to the MultiExp precompiles with `k` (point, scalar) pair"}},vm:{},pow:{}},Djt={name:"EIP-2565",number:2565,comment:"ModExp gas cost",url:"https://eips.ethereum.org/EIPS/eip-2565",status:"Final",minimumHardfork:"byzantium",gasConfig:{},gasPrices:{modexpGquaddivisor:{v:3,d:"Gquaddivisor from modexp precompile for gas calculation"}},vm:{},pow:{}},Bjt={name:"EIP-2718",comment:"Typed Transaction Envelope",url:"https://eips.ethereum.org/EIPS/eip-2718",status:"Final",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{},vm:{},pow:{}},$jt={name:"EIP-2929",comment:"Gas cost increases for state access opcodes",url:"https://eips.ethereum.org/EIPS/eip-2929",status:"Final",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{coldsload:{v:2100,d:"Gas cost of the first read of storage from a given location (per transaction)"},coldaccountaccess:{v:2600,d:"Gas cost of the first read of a given address (per transaction)"},warmstorageread:{v:100,d:"Gas cost of reading storage locations which have already loaded 'cold'"},sstoreCleanGasEIP2200:{v:2900,d:"Once per SSTORE operation from clean non-zero to something else"},sstoreNoopGasEIP2200:{v:100,d:"Once per SSTORE operation if the value doesn't change"},sstoreDirtyGasEIP2200:{v:100,d:"Once per SSTORE operation if a dirty value is changed"},sstoreInitRefundEIP2200:{v:19900,d:"Once per SSTORE operation for resetting to the original zero value"},sstoreCleanRefundEIP2200:{v:4900,d:"Once per SSTORE operation for resetting to the original non-zero value"},call:{v:0,d:"Base fee of the CALL opcode"},callcode:{v:0,d:"Base fee of the CALLCODE opcode"},delegatecall:{v:0,d:"Base fee of the DELEGATECALL opcode"},staticcall:{v:0,d:"Base fee of the STATICCALL opcode"},balance:{v:0,d:"Base fee of the BALANCE opcode"},extcodesize:{v:0,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:0,d:"Base fee of the EXTCODECOPY opcode"},extcodehash:{v:0,d:"Base fee of the EXTCODEHASH opcode"},sload:{v:0,d:"Base fee of the SLOAD opcode"},sstore:{v:0,d:"Base fee of the SSTORE opcode"}},vm:{},pow:{}},Ujt={name:"EIP-2930",comment:"Optional access lists",url:"https://eips.ethereum.org/EIPS/eip-2930",status:"Final",minimumHardfork:"istanbul",requiredEIPs:[2718,2929],gasConfig:{},gasPrices:{accessListStorageKeyCost:{v:1900,d:"Gas cost per storage key in an Access List transaction"},accessListAddressCost:{v:2400,d:"Gas cost per storage key in an Access List transaction"}},vm:{},pow:{}},zjt={name:"EIP-3198",number:3198,comment:"BASEFEE opcode",url:"https://eips.ethereum.org/EIPS/eip-3198",status:"Final",minimumHardfork:"london",gasConfig:{},gasPrices:{basefee:{v:2,d:"Gas cost of the BASEFEE opcode"}},vm:{},pow:{}},Hjt={name:"EIP-3529",comment:"Reduction in refunds",url:"https://eips.ethereum.org/EIPS/eip-3529",status:"Final",minimumHardfork:"berlin",requiredEIPs:[2929],gasConfig:{maxRefundQuotient:{v:5,d:"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},gasPrices:{selfdestructRefund:{v:0,d:"Refunded following a selfdestruct operation"},sstoreClearRefundEIP2200:{v:4800,d:"Once per SSTORE operation for clearing an originally existing storage slot"}},vm:{},pow:{}},Vjt={name:"EIP-3540",number:3540,comment:"EVM Object Format (EOF) v1",url:"https://eips.ethereum.org/EIPS/eip-3540",status:"Review",minimumHardfork:"london",requiredEIPs:[3541],gasConfig:{},gasPrices:{},vm:{},pow:{}},Wjt={name:"EIP-3541",comment:"Reject new contracts starting with the 0xEF byte",url:"https://eips.ethereum.org/EIPS/eip-3541",status:"Final",minimumHardfork:"berlin",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},qjt={name:"EIP-3554",comment:"Reduction in refunds",url:"Difficulty Bomb Delay to December 1st 2021",status:"Final",minimumHardfork:"muirGlacier",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:95e5,d:"the amount of blocks to delay the difficulty bomb with"}}},Gjt={name:"EIP-3607",number:3607,comment:"Reject transactions from senders with deployed code",url:"https://eips.ethereum.org/EIPS/eip-3607",status:"Final",minimumHardfork:"chainstart",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},Kjt={name:"EIP-3651",number:3198,comment:"Warm COINBASE",url:"https://eips.ethereum.org/EIPS/eip-3651",status:"Review",minimumHardfork:"london",requiredEIPs:[2929],gasConfig:{},gasPrices:{},vm:{},pow:{}},Yjt={name:"EIP-3670",number:3670,comment:"EOF - Code Validation",url:"https://eips.ethereum.org/EIPS/eip-3670",status:"Review",minimumHardfork:"london",requiredEIPs:[3540],gasConfig:{},gasPrices:{},vm:{},pow:{}},Xjt={name:"EIP-3675",number:3675,comment:"Upgrade consensus to Proof-of-Stake",url:"https://eips.ethereum.org/EIPS/eip-3675",status:"Final",minimumHardfork:"london",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},Qjt={name:"EIP-3855",number:3855,comment:"PUSH0 instruction",url:"https://eips.ethereum.org/EIPS/eip-3855",status:"Review",minimumHardfork:"chainstart",requiredEIPs:[],gasConfig:{},gasPrices:{push0:{v:2,d:"Base fee of the PUSH0 opcode"}},vm:{},pow:{}},Zjt={name:"EIP-3860",number:3860,comment:"Limit and meter initcode",url:"https://eips.ethereum.org/EIPS/eip-3860",status:"Review",minimumHardfork:"spuriousDragon",requiredEIPs:[],gasConfig:{},gasPrices:{initCodeWordCost:{v:2,d:"Gas to pay for each word (32 bytes) of initcode when creating a contract"}},vm:{maxInitCodeSize:{v:49152,d:"Maximum length of initialization code when creating a contract"}},pow:{}},Jjt={name:"EIP-4345",number:4345,comment:"Difficulty Bomb Delay to June 2022",url:"https://eips.ethereum.org/EIPS/eip-4345",status:"Final",minimumHardfork:"london",gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:107e5,d:"the amount of blocks to delay the difficulty bomb with"}}},e9t={name:"EIP-4399",number:4399,comment:"Supplant DIFFICULTY opcode with PREVRANDAO",url:"https://eips.ethereum.org/EIPS/eip-4399",status:"Review",minimumHardfork:"london",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},t9t={name:"EIP-5133",number:5133,comment:"Delaying Difficulty Bomb to mid-September 2022",url:"https://eips.ethereum.org/EIPS/eip-5133",status:"Draft",minimumHardfork:"grayGlacier",gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:114e5,d:"the amount of blocks to delay the difficulty bomb with"}}},H6={1153:Ojt,1559:Mjt,2315:Rjt,2537:Ljt,2565:Djt,2718:Bjt,2929:$jt,2930:Ujt,3198:zjt,3529:Hjt,3540:Vjt,3541:Wjt,3554:qjt,3607:Gjt,3651:Kjt,3670:Yjt,3675:Xjt,3855:Qjt,3860:Zjt,4345:Jjt,4399:e9t,5133:t9t},n9t={name:"chainstart",comment:"Start of the Ethereum main chain",url:"",status:"",gasConfig:{minGasLimit:{v:5e3,d:"Minimum the gas limit may ever be"},gasLimitBoundDivisor:{v:1024,d:"The bound divisor of the gas limit, used in update calculations"},maxRefundQuotient:{v:2,d:"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},gasPrices:{base:{v:2,d:"Gas base cost, used e.g. for ChainID opcode (Istanbul)"},tierStep:{v:[0,2,3,5,8,10,20],d:"Once per operation, for a selection of them"},exp:{v:10,d:"Base fee of the EXP opcode"},expByte:{v:10,d:"Times ceil(log256(exponent)) for the EXP instruction"},sha3:{v:30,d:"Base fee of the SHA3 opcode"},sha3Word:{v:6,d:"Once per word of the SHA3 operation's data"},sload:{v:50,d:"Base fee of the SLOAD opcode"},sstoreSet:{v:2e4,d:"Once per SSTORE operation if the zeroness changes from zero"},sstoreReset:{v:5e3,d:"Once per SSTORE operation if the zeroness does not change from zero"},sstoreRefund:{v:15e3,d:"Once per SSTORE operation if the zeroness changes to zero"},jumpdest:{v:1,d:"Base fee of the JUMPDEST opcode"},log:{v:375,d:"Base fee of the LOG opcode"},logData:{v:8,d:"Per byte in a LOG* operation's data"},logTopic:{v:375,d:"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas"},create:{v:32e3,d:"Base fee of the CREATE opcode"},call:{v:40,d:"Base fee of the CALL opcode"},callStipend:{v:2300,d:"Free gas given at beginning of call"},callValueTransfer:{v:9e3,d:"Paid for CALL when the value transfor is non-zero"},callNewAccount:{v:25e3,d:"Paid for CALL when the destination address didn't exist prior"},selfdestructRefund:{v:24e3,d:"Refunded following a selfdestruct operation"},memory:{v:3,d:"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL"},quadCoeffDiv:{v:512,d:"Divisor for the quadratic particle of the memory cost equation"},createData:{v:200,d:""},tx:{v:21e3,d:"Per transaction. NOTE: Not payable on data of calls between transactions"},txCreation:{v:32e3,d:"The cost of creating a contract via tx"},txDataZero:{v:4,d:"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions"},txDataNonZero:{v:68,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},copy:{v:3,d:"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added"},ecRecover:{v:3e3,d:""},sha256:{v:60,d:""},sha256Word:{v:12,d:""},ripemd160:{v:600,d:""},ripemd160Word:{v:120,d:""},identity:{v:15,d:""},identityWord:{v:3,d:""},stop:{v:0,d:"Base fee of the STOP opcode"},add:{v:3,d:"Base fee of the ADD opcode"},mul:{v:5,d:"Base fee of the MUL opcode"},sub:{v:3,d:"Base fee of the SUB opcode"},div:{v:5,d:"Base fee of the DIV opcode"},sdiv:{v:5,d:"Base fee of the SDIV opcode"},mod:{v:5,d:"Base fee of the MOD opcode"},smod:{v:5,d:"Base fee of the SMOD opcode"},addmod:{v:8,d:"Base fee of the ADDMOD opcode"},mulmod:{v:8,d:"Base fee of the MULMOD opcode"},signextend:{v:5,d:"Base fee of the SIGNEXTEND opcode"},lt:{v:3,d:"Base fee of the LT opcode"},gt:{v:3,d:"Base fee of the GT opcode"},slt:{v:3,d:"Base fee of the SLT opcode"},sgt:{v:3,d:"Base fee of the SGT opcode"},eq:{v:3,d:"Base fee of the EQ opcode"},iszero:{v:3,d:"Base fee of the ISZERO opcode"},and:{v:3,d:"Base fee of the AND opcode"},or:{v:3,d:"Base fee of the OR opcode"},xor:{v:3,d:"Base fee of the XOR opcode"},not:{v:3,d:"Base fee of the NOT opcode"},byte:{v:3,d:"Base fee of the BYTE opcode"},address:{v:2,d:"Base fee of the ADDRESS opcode"},balance:{v:20,d:"Base fee of the BALANCE opcode"},origin:{v:2,d:"Base fee of the ORIGIN opcode"},caller:{v:2,d:"Base fee of the CALLER opcode"},callvalue:{v:2,d:"Base fee of the CALLVALUE opcode"},calldataload:{v:3,d:"Base fee of the CALLDATALOAD opcode"},calldatasize:{v:2,d:"Base fee of the CALLDATASIZE opcode"},calldatacopy:{v:3,d:"Base fee of the CALLDATACOPY opcode"},codesize:{v:2,d:"Base fee of the CODESIZE opcode"},codecopy:{v:3,d:"Base fee of the CODECOPY opcode"},gasprice:{v:2,d:"Base fee of the GASPRICE opcode"},extcodesize:{v:20,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:20,d:"Base fee of the EXTCODECOPY opcode"},blockhash:{v:20,d:"Base fee of the BLOCKHASH opcode"},coinbase:{v:2,d:"Base fee of the COINBASE opcode"},timestamp:{v:2,d:"Base fee of the TIMESTAMP opcode"},number:{v:2,d:"Base fee of the NUMBER opcode"},difficulty:{v:2,d:"Base fee of the DIFFICULTY opcode"},gaslimit:{v:2,d:"Base fee of the GASLIMIT opcode"},pop:{v:2,d:"Base fee of the POP opcode"},mload:{v:3,d:"Base fee of the MLOAD opcode"},mstore:{v:3,d:"Base fee of the MSTORE opcode"},mstore8:{v:3,d:"Base fee of the MSTORE8 opcode"},sstore:{v:0,d:"Base fee of the SSTORE opcode"},jump:{v:8,d:"Base fee of the JUMP opcode"},jumpi:{v:10,d:"Base fee of the JUMPI opcode"},pc:{v:2,d:"Base fee of the PC opcode"},msize:{v:2,d:"Base fee of the MSIZE opcode"},gas:{v:2,d:"Base fee of the GAS opcode"},push:{v:3,d:"Base fee of the PUSH opcode"},dup:{v:3,d:"Base fee of the DUP opcode"},swap:{v:3,d:"Base fee of the SWAP opcode"},callcode:{v:40,d:"Base fee of the CALLCODE opcode"},return:{v:0,d:"Base fee of the RETURN opcode"},invalid:{v:0,d:"Base fee of the INVALID opcode"},selfdestruct:{v:0,d:"Base fee of the SELFDESTRUCT opcode"}},vm:{stackLimit:{v:1024,d:"Maximum size of VM stack allowed"},callCreateDepth:{v:1024,d:"Maximum depth of call/create stack"},maxExtraDataSize:{v:32,d:"Maximum size extra data may be after Genesis"}},pow:{minimumDifficulty:{v:131072,d:"The minimum that the difficulty may ever be"},difficultyBoundDivisor:{v:2048,d:"The bound divisor of the difficulty, used in the update calculations"},durationLimit:{v:13,d:"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not"},epochDuration:{v:3e4,d:"Duration between proof-of-work epochs"},timebombPeriod:{v:1e5,d:"Exponential difficulty timebomb period"},minerReward:{v:"5000000000000000000",d:"the amount a miner get rewarded for mining a block"},difficultyBombDelay:{v:0,d:"the amount of blocks to delay the difficulty bomb with"}}},r9t={name:"dao",comment:"DAO rescue hardfork",url:"https://eips.ethereum.org/EIPS/eip-779",status:"Final",gasConfig:{},gasPrices:{},vm:{},pow:{}},s9t={name:"homestead",comment:"Homestead hardfork with protocol and network changes",url:"https://eips.ethereum.org/EIPS/eip-606",status:"Final",gasConfig:{},gasPrices:{delegatecall:{v:40,d:"Base fee of the DELEGATECALL opcode"}},vm:{},pow:{}},i9t={name:"tangerineWhistle",comment:"Hardfork with gas cost changes for IO-heavy operations",url:"https://eips.ethereum.org/EIPS/eip-608",status:"Final",gasConfig:{},gasPrices:{sload:{v:200,d:"Once per SLOAD operation"},call:{v:700,d:"Once per CALL operation & message call transaction"},extcodesize:{v:700,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:700,d:"Base fee of the EXTCODECOPY opcode"},balance:{v:400,d:"Base fee of the BALANCE opcode"},delegatecall:{v:700,d:"Base fee of the DELEGATECALL opcode"},callcode:{v:700,d:"Base fee of the CALLCODE opcode"},selfdestruct:{v:5e3,d:"Base fee of the SELFDESTRUCT opcode"}},vm:{},pow:{}},a9t={name:"spuriousDragon",comment:"HF with EIPs for simple replay attack protection, EXP cost increase, state trie clearing, contract code size limit",url:"https://eips.ethereum.org/EIPS/eip-607",status:"Final",gasConfig:{},gasPrices:{expByte:{v:50,d:"Times ceil(log256(exponent)) for the EXP instruction"}},vm:{maxCodeSize:{v:24576,d:"Maximum length of contract code"}},pow:{}},o9t={name:"byzantium",comment:"Hardfork with new precompiles, instructions and other protocol changes",url:"https://eips.ethereum.org/EIPS/eip-609",status:"Final",gasConfig:{},gasPrices:{modexpGquaddivisor:{v:20,d:"Gquaddivisor from modexp precompile for gas calculation"},ecAdd:{v:500,d:"Gas costs for curve addition precompile"},ecMul:{v:4e4,d:"Gas costs for curve multiplication precompile"},ecPairing:{v:1e5,d:"Base gas costs for curve pairing precompile"},ecPairingWord:{v:8e4,d:"Gas costs regarding curve pairing precompile input length"},revert:{v:0,d:"Base fee of the REVERT opcode"},staticcall:{v:700,d:"Base fee of the STATICCALL opcode"},returndatasize:{v:2,d:"Base fee of the RETURNDATASIZE opcode"},returndatacopy:{v:3,d:"Base fee of the RETURNDATACOPY opcode"}},vm:{},pow:{minerReward:{v:"3000000000000000000",d:"the amount a miner get rewarded for mining a block"},difficultyBombDelay:{v:3e6,d:"the amount of blocks to delay the difficulty bomb with"}}},l9t={name:"constantinople",comment:"Postponed hardfork including EIP-1283 (SSTORE gas metering changes)",url:"https://eips.ethereum.org/EIPS/eip-1013",status:"Final",gasConfig:{},gasPrices:{netSstoreNoopGas:{v:200,d:"Once per SSTORE operation if the value doesn't change"},netSstoreInitGas:{v:2e4,d:"Once per SSTORE operation from clean zero"},netSstoreCleanGas:{v:5e3,d:"Once per SSTORE operation from clean non-zero"},netSstoreDirtyGas:{v:200,d:"Once per SSTORE operation from dirty"},netSstoreClearRefund:{v:15e3,d:"Once per SSTORE operation for clearing an originally existing storage slot"},netSstoreResetRefund:{v:4800,d:"Once per SSTORE operation for resetting to the original non-zero value"},netSstoreResetClearRefund:{v:19800,d:"Once per SSTORE operation for resetting to the original zero value"},shl:{v:3,d:"Base fee of the SHL opcode"},shr:{v:3,d:"Base fee of the SHR opcode"},sar:{v:3,d:"Base fee of the SAR opcode"},extcodehash:{v:400,d:"Base fee of the EXTCODEHASH opcode"},create2:{v:32e3,d:"Base fee of the CREATE2 opcode"}},vm:{},pow:{minerReward:{v:"2000000000000000000",d:"The amount a miner gets rewarded for mining a block"},difficultyBombDelay:{v:5e6,d:"the amount of blocks to delay the difficulty bomb with"}}},c9t={name:"petersburg",comment:"Aka constantinopleFix, removes EIP-1283, activate together with or after constantinople",url:"https://eips.ethereum.org/EIPS/eip-1716",status:"Final",gasConfig:{},gasPrices:{netSstoreNoopGas:{v:null,d:"Removed along EIP-1283"},netSstoreInitGas:{v:null,d:"Removed along EIP-1283"},netSstoreCleanGas:{v:null,d:"Removed along EIP-1283"},netSstoreDirtyGas:{v:null,d:"Removed along EIP-1283"},netSstoreClearRefund:{v:null,d:"Removed along EIP-1283"},netSstoreResetRefund:{v:null,d:"Removed along EIP-1283"},netSstoreResetClearRefund:{v:null,d:"Removed along EIP-1283"}},vm:{},pow:{}},u9t={name:"istanbul",comment:"HF targeted for December 2019 following the Constantinople/Petersburg HF",url:"https://eips.ethereum.org/EIPS/eip-1679",status:"Final",gasConfig:{},gasPrices:{blake2Round:{v:1,d:"Gas cost per round for the Blake2 F precompile"},ecAdd:{v:150,d:"Gas costs for curve addition precompile"},ecMul:{v:6e3,d:"Gas costs for curve multiplication precompile"},ecPairing:{v:45e3,d:"Base gas costs for curve pairing precompile"},ecPairingWord:{v:34e3,d:"Gas costs regarding curve pairing precompile input length"},txDataNonZero:{v:16,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},sstoreSentryGasEIP2200:{v:2300,d:"Minimum gas required to be present for an SSTORE call, not consumed"},sstoreNoopGasEIP2200:{v:800,d:"Once per SSTORE operation if the value doesn't change"},sstoreDirtyGasEIP2200:{v:800,d:"Once per SSTORE operation if a dirty value is changed"},sstoreInitGasEIP2200:{v:2e4,d:"Once per SSTORE operation from clean zero to non-zero"},sstoreInitRefundEIP2200:{v:19200,d:"Once per SSTORE operation for resetting to the original zero value"},sstoreCleanGasEIP2200:{v:5e3,d:"Once per SSTORE operation from clean non-zero to something else"},sstoreCleanRefundEIP2200:{v:4200,d:"Once per SSTORE operation for resetting to the original non-zero value"},sstoreClearRefundEIP2200:{v:15e3,d:"Once per SSTORE operation for clearing an originally existing storage slot"},balance:{v:700,d:"Base fee of the BALANCE opcode"},extcodehash:{v:700,d:"Base fee of the EXTCODEHASH opcode"},chainid:{v:2,d:"Base fee of the CHAINID opcode"},selfbalance:{v:5,d:"Base fee of the SELFBALANCE opcode"},sload:{v:800,d:"Base fee of the SLOAD opcode"}},vm:{},pow:{}},d9t={name:"muirGlacier",comment:"HF to delay the difficulty bomb",url:"https://eips.ethereum.org/EIPS/eip-2384",status:"Final",gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:9e6,d:"the amount of blocks to delay the difficulty bomb with"}}},f9t={name:"berlin",comment:"HF targeted for July 2020 following the Muir Glacier HF",url:"https://eips.ethereum.org/EIPS/eip-2070",status:"Final",eips:[2565,2929,2718,2930]},h9t={name:"london",comment:"HF targeted for July 2021 following the Berlin fork",url:"https://github.com/ethereum/eth1.0-specs/blob/master/network-upgrades/mainnet-upgrades/london.md",status:"Final",eips:[1559,3198,3529,3541]},p9t={name:"shanghai",comment:"Next feature hardfork after the merge hardfork having withdrawals, warm coinbase, push0, limit/meter initcode",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md",status:"Final",eips:[3651,3855,3860,4895]},m9t={name:"arrowGlacier",comment:"HF to delay the difficulty bomb",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/arrow-glacier.md",status:"Final",eips:[4345],gasConfig:{},gasPrices:{},vm:{},pow:{}},x9t={name:"grayGlacier",comment:"Delaying the difficulty bomb to Mid September 2022",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/gray-glacier.md",status:"Draft",eips:[5133],gasConfig:{},gasPrices:{},vm:{},pow:{}},g9t={name:"mergeForkIdTransition",comment:"Pre-merge hardfork to fork off non-upgraded clients",url:"https://eips.ethereum.org/EIPS/eip-3675",status:"Draft",eips:[]},b9t={name:"merge",comment:"Hardfork to upgrade the consensus mechanism to Proof-of-Stake",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/merge.md",status:"Final",consensus:{type:"pos",algorithm:"casper",casper:{}},eips:[3675,4399]},y9t={chainstart:n9t,homestead:s9t,dao:r9t,tangerineWhistle:i9t,spuriousDragon:a9t,byzantium:o9t,constantinople:l9t,petersburg:c9t,istanbul:u9t,muirGlacier:d9t,berlin:f9t,london:h9t,shanghai:p9t,arrowGlacier:m9t,grayGlacier:x9t,mergeForkIdTransition:g9t,merge:b9t},{buf:v9t}=Tjt;class ql extends eoe{static custom(t,n={}){var r;const s=(r=n.baseChain)!==null&&r!==void 0?r:"mainnet",a=Object.assign({},ql._getChainParams(s));if(a.name="custom-chain",typeof t!="string")return new ql(Object.assign({chain:Object.assign(Object.assign({},a),t)},n));if(t===fu.PolygonMainnet)return ql.custom({name:fu.PolygonMainnet,chainId:137,networkId:137},n);if(t===fu.PolygonMumbai)return ql.custom({name:fu.PolygonMumbai,chainId:80001,networkId:80001},n);if(t===fu.ArbitrumRinkebyTestnet)return ql.custom({name:fu.ArbitrumRinkebyTestnet,chainId:421611,networkId:421611},n);if(t===fu.ArbitrumOne)return ql.custom({name:fu.ArbitrumOne,chainId:42161,networkId:42161},n);if(t===fu.xDaiChain)return ql.custom({name:fu.xDaiChain,chainId:100,networkId:100},n);if(t===fu.OptimisticKovan)return ql.custom({name:fu.OptimisticKovan,chainId:69,networkId:69},Object.assign({hardfork:to.Berlin},n));if(t===fu.OptimisticEthereum)return ql.custom({name:fu.OptimisticEthereum,chainId:10,networkId:10},Object.assign({hardfork:to.Berlin},n));throw new Error(`Custom chain ${t} not supported`)}static fromGethGenesis(t,{chain:n,eips:r,genesisHash:s,hardfork:a,mergeForkIdPostMerge:o}){var l;const c=vjt(t,n,o),u=new ql({chain:(l=c.name)!==null&&l!==void 0?l:"custom",customChains:[c],eips:r,hardfork:a??c.hardfork});return s!==void 0&&u.setForkHashes(s),u}static isSupportedChainId(t){return!!this._getInitializedChains().names[t.toString()]}static _getChainParams(t,n){let r=t;const s=this._getInitializedChains(n);if(typeof r=="number"||typeof r=="bigint"){if(r=r.toString(),s.names[r]){const a=s.names[r];return s[a]}throw new Error(`Chain with ID ${r} not supported`)}if(s[r]!==void 0)return s[r];throw new Error(`Chain with name ${r} not supported`)}constructor(t){var n,r;super(),this._eips=[],this._customChains=(n=t.customChains)!==null&&n!==void 0?n:[],this._chainParams=this.setChain(t.chain),this.DEFAULT_HARDFORK=(r=this._chainParams.defaultHardfork)!==null&&r!==void 0?r:to.Merge,this.HARDFORK_CHANGES=this.hardforks().map(s=>[s.name,y9t[s.name]]),this._hardfork=this.DEFAULT_HARDFORK,t.hardfork!==void 0&&this.setHardfork(t.hardfork),t.eips&&this.setEIPs(t.eips)}setChain(t){if(typeof t=="number"||typeof t=="bigint"||typeof t=="string")this._chainParams=ql._getChainParams(t,this._customChains);else if(typeof t=="object"){if(this._customChains.length>0)throw new Error("Chain must be a string, number, or bigint when initialized with customChains passed in");const n=["networkId","genesis","hardforks","bootstrapNodes"];for(const r of n)if(!(r in t))throw new Error(`Missing required chain parameter: ${r}`);this._chainParams=t}else throw new Error("Wrong input format");for(const n of this.hardforks())if(n.block===void 0)throw new Error("Hardfork cannot have undefined block number");return this._chainParams}setHardfork(t){let n=!1;for(const r of this.HARDFORK_CHANGES)r[0]===t&&(this._hardfork!==t&&(this._hardfork=t,this.emit("hardforkChanged",t)),n=!0);if(!n)throw new Error(`Hardfork with name ${t} not supported`)}getHardforkByBlockNumber(t,n,r){const s=z6(t,$h.BigInt),a=z6(n,$h.BigInt),o=z6(r,$h.Number),l=this.hardforks().filter(g=>g.block!==null||g.ttd!==null&&g.ttd!==void 0||g.timestamp!==void 0),c=l.findIndex(g=>g.ttd!==null&&g.ttd!==void 0);if(l.slice(c+1).findIndex(g=>g.ttd!==null&&g.ttd!==void 0)>=0)throw Error("More than one merge hardforks found with ttd specified");let d=l.findIndex(g=>g.block!==null&&g.block>s||o!==void 0&&Number(g.timestamp)>o);if(d===-1)d=l.length;else if(d===0)throw Error("Must have at least one hardfork at block 0");if(o===void 0){const g=l.slice(0,d).reverse().findIndex(v=>v.block!==null||v.ttd!==void 0);d-=g}if(d-=1,l[d].block===null&&l[d].timestamp===void 0)(a==null||BigInt(l[d].ttd)>a)&&(d-=1);else if(c>=0&&a!==void 0&&a!==null){if(d>=c&&BigInt(l[c].ttd)>a)throw Error("Maximum HF determined by total difficulty is lower than the block number HF");if(d<c&&BigInt(l[c].ttd)<=a)throw Error("HF determined by block number is lower than the minimum total difficulty HF")}const f=d;for(;d<l.length-1&&!(l[d].block!==l[d+1].block||l[d].timestamp!==l[d+1].timestamp);d+=1);if(o){if(l.slice(0,f).reduce((w,C)=>{var N;return Math.max(Number((N=C.timestamp)!==null&&N!==void 0?N:"0"),w)},0)>o)throw Error("Maximum HF determined by timestamp is lower than the block number/ttd HF");if(l.slice(d+1).reduce((w,C)=>{var N;return Math.min(Number((N=C.timestamp)!==null&&N!==void 0?N:o),w)},o)<o)throw Error("Maximum HF determined by block number/ttd is lower than timestamp HF")}return l[d].name}setHardforkByBlockNumber(t,n,r){const s=this.getHardforkByBlockNumber(t,n,r);return this.setHardfork(s),s}_getHardfork(t){const n=this.hardforks();for(const r of n)if(r.name===t)return r;return null}setEIPs(t=[]){for(const n of t){if(!(n in H6))throw new Error(`${n} not supported`);const r=this.gteHardfork(H6[n].minimumHardfork);if(!r)throw new Error(`${n} cannot be activated on hardfork ${this.hardfork()}, minimumHardfork: ${r}`);if(H6[n].requiredEIPs!==void 0){for(const s of H6[n].requiredEIPs)if(!(t.includes(s)||this.isActivatedEIP(s)))throw new Error(`${n} requires EIP ${s}, but is not included in the EIP list`)}}this._eips=t}param(t,n){let r;for(const s of this._eips)if(r=this.paramByEIP(t,n,s),r!==void 0)return r;return this.paramByHardfork(t,n,this._hardfork)}paramByHardfork(t,n,r){let s=null;for(const a of this.HARDFORK_CHANGES){if("eips"in a[1]){const o=a[1].eips;for(const l of o){const c=this.paramByEIP(t,n,l);s=typeof c=="bigint"?c:s}}else{if(a[1][t]===void 0)throw new Error(`Topic ${t} not defined`);a[1][t][n]!==void 0&&(s=a[1][t][n].v)}if(a[0]===r)break}return BigInt(s??0)}paramByEIP(t,n,r){if(!(r in H6))throw new Error(`${r} not supported`);const s=H6[r];if(!(t in s))throw new Error(`Topic ${t} not defined`);if(s[t][n]===void 0)return;const a=s[t][n].v;return BigInt(a)}paramByBlock(t,n,r,s,a){const o=this.getHardforkByBlockNumber(r,s,a);return this.paramByHardfork(t,n,o)}isActivatedEIP(t){if(this.eips().includes(t))return!0;for(const n of this.HARDFORK_CHANGES){const r=n[1];if(this.gteHardfork(r.name)&&"eips"in r&&r.eips.includes(t))return!0}return!1}hardforkIsActiveOnBlock(t,n){const r=z6(n,$h.BigInt),s=t??this._hardfork,a=this.hardforkBlock(s);return typeof a=="bigint"&&a!==BigInt(0)&&r>=a}activeOnBlock(t){return this.hardforkIsActiveOnBlock(null,t)}hardforkGteHardfork(t,n){const r=t??this._hardfork,s=this.hardforks();let a=-1,o=-1,l=0;for(const c of s)c.name===r&&(a=l),c.name===n&&(o=l),l+=1;return a>=o&&o!==-1}gteHardfork(t){return this.hardforkGteHardfork(null,t)}hardforkBlock(t){var n;const r=t??this._hardfork,s=(n=this._getHardfork(r))===null||n===void 0?void 0:n.block;return s==null?null:BigInt(s)}hardforkTimestamp(t){var n;const r=t??this._hardfork,s=(n=this._getHardfork(r))===null||n===void 0?void 0:n.timestamp;return s==null?null:BigInt(s)}eipBlock(t){for(const n of this.HARDFORK_CHANGES){const r=n[1];if("eips"in r&&r.eips.includes(t))return this.hardforkBlock(typeof n[0]=="number"?String(n[0]):n[0])}return null}hardforkTTD(t){var n;const r=t??this._hardfork,s=(n=this._getHardfork(r))===null||n===void 0?void 0:n.ttd;return s==null?null:BigInt(s)}isHardforkBlock(t,n){const r=z6(t,$h.BigInt),s=n??this._hardfork,a=this.hardforkBlock(s);return typeof a=="bigint"&&a!==BigInt(0)?a===r:!1}nextHardforkBlockOrTimestamp(t){var n,r,s;const a=(n=t)!==null&&n!==void 0?n:this._hardfork,o=this.hardforks();let l=o.findIndex(f=>f.name===a);if(a===to.Merge&&(l-=1),l<0)return null;let c=(r=o[l].timestamp)!==null&&r!==void 0?r:o[l].block;c=c!=null?Number(c):null;const u=o.slice(l+1).find(f=>{var x;let g=(x=f.timestamp)!==null&&x!==void 0?x:f.block;return g=g!=null?Number(g):null,f.name!==to.Merge&&g!==null&&g!==void 0&&g!==c});if(u===void 0)return null;const d=(s=u.timestamp)!==null&&s!==void 0?s:u.block;return d==null?null:BigInt(d)}nextHardforkBlock(t){var n;const r=(n=t)!==null&&n!==void 0?n:this._hardfork;let s=this.hardforkBlock(r);if(s===null&&r===to.Merge){const o=this.hardforks(),l=o.findIndex(c=>c.ttd!==null&&c.ttd!==void 0);if(l<0)throw Error("Merge hardfork should have been found");s=this.hardforkBlock(o[l-1].name)}return s===null?null:this.hardforks().reduce((o,l)=>{const c=BigInt(l.block===null||l.ttd!==void 0&&l.ttd!==null?0:l.block);return c>s&&o===null?c:o},null)}isNextHardforkBlock(t,n){const r=z6(t,$h.BigInt),s=n??this._hardfork,a=this.nextHardforkBlock(s);return a===null?!1:a===r}_calcForkHash(t,n){let r=new Uint8Array,s=0;for(const l of this.hardforks()){const{block:c,timestamp:u,name:d}=l;let f=u??c;if(f=f!==null?Number(f):null,typeof f=="number"&&f!==0&&f!==s&&d!==to.Merge){const x=so(f.toString(16).padStart(16,"0"));r=dd(r,x),s=f}if(l.name===t)break}const a=dd(n,r);return Ui(wjt(v9t(a)>>>0))}forkHash(t,n){const r=t??this._hardfork,s=this._getHardfork(r);if(s===null||(s==null?void 0:s.block)===null&&(s==null?void 0:s.timestamp)===void 0&&(s==null?void 0:s.ttd)===void 0){const a="No fork hash calculation possible for future hardfork";throw new Error(a)}if((s==null?void 0:s.forkHash)!==null&&(s==null?void 0:s.forkHash)!==void 0)return s.forkHash;if(!n)throw new Error("genesisHash required for forkHash calculation");return this._calcForkHash(r,n)}hardforkForForkHash(t){const n=this.hardforks().filter(r=>r.forkHash===t);return n.length>=1?n[n.length-1]:null}setForkHashes(t){var n;for(const r of this.hardforks()){const s=(n=r.timestamp)!==null&&n!==void 0?n:r.block;(r.forkHash===null||r.forkHash===void 0)&&(s!=null||typeof r.ttd<"u")&&(r.forkHash=this.forkHash(r.name,t))}}genesis(){return this._chainParams.genesis}hardforks(){return this._chainParams.hardforks}bootstrapNodes(){return this._chainParams.bootstrapNodes}dnsNetworks(){return this._chainParams.dnsNetworks}hardfork(){return this._hardfork}chainId(){return BigInt(this._chainParams.chainId)}chainName(){return this._chainParams.name}networkId(){return BigInt(this._chainParams.networkId)}eips(){return this._eips}consensusType(){const t=this.hardfork();let n;for(const r of this.HARDFORK_CHANGES)if("consensus"in r[1]&&(n=r[1].consensus.type),r[0]===t)break;return n??this._chainParams.consensus.type}consensusAlgorithm(){const t=this.hardfork();let n;for(const r of this.HARDFORK_CHANGES)if("consensus"in r[1]&&(n=r[1].consensus.algorithm),r[0]===t)break;return n??this._chainParams.consensus.algorithm}consensusConfig(){var t;const n=this.hardfork();let r;for(const s of this.HARDFORK_CHANGES)if("consensus"in s[1]&&(r=s[1].consensus[s[1].consensus.algorithm]),s[0]===n)break;return(t=r??this._chainParams.consensus[this.consensusAlgorithm()])!==null&&t!==void 0?t:{}}copy(){const t=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return t.removeAllListeners(),t}static _getInitializedChains(t){const n={};for(const[s,a]of Object.entries(hR))n[a]=s.toLowerCase();const r={mainnet:Pjt,goerli:Ijt,sepolia:Fjt};if(t)for(const s of t){const{name:a}=s;n[s.chainId.toString()]=a,r[a]=s}return r.names=n,r}}var y0;(function(e){e[e.EIP155ReplayProtection=155]="EIP155ReplayProtection",e[e.EIP1559FeeMarket=1559]="EIP1559FeeMarket",e[e.EIP2718TypedTransaction=2718]="EIP2718TypedTransaction",e[e.EIP2930AccessLists=2930]="EIP2930AccessLists"})(y0||(y0={}));function w9t(e){if(e.length===0)return!0;const t=e[0];return!!Array.isArray(t)}function C9t(e){return!w9t(e)}class o4{constructor(t){if(t.length!==20)throw new Error("Invalid address length");this.buf=t}static zero(){return new o4(FFe(20))}equals(t){return t$(this.buf,t.buf)}isZero(){return this.equals(o4.zero())}toString(){return Ui(this.buf)}toArray(){return this.buf}static publicToAddress(t,n=!1){let r=t;if(goe(r),n&&r.length!==64&&(r=v1.ProjectivePoint.fromHex(r).toRawBytes(!1).slice(1)),r.length!==64)throw new Error("Expected pubKey to be of length 64");return td(r).slice(-20)}}const S9t=(e,t)=>{const n=e.param("vm","maxInitCodeSize");if(n&&BigInt(t)>n)throw new Error(`the initcode size of this transaction is too large: it is ${t} while the max is ${e.param("vm","maxInitCodeSize")}`)},OFe=e=>{let t,n;if(C9t(e)){t=e;const r=[];for(let s=0;s<e.length;s+=1){const a=e[s],o=No(a.address),l=[];for(let c=0;c<a.storageKeys.length;c+=1)l.push(No(a.storageKeys[c]));r.push([o,l])}n=r}else{n=e??[];const r=[];for(let s=0;s<n.length;s+=1){const a=n[s],o=Ui(a[0]),l=[];for(let u=0;u<a[1].length;u+=1)l.push(Ui(a[1][u]));const c={address:o,storageKeys:l};r.push(c)}t=r}return{AccessListJSON:t,accessList:n}},MFe=e=>{for(let t=0;t<e.length;t+=1){const n=e[t],r=n[0],s=n[1];if(n[2]!==void 0)throw new Error("Access list item cannot have 3 elements. It can only have an address, and an array of storage slots.");if(r.length!==20)throw new Error("Invalid EIP-2930 transaction: address length should be 20 bytes");for(let a=0;a<s.length;a+=1)if(s[a].length!==32)throw new Error("Invalid EIP-2930 transaction: storage slot length should be 32 bytes")}},RFe=e=>{const t=[];for(let n=0;n<e.length;n+=1){const r=e[n],s={address:Ui(wge(r[0],20)),storageKeys:[]},a=r&&r[1];for(let o=0;o<a.length;o+=1){const l=a[o];s.storageKeys.push(Ui(wge(l,32)))}t.push(s)}return t},LFe=(e,t)=>{const n=t.param("gasPrices","accessListStorageKeyCost"),r=t.param("gasPrices","accessListAddressCost");let s=0;for(let o=0;o<e.length;o+=1){const c=e[o][1];s+=c.length}return e.length*Number(r)+s*Number(n)};class lN{constructor(t,n){var r,s;this.cache={hash:void 0,dataFee:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=hR.Mainnet,this.DEFAULT_HARDFORK=to.Merge;const{nonce:a,gasLimit:o,to:l,value:c,data:u,v:d,r:f,s:x,type:g}=t;this._type=Number(Wa(No(g))),this.txOptions=n;const v=No(l===""?"0x":l),w=No(d===""?"0x":d),C=No(f===""?"0x":f),N=No(x===""?"0x":x);this.nonce=Wa(No(a===""?"0x":a)),this.gasLimit=Wa(No(o===""?"0x":o)),this.to=v.length>0?new o4(v):void 0,this.value=Wa(No(c===""?"0x":c)),this.data=No(u===""?"0x":u),this.v=w.length>0?Wa(w):void 0,this.r=C.length>0?Wa(C):void 0,this.s=N.length>0?Wa(N):void 0,this._validateCannotExceedMaxInteger({value:this.value,r:this.r,s:this.s}),this._validateCannotExceedMaxInteger({gasLimit:this.gasLimit},64),this._validateCannotExceedMaxInteger({nonce:this.nonce},64,!0);const I=this.to===void 0||this.to===null,P=(r=n.allowUnlimitedInitCodeSize)!==null&&r!==void 0?r:!1,R=(s=n.common)!==null&&s!==void 0?s:this._getCommon();I&&R.isActivatedEIP(3860)&&!P&&S9t(R,this.data.length)}get type(){return this._type}supports(t){return this.activeCapabilities.includes(t)}validate(t=!1){const n=[];return this.getBaseFee()>this.gasLimit&&n.push(`gasLimit is too low. given ${this.gasLimit}, need at least ${this.getBaseFee()}`),this.isSigned()&&!this.verifySignature()&&n.push("Invalid Signature"),t?n:n.length===0}_validateYParity(){const{v:t}=this;if(t!==void 0&&t!==BigInt(0)&&t!==BigInt(1)){const n=this._errorMsg("The y-parity of the transaction should either be 0 or 1");throw new Error(n)}}_validateHighS(){const{s:t}=this;if(this.common.gteHardfork("homestead")&&t!==void 0&&t>xjt){const n=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(n)}}getBaseFee(){const t=this.common.param("gasPrices","tx");let n=this.getDataFee();if(t&&(n+=t),this.common.gteHardfork("homestead")&&this.toCreationAddress()){const r=this.common.param("gasPrices","txCreation");r&&(n+=r)}return n}getDataFee(){const t=this.common.param("gasPrices","txDataZero"),n=this.common.param("gasPrices","txDataNonZero");let r=BigInt(0);for(let s=0;s<this.data.length;s+=1)this.data[s]===0?r+=t:r+=n;if((this.to===void 0||this.to===null)&&this.common.isActivatedEIP(3860)){const s=BigInt(Math.ceil(this.data.length/32)),a=this.common.param("gasPrices","initCodeWordCost")*s;r+=a}return r}toCreationAddress(){return this.to===void 0||this.to.buf.length===0}isSigned(){const{v:t,r:n,s:r}=this;return!(t===void 0||n===void 0||r===void 0)}verifySignature(){try{const t=this.getSenderPublicKey();return pR(t).length!==0}catch{return!1}}getSenderAddress(){return new o4(o4.publicToAddress(this.getSenderPublicKey()))}sign(t){if(t.length!==32){const c=this._errorMsg("Private key must be 32 bytes in length.");throw new Error(c)}let n=!1;this.type===0&&this.common.gteHardfork("spuriousDragon")&&!this.supports(y0.EIP155ReplayProtection)&&(this.activeCapabilities.push(y0.EIP155ReplayProtection),n=!0);const r=this.getMessageToSign(!0),{v:s,r:a,s:o}=this._ecsign(r,t),l=this._processSignature(s,a,o);if(n){const c=this.activeCapabilities.indexOf(y0.EIP155ReplayProtection);c>-1&&this.activeCapabilities.splice(c,1)}return l}_getCommon(t,n){var r,s,a,o;if(n!==void 0){const l=Wa(No(n));if(t){if(t.chainId()!==l){const c=this._errorMsg("The chain ID does not match the chain ID of Common");throw new Error(c)}return t.copy()}return ql.isSupportedChainId(l)?new ql({chain:l,hardfork:this.DEFAULT_HARDFORK}):ql.custom({name:"custom-chain",networkId:l,chainId:l},{baseChain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})}if(t!=null&&t.copy&&typeof(t==null?void 0:t.copy)=="function")return t.copy();if(t){const l=typeof t.hardfork=="function"?t.hardfork():t.hardfork;return ql.custom({name:"custom-chain",networkId:t.networkId?t.networkId():(s=BigInt((r=t.customChain)===null||r===void 0?void 0:r.networkId))!==null&&s!==void 0?s:void 0,chainId:t.chainId?t.chainId():(o=BigInt((a=t.customChain)===null||a===void 0?void 0:a.chainId))!==null&&o!==void 0?o:void 0},{baseChain:this.DEFAULT_CHAIN,hardfork:l||this.DEFAULT_HARDFORK})}return new ql({chain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})}_validateCannotExceedMaxInteger(t,n=256,r=!1){for(const[s,a]of Object.entries(t))switch(n){case 64:if(r){if(a!==void 0&&a>=bge){const o=this._errorMsg(`${s} cannot equal or exceed MAX_UINT64 (2^64-1), given ${a}`);throw new Error(o)}}else if(a!==void 0&&a>bge){const o=this._errorMsg(`${s} cannot exceed MAX_UINT64 (2^64-1), given ${a}`);throw new Error(o)}break;case 256:if(r){if(a!==void 0&&a>=$E){const o=this._errorMsg(`${s} cannot equal or exceed MAX_INTEGER (2^256-1), given ${a}`);throw new Error(o)}}else if(a!==void 0&&a>$E){const o=this._errorMsg(`${s} cannot exceed MAX_INTEGER (2^256-1), given ${a}`);throw new Error(o)}break;default:{const o=this._errorMsg("unimplemented bits value");throw new Error(o)}}}static _validateNotArray(t){const n=["nonce","gasPrice","gasLimit","to","value","data","v","r","s","type","baseFee","maxFeePerGas","chainId"];for(const[r,s]of Object.entries(t))if(n.includes(r)&&Array.isArray(s))throw new Error(`${r} cannot be an array`)}_getSharedErrorPostfix(){let t="";try{t=this.isSigned()?Ui(this.hash()):"not available (unsigned)"}catch{t="error"}let n="";try{n=this.isSigned().toString()}catch{t="error"}let r="";try{r=this.common.hardfork()}catch{r="error"}let s=`tx type=${this.type} hash=${t} nonce=${this.nonce} value=${this.value} `;return s+=`signed=${n} hf=${r}`,s}_ecsign(t,n,r){const s=v1.sign(t,n),a=s.toCompactRawBytes(),o=a.subarray(0,32),l=a.subarray(32,64),c=r===void 0?BigInt(s.recovery+27):BigInt(s.recovery+35)+BigInt(r)*BigInt(2);return{r:o,s:l,v:c}}static fromSerializedTx(t,n={}){}static fromTxData(t,n={}){}}const Nee=2,xV=so(Nee.toString(16).padStart(2,"0"));class Yv extends lN{static fromTxData(t,n={}){return new Yv(t,n)}static fromSerializedTx(t,n={}){if(!t$(t.subarray(0,1),xV))throw new Error(`Invalid serialized tx input: not an EIP-1559 transaction (wrong tx type, expected: ${Nee}, received: ${Ui(t.subarray(0,1))}`);const r=Uh.RLP.decode(t.subarray(1));if(!Array.isArray(r))throw new Error("Invalid serialized tx input: must be array");return Yv.fromValuesArray(r,n)}static fromValuesArray(t,n={}){if(t.length!==9&&t.length!==12)throw new Error("Invalid EIP-1559 transaction. Only expecting 9 values (for unsigned tx) or 12 values (for signed tx).");const[r,s,a,o,l,c,u,d,f,x,g,v]=t;return this._validateNotArray({chainId:r,v:x}),Xae({nonce:s,maxPriorityFeePerGas:a,maxFeePerGas:o,gasLimit:l,value:u,v:x,r:g,s:v}),new Yv({chainId:Wa(r),nonce:s,maxPriorityFeePerGas:a,maxFeePerGas:o,gasLimit:l,to:c,value:u,data:d,accessList:f??[],v:x!==void 0?Wa(x):void 0,r:g,s:v},n)}constructor(t,n={}){var r;super(Object.assign(Object.assign({},t),{type:Nee}),n),this.DEFAULT_HARDFORK="london";const{chainId:s,accessList:a,maxFeePerGas:o,maxPriorityFeePerGas:l}=t;if(this.common=this._getCommon(n.common,s),this.chainId=this.common.chainId(),!this.common.isActivatedEIP(1559))throw new Error("EIP-1559 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([1559,2718,2930]);const c=OFe(a??[]);if(this.accessList=c.accessList,this.AccessListJSON=c.AccessListJSON,MFe(this.accessList),this.maxFeePerGas=Wa(No(o===""?"0x":o)),this.maxPriorityFeePerGas=Wa(No(l===""?"0x":l)),this._validateCannotExceedMaxInteger({maxFeePerGas:this.maxFeePerGas,maxPriorityFeePerGas:this.maxPriorityFeePerGas}),lN._validateNotArray(t),this.gasLimit*this.maxFeePerGas>$E){const d=this._errorMsg("gasLimit * maxFeePerGas cannot exceed MAX_INTEGER (2^256-1)");throw new Error(d)}if(this.maxFeePerGas<this.maxPriorityFeePerGas){const d=this._errorMsg("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)");throw new Error(d)}this._validateYParity(),this._validateHighS(),((r=n==null?void 0:n.freeze)!==null&&r!==void 0?r:!0)&&Object.freeze(this)}getDataFee(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;let t=super.getDataFee();return t+=BigInt(LFe(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:t,hardfork:this.common.hardfork()}),t}getUpfrontCost(t=BigInt(0)){const n=this.maxPriorityFeePerGas,r=this.maxFeePerGas-t,a=(n<r?n:r)+t;return this.gasLimit*a+this.value}raw(){return[sa(this.chainId),sa(this.nonce),sa(this.maxPriorityFeePerGas),sa(this.maxFeePerGas),sa(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),sa(this.value),this.data,this.accessList,this.v!==void 0?sa(this.v):Uint8Array.from([]),this.r!==void 0?sa(this.r):Uint8Array.from([]),this.s!==void 0?sa(this.s):Uint8Array.from([])]}serialize(){const t=this.raw();return dd(xV,Uh.RLP.encode(t))}getMessageToSign(t=!0){const n=this.raw().slice(0,9),r=dd(xV,Uh.RLP.encode(n));return t?td(r):r}hash(){if(!this.isSigned()){const t=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(t)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=td(this.serialize())),this.cache.hash):td(this.serialize())}getMessageToVerifySignature(){return this.getMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const a=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(a)}const t=this.getMessageToVerifySignature(),{v:n,r,s}=this;this._validateHighS();try{return boe(t,n+BigInt(27),sa(r),sa(s))}catch{const o=this._errorMsg("Invalid Signature");throw new Error(o)}}_processSignature(t,n,r){const s=Object.assign(Object.assign({},this.txOptions),{common:this.common});return Yv.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:t-BigInt(27),r:Wa(n),s:Wa(r)},s)}toJSON(){const t=RFe(this.accessList);return{chainId:Ao(this.chainId),nonce:Ao(this.nonce),maxPriorityFeePerGas:Ao(this.maxPriorityFeePerGas),maxFeePerGas:Ao(this.maxFeePerGas),gasLimit:Ao(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:Ao(this.value),data:Ui(this.data),accessList:t,v:this.v!==void 0?Ao(this.v):void 0,r:this.r!==void 0?Ao(this.r):void 0,s:this.s!==void 0?Ao(this.s):void 0}}errorStr(){let t=this._getSharedErrorPostfix();return t+=` maxFeePerGas=${this.maxFeePerGas} maxPriorityFeePerGas=${this.maxPriorityFeePerGas}`,t}_errorMsg(t){return`${t} (${this.errorStr()})`}}const Aee=1,gV=so(Aee.toString(16).padStart(2,"0"));class Xv extends lN{static fromTxData(t,n={}){return new Xv(t,n)}static fromSerializedTx(t,n={}){if(!t$(t.subarray(0,1),gV))throw new Error(`Invalid serialized tx input: not an EIP-2930 transaction (wrong tx type, expected: ${Aee}, received: ${Ui(t.subarray(0,1))}`);const r=Uh.RLP.decode(Uint8Array.from(t.subarray(1)));if(!Array.isArray(r))throw new Error("Invalid serialized tx input: must be array");return Xv.fromValuesArray(r,n)}static fromValuesArray(t,n={}){if(t.length!==8&&t.length!==11)throw new Error("Invalid EIP-2930 transaction. Only expecting 8 values (for unsigned tx) or 11 values (for signed tx).");const[r,s,a,o,l,c,u,d,f,x,g]=t;this._validateNotArray({chainId:r,v:f}),Xae({nonce:s,gasPrice:a,gasLimit:o,value:c,v:f,r:x,s:g});const v=[];return new Xv({chainId:Wa(r),nonce:s,gasPrice:a,gasLimit:o,to:l,value:c,data:u,accessList:d??v,v:f!==void 0?Wa(f):void 0,r:x,s:g},n)}constructor(t,n={}){var r;super(Object.assign(Object.assign({},t),{type:Aee}),n),this.DEFAULT_HARDFORK="berlin";const{chainId:s,accessList:a,gasPrice:o}=t;if(this.common=this._getCommon(n.common,s),this.chainId=this.common.chainId(),!this.common.isActivatedEIP(2930))throw new Error("EIP-2930 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([2718,2930]);const l=OFe(a??[]);if(this.accessList=l.accessList,this.AccessListJSON=l.AccessListJSON,MFe(this.accessList),this.gasPrice=Wa(No(o===""?"0x":o)),this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),lN._validateNotArray(t),this.gasPrice*this.gasLimit>$E){const u=this._errorMsg("gasLimit * gasPrice cannot exceed MAX_INTEGER");throw new Error(u)}this._validateYParity(),this._validateHighS(),((r=n==null?void 0:n.freeze)!==null&&r!==void 0?r:!0)&&Object.freeze(this)}getDataFee(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;let t=super.getDataFee();return t+=BigInt(LFe(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:t,hardfork:this.common.hardfork()}),t}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}raw(){return[sa(this.chainId),sa(this.nonce),sa(this.gasPrice),sa(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),sa(this.value),this.data,this.accessList,this.v!==void 0?sa(this.v):Uint8Array.from([]),this.r!==void 0?sa(this.r):Uint8Array.from([]),this.s!==void 0?sa(this.s):Uint8Array.from([])]}serialize(){const t=this.raw();return dd(gV,Uh.RLP.encode(t))}getMessageToSign(t=!0){const n=this.raw().slice(0,8),r=dd(gV,Uh.RLP.encode(n));return t?td(r):r}hash(){if(!this.isSigned()){const t=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(t)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=td(this.serialize())),this.cache.hash):td(this.serialize())}getMessageToVerifySignature(){return this.getMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const a=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(a)}const t=this.getMessageToVerifySignature(),{v:n,r,s}=this;this._validateHighS();try{return boe(t,n+BigInt(27),sa(r),sa(s))}catch{const o=this._errorMsg("Invalid Signature");throw new Error(o)}}_processSignature(t,n,r){const s=Object.assign(Object.assign({},this.txOptions),{common:this.common});return Xv.fromTxData({chainId:this.chainId,nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:t-BigInt(27),r:Wa(n),s:Wa(r)},s)}toJSON(){const t=RFe(this.accessList);return{chainId:Ao(this.chainId),nonce:Ao(this.nonce),gasPrice:Ao(this.gasPrice),gasLimit:Ao(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:Ao(this.value),data:Ui(this.data),accessList:t,v:this.v!==void 0?Ao(this.v):void 0,r:this.r!==void 0?Ao(this.r):void 0,s:this.s!==void 0?Ao(this.s):void 0}}errorStr(){var t,n;let r=this._getSharedErrorPostfix();return r+=` gasPrice=${this.gasPrice} accessListCount=${(n=(t=this.accessList)===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0}`,r}_errorMsg(t){return`${t} (${this.errorStr()})`}}const N9t=0;function Nge(e,t){const n=Number(e),r=Number(t)*2;return n===r+35||n===r+36}class dy extends lN{static fromTxData(t,n={}){return new dy(t,n)}static fromSerializedTx(t,n={}){const r=Uh.RLP.decode(t);if(!Array.isArray(r))throw new Error("Invalid serialized tx input. Must be array");return this.fromValuesArray(r,n)}static fromValuesArray(t,n={}){if(t.length!==6&&t.length!==9)throw new Error("Invalid transaction. Only expecting 6 values (for unsigned tx) or 9 values (for signed tx).");const[r,s,a,o,l,c,u,d,f]=t;return Xae({nonce:r,gasPrice:s,gasLimit:a,value:l,v:u,r:d,s:f}),new dy({nonce:r,gasPrice:s,gasLimit:a,to:o,value:l,data:c,v:u,r:d,s:f},n)}constructor(t,n={}){var r;if(super(Object.assign(Object.assign({},t),{type:N9t}),n),this.common=this._validateTxV(this.v,n.common),this.gasPrice=Wa(No(t.gasPrice===""?"0x":t.gasPrice)),this.gasPrice*this.gasLimit>$E){const a=this._errorMsg("gas limit * gasPrice cannot exceed MAX_INTEGER (2^256-1)");throw new Error(a)}this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),lN._validateNotArray(t),this.common.gteHardfork("spuriousDragon")&&(this.isSigned()?Nge(this.v,this.common.chainId())&&this.activeCapabilities.push(y0.EIP155ReplayProtection):this.activeCapabilities.push(y0.EIP155ReplayProtection)),((r=n==null?void 0:n.freeze)!==null&&r!==void 0?r:!0)&&Object.freeze(this)}raw(){return[sa(this.nonce),sa(this.gasPrice),sa(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),sa(this.value),this.data,this.v!==void 0?sa(this.v):Uint8Array.from([]),this.r!==void 0?sa(this.r):Uint8Array.from([]),this.s!==void 0?sa(this.s):Uint8Array.from([])]}serialize(){return Uh.RLP.encode(this.raw())}_getMessageToSign(){const t=[sa(this.nonce),sa(this.gasPrice),sa(this.gasLimit),this.to!==void 0?this.to.buf:Uint8Array.from([]),sa(this.value),this.data];return this.supports(y0.EIP155ReplayProtection)&&(t.push(No(this.common.chainId())),t.push(pR(No(0))),t.push(pR(No(0)))),t}getMessageToSign(t=!0){const n=this._getMessageToSign();return t?td(Uh.RLP.encode(n)):n}getDataFee(){return this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork()?this.cache.dataFee.value:(Object.isFrozen(this)&&(this.cache.dataFee={value:super.getDataFee(),hardfork:this.common.hardfork()}),super.getDataFee())}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}hash(){if(!this.isSigned()){const t=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(t)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=td(Uh.RLP.encode(this.raw()))),this.cache.hash):td(Uh.RLP.encode(this.raw()))}getMessageToVerifySignature(){if(!this.isSigned()){const n=this._errorMsg("This transaction is not signed");throw new Error(n)}const t=this._getMessageToSign();return td(Uh.RLP.encode(t))}getSenderPublicKey(){const t=this.getMessageToVerifySignature(),{v:n,r,s}=this;this._validateHighS();try{return boe(t,n,sa(r),sa(s),this.supports(y0.EIP155ReplayProtection)?this.common.chainId():void 0)}catch{const o=this._errorMsg("Invalid Signature");throw new Error(o)}}_processSignature(t,n,r){let s=t;this.supports(y0.EIP155ReplayProtection)&&(s+=this.common.chainId()*BigInt(2)+BigInt(8));const a=Object.assign(Object.assign({},this.txOptions),{common:this.common});return dy.fromTxData({nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,v:s,r:Wa(n),s:Wa(r)},a)}toJSON(){return{nonce:Ao(this.nonce),gasPrice:Ao(this.gasPrice),gasLimit:Ao(this.gasLimit),to:this.to!==void 0?this.to.toString():void 0,value:Ao(this.value),data:Ui(this.data),v:this.v!==void 0?Ao(this.v):void 0,r:this.r!==void 0?Ao(this.r):void 0,s:this.s!==void 0?Ao(this.s):void 0}}_validateTxV(t,n){let r;const s=t!==void 0?Number(t):void 0;if(s!==void 0&&s<37&&s!==27&&s!==28)throw new Error(`Legacy txs need either v = 27/28 or v >= 37 (EIP-155 replay protection), got v = ${s}`);if(s!==void 0&&s!==0&&(!n||n.gteHardfork("spuriousDragon"))&&s!==27&&s!==28)if(n){if(!Nge(BigInt(s),n.chainId()))throw new Error(`Incompatible EIP155-based V ${s} and chain id ${n.chainId()}. See the Common parameter of the Transaction constructor to set the chain id.`)}else{let a;(s-35)%2===0?a=35:a=36,r=BigInt(s-a)/BigInt(2)}return this._getCommon(n,r)}errorStr(){let t=this._getSharedErrorPostfix();return t+=` gasPrice=${this.gasPrice}`,t}_errorMsg(t){return`${t} (${this.errorStr()})`}}const bV=new Map;class U3{constructor(){}static typeToInt(t){return Number(Wa(No(t)))}static registerTransactionType(t,n){const r=U3.typeToInt(t);bV.set(r,n)}static fromTxData(t,n={}){if(!("type"in t)||t.type===void 0)return dy.fromTxData(t,n);const r=U3.typeToInt(t.type);if(r===0)return dy.fromTxData(t,n);if(r===1)return Xv.fromTxData(t,n);if(r===2)return Yv.fromTxData(t,n);const s=bV.get(r);if(s!=null&&s.fromTxData)return s.fromTxData(t,n);throw new Error(`Tx instantiation with type ${r} not supported`)}static fromSerializedData(t,n={}){if(t[0]<=127)switch(t[0]){case 1:return Xv.fromSerializedTx(t,n);case 2:return Yv.fromSerializedTx(t,n);default:{const r=bV.get(Number(t[0]));if(r!=null&&r.fromSerializedTx)return r.fromSerializedTx(t,n);throw new Error(`TypedTransaction with ID ${t[0]} unknown`)}}else return dy.fromSerializedTx(t,n)}static fromBlockBodyData(t,n={}){if(a2(t))return this.fromSerializedData(t,n);if(Array.isArray(t))return dy.fromValuesArray(t,n);throw new Error("Cannot decode transaction: unknown type input")}}var d$=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const RA=(e,t)=>{let n;if(!t&&typeof e=="string"&&Ca(e)&&e.length!==66)throw new Lxe;try{n=a2(e)?e:Z0(e)}catch{throw new KSt}if(!t&&n.byteLength!==32)throw new Lxe;return n},yoe=(e,t=!1)=>{const n=Ca(e)?e:fm(e),r=so(n),s=so(GPe(`Ethereum Signed Message:
${r.byteLength}`)),a=t?r:dd(s,r);return zf(a)},A9t=(e,t)=>{const n=RA(t),r=v1.sign(e.substring(2),n),s=r.toCompactRawBytes(),a=r.r.toString(16).padStart(64,"0"),o=r.s.toString(16).padStart(64,"0"),l=r.recovery+27;return{messageHash:e,v:Yl(l),r:`0x${a}`,s:`0x${o}`,signature:`${Ui(s)}${l.toString(16)}`}},DFe=(e,t)=>{const n=yoe(e),{messageHash:r,v:s,r:a,s:o,signature:l}=A9t(n,t);return{message:e,messageHash:r,v:s,r:a,s:o,signature:l}},j9t=(e,t)=>d$(void 0,void 0,void 0,function*(){const n=e.sign(so(t));if(ar(n.v)||ar(n.r)||ar(n.s))throw new dee("Signer Error");const r=n.validate(!0);if(r.length>0){let o="Signer Error ";for(const l of r)o+=`${o} ${l}.`;throw new dee(o)}const s=Ui(n.serialize()),a=zf(s);return{messageHash:Ui(n.getMessageToSign(!0)),v:`0x${n.v.toString(16)}`,r:`0x${n.r.toString(16).padStart(64,"0")}`,s:`0x${n.s.toString(16).padStart(64,"0")}`,rawTransaction:s,transactionHash:Ui(a)}}),E9t=e=>{if(ar(e))throw new dNt;const t=U3.fromSerializedData(so(e));return ox(t.getSenderAddress().toString())},jee=(e,t,n,r,s)=>{if(typeof e=="object"){const f=`${e.r}${e.s.slice(2)}${e.v.slice(2)}`;return jee(e.messageHash,f,n)}if(typeof t=="string"&&typeof n=="string"&&!ar(r)){const f=`${n}${r.slice(2)}${t.slice(2)}`;return jee(e,f,s)}if(ar(t))throw new YSt("signature string undefined");const a=130,o=n?e:yoe(e);let l=parseInt(t.substring(a),16);l>26&&(l-=27);const c=v1.Signature.fromCompact(t.slice(2,a)).addRecoveryBit(l).recoverPublicKey(o.replace("0x","")).toRawBytes(!1),u=zf(c.subarray(1));return ox(`0x${u.slice(-40)}`)},f$=e=>{const t=RA(e),n=v1.getPublicKey(t,!1),s=zf(n.slice(1)).slice(-40);return ox(`0x${s}`)},_9t=(e,t)=>{const n=RA(e);return`0x${Ui(v1.getPublicKey(n,t)).slice(4)}`},BFe=(e,t,n)=>d$(void 0,void 0,void 0,function*(){var r,s,a,o,l,c,u;const d=RA(e);let f;if(n!=null&&n.salt?f=typeof n.salt=="string"?so(n.salt):n.salt:f=LE(32),!(Kae(t)||a2(t)))throw new ZSt;const x=typeof t=="string"?so(fm(t)):t;let g;if(n!=null&&n.iv){if(g=typeof n.iv=="string"?so(n.iv):n.iv,g.length!==16)throw new JSt}else g=LE(16);const v=(r=n==null?void 0:n.kdf)!==null&&r!==void 0?r:"scrypt";let w,C;if(v==="pbkdf2"){if(C={dklen:(s=n==null?void 0:n.dklen)!==null&&s!==void 0?s:32,salt:Ui(f).replace("0x",""),c:(a=n==null?void 0:n.c)!==null&&a!==void 0?a:262144,prf:"hmac-sha256"},C.c<1e3)throw new eNt;w=vFe(x,f,C.c,C.dklen,"sha256")}else if(v==="scrypt")C={n:(o=n==null?void 0:n.n)!==null&&o!==void 0?o:8192,r:(l=n==null?void 0:n.r)!==null&&l!==void 0?l:8,p:(c=n==null?void 0:n.p)!==null&&c!==void 0?c:1,dklen:(u=n==null?void 0:n.dklen)!==null&&u!==void 0?u:32,salt:Ui(f).replace("0x","")},w=wFe(x,f,C.n,C.p,C.r,C.dklen);else throw new oPe;const N=yield coe(d,w.slice(0,16),g,"aes-128-ctr"),I=Ui(N).slice(2),P=zf(dd(w.slice(16,32),N)).replace("0x","");return{version:3,id:soe(),address:f$(d).toLowerCase().replace("0x",""),crypto:{ciphertext:I,cipherparams:{iv:Ui(g).replace("0x","")},cipher:"aes-128-ctr",kdf:v,kdfparams:C,mac:P}}}),voe=(e,t)=>{const n=RA(e,t);return{address:f$(n),privateKey:Ui(n),signTransaction:r=>{throw new dee("Do not have network access to sign the transaction")},sign:r=>DFe(typeof r=="string"?r:JSON.stringify(r),n),encrypt:(r,s)=>d$(void 0,void 0,void 0,function*(){return BFe(n,r,s)})}},k9t=()=>{const e=v1.utils.randomPrivateKey();return voe(`${Ui(e)}`)},T9t=(e,t,n)=>d$(void 0,void 0,void 0,function*(){const r=typeof e=="object"?e:JSON.parse(n?e.toLowerCase():e);if(Us.validateJSONSchema(gjt,r),r.version!==3)throw new QSt;const s=typeof t=="string"?so(fm(t)):t;Us.validate(["bytes"],[s]);let a;if(r.crypto.kdf==="scrypt"){const u=r.crypto.kdfparams,d=typeof u.salt=="string"?so(u.salt):u.salt;a=wFe(s,d,u.n,u.p,u.r,u.dklen)}else if(r.crypto.kdf==="pbkdf2"){const u=r.crypto.kdfparams,d=typeof u.salt=="string"?so(u.salt):u.salt;a=vFe(s,d,u.c,u.dklen,"sha256")}else throw new oPe;const o=so(r.crypto.ciphertext);if(zf(dd(a.slice(16,32),o)).replace("0x","")!==r.crypto.mac)throw new XSt;const c=yield N7t(so(r.crypto.ciphertext),a.slice(0,16),so(r.crypto.cipherparams.iv));return voe(c)});var Age=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const I9t=1e3;class P9t{constructor(t){this._requestManager=t,this._requests=new Map}get requests(){return[...this._requests.values()].map(t=>t.payload)}add(t){const n=D3(t),r=new cR;return this._requests.set(n.id,{payload:n,promise:r}),r}execute(t){return Age(this,void 0,void 0,function*(){var n;if(this.requests.length===0)return Promise.resolve([]);const r=new cR({timeout:(n=t==null?void 0:t.timeout)!==null&&n!==void 0?n:I9t,eagerStart:!0,timeoutMessage:"Batch request timeout"});return this._processBatchRequest(r).catch(s=>r.reject(s)),r.catch(s=>{s instanceof lPe&&this._abortAllRequests("Batch request timeout"),r.reject(s)}),r})}_processBatchRequest(t){return Age(this,void 0,void 0,function*(){var n,r;const s=yield this._requestManager.sendBatch([...this._requests.values()].map(l=>l.payload));if(s.length!==this._requests.size)throw this._abortAllRequests("Invalid batch response"),new b0(s,`Batch request size mismatch the results size. Requests: ${this._requests.size}, Responses: ${s.length}`);const a=this.requests.map(l=>l.id).map(Number).sort((l,c)=>l-c),o=s.map(l=>l.id).map(Number).sort((l,c)=>l-c);if(JSON.stringify(a)!==JSON.stringify(o))throw this._abortAllRequests("Invalid batch response"),new b0(s,`Batch request mismatch the results. Requests: [${a.join()}], Responses: [${o.join()}]`);for(const l of s)Cy(l)?(n=this._requests.get(l.id))===null||n===void 0||n.promise.resolve(l.result):Sy(l)&&((r=this._requests.get(l.id))===null||r===void 0||r.promise.reject(l.error));t.resolve(s)})}_abortAllRequests(t){for(const{promise:n}of this._requests.values())n.reject(new oNt(t))}}var F9t=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class Vd extends x7t{constructor(t){var n;if(super(),this.providers=Qw.providers,Xs(t)||typeof t=="string"&&t.trim()!==""||uR(t)){this._requestManager=new Qw(t),this._subscriptionManager=new dR(this._requestManager,{});return}const{config:r,provider:s,requestManager:a,subscriptionManager:o,registeredSubscriptions:l,accountProvider:c,wallet:u,requestManagerMiddleware:d}=t;this.setConfig(r??{}),this._requestManager=a??new Qw(s,(n=r==null?void 0:r.enableExperimentalFeatures)===null||n===void 0?void 0:n.useSubscriptionWhenCheckingBlockTimeout,d),o?this._subscriptionManager=o:this._subscriptionManager=new dR(this.requestManager,l??{}),c&&(this._accountProvider=c),u&&(this._wallet=u)}get requestManager(){return this._requestManager}get subscriptionManager(){return this._subscriptionManager}get wallet(){return this._wallet}get accountProvider(){return this._accountProvider}static fromContextObject(...t){return new this(...t.reverse())}getContextObject(){var t;return{config:this.config,provider:this.provider,requestManager:this.requestManager,subscriptionManager:this.subscriptionManager,registeredSubscriptions:(t=this.subscriptionManager)===null||t===void 0?void 0:t.registeredSubscriptions,providers:this.providers,wallet:this.wallet,accountProvider:this.accountProvider}}use(t,...n){const r=new t(...n,this.getContextObject());return this.on(B3.CONFIG_CHANGE,s=>{r.setConfig({[s.name]:s.newValue})}),this[t.name]=r,r}link(t){this.setConfig(t.config),this._requestManager=t.requestManager,this.provider=t.provider,this._subscriptionManager=t.subscriptionManager,this._wallet=t.wallet,this._accountProvider=t._accountProvider,t.on(B3.CONFIG_CHANGE,n=>{this.setConfig({[n.name]:n.newValue})})}registerPlugin(t){if(this[t.pluginNamespace]!==void 0)throw new lNt(t.pluginNamespace);const n={[t.pluginNamespace]:t};n[t.pluginNamespace].link(this),Object.assign(this,n)}get provider(){return this.currentProvider}set provider(t){this.requestManager.setProvider(t)}get currentProvider(){return this.requestManager.provider}set currentProvider(t){this.requestManager.setProvider(t)}get givenProvider(){return Vd.givenProvider}setProvider(t){return this.provider=t,!0}setRequestManagerMiddleware(t){this.requestManager.setMiddleware(t)}get BatchRequest(){return P9t.bind(void 0,this._requestManager)}extend(t){var n;return t.property&&!this[t.property]&&(this[t.property]={}),(n=t.methods)===null||n===void 0||n.forEach(r=>{const s=(...a)=>F9t(this,void 0,void 0,function*(){return this.requestManager.send({method:r.call,params:a})});t.property?this[t.property][r.name]=s:this[r.name]=s}),this}}Vd.providers=Qw.providers;class kl{constructor(t){if(this.toAddress=()=>{if(this.isDirect()){const n=this._iban.slice(4),r=kl._parseInt(n,36),s=ME(r,40);return ox(s)}throw new Error("Iban is indirect and cannot be converted. Must be length of 34 or 35")},kl.isIndirect(t)||kl.isDirect(t))this._iban=t;else throw new Error("Invalid IBAN was provided")}static isDirect(t){return t.length===34||t.length===35}isDirect(){return kl.isDirect(this._iban)}static isIndirect(t){return t.length===20}isIndirect(){return kl.isIndirect(this._iban)}static isValid(t){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(t)&&kl._mod9710(kl._iso13616Prepare(t))===1}isValid(){return kl.isValid(this._iban)}static fromBban(t){const n="XE",s=`0${(98-this._mod9710(this._iso13616Prepare(`${n}00${t}`))).toString()}`.slice(-2);return new kl(`${n}${s}${t}`)}static createIndirect(t){return kl.fromBban(`ETH${t.institution}${t.identifier}`)}static fromAddress(t){if(!Uf(t))throw new Uae(t);const r=BigInt(Zk(t)).toString(36),s=ME(r,15);return kl.fromBban(s.toUpperCase())}static toIban(t){return kl.fromAddress(t).toString()}client(){return this.isIndirect()?this._iban.slice(11):""}checksum(){return this._iban.slice(2,4)}institution(){return this.isIndirect()?this._iban.slice(7,11):""}toString(){return this._iban}}kl._iso13616Prepare=e=>{const r=e.toUpperCase();return`${r.slice(4)}${r.slice(0,4)}`.split("").map(a=>{const o=a.charCodeAt(0);return o>=65&&o<=90?o-65+10:a}).join("")};kl._parseInt=(e,t)=>[...e].reduce((n,r)=>BigInt(parseInt(r,t))+BigInt(t)*n,BigInt(0));kl._mod9710=e=>{let t=e,n;for(;t.length>2;)n=t.slice(0,9),t=`${(parseInt(n,10)%97).toString()}${t.slice(n.length)}`;return parseInt(t,10)%97};kl.toAddress=e=>new kl(e).toAddress();var yV=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},$Fe;class UFe extends o${constructor(t){super(),this[$Fe]="Promise",this._promise=new Promise(t)}then(t,n){return yV(this,void 0,void 0,function*(){return this._promise.then(t,n)})}catch(t){return yV(this,void 0,void 0,function*(){return this._promise.catch(t)})}finally(t){return yV(this,void 0,void 0,function*(){return this._promise.finally(t)})}on(t,n){return super.on(t,n),this}once(t,n){return super.once(t,n),this}}$Fe=Symbol.toStringTag;var vV={},jge;function O9t(){return jge||(jge=1,function(e,t){if(e.setImmediate)return;var n=1,r={},s=!1,a=e.document,o;function l(I){typeof I!="function"&&(I=new Function(""+I));for(var P=new Array(arguments.length-1),R=0;R<P.length;R++)P[R]=arguments[R+1];var F={callback:I,args:P};return r[n]=F,o(n),n++}function c(I){delete r[I]}function u(I){var P=I.callback,R=I.args;switch(R.length){case 0:P();break;case 1:P(R[0]);break;case 2:P(R[0],R[1]);break;case 3:P(R[0],R[1],R[2]);break;default:P.apply(t,R);break}}function d(I){if(s)setTimeout(d,0,I);else{var P=r[I];if(P){s=!0;try{u(P)}finally{c(I),s=!1}}}}function f(){o=function(I){process.nextTick(function(){d(I)})}}function x(){if(e.postMessage&&!e.importScripts){var I=!0,P=e.onmessage;return e.onmessage=function(){I=!1},e.postMessage("","*"),e.onmessage=P,I}}function g(){var I="setImmediate$"+Math.random()+"$",P=function(R){R.source===e&&typeof R.data=="string"&&R.data.indexOf(I)===0&&d(+R.data.slice(I.length))};e.addEventListener?e.addEventListener("message",P,!1):e.attachEvent("onmessage",P),o=function(R){e.postMessage(I+R,"*")}}function v(){var I=new MessageChannel;I.port1.onmessage=function(P){var R=P.data;d(R)},o=function(P){I.port2.postMessage(P)}}function w(){var I=a.documentElement;o=function(P){var R=a.createElement("script");R.onreadystatechange=function(){d(P),R.onreadystatechange=null,I.removeChild(R),R=null},I.appendChild(R)}}function C(){o=function(I){setTimeout(d,0,I)}}var N=Object.getPrototypeOf&&Object.getPrototypeOf(e);N=N&&N.setTimeout?N:e,{}.toString.call(e.process)==="[object process]"?f():x()?g():e.MessageChannel?v():a&&"onreadystatechange"in a.createElement("script")?w():C(),N.setImmediate=l,N.clearImmediate=c}(typeof self>"u"?typeof ju>"u"?vV:ju:self)),vV}O9t();var ai=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function M9t(e){return ai(this,void 0,void 0,function*(){return e.send({method:"eth_protocolVersion",params:[]})})}function zFe(e){return ai(this,void 0,void 0,function*(){return e.send({method:"eth_syncing",params:[]})})}function R9t(e){return ai(this,void 0,void 0,function*(){return e.send({method:"eth_coinbase",params:[]})})}function L9t(e){return ai(this,void 0,void 0,function*(){return e.send({method:"eth_mining",params:[]})})}function D9t(e){return ai(this,void 0,void 0,function*(){return e.send({method:"eth_hashrate",params:[]})})}function B9t(e){return ai(this,void 0,void 0,function*(){return e.send({method:"eth_gasPrice",params:[]})})}function $9t(e){return ai(this,void 0,void 0,function*(){return e.send({method:"eth_maxPriorityFeePerGas",params:[]})})}function U9t(e){return ai(this,void 0,void 0,function*(){return e.send({method:"eth_accounts",params:[]})})}function z9t(e){return ai(this,void 0,void 0,function*(){return e.send({method:"eth_blockNumber",params:[]})})}function H9t(e,t,n){return ai(this,void 0,void 0,function*(){return Us.validate(["address","blockNumberOrTag"],[t,n]),e.send({method:"eth_getBalance",params:[t,n]})})}function V9t(e,t,n,r){return ai(this,void 0,void 0,function*(){return Us.validate(["address","hex","blockNumberOrTag"],[t,n,r]),e.send({method:"eth_getStorageAt",params:[t,n,r]})})}function W9t(e,t,n){return ai(this,void 0,void 0,function*(){return Us.validate(["address","blockNumberOrTag"],[t,n]),e.send({method:"eth_getTransactionCount",params:[t,n]})})}function q9t(e,t){return ai(this,void 0,void 0,function*(){return Us.validate(["bytes32"],[t]),e.send({method:"eth_getBlockTransactionCountByHash",params:[t]})})}function G9t(e,t){return ai(this,void 0,void 0,function*(){return Us.validate(["blockNumberOrTag"],[t]),e.send({method:"eth_getBlockTransactionCountByNumber",params:[t]})})}function K9t(e,t){return ai(this,void 0,void 0,function*(){return Us.validate(["bytes32"],[t]),e.send({method:"eth_getUncleCountByBlockHash",params:[t]})})}function Y9t(e,t){return ai(this,void 0,void 0,function*(){return Us.validate(["blockNumberOrTag"],[t]),e.send({method:"eth_getUncleCountByBlockNumber",params:[t]})})}function X9t(e,t,n){return ai(this,void 0,void 0,function*(){return Us.validate(["address","blockNumberOrTag"],[t,n]),e.send({method:"eth_getCode",params:[t,n]})})}function Q9t(e,t,n){return ai(this,void 0,void 0,function*(){return Us.validate(["address","hex"],[t,n]),e.send({method:"eth_sign",params:[t,n]})})}function Z9t(e,t){return ai(this,void 0,void 0,function*(){return e.send({method:"eth_signTransaction",params:[t]})})}function J9t(e,t){return ai(this,void 0,void 0,function*(){return e.send({method:"eth_sendTransaction",params:[t]})})}function HFe(e,t){return ai(this,void 0,void 0,function*(){return Us.validate(["hex"],[t]),e.send({method:"eth_sendRawTransaction",params:[t]})})}function eEt(e,t,n){return ai(this,void 0,void 0,function*(){return Us.validate(["blockNumberOrTag"],[n]),e.send({method:"eth_call",params:[t,n]})})}function tEt(e,t,n){return ai(this,void 0,void 0,function*(){return Us.validate(["blockNumberOrTag"],[n]),e.send({method:"eth_estimateGas",params:[t,n]})})}function nEt(e,t,n){return ai(this,void 0,void 0,function*(){return Us.validate(["bytes32","bool"],[t,n]),e.send({method:"eth_getBlockByHash",params:[t,n]})})}function VFe(e,t,n){return ai(this,void 0,void 0,function*(){return Us.validate(["blockNumberOrTag","bool"],[t,n]),e.send({method:"eth_getBlockByNumber",params:[t,n]})})}function rEt(e,t){return ai(this,void 0,void 0,function*(){return Us.validate(["bytes32"],[t]),e.send({method:"eth_getTransactionByHash",params:[t]})})}function sEt(e,t,n){return ai(this,void 0,void 0,function*(){return Us.validate(["bytes32","hex"],[t,n]),e.send({method:"eth_getTransactionByBlockHashAndIndex",params:[t,n]})})}function iEt(e,t,n){return ai(this,void 0,void 0,function*(){return Us.validate(["blockNumberOrTag","hex"],[t,n]),e.send({method:"eth_getTransactionByBlockNumberAndIndex",params:[t,n]})})}function aEt(e,t){return ai(this,void 0,void 0,function*(){return Us.validate(["bytes32"],[t]),e.send({method:"eth_getTransactionReceipt",params:[t]})})}function oEt(e,t,n){return ai(this,void 0,void 0,function*(){return Us.validate(["bytes32","hex"],[t,n]),e.send({method:"eth_getUncleByBlockHashAndIndex",params:[t,n]})})}function lEt(e,t,n){return ai(this,void 0,void 0,function*(){return Us.validate(["blockNumberOrTag","hex"],[t,n]),e.send({method:"eth_getUncleByBlockNumberAndIndex",params:[t,n]})})}function cEt(e,t){return ai(this,void 0,void 0,function*(){return Us.validate(["filter"],[t]),e.send({method:"eth_newFilter",params:[t]})})}function uEt(e){return ai(this,void 0,void 0,function*(){return e.send({method:"eth_newBlockFilter",params:[]})})}function dEt(e){return ai(this,void 0,void 0,function*(){return e.send({method:"eth_newPendingTransactionFilter",params:[]})})}function fEt(e,t){return ai(this,void 0,void 0,function*(){return Us.validate(["hex"],[t]),e.send({method:"eth_uninstallFilter",params:[t]})})}function hEt(e,t){return ai(this,void 0,void 0,function*(){return Us.validate(["hex"],[t]),e.send({method:"eth_getFilterChanges",params:[t]})})}function pEt(e,t){return ai(this,void 0,void 0,function*(){return Us.validate(["hex"],[t]),e.send({method:"eth_getFilterLogs",params:[t]})})}function mEt(e,t){return ai(this,void 0,void 0,function*(){return Us.validate(["filter"],[t]),e.send({method:"eth_getLogs",params:[t]})})}function xEt(e){return ai(this,void 0,void 0,function*(){return e.send({method:"eth_getWork",params:[]})})}function gEt(e,t,n,r){return ai(this,void 0,void 0,function*(){return Us.validate(["bytes8","bytes32","bytes32"],[t,n,r]),e.send({method:"eth_submitWork",params:[t,n,r]})})}function bEt(e,t,n,r){return ai(this,void 0,void 0,function*(){Us.validate(["hex","blockNumberOrTag"],[t,n]);for(const s of r)Us.validate(["number"],[s]);return e.send({method:"eth_feeHistory",params:[t,n,r]})})}function yEt(e){return ai(this,void 0,void 0,function*(){return e.send({method:"eth_pendingTransactions",params:[]})})}function vEt(e){return ai(this,void 0,void 0,function*(){return e.send({method:"eth_requestAccounts",params:[]})})}function wEt(e){return ai(this,void 0,void 0,function*(){return e.send({method:"eth_chainId",params:[]})})}function CEt(e,t,n,r){return ai(this,void 0,void 0,function*(){return Us.validate(["address","bytes32[]","blockNumberOrTag"],[t,n,r]),e.send({method:"eth_getProof",params:[t,n,r]})})}function SEt(e){return ai(this,void 0,void 0,function*(){return e.send({method:"web3_clientVersion",params:[]})})}function NEt(e,t,n){return ai(this,void 0,void 0,function*(){return Us.validate(["blockNumberOrTag"],[n]),e.send({method:"eth_createAccessList",params:[t,n]})})}function AEt(e,t,n,r=!1){return ai(this,void 0,void 0,function*(){return Us.validate(["address"],[t]),e.send({method:`eth_signTypedData${r?"":"_v4"}`,params:[t,n]})})}var woe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function jEt(e){return woe(this,void 0,void 0,function*(){return e.send({method:"net_version",params:[]})})}function EEt(e){return woe(this,void 0,void 0,function*(){return e.send({method:"net_peerCount",params:[]})})}function _Et(e){return woe(this,void 0,void 0,function*(){return e.send({method:"net_listening",params:[]})})}var w1=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const kEt=e=>w1(void 0,void 0,void 0,function*(){return e.send({method:"personal_listAccounts",params:[]})}),TEt=(e,t)=>w1(void 0,void 0,void 0,function*(){return e.send({method:"personal_newAccount",params:[t]})}),IEt=(e,t,n,r)=>w1(void 0,void 0,void 0,function*(){return e.send({method:"personal_unlockAccount",params:[t,n,r]})}),PEt=(e,t)=>w1(void 0,void 0,void 0,function*(){return e.send({method:"personal_lockAccount",params:[t]})}),FEt=(e,t,n)=>w1(void 0,void 0,void 0,function*(){return e.send({method:"personal_importRawKey",params:[t,n]})}),OEt=(e,t,n)=>w1(void 0,void 0,void 0,function*(){return e.send({method:"personal_sendTransaction",params:[t,n]})}),MEt=(e,t,n)=>w1(void 0,void 0,void 0,function*(){return e.send({method:"personal_signTransaction",params:[t,n]})}),REt=(e,t,n,r)=>w1(void 0,void 0,void 0,function*(){return e.send({method:"personal_sign",params:[t,n,r]})}),LEt=(e,t,n)=>w1(void 0,void 0,void 0,function*(){return e.send({method:"personal_ecRecover",params:[t,n]})}),Ege={type:"object",properties:{accessList:{type:"null"},maxFeePerGas:{type:"null"},maxPriorityFeePerGas:{type:"null"}}},_ge={type:"object",properties:{maxFeePerGas:{type:"null"},maxPriorityFeePerGas:{type:"null"}}},kge={type:"object",properties:{gasPrice:{type:"null"}}},uP=(e,t,n)=>{try{Us.validateJSONSchema(e,t)}catch(r){throw r instanceof eN?new MNt(r.errors,n):r}},DEt=e=>{var t,n;const r=e;if(!ar(r.type)){let a;switch(r.type){case"0x0":a=Ege;break;case"0x1":a=_ge;break;case"0x2":a=kge;break;default:return Ur({format:"uint"},r.type,ui)}return uP(a,r,r.type),Ur({format:"uint"},r.type,ui)}if(!ar(r.maxFeePerGas)||!ar(r.maxPriorityFeePerGas))return uP(kge,r,"0x2"),"0x2";if(!ar(r.accessList))return uP(_ge,r,"0x1"),"0x1";const s=(t=r.hardfork)!==null&&t!==void 0?t:(n=r.common)===null||n===void 0?void 0:n.hardfork;if(!ar(s)){const a=Object.keys(Yj).indexOf(s);if(a>=Object.keys(Yj).indexOf("london"))return ar(r.gasPrice)?"0x2":"0x0";if(a===Object.keys(Yj).indexOf("berlin"))return"0x0"}if(!ar(r.gasPrice))return uP(Ege,r,"0x0"),"0x0"},BEt=(e,t)=>{var n;return((n=t==null?void 0:t.transactionTypeParser)!==null&&n!==void 0?n:DEt)(e)},$Et=e=>e[0]>127?"0x0":c1(e[0]),UEt={type:"object",properties:{address:{format:"address"},storageKeys:{type:"array",items:{format:"bytes32"}}}},Coe={type:"array",items:Object.assign({},UEt)},zEt={type:"object",properties:{accessList:Object.assign({},Coe),gasUsed:{type:"string"}}},Tge={type:"string",enum:["goerli","kovan","mainnet","rinkeby","ropsten","sepolia"]},Ige={type:"string",enum:["arrowGlacier","berlin","byzantium","chainstart","constantinople","dao","homestead","istanbul","london","merge","muirGlacier","petersburg","shanghai","spuriousDragon","tangerineWhistle"]},HEt={type:"object",properties:{name:{format:"string"},networkId:{format:"uint"},chainId:{format:"uint"}}},WFe={type:"object",properties:{from:{format:"address"},to:{oneOf:[{format:"address"},{type:"null"}]},value:{format:"uint"},gas:{format:"uint"},gasPrice:{format:"uint"},effectiveGasPrice:{format:"uint"},type:{format:"uint"},maxFeePerGas:{format:"uint"},maxPriorityFeePerGas:{format:"uint"},accessList:Object.assign({},Coe),data:{format:"bytes"},input:{format:"bytes"},nonce:{format:"uint"},chain:Object.assign({},Tge),hardfork:Object.assign({},Ige),chainId:{format:"uint"},networkId:{format:"uint"},common:{type:"object",properties:{customChain:Object.assign({},HEt),baseChain:Object.assign({},Tge),hardfork:Object.assign({},Ige)}},gasLimit:{format:"uint"},v:{format:"uint"},r:{format:"bytes32"},s:{format:"bytes32"}}},Eee={type:"object",properties:Object.assign(Object.assign({},WFe.properties),{blockHash:{format:"bytes32"},blockNumber:{format:"uint"},hash:{format:"bytes32"},transactionIndex:{format:"uint"},from:{format:"address"},to:{oneOf:[{format:"address"},{type:"null"}]},value:{format:"uint"},gas:{format:"uint"},gasPrice:{format:"uint"},effectiveGasPrice:{format:"uint"},type:{format:"uint"},maxFeePerGas:{format:"uint"},maxPriorityFeePerGas:{format:"uint"},accessList:Object.assign({},Coe),data:{format:"bytes"},input:{format:"bytes"},nonce:{format:"uint"},gasLimit:{format:"uint"},v:{format:"uint"},r:{format:"bytes32"},s:{format:"bytes32"}})},qFe={type:"object",properties:{index:{format:"uint"},validatorIndex:{format:"uint"},address:{format:"address"},amount:{format:"uint"}}},mR={type:"object",properties:{baseFeePerGas:{format:"uint"},blobGasUsed:{format:"uint"},difficulty:{format:"uint"},excessBlobGas:{format:"uint"},extraData:{format:"bytes"},gasLimit:{format:"uint"},gasUsed:{format:"uint"},hash:{format:"bytes32"},logsBloom:{format:"bytes256"},miner:{format:"bytes"},mixHash:{format:"bytes32"},nonce:{format:"uint"},number:{format:"uint"},parentBeaconBlockRoot:{format:"bytes32"},parentHash:{format:"bytes32"},receiptsRoot:{format:"bytes32"},sha3Uncles:{format:"bytes32"},size:{format:"uint"},stateRoot:{format:"bytes32"},timestamp:{format:"uint"},totalDifficulty:{format:"uint"},transactions:{oneOf:[{type:"array",items:Object.assign({},Eee)},{type:"array",items:{format:"bytes32"}}]},transactionsRoot:{format:"bytes32"},uncles:{type:"array",items:{format:"bytes32"}},withdrawals:{type:"array",items:Object.assign({},qFe)},withdrawalsRoot:{format:"bytes32"}}},VEt={type:"object",properties:{author:{format:"bytes32"},excessDataGas:{format:"uint"},baseFeePerGas:{format:"uint"},blobGasUsed:{format:"uint"},difficulty:{format:"uint"},excessBlobGas:{format:"uint"},extraData:{format:"bytes"},gasLimit:{format:"uint"},gasUsed:{format:"uint"},hash:{format:"bytes32"},logsBloom:{format:"bytes256"},miner:{format:"bytes"},mixHash:{format:"bytes32"},nonce:{format:"uint"},number:{format:"uint"},parentBeaconBlockRoot:{format:"bytes32"},parentHash:{format:"bytes32"},receiptsRoot:{format:"bytes32"},sha3Uncles:{format:"bytes32"},size:{format:"uint"},stateRoot:{format:"bytes32"},timestamp:{format:"uint"},totalDifficulty:{format:"uint"},transactions:{type:"array",items:{format:"bytes32"}},transactionsRoot:{format:"bytes32"},uncles:{type:"array",items:{format:"bytes32"}},withdrawals:{type:"array",items:Object.assign({},qFe)},withdrawalsRoot:{format:"bytes32"}}},LA={type:"object",properties:{removed:{format:"bool"},logIndex:{format:"uint"},transactionIndex:{format:"uint"},transactionHash:{format:"bytes32"},blockHash:{format:"bytes32"},blockNumber:{format:"uint"},address:{format:"address"},data:{format:"bytes"},topics:{type:"array",items:{format:"bytes32"}}}},WEt={type:"object",properties:{startingBlock:{format:"string"},currentBlock:{format:"string"},highestBlock:{format:"string"},knownStates:{format:"string"},pulledStates:{format:"string"}}},DA={type:"object",properties:{transactionHash:{format:"bytes32"},transactionIndex:{format:"uint"},blockHash:{format:"bytes32"},blockNumber:{format:"uint"},from:{format:"address"},to:{format:"address"},cumulativeGasUsed:{format:"uint"},gasUsed:{format:"uint"},effectiveGasPrice:{format:"uint"},contractAddress:{format:"address"},logs:{type:"array",items:Object.assign({},LA)},logsBloom:{format:"bytes"},root:{format:"bytes"},status:{format:"uint"},type:{format:"uint"}}},qEt={type:"object",properties:{messageHash:{format:"bytes"},r:{format:"bytes32"},s:{format:"bytes32"},v:{format:"bytes"},message:{format:"bytes"},signature:{format:"bytes"}}},GEt={type:"object",properties:{oldestBlock:{format:"uint"},baseFeePerGas:{type:"array",items:{format:"uint"}},reward:{type:"array",items:{type:"array",items:{format:"uint"}}},gasUsedRatio:{type:"array",items:{type:"number"}}}},KEt={type:"object",properties:{key:{format:"bytes32"},value:{format:"uint"},proof:{type:"array",items:{format:"bytes32"}}}},YEt={type:"object",properties:{balance:{format:"uint"},codeHash:{format:"bytes32"},nonce:{format:"uint"},storageHash:{format:"bytes32"},accountProof:{type:"array",items:{format:"bytes32"}},storageProof:{type:"array",items:Object.assign({},KEt)}}};function tf(e,t=id,n={transactionSchema:Eee,fillInputAndData:!1}){var r,s;let a=o2({},e);if(ar(e==null?void 0:e.common)||(a.common=Object.assign({},e.common),ar((r=e.common)===null||r===void 0?void 0:r.customChain)||(a.common.customChain=Object.assign({},e.common.customChain))),a=Ur((s=n.transactionSchema)!==null&&s!==void 0?s:Eee,a,t),!ar(a.data)&&!ar(a.input)&&c1(a.data)!==c1(a.input))throw new fPe({data:Ui(a.data),input:Ui(a.input)});return n.fillInputAndData&&(ar(a.data)?ar(a.input)||(a.data=a.input):a.input=a.data),ar(a.gasLimit)||(a.gas=a.gasLimit,delete a.gasLimit),a}function XEt(e,t,n={fillInputAndData:!1}){return{raw:Ur({format:"bytes"},e,t),tx:tf(Object.assign(Object.assign({},U3.fromSerializedData(so(e)).toJSON()),{hash:Ui(rN(so(e))),type:$Et(so(e))}),t,{fillInputAndData:n.fillInputAndData,transactionSchema:n.transactionSchema})}}var Soe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function Noe(e,t){return Soe(this,void 0,void 0,function*(){const n=yield jEt(e.requestManager);return Ur({format:"uint"},n,t)})}function QEt(e,t){return Soe(this,void 0,void 0,function*(){const n=yield EEt(e.requestManager);return Ur({format:"uint"},n,t)})}const ZEt=e=>Soe(void 0,void 0,void 0,function*(){return _Et(e.requestManager)});var wV=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class GFe extends Vd{getId(t=this.defaultReturnFormat){return wV(this,void 0,void 0,function*(){return Noe(this,t)})}getPeerCount(t=this.defaultReturnFormat){return wV(this,void 0,void 0,function*(){return QEt(this,t)})}isListening(){return wV(this,void 0,void 0,function*(){return ZEt(this)})}}const cN="ALLEVENTS",_ee={name:cN,signature:"",type:"event",inputs:[]},h$={bytes:a1.HEX,number:Vh.NUMBER};var KFe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function JEt(e,t,n){return KFe(this,void 0,void 0,function*(){var r,s,a,o;const l=yield SOe(t,t.defaultBlock,!1,ui);if(ar(l.baseFeePerGas))throw new INt;let c;if(ar(e.gasPrice)&&BigInt(l.baseFeePerGas)===BigInt(0)&&(c=yield Foe(t,n)),!ar(e.gasPrice)||!ar(c)){const u=Ur({format:"uint"},(r=e.gasPrice)!==null&&r!==void 0?r:c,n);return{maxPriorityFeePerGas:u,maxFeePerGas:u}}return{maxPriorityFeePerGas:Ur({format:"uint"},(s=e.maxPriorityFeePerGas)!==null&&s!==void 0?s:t.defaultMaxPriorityFeePerGas,n),maxFeePerGas:Ur({format:"uint"},(a=e.maxFeePerGas)!==null&&a!==void 0?a:BigInt(l.baseFeePerGas)*BigInt(2)+BigInt((o=e.maxPriorityFeePerGas)!==null&&o!==void 0?o:t.defaultMaxPriorityFeePerGas),n)}})}function YFe(e,t,n){return KFe(this,void 0,void 0,function*(){const r=XFe(e,t);if(!ar(r)){if(r.startsWith("-"))throw new Uxe(r);if(Number(r)<0||Number(r)>127)throw new Uxe(r);if(ar(e.gasPrice)&&(r==="0x0"||r==="0x1"))return{gasPrice:yield Foe(t,n),maxPriorityFeePerGas:void 0,maxFeePerGas:void 0};if(r==="0x2")return Object.assign({gasPrice:void 0},yield JEt(e,t,n))}})}var Aoe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const kee=(e,t,n,r)=>{if(n!==void 0&&e in n&&n[e]!==void 0){if(typeof n[e]=="string"&&Uf(n[e]))return n[e];if(!Ca(n[e])&&WPe(n[e])){if(t.wallet){const s=t.wallet.get(Ur({format:"uint"},n[e],h$));if(!ar(s))return s.address;throw new zxe}throw new zxe}else throw e==="from"?new fNt(n.from):new hNt(n.to)}if(e==="from"){if(!ar(r))return f$(r);if(!ar(t.defaultAccount))return t.defaultAccount}},e_t=(e,t,...n)=>Aoe(void 0,[e,t,...n],void 0,function*(r,s,a=r.defaultReturnFormat){if(ar(s))throw new TNt;return AOe(r,s,r.defaultBlock,a)}),XFe=(e,t)=>{const n=BEt(e,t);if(!ar(n))return n;if(!ar(t.defaultTransactionType))return Ur({format:"uint"},t.defaultTransactionType,ui)};function t_t(e){return Aoe(this,void 0,void 0,function*(){var t,n;let r=Ur(WFe,e.transaction,e.web3Context.defaultReturnFormat);if(ar(r.from)&&(r.from=kee("from",e.web3Context,void 0,e.privateKey)),ar(r.nonce)&&(r.nonce=yield e_t(e.web3Context,r.from,ui)),ar(r.value)&&(r.value="0x0"),ar(r.data))ar(r.input)?r.input="0x":r.input.startsWith("0x")||(r.input=`0x${r.input}`);else{if(!ar(r.input)&&r.data!==r.input)throw new fPe({data:Ui(r.data),input:Ui(r.input)});r.data.startsWith("0x")||(r.data=`0x${r.data}`)}if(ar(r.common)){if(e.web3Context.defaultCommon){const s=e.web3Context.defaultCommon,a=s.customChain.chainId,o=s.customChain.networkId,l=s.customChain.name;r.common=Object.assign(Object.assign({},s),{customChain:{chainId:a,networkId:o,name:l}})}ar(r.chain)&&(r.chain=e.web3Context.defaultChain),ar(r.hardfork)&&(r.hardfork=e.web3Context.defaultHardfork)}if(ar(r.chainId)&&ar((t=r.common)===null||t===void 0?void 0:t.customChain.chainId)&&(r.chainId=yield EOe(e.web3Context,ui)),ar(r.networkId)&&(r.networkId=(n=e.web3Context.defaultNetworkId)!==null&&n!==void 0?n:yield Noe(e.web3Context,ui)),ar(r.gasLimit)&&!ar(r.gas)&&(r.gasLimit=r.gas),r.type=XFe(r,e.web3Context),ar(r.accessList)&&(r.type==="0x1"||r.type==="0x2")&&(r.accessList=[]),e.fillGasPrice&&(r=Object.assign(Object.assign({},r),yield YFe(r,e.web3Context,ui))),ar(r.gas)&&ar(r.gasLimit)&&e.fillGasLimit){const s=yield Roe(e.web3Context,r,"latest",ui);r=Object.assign(Object.assign({},r),{gas:Ur({format:"uint"},s,ui)})}return r})}const n_t=e=>Aoe(void 0,void 0,void 0,function*(){var t;return((t=e.web3Context.transactionBuilder)!==null&&t!==void 0?t:t_t)(Object.assign(Object.assign({},e),{transaction:e.transaction}))});var joe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function Tee(e,t,n){const r=e.transactionPollingInterval,[s,a]=sFe(()=>joe(this,void 0,void 0,function*(){let l;try{l=yield Ooe(e,h$)}catch(u){console.warn("An error happen while trying to get the block number",u);return}const c=l-t;if(c>=e.transactionBlockTimeout)return new mPe({starterBlockNumber:t,numberOfBlocks:c,transactionHash:n})}),r);return[a,{clean:()=>{clearInterval(s)}}]}function r_t(e,t,n){return joe(this,void 0,void 0,function*(){var r;let s=!0,a,o;function l(u,d){d&&console.warn("error happened at subscription. So revert to polling...",d),o.clean(),s=!1;const[f,x]=Tee(e,t,n);o.clean=x.clean,f.catch(g=>u(g))}try{a=yield(r=e.subscriptionManager)===null||r===void 0?void 0:r.subscribe("newHeads"),o={clean:()=>{var u;a.id&&((u=e.subscriptionManager)===null||u===void 0||u.removeSubscription(a).then(()=>{}).catch(()=>{}))}}}catch{return Tee(e,t,n)}return[new Promise((u,d)=>{try{a.on("data",f=>{if(s=!1,!(f!=null&&f.number))return;const x=Number(BigInt(f.number)-BigInt(t));x>=e.transactionBlockTimeout&&d(new mPe({starterBlockNumber:t,numberOfBlocks:x,transactionHash:n}))}),a.on("error",f=>{l(d,f)})}catch(f){l(d,f)}setTimeout(()=>{s&&l(d)},e.blockHeaderTimeout*1e3)}),o]})}function QFe(e,t){return joe(this,void 0,void 0,function*(){var n,r;const{provider:s}=e.requestManager;let a;const o=yield Ooe(e,h$);return!((r=(n=s).supportsSubscriptions)===null||r===void 0)&&r.call(n)&&e.enableExperimentalFeatures.useSubscriptionWhenCheckingBlockTimeout?a=yield r_t(e,o,t):a=Tee(e,o,t),a})}var s_t=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function Iee(e,t,n){return s_t(this,void 0,void 0,function*(){const[r,s]=roe(e.transactionSendTimeout,new PNt({numberOfSeconds:e.transactionSendTimeout/1e3,transactionHash:n})),[a,o]=yield QFe(e,n);try{return yield Promise.race([t(),s,a])}finally{clearTimeout(r),o.clean()}})}var Pge=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function ZFe(e,t,n,r){return Pge(this,void 0,void 0,function*(){var s;const a=(s=e.transactionReceiptPollingInterval)!==null&&s!==void 0?s:e.transactionPollingInterval,[o,l]=noe(()=>Pge(this,void 0,void 0,function*(){try{return(r??NOe)(e,t,n)}catch(x){console.warn("An error happen while trying to get the transaction receipt",x);return}}),a),[c,u]=roe(e.transactionPollingTimeout,new pPe({numberOfSeconds:e.transactionPollingTimeout/1e3,transactionHash:t})),[d,f]=yield QFe(e,t);try{return yield Promise.race([o,u,d])}finally{c&&clearTimeout(c),l&&clearInterval(l),f.clean()}})}var i_t=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const hO=({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,customTransactionReceiptSchema:r,returnFormat:s})=>{var a;let o=1;const l=setInterval(()=>{i_t(void 0,void 0,void 0,function*(){if(o>=e.transactionConfirmationBlocks){clearInterval(l);return}const c=yield VFe(e.requestManager,Yl(BigInt(t.blockNumber)+BigInt(o)),!1);c!=null&&c.hash&&(o+=1,n.emit("confirmation",{confirmations:Ur({format:"uint"},o,s),receipt:Ur(r??DA,t,s),latestBlockHash:Ur({format:"bytes32"},c.hash,s)}))})},(a=e.transactionReceiptPollingInterval)!==null&&a!==void 0?a:e.transactionPollingInterval)};var Fge=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const a_t=({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,customTransactionReceiptSchema:r,returnFormat:s})=>{let a=!0,o;setImmediate(()=>{var l;(l=e.subscriptionManager)===null||l===void 0||l.subscribe("newHeads").then(c=>{c.on("data",u=>Fge(void 0,void 0,void 0,function*(){var d;if(a=!1,!(u!=null&&u.number)||o===(u==null?void 0:u.parentHash))return;o=u==null?void 0:u.parentHash;const f=BigInt(u.number)-BigInt(t.blockNumber)+BigInt(1);n.emit("confirmation",{confirmations:Ur({format:"uint"},f,s),receipt:Ur(r??DA,t,s),latestBlockHash:Ur({format:"bytes32"},u.parentHash,s)}),f>=e.transactionConfirmationBlocks&&(yield(d=e.subscriptionManager)===null||d===void 0?void 0:d.removeSubscription(c))})),c.on("error",()=>Fge(void 0,void 0,void 0,function*(){var u;yield(u=e.subscriptionManager)===null||u===void 0?void 0:u.removeSubscription(c),a=!1,hO({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,customTransactionReceiptSchema:r,returnFormat:s})}))}).catch(()=>{a=!1,hO({web3Context:e,transactionReceipt:t,customTransactionReceiptSchema:r,transactionPromiEvent:n,returnFormat:s})})}),setTimeout(()=>{a&&hO({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,returnFormat:s})},e.blockHeaderTimeout*1e3)};function o_t(e,t,n,r,s,a){if(ar(n)||ar(n.blockHash))throw new FNt({receipt:n,blockHash:Ur({format:"bytes32"},n==null?void 0:n.blockHash,s),transactionHash:Ur({format:"bytes32"},r,s)});if(!n.blockNumber)throw new ONt({receipt:n});t.emit("confirmation",{confirmations:Ur({format:"uint"},1,s),receipt:Ur(a??DA,n,s),latestBlockHash:Ur({format:"bytes32"},n.blockHash,s)});const o=e.requestManager.provider;o&&"supportsSubscriptions"in o&&o.supportsSubscriptions()?a_t({web3Context:e,transactionReceipt:n,transactionPromiEvent:t,customTransactionReceiptSchema:a,returnFormat:s}):hO({web3Context:e,transactionReceipt:n,transactionPromiEvent:t,customTransactionReceiptSchema:a,returnFormat:s})}const p$=e=>!Xs(e)&&typeof e=="object"&&!Xs(e.type)&&e.type==="error",Eoe=e=>!Xs(e)&&typeof e=="object"&&!Xs(e.type)&&e.type==="event",m$=e=>!Xs(e)&&typeof e=="object"&&!Xs(e.type)&&e.type==="function",l_t=e=>!Xs(e)&&typeof e=="object"&&!Xs(e.type)&&e.type==="constructor",c_t=e=>typeof e=="object"&&typeof e.components>"u"&&typeof e.name>"u",JFe=e=>e.includes("[]")?{type:"tuple[]",name:e.slice(0,-2)}:{type:"tuple",name:e},eOe=e=>{const t=[];for(const n of Object.keys(e)){const r=e[n];typeof r=="object"?t.push(Object.assign(Object.assign({},JFe(n)),{components:eOe(r)})):t.push({name:n,type:e[n]})}return t},Pee=(e,t)=>{const n=[];return t.forEach(r=>{if(typeof r.components=="object"){if(!r.type.startsWith("tuple"))throw new Wi(`Invalid value given "${r.type}". Error: components found but type is not tuple.`);const s=r.type.indexOf("["),a=s>=0?r.type.substring(s):"",o=Pee(e,r.components);n.push(`(${o.join(",")})${a}`)}else n.push(r.type)}),n},Ug=e=>{var t,n,r,s;return p$(e)||Eoe(e)||m$(e)?!((t=e.name)===null||t===void 0)&&t.includes("(")?e.name:`${(n=e.name)!==null&&n!==void 0?n:""}(${Pee(!1,(r=e.inputs)!==null&&r!==void 0?r:[]).join(",")})`:`(${Pee(!1,(s=e.inputs)!==null&&s!==void 0?s:[]).join(",")})`},u_t=e=>{if(typeof e!="string"&&!p$(e))throw new Wi("Invalid parameter value in encodeErrorSignature");let t;return e&&(typeof e=="function"||typeof e=="object")?t=Ug(e):t=e,zf(t)},_oe=e=>{if(typeof e!="string"&&!Eoe(e))throw new Wi("Invalid parameter value in encodeEventSignature");let t;return e&&(typeof e=="function"||typeof e=="object")?t=Ug(e):t=e,zf(t)};function koe(e,t){const n=e.exec(t);return n==null?void 0:n.groups}var tOe=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,nOe=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,rOe=/^\(.+?\).*?$/,d_t=Object.defineProperty,f_t=(e,t,n)=>t in e?d_t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_7=(e,t,n)=>(f_t(e,typeof t!="symbol"?t+"":t,n),n),h_t="abitype",p_t="0.7.1",Ud=class extends Error{constructor(e,t={}){var a;const n=t.cause instanceof Ud?t.cause.details:(a=t.cause)!=null&&a.message?t.cause.message:t.details,r=t.cause instanceof Ud&&t.cause.docsPath||t.docsPath,s=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...r?[`Docs: https://abitype.dev${r}`]:[],...n?[`Details: ${n}`]:[],`Version: ${h_t}@${p_t}`].join(`
`);super(s),_7(this,"details"),_7(this,"docsPath"),_7(this,"metaMessages"),_7(this,"shortMessage"),_7(this,"name","AbiTypeError"),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=r,this.metaMessages=t.metaMessages,this.shortMessage=e}},sOe=/^struct (?<name>[a-zA-Z0-9_]+) \{(?<properties>.*?)\}$/;function iOe(e){return sOe.test(e)}function m_t(e){return koe(sOe,e)}var Oge=new Set(["memory","indexed","storage","calldata"]),x_t=new Set(["calldata","memory","storage"]);function g_t(e,t){return t?`${t}:${e}`:e}var CV=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]),b_t=/^(?<type>[a-zA-Z0-9_]+?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z0-9_]+))?$/,y_t=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z0-9_]+))?$/,v_t=/^u?int$/;function xR(e,t){var f,x;const n=g_t(e,t==null?void 0:t.type);if(CV.has(n))return CV.get(n);const r=rOe.test(e),s=koe(r?y_t:b_t,e);if(!s)throw new Ud("Invalid ABI parameter.",{details:e});if(s.name&&C_t(s.name))throw new Ud("Invalid ABI parameter.",{details:e,metaMessages:[`"${s.name}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]});const a=s.name?{name:s.name}:{},o=s.modifier==="indexed"?{indexed:!0}:{},l=(t==null?void 0:t.structs)??{};let c,u={};if(r){c="tuple";const g=CC(s.type),v=[],w=g.length;for(let C=0;C<w;C++)v.push(xR(g[C],{structs:l}));u={components:v}}else if(s.type in l)c="tuple",u={components:l[s.type]};else if(v_t.test(s.type))c=`${s.type}256`;else if(c=s.type,(t==null?void 0:t.type)!=="struct"&&!aOe(c))throw new Ud("Unknown type.",{metaMessages:[`Type "${c}" is not a valid ABI type.`]});if(s.modifier){if(!((x=(f=t==null?void 0:t.modifiers)==null?void 0:f.has)!=null&&x.call(f,s.modifier)))throw new Ud("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${s.modifier}" not allowed${t!=null&&t.type?` in "${t.type}" type`:""}.`]});if(x_t.has(s.modifier)&&!S_t(c,!!s.array))throw new Ud("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${s.modifier}" not allowed${t!=null&&t.type?` in "${t.type}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${s.modifier}" was given.`]})}const d={type:`${c}${s.array??""}`,...a,...o,...u};return CV.set(n,d),d}function CC(e,t=[],n="",r=0){if(e===""){if(n==="")return t;if(r!==0)throw new Ud("Unbalanced parentheses.",{metaMessages:[`"${n.trim()}" has too many ${r>0?"opening":"closing"} parentheses.`],details:`Depth "${r}"`});return[...t,n.trim()]}const s=e.length;for(let a=0;a<s;a++){const o=e[a],l=e.slice(a+1);switch(o){case",":return r===0?CC(l,[...t,n.trim()]):CC(l,t,`${n}${o}`,r);case"(":return CC(l,t,`${n}${o}`,r+1);case")":return CC(l,t,`${n}${o}`,r-1);default:return CC(l,t,`${n}${o}`,r)}}return[]}function aOe(e){return e==="address"||e==="bool"||e==="function"||e==="string"||tOe.test(e)||nOe.test(e)}var w_t=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function C_t(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||tOe.test(e)||nOe.test(e)||w_t.test(e)}function S_t(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function N_t(e){const t={},n=e.length;for(let o=0;o<n;o++){const l=e[o];if(!iOe(l))continue;const c=m_t(l);if(!c)throw new Ud("Invalid struct signature.",{details:l});const u=c.properties.split(";"),d=[],f=u.length;for(let x=0;x<f;x++){const v=u[x].trim();if(!v)continue;const w=xR(v,{type:"struct"});d.push(w)}if(!d.length)throw new Ud("Invalid struct signature.",{details:l,metaMessages:["No properties exist."]});t[c.name]=d}const r={},s=Object.entries(t),a=s.length;for(let o=0;o<a;o++){const[l,c]=s[o];r[l]=oOe(c,t)}return r}var A_t=/^(?<type>[a-zA-Z0-9_]+?)(?<array>(?:\[\d*?\])+?)?$/;function oOe(e,t,n=new Set){const r=[],s=e.length;for(let a=0;a<s;a++){const o=e[a];if(rOe.test(o.type))r.push(o);else{const c=koe(A_t,o.type);if(!(c!=null&&c.type))throw new Ud("Invalid ABI parameter.",{details:JSON.stringify(o,null,2),metaMessages:["ABI parameter type is invalid."]});const{array:u,type:d}=c;if(d in t){if(n.has(d))throw new Ud("Circular reference detected.",{metaMessages:[`Struct "${d}" is a circular reference.`]});r.push({...o,type:`tuple${u??""}`,components:oOe(t[d]??[],t,new Set([...n,d]))})}else if(aOe(d))r.push(o);else throw new Ud("Unknown type.",{metaMessages:[`Type "${d}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]})}}return r}function j_t(e){let t;if(typeof e=="string")t=xR(e,{modifiers:Oge});else{const n=N_t(e),r=e.length;for(let s=0;s<r;s++){const a=e[s];if(!iOe(a)){t=xR(a,{modifiers:Oge,structs:n});break}}}if(!t)throw new Ud("Failed to parse ABI parameter.",{details:`parseAbiParameter(${JSON.stringify(e,null,2)})`,docsPath:"/api/human.html#parseabiparameter-1"});return t}const Zo=32;function Fee(e=0){var t;if(((t=globalThis.Buffer)===null||t===void 0?void 0:t.alloc)!==void 0){const n=globalThis.Buffer.alloc(e);return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}return new Uint8Array(e)}function lOe(e){var t,n;return Object.assign(Object.assign({},e),{name:(t=e.name)!==null&&t!==void 0?t:"",components:(n=e.components)===null||n===void 0?void 0:n.map(r=>lOe(r))})}function E_t(e){return!Xs(e)&&typeof e=="object"&&!Xs(e.type)&&typeof e.type=="string"}function cOe(e){return e.map(t=>{var n;if(E_t(t))return t;if(typeof t=="string")return lOe(j_t(t.replace(/tuple/,"")));if(c_t(t)){const r=Object.keys(t)[0],s=JFe(r);return s.name=(n=s.name)!==null&&n!==void 0?n:"",Object.assign(Object.assign({},s),{components:eOe(t[r])})}throw new Wi("Invalid abi")})}function Toe(e){const t=e.type.lastIndexOf("["),n=e.type.substring(0,t),r=e.type.substring(t);let s=-1;if(r!=="[]"&&(s=Number(r.slice(1,-1)),isNaN(s)))throw new Wi("Invalid fixed array size",{size:r});return{param:{type:n,name:"",components:e.components},size:s}}function gR(e){var t,n;return e.type==="string"||e.type==="bytes"||e.type.endsWith("[]")?!0:e.type==="tuple"?(n=(t=e.components)===null||t===void 0?void 0:t.some(gR))!==null&&n!==void 0?n:!1:e.type.endsWith("]")?gR(Toe(e).param):!1}const uOe=20,dOe=Zo-uOe;function __t(e,t){if(typeof t!="string")throw new Wi("address type expects string as input type",{value:t,name:e.name,type:e.type});let n=t.toLowerCase();if(n.startsWith("0x")||(n=`0x${n}`),!Uf(n))throw new Wi("provided input is not valid address",{value:t,name:e.name,type:e.type});const r=u5(n),s=Fee(Zo);return s.set(r,dOe),{dynamic:!1,encoded:s}}function k_t(e,t){const n=t.subarray(dOe,Zo);if(n.length!==uOe)throw new Wi("Invalid decoding input, not enough bytes to decode address",{bytes:t});const r=y1(n);return{result:ox(r),encoded:t.subarray(Zo),consumed:Zo}}const Vy=new Map;let dP=BigInt(256);for(let e=8;e<=256;e+=8)Vy.set(`uint${e}`,{min:BigInt(0),max:dP-BigInt(1)}),Vy.set(`int${e}`,{min:-dP/BigInt(2),max:dP/BigInt(2)-BigInt(1)}),dP*=BigInt(256);Vy.set("int",Vy.get("int256"));Vy.set("uint",Vy.get("uint256"));const fOe=BigInt(1)<<BigInt(256);function T_t(e,t=Zo){let n;return e<0?n=(fOe+e).toString(16):n=e.toString(16),n=nN(n,t*2),u5(n)}function I_t(e,t){const n=y1(e),r=BigInt(n);return r<=t?r:r-fOe}function rT(e,t){let n;try{n=Gv(t)}catch{throw new Wi("provided input is not number value",{type:e.type,value:t,name:e.name})}const r=Vy.get(e.type);if(!r)throw new Wi("provided abi contains invalid number datatype",{type:e.type});if(n<r.min)throw new Wi("provided input is less then minimum for given type",{type:e.type,value:t,name:e.name,minimum:r.min.toString()});if(n>r.max)throw new Wi("provided input is greater then maximum for given type",{type:e.type,value:t,name:e.name,maximum:r.max.toString()});return{dynamic:!1,encoded:T_t(n)}}function uN(e,t){if(t.length<Zo)throw new Wi("Not enough bytes left to decode",{param:e,bytesLeft:t.length});const n=t.subarray(0,Zo),r=Vy.get(e.type);if(!r)throw new Wi("provided abi contains invalid number datatype",{type:e.type});const s=I_t(n,r.max);if(s<r.min)throw new Wi("decoded value is less then minimum for given type",{type:e.type,value:s,name:e.name,minimum:r.min.toString()});if(s>r.max)throw new Wi("decoded value is greater then maximum for given type",{type:e.type,value:s,name:e.name,maximum:r.max.toString()});return{result:s,encoded:t.subarray(Zo),consumed:Zo}}function P_t(e,t){let n;try{n=XPe(t)}catch(r){if(r instanceof zae)throw new Wi("provided input is not valid boolean value",{type:e.type,value:t,name:e.name})}return rT({type:"uint8",name:""},Number(n))}function F_t(e,t){const n=uN({type:"uint8",name:""},t);if(n.result>1||n.result<0)throw new Wi("Invalid boolean value encoded",{boolBytes:t.subarray(0,Zo),numberResult:n});return{result:n.result===BigInt(1),encoded:n.encoded,consumed:Zo}}const O_t=32;function hOe(e,t){if(typeof t=="string"&&t.length%2!==0&&(t+="0"),!i2(t))throw new Wi("provided input is not valid bytes value",{type:e.type,value:t,name:e.name});const n=Z0(t),[,r]=e.type.split("bytes");if(r){if(Number(r)>O_t||Number(r)<1)throw new Wi("invalid bytes type. Static byte type can have between 1 and 32 bytes",{type:e.type});if(Number(r)<n.length)throw new Wi("provided input size is different than type size",{type:e.type,value:t,name:e.name});const o=Fee(Zo);return o.set(n),{dynamic:!1,encoded:o}}const s=Math.ceil(n.length/Zo),a=Fee(Zo+s*Zo);return a.set(rT({type:"uint32",name:""},n.length).encoded),a.set(n,Zo),{dynamic:!0,encoded:a}}function pOe(e,t){const[,n]=e.type.split("bytes");let r=Number(n),s=t,a=1,o=0;if(!r){const l=uN({type:"uint32",name:""},s);r=Number(l.result),o+=l.consumed,s=l.encoded,a=Math.ceil(r/Zo)}if(r>t.length)throw new Wi("there is not enough data to decode",{type:e.type,encoded:t,size:r});return{result:Ui(s.subarray(0,r)),encoded:s.subarray(a*Zo),consumed:o+a*Zo}}function M_t(e,t){if(typeof t!="string")throw new Wi("invalid input, should be string",{input:t});const n=Jae(t);return hOe({type:"bytes",name:""},n)}function R_t(e,t){const n=pOe({type:"bytes",name:""},t);return{result:r$(n.result),encoded:n.encoded,consumed:n.consumed}}function mOe(e){let t=0,n=0;const r=[],s=[];for(const a of e)a.dynamic?t+=Zo:t+=a.encoded.length;for(const a of e)a.dynamic?(r.push(rT({type:"uint256",name:""},t+n)),s.push(a),n+=a.encoded.length):r.push(a);return dd(...r.map(a=>a.encoded),...s.map(a=>a.encoded))}function L_t(e,t){if(!Array.isArray(t))throw new Wi("Expected value to be array",{abi:e,values:t});const{size:n,param:r}=Toe(e),s=t.map(l=>Oee(r,l)),a=n===-1,o=s.length>0&&s[0].dynamic;if(!a&&t.length!==n)throw new Wi("Given arguments count doesn't match array length",{arrayLength:n,argumentsLength:t.length});if(a||o){const l=mOe(s);if(a){const c=rT({type:"uint256",name:""},s.length).encoded;return{dynamic:!0,encoded:s.length>0?dd(c,l):c}}return{dynamic:!0,encoded:l}}return{dynamic:!1,encoded:dd(...s.map(l=>l.encoded))}}function D_t(e,t){let{size:n,param:r}=Toe(e);const s=n===-1;let a=0;const o=[];let l=t;if(s){const u=uN({type:"uint32",name:""},t);n=Number(u.result),a=u.consumed,l=u.encoded}if(gR(r)){for(let u=0;u<n;u+=1){const d=uN({type:"uint32",name:""},l.subarray(u*Zo));a+=d.consumed;const f=bR(r,l.subarray(Number(d.result)));a+=f.consumed,o.push(f.result)}return{result:o,encoded:l.subarray(a),consumed:a}}for(let u=0;u<n;u+=1){const d=bR(r,t.subarray(a));a+=d.consumed,o.push(d.result)}return{result:o,encoded:t.subarray(a),consumed:a}}function Oee(e,t){if(e.type==="string")return M_t(e,t);if(e.type==="bool")return P_t(e,t);if(e.type==="address")return __t(e,t);if(e.type==="tuple")return Ioe(e,t);if(e.type.endsWith("]"))return L_t(e,t);if(e.type.startsWith("bytes"))return hOe(e,t);if(e.type.startsWith("uint")||e.type.startsWith("int"))return rT(e,t);throw new Wi("Unsupported",{param:e,value:t})}function bR(e,t){if(e.type==="string")return R_t(e,t);if(e.type==="bool")return F_t(e,t);if(e.type==="address")return k_t(e,t);if(e.type==="tuple")return xOe(e,t);if(e.type.endsWith("]"))return D_t(e,t);if(e.type.startsWith("bytes"))return pOe(e,t);if(e.type.startsWith("uint")||e.type.startsWith("int"))return uN(e,t);throw new Wi("Unsupported",{param:e,bytes:t})}function Ioe(e,t){var n,r,s;let a=!1;if(!Array.isArray(t)&&typeof t!="object")throw new Wi("param must be either Array or Object",{param:e,input:t});const o=t,l=[];for(let c=0;c<((r=(n=e.components)===null||n===void 0?void 0:n.length)!==null&&r!==void 0?r:0);c+=1){const u=e.components[c];let d;if(Array.isArray(o)){if(c>=o.length)throw new Wi("input param length missmatch",{param:e,input:t});d=Oee(u,o[c])}else{const f=o[(s=u.name)!==null&&s!==void 0?s:""];if(f==null)throw new Wi("missing input defined in abi",{param:e,input:t,paramName:u.name});d=Oee(u,f)}d.dynamic&&(a=!0),l.push(d)}return a?{dynamic:!0,encoded:mOe(l)}:{dynamic:!1,encoded:dd(...l.map(c=>c.encoded))}}function xOe(e,t){const n={__length__:0};let r=0;if(!e.components)return{result:n,encoded:t,consumed:r};let s=0;for(const[a,o]of e.components.entries()){let l;if(gR(o)){const c=uN({type:"uint32",name:""},t.subarray(r));l=bR(o,t.subarray(Number(c.result))),r+=c.consumed,s+=l.consumed}else l=bR(o,t.subarray(r)),r+=l.consumed;n.__length__+=1,n[a]=l.result,o.name&&o.name!==""&&(n[o.name]=l.result)}return{encoded:t.subarray(r+s),result:n,consumed:r+s}}function B_t(e,t,n){const r=cOe(e),s=u5(t);return xOe({type:"tuple",name:"",components:r},s).result}function gOe(e){const t=[];return e.forEach(n=>{if(Array.isArray(n)){const r=gOe(n);t.push({type:"tuple",components:r,name:""})}else t.push({type:c1(n,!0)})}),t}function x$(e,t){if((e==null?void 0:e.length)!==t.length)throw new Wi("Invalid number of values received for given ABI",{expected:e==null?void 0:e.length,received:t.length});const n=cOe(e);return y1(Ioe({type:"tuple",name:"",components:n},t).encoded)}function $_t(e){try{const t=gOe(e);return y1(Ioe({type:"tuple",name:"",components:t},e).encoded)}catch{throw new Wi("Could not infer types from given params",{params:e})}}const Mee=(e,t)=>x$([e],[t]),bOe=(e,t,n)=>{try{if(e.length>0&&(!t||t==="0x"||t==="0X"))throw new Wi("Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.");return B_t(e,`0x${t.replace(/0x/i,"")}`,n)}catch(r){throw new Wi(`Parameter decoding error: ${r.message}`,{internalErr:r})}},Jw=(e,t)=>bOe(e,t,!1),yOe=(e,t)=>Jw([e],t)[0],UE=e=>{if(typeof e!="string"&&!m$(e))throw new Wi("Invalid parameter value in encodeFunctionSignature");let t;return e&&(typeof e=="function"||typeof e=="object")?t=Ug(e):t=e,zf(t).slice(0,10)},U_t=(e,t)=>{var n;if(!m$(e))throw new Wi("Invalid parameter value in encodeFunctionCall");return`${UE(e)}${x$((n=e.inputs)!==null&&n!==void 0?n:[],t??[]).replace("0x","")}`},Ree=(e,t,n=!0)=>{const r=n&&t&&t.length>=10&&t.startsWith("0x")?t.slice(10):t;if(!e.inputs)throw new ad("No inputs found in the ABI");const s=Jw([...e.inputs],r);return Object.assign(Object.assign({},s),{__method__:Ug(e)})},z_t=(e,t)=>{if(e.type==="constructor")return t;if(!t)return null;const n=t.length>=2?t.slice(2):t;if(!e.outputs)return null;const r=Jw([...e.outputs],n);return r.__length__===1?r[0]:r},H_t=["bool","string","int","uint","address","fixed","ufixed"],V_t=(e,t)=>e==="string"?t:yOe(e,t),vOe=(e,t,n)=>{const r=Array.isArray(n)?n:[n],s={},a={};for(const[x,g]of e.entries())g.indexed?s[x]=g:a[x]=g;const o=t?bOe(Object.values(a),t,!0):{__length__:0},l=r.length-Object.keys(s).length,c=Object.values(s).map((x,g)=>H_t.some(v=>x.type.startsWith(v))?V_t(x.type,r[g+l]):r[g+l]),u={__length__:0};let d=0,f=0;for(const[x,g]of e.entries())u[x]=g.type==="string"?"":void 0,s[x]&&(u[x]=c[d],d+=1),a[x]&&(u[x]=o[String(f)],f+=1),g.name&&(u[g.name]=u[x]),u.__length__+=1;return u},pO=(e,t)=>{if(t!=null&&t.data){let n,r,s;try{const a=t.data.slice(0,10),o=e.find(l=>u_t(l).startsWith(a));o!=null&&o.inputs?(n=o.name,r=Ug(o),s=Jw([...o.inputs],t.data.substring(10))):t.data.startsWith("0x08c379a0")?(n="Error",r="Error(string)",s=Jw([{name:"message",type:"string"}],t.data.substring(10))):t.data.startsWith("0x4e487b71")?(n="Panic",r="Panic(uint256)",s=Jw([{name:"code",type:"uint256"}],t.data.substring(10))):console.error("No matching error abi found for error data",t.data)}catch(a){console.error(a)}n&&t.setDecodedProperties(n,r,s)}};var W_t=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const q_t=(e,t)=>{var n,r,s,a,o;if(e instanceof Yw&&e.cause instanceof KB){if(t!==void 0){const l=t.filter(c=>p$(c));return pO(l,e.cause),{reason:e.cause.message,signature:(n=e.cause.data)===null||n===void 0?void 0:n.slice(0,10),data:(r=e.cause.data)===null||r===void 0?void 0:r.substring(10),customErrorName:e.cause.errorName,customErrorDecodedSignature:e.cause.errorSignature,customErrorArguments:e.cause.errorArgs}}return{reason:e.cause.message,signature:(s=e.cause.data)===null||s===void 0?void 0:s.slice(0,10),data:(a=e.cause.data)===null||a===void 0?void 0:a.substring(10)}}if(e instanceof YB&&!Array.isArray((o=e.cause)===null||o===void 0?void 0:o.errors)&&e.cause!==void 0)return e.cause.message;throw e};function wOe(e,t,n){return W_t(this,arguments,void 0,function*(r,s,a,o=r.defaultReturnFormat){try{yield Moe(r,s,r.defaultBlock,o);return}catch(l){return q_t(l,a)}})}var G_t=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function SV(e,t,n,r,s,a){return G_t(this,void 0,void 0,function*(){let o=a;o===void 0&&e.handleRevert&&t!==void 0&&(o=yield wOe(e,t,s));let l;if(o===void 0)l=new uPe(n);else if(typeof o=="string")l=new GM(o,void 0,n);else if(o.customErrorName!==void 0&&o.customErrorDecodedSignature!==void 0&&o.customErrorArguments!==void 0){const c=o;l=new cPe(c.reason,c.customErrorName,c.customErrorDecodedSignature,c.customErrorArguments,c.signature,n,c.data)}else l=new GM(o.reason,o.signature,n,o.data);return l})}const Poe=(e,t,n,r=id)=>{var s,a,o,l,c,u;let d=Object.assign({},e);const f=Ur(LA,t,r);if([cN,"allEvents"].includes(d.name)){const g=n.find(v=>v.signature===t.topics[0]);g?d=g:d={anonymous:!0}}if(d.inputs=(a=(s=d.inputs)!==null&&s!==void 0?s:e.inputs)!==null&&a!==void 0?a:[],!d.anonymous){let g=0;((o=d.inputs)!==null&&o!==void 0?o:[]).forEach(v=>{v.indexed&&(g+=1)}),g>0&&(t!=null&&t.topics)&&(t==null?void 0:t.topics.length)!==g+1&&(d=Object.assign(Object.assign({},d),{anonymous:!0,inputs:[]}))}const x=d.anonymous?t.topics:((l=t.topics)!==null&&l!==void 0?l:[]).slice(1);return Object.assign(Object.assign({},f),{returnValues:vOe([...(c=d.inputs)!==null&&c!==void 0?c:[]],t.data,x),event:d.name,signature:!d.anonymous&&((u=t.topics)===null||u===void 0?void 0:u.length)>0&&t.topics[0]?t.topics[0]:void 0,raw:{data:t.data,topics:t.topics}})};var iv=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class COe{constructor({options:t,web3Context:n,promiEvent:r,returnFormat:s}){this.options={checkRevertBeforeSending:!0},this.options=t,this.web3Context=n,this.promiEvent=r,this.returnFormat=s}getReceiptWithEvents(t){var n,r;const s=Object.assign({},t??{});if(!((n=this.options)===null||n===void 0)&&n.contractAbi&&s.logs&&s.logs.length>0){s.events={};for(const a of s.logs){const o=Poe(_ee,a,(r=this.options)===null||r===void 0?void 0:r.contractAbi,this.returnFormat);o.event&&(s.events[o.event]=o)}}return s}checkRevertBeforeSending(t){return iv(this,void 0,void 0,function*(){if(this.options.checkRevertBeforeSending!==!1){let n=t;ar(t.data)&&ar(t.input)&&ar(t.gas)&&(n=Object.assign(Object.assign({},t),{gas:21e3}));const r=yield wOe(this.web3Context,n,this.options.contractAbi);if(r!==void 0)throw yield SV(this.web3Context,t,void 0,void 0,this.options.contractAbi,r)}})}emitSending(t){this.promiEvent.listenerCount("sending")>0&&this.promiEvent.emit("sending",t)}populateGasPrice(t){return iv(this,arguments,void 0,function*({transactionFormatted:n,transaction:r}){var s;let a=n;return!this.web3Context.config.ignoreGasPricing&&!(!((s=this.options)===null||s===void 0)&&s.ignoreGasPricing)&&ar(n.gasPrice)&&(ar(r.maxPriorityFeePerGas)||ar(r.maxFeePerGas))&&(a=Object.assign(Object.assign({},n),yield YFe(n,this.web3Context,ui))),a})}signAndSend(t){return iv(this,arguments,void 0,function*({wallet:n,tx:r}){if(n){const s=yield n.signTransaction(r);return Iee(this.web3Context,()=>iv(this,void 0,void 0,function*(){return HFe(this.web3Context.requestManager,s.rawTransaction)}),s.transactionHash)}return Iee(this.web3Context,()=>iv(this,void 0,void 0,function*(){return J9t(this.web3Context.requestManager,r)}))})}emitSent(t){this.promiEvent.listenerCount("sent")>0&&this.promiEvent.emit("sent",t)}emitTransactionHash(t){this.promiEvent.listenerCount("transactionHash")>0&&this.promiEvent.emit("transactionHash",t)}emitReceipt(t){this.promiEvent.listenerCount("receipt")>0&&this.promiEvent.emit("receipt",t)}handleError(t){return iv(this,arguments,void 0,function*({error:n,tx:r}){var s;let a=n;return a instanceof Yw&&this.web3Context.handleRevert&&(a=yield SV(this.web3Context,r,void 0,void 0,(s=this.options)===null||s===void 0?void 0:s.contractAbi)),(a instanceof YB||a instanceof Yw||a instanceof cPe||a instanceof uPe||a instanceof GM||a instanceof pPe)&&this.promiEvent.listenerCount("error")>0&&this.promiEvent.emit("error",a),a})}emitConfirmation({receipt:t,transactionHash:n,customTransactionReceiptSchema:r}){this.promiEvent.listenerCount("confirmation")>0&&o_t(this.web3Context,this.promiEvent,t,n,this.returnFormat,r)}handleResolve(t){return iv(this,arguments,void 0,function*({receipt:n,tx:r}){var s,a,o;if(!((s=this.options)===null||s===void 0)&&s.transactionResolver)return(a=this.options)===null||a===void 0?void 0:a.transactionResolver(n);if(n.status===BigInt(0)){const l=yield SV(this.web3Context,r,n,void 0,(o=this.options)===null||o===void 0?void 0:o.contractAbi);throw this.promiEvent.listenerCount("error")>0&&this.promiEvent.emit("error",l),l}else return n})}}var Fa=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},K_t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n};const Y_t=e=>Fa(void 0,void 0,void 0,function*(){return zFe(e.requestManager)});function X_t(e,t){return Fa(this,void 0,void 0,function*(){const n=yield D9t(e.requestManager);return Ur({format:"uint"},n,t??e.defaultReturnFormat)})}function Foe(e,t){return Fa(this,void 0,void 0,function*(){const n=yield B9t(e.requestManager);return Ur({format:"uint"},n,t??e.defaultReturnFormat)})}function Q_t(e,t){return Fa(this,void 0,void 0,function*(){const n=yield $9t(e.requestManager);return Ur({format:"uint"},n,t??e.defaultReturnFormat)})}function Ooe(e,t){return Fa(this,void 0,void 0,function*(){const n=yield z9t(e.requestManager);return Ur({format:"uint"},n,t??e.defaultReturnFormat)})}function Z_t(e,t){return Fa(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a){const o=Tc(s)?s:Ur({format:"uint"},s,ui),l=yield H9t(n.requestManager,r,o);return Ur({format:"uint"},l,a??n.defaultReturnFormat)})}function J_t(e,t,n){return Fa(this,arguments,void 0,function*(r,s,a,o=r.defaultBlock,l){const c=Ur({format:"uint"},a,ui),u=Tc(o)?o:Ur({format:"uint"},o,ui),d=yield V9t(r.requestManager,s,c,u);return Ur({format:"bytes"},d,l??r.defaultReturnFormat)})}function ekt(e,t){return Fa(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a){const o=Tc(s)?s:Ur({format:"uint"},s,ui),l=yield X9t(n.requestManager,r,o);return Ur({format:"bytes"},l,a??n.defaultReturnFormat)})}function SOe(e){return Fa(this,arguments,void 0,function*(t,n=t.defaultBlock,r=!1,s){var a;let o;if(i2(n)){const c=Ur({format:"bytes32"},n,ui);o=yield nEt(t.requestManager,c,r)}else{const c=Tc(n)?n:Ur({format:"uint"},n,ui);o=yield VFe(t.requestManager,c,r)}const l=Ur(mR,o,s??t.defaultReturnFormat);return ar(l)?l:Object.assign(Object.assign({},l),{transactions:(a=l.transactions)!==null&&a!==void 0?a:[]})})}function tkt(e){return Fa(this,arguments,void 0,function*(t,n=t.defaultBlock,r){let s;if(i2(n)){const a=Ur({format:"bytes32"},n,ui);s=yield q9t(t.requestManager,a)}else{const a=Tc(n)?n:Ur({format:"uint"},n,ui);s=yield G9t(t.requestManager,a)}return Ur({format:"uint"},s,r??t.defaultReturnFormat)})}function nkt(e){return Fa(this,arguments,void 0,function*(t,n=t.defaultBlock,r){let s;if(i2(n)){const a=Ur({format:"bytes32"},n,ui);s=yield K9t(t.requestManager,a)}else{const a=Tc(n)?n:Ur({format:"uint"},n,ui);s=yield Y9t(t.requestManager,a)}return Ur({format:"uint"},s,r??t.defaultReturnFormat)})}function rkt(e){return Fa(this,arguments,void 0,function*(t,n=t.defaultBlock,r,s){const a=Ur({format:"uint"},r,ui);let o;if(i2(n)){const l=Ur({format:"bytes32"},n,ui);o=yield oEt(t.requestManager,l,a)}else{const l=Tc(n)?n:Ur({format:"uint"},n,ui);o=yield lEt(t.requestManager,l,a)}return Ur(mR,o,s??t.defaultReturnFormat)})}function skt(e,t){return Fa(this,arguments,void 0,function*(n,r,s=n.defaultReturnFormat){const a=Ur({format:"bytes32"},r,id),o=yield rEt(n.requestManager,a);return ar(o)?o:tf(o,s,{transactionSchema:n.config.customTransactionSchema,fillInputAndData:!0})})}function ikt(e,t){return Fa(this,void 0,void 0,function*(){return(yield yEt(e.requestManager)).map(r=>tf(r,t??e.defaultReturnFormat,{transactionSchema:e.config.customTransactionSchema,fillInputAndData:!0}))})}function akt(e){return Fa(this,arguments,void 0,function*(t,n=t.defaultBlock,r,s){const a=Ur({format:"uint"},r,ui);let o;if(i2(n)){const l=Ur({format:"bytes32"},n,ui);o=yield sEt(t.requestManager,l,a)}else{const l=Tc(n)?n:Ur({format:"uint"},n,ui);o=yield iEt(t.requestManager,l,a)}return ar(o)?o:tf(o,s??t.defaultReturnFormat,{transactionSchema:t.config.customTransactionSchema,fillInputAndData:!0})})}function NOe(e,t,n){return Fa(this,void 0,void 0,function*(){const r=Ur({format:"bytes32"},t,id);let s;try{s=yield aEt(e.requestManager,r)}catch(a){if(typeof a=="object"&&!ar(a)&&"message"in a&&a.message==="transaction indexing is in progress")console.warn("Transaction indexing is in progress.");else throw a}return ar(s)?s:Ur(DA,s,n??e.defaultReturnFormat)})}function AOe(e,t){return Fa(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a){const o=Tc(s)?s:Ur({format:"uint"},s,ui),l=yield W9t(n.requestManager,r,o);return Ur({format:"uint"},l,a??n.defaultReturnFormat)})}function zE(e,t,n,r={checkRevertBeforeSending:!0},s){const a=new UFe((o,l)=>{setImmediate(()=>{Fa(this,void 0,void 0,function*(){const c=new COe({web3Context:e,promiEvent:a,options:r,returnFormat:n});let u=Object.assign({},t);ar(s)||(u=yield s.processTransaction(u));let d=tf(Object.assign(Object.assign({},u),{from:kee("from",e,u),to:kee("to",e,u)}),ui,{transactionSchema:e.config.customTransactionSchema});try{d=yield c.populateGasPrice({transaction:u,transactionFormatted:d}),yield c.checkRevertBeforeSending(d),c.emitSending(d);let f;e.wallet&&!ar(d.from)&&(f=e.wallet.get(d.from));const x=yield c.signAndSend({wallet:f,tx:d}),g=Ur({format:"bytes32"},x,n??e.defaultReturnFormat);c.emitSent(d),c.emitTransactionHash(g);const v=yield ZFe(e,x,n??e.defaultReturnFormat),w=c.getReceiptWithEvents(Ur(DA,v,n??e.defaultReturnFormat));c.emitReceipt(w),o(yield c.handleResolve({receipt:w,tx:d})),c.emitConfirmation({receipt:w,transactionHash:x})}catch(f){l(yield c.handleError({error:f,tx:d}))}})})});return a}function okt(e,t,n,r={checkRevertBeforeSending:!0}){const s=new UFe((a,o)=>{setImmediate(()=>{Fa(this,void 0,void 0,function*(){const l=new COe({web3Context:e,promiEvent:s,options:r,returnFormat:n}),c=Ur({format:"bytes"},t,ui),u=U3.fromSerializedData(Z0(so(c))),d=Object.assign(Object.assign({},u.toJSON()),{from:u.getSenderAddress().toString()});try{const{v:f,r:x,s:g}=d,v=K_t(d,["v","r","s"]);yield l.checkRevertBeforeSending(v),l.emitSending(c);const w=yield Iee(e,()=>Fa(this,void 0,void 0,function*(){return HFe(e.requestManager,c)}));l.emitSent(c);const C=Ur({format:"bytes32"},w,n??e.defaultReturnFormat);l.emitTransactionHash(C);const N=yield ZFe(e,w,n??e.defaultReturnFormat),I=l.getReceiptWithEvents(Ur(DA,N,n??e.defaultReturnFormat));l.emitReceipt(I),a(yield l.handleResolve({receipt:I,tx:d})),l.emitConfirmation({receipt:I,transactionHash:w})}catch(f){o(yield l.handleError({error:f,tx:d}))}})})});return s}function lkt(e,t,n){return Fa(this,arguments,void 0,function*(r,s,a,o=r.defaultReturnFormat){var l;const c=Ur({format:"bytes"},s,id);if(!((l=r.wallet)===null||l===void 0)&&l.get(a)){const f=r.wallet.get(a).sign(c);return Ur(qEt,f,o)}if(typeof a=="number")throw new uNt(s,'RPC method "eth_sign" does not support index signatures');const u=yield Q9t(r.requestManager,a,c);return Ur({format:"bytes"},u,o)})}function ckt(e,t){return Fa(this,arguments,void 0,function*(n,r,s=n.defaultReturnFormat){const a=yield Z9t(n.requestManager,tf(r,ui,{transactionSchema:n.config.customTransactionSchema}));return Kae(a)?XEt(a,s,{fillInputAndData:!0}):{raw:Ur({format:"bytes"},a.raw,s),tx:tf(a.tx,s,{transactionSchema:n.config.customTransactionSchema,fillInputAndData:!0})}})}function Moe(e,t){return Fa(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a=n.defaultReturnFormat){const o=Tc(s)?s:Ur({format:"uint"},s,ui),l=yield eEt(n.requestManager,tf(r,ui,{transactionSchema:n.config.customTransactionSchema}),o);return Ur({format:"bytes"},l,a)})}function Roe(e,t){return Fa(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a){const o=tf(r,ui,{transactionSchema:n.config.customTransactionSchema}),l=Tc(s)?s:Ur({format:"uint"},s,ui),c=yield tEt(n.requestManager,o,l);return Ur({format:"uint"},c,a??n.defaultReturnFormat)})}function jOe(e,t,n){return Fa(this,void 0,void 0,function*(){let{toBlock:r,fromBlock:s}=t;ar(r)||(typeof r=="number"||typeof r=="bigint")&&(r=Yl(r)),ar(s)||(typeof s=="number"||typeof s=="bigint")&&(s=Yl(s));const a=Object.assign(Object.assign({},t),{fromBlock:s,toBlock:r});return(yield mEt(e.requestManager,a)).map(c=>typeof c=="string"?c:Ur(LA,c,n??e.defaultReturnFormat))})}function EOe(e,t){return Fa(this,void 0,void 0,function*(){const n=yield wEt(e.requestManager);return Ur({format:"uint"},n,t??e.defaultReturnFormat)})}function ukt(e,t,n){return Fa(this,arguments,void 0,function*(r,s,a,o=r.defaultBlock,l){const c=a.map(f=>Ur({format:"bytes"},f,ui)),u=Tc(o)?o:Ur({format:"uint"},o,ui),d=yield CEt(r.requestManager,s,c,u);return Ur(YEt,d,l??r.defaultReturnFormat)})}function dkt(e,t){return Fa(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a,o){const l=Ur({format:"uint"},r,ui),c=Tc(s)?s:Ur({format:"uint"},s,ui),u=Ur({type:"array",items:{format:"uint"}},a,h$),d=yield bEt(n.requestManager,l,c,u);return Ur(GEt,d,o??n.defaultReturnFormat)})}function _Oe(e,t){return Fa(this,arguments,void 0,function*(n,r,s=n.defaultBlock,a){const o=Tc(s)?s:Ur({format:"uint"},s,ui),l=yield NEt(n.requestManager,tf(r,ui,{transactionSchema:n.config.customTransactionSchema}),o);return Ur(zEt,l,a??n.defaultReturnFormat)})}function fkt(e,t,n,r,s){return Fa(this,void 0,void 0,function*(){const a=yield AEt(e.requestManager,t,n,r);return Ur({format:"bytes"},a,s??e.defaultReturnFormat)})}var BA=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};function hkt(e,t){return BA(this,void 0,void 0,function*(){const n=yield dEt(e.requestManager);return Ur({format:"uint"},n,t??e.defaultReturnFormat)})}function pkt(e,t,n){return BA(this,void 0,void 0,function*(){let{toBlock:r,fromBlock:s}=t;ar(r)||(typeof r=="number"||typeof r=="bigint")&&(r=Yl(r)),ar(s)||(typeof s=="number"||typeof s=="bigint")&&(s=Yl(s));const a=Object.assign(Object.assign({},t),{fromBlock:s,toBlock:r}),o=yield cEt(e.requestManager,a);return Ur({format:"uint"},o,n??e.defaultReturnFormat)})}function mkt(e,t){return BA(this,void 0,void 0,function*(){const n=yield uEt(e.requestManager);return Ur({format:"uint"},n,t??e.defaultReturnFormat)})}function xkt(e,t){return BA(this,void 0,void 0,function*(){return yield fEt(e.requestManager,Yl(t))})}function gkt(e,t,n){return BA(this,void 0,void 0,function*(){return(yield hEt(e.requestManager,Yl(t))).map(a=>typeof a=="string"?a:Ur(LA,a,n??e.defaultReturnFormat))})}function bkt(e,t,n){return BA(this,void 0,void 0,function*(){return(yield pEt(e.requestManager,Yl(t))).map(a=>typeof a=="string"?a:Ur(LA,a,n??e.defaultReturnFormat))})}class kOe extends eT{_buildSubscriptionParams(){return["logs",this.args]}formatSubscriptionResult(t){return Ur(LA,t,super.returnFormat)}}class Mge extends eT{_buildSubscriptionParams(){return["newPendingTransactions"]}formatSubscriptionResult(t){return Ur({format:"string"},t,super.returnFormat)}}class yR extends eT{_buildSubscriptionParams(){return["newHeads"]}formatSubscriptionResult(t){return Ur(VEt,t,super.returnFormat)}}class TOe extends eT{_buildSubscriptionParams(){return["syncing"]}_processSubscriptionResult(t){if(typeof t=="boolean")this.emit("changed",t);else{const n=Object.fromEntries(Object.entries((t==null?void 0:t.status)||t).map(([r,s])=>[r.charAt(0).toLowerCase()+r.substring(1),s]));this.emit("changed",t.syncing),this.emit("data",Ur(WEt,n,super.returnFormat))}}}var pi=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const Lee={logs:kOe,newPendingTransactions:Mge,newHeads:yR,syncing:TOe,pendingTransactions:Mge,newBlockHeaders:yR};class g$ extends Vd{constructor(t){if(typeof t=="string"||uR(t)){super({provider:t,registeredSubscriptions:Lee});return}if(t.registeredSubscriptions){super(t);return}super(Object.assign(Object.assign({},t),{registeredSubscriptions:Lee})),this.getFeeData=this.calculateFeeData}setTransactionMiddleware(t){this.transactionMiddleware=t}getTransactionMiddleware(){return this.transactionMiddleware}getProtocolVersion(){return pi(this,void 0,void 0,function*(){return M9t(this.requestManager)})}isSyncing(){return pi(this,void 0,void 0,function*(){return zFe(this.requestManager)})}getCoinbase(){return pi(this,void 0,void 0,function*(){return R9t(this.requestManager)})}isMining(){return pi(this,void 0,void 0,function*(){return L9t(this.requestManager)})}getHashrate(t){return pi(this,void 0,void 0,function*(){var n;return t===void 0&&(t=(n=this.defaultReturnFormat)!==null&&n!==void 0?n:id),this.getHashRate(t)})}getHashRate(){return pi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return X_t(this,t)})}getGasPrice(){return pi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return Foe(this,t)})}getMaxPriorityFeePerGas(){return pi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return Q_t(this,t)})}calculateFeeData(){return pi(this,arguments,void 0,function*(t=BigInt(2),n=n$.Gwei){var r;const s=yield this.getBlock(void 0,!1),a=(r=s==null?void 0:s.baseFeePerGas)!==null&&r!==void 0?r:void 0;let o;try{o=yield this.getGasPrice()}catch{}let l;try{l=yield this.getMaxPriorityFeePerGas()}catch{}let c;if(a){l=l??n;let u;typeof t=="number"?u=BigInt(Math.floor(t*1e3))/BigInt(1e3):u=t,c=a*u+l}return{gasPrice:o,maxFeePerGas:c,maxPriorityFeePerGas:l,baseFeePerGas:a}})}getAccounts(){return pi(this,void 0,void 0,function*(){var t;return((t=yield U9t(this.requestManager))!==null&&t!==void 0?t:[]).map(r=>ox(r))})}getBlockNumber(){return pi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return Ooe(this,t)})}getBalance(t){return pi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return Z_t(this,n,r,s)})}getStorageAt(t,n){return pi(this,arguments,void 0,function*(r,s,a=this.defaultBlock,o=this.defaultReturnFormat){return J_t(this,r,s,a,o)})}getCode(t){return pi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return ekt(this,n,r,s)})}getBlock(){return pi(this,arguments,void 0,function*(t=this.defaultBlock,n=!1,r=this.defaultReturnFormat){return SOe(this,t,n,r)})}getBlockTransactionCount(){return pi(this,arguments,void 0,function*(t=this.defaultBlock,n=this.defaultReturnFormat){return tkt(this,t,n)})}getBlockUncleCount(){return pi(this,arguments,void 0,function*(t=this.defaultBlock,n=this.defaultReturnFormat){return nkt(this,t,n)})}getUncle(){return pi(this,arguments,void 0,function*(t=this.defaultBlock,n,r=this.defaultReturnFormat){return rkt(this,t,n,r)})}getTransaction(t){return pi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){const s=yield skt(this,n,r);if(!s)throw new $xe;return s})}getPendingTransactions(){return pi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return ikt(this,t)})}getTransactionFromBlock(){return pi(this,arguments,void 0,function*(t=this.defaultBlock,n,r=this.defaultReturnFormat){return akt(this,t,n,r)})}getTransactionReceipt(t){return pi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){const s=yield NOe(this,n,r);if(!s)throw new $xe;return s})}getTransactionCount(t){return pi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return AOe(this,n,r,s)})}sendTransaction(t,n=this.defaultReturnFormat,r){return zE(this,t,n,r,this.transactionMiddleware)}sendSignedTransaction(t,n=this.defaultReturnFormat,r){return okt(this,t,n,r)}sign(t,n){return pi(this,arguments,void 0,function*(r,s,a=this.defaultReturnFormat){return lkt(this,r,s,a)})}signTransaction(t){return pi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return ckt(this,n,r)})}call(t){return pi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return Moe(this,n,r,s)})}estimateGas(t){return pi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return Roe(this,n,r,s)})}getPastLogs(t){return pi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return jOe(this,n,r)})}getWork(){return pi(this,void 0,void 0,function*(){return xEt(this.requestManager)})}submitWork(t,n,r){return pi(this,void 0,void 0,function*(){return gEt(this.requestManager,t,n,r)})}requestAccounts(){return pi(this,void 0,void 0,function*(){return vEt(this.requestManager)})}getChainId(){return pi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return EOe(this,t)})}getNodeInfo(){return pi(this,void 0,void 0,function*(){return SEt(this.requestManager)})}getProof(t,n){return pi(this,arguments,void 0,function*(r,s,a=this.defaultBlock,o=this.defaultReturnFormat){return ukt(this,r,s,a,o)})}getFeeHistory(t){return pi(this,arguments,void 0,function*(n,r=this.defaultBlock,s,a=this.defaultReturnFormat){return dkt(this,n,r,s,a)})}createAccessList(t){return pi(this,arguments,void 0,function*(n,r=this.defaultBlock,s=this.defaultReturnFormat){return _Oe(this,n,r,s)})}signTypedData(t,n,r,s){return pi(this,void 0,void 0,function*(){var a;return r===void 0&&(r=!1),s===void 0&&(s=(a=this.defaultReturnFormat)!==null&&a!==void 0?a:id),fkt(this,t,n,r,s)})}subscribe(t,n,r){return pi(this,void 0,void 0,function*(){var s,a;r===void 0&&(r=(s=this.defaultReturnFormat)!==null&&s!==void 0?s:id);const o=yield(a=this.subscriptionManager)===null||a===void 0?void 0:a.subscribe(t,n,r);return o instanceof kOe&&t==="logs"&&typeof n=="object"&&!Xs(n.fromBlock)&&Number.isFinite(Number(n.fromBlock))&&setImmediate(()=>{this.getPastLogs(n).then(l=>{for(const c of l)o._processSubscriptionResult(c)}).catch(l=>{o._processSubscriptionError(l)})}),o})}static shouldClearSubscription({sub:t}){return!(t instanceof TOe)}clearSubscriptions(t=!1){var n;return(n=this.subscriptionManager)===null||n===void 0?void 0:n.unsubscribe(t?g$.shouldClearSubscription:void 0)}createNewPendingTransactionFilter(){return pi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return hkt(this,t)})}createNewFilter(t){return pi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return pkt(this,n,r)})}createNewBlockFilter(){return pi(this,arguments,void 0,function*(t=this.defaultReturnFormat){return mkt(this,t)})}uninstallFilter(t){return pi(this,void 0,void 0,function*(){return xkt(this,t)})}getFilterChanges(t){return pi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return gkt(this,n,r)})}getFilterLogs(t){return pi(this,arguments,void 0,function*(n,r=this.defaultReturnFormat){return bkt(this,n,r)})}}const ykt=e=>{if(!ar(e.common)){if(ar(e.common.customChain))throw new pNt;if(ar(e.common.customChain.chainId))throw new mNt;if(!ar(e.chainId)&&e.chainId!==e.common.customChain.chainId)throw new xNt({txChainId:e.chainId,customChainId:e.common.customChain.chainId})}},vkt=e=>{if(!ar(e.common)&&!ar(e.chain)&&!ar(e.hardfork))throw new yNt;if(!ar(e.chain)&&ar(e.hardfork)||!ar(e.hardfork)&&ar(e.chain))throw new vNt({chain:e.chain,hardfork:e.hardfork})},wkt=e=>{if(!ar(e.common)&&!ar(e.common.baseChain)&&!ar(e.chain)&&e.chain!==e.common.baseChain)throw new gNt({txChain:e.chain,baseChain:e.common.baseChain})},Ckt=e=>{if(!ar(e.common)&&!ar(e.common.hardfork)&&!ar(e.hardfork)&&e.hardfork!==e.common.hardfork)throw new bNt({txHardfork:e.hardfork,commonHardfork:e.common.hardfork})},Rge=e=>{if(ar(e.gas)||!l1(e.gas)||ar(e.gasPrice)||!l1(e.gasPrice))throw new ANt({gas:e.gas,gasPrice:e.gasPrice});if(!ar(e.maxFeePerGas)||!ar(e.maxPriorityFeePerGas))throw new dPe({maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas})},Lge=e=>{if(!ar(e.gasPrice)&&e.type==="0x2")throw new ENt(e.gasPrice);if(e.type==="0x0"||e.type==="0x1")throw new dPe({maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas});if(ar(e.maxFeePerGas)||!l1(e.maxFeePerGas)||ar(e.maxPriorityFeePerGas)||!l1(e.maxPriorityFeePerGas))throw new jNt({maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas})},Skt=e=>{const t=!ar(e.gas)||!ar(e.gasLimit),n=t&&!ar(e.gasPrice),r=t&&!ar(e.maxPriorityFeePerGas)&&!ar(e.maxFeePerGas);if(!n&&!r)throw new CNt({gas:e.gas,gasPrice:e.gasPrice,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas});if(n&&r)throw new NNt({gas:e.gas,gasPrice:e.gasPrice,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas});(n?Rge:Lge)(e),(!ar(e.type)&&e.type>"0x1"?Lge:Rge)(e)},Nkt=(e,t,n={transactionSchema:void 0})=>{if(!ar(t)){t(e);return}if(typeof e!="object"||ar(e))throw new _Nt(e);ykt(e),vkt(e),wkt(e),Ckt(e);const r=tf(e,ui,{transactionSchema:n.transactionSchema});if(Skt(r),ar(r.nonce)||ar(r.chainId)||r.nonce.startsWith("-")||r.chainId.startsWith("-"))throw new kNt({nonce:e.nonce,chainId:e.chainId})};var Akt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const jkt=e=>{var t,n;return Object.assign(Object.assign({},e),{nonce:e.nonce,gasPrice:e.gasPrice,gasLimit:(t=e.gasLimit)!==null&&t!==void 0?t:e.gas,to:e.to,value:e.value,data:(n=e.data)!==null&&n!==void 0?n:e.input,type:e.type,chainId:e.chainId,accessList:e.accessList,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas})},Ekt=(e,t)=>{var n,r,s,a,o,l,c,u,d,f,x,g,v,w,C,N,I,P;const R=!ar(e.chain)&&!ar(e.hardfork)||!ar(e.common);let F;if(!R)t.defaultCommon?(F=Object.assign({},t.defaultCommon),ar(F.hardfork)&&(F.hardfork=(n=e.hardfork)!==null&&n!==void 0?n:t.defaultHardfork),ar(F.baseChain)&&(F.baseChain=t.defaultChain)):F=ql.custom({name:"custom-network",chainId:Hd(e.chainId),networkId:ar(e.networkId)?void 0:Hd(e.networkId),defaultHardfork:(r=e.hardfork)!==null&&r!==void 0?r:t.defaultHardfork},{baseChain:t.defaultChain});else{const U=(l=(o=(a=(s=e==null?void 0:e.common)===null||s===void 0?void 0:s.customChain)===null||a===void 0?void 0:a.name)!==null&&o!==void 0?o:e.chain)!==null&&l!==void 0?l:"custom-network",L=Hd((d=(u=(c=e==null?void 0:e.common)===null||c===void 0?void 0:c.customChain)===null||u===void 0?void 0:u.chainId)!==null&&d!==void 0?d:e==null?void 0:e.chainId),z=Hd((g=(x=(f=e==null?void 0:e.common)===null||f===void 0?void 0:f.customChain)===null||x===void 0?void 0:x.networkId)!==null&&g!==void 0?g:e==null?void 0:e.networkId),X=(C=(w=(v=e==null?void 0:e.common)===null||v===void 0?void 0:v.hardfork)!==null&&w!==void 0?w:e==null?void 0:e.hardfork)!==null&&C!==void 0?C:t.defaultHardfork,ne=(P=(I=(N=e.common)===null||N===void 0?void 0:N.baseChain)!==null&&I!==void 0?I:e.chain)!==null&&P!==void 0?P:t.defaultChain;L&&z&&U&&(F=ql.custom({name:U,chainId:L,networkId:z,defaultHardfork:X},{baseChain:ne}))}return{common:F}},_kt=(e,t,n,...r)=>Akt(void 0,[e,t,n,...r],void 0,function*(s,a,o,l=!1,c=!0){const u=yield n_t({transaction:s,web3Context:a,privateKey:o,fillGasPrice:l,fillGasLimit:c}),d=tf(u,ui,{transactionSchema:a.config.customTransactionSchema});return Nkt(d,void 0,{transactionSchema:a.config.customTransactionSchema}),U3.fromTxData(jkt(d),Ekt(d,a))}),Dge=({address:e},t,n)=>{var r,s;const a=n==null?void 0:n.topics,o=(r=n==null?void 0:n.filter)!==null&&r!==void 0?r:{},l={};if(Xs(n==null?void 0:n.fromBlock)||(l.fromBlock=Ur(mR.properties.number,n==null?void 0:n.fromBlock,{number:Vh.HEX,bytes:a1.HEX})),Xs(n==null?void 0:n.toBlock)||(l.toBlock=Ur(mR.properties.number,n==null?void 0:n.toBlock,{number:Vh.HEX,bytes:a1.HEX})),a&&Array.isArray(a))l.topics=[...a];else if(l.topics=[],t&&!t.anonymous&&![cN,"allEvents"].includes(t.name)&&l.topics.push((s=t.signature)!==null&&s!==void 0?s:_oe(Ug(t))),![cN,"allEvents"].includes(t.name)&&t.inputs)for(const c of t.inputs){if(!c.indexed)continue;const u=o[c.name];if(!u){l.topics.push(null);continue}Array.isArray(u)?l.topics.push(u.map(d=>Mee(c.type,d))):c.type==="string"?l.topics.push(rN(u)):l.topics.push(Mee(c.type,u))}return l.topics.length||delete l.topics,e&&(l.address=e.toLowerCase()),l},Zj=(e,t,n)=>{const r=Array.isArray(e.inputs)?e.inputs.length:0;if(e.inputs&&r!==t.length)throw new ad(`The number of arguments is not matching the methods required number. You need to pass ${r} arguments.`);let s;if(e.inputs?s=x$(Array.isArray(e.inputs)?e.inputs:[],t).replace("0x",""):s=$_t(t).replace("0x",""),l_t(e)){if(!n)throw new ad("The contract has no contract data option set. This is necessary to append the constructor parameters.");return n.startsWith("0x")?`${n}${s}`:`0x${n}${s}`}return`${UE(e)}${s}`};class IOe extends eT{constructor(t,n){super(t,n),this.address=t.address,this.topics=t.topics,this.abi=t.abi,this.jsonInterface=t.jsonInterface}_buildSubscriptionParams(){return["logs",{address:this.address,topics:this.topics}]}formatSubscriptionResult(t){return Poe(this.abi,t,this.jsonInterface,super.returnFormat)}}Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));const b$=(e,t,n,r)=>{var s,a;const o={};return(!Xs(e.data)||r==="both")&&(o.data=Zj(t,n,(s=e.data)!==null&&s!==void 0?s:e.input)),(!Xs(e.input)||r==="both")&&(o.input=Zj(t,n,(a=e.input)!==null&&a!==void 0?a:e.data)),Xs(o.input)&&Xs(o.data)&&(o[r]=Zj(t,n)),{data:o.data,input:o.input}},Dee=({abi:e,params:t,options:n,contractOptions:r})=>{var s,a,o;if(!((o=(a=(s=n==null?void 0:n.input)!==null&&s!==void 0?s:n==null?void 0:n.data)!==null&&a!==void 0?a:r.input)!==null&&o!==void 0?o:r.data)&&!(n!=null&&n.to)&&!r.address)throw new ad("Contract address not specified");if(!(n!=null&&n.from)&&!r.from)throw new ad('Contract "from" address not specified');let c=o2({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,maxPriorityFeePerGas:r.maxPriorityFeePerGas,maxFeePerGas:r.maxFeePerGas,data:r.data},n);const u=b$(c,e,t,n==null?void 0:n.dataInputFill);return c=Object.assign(Object.assign({},c),{data:u.data,input:u.input}),c},kkt=({abi:e,params:t,options:n,contractOptions:r})=>{if(!(n!=null&&n.to)&&!r.address)throw new ad("Contract address not specified");let s=o2({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,maxPriorityFeePerGas:r.maxPriorityFeePerGas,maxFeePerGas:r.maxFeePerGas,data:r.data},n);const a=b$(s,e,t,n==null?void 0:n.dataInputFill);return s=Object.assign(Object.assign({},s),{data:a.data,input:a.input}),s},Tkt=({abi:e,params:t,options:n,contractOptions:r})=>{let s=o2({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,data:r.data},n);const a=b$(s,e,t,n==null?void 0:n.dataInputFill);return s=Object.assign(Object.assign({},s),{data:a.data,input:a.input}),s},Bge=e=>typeof e=="object"&&!Xs(e)&&Object.keys(e).length!==0&&!uy(e),Ikt=({abi:e,params:t,options:n,contractOptions:r})=>{if(!(n!=null&&n.to)&&!r.address)throw new ad("Contract address not specified");if(!(n!=null&&n.from)&&!r.from)throw new ad('Contract "from" address not specified');let s=o2({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,maxPriorityFeePerGas:r.maxPriorityFeePerGas,maxFeePerGas:r.maxFeePerGas,data:r.data},n);const a=b$(s,e,t,n==null?void 0:n.dataInputFill);return s=Object.assign(Object.assign({},s),{data:a.data,input:a.input}),s};var Pkt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class Fkt{_contractMethodDeploySend(t){const n={transactionResolver:r=>{if(r.status===BigInt(0))throw new ad("code couldn't be stored",r);const s=this.parent.clone();return s.options.address=r.contractAddress,s},contractAbi:this.parent.options.jsonInterface,checkRevertBeforeSending:!1};return ar(this.parent.getTransactionMiddleware())?zE(this.parent,t,this.parent.defaultReturnFormat,n):zE(this.parent,t,this.parent.defaultReturnFormat,n,this.parent.getTransactionMiddleware())}constructor(t,n){this.parent=t,this.deployOptions=n;const{args:r,abi:s,contractOptions:a,deployData:o}=this.calculateDeployParams();this.args=r,this.constructorAbi=s,this.contractOptions=a,this.deployData=o}send(t){const n=Object.assign({},t),r=this.populateTransaction(n);return this._contractMethodDeploySend(r)}populateTransaction(t){var n,r;const s=Object.assign(Object.assign({},this.contractOptions),{from:(r=(n=this.contractOptions.from)!==null&&n!==void 0?n:this.parent.defaultAccount)!==null&&r!==void 0?r:void 0}),a=Dee({abi:this.constructorAbi,params:this.args,options:Object.assign(Object.assign({},t),{dataInputFill:this.parent.contractDataInputFill}),contractOptions:s});return a.dataInputFill&&delete a.dataInputFill,a}calculateDeployParams(){var t,n,r,s,a,o;let l=this.parent.options.jsonInterface.find(g=>g.type==="constructor");l||(l={type:"constructor",stateMutability:""});const c=Ur({format:"bytes"},(n=(t=this.deployOptions)===null||t===void 0?void 0:t.input)!==null&&n!==void 0?n:this.parent.options.input,id),u=Ur({format:"bytes"},(s=(r=this.deployOptions)===null||r===void 0?void 0:r.data)!==null&&s!==void 0?s:this.parent.options.data,id);if((!c||c.trim()==="0x")&&(!u||u.trim()==="0x"))throw new ad("contract creation without any data provided.");const d=(o=(a=this.deployOptions)===null||a===void 0?void 0:a.arguments)!==null&&o!==void 0?o:[],f=Object.assign(Object.assign({},this.parent.options),{input:c,data:u});return{args:d,abi:l,contractOptions:f,deployData:c??u}}estimateGas(t){return Pkt(this,arguments,void 0,function*(n,r=this.parent.defaultReturnFormat){const s=Object.assign({},n);return this.parent.contractMethodEstimateGas({abi:this.constructorAbi,params:this.args,returnFormat:r,options:s,contractOptions:this.contractOptions})})}encodeABI(){return Zj(this.constructorAbi,this.args,Ur({format:"bytes"},this.deployData,this.parent.defaultReturnFormat))}decodeData(t){return Object.assign(Object.assign({},Ree(this.constructorAbi,t.replace(this.deployData,""),!1)),{__method__:this.constructorAbi.type})}}var Okt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class Mkt extends dR{constructor(t,n){super(t.requestManager,t.registeredSubscriptions),this.parentContract=n}subscribe(t,n){const r=Object.create(null,{subscribe:{get:()=>super.subscribe}});return Okt(this,arguments,void 0,function*(s,a,o=id){return r.subscribe.call(this,s,a??this.parentContract.options,o)})}}var av=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const Rkt={logs:IOe,newHeads:yR,newBlockHeaders:yR};class e3 extends Vd{get subscriptionManager(){return this._subscriptionManager}constructor(t,n,r,s,a){var o,l,c;const u=uy(n)?n:uy(r)?r:void 0;let d;Bge(n)?d=n:Bge(r)?d=r:d=s;let f;if(typeof n=="object"&&"provider"in n?f=n.provider:typeof r=="object"&&"provider"in r?f=r.provider:typeof s=="object"&&"provider"in s?f=s.provider:f=e3.givenProvider,super(Object.assign(Object.assign({},d),{provider:f,registeredSubscriptions:Rkt})),this.syncWithContext=!1,this._functions={},this._subscriptionManager=new Mkt(super.subscriptionManager,this),d!=null&&d.wallet&&(this._wallet=d.wallet),d!=null&&d.accountProvider&&(this._accountProvider=d.accountProvider),!ar(u)&&!ar(u.data)&&!ar(u.input)&&this.config.contractDataInputFill!=="both")throw new sNt({data:u.data,input:u.input});this._overloadedMethodAbis=new Map;const x=lg(s)?s:lg(r)?r:a??this.defaultReturnFormat,g=typeof n=="string"?n:void 0;this.config.contractDataInputFill=(o=u==null?void 0:u.dataInputFill)!==null&&o!==void 0?o:this.config.contractDataInputFill,this._parseAndSetJsonInterface(t,x),this.defaultReturnFormat!==x&&(this.defaultReturnFormat=x),ar(g)||this._parseAndSetAddress(g,x),this.options={address:g,jsonInterface:this._jsonInterface,gas:(l=u==null?void 0:u.gas)!==null&&l!==void 0?l:u==null?void 0:u.gasLimit,gasPrice:u==null?void 0:u.gasPrice,from:u==null?void 0:u.from,input:u==null?void 0:u.input,data:u==null?void 0:u.data},this.syncWithContext=(c=u==null?void 0:u.syncWithContext)!==null&&c!==void 0?c:!1,d instanceof Vd&&this.subscribeToContextEvents(d),Object.defineProperty(this.options,"address",{set:v=>this._parseAndSetAddress(v,x),get:()=>this._address}),Object.defineProperty(this.options,"jsonInterface",{set:v=>this._parseAndSetJsonInterface(v,x),get:()=>this._jsonInterface}),d instanceof Vd&&d.on(B3.CONFIG_CHANGE,v=>{this.setConfig({[v.name]:v.newValue})})}setTransactionMiddleware(t){this.transactionMiddleware=t}getTransactionMiddleware(){return this.transactionMiddleware}get events(){return this._events}get methods(){return this._methods}clone(){let t;return this.options.address?t=new e3([...this._jsonInterface,...this._errorsInterface],this.options.address,{gas:this.options.gas,gasPrice:this.options.gasPrice,from:this.options.from,input:this.options.input,data:this.options.data,provider:this.currentProvider,syncWithContext:this.syncWithContext,dataInputFill:this.config.contractDataInputFill},this.getContextObject()):t=new e3([...this._jsonInterface,...this._errorsInterface],{gas:this.options.gas,gasPrice:this.options.gasPrice,from:this.options.from,input:this.options.input,data:this.options.data,provider:this.currentProvider,syncWithContext:this.syncWithContext,dataInputFill:this.config.contractDataInputFill},this.getContextObject()),this.context&&t.subscribeToContextEvents(this.context),t}deploy(t){return new Fkt(this,t)}getPastEvents(t,n,r){return av(this,void 0,void 0,function*(){var s;const a=typeof t=="string"?t:cN,o=typeof t!="string"&&!lg(t)?t:lg(n)?{}:n,l=lg(t)?t:lg(n)?n:r??this.defaultReturnFormat,c=a==="allEvents"||a===cN?_ee:this._jsonInterface.find(N=>"name"in N&&N.name===a);if(!c)throw new ad(`Event ${String(a)} not found.`);const{fromBlock:u,toBlock:d,topics:f,address:x}=Dge(this.options,c,o??{}),g=yield jOe(this,{fromBlock:u,toBlock:d,topics:f,address:x},l),v=g?g.map(N=>typeof N=="string"?N:Poe(c,N,this._jsonInterface,l)):[],w=(s=o==null?void 0:o.filter)!==null&&s!==void 0?s:{},C=Object.keys(w);return C.length>0?v.filter(N=>typeof N=="string"?!0:C.every(I=>{var P;if(Array.isArray(w[I]))return w[I].some(F=>String(N.returnValues[I]).toUpperCase()===String(F).toUpperCase());const R=(P=c.inputs)===null||P===void 0?void 0:P.filter(F=>F.name===I)[0];return R!=null&&R.indexed&&R.type==="string"&&rN(w[I])===String(N.returnValues[I])?!0:String(N.returnValues[I]).toUpperCase()===String(w[I]).toUpperCase()})):v})}_parseAndSetAddress(t,n=this.defaultReturnFormat){this._address=t&&ox(Ur({format:"address"},t,n))}decodeMethodData(t){const n=t.slice(0,10),s=this._jsonInterface.filter(a=>a.type!=="error").find(a=>n===UE(Ug(a)));if(!s)throw new ad(`The ABI for the provided method signature ${n} was not found.`);return Ree(s,t)}_parseAndSetJsonInterface(t,n=this.defaultReturnFormat){var r,s;this._functions={},this._methods={},this._events={};let a=[];const o=t.filter(c=>c.type!=="error"),l=t.filter(c=>p$(c));for(const c of o){const u=Object.assign(Object.assign({},c),{signature:""});if(m$(u)){const d=Ug(u),f=UE(d);u.methodNameWithInputs=d,u.signature=f,u.constant=u.stateMutability==="view"||u.stateMutability==="pure"||u.constant,u.payable=u.stateMutability==="payable"||u.payable,this._overloadedMethodAbis.set(u.name,[...(r=this._overloadedMethodAbis.get(u.name))!==null&&r!==void 0?r:[],u]);const x=(s=this._overloadedMethodAbis.get(u.name))!==null&&s!==void 0?s:[],g=this._createContractMethod(x,l),v=this._createContractMethod(x,l,!0);this._functions[d]={signature:f,method:v},this._methods[u.name]=g,this._methods[d]=v,this._methods[f]=v}else if(Eoe(u)){const d=Ug(u),f=_oe(d),x=this._createContractEvent(u,n);u.signature=f,(!(d in this._events)||u.name==="bound")&&(this._events[d]=x),this._events[u.name]=x,this._events[f]=x}a=[...a,u]}this._events.allEvents=this._createContractEvent(_ee,n),this._jsonInterface=[...a],this._errorsInterface=l}_getAbiParams(t,n){var r;try{return Qj((r=t.inputs)!==null&&r!==void 0?r:[],n)}catch(s){throw new ad(`Invalid parameters for method ${t.name}: ${s.message}`)}}_createContractMethod(t,n,r=!1){const s=t[t.length-1];return(...a)=>{var o,l,c;let u;const d=(l=r?(o=this._overloadedMethodAbis.get(s.name))===null||o===void 0?void 0:o.filter(w=>w.signature===s.signature):this._overloadedMethodAbis.get(s.name))!==null&&l!==void 0?l:[];let f=d[0];const x=n,g=d.filter(w=>{var C;return((C=w.inputs)!==null&&C!==void 0?C:[]).length===a.length});if(d.length===1||g.length===0)u=this._getAbiParams(f,a),Us.validate((c=s.inputs)!==null&&c!==void 0?c:[],u);else{const w=[],C=[];for(const N of g)try{u=this._getAbiParams(N,a),Us.validate(N.inputs,u),C.push(N)}catch(I){w.push(I)}if(C.length===1?[f]=C:C.length>1&&([f]=C,console.warn(`Multiple methods found that is compatible with the given inputs.
	Found ${C.length} compatible methods: ${JSON.stringify(C.map(N=>`${N.methodNameWithInputs} (signature: ${N.signature})`))} 
	The first one will be used: ${f.methodNameWithInputs}`)),w.length===g.length)throw new eN(w)}const v={arguments:u,call:(w,C)=>av(this,void 0,void 0,function*(){return this._contractMethodCall(f,u,x,w,C)}),send:w=>this._contractMethodSend(f,u,x,w),populateTransaction:(w,C)=>{var N,I;let P=C??this.options;P=Object.assign(Object.assign({},P),{input:void 0,from:(I=(N=P==null?void 0:P.from)!==null&&N!==void 0?N:this.defaultAccount)!==null&&I!==void 0?I:void 0});const R=Dee({abi:s,params:a,options:Object.assign(Object.assign({},w),{dataInputFill:this.config.contractDataInputFill}),contractOptions:P});return R.dataInputFill&&delete R.dataInputFill,R},estimateGas:(w,...C)=>av(this,[w,...C],void 0,function*(N,I=this.defaultReturnFormat){return this.contractMethodEstimateGas({abi:f,params:u,returnFormat:I,options:N})}),encodeABI:()=>Zj(f,u),decodeData:w=>Ree(f,w),createAccessList:(w,C)=>av(this,void 0,void 0,function*(){return this._contractMethodCreateAccessList(f,u,x,w,C)})};return f.stateMutability==="payable",v}}_contractMethodCall(t,n,r,s,a){return av(this,void 0,void 0,function*(){var o;const l=kkt({abi:t,params:n,options:Object.assign(Object.assign({},s),{dataInputFill:this.config.contractDataInputFill}),contractOptions:Object.assign(Object.assign({},this.options),{from:(o=this.options.from)!==null&&o!==void 0?o:this.config.defaultAccount})});try{const c=yield Moe(this,l,a,this.defaultReturnFormat);return z_t(t,c)}catch(c){throw c instanceof Yw&&pO(r,c.cause),c}})}_contractMethodCreateAccessList(t,n,r,s,a){return av(this,void 0,void 0,function*(){var o;const l=Ikt({abi:t,params:n,options:Object.assign(Object.assign({},s),{dataInputFill:this.config.contractDataInputFill}),contractOptions:Object.assign(Object.assign({},this.options),{from:(o=this.options.from)!==null&&o!==void 0?o:this.config.defaultAccount})});try{return _Oe(this,l,a,this.defaultReturnFormat)}catch(c){throw c instanceof Yw&&pO(r,c.cause),c}})}_contractMethodSend(t,n,r,s,a){var o,l;let c=a??this.options;c=Object.assign(Object.assign({},c),{input:void 0,from:(l=(o=c.from)!==null&&o!==void 0?o:this.defaultAccount)!==null&&l!==void 0?l:void 0});const u=Dee({abi:t,params:n,options:Object.assign(Object.assign({},s),{dataInputFill:this.config.contractDataInputFill}),contractOptions:c}),d=ar(this.transactionMiddleware)?zE(this,u,this.defaultReturnFormat,{checkRevertBeforeSending:!1,contractAbi:this._jsonInterface}):zE(this,u,this.defaultReturnFormat,{checkRevertBeforeSending:!1,contractAbi:this._jsonInterface},this.transactionMiddleware);return d.on("error",f=>{f instanceof Yw&&pO(r,f.cause)}),d}contractMethodEstimateGas(t){return av(this,arguments,void 0,function*({abi:n,params:r,returnFormat:s,options:a,contractOptions:o}){const l=Tkt({abi:n,params:r,options:Object.assign(Object.assign({},a),{dataInputFill:this.config.contractDataInputFill}),contractOptions:o??this.options});return Roe(this,l,Ag.LATEST,s??this.defaultReturnFormat)})}_createContractEvent(t,n=this.defaultReturnFormat){return(...r)=>{var s;const{topics:a,fromBlock:o}=Dge(this.options,t,r[0]),l=new IOe({address:this.options.address,topics:a,abi:t,jsonInterface:this._jsonInterface},{subscriptionManager:this.subscriptionManager,returnFormat:n});return ar(o)||this.getPastEvents(t.name,{fromBlock:o,topics:a},n).then(c=>{c&&c.forEach(u=>l.emit("data",u))}).catch(c=>{l.emit("error",new rg("Failed to get past events.",c))}),(s=this.subscriptionManager)===null||s===void 0||s.addSubscription(l).catch(c=>{l.emit("error",new rg("Failed to subscribe.",c))}),l}}subscribeToContextEvents(t){const n=this;this.context=t,n.syncWithContext&&t.on(B3.CONFIG_CHANGE,r=>{n.setConfig({[r.name]:r.newValue})})}}const $ge={addr:"0x3b3b57de",name:"0x691f3431",abi:"0x2203ab56",pubkey:"0xc8690233",text:"0x59d1d43c",contenthash:"0xbc1c58d1"},V6={setAddr:"addr",addr:"addr",setPubkey:"pubkey",pubkey:"pubkey",setContenthash:"contenthash",contenthash:"contenthash",text:"text",name:"name"},vR={main:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",goerli:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},Lkt={"0x1":"main","0x5":"goerli"},Dkt=[{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"label",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"NewOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"resolver",type:"address"}],name:"NewResolver",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"recordExists",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"resolver",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"ttl",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"view",type:"function"}],Bkt=[{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"a",type:"address"}],name:"AddrChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"coinType",type:"uint256"},{indexed:!1,internalType:"bytes",name:"newAddress",type:"bytes"}],name:"AddressChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"hash",type:"bytes"}],name:"ContenthashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"},{indexed:!1,internalType:"bytes",name:"record",type:"bytes"}],name:"DNSRecordChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"}],name:"DNSRecordDeleted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"}],name:"DNSZoneCleared",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"lastzonehash",type:"bytes"},{indexed:!1,internalType:"bytes",name:"zonehash",type:"bytes"}],name:"DNSZonehashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes4",name:"interfaceID",type:"bytes4"},{indexed:!1,internalType:"address",name:"implementer",type:"address"}],name:"InterfaceChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"string",name:"name",type:"string"}],name:"NameChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"x",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"y",type:"bytes32"}],name:"PubkeyChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"string",name:"indexedKey",type:"string"},{indexed:!1,internalType:"string",name:"key",type:"string"}],name:"TextChanged",type:"event"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentTypes",type:"uint256"}],name:"ABI",outputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"addr",outputs:[{internalType:"address payable",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"}],name:"addr",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"contenthash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"uint16",name:"resource",type:"uint16"}],name:"dnsRecord",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"}],name:"hasDNSRecords",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"interfaceImplementer",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"pubkey",outputs:[{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"}],name:"text",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"zonehash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"a",type:"address"}],name:"setAddr",outputs:[],stateMutability:"nonpayable",type:"function"}];var $kt="AEkVMQnvDV0B0wKWAQYBQgDpATQAoQDcAIUApwBsAOMAcACTAEUAigBRAHkAPgA/ACwANwAoAGIAHgAvACsAJQAXAC8AHAAhACIALwAVACsAEQAiAAsAGwARABgAFwA7ACoAKwAsADQAFgAtABIAHAAhAA4AHQAdABUAFgAZAA0ADgAXABAAGQAUABIEtAYQASIUOjfDBdMAsQCuPwFnAKUBA10jAK5/Ly8vLwE/pwUJ6/0HPwbkMQVXBVgAPSs5APa2EQbIwQuUCkEDyJ4zAsUKLwKOoQKG2D+Ob4kCxcsCg/IBH98JAPKtAUECLY0KP48A4wDiChUAF9S5yAwLPZ0EG3cA/QI5GL0P6wkGKekFBIFnDRsHLQCrAGmR76WcfwBbBpMjBukAGwA7DJMAWxVbqft7uycM2yDPCLspA7EUOwD3LWujAKF9GAAXBCXXFgEdALkZzQT6CSBMNwmXCYgeG1ZZTOODQgATAAwAFQAOa1QAIQAOAEfuFdg98zlYypXmLgoQHV9NWD3sABMADAAVAA5rIFxAlwDD6wAbADkMxQAbFVup+3EB224cHQVbBeIC0J8CxLAKTBykZRRzGm1M9QC7DWcC4QALLTSJF8mRAoF7ARMbAL0NZwLhAAstAUhQJZFMCgMt+wUyCddpF60B10MASSsSdwIxFiEC6ye5N2sAOeEB9SUAxw7LtQEbY4EAsQUABQCK00kFG8MfBxcAqCfRAaErLQObAGcBChk+7Td0BBgXAKoBxwIhANMrEnM681CwBZA6dyc1SAX6JwVZBVivuAVpO11CEjpYQZd7k2ZfofgLEwPFByXxdyMEo0sCU1MCdRurJwGPo6U1WwNFFwSDYQkA0QarPy8jBykCOV0AawFhH3EAgx0ZAJUBSbcAJ2kXAa/FAzctIUNTAW9ZBmUCZQDxSRcDKQEFAElBAKsAXQBzACu1Bgfz7xmNfwAJIQApALMbRwHRAdsHCzGXeIHoAAoAEQA0AD0AODN3edPAEF8QXAFNCUxsOhULAqwPpgvlERUM0SrL09gANKkH6wNTB+sDUwNTB+sH6wNTB+sDUwNTA1MDUxwK8BrTwBBfD0gEbQWOBYsE1giDJkkRgQcoCNJUDXQeHEcDRQD8IyVJHDuTMwslQkwMTQMH/DZCbKd9OANHMatU9ZCiA8syTzlsAR5xEqAAKg9zHDW1Tn56R3GgCktPrrV/SWJOZwK+Oqg/+AohCZNvu3dOBj0QFyehEPMMLwGxATcN6UvUBO0GNwTFH3kZFQ/JlZgIoS3ZDOkm3y6dgFYj8Sp/BelL8DzZC0lRZA9VC2EJ3zpfgUoDHQEJIocK2Q01CGkQ7wrFZw3hEUEHNQPRSZYAoQb9Cw0dMRWxJgxiqAsFOXMG9xryC4smqxMlevgFzxodBkkBJRr7AMsu44WsWi1cGE9bBf8LISPDFKRQHA0hQLN4RBoXBxElpQKNQ2xKg1EyHo8h8jw5DWIuD1F4B/E8ARlLC308mkanRQoRzj6JPUQiRUwoBDF7LCsnhwnLD4EMtXxuAVUJHQmtDG0TLRETN8EINQcVKZcgJxEIHUaRYJYE85sD7xPNAwcFOwk9Bw8DsRwpEyoVJQUJgSDTAu820S6vAotWfAETBccPIR/bEExH3A7lCJcCYQN/JecAKRUdABMilwg/XwBbj9RTAS7HCMNqaCNwA2MU410RbweNDlMHoxwvFbsc3XDEXgeGBCifqwlXAXEJlQFbBN8IBTVXjJwgPWdPi1QYlyBdQTtd+AItDGEVm0S5h3QChw9nEhcBMQFvBzUM/QJzEekRZxCRCOeGADWxM/Q6IQRLIX8gDQojA0tsygsjJvUM9GUBnxJeAwg0OXfqZ6dgsiAX+QcVMsFBXCHtC45PyQyYGr0YPlQqGeAHuwPvGu8n5kFTBfsDnw86STPqBLkLZQiHCTsARQ6fEwfTGGYKbYzMAS2HAbOVA1ONfwJriwYzBwcAYweDBXXhABkCowifAAEAywNTADUCqQeZABUAgT0BOQMjKwEd4QKLA48ILccBkSsB7yUEF78MEQDzM25GAsOtAoBmZp4F2VQCigJFMQFJIQQBSkNNA6tt3QDXAEcGD9tDARGnRscW3z8B22snAMMA9wABMQcBPQHJAe9pALMBWwstCZ6vsQFJ5SUAfwARZwHTAoUA2QAxAHvtAU8ASQVV9QXPAktFAQ0tFCdTXQG3AxsBLwEJAHUGx4mhxQMbBGkHzwIQFxXdAu8qB7EDItsTyULBAr3aUQAyEgo0CrUKtB9f81wvAi1uPUwACh+kPsM/SgVNO087VDtPO1Q7TztUO087VDtPO1QDk7veu94KaF9BYecMog3QRMQ6RRPXYE1gLhPELbMUvRXKJVIZORq4JwEl4FUFDwAtz2YsCCg0cRe4ADspZIM9Y4IeLApHHONTjVT0LRcArUueM6sNqBsRRDwFQ3XpYiYWCgoeAmR9AmI+V0mrVzccAqHzAmiUAmYFAp+AOBcHAmY3AmYiBGoEewN/DwN+jjkCOXMTOX46Hx8CbBkCMjI4BgJtwwJtquuGL2NBJwFjANoA3QBGAQeUDIkA+ge+AAmxAncrAnaeOwJ5Rz8CeLYZWNdFqkbTAnw7AnrEAn0FAnzsBVUFHEf8SHlfIAAnEUlUSlcRE0rIAtD9AtDISyMDiEsDh+JEwZEuAvKdXP8DA6pLykwpIctNSE2rAos7AorUvRcDGT9jAbMCjjMCjlg8k30CjtUCjlh0UbBTMQZS0FSBApP3ApMIAOUAGFUaVatVzAIsFymRgjLdeGJFNzUCl5sC765YHaQAVSEClosClniYAKVZqFoFfUkANwKWsQKWSlxAXM0CmccCmWBcxl0DFQKclzm+OpkCnBICn5cCnrSGABkLLSYLAp3tAp6OALE5YTBh6wKezwKgagGlAp6bGwKeSqFjxGQjIScCJ6sCJnoCoPcCoEgCotkCocACpisCpcoCp/sAeQKn7mh4aK3/RWoYas0CrN8CrKoCrWMCrP4CVxkCVdgCsd3TAx9KbJMCsrkJArLkE2zcbV9tRFsDJckCtlg3O26MAylBArhaArlDEQK5JnNwMnDdAr0VArvWcJIDMg0CvoRx/gMzbQK+FnMec0sCw8cCwwBzfnRHMUF03AM8owM8lgM9uwLFeALGQwLGDIUCyGVNAshAAslLAskqAmSZAt3OeHVdeKp5IUvMAxifZv4CYfAZ75Ugewdejl63DQLPZwLPaCtHT87vD5sAwqkCz28BJeYDTg5+RwEC3CMC24YC0ksDUlgDU1sA/QNViICFO8cS6VxBghiCz4LKg4kC2sMC2dqEDIRFpzgDhqEAKwNkCoZtVfUAUQLfYQLetG9zAuIr7RAB8ywjAfSXAfLOgwLr7wLpbHUC6vUC6uAA9UMBtQLuhQLrmJamlv8C7jsDhdyYdXDccZ0C8v8AZQOOEpmPAvcPA5FqA5KDAveUAvnVAvhimhiap7czmxoDnX8C/vYBFwA1nxifrwMFiQOmZgOm1QDNwQMGZqGEogEFAwxFAQsBGwdpBl21YwEAtwRnuw2HHq8JABNxNQAfAy8SSQOFewFfIx0AjOsAHQDmnwObjQizBhufwQCnBRG76R09PhZ4BWg3PkArQiFCtF9xEV+8AJbFBTIAkEwZm7k7JmAyEbrPDi8YxhiJyfYFVwVYBVcFWAVjBVgFVwVYBVcFWAVXBVgFVwVYRhUI14VnAgICCmRe6SsEyQOxBi+7uwC7BKe7AOdAKRayBUY+aT5wQj9Ctl91N1/oAFgRM6sAjP7Ma8v8pudGej0mIwQrFic2NX5t32rB8RnCLGkBa9duMBcFXwVqycHJuAjPSVsAAAAKfF59i74AMz+BAAMW0QblrSMFAIzDCwMBDQDlZR09JB9KQrFCvEE4I18nYDYnOCMJwT0KRD9DPng+gT5wPnECiUK8SUI7X8tOT2pNCixrVC9qC24fX+AzOhsJZ5sKYiMrPB0mQqtCvCvMAcv8X8kOHy4JCAkifp3fajotShfJq8msCWXBy8wKYEFfD+UQoxEAk40dRUIlG6ltOc44CjM/Qz5wQj8cBwodTEdsWywtWuG8Egp97R0rQj8cXQhKCQ4zVENCNwQ7Q5wsCoEbLUI/G/UIUyIjGDAxAAWPYfBeCnFkyWALYC0jbkNgGTkCGx5gswYCaxBlTmBNEQFk52AVYJVgfWCzYEtgkWgWFwa1DtxVqbxaC0MWqwG7K83BAh8VABwDHgF5AmwvMJVSgAGKCrhHGgDkI3SOCsoNpk3qAZsCh5xPBUBfAPf3BwA0FlcMC6UMJB+6r0eAgQw0ABUTnyuCCHoC0gtLZREbANhOBnUECh5aADEAtritAJQnCxZvqyQ4nxkBWwGGCfwD2e0PBqoGSga5AB3LValaCbthE4kLLT8OuwG7ASICR1ooKCggHh8hLBImBiEMjQBUAm5XkEmVAW4fD3FHAdN1D85RIBmpsE3qBxEFTF8A9/cHAHoGJGwKKwulODAtx69WDQsAX7wLAGNAlQh6AOpN7yIbvwAxALa4rQCUJy07Ds4CkBh7ULtYyHRyjsOlmw/ZFUkb7AEpEFwSBh/lAccJOhCTBQ8rDDYLABEAs+AiAQIApADhAJiCCrJrOS8AFABbG8YubHYqDcEQAjskHNPhHB4LG30CewTBCqrxbAAnLQ6mLs6hHAe7CQAQOg+7GkcczaF3HgE9Kl8cLs4RGQB9q9ocAuugCAHCAULz5B9lAb4Jtwz6CDwKPgAFwAs9AksNuwi8DTwKvAk8DrsFmAEbawouzqEqD4sa4QHDAREWOwCgCzsLuxC7BBiqe9wAO2sMPAACpgm8BRvQ9QUBvgH6bsoGewG7D00RErwBAQDqAQAAdBVbBhbLFPxvF7sYOxjbL7ZtvgNIqLsAB7sALrsC6w5WAAq7BAAeuwJVICp/FTwVuwG+J+QAsloBvSjgo7vIAAFbAAG7AAJbAALjAAg7AA67AgAbu6VbDr/EAPQAaPuoOwMBu5UnSwDn3Rm7CBp7CKEFCv9wAN+7p7sau6OLeXIG+6mbgwASuwYbCwG8AACGAG27BgALu6c7ARo7ugihnMoBuwvtB8CpOwDhewG/AADlABW7AAb7AAm7AGmLABq7GLuOaRX7AA5rAC5LHgAGuwAXuwghAA1KAcIAt68mAcAAALQADpsAHBsBv/7hCqEABcYLFRXbAAebAEK7AQIAabsAC3sAHbsACLsJoQAFygBunxnVAJEIIQAFygABOwAH2wAdmwghAAaaAAl7ABsrAG0bAOa7gAAIWwAUuwkhAAbKAOOLAAk7C6EOxPtfAAc7AG6cQEgARwADOwAJrQM3AAcbABl7Abv/Aab7AAobAAo7AAn7p+sGuwAJGwADCwAQOwAIPAAUOwARawAPiwAN6wANuwAZCwYWGwAVOwBumxm7ALobLgATOwMAaSsKAOFLAAI7AARSABd7BRsABtAAGLsAC/sAX7sAa/sA5IsBuwAXdgG8AAFyC6EABUoAbXYAB/sA5XsAHGseAXsoUgA5RQD+Bw0McgAoKnABpAUIXgG8XiMMCQdvS2xfKokfPBRiLTYDoQq0AdgAFgLRA24BdnJHUhQhA08CFT4BLAYDc0a8e1J6QAApADEB+wBTCtsAe5AsASsAduUNETJGAUoAVwUAAVABB4rMAHg7BCClAFoA1hUAlWg3H4sAzWuxAM/UFgjCdXMbGFYdCdEBiJCrIlNTTUgSPMKJ+QB/HDdAKSvgEZdPAHIBKSwwKUIZDwMwVQT3xe4AS2XcAGoCcQI/EXo6x3guNdUGBQAQGx0KCAwqBB8dKU5TTgi5ugAKEs0AJgABGgCGAIkAjjUA7gC0AOAAnTwAuwCrAKYAoQDyAJ8A0wCcAOsBDAEHAMAAeQBaAMsAzQEHANcA6wCIAKIBNQDjANgA1QMBByoz1NTU1LbA3M3QzkMyFwFNAVcvRwFVAWQBYwFWAUdLQ0VoDQFOFQcIAzI2DAcAIg0kJiksODo6PT09Pj8OQB5RUVFRU1NSUylUVVdWVhxdYWFgYmEjZmhwb3JycnJycnR0dHR0dHR0dHR0dnZ3dnVbAEDsAEUAlgB0AC4AYvIAigBTAFMAMwJz6QCH//LyAGAAj+wAmwBLAF4AYPn5qgCBAIEAZQBSAK0AHgCyAH8CPAI/APgA4wD6APoA5AD7AOUA5QDkAOIAKQJ3AU0BPAE6AVABOgE6AToBNQE0ATQBNAEYAVQPACsIAABNFwoWAxUWDgCKAJIAogBLAGQYAi0AcABpAJEDEgMkKgMeQT5HKQCLAksAwwJTAqAAugKSApICkgKSApICkgKHApICkgKSApICkgKSApECkQKUApwCkwKSApICkAKQApACkAKOApECcQHQApMCmwKSApICkRZ5CwD6BQOnAl0CNhcBUBA1At4RCisTAUo3E02RAXekPAFlWQD/Az1HAQAAkykeGI9qAClgAGkALgCJA5TMi/CuhFoFuisOwhEBndV0KgsEIzFsATNabAGyAN5+gH9+gH6BgoJ+g4aEfoWIhoCHgoiCiX6Kfot+jIqNfo5+j4KQfpF+kn6TfpSDlYiWgpd+2gLabOEC2GwAgmwkbKAAg2xsBEkERgRIBEsESQRPBEwERwRNBE8ETgRKBEwETwCWZmwAowOIbAC0ZgEFbADJUWxsAM9sAgxsAPZabAD2ARkA9gD0APQA9QD0A31ebNSEI2XAAPYA9AD0APUA9BxsbACJWmwA9gCJARkA9gCJAL4A6AAIAPYAiQN9XmzUhCNlwBxsAPdabAEZAPYA9gD0APQA9QD0APcA9AD0APUA9AN9XmzUhCNlwBxsbACJWmwBGQD2AIkA9gCJAu0A9gCJAL4CNwD3AIkDfV5s1IQjZcAcbAJDATZsAkoBOWwCS8FsbAJXbGwDnwLtA58DnwOgA6ADoAOg1IQjZcAGA31ebBxsbACJWmwBGQOfAIkDnwCJAu0DnwCJAL4CNwOfAInUhCNlwAYDfV5sHGwEPmwAiQQ/AIkGjTFtIDFs1m4DKGwDrAJsbABVWv4VMgJsbACJAmwAVAEAul5sAmxebGwAiV5sAmxebD3YAEls1gJsbEbCxxP/x5BApA0KYFA89AsjTx97EHmJQPyocItC2JnNFRCEnFU6SFTDoI0PxeRNRoNRWkpzVnWW8pTagkNmgf+jGupqZ3eu50LAFnc+OzfJwdub1AdpOy76VnijWNR/CMEevikQkFyQuLuPajxWi9chqOoMJ7qpCN4sx3LJG4Myu8kD68wC6+iAwt+pU1JEeY13rpCVkXSZfinVKn4xZpxsI3Lp8bJLrJ9ujkrIalMRBAcv/GSKEtowzcEn5XmJw2BagB8V2UWJoJHZ14SXhM7p0XeGFOuw6mlvyq99WYp5XxrO6ru9nn4RHcOkJ7hx5UqWtman7yVMLzYXQefQRUdIY70RYQE8+aAzCNSGQkXiHfnHYRMi+xczKDdZLk3AV1gzxkkSHLjBwuq8shIJ+/RAbqjqQbugFhe0rqklu432EERkM5k9y1DXzds46oLqKAx6OhPT2WiqEfhaITn7OF9Y694AmKmUvbpWp0xJqDaf3jeNJXnK6NpnGcFOmbclbARC+5+5U52ufw5b0Hh+2LrrNimvZe4eYmApRsZnJE310SqB+1xB6rSJfnV1f2D0awB18Oc0sXAFqIlgHgWiaZGdvP5CJUSsCTCQUC335+iSkwPlLJJ5lwjTSn9Lw22NbK1Tu8w+bUpHtDRDPho7Gun8aw2Jzu9i+N0Ot/kPMbLAb/rUQ82kfpk85qLDkfxLl39QPDngo72GYh/Xigbpcm1pA23D2ywt3D8GgMOao040wDqkHxOEx0OhC+ZmHiIdjK7yRbfJD2ouZbAedhD3p7s8WDmCJfNforgDYPGAXSI08fTjPZ5B37lc5VXGzc1vJmibDwBNVzXuaUzg7N5H4BxqjhJ+kz9HLUJys7bpBDYAPvbut13AwJCWd059tS8YTYgC8HwrkewBfa1LSSpmMr9uR2EekTiAMH+Mx4AGzgbquccwBDlLmRhgXL/YiLPCEb6d2k5qJ6o800qddABkpqt7NG+sc2uvHZwZs57W1AHTFM1KkMShasADAh2FvzbzJOzVDMS3ZlT2BSFKdnkZFB6JyqJbhm6XANis9TrtzJdlPVp+rl8v3nIke6Jou7m2TKu53Vounupgkz2LzrQPhhatLIG7rfF/gUKWp15X3LKt+ZvuCDSqPUigF9yJntimC1HJR7Yj/dUrLAXWrT+1tnwPJJLGKAlQ5VeNDWRKCTt2vz3rJuo4+gIt75/Mkfl/gSZblZ9r/SEeeosZXneli/xNh1WVCvkRt2RnyyjtMkMqhzXh1PVOCbILqv0r7rGYm0CHIyKdhHL90cl9E1I6eEtQTCt6RXj8M0HHrHCHLVRpNM6WIbT5BCMGVnL0o5895qSRbCJz+5I8PGMhAN/Xrj4BgIdlKqlHtBHqTJwmK169toZ2IWxNzrAbIG7zh85Q/LG2A4yBcaBel52zdunokB0lv3A7kXnTI7M6ZnfZ7nwuj5lkGhqSpW+w5CI/FmRlplBEbnZy1ZxS3DL8rf1YWhO5XivWZBSRh1gFsjjyj3qRG1cm/6ors7WsEif6WRxns1MKDZa6KrbfMQ/swIb+2nb0tqxHeii6FcgVeAjE/Xwac1owx04dJKG8R5YQgHNnEfHf0qb8WOnU0eQSjazq+IK7cSuCqYzPEUB/x+QgGZqM3dBoYvNvZVOHDkbgdilWdagqO5bkybXfLpyMPuGq8mvAAEZGbR6RwXGlW9ErOWTfnjfx6dXFJqBj0OBSGFz4lWQasNOmVJeN4SFWSLfOGB/7ehV5YuoNNROHZEG9ElVuMnqbDMMuDleOt/cN/gsWxGw128mwU8/HxkOKqdTZnI7dHka67WCTf/FmBrxpNCaKJ1GxBTCSS7MNfhNj8S4Gtotg6Z3AM9cAeVROnppUMaiV5jjudLnNqoVrKO1/FijLlAc74kxydxKX1RQuMqHR63eecYr5o6MJ+B78VsLlCrpelWh6GOrCOBIoQmIcdpJL1pwE2zzZqBkecGTdK8KMOB6r1eNRURyrz6M899TZaoS/vNOxHf+5gORU+OyYIcIW6diP25GHF6u8TNjuL/GJzCnLLXd01KrsjRa51v4+O/VIAWXESJxfxWjv628J+cWUQpoD+Yytzs3jSMRJ23/XT+vUdtUMLDQq1vnIoeg/GjWh88MT6k9dRqDaQ+vodilFgvjuNw5pJpId9mfwyYeLCGb3BmHXdfQfhfPRQaupe/f8TG4Bk3eDKlYBaEK3kZYNN2Sdxz47m/vYBxvIOKtnqplB1pebzuXmAr/MuzQCknKe653dzaWQQ7MUhWYWvzIZwLe1v0rXxImLaz+AkAu+sYikhouNF3EW6w4crZ6MuUiDbIAx8XhAfegcvW6x9BPb3/sCxGWu9YyatqExB+TSm69qIkI9IwhjrcnzME+jWBx4mNQm5WwLzUjSyY4FZ0aMF5YFlXUD4hL4XfOeYv5rDe2s2D/Cn+28fZ9UCnOQvXFMnQqfc0G+ZqOWWD9l/liqUPaNQzZjxCHpUAD8Rcc90MniQ02ugHWsUupFUvhC9usY7zNPt5F2jO7qgzhafsQSd50jgLrC6Qx6bpHbXR3WNAu1BzGmwbz+ebGmwTjdy006Y6zipP7n/OJlvSmbq+SY+nefAVKK6EBMPbce5n3IdRI8+vbxCpN53rw3TvgNds1SuMiuLGxt89L71mxPDeanGhyHvOjmO56tnVpoHalQnL6TqNuqKsHjHCIKB4pCgj4WyYPvRvYvqi5EMr7lN3MotPR/KH7JUD1lZbU0QzfbrEBJnuQiVAyAC9vwXWp2TRU1/0aapyAH2cbglEHVAdl+1rb1u147uV0td1eNoQZsqHrIMIYVPXtLk2TIU3cJE08PjoYNDpfF/IcJnYQHl6nsplczX3Rgah4NbJJHl//5scUufqsSd//kbIS406ZWoMP//+jhGUswX/5nVNz/jAj9KmXPtAmMiK+khhbn1w/mELzZMT/WxcW//y/jsHaOM/61oAW/CjYhJtY622/TtMYuP7bilBvbiT3vB9n8IcFPnwM78H0KfhYDRdY5PhWJ4jWRQzB+HT5NVZV56LG82hcQms+jOTT/c9Y9sx5rPi1/wB7f/+c5UfUCKk3iwwCuywUc2MGnAwsXf1E5hoI55x1Q/Qby+sWH8NRjavZ8VaDsdi1NUVhH86BJHX1yaFt1w1OYeL5LVmdN+5Q+KuTvXEPDzUCg6xp0HhsUhTWSe7MZMM/6rsTUb0/nbUE3YQlGGt48kT1/6cnf6yHnvHtQx9EosOXN077yyEq/jE3YTiG/5SEJmXFeocJJ1EAd6vKeK6VEdJLOZ1km/EwOnZWCQpzCLKPHxrfh4yJhGq//2dos2E/3+MOcdW5EsgIdmTQUQetzRy5fQHhDBl37XbWzsqO/cASEDjyst1/8NEROqVAxWnddQV+umJ8IrKVgKvGaTc0GsQ4s8h0Osql5QKwlddPDjJhKInyWqYUKmmlIts+FIcXZ6yM6cljbsjUG2ksSOkuIw4sYHffRNgBOLApvD6XrR6Rt0rV2Uf8IpnIUVnb9Twt91QjAaD/dStSWDxg7aYY+VXIgnuowYdOkjywa2hlgrnI6PjaU3e3UjQ5Yk5mdIJGyHnv3/P+1EkMav1yFyF+FeJE/RXnWBw+Nh0aOo6TGlKX7d+dkP9+brvr79SdtXJtcD/aXBGiMNfG6/NQniQHYQlK78FEHDqOh+bDI0o+2Ub0h53EL/vlzjrBczVEZz2bOtvIL+DIzDkk9nCWt7tlqsq3l9JMtJk3r5HG2iJ9b/X11TG6wwMAjHLQ2oasaMEsydh88QPvI+hmqIHhvalpKoKOueJR0eZ9J8G2alNOIOy98jwvbc87Ewk9d+5G/tUijTmlbjFlDKXV05HalKxaRTrucc73On7yzAPS6f2v4ogiaWyWeV73dv/MsQT5HjRrsYV9dLAcI3T+zC2qEVINyNpEhoKV+xVSuWtT4AhBfpnZ7unIM+HX3msI0HiI+P+z2PFgkjGi5PqEbG/wNIWeRUjPtDEgbbubN+I4JaDLrW9borRBDob7ZFx+JdKeFVUKVeWqb/c88Ol7DhM0suLtuEd8tkDSMTD3DFx8UphPINHMHi51hAPttXL4Ektt/lKEUG/R4qZKohHjVpAcPIMiHyWr6xR8/EWnNJvBFET76yCdk5er7ADB/1bgoImhpSiZ/omZjPKPCEeZsOwvPmXL+1vlJNeGO3TzySmGA1X6e58gLrazDM71jywM1XL8zKHN6G3kB31Y8vLtP982N975SZXk2JwDvmv7AY/aDsFFk1v+nE7/hbvuOWhBH4kuemeYozPk2K22Vx/YGiDTLU7YilpOt29u3RZMBh4UJjlTP5ItxTzWv6ebL9b+GSU1Vsm2S8LMfVfJczaBSqE8J1A4YUjpsALL7++bwCPXFhaufdpDFtBlHb9makeYbqdg9ltvK/HwF/rNE6KrtWUkEcxmTB7Iyu5TiVaIgW/YxzQhpArliIMkOoK5L7ShVtF+DYqV01mk7fwop04hQRwg4KFmr5z9nYf05VVqkSe7gfnx5bxxlQ0qEV0jiwzf064qG11iEqjHcUgDWWsDs/LEGlzX31T5KVL+7D4EoKim7HBagiqRo5JI3WfDBgpKIruWz9j/J6Hp5Q/EJbMWB8NeSMuFarNw3AEYPBJtYQO/4oD/ZgPTSQ06di0EeumX5EbrdThO+fvYEVSxLtZ3AJkee0Xn0sDwNtiiZhJjJRDuG1YRKB1vOulfd9JjHeyu+UHTmrtra/pm+8Rixh4WKiLaLOCxIbZNoWRZSyyUGLPjAaAo+SQBpfO2uruWrzFxLlpvrXJNMCWtlJDKGAnlWK5xpU2tcxXbeD+sbdfwYXt/qTwDk6UqXR/aUt099DhSNl4Nk8mXwpw+b0nvjKOG6Mg1PRXjrMUMANvNgEArv8nMJs3vj1aHi8MHz/UfJWWzkcrSpZTNBhduXlGR7i+ip/THDp5R9KRNcDKECgtwgXg4EFN5HHfikP/XvsoCkHTg+NbsD8Gl6eknk4Arwn/BWGJ0hgW0/gUKrzuGZhub7igRP3abetpIm+24xEOlWl3YKpm2qTBFvX8ddDRvm1LcwnCJuEfZx12qPY9TrntMIQsv316zvpyWnyStX8VU4j6tQk+CWlLBUCJR6MdH9Cp7g2qdn2WM9qFbREmejH09dlWEPm8hPF0L7RxwRRdiCs0DP8ewk6ApoELkKU9hckSdbnXm8UHJmaNXjxv/q0fTTpu8rnl9lN0vQCpDRbCtcz12rGRFEA7Cfg7FhZn5QFkNmv1ZURKEsiZce1nS9K7HrwpC7yJV4Xt3eAVbLJfoXHrtwG60Z8gwaSnmxoL3s2ZlRqggZN/MHo1oUS4L+GwObFI596Ld4Mvi8l+cQmF1gJpkpnDio7TuO35npaMHiWzFqPSX3qNgkIPGuX0qGYnPIVsM901Yu8oZnOZOY1TbtIdFUNKNq2dP8SJ4F/VCEzIjF0/Rh+7UrZj80tC6rognVH3mqa8eCs/lcQU1Pjj98kBmAKDbZUTwosv02UunRR3n0X6c+f73mtwB7/WbQ16gO431EtwZbNG1SM4TZPBnsQSESlsfG2JLQXx5xWf4bmQ/xcVCPISAX5897JxHKLD/Xkgu57+ABR2+MMtEbX64+MNlBHpKC7sjlWVEShf5qA+dGc59LFVlZrX/Enq9z/v+wnZ1HErmxmjJjxOA+hAjVUWgtq6ygAi/8ewJDjUMFw3zhQFtbyTLDPFd21Ji5S5QPZo9nMSxdg1+DGFSN0wlWt7XeYPbHqLfliV0J1kOhQNp0VbUPy0MS2Ms66OxtSWvaULaWHnfAA+sieVVgtjDwN3nKonWapkSKRN8BKKJQpCfqo8RQI5udhfu5s5+7vwsppmAJDgz2GNA7d43VdbV2l/SrvEu4RYslmNJmfSOVbssxAhSYy6WxpIQdDB0FVBpZ6IM8yr81QN+XLZ3n/wed/R+s6LslkxKbzzst/GkRbe6rFmtvJCwr1T44ETM+IMgOnjUO0eG6a1n2w7lwM1oFBvzMUWRkNFOvKcx3oSb5XdenZ5dXsute6nkRypBiSdAtA2fxAd8UdLOZW/MB7fZoEuFheQXijdaF8kuaRZoSeWdKOkKsGYEGaXfaDKTu0WMTcLniQs7KRCz9iK3SP+Y2xIjkfVGqFLSQ6vh+A1u6FdfwXsv1VPMfi2cxmdM+/xTgMXEyo2ZGcQ2YmPsghnYdv2+z48JpGZA4tUK1p1q2VdVxyfypXEXcrxKKtmt8UdW7sHWmKMqDuBBM3J/JUQx8eUYN4pJ5oRqvdiPHU1o/WPjiKvnlCqOdyxlxF54L9PrtLD1NejZ9aZDivVr6ZfMFK1/psVygoPIAnphcJWWb9+5IKMKmgRQULsTPZi6Bw4wP32zVEoKcHpP73CkFAqS98nSaGoWDjDJiaACJn4p5o1jq9R4Q4VcibhXF//LHP0bdf63kRVZdRbbhGe7sDQcyWS5tpkfeYHnff25WK+4FpzLlAcbaKmHdIBqOw3fImx1uqQIADH0TyHzFlqTG6nMoY81svP0T6BIyELMS8tMe+E1p6TFP6sVpZa6VNaTumufD5aj9goRa9SAmdJT4HhI2r0egj8UrgFb8L59wGLnYlzkLAiUd3m/WWIIEU61kPoEjd3gIVy/fiBcgqQqHnoXpL0SqLGdGGgn7DQeVMSYWHfjno1FngIKP9cjYaTlcRP6bZunjHP13/lbVm4awti894pTf/ZNNqr4OR+tDVie/m+rC8QpVnRbsCMPukOH87B2jM4AG6pHuXl1x9SiKdhYJVOhfo/+SCaGjUW2CoogL1FFhFGN9o+acoVLl0SXs/3vrSccmZeAF3NewFuOg/P12QYKQF+SH+KYcNnsAhIAELPBUgre/KRUJEA+KPD0MHRjv+3J/j2Z23MuJmkfy7leWcMsti8wXLSHgXFJTaksx1Woi6oljwxFVIJG12SBSZLNJDbXMYPekmiXT4FclKI35BFgqnYpKfcsr+f8HUXQoHJ9UYZ4J5YMiHHyAxg6eidhodgqJ2Htf/xYEx+G0zXchuzlt8hcAl+AT8NCQ4orFc4DerabF1enA7NTLnvtZh3FUwqIOvY7Q4DYmoDHwXTSw5UNNh6r7j0B/ezMYJMDcw4+6gCTZX4YQ+7Xs8de72vsR3cmfpxIX64/6KR1p3VX4F6vfHEzxzarh8aDH4G1DFoBBM6npXFpK+Rh+WrcFclAeAxi0PoaR9CpOxxGLSdvxKVSw8oOOanG/soKImRopN38AdcUhhM2GT/PgQeSQrG12njuJJD5Z7vWfAZmFybYLdSA91kB4aoBhoj1Z//KNIVVujqaLLRwCkbyn4vh0739C9V9iSjybeOIeSOvNs7LW1a7EUtNoKAnOGML4U8KBXpfrw73WjAszJG4Qscq+Xr3kZWR4Omm0xT6qE9y6FNSpstV4onMZSqCEJ+3VX9qjvdx5QVrM0WXxmPZxejdfnihcFAjzv5PjlTl6ickDbHe6+Lch52pjOPqk+m3RZ+bh2JSMGtFBuODbMchrpRVlt16NTQ05Ps0IDtWlUmWfP2vX8M4YDynIuOZ4Ck91+591B98Gw9fw+yQogTR8CSg0zaJu+rlBo/mr3A+1NziF+kdubz+whc857AZt6DwIBIF5+5yiaaf3ByQp1Fm3sOkZDAzwsYSQTM/Kv6idkugF63FDobDdUY3huruU+sCaBuRR+HmOowvmZoBjZHNh77SXFtmY/oOUE7ifN7nBHAo83S/xvcS6H4Ci2u/9Id62Wv6Ui+zMNLAzhfkTkVcW2BwrnYvpur0ZDlzs+ZLsmGTWvd1892t78gx1YjEJusGcxphjLkV0UfAKlekfSBVWHE2ahk4AbbRmHyL7GYdtKfdlINwrcdJuf3Cee1nfUojDQn/YmItESOFhtLzrkEv4k2XpMU9oaJQ3VUC+1INh6BE68pkHameGJm4Gvdb24Q0fXWxd9Tp3A9mzFSe4qXDGGDIV4AAGV1jIDfveknH1TwWpUT6HiQxKP3AAHJNkJeRlj/mXBmS4S1j8FK6YmpK7jyyAiRbsMCCLoJcx01fvgpMvKQRxu9IOwymconQjD56g7ksOrcOeoTbius4JnGesAS1DtgdaophYsw1wGIsMS3P7K6doE3K5czznqPQLSRRF/Ylzb5NtSKsL33SgskFNCF4khn5LWaDxI23ZRi2hzqN8uW8UzZEBYy68+VtGLSymQrXGUlr2nO2BbBIT5Vh1RmGAyDXaW0FPrpx3wv2UYdFk9tSl+906bMxCuXQaKDQP/U19UEcVGK4gmksL8lAorxQSAOwpeYX9xrZsh6yoGaL/X5O3tgQC8OM+/GvxnW9XvAtu/JxAigydfSmZfqZfg1XOcHNOpLlN8j64OZ36l5qawDBJ62YaTvxeNmm5gowCdBosgcpHOgNgwA+sknN8XmsR2IYChcafl9bGNMZ/nB5guWuvEziv6QI2bP2DtyKWG/qUjZMaxy+wASkkVGtuwGtywkTYG6MYrZBo18vYcww48G/+f+eITA/qMwbLlJC0S3+/ai2pPvkOhRRVmGTuSupaxhIk0xoXLtixCxSAn4Z3OnUS3wBqVscLI4P3GP7i/6gxYsswsVmkvDXFLhO/OKcur8flegCSKiqmVpIRvCzgbjEA0mXPn+RExXY/2OE1f/BYuWpRQY8gCDpMOYBx9Gn4tL3hihSIR1ixh2PIIT7cr2gUJbfs76EKYG52Jk0UZF/PQkBxGuFCEWXnG6ue/hTIqjTRq1sotVrKrwIGHDrITyuanUzbIYdgdEeV88K1VD82TYB2B61Ft+tB1KqHPmT9+hWoaV+iF3SuvtJqvnoLaA8wxrD56AUMULEgzO9SvBcBAfqz/dzMYzwMt/YLszDbmGe1bcHHfFMcvGql9bf/tp+Hrj4q18aNnftGjmXTfws39emn7/5IBxog9MrmftAA5Oq4awenm8HimWO72dwVlHcHmutVMdrMHw+p2vzpzT+B0iIZ+IEpplwWhClcXlxhxAsF3CHRnnaUEqq3ByQ+cqhe5SvR4SFxh/LZoQwtj8QZQGT1BzY2EMpYnUcZWQEPlwFZw+7UryK9qV8KgruYsvyMoK16KI2sN4SOblrVwhyiL8+IBZ8cpUhsJQSU7TFHAi+L2F0sn0y+FtDODlnuif2Mba8QddPZYYxjTsIgkMe3M6+7kXxUfZvbCUlyq71J1eNczGk6Vqw6rSx2K3vM+DjLxDRGzWepTO2qTT/W8S7u0QXcyFUahcB4vq8xCYTpy8iswtnyz7Kx6lgTEQJ9RqkgEIN6DOUqB0uRdeYuDa7AP7Zy9z+ZlTsmVR5vtV71m3dmdtNeWghbr5PnPJtjXAzcvZjxyV96VEx/B1TA0IEQSI50ywGuIbmAYdQg/l/rxhQLX+6uOLyFsaUt6mtjpAJkLfehnB6MlOHnNOrWLvCBqVBS07jcM+4RzLEed3f3/0Xwp92U+nataNHyEgnnuYR6PXEjRLETz0xrt3UglfK7Bn4aNlXG7cZco4lMziLv5+Mh2JCww3mz69Z9ZMRR/xv5EKJ38IFxKd9dw5CgPIXja/gzAshMbF14/qBIgNkdUQeP8YE7SrICGtiTnAKTyA9cXa3OauDHxZOdTP7yuYBzD1UcHstIO16FxF1bRUAlSkszI83YufTchU8OPnnozDl9bS0y6CnnjGwgj9M61cXcZsljjhLeT/Vq+30ScN2PcT/dOoxUDqDS38+OpCCzLDdnwHQc3ECQVIkaxmdPaZTSdfp2jjGzSdNLM5yPQsgJDl+ZnhclDQi8ltUnkqWJ323IvTZPN8rn0+EshL1cx9PiaLTzUsryn9Zp2Nt/detUAh4N/2I3dlMQqjHFxSihv0uykzflq5clMy2ZBaxoEb0/QMp03IQQus3vnZd/NOmSsmgqXqKFP3ozyDgY7RQS+npabe/hNG+5sa5FtvL8v0uYuag2NewYkcol3TOTadpuncCnDgOGpmLnTQ1PEPUN2cNsrW8LYfIv+hzfb7vod+ipXHzmbgj5Fzc6RcT/5PD7VQ8nTJBNj1urkVUx9uJvTWmqY08OC80rGDLaWXv243VB16gjt4Xtwp5H2UDR0LiKW24Ed/sOO8jl1yEU/XAb3h7ScKnCFy/V3sICrkY1D0K9fSokHIL0s5/7DLShLAPXRbV7fbv4qj6OwHC9d5PlEOX3LRpQ3P7hcSAKlIKPDM83ypz56U5+rJeo0cyUtC7wltL8wqEiNSgZsDWzACc7RFoZqhlD0+sihIBQlkQTXmvUyIOZhkQX2zqME5VRC7ms1sa3CY+odMn3mMBiTvCMKnnCxg5ZPLq4GUDB4jF8Br2K4x4sxfWjGXQatJ25I1JyrIv2Z4bP1jKw5C+B2/s0v4dGUOsaS6IPIQV3ETQ+F2fSl2BPBXHzyYN8VmwWIrKeMX9pyGWuAOVXwkxJsRBaBVzLhZDP8ONGncknL5DpTxHN32GgFWMwsc0GmL0oRDmRT8u2lvjAKUIi0MmXhIHSlFeh3Qh5pP6ap4YUd6b569ZIaHgya2AyD12cPxY0In/PBjzDctTaKJCU+xc6m9RkNLDEE8guvxtJP8sl8N9bLqw0F/qejaBlcHYqw31zYpsutQp07hsP1vhGdl4hJ1wA7OCsAHnKj9879uSHILEmuZ6vI1lT4tvnWCVKZhhYrWHW9oPKPKpbOC6FTjf/OtUvwmiXr2ykvyLzHGQeyS7BenZpL3N/CaF5T7Gkml7JXN5cj0PKaDpZVImD61FuMgFHPqSHvt4Ej4KBdAfdcoO3AjQPLwwtKsgGM+ty4lNZMBEItJSRLunG5ckrM/BeoXWoPZVvEoIzLgFQYPupMwZCXis4W2SCJ2zsefZqCj+aTfSq1FYdUj2UeJALvVTf7vuuikOE1Hit3UIAGUi/sqgMum9vw218y1FlY/9XnOji9nqhGAcMYICc7BiqLZj5N+cKEuSAuiyWbMg81ZD1lHovy/we2eaCcCv4MzEW3O0mVA/t2xdA0cxTVbXmFhn+tARDpvDz5ftLr15OAAmvo2QiAky+feVO4bGibv2nlBmBzqx0lEDfEm4UnEs11pbnwZlJ/0Y73/wBPYfTNZiJKR73TzdCW1BffiJq9bLjQmaKnU0+gN8sfe25IKSUCooQwxePDrFn3a/zUgWxvPoTYVXfobY/GV2qqTkeVDV9D8657fhY0/wiaJ5NfLxhXbE/naxs34N0hd6vxNfdm1TCnozm/NKSCThchoYgMF7Z2tzXFovRfsNVkf86JjrM60r7UIuV3bsmfrMOqzjXjN6HPBG25zCJ3QLueySbj9oFvX/HxWBqh31PBPxduCVAxMqC9HK+YL3oBZqBruoh6LKvdMqoz0PYXUBrwbiioyE8Tj5ImjJmiOOWLbAZvIZ/l9rIPljx3T5glJ2ewlfuIT5GlodQsAf/IEtmYkML5SRQGxxwW+rlZkD8belJNu09Itwx9xDULTnemVDeojdbgcd2gKGM9aO00Jivtbs7ZyOSE8IPh98GfvatD8Ud5uHcZfAfMiPSlIxd4UqeSDzuNfbKDuFepkyC/s3j9fawmhY1b9NqDi0ZS5eP35l7rL2eK5QlWLlyCmxx8AFaFiTuD2pMUxZV5mBSJuJduOaq2ZrWpu28DE8jl/hisBz7bGWH6qLF0ayWNq1Sejtcs8KQrQqJk5P9QHDYHOIolgNsMDmEaWcTelghbfFCDqWrq6YLwDWy+m68ec5nShgq2fduUBpQUuKKKgnttaUX9PRfMmxqJyU7e0RLr1bev+ge1KK0bZyhHKKDE8gQX9Vf7rNHWOxBtZcxwwGusyMpH77qWZxXsQmbgIGhtiO+gSSRCyu/ek+OFsz1HMiQH0IHV7PjJi3dszYfFp8ue9h4+AfKte4MTiehPvxNcm/T1t9vsFZx8rHN5ie77r2jzZOq/Em4Q+H9sNcZakf9HnzCc1fJixppxP8FQABmVnqa6GbJhwaka7WH7Wdoz1WxOjSNV8N9sgW5S3Ppgkut+TTCkjA+AodUOk1KIR+8G8S3WrSZG4nyqfJ6FEjXl6a/LEoRMHZUqfPRWvwqrtXYy9IUsmUGzkqi76ib4NANCe5DnyOxnFRZ9d8FdBVBjra3iNuZhJuWW5Omi/hBigqDsg0mu2AhfJDXdwyMIJ33HHHPfS2JtjegRejX11m41TbNL+Qp7mR0g9CPKTj9PIjuSycGN/YPozXI4zarXuAeLv5CHKtKcJKRbd6R2oLNiEt0T8+QIVJH7zt9ncKMgd49vV2P1AyScZ9Qzbu3m3LBnuu6dw7aE0b6r4kzVkI/GUS88mA53L/rLtntkFlZXGtIoqNP2mD3eVv08AVVPT3wJn81zpbJV9SuqZ6Pd1ge0Zz2RFHeCdV5CLPftH9V5o9+VzFu4R0QeumqDwUhXn3IyYotdJnxr1l3BqWnQVAeDBEOtPyJQx1q5+mODiClXtYeBLTWtsJ42AMBcf/IFIhpfhYO08hsg0Ik+DpQFNOKReK3o3cudkxWX0soPtI5eSFOA6yNylS+IQjrQtYQ/5s4UcixJfokumBUjpH9ofSjUTwPCapGFndfqqG5IHeMMvfg+88SXm7bNyjk6pGKzL+WxDAdqKtQ72WWVbOk3I+ueGuammmB2pvFZvqIcU/lvW3n9+r2lycnQLE4OX9R1jIgW4cDjJ3v8dAa66mVcfC7ptCr5io6mCaA9qI9T9FFWqo1ZAaMxgxAu8aXqmaOYryMND2sTUfoHvxcYK7hEiJhCLYFDx3PBhE97c2a0ub1/ePJcyJOqr7UaTAPTJ+xvZtjb/40sloY1ltRnTkWILmIP2b7S3AdXCR+YiArMUHwdncpjpyDGfzqGOUoAuaamWzAMacQtb34/M32FEgR5lUEf8fRzFrZUhzQj0fR7/6gdzdnVVvcSneLmtqJ930VCCDORY8CVdQWdo/S3PNkX3pQsPVKWIYGAMrFZoq8bQ/OJBDSXP7KSBdL3QN0Zqd393p6VFc7DnlnFiN00SY5Nux7yadeIM0Upl2rVsu8/VAI";const Uge=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),zge=4;function Ukt(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),s=1,a=[0,1];for(let F=1;F<r;F++)a.push(s+=n());let o=n(),l=t;t+=o;let c=0,u=0;function d(){return c==0&&(u=u<<8|e[t++],c=8),u>>--c&1}const f=31,x=2**f,g=x>>>1,v=g>>1,w=x-1;let C=0;for(let F=0;F<f;F++)C=C<<1|d();let N=[],I=0,P=x;for(;;){let F=Math.floor(((C-I+1)*s-1)/P),U=0,L=r;for(;L-U>1;){let ne=U+L>>>1;F<a[ne]?L=ne:U=ne}if(U==0)break;N.push(U);let z=I+Math.floor(P*a[U]/s),X=I+Math.floor(P*a[U+1]/s)-1;for(;!((z^X)&g);)C=C<<1&w|d(),z=z<<1&w,X=X<<1&w|1;for(;z&~X&v;)C=C&g|C<<1&w>>>1|d(),z=z<<1^g,X=(X^g)<<1|g|1;I=z,P=1+X-z}let R=r-4;return N.map(F=>{switch(F-R){case 3:return R+65792+(e[l++]<<16|e[l++]<<8|e[l++]);case 2:return R+256+(e[l++]<<8|e[l++]);case 1:return R+e[l++];default:return F-1}})}function zkt(e){let t=0;return()=>e[t++]}function POe(e){return zkt(Ukt(Hkt(e)))}function Hkt(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,a)=>t[s.charCodeAt(0)]=a);let n=e.length,r=new Uint8Array(6*n>>3);for(let s=0,a=0,o=0,l=0;s<n;s++)l=l<<6|t[e.charCodeAt(s)],o+=6,o>=8&&(r[a++]=l>>(o-=8));return r}function Vkt(e){return e&1?~e>>1:e>>1}function Wkt(e,t){let n=Array(e);for(let r=0,s=0;r<e;r++)n[r]=s+=Vkt(t());return n}function HE(e,t=0){let n=[];for(;;){let r=e(),s=e();if(!s)break;t+=r;for(let a=0;a<s;a++)n.push(t+a);t+=s+1}return n}function FOe(e){return VE(()=>{let t=HE(e);if(t.length)return t})}function OOe(e){let t=[];for(;;){let n=e();if(n==0)break;t.push(qkt(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(Gkt(n,e))}return t.flat()}function VE(e){let t=[];for(;;){let n=e(t.length);if(!n)break;t.push(n)}return t}function MOe(e,t,n){let r=Array(e).fill().map(()=>[]);for(let s=0;s<t;s++)Wkt(e,n).forEach((a,o)=>r[o].push(a));return r}function qkt(e,t){let n=1+t(),r=t(),s=VE(t);return MOe(s.length,1+e,t).flatMap((o,l)=>{let[c,...u]=o;return Array(s[l]).fill().map((d,f)=>{let x=f*r;return[c+f*n,u.map(g=>g+x)]})})}function Gkt(e,t){let n=1+t();return MOe(n,1+e,t).map(s=>[s[0],s.slice(1)])}function Kkt(e){let t=[],n=HE(e);return s(r([]),[]),t;function r(a){let o=e(),l=VE(()=>{let c=HE(e).map(u=>n[u]);if(c.length)return r(c)});return{S:o,B:l,Q:a}}function s({S:a,B:o},l,c){if(!(a&4&&c===l[l.length-1])){a&2&&(c=l[l.length-1]),a&1&&t.push(l);for(let u of o)for(let d of u.Q)s(u,[...l,d],c)}}}function Ykt(e){return e.toString(16).toUpperCase().padStart(2,"0")}function ROe(e){return`{${Ykt(e)}}`}function Xkt(e){let t=[];for(let n=0,r=e.length;n<r;){let s=e.codePointAt(n);n+=s<65536?1:2,t.push(s)}return t}function dN(e){let n=e.length;if(n<4096)return String.fromCodePoint(...e);let r=[];for(let s=0;s<n;)r.push(String.fromCodePoint(...e.slice(s,s+=4096)));return r.join("")}function Qkt(e,t){let n=e.length,r=n-t.length;for(let s=0;r==0&&s<n;s++)r=e[s]-t[s];return r}var Zkt="AEUDWAHSCGYATwDVADIAdgAiADQAFAAtABQAIQAPACcADQASAAsAGQAJABIACQARAAUACwAFAAwABQAQAAMABwAEAAoABQAJAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACwANAA0AAwAKAAkABAAdAAYAZwDTAecDNACxCmIB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgPi89uj00MsvBXxEPAGPCDwBnQKoEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJEMAJpIBpob5AERSMAKNoAXqaQLRBMCzEiC+AZ4EWRJJFbEu7QDQLARtEbgECxDwAb/RyAk1AV4nD2cEQQKTAzsAGpobPgAahAGPCrysdy0OAKwAfFIcBAQFUmoA/PtZADkBIadVj2UMUgx5Il4ANQC9vLIBDAHUGVsQ8wCzfQIbGVcCHBZHAZ8CBAgXOhG7AqMZ4M7+1M0UAPDNAWsC+mcJDe8AAQA99zkEXLICyQozAo6lAobcP5JvjQLFzwKD9gU/OD8FEQCtEQL6bW+nAKUEvzjDHsuRyUvOFHcacUz5AqIFRSE2kzsBEQCuaQL5DQTlcgO6twSpTiUgCwIFCAUXBHQEqQV6swAVxUlmTmsCwjqsP/wKJQmXb793UgZBEBsnpRD3DDMBtQE7De1L2ATxBjsEyR99GRkPzZWcCKUt3QztJuMuoYBaI/UqgwXtS/Q83QtNUWgPWQtlCeM6Y4FOAyEBDSKLCt0NOQhtEPMKyWsN5RFFBzkD1UmaAKUHAQsRHTUVtSYQYqwLCTl3Bvsa9guPJq8TKXr8BdMaIQZNASka/wDPLueFsFoxXBxPXwYDCyUjxxSoUCANJUC3eEgaGwcVJakCkUNwSodRNh6TIfY8PQ1mLhNRfAf1PAUZTwuBPJ5Gq0UOEdI+jT1IIklMLAQ1fywvJ4sJzw+FDLl8cgFZCSEJsQxxEzERFzfFCDkHGS2XJCcVCCFGlWCaBPefA/MT0QMLBT8JQQcTA7UcLRMuFSkFDYEk1wLzNtUuswKPVoABFwXLDyUf3xBQR+AO6QibAmUDgyXrAC0VIQAXIpsIQ2MAX4/YUwUuywjHamwjdANnFOdhEXMHkQ5XB6ccMxW/HOFwyF4Lhggoo68JWwF1CZkBXwTjCAk1W4ygIEFnU4tYGJsgYUE/XfwCMQxlFZ9EvYd4AosPaxIbATUBcwc5DQECdxHtEWsQlQjrhgQ1tTP4OiUETyGDIBEKJwNPbM4LJyb5DPhpAaMSYgMMND137merYLYkF/0HGTLFQWAh8QuST80MnBrBGEJULhnkB78D8xrzJ+pBVwX/A6MDEzpNM+4EvQtpCIsJPwBJDqMXB9cYagpxjNABMYsBt5kDV5GDAm+PBjcHCwBnC4cFeeUAHQKnCKMABQDPA1cAOQKtB50AGQCFQQE9AycvASHlAo8DkwgxywGVLwHzKQQbwwwVAPc3bkoCw7ECgGpmogXdWAKOAkk1AU0lBAVOR1EDr3HhANsASwYT30cBFatKyxrjQwHfbysAxwD7AAU1BwVBAc0B820AtwFfCzEJorO1AU3pKQCDABVrAdcCiQDdADUAf/EBUwBNBVn5BdMCT0kBETEYK1dhAbsDHwEzAQ0AeQbLjaXJBx8EbQfTAhAbFeEC7y4HtQEDIt8TzULFAr3eVaFgAmSBAmJCW02vWzcgAqH3AmiYAmYJAp+EOBsLAmY7AmYmBG4EfwN/EwN+kjkGOXcXOYI6IyMCbB0CMjY4CgJtxwJtru+KM2dFKwFnAN4A4QBKBQeYDI0A/gvCAA21AncvAnaiPwJ5S0MCeLodXNtFrkbXAnw/AnrIAn0JAnzwBVkFIEgASH1jJAKBbQKAAAKABQJ/rklYSlsVF0rMAtEBAtDMSycDiE8Dh+ZExZEyAvKhXQMDA65LzkwtJQPPTUxNrwKLPwKK2MEbBx1DZwW3Ao43Ao5cQJeBAo7ZAo5ceFG0UzUKUtRUhQKT+wKTDADpABxVHlWvVdAGLBsplYYy4XhmRTs5ApefAu+yWCGoAFklApaPApZ8nACpWaxaCYFNADsClrUClk5cRFzRApnLAplkXMpdBxkCnJs5wjqdApwWAp+bAp64igAdDzEqDwKd8QKekgC1PWE0Ye8CntMCoG4BqQKenx8Cnk6lY8hkJyUrAievAiZ+AqD7AqBMAqLdAqHEAqYvAqXOAqf/AH0Cp/JofGixAANJahxq0QKs4wKsrgKtZwKtAgJXHQJV3AKx4dcDH05slwKyvQ0CsugXbOBtY21IXwMlzQK2XDs/bpADKUUCuF4CuUcVArkqd3A2cOECvRkCu9pwlgMyEQK+iHICAzNxAr4acyJzTwLDywLDBHOCdEs1RXTgAzynAzyaAz2/AsV8AsZHAsYQiQLIaVECyEQCyU8CyS4CZJ0C3dJ4eWF4rnklS9ADGKNnAgJh9BnzlSR7C16SXrsRAs9rAs9sL0tT0vMTnwDGrQLPcwEp6gNOEn5LBQLcJwLbigLSTwNSXANTXwEBA1WMgIk/AMsW7WBFghyC04LOg40C2scC2d6EEIRJpzwDhqUALwNkDoZxWfkAVQLfZQLeuHN3AuIv7RQB8zAnAfSbAfLShwLr8wLpcHkC6vkC6uQA+UcBuQLuiQLrnJaqlwMC7j8DheCYeXDgcaEC8wMAaQOOFpmTAvcTA5FuA5KHAveYAvnZAvhmmhyaq7s3mx4DnYMC/voBGwA5nxyfswMFjQOmagOm2QDRxQMGaqGIogUJAwxJAtQAPwMA4UEXUwER8wNrB5dnBQCTLSu3r73bAYmZFH8RBDkB+ykFIQ6dCZ8Akv0TtRQrxQL3LScApQC3BbmOkRc/xqdtQS4UJo0uAUMBgPwBtSYAdQMOBG0ALAIWDKEAAAoCPQJqA90DfgSRASBFBSF8CgAFAEQAEwA2EgJ3AQAF1QNr7wrFAgD3Cp8nv7G35QGRIUFCAekUfxE0wIkABAAbAFoCRQKEiwAGOlM6lI1tALg6jzrQAI04wTrcAKUA6ADLATqBOjs5/Dn5O3aJOls7nok6bzkYAVYBMwFsBS81XTWeNa01ZjV1NbY1xTWCNZE10jXhNZ41rTXuNf01sjXBNgI2ETXGNdU2FjYnNd417TYuNj02LjUtITY6Nj02PDbJNwgEkDxXNjg23TcgNw82yiA3iTcwCgSwPGc2JDcZN2w6jTchQtRDB0LgQwscDw8JmyhtKFFVBgDpfwDpsAD+mxQ91wLpNSMArQC9BbeOkRdLxptzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgELgEaJZkC7aMAoQCjBcGOmxdNxrsBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUHqSvAj5Gqwr7YrMUACT9AN3rpF27H7fsd/twPt4l+UW1yQYKBt2Cgy7qJpGiLcdE2P1cQSImUbqJ6ICH27H4knQMIRMrFkHu3sx6tC35Y+eLIh4e4CMKJ4DfyV+8mfta499RCAJ0xfeZR8PsoYOApva9pjGn4PhvyZS7/h5JLuhaucfjuU+Z584wwqNO4hWYmaBCcjgQPale1bjoHzMUbut/zTgxHxBnAyrdKpF4IRMASLBtD/jviyLeCgj8twWjAd3HchN/uqaeRYeHJgl7JEY9/cTrvtfybx/r3Y/NtxJ9dp+MTVmiS9bwBH73s8Di56/Ma+mTPMHq4T1yEG1fWcqr0u+hrGnJEvU1JJAm/maQSrKrazIyvSkDFkj8UUlfBq8baniTGPng6YZRL661rDNw4w/1g2figG0IhXnL7wosd/sVNo5dYSmMBTP5c7rYLjRdCwg8quwljOMPf63D8ICAL0r71XRiyFHdgwHbwfgnPOf4Lzjf2v+j+IiDHG2isp5yUnzSDyDRb4i/Vs0qHSHq8PiEQ/JnBP7PxnjN0j6gT4AVAeRx/1o9VnEUlUwvFrzJqHk9jxAw4sYxCnrxaeBdCFFKbnE7z+x54F5W7ZZsU6kx8Qocul6FoAHHy01FGL/nne61mn4+uYXfQ1Uccn+HMLKE+cZzT8BB1E3FRskOgJrRsq25rauLm8+uamXpkS/bTy6y1wDbCrW4eD532kTWrtNUmVVZOIn/C+/JR9KVR5iG9TY8iaT67ubm/whL1xbKZoqtY+a6fNxMJrg211bGYJDUkYMNWA0BMB++9zOm6Eik4roqs9CCEFW0lyAK0PbvlzvoxrZuY/OEhNW/l/63U15Od/RSvmDvXpGLiVmeGi5PDSH2bYz5o2g6wFDQ2FbZgYgTF8rPlvA1ifjZD3NLtFdXdpSIJvgKR7GpjJWG7GZGawPomIH8B5tUmtHH9LpM+/KQKunEPa1GiQkCXv4Cnm9DLORo2joicHdPDZ64obQrPZ5bgqckkj0G6/NEiPYBY4bCkL7W8G5YzsUb6GakFjykSPkT7JGeLeB6uJOGMm+x7N381BCDfbJFx0dtLgV9Q477BfL1fvitX5anV/oYfxeYl+eF5x5bB8+Ep/L2nsmd56aKF4aAD4GbJWsdKyBW22xEmAD3XdbtsMyAFoR5mOla0gEd9U/YVB7zvHGpHbQonay9Sv0bQ8iZ8piaXVrKc5AG1AmqqgaEvzHSP2Wux7aZTWh6quVDVU01JtMIVRdCFwlSbbqqhoFlyzsotQzRexFvZ/MqUSFu3OhRIuNBbufvBpdVgb8XdGJ48/lJPCZ7dsOujTTbKPSEvGXkOnG2Xdi8/nM3EMRqITd5QeU7iOjKqC7URJY6TnLsHij22xAHKnVRD5MDtBYnoGFqZGMDmXCW6Oj+BAWw14hESY/xLF6bLku06AHkiXTHPCFZ0f9YSqqo27eAhhS67OrA2Het4M9JM3jm/yRX6bYxnfmzYl5qQdHxN08FsNuWDrWd4vMUY2QD3hr8vS73SCTkFoXZR3xNzOQt8d/6HfjBmXqvrE6EGkLzK6YK2U2/ksU/iUH+LvVIsJI+ri2AL/klo+ShdDyfs5A83i2prkMs51IKR7ZcqjZJi5X3+bd8GlyWvtddxKEoEqSgEO7A8jIgf2nH0h8FjM7oB6yte3X5mpL0i/E4Rx0CotKnILJj/vJqo4VkPQ93jRtRVfaitQPqldl5xRYPq8387Z0DcnZvOeION0Ht1+P27kFLGQIcLBX4FG3sffccNHh5cPfzp9INoRtqVtdViJfg8RjnXiIz/MNqEN6zvzX3hMzyWC7oSoXIT14ubc0abPX8Rp9GVa5NI/8iv+6ela1oTncbdimRKnrbRffDR/X4nH+bgqAuHWl7hOaeXPWVzIeRl7ga+JzD4Sx3mlj/q6Ra/E2HhDf21eEzTLNGfCZsY+/yxZzQzIAuijG65ii4O/waAJCrEJaWd/DRAKMQ5678Dw5AT7RCKzdadIwd8LsD+DgPBASmWsUlf8R0k1w/2k4lO2Wpb4zMI6EJVJs0xk/wn8/fRUPqrDKhbjHR41SqgFMx5RGMPuduFwlu5lK89tW11sTqiX/5EfGs5nO+y9FKvgXKPOEmgE05EKNL6Sjb3xS40H3BVPhm0ESOZgAjZoymc8be0inDVo4JdJVf+NKd3tN/CaB7GShhH27qf95NoFZVX/6ZkR2lX+CgWrQ2INgkh+bbMz68+uJ3Clsh8HSMPEQtAt+BBE6fXDab7KIlsKxU1lIXW/KWVstpdPanJ0pdXpQinDyUQjtY7ZVcfiecRxRDMAUhHFU2cEaciQ+htiPMPx1kdvtWG9T44w3r037ljHBFJdYR0r55qvMRixtAEFJAqA4T1ES87FAx7UozXasytg8MftZYt0rjYgLe6EJ5aWvy2qscBSBQ7yehoJIA3wIIZ9ukfkyBb6qnue5ko8W50rpV4kXqWjI5nbGRXrNW0tBZHXlY48nSgcUXBHWT4GcgLZJoLlKJnV96kCYpq9eWHh7xJzkCAyrQuQ5AJ0qq/uZ3toJglNterev+Qm0KXxPg/+YbFRJdfhbp1wOnVOEYdVHTya6CtO0afhEaBhx3oHwCb5Kq6RwHDzFMl2vfjL8GwzcCoTj7wZe+UFnYDV2yKpPU9dba29gYBdNqJg/KXozO+CJTlKmlKhnqTf5doeS35DZFV+cYJQVjd+oVY/Gtc/6XPzUxb1gMqf6cEjNNoRC8AObrp+fx0cVtGu4ffC2TgXRC8zPl8moUHCB5HZ25d87mlsiiK0aNwBtcEQjRNBT/QrXbw/8aVXdKMHn9EqYEKEyxSGTpYQOaes1G1Qq8pDgqkZtlO2HRyCXpmeM7TSrRPkAh004BfisVpF6zP44n2Jvxz/gOVocNCyy9V6lkod28QM4pbaMvVJigD/w3BrsjSJrXlqc4ulBYOCceiBN4b/gHajYyupbhEt63a619Ay4wsL6a6w6B+A7TnoyE7BliWHJfzVxxIKM/W3M/J8Bx99Op863Q8eNuIMGRx++VbYfjm+VGYBA3Ap/KEu/wxBNBpJJncwHPG45V8Gh98ZIrGCc20MwijGowZbcS7d1nEgcOW5cddZpHL2XPAIRbColiheZzXTvBxZOY3iMSDSKDrICyJ/iQs1vdplVdH/JrLJsQ2jtTnfCrITIghq3KFX3qAgLWAIp8IffNSdTYptnbGfc8s+qcr3zyzyHp1aJg+jxTF4kD1ry5Wauv5V3xnOGwTFecNzXSLHBW20/pCQjk4uorD0plIhMSTc79+/r4RKPClRYTBYex1Ob5crtfvRQBBv6re/6FhtCqtduag67glqRA77/3ulblh9YRtMdDxkCyJDeNnAuCLPQFmdRRWJtH20Z8DstfJf+5oj5SSB64d0iF5/Ya4KfTWxfivj9Ap2/zbYaTo/1gO3tM6RYsCZharMBFr7Fm61mLSrQnEI4OF1gbVS4k/JE9UotOrnLJZuswoWodCSV8zbybkJSVIP7n8UaE9xCR39rJZmf27HOAPVOGc9pdkQUcRrI0qyVF9Z3j1RHDbxIfwbWzmPVjwIdPJvtmBYwEQIUsIW1S939hcVikK00ozPRI02cqhzVUNzpOxVdrwRPvlh1aIOf0xFEqD3YkGnCnFah/cFN3J2gB7N+bZSGawwkKFu1tpQMrp1W+27YNkyT0TpcFpTqgOqqLabrgcCUPxh97mREOGy4xItzQ9xSl6rq+8BZsHcrQFReS+QeMxJ3P6CnL9EP/eOLDjumLhvrcQrpPiknsofbzBv9gTP0lU+TIVwE6E7CcKfT36q+ZiEOHJ9ayf0dyUJLezAb2M8aNHwd0+OJmsVgTzRWA";const WE=44032,wR=4352,CR=4449,SR=4519,LOe=19,DOe=21,fN=28,NR=DOe*fN,Jkt=LOe*NR,eTt=WE+Jkt,tTt=wR+LOe,nTt=CR+DOe,rTt=SR+fN;function Cj(e){return e>>24&255}function BOe(e){return e&16777215}let Bee,Hge,$ee,mO;function sTt(){let e=POe(Zkt);Bee=new Map(FOe(e).flatMap((t,n)=>t.map(r=>[r,n+1<<24]))),Hge=new Set(HE(e)),$ee=new Map,mO=new Map;for(let[t,n]of OOe(e)){if(!Hge.has(t)&&n.length==2){let[r,s]=n,a=mO.get(r);a||(a=new Map,mO.set(r,a)),a.set(s,t)}$ee.set(t,n.reverse())}}function $Oe(e){return e>=WE&&e<eTt}function iTt(e,t){if(e>=wR&&e<tTt&&t>=CR&&t<nTt)return WE+(e-wR)*NR+(t-CR)*fN;if($Oe(e)&&t>SR&&t<rTt&&(e-WE)%fN==0)return e+(t-SR);{let n=mO.get(e);return n&&(n=n.get(t),n)?n:-1}}function UOe(e){Bee||sTt();let t=[],n=[],r=!1;function s(a){let o=Bee.get(a);o&&(r=!0,a|=o),t.push(a)}for(let a of e)for(;;){if(a<128)t.push(a);else if($Oe(a)){let o=a-WE,l=o/NR|0,c=o%NR/fN|0,u=o%fN;s(wR+l),s(CR+c),u>0&&s(SR+u)}else{let o=$ee.get(a);o?n.push(...o):s(a)}if(!n.length)break;a=n.pop()}if(r&&t.length>1){let a=Cj(t[0]);for(let o=1;o<t.length;o++){let l=Cj(t[o]);if(l==0||a<=l){a=l;continue}let c=o-1;for(;;){let u=t[c+1];if(t[c+1]=t[c],t[c]=u,!c||(a=Cj(t[--c]),a<=l))break}a=Cj(t[o])}}return t}function aTt(e){let t=[],n=[],r=-1,s=0;for(let a of e){let o=Cj(a),l=BOe(a);if(r==-1)o==0?r=l:t.push(l);else if(s>0&&s>=o)o==0?(t.push(r,...n),n.length=0,r=l):n.push(l),s=o;else{let c=iTt(r,l);c>=0?r=c:s==0&&o==0?(t.push(r),r=l):(n.push(l),s=o)}}return r>=0&&t.push(r,...n),t}function zOe(e){return UOe(e).map(BOe)}function oTt(e){return aTt(UOe(e))}const Vge=45,HOe=".",VOe=65039,WOe=1,AR=e=>Array.from(e);function qE(e,t){return e.P.has(t)||e.Q.has(t)}let lTt=class extends Array{get is_emoji(){return!0}},Uee,qOe,Qv,zee,GOe,l4,NV,SC,Nv,Wge,Hee;function Loe(){if(Uee)return;let e=POe($kt);const t=()=>HE(e),n=()=>new Set(t()),r=(d,f)=>f.forEach(x=>d.add(x));Uee=new Map(OOe(e)),qOe=n(),Qv=t(),zee=new Set(t().map(d=>Qv[d])),Qv=new Set(Qv),GOe=n(),n();let s=FOe(e),a=e();const o=()=>{let d=new Set;return t().forEach(f=>r(d,s[f])),r(d,t()),d};l4=VE(d=>{let f=VE(e).map(x=>x+96);if(f.length){let x=d>=a;f[0]-=32,f=dN(f),x&&(f=`Restricted[${f}]`);let g=o(),v=o(),w=!e();return{N:f,P:g,Q:v,M:w,R:x}}}),NV=n(),SC=new Map;let l=t().concat(AR(NV)).sort((d,f)=>d-f);l.forEach((d,f)=>{let x=e(),g=l[f]=x?l[f-x]:{V:[],M:new Map};g.V.push(d),NV.has(d)||SC.set(d,g)});for(let{V:d,M:f}of new Set(SC.values())){let x=[];for(let v of d){let w=l4.filter(N=>qE(N,v)),C=x.find(({G:N})=>w.some(I=>N.has(I)));C||(C={G:new Set,V:[]},x.push(C)),C.V.push(v),r(C.G,w)}let g=x.flatMap(v=>AR(v.G));for(let{G:v,V:w}of x){let C=new Set(g.filter(N=>!v.has(N)));for(let N of w)f.set(N,C)}}Nv=new Set;let c=new Set;const u=d=>Nv.has(d)?c.add(d):Nv.add(d);for(let d of l4){for(let f of d.P)u(f);for(let f of d.Q)u(f)}for(let d of Nv)!SC.has(d)&&!c.has(d)&&SC.set(d,WOe);r(Nv,zOe(Nv)),Wge=Kkt(e).map(d=>lTt.from(d)).sort(Qkt),Hee=new Map;for(let d of Wge){let f=[Hee];for(let x of d){let g=f.map(v=>{let w=v.get(x);return w||(w=new Map,v.set(x,w)),w});x===VOe?f.push(...g):f=g}for(let x of f)x.V=d}}function Doe(e){return(KOe(e)?"":`${Boe(y$([e]))} `)+ROe(e)}function Boe(e){return`"${e}"‎`}function cTt(e){if(e.length>=4&&e[2]==Vge&&e[3]==Vge)throw new Error(`invalid label extension: "${dN(e.slice(0,4))}"`)}function uTt(e){for(let n=e.lastIndexOf(95);n>0;)if(e[--n]!==95)throw new Error("underscore allowed only at start")}function dTt(e){let t=e[0],n=Uge.get(t);if(n)throw Jj(`leading ${n}`);let r=e.length,s=-1;for(let a=1;a<r;a++){t=e[a];let o=Uge.get(t);if(o){if(s==a)throw Jj(`${n} + ${o}`);s=a+1,n=o}}if(s==r)throw Jj(`trailing ${n}`)}function y$(e,t=1/0,n=ROe){let r=[];fTt(e[0])&&r.push("◌"),e.length>t&&(t>>=1,e=[...e.slice(0,t),8230,...e.slice(-t)]);let s=0,a=e.length;for(let o=0;o<a;o++){let l=e[o];KOe(l)&&(r.push(dN(e.slice(s,o))),r.push(n(l)),s=o+1)}return r.push(dN(e.slice(s,a))),r.join("")}function fTt(e,t){return Loe(),Qv.has(e)}function KOe(e){return Loe(),GOe.has(e)}function hTt(e){return gTt(pTt(e,oTt,vTt))}function pTt(e,t,n){if(!e)return[];Loe();let r=0;return e.split(HOe).map(s=>{let a=Xkt(s),o={input:a,offset:r};r+=a.length+1;try{let l=o.tokens=yTt(a,t,n),c=l.length,u;if(!c)throw new Error("empty label");let d=o.output=l.flat();if(uTt(d),!(o.emoji=c>1||l[0].is_emoji)&&d.every(x=>x<128))cTt(d),u="ASCII";else{let x=l.flatMap(g=>g.is_emoji?[]:g);if(!x.length)u="Emoji";else{if(Qv.has(d[0]))throw Jj("leading combining mark");for(let w=1;w<c;w++){let C=l[w];if(!C.is_emoji&&Qv.has(C[0]))throw Jj(`emoji + combining mark: "${dN(l[w-1])} + ${y$([C[0]])}"`)}dTt(d);let g=AR(new Set(x)),[v]=xTt(g);bTt(v,x),mTt(v,g),u=v.N}}o.type=u}catch(l){o.error=l}return o})}function mTt(e,t){let n,r=[];for(let s of t){let a=SC.get(s);if(a===WOe)return;if(a){let o=a.M.get(s);if(n=n?n.filter(l=>o.has(l)):AR(o),!n.length)return}else r.push(s)}if(n){for(let s of n)if(r.every(a=>qE(s,a)))throw new Error(`whole-script confusable: ${e.N}/${s.N}`)}}function xTt(e){let t=l4;for(let n of e){let r=t.filter(s=>qE(s,n));if(!r.length)throw l4.some(s=>qE(s,n))?XOe(t[0],n):YOe(n);if(t=r,r.length==1)break}return t}function gTt(e){return e.map(({input:t,error:n,output:r})=>{if(n){let s=n.message;throw new Error(e.length==1?s:`Invalid label ${Boe(y$(t,63))}: ${s}`)}return dN(r)}).join(HOe)}function YOe(e){return new Error(`disallowed character: ${Doe(e)}`)}function XOe(e,t){let n=Doe(t),r=l4.find(s=>s.P.has(t));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${e.N} + ${n}`)}function Jj(e){return new Error(`illegal placement: ${e}`)}function bTt(e,t){for(let n of t)if(!qE(e,n))throw XOe(e,n);if(e.M){let n=zOe(t);for(let r=1,s=n.length;r<s;r++)if(zee.has(n[r])){let a=r+1;for(let o;a<s&&zee.has(o=n[a]);a++)for(let l=r;l<a;l++)if(n[l]==o)throw new Error(`duplicate non-spacing marks: ${Doe(o)}`);if(a-r>zge)throw new Error(`excessive non-spacing marks: ${Boe(y$(n.slice(r-1,a)))} (${a-r}/${zge})`);r=a}}}function yTt(e,t,n){let r=[],s=[];for(e=e.slice().reverse();e.length;){let a=wTt(e);if(a)s.length&&(r.push(t(s)),s=[]),r.push(n(a));else{let o=e.pop();if(Nv.has(o))s.push(o);else{let l=Uee.get(o);if(l)s.push(...l);else if(!qOe.has(o))throw YOe(o)}}}return s.length&&r.push(t(s)),r}function vTt(e){return e.filter(t=>t!=VOe)}function wTt(e,t){let n=Hee,r,s=e.length;for(;s&&(n=n.get(e[--s]),!!n);){let{V:a}=n;a&&(r=a,e.length=s)}return r}const CTt=e=>hTt(e),p0=e=>{let t="";for(let n=0;n<32;n+=1)t+="00";if(e){const r=CTt(e).split(".");for(let s=r.length-1;s>=0;s-=1){const a=zf(r[s]).slice(2);t=zf(`0x${t}${a}`).slice(2)}}return`0x${t}`};var fP=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class STt{constructor(t,n){this.contract=new e3(Dkt,n??vR.main,t),this.context=t}getOwner(t){return fP(this,void 0,void 0,function*(){try{return this.contract.methods.owner(p0(t)).call()}catch{throw new Error}})}getTTL(t){return fP(this,void 0,void 0,function*(){try{return this.contract.methods.ttl(p0(t)).call()}catch{throw new Error}})}recordExists(t){return fP(this,void 0,void 0,function*(){try{return this.contract.methods.recordExists(p0(t)).call()}catch{throw new Error}})}getResolver(t){return fP(this,void 0,void 0,function*(){try{return this.contract.methods.resolver(p0(t)).call().then(n=>{if(typeof n=="string")return new e3(Bkt,n,this.context);throw new Error})}catch{throw new Error}})}get events(){return this.contract.events}}var Bx=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class NTt{constructor(t){this.registry=t}getResolverContractAdapter(t){return Bx(this,void 0,void 0,function*(){return this.registry.getResolver(t)})}checkInterfaceSupport(t,n){var r,s;return Bx(this,void 0,void 0,function*(){if(Xs($ge[n]))throw new Dxe((r=t.options.address)!==null&&r!==void 0?r:"",n);if(!(yield t.methods.supportsInterface($ge[n]).call()))throw new Dxe((s=t.options.address)!==null&&s!==void 0?s:"",n)})}supportsInterface(t,n){var r;return Bx(this,void 0,void 0,function*(){const s=yield this.getResolverContractAdapter(t);let a=n;if(!Ca(a)){if(a=(r=Jk(n))!==null&&r!==void 0?r:"",n==="")throw new Error("Invalid interface Id");a=a.slice(0,10)}return s.methods.supportsInterface(a).call()})}getAddress(t,n=60){return Bx(this,void 0,void 0,function*(){const r=yield this.getResolverContractAdapter(t);return yield this.checkInterfaceSupport(r,V6.addr),r.methods.addr(p0(t),n).call()})}getPubkey(t){return Bx(this,void 0,void 0,function*(){const n=yield this.getResolverContractAdapter(t);return yield this.checkInterfaceSupport(n,V6.pubkey),n.methods.pubkey(p0(t)).call()})}getContenthash(t){return Bx(this,void 0,void 0,function*(){const n=yield this.getResolverContractAdapter(t);return yield this.checkInterfaceSupport(n,V6.contenthash),n.methods.contenthash(p0(t)).call()})}setAddress(t,n,r){return Bx(this,void 0,void 0,function*(){const s=yield this.getResolverContractAdapter(t);return yield this.checkInterfaceSupport(s,V6.setAddr),s.methods.setAddr(p0(t),n).send(r)})}getText(t,n){return Bx(this,void 0,void 0,function*(){const r=yield this.getResolverContractAdapter(t);return yield this.checkInterfaceSupport(r,V6.text),r.methods.text(p0(t),n).call()})}getName(t,n=!0){return Bx(this,void 0,void 0,function*(){const r=`${t.toLowerCase().substring(2)}.addr.reverse`,s=yield this.getResolverContractAdapter(r);return n&&(yield this.checkInterfaceSupport(s,V6.name)),s.methods.name(p0(r)).call()})}}var hh=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class QOe extends Vd{constructor(t,n){super(n??""),this.registryAddress=t??vR.main,this._registry=new STt(this.getContextObject(),t),this._resolver=new NTt(this._registry)}getResolver(t){return hh(this,void 0,void 0,function*(){return this._registry.getResolver(t)})}recordExists(t){return hh(this,void 0,void 0,function*(){return this._registry.recordExists(t)})}getTTL(t){return hh(this,void 0,void 0,function*(){return this._registry.getTTL(t)})}getOwner(t){return hh(this,void 0,void 0,function*(){return this._registry.getOwner(t)})}getAddress(t,n=60){return hh(this,void 0,void 0,function*(){return this._resolver.getAddress(t,n)})}getText(t,n){return hh(this,void 0,void 0,function*(){return Uf(t)?this._resolver.getText(yield this._resolver.getName(t,!1),n):this._resolver.getText(t,n)})}getName(t,n=!0){return hh(this,void 0,void 0,function*(){return this._resolver.getName(t,n)})}getPubkey(t){return hh(this,void 0,void 0,function*(){return this._resolver.getPubkey(t)})}getContenthash(t){return hh(this,void 0,void 0,function*(){return this._resolver.getContenthash(t)})}checkNetwork(){return hh(this,void 0,void 0,function*(){const t=Date.now()/1e3;if(!this._lastSyncCheck||t-this._lastSyncCheck>3600){const s=yield Y_t(this);if(!(typeof s=="boolean"&&!s))throw new aNt;this._lastSyncCheck=t}if(this._detectedAddress)return this._detectedAddress;const n=yield Noe(this,Object.assign(Object.assign({},this.defaultReturnFormat),{number:Vh.HEX})),r=vR[Lkt[n]];if(typeof r>"u")throw new iNt(n);return this._detectedAddress=r,this._detectedAddress})}supportsInterface(t,n){return hh(this,void 0,void 0,function*(){return this._resolver.supportsInterface(t,n)})}get events(){return this._registry.events}setAddress(t,n,r){return hh(this,void 0,void 0,function*(){return this._resolver.setAddress(t,n,r)})}}var C1=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const ATt=e=>C1(void 0,void 0,void 0,function*(){return(yield kEt(e)).map(ox)}),jTt=(e,t)=>C1(void 0,void 0,void 0,function*(){Us.validate(["string"],[t]);const n=yield TEt(e,t);return ox(n)}),ETt=(e,t,n,r)=>C1(void 0,void 0,void 0,function*(){return Us.validate(["address","string","uint"],[t,n,r]),IEt(e,t,n,r)}),_Tt=(e,t)=>C1(void 0,void 0,void 0,function*(){return Us.validate(["address"],[t]),PEt(e,t)}),kTt=(e,t,n)=>C1(void 0,void 0,void 0,function*(){return Us.validate(["string","string"],[t,n]),FEt(e,t,n)}),TTt=(e,t,n,r)=>C1(void 0,void 0,void 0,function*(){const s=tf(t,ui,{transactionSchema:r==null?void 0:r.customTransactionSchema});return OEt(e,s,n)}),ITt=(e,t,n,r)=>C1(void 0,void 0,void 0,function*(){const s=tf(t,ui,{transactionSchema:r==null?void 0:r.customTransactionSchema});return MEt(e,s,n)}),PTt=(e,t,n,r)=>C1(void 0,void 0,void 0,function*(){Us.validate(["string","address","string"],[t,n,r]);const s=Ca(t)?t:fm(t);return REt(e,s,n,r)}),FTt=(e,t,n)=>C1(void 0,void 0,void 0,function*(){Us.validate(["string","string"],[t,n]);const r=Ca(t)?t:fm(t);return LEt(e,r,n)});var $x=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class ZOe extends Vd{getAccounts(){return $x(this,void 0,void 0,function*(){return ATt(this.requestManager)})}newAccount(t){return $x(this,void 0,void 0,function*(){return jTt(this.requestManager,t)})}unlockAccount(t,n,r){return $x(this,void 0,void 0,function*(){return ETt(this.requestManager,t,n,r)})}lockAccount(t){return $x(this,void 0,void 0,function*(){return _Tt(this.requestManager,t)})}importRawKey(t,n){return $x(this,void 0,void 0,function*(){return kTt(this.requestManager,t,n)})}sendTransaction(t,n){return $x(this,void 0,void 0,function*(){return TTt(this.requestManager,t,n,this.config)})}signTransaction(t,n){return $x(this,void 0,void 0,function*(){return ITt(this.requestManager,t,n,this.config)})}sign(t,n,r){return $x(this,void 0,void 0,function*(){return PTt(this.requestManager,t,n,r)})}ecRecover(t,n){return $x(this,void 0,void 0,function*(){return FTt(this.requestManager,t,n)})}}var v0;(function(e){e.HTTPS="https",e.WebSocket="wss"})(v0||(v0={}));var fs;(function(e){e.ETH_MAINNET="eth_mainnet",e.ETH_SEPOLIA="eth_sepolia",e.ETH_HOLESKY="eth_holesky",e.POLYGON_MAINNET="polygon_mainnet",e.POLYGON_AMOY="polygon_amoy",e.AVALANCHE_C_MAINNET="avalanche_c_mainnet",e.AVALANCHE_P_MAINNET="avalanche_p_mainnet",e.AVALANCHE_X_MAINNET="avalanche_x_mainnet",e.ARBITRUM_MAINNET="arbitrum_mainnet",e.ARBITRUM_SEPOLIA="arbitrum_sepolia",e.BASE_MAINNET="base_mainnet",e.BASE_SEPOLIA="base_sepolia",e.OPTIMISM_MAINNET="optimism_mainnet",e.OPTIMISM_SEPOLIA="optimism_sepolia",e.FANTOM_MAINNET="fantom_mainnet",e.FANTOM_TESTNET="fantom_testnet",e.DYMENSION_MAINNET="dymension_mainnet",e.DYMENSION_TESTNET="dymension_testnet",e.BNB_MAINNET="bnb_mainnet",e.BNB_TESTNET="bnb_testnet",e.BSC_MAINNET="bsc_mainnet",e.BSC_TESTNET="bsc_testnet",e.ARBITRUM_ONE="arbitrum_one",e.ARBITRUM_NOVA="arbitrum_nova",e.AVALANCHE_FUJI_C="avalanche_fuji_c",e.AVALANCHE_FUJI_P="avalanche_fuji_p",e.AVALANCHE_FUJI_X="avalanche_fuji_x",e.BLAST_MAINNET="blast_mainnet",e.OPBNB_MAINNET="opbnb_mainnet",e.OPBNB_TESTNET="opbnb_testnet",e.GNOSIS_MAINNET="gnosis_mainnet",e.GNOSIS_CHIADO="gnosis_chiado",e.PULSECHAIN_MAINNET="pulsechain_mainnet",e.PULSECHAIN_TESTNET="pulsechain_testnet",e.KAVA_MAINNET="kava_mainnet",e.CRONOS_MAINNET="cronos_mainnet",e.MANTLE_MAINNET="mantle_mainnet",e.CHILIZ_MAINNET="chiliz_mainnet",e.CHILIZ_SPICY="chiliz_spicy",e.MOONBEAM_MAINNET="moonbeam_mainnet",e.TAIKO_MAINNET="taiko_mainnet",e.TAIKO_HEKLA="taiko_hekla",e.LINEA_MAINNET="linea_mainnet",e.LINEA_SEPOLIA="linea_sepolia",e.BAHAMUT_MAINNET="bahamut_mainnet",e.SCROLL_MAINNET="scroll_mainnet",e.SCROLL_SEPOLIA="scroll_sepolia",e.TRON_MAINNET="tron_mainnet",e.SYSCOIN_MAINNET="syscoin_mainnet",e.SYSCOIN_TANENBAUM="syscoin_tanenbaum",e.MOONRIVER_MAINNET="moonriver_mainnet",e.HAQQ_MAINNET="haqq_mainnet",e.EVMOS_MAINNET="evmos_mainnet",e.EVMOS_TESTNET="evmos_testnet",e.BERACHAIN_TESTNET="berachain_testnet"})(fs||(fs={}));const OTt=1300;class MTt extends ii{constructor(t){super("You've reach the rate limit of free RPC calls from our Partner Quick Nodes. There are two options you can either create a paid Quick Nodes account and get 20% off for 2 months using WEB3JS referral code, or use Free public RPC endpoint.",t),this.code=OTt}}const RTt=1301;class qge extends ii{constructor(t){super(`Invalid provider config options given for ${t}`),this.code=RTt}}var LTt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};class JOe extends loe{constructor(t,n,r,s,a){if(super(),a!==void 0&&n===v0.HTTPS&&!("providerOptions"in a))throw new qge("HTTP Provider");if(a!==void 0&&n===v0.WebSocket&&!("socketOptions"in a||"reconnectOptions"in a))throw new qge("Websocket Provider");this.transport=n,n===v0.HTTPS?this.provider=new l$(this.getRPCURL(t,n,r,s),a):n===v0.WebSocket&&(this.provider=new dFe(this.getRPCURL(t,n,r,s),a==null?void 0:a.socketOptions,a==null?void 0:a.reconnectOptions))}request(t,n){return LTt(this,void 0,void 0,function*(){return this.transport===v0.HTTPS?yield this.provider.request(t,n):this.provider.request(t)})}getStatus(){return this.provider.getStatus()}supportsSubscriptions(){return this.provider.supportsSubscriptions()}once(t,n){var r;!((r=this.provider)===null||r===void 0)&&r.once&&this.provider.once(t,n)}removeAllListeners(t){var n;!((n=this.provider)===null||n===void 0)&&n.removeAllListeners&&this.provider.removeAllListeners(t)}connect(){var t;!((t=this.provider)===null||t===void 0)&&t.connect&&this.provider.connect()}disconnect(t,n){var r;!((r=this.provider)===null||r===void 0)&&r.disconnect&&this.provider.disconnect(t,n)}reset(){var t;!((t=this.provider)===null||t===void 0)&&t.reset&&this.provider.reset()}on(t,n){this.provider&&this.provider.on(t,n)}removeListener(t,n){this.provider&&this.provider.removeListener(t,n)}}var DTt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const pc=e=>e!==void 0&&e.trim().length>0;class BTt extends JOe{constructor(t=fs.ETH_MAINNET,n=v0.HTTPS,r="",s="",a){super(t,n,r,s,a)}request(t,n){const r=Object.create(null,{request:{get:()=>super.request}});return DTt(this,void 0,void 0,function*(){try{return yield r.request.call(this,t,n)}catch(s){throw s instanceof b0&&s.statusCode===429?new MTt(s):s}})}getRPCURL(t,n,r,s){let a="",o="";switch(t){case fs.ETH_MAINNET:a=pc(s)?s:"powerful-holy-bush.quiknode.pro",o=pc(r)?r:"3240624a343867035925ff7561eb60dfdba2a668";break;case fs.ETH_SEPOLIA:a=pc(s)?s:"dimensional-fabled-glitter.ethereum-sepolia.quiknode.pro",o=pc(r)?r:"382a3b5a4b938f2d6e8686c19af4b22921fde2cd";break;case fs.ETH_HOLESKY:a=pc(s)?s:"yolo-morning-card.ethereum-holesky.quiknode.pro",o=pc(r)?r:"481ebe70638c4dcf176af617a16d02ab866b9af9";break;case fs.ARBITRUM_MAINNET:a=pc(s)?s:"autumn-divine-dinghy.arbitrum-mainnet.quiknode.pro",o=pc(r)?r:"a5d7bfbf60b5ae9ce3628e53d69ef50d529e9a8c";break;case fs.ARBITRUM_SEPOLIA:a=pc(s)?s:"few-patient-pond.arbitrum-sepolia.quiknode.pro",o=pc(r)?r:"3be985450970628c860b959c65cd2642dcafe53c";break;case fs.BNB_MAINNET:a=pc(s)?s:"purple-empty-reel.bsc.quiknode.pro",o=pc(r)?r:"ebf6c532961e21f092ff2facce1ec4c89c540158";break;case fs.BNB_TESTNET:a=pc(s)?s:"floral-rough-scion.bsc-testnet.quiknode.pro",o=pc(r)?r:"5b297e5acff5f81f4c37ebf6f235f7299b6f9d28";break;case fs.POLYGON_MAINNET:a=pc(s)?s:"small-chaotic-moon.matic.quiknode.pro",o=pc(r)?r:"847569f8a017e84d985e10d0f44365d965a951f1";break;case fs.POLYGON_AMOY:a=pc(s)?s:"prettiest-side-shape.matic-amoy.quiknode.pro",o=pc(r)?r:"79a9476eea661d4f82de614db1d8a895b14b881c";break;default:throw new Error("Network info not avalible.")}return`${n}://${a}/${o}`}}const $Tt=e=>e!==void 0&&e.trim().length>0,UTt=[fs.DYMENSION_MAINNET,fs.DYMENSION_TESTNET,fs.KAVA_MAINNET,fs.CRONOS_MAINNET,fs.POLYGON_MAINNET];class jR extends JOe{constructor(t=fs.ETH_MAINNET,n=v0.HTTPS,r="",s){super(t,n,"",r,s)}getRPCURL(t,n,r,s){if(!jR.networkHostMap[t])throw new Error("Network info not avalible.");const a=`${jR.networkHostMap[t]}.publicnode.com`,o=$Tt(s)?s:a;return UTt.includes(t)&&n===v0.WebSocket?`${n}://${o}/websocket`:`${n}://${o}`}}jR.networkHostMap={[fs.POLYGON_AMOY]:"polygon-amoy-bor-rpc",[fs.DYMENSION_MAINNET]:"dymension-evm-rpc",[fs.DYMENSION_TESTNET]:"dymension-testnet-evm-rpc",[fs.BLAST_MAINNET]:"blast-rpc",[fs.GNOSIS_MAINNET]:"gnosis-rpc",[fs.PULSECHAIN_MAINNET]:"pulsechain-rpc",[fs.PULSECHAIN_TESTNET]:"pulsechain-testnet-rpc",[fs.KAVA_MAINNET]:"kava-evm-rpc",[fs.CRONOS_MAINNET]:"cronos-evm-rpc",[fs.MANTLE_MAINNET]:"mantle-rpc",[fs.TAIKO_MAINNET]:"taiko-rpc",[fs.TAIKO_HEKLA]:"taiko-hekla-rpc",[fs.LINEA_MAINNET]:"linea-rpc",[fs.LINEA_SEPOLIA]:"linea-sepolia-rpc",[fs.SCROLL_MAINNET]:"scroll-rpc",[fs.SCROLL_SEPOLIA]:"scroll-sepolia-rpc",[fs.SYSCOIN_MAINNET]:"syscoin-evm-rpc",[fs.SYSCOIN_TANENBAUM]:"syscoin-tanenbaum-evm-rpc",[fs.HAQQ_MAINNET]:"haqq-evm-rpc",[fs.EVMOS_MAINNET]:"evmos-evm-rpc",[fs.EVMOS_TESTNET]:"evmos-testnet-evm-rpc",[fs.BERACHAIN_TESTNET]:"berachain-testnet-evm-rpc",[fs.ETH_MAINNET]:"ethereum-rpc",[fs.ETH_SEPOLIA]:"ethereum-sepolia-rpc",[fs.ETH_HOLESKY]:"ethereum-holesky-rpc",[fs.BSC_MAINNET]:"bsc-rpc",[fs.BSC_TESTNET]:"bsc-testnet-rpc",[fs.POLYGON_MAINNET]:"polygon-bor-rpc",[fs.BASE_MAINNET]:"base-rpc",[fs.BASE_SEPOLIA]:"base-sepolia-rpc",[fs.ARBITRUM_ONE]:"arbitrum-one-rpc",[fs.ARBITRUM_NOVA]:"arbitrum-nova-rpc",[fs.ARBITRUM_SEPOLIA]:"arbitrum-sepolia-rpc",[fs.AVALANCHE_C_MAINNET]:"avalanche-c-chain-rpc",[fs.AVALANCHE_P_MAINNET]:"avalanche-p-chain-rpc",[fs.AVALANCHE_X_MAINNET]:"avalanche-x-chain-rpc",[fs.AVALANCHE_FUJI_C]:"avalanche-fuji-c-chain-rpc",[fs.AVALANCHE_FUJI_P]:"avalanche-fuji-p-chain-rpc",[fs.AVALANCHE_FUJI_X]:"avalanche-fuji-x-chain-rpc",[fs.OPTIMISM_MAINNET]:"optimism-rpc",[fs.OPTIMISM_SEPOLIA]:"optimism-sepolia-rpc",[fs.FANTOM_MAINNET]:"fantom-rpc",[fs.FANTOM_TESTNET]:"fantom-testnet-rpc",[fs.OPBNB_MAINNET]:"opbnb-rpc",[fs.OPBNB_TESTNET]:"opbnb-testnet-rpc",[fs.GNOSIS_CHIADO]:"gnosis-chiado-rpc",[fs.CHILIZ_MAINNET]:"chiliz-rpc",[fs.CHILIZ_SPICY]:"chiliz-spicy-rpc",[fs.MOONBEAM_MAINNET]:"moonbeam-rpc",[fs.BAHAMUT_MAINNET]:"bahamut-rpc",[fs.TRON_MAINNET]:"tron-evm-rpc",[fs.MOONRIVER_MAINNET]:"moonriver-rpc"};const zTt=new BTt,HTt={encodeEventSignature:_oe,encodeFunctionCall:U_t,encodeFunctionSignature:UE,encodeParameter:Mee,encodeParameters:x$,decodeParameter:yOe,decodeParameters:Jw,decodeLog:vOe};var k7=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})};const VTt=e=>{const t=(o,l)=>k7(void 0,void 0,void 0,function*(){const c=yield _kt(o,e),u=Ur({format:"bytes"},l,ui);return j9t(c,u)}),n=o=>{const l=voe(o);return Object.assign(Object.assign({},l),{signTransaction:c=>k7(void 0,void 0,void 0,function*(){return t(c,l.privateKey)})})},r=(o,l,c)=>k7(void 0,void 0,void 0,function*(){var u;const d=yield T9t(o,l,(u=c==null?void 0:c.nonStrict)!==null&&u!==void 0?u:!0);return Object.assign(Object.assign({},d),{signTransaction:f=>k7(void 0,void 0,void 0,function*(){return t(f,d.privateKey)})})}),s=()=>{const o=k9t();return Object.assign(Object.assign({},o),{signTransaction:l=>k7(void 0,void 0,void 0,function*(){return t(l,o.privateKey)})})},a=new fR({create:s,privateKeyToAccount:n,decrypt:r});return{signTransaction:t,create:s,privateKeyToAccount:n,decrypt:r,recoverTransaction:E9t,hashMessage:yoe,sign:DFe,recover:jee,encrypt:BFe,wallet:a,privateKeyToAddress:f$,parseAndValidatePrivateKey:RA,privateKeyToPublicKey:_9t}},WTt={version:"4.16.0"};var qTt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},ER;(function(e){e.eip6963announceProvider="eip6963:announceProvider",e.eip6963requestProvider="eip6963:requestProvider"})(ER||(ER={}));const AV=new Map,eMe="web3:providersMapUpdated",GTt=()=>qTt(void 0,void 0,void 0,function*(){return new Promise((e,t)=>{typeof window>"u"&&t(new Error("window object not available, EIP-6963 is intended to be used within a browser")),window.addEventListener(ER.eip6963announceProvider,n=>{AV.set(n.detail.info.uuid,n.detail);const r=new CustomEvent(eMe,{detail:AV});window.dispatchEvent(r),e(AV)}),window.dispatchEvent(new Event(ER.eip6963requestProvider))})}),KTt=e=>{if(typeof window>"u")throw new Error("window object not available, EIP-6963 is intended to be used within a browser");window.addEventListener(eMe,e)};class yl extends Vd{constructor(t=zTt){var n;(Xs(t)||typeof t=="string"&&t.trim()===""||typeof t!="string"&&!uR(t)&&!t.provider)&&console.warn("NOTE: web3.js is running without provider. You need to pass a provider in order to interact with the network!");let r={};typeof t=="string"||uR(t)?r.provider=t:t?r=t:r={},r.registeredSubscriptions=Object.assign(Object.assign({},Lee),(n=r.registeredSubscriptions)!==null&&n!==void 0?n:{}),super(r);const s=VTt(this);this._wallet=s.wallet,this._accountProvider=s,this.utils=uFe;const a=this;class o extends e3{constructor(u,d,f,x,g){if(uy(d)&&uy(f))throw new Bxe("Should not provide options at both 2nd and 3rd parameters");let v,w={},C,N;if(!Xs(d)&&typeof d!="object"&&typeof d!="string")throw new Bxe;if(typeof d=="string"&&(v=d),uy(d)?w=d:uy(f)?w=f:w={},d instanceof Vd?C=d:f instanceof Vd?C=f:x instanceof Vd?C=x:C=a.getContextObject(),g?N=g:lg(f)?N=f:lg(x)&&(N=x),super(u,v,w,C,N),super.subscribeToContextEvents(a),!Xs(l)){const I=l.getTransactionMiddleware();Xs(I)||super.setTransactionMiddleware(I)}}}const l=a.use(g$);this.eth=Object.assign(l,{ens:a.use(QOe,vR.main),Iban:kl,net:a.use(GFe),personal:a.use(ZOe),Contract:o,abi:HTt,accounts:s})}}yl.version=WTt.version;yl.utils=uFe;yl.requestEIP6963Providers=GTt;yl.onNewProviderDiscovered=KTt;yl.modules={Web3Eth:g$,Iban:kl,Net:GFe,ENS:QOe,Personal:ZOe};const fd=({open:e,setOpen:t,transactionHash:n,transactionLoading:r,paymentPresaleRole:s,errorFunds:a,activeMethod:o})=>{const[l,c]=m.useState(!1);m.useEffect(()=>{const d=f=>{r&&e&&(f.preventDefault(),f.returnValue="Please do not leave, your purchase is in progress.")};return window.addEventListener("beforeunload",d),()=>window.removeEventListener("beforeunload",d)},[r,e]);const u=async d=>{try{await navigator.clipboard.writeText(d),on.success("TX Hash copied to clipboard!")}catch(f){console.error("Failed to copy: ",f),on.error("Failed to copy TX Hash")}};return m.useEffect(()=>{let d;return e&&r?d=setTimeout(()=>c(!0),24e4):(c(!1),d&&clearTimeout(d)),()=>d&&clearTimeout(d)},[e,r]),i.jsxs(ga,{open:e,onClose:()=>{r||t(!1)},className:"relative z-[9001] font-inter",children:[i.jsx(xa,{style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full justify-center p-4 text-center items-center sm:p-0",children:i.jsx(da,{transition:!0,style:{maxWidth:"448px"},className:`relative transform overflow-hidden rounded-lg bg-[#161616] border border-[#404040] pt-5 pb-4 text-left shadow-xl transition-all 
             data-[closed]:translate-y-4 data-[closed]:opacity-0 
             data-[enter]:duration-300 data-[leave]:duration-200 
             data-[enter]:ease-out data-[leave]:ease-in 
             sm:my-8 sm:align-middle sm:w-full sm:max-w-lg`,children:i.jsxs("div",{className:"mt-3 text-center sm:mt-5 text-white",children:[(!r&&s||l)&&i.jsx("svg",{onClick:()=>t(!1),xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 fixed right-0 mr-4 top-4 cursor-pointer text-gray-400 hover:text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),r?i.jsxs("div",{className:"mt-2",children:[!a&&i.jsx("div",{className:"flex justify-center items-center",children:i.jsx(Ma,{})}),i.jsxs("p",{className:"mt-4 text-center flex flex-col items-center text-sm font-medium text-gray-200",children:[i.jsx("span",{children:"Your subscription order is created, please confirm"}),i.jsx("span",{children:"transaction on your wallet to complete purchase."})]}),l?i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"text-red-400 mt-4 flex justify-start items-center min-h-20 sm:h-20 bg-[#2a1a1a] w-full border-l-2 border-red-600 gap-4 pl-2.5 rounded",children:[i.jsx("img",{src:vc,alt:"",className:"w-8 h-8"}),i.jsx("span",{className:"text-sm font-medium text-red-400 max-w-[354px] text-left",children:"There was an error, you can contact us via discord."})]}),i.jsx("div",{className:"w-full flex justify-center items-center mt-6",children:i.jsxs("a",{href:"https://discord.gg/dextrabot",target:"_blank",className:"inline-flex relative items-center px-2.5 py-1.5 text-sm font-bold text-white hover:text-white bg-[#5865F2] hover:bg-[#626ef1] rounded-md h-9 min-w-max gap-2",children:[i.jsx("img",{src:rke,className:"w-6 h-6"}),"Join Discord"]})})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:`${a?"text-red-400 bg-[#2a1a1a] border-red-600":"text-yellow-400 bg-[#2a2418] border-yellow-600"}  mt-4 flex justify-start items-center min-h-20 sm:h-20  w-full border-l-2 gap-4 pl-2.5 rounded`,children:a?i.jsxs(i.Fragment,{children:[i.jsx("img",{src:vc,alt:"",className:"w-8 h-8"}),i.jsx("span",{className:"text-sm font-medium text-red-400 max-w-[354px] text-left",children:"Insufficient funds.Please add funds to your wallet on Ethereum Mainnet."})]}):i.jsxs(i.Fragment,{children:[i.jsx(TM,{className:"w-8 h-8 text-yellow-400"}),i.jsx("span",{className:"text-sm font-medium text-yellow-400 max-w-[354px] text-left",children:"If you have confirmed the transaction from wallet extension, do not exit back and wait, otherwise your transaction may be incorrect."})]})}),i.jsx("div",{className:"w-full flex justify-center items-center mt-6",children:i.jsx("div",{onClick:()=>t(!1),className:"w-26 h-8 px-4 py-1 bg-[#2a2a2a] rounded-full flex justify-center items-center cursor-pointer hover:bg-[#3a3a3a]",children:i.jsx("div",{className:"text-sm font-medium text-gray-300",children:"Cancel"})})})]})]}):o===2&&s?i.jsxs("div",{className:"mt-2",children:[i.jsx("div",{className:"flex justify-center items-center",children:i.jsx("div",{className:"mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-green-100",children:i.jsx(pet,{className:"h-6 w-6 text-green-600","aria-hidden":"true"})})}),i.jsx("p",{className:"text-gray-100 text-lg mt-4 font-medium",children:"Payment Successful"}),i.jsxs("p",{className:"text-sm text-left text-gray-300 mt-4 px-2",children:["Transaction Hash"," ",i.jsxs("span",{className:"flex items-center justify-center text-xs break-all",children:[n,i.jsx("span",{onClick:()=>u(n),className:"inline-block mx-1 w-4 cursor-pointer",children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-300 hover:text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})})})]})]})]}):i.jsxs("div",{className:"my-2",children:[i.jsx("div",{className:"flex justify-center items-center",children:i.jsx(Ma,{})}),i.jsx("p",{className:"mt-4 text-center flex flex-col items-center text-sm font-medium text-gray-200 font-manrope",children:i.jsx("span",{children:"If your role has not been assigned yet, please refresh the page."})})]})]})})})})]})};function $oe({open:e=!1,setOpen:t=()=>{}}){const[n,r]=m.useState([]),[s,a]=m.useState(""),[o,l]=m.useState(""),[c,u]=m.useState("11"),[d,f]=m.useState(""),[x,g]=m.useState(""),[v,w]=m.useState(""),[C,N]=m.useState(""),[I,P]=m.useState(2),[R,F]=m.useState(!1),[U,L]=m.useState(!1),[z,X]=m.useState(!1),[ne,J]=m.useState(!1),[Z,re]=m.useState(!1),[he,Y]=m.useState(""),[ie,oe]=m.useState(""),[G,V]=m.useState(!1),[ee,ae]=m.useState(!1),[fe,Ae]=m.useState(null),[ce,ye]=m.useState(""),[Ne,be]=m.useState(!1),[je,Ie]=m.useState(!1),[Re,Qe]=m.useState(null),[Be,it]=m.useState(!1),[tt,at]=m.useState([]),[dt,ct]=m.useState(!1),[Ut,kt]=m.useState(!1),[tn,jt]=m.useState(""),[un,cn]=m.useState(!0),{setSignModalOpen:Pt,setTelegramChatId:Xe,setSubscriberRole:Vt,setSubsExpireDay:Yt,setMushboomerETH:Ve,setMushboomerSOL:Ke,setIsReferralCode:ft,setIsReferralCodeName:en,setIsWhitelist:Dt,setHyperToken:At,setHyperAddress:Je}=m.useContext(Gr),He="https://dextrabothypev2.nftinit.io",Rt="https://api.hyperliquid.xyz/info",qe="0x1924b8561eef20e70ede628a296175d358be80e5",lt=["HYPE","ETH","BTC","SOL","USDT0","PUP"],xt="0.01",Nt=Ee=>{switch(Ee){case"BTC":return"UBTC";case"ETH":return"UETH";case"SOL":return"USOL";case"USDT0":return"USDT0";case"HYPE":default:return Ee}},It=Ee=>{if(Ee==null||Ee==="")return"0.00";const p=Number(Ee);return Number.isNaN(p)?"0.00":p.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})},xn=Ee=>/^\d*\.?\d{0,6}$/.test(Ee),dn=Ee=>/^\d*$/.test(Ee),Mn=Ee=>{["e","E","+","-"].includes(Ee.key)&&Ee.preventDefault()},_n=m.useMemo(()=>{if(c==="")return!1;const Ee=Number(c);return!Number.isNaN(Ee)&&Ee>=11},[c]);m.useMemo(()=>{if(d==="")return!1;const Ee=Number(d);return!Number.isNaN(Ee)&&Ee>0},[d]);const kn=m.useMemo(()=>{if(x==="")return!1;const Ee=Number(x);return!Number.isNaN(Ee)&&Ee>=0&&Ee<=100},[x]),vn=m.useMemo(()=>{if(v==="")return!1;const Ee=Number(v);return!Number.isNaN(Ee)&&Ee>=0&&Ee<=100},[v]),Qn=m.useMemo(()=>{if(C==="")return!1;const Ee=Number(C);return Number.isInteger(Ee)&&Ee>0&&Ee<=180},[C]),Hn=m.useMemo(()=>n.map(Ee=>{const p=(Ee==null?void 0:Ee.wallet_name)??(Ee==null?void 0:Ee.name)??(Ee==null?void 0:Ee.label)??String(Ee==null?void 0:Ee.wallet_id),h=(Ee==null?void 0:Ee.version)===3?`${p} - (API-AGENT) Wallet`:p;return{value:(Ee==null?void 0:Ee.wallet_id)??(Ee==null?void 0:Ee.id)??(Ee==null?void 0:Ee.value)??"",label:h,raw:Ee}}),[n]),$n=m.useMemo(()=>{var Ee;return(Ee=Hn.find(p=>String(p.value)===String(s)))==null?void 0:Ee.raw},[Hn,s]),Jn=m.useMemo(()=>{const Ee=$n||{};return Ee.address||Ee.evm_address||Ee.wallet_address||Ee.public_address||Ee.eth_address||Ee.addr||null},[$n]),Nn=($n==null?void 0:$n.version)===3,ln=!Nn||Re>0,Oe=m.useMemo(()=>{if(!o)return{coin:Nt(o),total:"0",entryNtl:"0"};const Ee=Nt(o);return(tt||[]).find(h=>(h==null?void 0:h.coin)===Ee)??{coin:Ee,total:"0",entryNtl:"0"}},[o,tt]),sn=s!==""&&o!==""&&(I===1?Qn&&vn:_n&&kn)&&Ne&&ln&&un;m.useEffect(()=>{if(!e)return;const Ee=localStorage.getItem("hyperToken"),p=localStorage.getItem("hyperAddress");be(!!(Ee&&p));const h=setInterval(()=>{const S=localStorage.getItem("hyperToken"),_=localStorage.getItem("hyperAddress");be(!!(S&&_))},800);return()=>clearInterval(h)},[e]),m.useEffect(()=>{e&&(Y(""),Ne&&Bt())},[e,Ne]),m.useEffect(()=>{e&&(Jn?Kn(Jn):(Ae(null),ye(""),at([])))},[e,Jn]),m.useEffect(()=>{!e||!Ne||(Et(),Yn())},[e,Ne]),m.useEffect(()=>{e&&I===1&&!v&&w(xt)},[e,I]),m.useEffect(()=>{if(!e||!Ne)return;const Ee=$n||{},p=Ee.address||Ee.evm_address||Ee.wallet_address||Ee.public_address||Ee.eth_address||Ee.addr||null;(Ee==null?void 0:Ee.version)===3&&p&&fn(p)},[e,Ne,s,$n]);async function fn(Ee){try{Ie(!0),Qe(null);const h=await(await fetch(Rt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"maxBuilderFee",user:Ee,builder:qe})})).json();Qe(Number(h))}catch{Qe(null)}finally{Ie(!1)}}async function Et(){var Ee,p,h;try{L(!0);const S=window.localStorage.getItem("hyperToken"),_=window.localStorage.getItem("hyperAddress");if(!S||!_){V(!1);return}const T=await(await fetch(`${He}/api/hyper/farming/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:_.toLowerCase(),token:S})})).json();if(T!=null&&T.success&&((Ee=T==null?void 0:T.data)!=null&&Ee.farming_params)){V(!0),((p=T==null?void 0:T.data)==null?void 0:p.wallet_id)!==void 0&&((h=T==null?void 0:T.data)==null?void 0:h.wallet_id)!==null&&a(String(T.data.wallet_id));const B=T.data.farming_params||{};B.coin&&l(B.coin),B.margin!==void 0&&B.margin!==null&&u(String(B.margin)),B.budget!==void 0&&B.budget!==null&&f(String(B.budget));const q=Number(B.methodType);q===1?(P(2),B.spread!==void 0&&B.spread!==null&&g(String(B.spread))):q===2?(P(1),B.spread!==void 0&&B.spread!==null?w(String(B.spread)):w(xt),B.orderPerHour!==void 0&&B.orderPerHour!==null&&N(String(B.orderPerHour))):P(2)}else V(!1)}catch{V(!1)}finally{L(!1)}}async function Kn(Ee){try{ye(""),ae(!0),Ae(null);const h=await(await fetch(Rt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"spotClearinghouseState",user:Ee})})).json(),S=Array.isArray(h==null?void 0:h.balances)?h.balances:[];at(S);const _=S.find(k=>(k==null?void 0:k.coin)==="USDC");Ae(_?_.total:"0")}catch(p){ye(p.message||"Failed to load USDC balance.")}finally{ae(!1)}}function Cn(){const Ee=Jn||window.localStorage.getItem("hyperAddress");Ee&&Kn(Ee)}async function Bt(){try{F(!0);const Ee=window.localStorage.getItem("hyperToken"),p=window.localStorage.getItem("hyperAddress");if(!Ee||!p){be(!1),Pt(!0);return}const S=await(await fetch(`${He}/api/wallet/confirmed-list`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:p.toLowerCase(),token:Ee})})).json();S!=null&&S.success?r((S==null?void 0:S.data)||[]):Y((S==null?void 0:S.error_message)||"Failed to load wallets.")}catch(Ee){Y(Ee.message||"Wallet list error.")}finally{F(!1)}}async function an(){if(!Ne){Pt(!0);return}if(sn)try{J(!0),Y("");const Ee=window.localStorage.getItem("hyperToken"),p=window.localStorage.getItem("hyperAddress");if(!Ee||!p){be(!1),Pt(!0);return}const S=I===1?{margin:100,budget:1,coin:o,orderPerHour:Number(C),spread:Number(v),methodType:2}:{margin:Number(c),coin:o,spread:Number(x),methodType:1,budget:1},_={address:p.toLowerCase(),token:Ee,wallet_id:Number(s),farming_params:S},T=await(await fetch(`${He}/api/hyper/farming/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(_)})).json();T!=null&&T.success?V(!0):Y((T==null?void 0:T.message)||"Start failed.")}catch(Ee){Y(Ee.message||"An error occurred while saving.")}finally{J(!1)}}async function Pn(){if(!Ne)return Pt(!0);if(s)try{re(!0),Y("");const Ee=window.localStorage.getItem("hyperToken"),p=window.localStorage.getItem("hyperAddress");if(!Ee||!p){be(!1),Pt(!0);return}const S=await(await fetch(`${He}/api/hyper/farming/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:p.toLowerCase(),token:Ee,wallet_id:Number(s)})})).json();S!=null&&S.success?V(!1):Y((S==null?void 0:S.error_message)||"Stop failed.")}catch(Ee){Y(Ee.message||"An error occurred while stopping.")}finally{re(!1)}}const qn=32,nr={control:(Ee,p)=>({...Ee,backgroundColor:"#242424",borderColor:p.isFocused?"#67FFBD":"#353535",minHeight:qn,height:qn,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:Ee=>({...Ee,height:qn,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:Ee=>({...Ee,height:qn}),input:Ee=>({...Ee,color:"#FFFFFF",margin:0,padding:0}),singleValue:Ee=>({...Ee,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:Ee=>({...Ee,color:"#7F7F7F",fontSize:"12px"}),menu:Ee=>({...Ee,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:Ee=>({...Ee,paddingTop:0,paddingBottom:0}),option:(Ee,p)=>({...Ee,backgroundColor:p.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:qn,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:Ee=>({...Ee,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:Ee=>({...Ee,backgroundColor:"#353535"})},tr=Ee=>{var p;return i.jsx($a.Option,{...Ee,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[((p=Ee.data)==null?void 0:p.icon)&&i.jsx("img",{src:Ee.data.icon,alt:Ee.data.label,className:"w-4 h-4",onError:h=>{h.currentTarget.style.display="none"}}),i.jsx("span",{className:"text-white text-[13px]",children:Ee.data.label})]})})},Qt=Ee=>{var p;return i.jsx($a.SingleValue,{...Ee,children:i.jsxs("div",{className:"flex items-center gap-2",children:[((p=Ee.data)==null?void 0:p.icon)&&i.jsx("img",{src:Ee.data.icon,alt:Ee.data.label,className:"w-4 h-4",onError:h=>{h.currentTarget.style.display="none"}}),i.jsx("span",{className:"text-white text-[13px]",children:Ee.data.label})]})})},zn=m.useMemo(()=>lt.map(Ee=>{let h=`https://app.hyperliquid.xyz/coins/${Ee==="USDT0"?"USDT":Ee}.svg`;return Ee==="PUP"&&(h="https://www.basedapp.io/_next/image?url=%2Ftokens%2Fpng%2FPUP_USDC.png&w=32&q=75"),{value:Ee,label:Ee,icon:h}}),[]),Yn=async()=>{var h,S;const Ee=window.localStorage.getItem("hyperToken"),p=window.localStorage.getItem("hyperAddress");if(!(!Ee||!p))try{X(!0);const _=await Si(p.toLowerCase(),Ee);_!=null&&_.success?(Xe(_==null?void 0:_.telegram_chat_id),Vt(_==null?void 0:_.subscriber_role),Yt(_==null?void 0:_.subs_expire_day),Ve((h=_==null?void 0:_.mushboomer_counts)==null?void 0:h.eth),Ke((S=_==null?void 0:_.mushboomer_counts)==null?void 0:S.sol),ft(_==null?void 0:_.referral_code),en(_==null?void 0:_.refcode),Dt(_==null?void 0:_.whitelist),At(Ee),Je(p),cn(!0),X(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),At(""),Je(""),X(!1))}catch(_){console.error("Token verification error:",_),console.error(_.message||"An unknown error occurred."),X(!1)}},Lt=R||U||ne||Z||z,Fn=G&&!Z;return e?i.jsxs(i.Fragment,{children:[Be&&Ia.createPortal(i.jsx("div",{className:"fixed inset-0 z-[999999999]",children:i.jsx(FA,{open:Be,setOpen:it,handleListRequest:Bt,handlePageChange:()=>{}})}),document.body),i.jsx(fd,{open:Ut,setOpen:kt,transactionHash:tn,transactionLoading:dt,paymentPresaleRole:un,errorFunds:ie,activeMethod:2}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!Lt&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#ff6940] max-h-[90dvh] overflow-y-auto",children:[i.jsxs("div",{className:"p-5 border-b border-[#353535] rounded-t-3xl relative",children:[i.jsxs("div",{className:"flex justify-start items-baseline gap-2",children:[i.jsx("img",{src:oke,alt:"BasedApp",className:"h-6"}),i.jsx("span",{className:"text-[34px] font-semibold text-[#ff6940]",children:"farming"})]}),i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2 pr-[148px]",children:"BasedApp farming module lets you configure automated trading by selecting a wallet, coin, margin, and spread or orders per hour."}),i.jsxs("div",{onClick:Ee=>{window.localStorage.getItem("hyperToken")?it(!0):Pt(!0)},className:"absolute top-[70px] sm:top-8 right-5 h-6 sm:h-8 pl-2 sm:pl-3 pr-4 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] !w-30",children:"Add Account"})]}),i.jsxs("div",{onClick:()=>{window.open("https://www.youtube.com/watch?v=2kBqpY09aDM","_blank")},className:"absolute top-[110px] sm:top-[84px] right-5 h-6 sm:h-8 pl-[26px] sm:pl-[32px] pr-7 py-3 bg-[#FF0000] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#ff4d4d] justify-center items-center gap-1 inline-flex cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsx(Wk,{})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"YouTube"})]})]}),G&&i.jsx("div",{className:"px-5 pt-3",children:i.jsxs("div",{className:"flex items-center justify-between rounded-[12px] border border-[#2A2A2A] bg-[#1f1f1f] px-3 py-2",children:[i.jsx("span",{className:"text-[12px] text-[#CECECE]",children:"Your farm process is currently running. You can follow it here."}),i.jsx("a",{href:"https://www.basedapp.io/leaderboard",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center h-8 px-4 rounded-[10px] text-[12px] font-semibold border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] text-white",children:"Leaderboard"})]})}),I===2&&i.jsx("div",{className:"px-5 pt-3",children:i.jsx("div",{className:"text-[12px] text-[#FFD166] bg-[#2a2413] border border-[#6b5c2d] rounded-md px-3 py-2",children:"Use a lower margin compared to your spot balance. Margin should be less than 50% of the Spot balance in order for system to keep farming. Example: For 10.000$ Spot equity use 2.000$ in margin."})}),Ne&&Nn&&i.jsx("div",{className:"px-5 pt-3",children:je?i.jsx("div",{className:"text-[12px] text-[#FFD166] bg-[#2a2413] border border-[#6b5c2d] rounded-md px-3 py-2",children:"Checking builder approval..."}):ln?null:i.jsxs("div",{className:"flex flex-col gap-2 text-[12px] text-[#FFD166] bg-[#2a2413] border border-[#6b5c2d] rounded-md px-3 py-2",children:[i.jsx("span",{children:"Action required: Please log in via BasedApp and approve the Builder fee for this wallet to continue."}),i.jsx("a",{href:"https://app.based.one/register?ref=ANABOLIC",target:"_blank",rel:"noopener noreferrer",className:"inline-block text-center text-[#1B1B1B] bg-[#ff6940] rounded-md px-3 py-1 font-bold transition",children:"BasedApp Login"})]})}),i.jsxs("div",{className:"p-5 space-y-6",children:[he&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:he}),i.jsxs("div",{className:"w-full rounded-full border border-[#2A2A2A] bg-transparent p-1 flex gap-2",children:[i.jsx("div",{className:`flex-1 h-9 rounded-full text-[13px] transition cursor-pointer flex justify-center items-center font-semibold ${I===2?"bg-[#242424] text-white shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]":"text-[#B3B3B3]"} ${Fn?"opacity-60 cursor-not-allowed":""}`,onClick:()=>!Fn&&P(2),children:"Econo Mode"}),i.jsx("div",{className:`flex-1 h-9 rounded-full text-[13px] transition cursor-pointer flex justify-center items-center font-semibold ${I===1?"bg-[#242424] text-white shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]":"text-[#B3B3B3]"} ${Fn?"opacity-60 cursor-not-allowed":""}`,onClick:()=>!Fn&&P(1),children:"Farmer Mode"})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Select Wallet"}),i.jsxs("div",{className:"relative",children:[i.jsx(Zl,{styles:nr,isDisabled:Lt||R||Fn,isLoading:R,options:Hn,value:Hn.find(Ee=>String(Ee.value)===String(s))||null,onChange:Ee=>{if(Fn)return;a((Ee==null?void 0:Ee.value)??""),Qe(null);const p=(Ee==null?void 0:Ee.raw)||{},h=p.address||p.evm_address||p.wallet_address||p.public_address||p.eth_address||p.addr||null;Ne&&(p==null?void 0:p.version)===3&&h&&fn(h)},placeholder:Ne?R?"Loading...":"Select":"Connect to select",isSearchable:!0,onMenuOpen:()=>{Ne||Pt(!0)},menuIsOpen:Ne?void 0:!1}),!Ne&&i.jsx("button",{type:"button",onClick:()=>Pt(!0),className:"absolute inset-0 rounded-md cursor-pointer bg-transparent","aria-label":"Connect to select",title:"Connect"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Select Coin"}),i.jsx(Zl,{styles:nr,components:{Option:tr,SingleValue:Qt},isDisabled:Lt||Fn,options:zn,value:zn.find(Ee=>Ee.value===o)||null,onChange:Ee=>{Fn||l((Ee==null?void 0:Ee.value)??"")},placeholder:"Select",isSearchable:!0})]})]}),I===1?i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Trade Per Hour"}),i.jsx("input",{value:C,onChange:Ee=>{const p=Ee.target.value.trim();if(p==="")return N("");dn(p)&&N(p)},onKeyDown:Mn,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 6 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[14px] font-inter outline-none placeholder:text-[#7F7F7F] ${C===""?"border-[#353535]":Qn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Lt||Fn}),C!==""&&!Qn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]}),i.jsxs("div",{className:"space-y-2 hidden",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Spread %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:v,onChange:Ee=>{const p=Ee.target.value.trim();if(p==="")return w("");xn(p)&&w(p)},onKeyDown:Mn,inputMode:"decimal",autoComplete:"off",placeholder:"Default 0.01",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[14px] font-inter outline-none placeholder:text-[#7F7F7F] ${v===""?"border-[#353535]":vn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Lt||Fn})]}),v!==""&&!vn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter a percentage between 0 and 100."}),o==="PUP"&&i.jsxs("div",{className:"mt-2 text-[12px] text-[#FFD166] bg-[#2a2413] border border-[#6b5c2d] rounded-md px-3 py-2",children:[i.jsx("div",{children:"⚠️ PUP Spread Warning"}),i.jsx("div",{children:"Due to high price volatility, we recommend setting your spread to at least %0.03 for PUP."})]})]})]}):i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:i.jsx(fi,{content:"The portion of your budget used per trade. A higher margin means larger trade size, while a lower margin spreads your budget across more trades.",children:i.jsx("span",{children:"Margin (Amount)"})})}),i.jsx("input",{value:c,onChange:Ee=>{const p=Ee.target.value.trim();if(p==="")return u("");xn(p)&&u(p)},onKeyDown:Mn,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 2000",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[14px] font-inter outline-none placeholder:text-[#7F7F7F] ${c===""?"border-[#353535]":_n?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Lt||Fn}),c!==""&&!_n&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter a value greater than or equal to 11."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Spread %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:x,onChange:Ee=>{const p=Ee.target.value.trim();if(p==="")return g("");xn(p)&&g(p)},onKeyDown:Mn,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 0.5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[14px] font-inter outline-none placeholder:text-[#7F7F7F] ${x===""?"border-[#353535]":kn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Lt||Fn})]}),x!==""&&!kn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter a percentage between 0 and 100."}),o==="PUP"&&i.jsxs("div",{className:"mt-2 text-[12px] text-[#FFD166] bg-[#2a2413] border border-[#6b5c2d] rounded-md px-3 py-2",children:[i.jsx("div",{children:"⚠️ PUP Spread Warning"}),i.jsx("div",{children:"Due to high price volatility, we recommend setting your spread to at least 0.03 for PUP."})]})]})]})]}),i.jsxs("div",{className:"flex items-start gap-3 p-3 border-t border-[#353535] bg[rgba(27,27,27,0.32)] rounded-b-3xl",children:[i.jsxs("div",{className:"flex flex-col gap-1",children:[Ne&&i.jsxs("div",{className:"text-[12px] text-[#9B9B9B] flex items-center gap-2",children:["Available Spot Balance (USDC):",i.jsx("span",{className:"text-white",children:ee?"Loading...":ce?"—":It(fe??"0")}),i.jsx("div",{onClick:Cn,className:"flex justify-center items-center cursor-pointer",title:"Refresh balance",children:i.jsx(NS,{className:`w-4 h-4 ${ee?"animate-spin":""}`})})]}),Ne&&o&&i.jsxs("div",{className:"text-[12px] text-[#9B9B9B] flex items-center gap-2",children:["Available ",o," Balance:",i.jsx("span",{className:"text-white",children:It(Oe==null?void 0:Oe.total)}),i.jsxs("span",{className:"text-[#9B9B9B]",children:["(~",It(Oe==null?void 0:Oe.entryNtl)," USDC)"]}),i.jsx("div",{onClick:Cn,className:"flex justify-center items-center cursor-pointer",title:"Refresh balance",children:i.jsx(NS,{className:`w-4 h-4 ${ee?"animate-spin":""}`})})]})]}),i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!Lt&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] font-inter hover:border-white disabled:opacity-60",disabled:Lt,children:"Cancel"}),Ne?G?i.jsx("button",{onClick:Pn,disabled:!s||Lt,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] font-inter border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:Z?"Stopping...":"Stop"}):i.jsx("button",{onClick:an,disabled:!sn||Lt,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] font-inter border ${!sn||Lt?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:ne?"Starting...":"Start"}):i.jsx("button",{onClick:()=>Pt(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] font-inter border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})]}),(R||U)&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]}):null}const tMe=({className:e})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"121",height:"32",viewBox:"0 0 32 32",fill:"none",className:e,children:[i.jsx("path",{d:"M9.13309 30.4398L9.88315 26.9871C10.7197 23.1362 7.77521 19.4988 3.82118 19.4988H0.385363C1.4689 24.3374 4.75127 28.3496 9.13309 30.4398Z",fill:"currentColor"}),i.jsx("path",{d:"M10.64 31.0663C12.3326 31.6707 14.1567 32 16.0579 32C23.7199 32 30.1285 26.6527 31.7305 19.4988H21.249C16.5244 19.4988 12.4396 22.7824 11.44 27.3838L10.64 31.0663Z",fill:"currentColor"}),i.jsx("path",{d:"M32.0038 17.8987C32.0778 17.2756 32.1159 16.6415 32.1159 15.9985C32.1159 7.60402 25.629 0.719287 17.3779 0.0503251L15.1273 10.4105C14.2907 14.2614 17.2352 17.8987 21.1892 17.8987H32.0038Z",fill:"currentColor"}),i.jsx("path",{d:"M15.7459 0C7.02134 0.165717 0 7.26504 0 15.9985C0 16.6415 0.0380539 17.2756 0.112041 17.8987H3.76146C8.48603 17.8987 12.5709 14.6151 13.5705 10.0137L15.7459 0Z",fill:"currentColor"}),i.jsxs("defs",{children:[i.jsxs("linearGradient",{id:"paint0_linear",x1:"18.9416",y1:"0",x2:"12.6408",y2:"32.0507",gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{stopColor:"#F4D5B1"}),i.jsx("stop",{offset:"1",stopColor:"#FFD29F"})]}),i.jsxs("linearGradient",{id:"paint1_linear",x1:"18.9416",y1:"0",x2:"12.6408",y2:"32.0507",gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{stopColor:"#F4D5B1"}),i.jsx("stop",{offset:"1",stopColor:"#FFD29F"})]}),i.jsxs("linearGradient",{id:"paint2_linear",x1:"18.9416",y1:"0",x2:"12.6408",y2:"32.0507",gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{stopColor:"#F4D5B1"}),i.jsx("stop",{offset:"1",stopColor:"#FFD29F"})]}),i.jsxs("linearGradient",{id:"paint3_linear",x1:"18.9416",y1:"0",x2:"12.6408",y2:"32.0507",gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{stopColor:"#F4D5B1"}),i.jsx("stop",{offset:"1",stopColor:"#FFD29F"})]})]})]}),Uoe=({open:e=!1,setOpen:t=()=>{},defaultMethod:n=2})=>{const{setSignModalOpen:r,setTelegramChatId:s,setSubscriberRole:a,setSubsExpireDay:o,setMushboomerETH:l,setMushboomerSOL:c,setIsReferralCode:u,setIsReferralCodeName:d,setIsWhitelist:f,setHyperToken:x,setHyperAddress:g}=m.useContext(Gr);Yr();const[v,w]=m.useState(!1),[C,N]=m.useState(!1),[I,P]=m.useState(""),[R,F]=m.useState(""),[U,L]=m.useState(""),[z,X]=m.useState(""),[ne,J]=m.useState(""),[Z,re]=m.useState("OFF"),[he,Y]=m.useState(""),[ie,oe]=m.useState(""),[G,V]=m.useState("LONG"),[ee,ae]=m.useState("MARKET"),[fe,Ae]=m.useState(""),[ce,ye]=m.useState(""),[Ne,be]=m.useState(""),[je,Ie]=m.useState(!1),[Re,Qe]=m.useState(!1),[Be,it]=m.useState(!1),[tt,at]=m.useState(!1),[dt,ct]=m.useState(""),[Ut,kt]=m.useState(""),[tn,jt]=m.useState(!0),[un,cn]=m.useState(!1),[Pt,Xe]=m.useState(!1),[Vt,Yt]=m.useState(!1),[Ve,Ke]=m.useState(!1),[ft,en]=m.useState(!1),[Dt,At]=m.useState(!1),[Je,He]=m.useState(""),[Rt,qe]=m.useState(!0),[lt,xt]=m.useState(2),Nt="https://dextrabothypev2.nftinit.io",It="",xn={ASTERUSDT:[[50,0,2500],[25,2500,5e3],[20,5e3,1e4],[10,1e4,1e5],[5,1e5,2e5],[2,2e5,6e5],[1,6e5,1e6]],BTCUSDT:[[100,0,5e5],[75,5e5,1e6],[50,1e6,25e5],[25,25e5,5e6],[20,5e6,125e5],[10,125e5,25e6],[5,25e6,75e6],[4,75e6,125e6],[3,125e6,2e8],[2,2e8,25e7],[1,25e7,375e6]],ETHUSDT:[[100,0,3e5],[75,3e5,6e5],[50,6e5,375e4],[20,375e4,12e6],[10,12e6,15e6],[5,15e6,45e6],[4,45e6,75e6],[3,75e6,12e7],[2,12e7,15e7],[1,15e7,225e6]],BNBUSDT:[[100,0,1e4],[75,1e4,5e4],[50,5e4,625e3],[20,625e3,2e6],[10,2e6,25e5],[5,25e5,75e5],[4,75e5,125e5],[3,125e5,2e7],[2,2e7,25e6],[1,25e6,375e5]],SOLUSDT:[[25,0,2e5],[15,2e5,4e5],[10,4e5,4e6],[8,4e6,8e6],[6,8e6,2e7],[5,2e7,4e7],[4,4e7,8e7],[3,8e7,12e7],[2,12e7,16e7],[1,16e7,2e8]]},dn={ASTERUSDT:{market:5e3,unit:"ASTER"},BTCUSDT:{market:20,unit:"BTC"},ETHUSDT:{market:100,unit:"ETH"},BNBUSDT:{market:300,unit:"BNB"},SOLUSDT:{market:3e3,unit:"SOL"}},Mn=k=>{if(k==null||isNaN(k))return"";const T=Math.abs(k),B=q=>q.toFixed(1).replace(/\.0$/,"");return T>=1e9?`${B(k/1e9)}B`:T>=1e6?`${B(k/1e6)}M`:T>=1e3?`${B(k/1e3)}K`:`${k}`},_n=(k,T)=>{const B=xn[k]||[];if(!B.length||!T)return null;let q=null;for(const[te,ue,de]of B)T<=te&&(!q||te<q.maxLev)&&(q={min:ue,max:de,maxLev:te});return q},kn=m.useMemo(()=>[{value:"ASTERUSDT",label:"ASTERUSDT",icon:"https://static.astherus.finance/image/admin_mgs_image_upload/20250916/6dba1412-ddfb-4314-bfdf-87fa11f2daa6.png",maxLeverage:50},{value:"BTCUSDT",label:"BTCUSDT",icon:"https://app.hyperliquid.xyz/coins/BTC.svg",maxLeverage:100},{value:"ETHUSDT",label:"ETHUSDT",icon:"https://app.hyperliquid.xyz/coins/ETH.svg",maxLeverage:100},{value:"BNBUSDT",label:"BNBUSDT",icon:"https://app.hyperliquid.xyz/coins/BNB.svg",maxLeverage:100},{value:"SOLUSDT",label:"SOLUSDT",icon:"https://app.hyperliquid.xyz/coins/SOL.svg",maxLeverage:25}],[]),vn=k=>{var T;return((T=kn.find(B=>B.value===k))==null?void 0:T.maxLeverage)??100},Qn=k=>{["e","E","+","-"].includes(k.key)&&k.preventDefault()},Hn=k=>/^\d*\.?\d{0,6}$/.test(k),$n=k=>/^\d*$/.test(k),Jn=m.useMemo(()=>{if(he==="")return!1;const k=Number(he);return Number.isInteger(k)&&k>=1&&k<=180},[he]),Nn=m.useMemo(()=>{if(ie==="")return!1;const k=Number(ie),T=vn(ne);return Number.isInteger(k)&&k>=1&&k<=T},[ie,ne]),ln=m.useMemo(()=>{if(fe==="")return!1;const k=Number(fe);return!Number.isNaN(k)&&k>=0&&k<=100},[fe]),Oe=m.useMemo(()=>{if(ce==="")return!1;const k=Number(ce);return!Number.isNaN(k)&&k>=0&&k<=100},[ce]),sn=m.useMemo(()=>{if(Ne==="")return!1;const k=Number(Ne);return!Number.isNaN(k)&&k>=0&&k<=100},[Ne]),fn=Number(ie||0),Et=Nn&&ne?_n(ne,fn):null,Kn=v&&I.trim()!==""&&R.trim()!==""&&(Z!=="ON"||U.trim()!==""&&z.trim()!=="")&&ne!==""&&Jn&&Nn&&(G==="LONG"||G==="SHORT")&&(ee==="LIMIT"||ee==="MARKET")&&Rt,Cn=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),Bt=()=>`asterCreds:${Cn()}`,an=()=>{try{const k=localStorage.getItem(Bt());if(!k)return;const T=JSON.parse(k);T.apiKey&&P(T.apiKey),T.apiSecret&&F(T.apiSecret),T.apiKeyTwo&&L(T.apiKeyTwo),T.apiSecretTwo&&X(T.apiSecretTwo),typeof T.remember=="boolean"&&jt(T.remember)}catch{}},Pn=()=>{if(tn)try{localStorage.setItem(Bt(),JSON.stringify({apiKey:I,apiSecret:R,apiKeyTwo:U,apiSecretTwo:z,remember:!0}))}catch{}},qn=()=>{try{localStorage.removeItem(Bt())}catch{}};m.useEffect(()=>{if(!e)return;const k=localStorage.getItem("hyperToken"),T=localStorage.getItem("hyperAddress");w(!!(k&&T));const B=setInterval(()=>{const q=localStorage.getItem("hyperToken"),te=localStorage.getItem("hyperAddress");w(!!(q&&te))},800);return()=>clearInterval(B)},[e]),m.useEffect(()=>{!e||!v||(nr(),Ee())},[e,v]),m.useEffect(()=>{e&&(ce===""&&ye(It),fe===""&&Ae(It),Ne===""&&be(It))},[e]),m.useEffect(()=>{if(!ne)return;const k=vn(ne),T=Number(ie);!Number.isNaN(T)&&T>k&&oe(String(k)),!Number.isNaN(T)&&T<1&&ie!==""&&oe("1")},[ne]),m.useEffect(()=>{e&&(tn&&Pn(),tn||qn())},[I,R,U,z,tn,e]);async function nr(){var k,T,B,q,te;try{Qe(!0),ct("");const ue=window.localStorage.getItem("hyperToken"),de=window.localStorage.getItem("hyperAddress");if(!ue||!de){N(!1),an();return}const we=await(await fetch(`${Nt}/api/hyper/ast_farming/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:de.toLowerCase(),token:ue})})).json(),ke=(k=we==null?void 0:we.data)==null?void 0:k.farming_params;if(we!=null&&we.success&&ke){N(!0);const Me=((T=we==null?void 0:we.data)==null?void 0:T.aster_apikey)??"",Ye=((B=we==null?void 0:we.data)==null?void 0:B.aster_apisecret)??"",Fe=(ke==null?void 0:ke.api_key_2)??"",rt=(ke==null?void 0:ke.api_secret_2)??"";Me&&P(String(Me)),Ye&&F(String(Ye)),Fe&&L(String(Fe)),rt&&X(String(rt)),((q=we==null?void 0:we.data)==null?void 0:q.delta_neutral)!==void 0&&re((te=we==null?void 0:we.data)!=null&&te.delta_neutral?"ON":"OFF"),ke!=null&&ke.coin&&J(String(ke.coin)),(ke==null?void 0:ke.orderPerHour)!=null&&Y(String(ke.orderPerHour)),(ke==null?void 0:ke.leverage)!=null&&oe(String(ke.leverage)),ke!=null&&ke.direction&&V(String(ke.direction).toUpperCase()==="SHORT"?"SHORT":"LONG"),ke!=null&&ke.order_type&&ae(String(ke.order_type)==="limit"?"LIMIT":"MARKET"),(ke==null?void 0:ke.upspread)!=null&&Ae(String(ke.upspread)),(ke==null?void 0:ke.downspread)!=null&&ye(String(ke.downspread)),(ke==null?void 0:ke.upspread)!=null&&be(String(ke.upspread))}else N(!1),re("OFF");(!I&&!R||Z==="ON"&&!U&&!z)&&an()}catch{N(!1),an(),re("OFF")}finally{Qe(!1)}}async function tr(){if(!v){r(!0);return}if(Kn)try{it(!0),ct("");const k=window.localStorage.getItem("hyperToken"),T=window.localStorage.getItem("hyperAddress");if(!k||!T){r(!0);return}const B={methodType:Z==="ON"?2:1,coin:ne,orderPerHour:Number(he),leverage:Number(ie),...Z==="ON"?{api_key_2:U,api_secret_2:z}:ee==="LIMIT"?{upspread:Number(Ne),direction:G,order_type:ee==="LIMIT"?"limit":"market"}:{upspread:Number(fe),downspread:Number(ce),direction:G,order_type:ee==="LIMIT"?"limit":"market"}},q={address:T.toLowerCase(),token:k,apikey:I,apisecret:R,farming_params:B,delta_neutral:Z==="ON"},ue=await(await fetch(`${Nt}/api/hyper/ast_farming/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(q)})).json();ue!=null&&ue.success?(N(!0),tn&&Pn()):ct((ue==null?void 0:ue.error_message)||"Start failed.")}catch(k){ct(k.message||"An error occurred while saving.")}finally{it(!1)}}async function Qt(){if(!v){r(!0);return}try{at(!0),ct("");const k=window.localStorage.getItem("hyperToken"),T=window.localStorage.getItem("hyperAddress");if(!k||!T){r(!0);return}const q=await(await fetch(`${Nt}/api/hyper/ast_farming/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:T.toLowerCase(),token:k})})).json();q!=null&&q.success?N(!1):ct((q==null?void 0:q.error_message)||"Stop failed.")}catch(k){ct(k.message||"An error occurred while stopping.")}finally{at(!1)}}const zn={control:(k,T)=>({...k,backgroundColor:"#242424",borderColor:T.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:k=>({...k,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:k=>({...k,height:32}),input:k=>({...k,color:"#FFFFFF",margin:0,padding:0}),singleValue:k=>({...k,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:k=>({...k,color:"#7F7F7F",fontSize:"12px"}),menu:k=>({...k,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:k=>({...k,paddingTop:0,paddingBottom:0}),option:(k,T)=>({...k,backgroundColor:T.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:k=>({...k,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:k=>({...k,backgroundColor:"#353535"})},Yn=({max:k})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[k,"x"]}),Lt=k=>{var T;return i.jsx($a.Option,{...k,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[((T=k.data)==null?void 0:T.icon)&&i.jsx("img",{src:k.data.icon,alt:k.data.label,className:"w-4 h-4 rounded-[4px]",onError:B=>B.currentTarget.style.display="none"}),i.jsx("span",{className:"text-white text-[13px]",children:k.data.label}),i.jsx(Yn,{max:k.data.maxLeverage})]})})},Fn=k=>{var T;return i.jsx($a.SingleValue,{...k,children:i.jsxs("div",{className:"flex items-center gap-2",children:[((T=k.data)==null?void 0:T.icon)&&i.jsx("img",{src:k.data.icon,alt:k.data.label,className:"w-4 h-4 rounded-[4px]",onError:B=>B.currentTarget.style.display="none"}),i.jsx("span",{className:"text-white text-[13px]",children:k.data.label}),i.jsx(Yn,{max:k.data.maxLeverage})]})})},Ee=async()=>{var B,q;const k=window.localStorage.getItem("hyperToken"),T=window.localStorage.getItem("hyperAddress");if(!(!k||!T))try{Ie(!0);const te=await Si(T.toLowerCase(),k);te!=null&&te.success?(s(te==null?void 0:te.telegram_chat_id),a(te==null?void 0:te.subscriber_role),o(te==null?void 0:te.subs_expire_day),l((B=te==null?void 0:te.mushboomer_counts)==null?void 0:B.eth),c((q=te==null?void 0:te.mushboomer_counts)==null?void 0:q.sol),u(te==null?void 0:te.referral_code),d(te==null?void 0:te.refcode),f(te==null?void 0:te.whitelist),x(k),g(T),qe(!0),Ie(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),x(""),g(""),Ie(!1))}catch(te){console.error("Token verification error:",te),console.error(te.message||"An unknown error occurred."),Ie(!1)}},p=kn;if(!e)return null;const h=Re||Be||tt||je,S=C&&!tt,_=vn(ne);return i.jsxs(i.Fragment,{children:[i.jsx(fd,{open:Dt,setOpen:At,transactionHash:Je,transactionLoading:ft,paymentPresaleRole:Rt,errorFunds:Ut,activeMethod:2}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!h&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#F8D4AB] max-h-[97dvh] overflow-y-auto",children:[i.jsxs("div",{className:`${Z==="ON"?"pb-3.5":"pb-2"} px-5 pt-5 border-b border-[#353535] rounded-t-3xl relative`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("img",{src:"https://static.asterdex.com/cloud-futures/static/images/aster/logo.svg",alt:"Dextrabot - Aster Farming"}),i.jsx("span",{className:"text-[24px] font-semibold text-[#F8D4AB] mt-[1px]",children:"farming"})]}),i.jsxs("div",{className:"flex justify-between items-center gap-4",children:[i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2",children:"Aster Farming module lets you set up automated farming by providing your API Key and Secret, selecting a pair, defining orders per hour, leverage, direction, and TP/SL percentages."}),i.jsx("div",{className:"flex flex-col items- justify-start gap-1",children:i.jsxs("div",{onClick:()=>window.open("https://www.youtube.com/watch?v=qFJxq-vzctE","_blank"),className:"h-6 sm:h-7 w-[130px] py-2 bg-[#FF0000] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#ff4d4d] inline-flex justify-center items-center gap-1 cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsx(Wk,{})}),i.jsx("div",{className:"text-white text-[13px] font-medium leading-[8px]",children:"YouTube"})]})})]}),C&&lt===2&&i.jsx("div",{className:"pt-4",children:i.jsxs("div",{className:"flex items-center justify-between rounded-[12px] border border-[#2A2A2A] bg-[#1f1f1f] px-3 py-2",children:[i.jsx("span",{className:"text-[12px] text-[#CECECE]",children:"Your farm process is currently running. You can follow it here."}),i.jsx("a",{href:"https://www.asterdex.com/en/stage3/statistics",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center h-8 px-4 rounded-[10px] text-[12px] font-semibold border bg-[#F8D4AB] border-[#f7c080] hover:bg-[#f6e7d5] text-black hover:text-black",children:"Points"})]})})]}),i.jsxs("div",{className:`${Z==="ON"?"space-y-3 pt-3.5 pb-3":"space-y-2 pt-2 pb-2"} px-5`,children:[dt&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:dt}),i.jsx("div",{className:"px-1 sm:px-4",children:i.jsx("div",{className:"w-full flex gap-2",children:i.jsx("div",{className:"flex-1 h-9 rounded-full text-[13px] transition flex justify-center items-center font-semibold",children:i.jsx("div",{className:"airdrop-btn",children:i.jsx("span",{className:"label",children:i.jsxs("span",{className:"text-[#F6D5B1] font-medium text-[11px] sm:text-sm flex items-center gap-2 min-w-max",children:[i.jsx(tMe,{className:"w-4 h-4"}),"Stage 3"]})})})})})}),v&&!C&&lt===2&&Rt&&i.jsxs("div",{className:"flex flex-col items-center gap-2 px-2 sm:px-5 ",children:[i.jsxs("div",{className:"flex justify-between items-center  rounded-[12px] border border-[#2A2A2A] bg-[#1f1f1f] px-3 py-2 w-full gap-2",children:[i.jsx("div",{className:"text-white font-semibold text-[11px] sm:text-[14px] leading-4 font-manrope",children:"1) Enable Trading on Asterdex"}),i.jsx("div",{onClick:()=>{window.open("https://www.asterdex.com/en/futures/v1/BTCUSDT?ref=9876D8","_blank")},className:"flex items-center justify-center h-6 px-6 rounded-[10px] text-[13px] border bg-[#F8D4AB] border-[#F8D4AB] hover:bg-[#dbb689] cursor-pointer min-w-max text-black hover:text-black/90",children:"Enable Trading"})]}),i.jsxs("div",{className:"flex justify-between items-center  rounded-[12px] border border-[#2A2A2A] bg-[#1f1f1f] px-3 py-2 w-full gap-2",children:[i.jsx("div",{className:"text-white font-semibold text-[11px] sm:text-[14px] leading-4 font-manrope",children:"2) Create Your API Keys"}),i.jsx("div",{onClick:()=>{window.open("https://www.asterdex.com/en/api-management","_blank")},className:"flex items-center justify-center h-6 px-6 rounded-[10px] text-[13px] border bg-[#F8D4AB] border-[#F8D4AB] hover:bg-[#dbb689] cursor-pointer min-w-max text-black hover:text-black/90",children:"Go to Asterdex"})]})]}),lt===2&&i.jsxs("div",{className:`${Z==="ON"?"space-y-6":"space-y-3"} px-3 sm:px-5 py-2 `,children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[Z==="ON"?i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 1"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key"}),i.jsx("a",{href:"https://www.asterdex.com/en/api-management",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:I,onChange:k=>P(k.target.value),autoComplete:"off",placeholder:"ASTER_API_KEY",type:un?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${I===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:h||S}),i.jsx("button",{type:"button",onClick:()=>cn(k=>!k),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:h||S,children:un?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Secret"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:R,onChange:k=>F(k.target.value),autoComplete:"off",placeholder:"ASTER_API_SECRET",type:Pt?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${R===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:h||S}),i.jsx("button",{type:"button",onClick:()=>Xe(k=>!k),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:h||S,children:Pt?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key"}),i.jsx("a",{href:"https://www.asterdex.com/en/api-management",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:I,onChange:k=>P(k.target.value),autoComplete:"off",placeholder:"ASTER_API_KEY",type:un?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${I===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:h||S}),i.jsx("button",{type:"button",onClick:()=>cn(k=>!k),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:h||S,children:un?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Secret"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:R,onChange:k=>F(k.target.value),autoComplete:"off",placeholder:"ASTER_API_SECRET",type:Pt?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${R===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:h||S}),i.jsx("button",{type:"button",onClick:()=>Xe(k=>!k),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:h||S,children:Pt?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]})]}),Z==="ON"&&i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 2"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key 2"}),i.jsx("a",{href:"https://www.asterdex.com/en/api-management",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:U,onChange:k=>L(k.target.value),autoComplete:"off",placeholder:"ASTER_API_KEY_2",type:Vt?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${U===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:h||S}),i.jsx("button",{type:"button",onClick:()=>Yt(k=>!k),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:h||S,children:Vt?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Secret 2"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:z,onChange:k=>X(k.target.value),autoComplete:"off",placeholder:"ASTER_API_SECRET_2",type:Ve?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${z===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:h||S}),i.jsx("button",{type:"button",onClick:()=>Ke(k=>!k),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:h||S,children:Ve?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Zl,{styles:zn,components:{Option:Lt,SingleValue:Fn},isDisabled:h||S,options:p,value:p.find(k=>k.value===ne)||null,onChange:k=>J((k==null?void 0:k.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per Hour"}),i.jsx("input",{value:he,onChange:k=>{const T=k.target.value.trim();if(T==="")return Y("");$n(T)&&Y(T)},onKeyDown:Qn,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${he===""?"border-[#353535]":Jn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:h||S}),he!==""&&!Jn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:Z==="ON"?"On":"Off"}),i.jsx(Oo,{checked:Z==="ON",onChange:k=>re(k?"ON":"OFF"),disabled:h||S,className:`${Z==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${h||S?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out  ${Z==="ON"?"translate-x-3":"translate-x-0"}`})})]})]}),i.jsxs("div",{className:" space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Leverage"}),i.jsx("input",{value:ie,onChange:k=>{const T=k.target.value.trim();if(T==="")return oe("");$n(T)&&oe(T)},onKeyDown:Qn,inputMode:"numeric",autoComplete:"off",placeholder:ne?`1–${_}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ie===""?"border-[#353535]":Nn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:h||S}),ie!==""&&!Nn&&i.jsxs("div",{className:"text-[#FF797C] text-[12px]",children:["Allowed: 1–",_,"x"]}),Et&&i.jsxs("div",{className:"mt-2 space-y-1 text-[10px] text-[#CECECE]",children:[i.jsxs("div",{children:["Tier range at ",i.jsxs("b",{children:[fn,"x"]}),":"," ",i.jsxs("b",{children:[Mn(Et.min)," – ",Mn(Et.max)," USDT"]})," ",i.jsx("a",{href:"https://www.asterdex.com/en/futures/trading-rules/leverage-and-margin",target:"_blank",rel:"noopener noreferrer",className:"underline text-[#F8D4AB] hover:text-white",children:"More Details"})]}),dn[ne]&&i.jsxs("div",{children:["Trading Limit is"," ",i.jsxs("b",{children:[Mn(dn[ne].market)," ",dn[ne].unit]})," ","for ",i.jsx("b",{children:ne})," ",i.jsx("a",{href:"https://www.asterdex.com/en/futures/trading-rules/trading-rules",target:"_blank",rel:"noopener noreferrer",className:"underline text-[#F8D4AB] hover:text-white",children:"More Details"})]})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${Z==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"flex items-center gap-2 text-[13px] text-[#7C7C7C] font-semibold",children:i.jsx("span",{children:"Order Type"})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{"aria-pressed":ee==="MARKET",onClick:()=>!S&&ae("MARKET"),className:["inline-flex justify-center items-center gap-1.5 h-8 px-3 rounded-[10px] uppercase tracking-wide text-[12px] font-semibold transition-all border w-1/2",h||S?"opacity-60 cursor-not-allowed":"cursor-pointer",ee==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["MARKET ",ee==="MARKET"?" ✓":""]})}),i.jsx("button",{"aria-pressed":ee==="LIMIT",onClick:()=>!S&&ae("LIMIT"),className:["inline-flex justify-center items-center gap-1.5 h-8 px-3 rounded-[10px] uppercase tracking-wide text-[12px] font-semibold transition-all border w-1/2",h||S?"opacity-60 cursor-not-allowed":"cursor-pointer",ee==="LIMIT"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["LIMIT ",ee==="LIMIT"?" ✓":""]})})]})]}),i.jsxs("div",{className:`${Z==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{"aria-pressed":G==="LONG",onClick:()=>!S&&V("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-8 px-3 rounded-[10px] uppercase tracking-wide text-[12px] font-semibold transition-all border w-1/2",h||S?"opacity-60 cursor-not-allowed":"cursor-pointer",G==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsxs("span",{children:["LONG",ie?` - ${ie}x`:""]})}),i.jsx("div",{"aria-pressed":G==="SHORT",onClick:()=>!S&&V("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-8 px-3 rounded-[10px] uppercase tracking-wide text-[12px] font-semibold transition-all border w-1/2",h||S?"opacity-60 cursor-not-allowed":"cursor-pointer",G==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsxs("span",{children:["SHORT",ie?` - ${ie}x`:""]})})]})]})]}),i.jsxs("div",{className:`${Z==="ON"||ee==="LIMIT"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Take Profit %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:fe,onChange:k=>{const T=k.target.value.trim();if(T==="")return Ae("");Hn(T)&&Ae(T)},onKeyDown:Qn,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 0.5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${fe===""?"border-[#353535]":ln?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:h||S})]}),fe!==""&&!ln&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter a percentage between 0 and 100."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stop Loss %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:ce,onChange:k=>{const T=k.target.value.trim();if(T==="")return ye("");Hn(T)&&ye(T)},onKeyDown:Qn,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 0.2",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ce===""?"border-[#353535]":Oe?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:h||S})]}),ce!==""&&!Oe&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter a percentage between 0 and 100."})]})]}),i.jsx("div",{className:`${Z==="OFF"&&ee==="LIMIT"?"":"hidden"} grid grid-cols-1 md:grid-cols-2 gap-4`,children:i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Spread %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:Ne,onChange:k=>{const T=k.target.value.trim();if(T==="")return be("");Hn(T)&&be(T)},onKeyDown:Qn,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 0.5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ne===""?"border-[#353535]":sn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:h||S})]}),Ne!==""&&!sn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter a percentage between 0 and 100."})]})})]}),lt===2&&i.jsx("div",{className:"flex items-center gap-3 px-5 py-3 border-t border-[#353535] bg-[rgba(27,27,27,0.32)] rounded-b-3xl",children:i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!h&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] hover:border-white disabled:opacity-60",disabled:h,children:"Cancel"}),v?C?i.jsx("button",{onClick:Qt,disabled:h,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:tt?"Stopping...":"Stop"}):i.jsx("button",{onClick:tr,disabled:!Kn||h,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Kn||h?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Be?"Starting...":"Start"}):i.jsx("button",{onClick:()=>r(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})}),Re&&lt===2&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})},YTt=({linkTo:e,title:t,icon:n})=>i.jsx("a",{href:e,target:"_self",children:i.jsxs("div",{className:`${location.pathname===e?"bg-[#353535] rounded-[256px]":""} h-8 px-2.5 py-2 justify-start items-center inline-flex text-white min-w-max cursor-pointer ${e==="/tracked-wallets"||e==="/tracker"||e==="/referral"||e==="/wallet-management"||e==="/copy-trade"||e==="/leaderboard"?"hidden sm:block":""}`,children:[n&&i.jsx("img",{src:n,alt:t,className:"h-4"}),i.jsx("div",{className:"text-[13px] font-semibold font-manrope leading-[16px] min-w-max",children:t})]})}),Hf=({className:e})=>i.jsxs("svg",{viewBox:"0 0 53 96",fill:"currentColor",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:`size-full ${e}`,children:[i.jsx("path",{d:"M23 76.3751L0 96V20.687L23 0V76.3751Z"}),i.jsx("path",{d:"M53 76.4219L30 96V66.6279L53 46V76.4219Z"})]}),eo=({content:e,positionTop:t,alignRight:n,tooltipCss:r})=>i.jsxs("span",{className:`tooltip ${n?"left-5 top-1/2 -translate-y-1/2 ":t?"-top-6 -translate-x-1/2 left-1/2":"-bottom-6 -translate-x-1/2 left-1/2"} transform bg-[#353535] text-white font-manrope font-semibold text-xs leading-3 py-1 px-1.5 rounded-sm relative whitespace-normal ${r} h-auto overflow-hidden break-normal`,children:[e==="Sharpe_tooltip"?i.jsxs("div",{className:"flex flex-col items-start pl-4 gap-1 min-w-max",children:[i.jsxs("span",{className:"flex justify-start items-center gap-1 text-xs font-semibold",children:[i.jsx("div",{className:"rounded-full bg-[#FF7173] w-2 h-2"}),i.jsx("span",{children:"< 1"})]}),i.jsxs("span",{className:"flex justify-start items-center gap-1 text-xs font-semibold",children:[i.jsx("div",{className:"rounded-full bg-[#E5BB18] w-2 h-2"}),i.jsx("span",{children:"1 - 2"})]}),i.jsxs("span",{className:"flex justify-start items-center gap-1 text-xs font-semibold",children:[i.jsx("div",{className:"rounded-full bg-[#1DE6A3] w-2 h-2"}),i.jsx("span",{children:"> 2"})]})]}):e,i.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:`absolute transform -z-1 ${n?"-rotate-90 left-1 -translate-x-full -translate-y-1/2 top-1/2 ":t?"-bottom-1 rotate-180 -translate-x-1/2 left-1/2":"-top-1 -translate-x-1/2 left-1/2"}`,children:i.jsx("path",{d:"M3.70096 1.25C4.27831 0.25 5.72169 0.25 6.29904 1.25L8.89711 5.75C9.47446 6.75 8.75278 8 7.59808 8H2.40192C1.24722 8 0.525536 6.75 1.10289 5.75L3.70096 1.25Z",fill:"#353535"})})]}),vi=({className:e})=>i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[i.jsx("path",{d:"M8.00016 14.6666C11.6668 14.6666 14.6668 11.6666 14.6668 7.99992C14.6668 4.33325 11.6668 1.33325 8.00016 1.33325C4.3335 1.33325 1.3335 4.33325 1.3335 7.99992C1.3335 11.6666 4.3335 14.6666 8.00016 14.6666Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M8 5.33325V8.66659",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M7.99609 10.6667H8.00208",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]}),d5=({open:e=!1,setOpen:t=()=>{},oldSlotCount:n,checkAccountLighter:r,tradeMarket:s,product:a})=>{const{address:o}=Yr(),{setSignModalOpen:l,setTelegramChatId:c,setSubscriberRole:u,setSubsExpireDay:d,setMushboomerETH:f,setMushboomerSOL:x,setIsReferralCode:g,setIsReferralCodeName:v,setIsWhitelist:w,setHyperToken:C,setHyperAddress:N}=m.useContext(Gr),[I,P]=m.useState(1),[R,F]=m.useState(!1),[U,L]=m.useState(!1),[z,X]=m.useState(""),[ne,J]=m.useState(""),[Z,re]=m.useState(""),he=fe=>/^\d*$/.test(fe),Y=fe=>{["e","E","+","-"].includes(fe.key)&&fe.preventDefault()};m.useEffect(()=>{e||P(1)},[e]);const ie=m.useRef(Z);m.useEffect(()=>{ie.current=Z},[Z]);const oe=m.useMemo(()=>{if(I==="")return!1;const fe=Number(I);return Number.isInteger(fe)&&fe>=1},[I]),G=async()=>{var ce,ye,Ne,be;const fe=window.localStorage.getItem("hyperToken"),Ae=window.localStorage.getItem("hyperAddress");if(!(!fe||!Ae))try{const je=await Si(Ae.toLowerCase(),fe);je!=null&&je.success?(c(je==null?void 0:je.telegram_chat_id),u(je==null?void 0:je.subscriber_role),d(je==null?void 0:je.subs_expire_day),f((ce=je==null?void 0:je.mushboomer_counts)==null?void 0:ce.eth),x((ye=je==null?void 0:je.mushboomer_counts)==null?void 0:ye.sol),g(je==null?void 0:je.referral_code),v(je==null?void 0:je.refcode),w(je==null?void 0:je.whitelist),C(fe),N(Ae),re((be=(Ne=je==null?void 0:je.slots_info)==null?void 0:Ne[s])==null?void 0:be.total_qty)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),C(""),N(""))}catch(je){console.error("Token verification error:",je),console.error(je.message||"An unknown error occurred.")}},V=async()=>new yl(window.ethereum).eth.getAccounts(Ae=>Ae),ee=async(fe="slot",Ae=24,ce=5e3)=>{Ae<=0||(await new Promise(ye=>setTimeout(ye,ce)),await G(),fe==="slot"&&ie.current<=n?ee(fe,Ae-1,ce):r())},ae=async fe=>{J("");const Ae=window.localStorage.getItem("hyperToken"),ce=window.localStorage.getItem("hyperAddress");if(!Ae||!o){l(!0);return}L(!0),F(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(be){console.error("Failed to switch network",be),F(!1);return}const ye=new yl(window.ethereum);var Ne=await V();if(Ne.length>0?Ne=Ne[0]:Ne=void 0,Ne){const je=fe*.012,Ie=ye.utils.toWei(je.toString(),"ether"),Re={from:Ne,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:Ie};await ye.eth.sendTransaction(Re).then(Qe=>{console.log("txHash :>> ",Qe),F(!1),X(Qe.transactionHash);const Be=a==="grid_bot"?"bots_extra_slot":s==="lighter"?"lighter_season_2":s==="variational"?"variational":s==="extended"?"extended":s==="pacifica"?"pacifica":s==="paradex"?"paradex":"";fetch("https://dextrabothypev2.nftinit.io/api/hyper/slots_payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:o?o.toLowerCase():ce,token:Ae,payment_tx:Qe.transactionHash,slot_role:Be,slot_qty:Number(I)})}),G(),ee("slot")}).catch(Qe=>{console.log(Qe),Qe.code===-32003||Qe.message.includes("insufficient funds")?J("Insufficient funds."):Qe.message==="MetaMask Tx Signature: User denied transaction signature."&&L(!1)})}else await ye.eth.requestAccounts()};return e?i.jsxs(i.Fragment,{children:[i.jsx(fd,{open:U,setOpen:L,transactionHash:z,transactionLoading:R,paymentPresaleRole:!(Z<=n),errorFunds:ne,activeMethod:2}),i.jsxs("div",{className:"fixed inset-0 z-[9001] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>t(!1)}),i.jsx("div",{className:"relative w-[380px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#404040] max-h-[97dvh] overflow-y-auto p-5",children:i.jsxs("div",{className:"flex flex-col w-full gap-4",children:[i.jsx("div",{className:"text-white/90 font-manrope text-[18px] font-semibold leading-4 mx-auto",children:"Get more slots"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Slot Count"}),i.jsxs("div",{className:"flex items-center justify-center gap-2",children:[i.jsx("button",{onClick:()=>P(fe=>{const Ae=Number(fe||0);return Ae>1?String(Ae-1):"1"}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"–"}),i.jsx("input",{value:I,onChange:fe=>{const Ae=fe.target.value.trim();if(Ae==="")return P("");he(Ae)&&P(Ae)},onKeyDown:Y,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10",className:"w-full h-8 text-center rounded-md bg-[#242424] border border-[#353535] text-white text-[13px] outline-none placeholder:text-[#7F7F7F]"}),i.jsx("button",{onClick:()=>P(fe=>{const Ae=Number(fe||0);return String(Ae+1)}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"+"})]}),I!==""&&!oe&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer that is at least 1."})]}),i.jsxs("div",{className:"text-[13px] text-[#7C7C7C] font-semibold flex items-center gap-1",children:["Total Price:",i.jsxs("span",{className:"bg-[#1E1E1E] text-[#F8D4AB] font-bold px-2 py-[2px] rounded-md border border-[#3A3A3A]",children:[(I*.012).toFixed(3)," ETH"]})]}),i.jsx("div",{onClick:fe=>{fe.preventDefault(),oe&&ae(I)},className:`flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] min-w-max font-semibold ${oe?"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer":"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed"}`,children:"Buy"})]})})]})]}):null},zoe=({open:e=!1,setOpen:t=()=>{}})=>{var gi,oi,la,jr;const{setSignModalOpen:n,setTelegramChatId:r,setSubscriberRole:s,setSubsExpireDay:a,setMushboomerETH:o,setMushboomerSOL:l,setIsReferralCode:c,setIsReferralCodeName:u,setIsWhitelist:d,setHyperToken:f,setHyperAddress:x}=m.useContext(Gr);Yr();const[g,v]=m.useState(1),[w,C]=m.useState(0),[N,I]=m.useState(0),[P,R]=m.useState(0),[F,U]=m.useState(0),[L,z]=m.useState({}),[X,ne]=m.useState(null),[J,Z]=m.useState(!1),[re,he]=m.useState(!1),[Y,ie]=m.useState(!1),[oe,G]=m.useState("OFF"),[V,ee]=m.useState(""),[ae,fe]=m.useState(""),[Ae,ce]=m.useState(""),[ye,Ne]=m.useState(""),[be,je]=m.useState(""),[Ie,Re]=m.useState(""),[Qe,Be]=m.useState(""),[it,tt]=m.useState(""),[at,dt]=m.useState([]),[ct,Ut]=m.useState(""),[kt,tn]=m.useState(""),[jt,un]=m.useState(""),[cn,Pt]=m.useState("LONG"),[Xe,Vt]=m.useState("STANDARD"),[Yt,Ve]=m.useState("STANDARD"),[Ke,ft]=m.useState("MARKET"),[en,Dt]=m.useState(""),[At,Je]=m.useState(""),[He,Rt]=m.useState(""),[qe,lt]=m.useState(!1),[xt,Nt]=m.useState(!1),[It,xn]=m.useState(!1),[dn,Mn]=m.useState(!1),[_n,kn]=m.useState(""),[vn,Qn]=m.useState(""),[Hn,$n]=m.useState(!0),[Jn,Nn]=m.useState(!1),[ln,Oe]=m.useState(!1),[sn,fn]=m.useState(!1),[Et,Kn]=m.useState(!1),[Cn,Bt]=m.useState(""),[an,Pn]=m.useState(!0),[qn,nr]=m.useState(!1),[tr,Qt]=m.useState("Hour"),[zn,Yn]=m.useState(1),[Lt,Fn]=m.useState("lighter"),[Ee,p]=m.useState(!1),h=m.useRef(null),[S,_]=m.useState(""),[k,T]=m.useState(null),[B,q]=m.useState(""),[te,ue]=m.useState(!1),de=k?(k==null?void 0:k.getTime())<=Date.now():!1,xe="https://dextrabothypev2.nftinit.io",we="",ke={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI"},Me=["BTC","ETH","SOL"];m.useEffect(()=>{async function Xt(){if(e)try{const st=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_lighter_coins/")).json();if(st!=null&&st.coins){let Ft=st.coins.map(yt=>{const pn=(yt==null?void 0:yt.label)||"",An=ke[pn]||pn,or=An==="XMR"?"https://app.lighter.xyz/assets/xmr-CV8khZ54.png":An==="NMR"?"https://app.lighter.xyz/assets/nmr-2YIHMk6g.png":An==="USELESS"?"https://app.lighter.xyz/assets/useless-BTmgr78l.png":An==="DOLO"?"https://app.lighter.xyz/assets/dolo-DuOVl-Vo.png":An==="CRO"?"https://app.lighter.xyz/assets/cro-C7lstwu3.png":An==="FF"?"https://app.lighter.xyz/assets/ff-CvnDhHny.png":An==="kTOSHI"?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAKx0lEQVR4XtVae3BUVxnfzYO8aHFKsptNeOWxm0JpyANoSi1V+0etIiQpHVoSa5niDOp0xsFa/6DTkIBSq9XWjm3zkqL9Q8eZ6h8ELY5TaaSGEUsgVDrkwWAgaKcBCUIhye7n951z7957v3PvPpLNBr6Z39zd8/x+v/Od75y7icuVLHsE3nXVA8SMW944oeniljHueOJxhk85+1YPTTaOzjxuCuNOJRuzZtyR2UZSjU8eA9oH4wPvHxNm3PiEUcBJTRV83KiYEeOTOIA7n2jw+RyRUOOD24A7OtPg89siIcYHtQF3LlngfthiWsYHswF3Ktng/thiysYHsiHurg1CibcCXj0xpjiXTHD/GJo4teimDqKQJ7hrDbg2AATyKhTnkgXupwVxGe/sQP6lngtIPATPtR8GVx3WkwgE/OzPq1QcTAa4v1MTgXfUMH+rdbL7H9wsCLfh52df+zMs8VXISDDh85u+rjg5k8jdqvodnwi8gwl8srLCak2AkBDhzVPXYGfbe2Hy+tbIKtyo9DWjbSCET4Jap9f7PVUQ8FbCQu8acNX0ILoRf4Pblr+otOd+xy4AvWryDg7kCUsLqsUWaB8MCgEIHb1jQoSsLx6zREIqtRsIQsBTAa57/iIIpDwSEgJ1DE2G+xNo7M4BFNhbhe1we9WgqDWHILWmL7zF3PUT4Bfzq35NXQTeMAJ5QmDhSkgRAsgI0NHU/p4Qocy7whIN9JyXW6qVhSwCtQ8Z/XVQGzeSLc67S+YVTzU0tXWH2+Ys2CISL/crqgiOxhtGEWDrnn22AhBIAGM7hCD1oQsKaQ4a0xiD2hrtSYgmHM8cJan39eC2qFL8iiqArQi8QRTyOpwEeGNQOkwipH7hpCQhIMNeJ2c+Qum7WQBqu7b5ktYnBCnYphkjgOpL7wg4hn9MIijGG8QqAK5Mx6CVvIgA2gbt3eC+96/KSkuYVpeIDMjv7ef0fCCFasdc4Fqvt5NlnTQv5oVi752KPxycj70AvFLDnqPqgByU3Dot+zeEq96Nq38I3JS8FOIcknjnsOZwnXzKLYDiogB1nTcsfdJqDop2racnFX84nu9Weaki8AoNfDA7kCOlvgATAInfcyic+CJD7nU9nNuGJHFDgKBY+XD7DSExZ7GvXPHFCZxXQgWgdwF37YQR+q2HxBEnQh9Dd+tvrsB3eiInP7MYe88FRT7Y/qcxzC8AP/lo0lIvREFxynyrFF+cwHnFJEDZd9WB7CDO6lrtO26FAF5YKAIoMb5yImhD0h7maHHXGQmSt9NF2HvG+eLEUfk8KPwMAerhklJRrw7ihJVVtcIp2qu7Ot8X5Pdi2Mp3g0grH6nOCdp2WRfEyxPdC5yPQA7OzxCBF8QpAIFWamHxKmj8xo9FdqYQ7sBs7v6S7rT5qUOSMUM/7ozvMvNbx9A+Yy5oG1J9cQLnl1AByKFSTxEUPtwFz/7soFbGCXNwYrzeCSaBMMeU5ceWCzi/hArgx5eUxd67xdHn+jJ32Ar90lP2rVGRNPUx0jdcM+rDbQ1hqDyrbgxeH56EN86Na+1CMGf9fxV/7GAkPG425OMV4PFvvyiPPnHux7aaBU9eEX31o1MXw0Jeux3KIzIkLlzyUmSdw++J/iMMp22YDfl4BQh4KgX5tHVXFaI6AX3FeB2H3pYwODIaLuPtzO3p+erxy4pfZnDahtmQj1cA1730bo7h70CQnLy9qhUW4TYpzavEfFEFpV56IvAYLcmvhBIvlSEKysXKD41cgoGRi9B/YVR892Nbf75s6y+ogju95XgBq4Bl+eVSBDx1lhZ9VvEt7KOj2ZCPR4BSzwqx+nTt5StlvcHhip6/iKRGYZFnGfarEDj7nzFBVMfRw32Qgu/65jL3o9eh/5zs68f5KOSHP/4fHDlMvw9Y8wTVcx9nTIC2/klt9UkAigDDEXoOofODJiL0mZzXyVPyNBPtef9DOD1y2VKmY/iTq+G+Z7DNIEbIvLVvQ/oDJzQfJPwOr8ectmE25GMVgMJZ/lqDAqyXtz66vq770RWFgBnk/L/HPoVCfIdY4FsOT2/ZDgPnZcib0dr5W5ty+m6Ukag0HvlQ+8QOxcewADYcBZSCGAUIeKvD5MX+ryMBQuLnLk5kSrhwSa54XoVaZ4PBkcjHIednFiDuq3BrfxDy89cZq49IXfMuPrstIZ9s0B9ouK/RBXDYBrG8DNGLj9j7mhABX5XiVDw4LZKkCedHlTaRQOJzHwmRX4YcBCDwgZzw2ofXxBHGHTr10VmlLBKIwBIMe31fi/BHUYZIGCaOPFFU0KnE/eO8Ei4AgWd0HV37uuD8x5GTIke/6bP9lhrFcQ+IsQ/g01w3NPyJ4hvnFbMAzxxUiTqBVkx19KJYubd/8XvhbNebXWqYx41ROIDjiPFM0Ov5Nnjh7yovVYAIInCidmjDpMgd/V2HRtoEus0Z3/c7i2YHzAenTo9A11t/hPLiz8Gj25qhNFfeJPUx+7WLltk3zsee/DQFoD+E0koTId2ZA1p4drz8K3E5KcH9XIIClJguQp0vvaW1swpl/r4fV7uiuEbsbRKazx32AY/l1h+0C7HKCoxXZM7HWQAy3ihGEQb/dRnDcj/QvizxlIsLku5sb0MmHGuYY0GveGZIMVCYLtFXJ38AfvnKr2HTUi9MtmTBxK4sZb5IKM1FofNkIuQ8ZkwAurD8/ORVpfzBr2wThI83pIfJT+zKFBhHYuM/nA/HHs+B41uyRES8s+8PYgWL8QXnys50uNGcBhMtKFSe/fU2GjiPyOTJIvxHNx88FtBvdnK1DeJBJB7aNQfGkdinTSnQ91gqnECBiu5YAb2b06G88C7cUith8vsZEMhfAfeXqsdaLOD+xyYAGW88TRFKfNXwAQnQMgd++sBcFCRDCHJjTwZMClGyoLcxA1Le2QhHHkuHsztuE2XXd2ZD5u6HAVrSlDGjgfsdO3ndeCcN859SJ4uGviczoNizSpA+sikbjjakGVugBQVAHGucIwSA3anhSCEEvKuh2LcKLmyfq4zrhNynVL8TJgCBTxgN9U+3iG0gVzsTfL77wgLQStPnY43p4D6IArwgv0tkQFF+NSzJLId/bs4Av69GGdsO3N/4yevGO09RhJNPYNZvzIRDG28PEw7uJgGMle5FAVwYAeNI2hwBi/F2mXJkM6xdnIvfs5WxObifUyevGx8kThFe/uCiCP1/NEhiHiREz21L54fFIAx9Mx3SvrfcUkY4jn0DuSsxOaaIuqIIpwH3j2EnpxabqQMp4I6YUeS923ICEIm+r9E+z8HVzrGUF3lIHKsAhNSeBgg2ybxhdyfg/thiWsYHswF3SofI+I20+llwA5PdM2vy8XKTJkQZb7aGOw9/K7JEHqHngvnLkkheNz6oDTh5ug3SbS+0OwsTIBLYTIlQywG4n09uSkExsrVkmCPKCCHtOdlCEULIFv2KCyrw0kTRI3MBn98WCTU+uAN0AUq85UKAJfmrYXjHPEGcToJe7Rgk+D0rxarSUUg3vkmHKCjCC9EJPAlCe+Yq8zliRoxPEgF9X5WhzkNZPjNgsWc1Hnsuhezl5+Za3hv0fnz8iJhx4xNGgU6antfxBWcR/QEEr8nBJjXpmcHHiYqkGp98tjFrxh1JNmrhM9yl5BtdNLhjycBNadzJxOMMn/LmNNXx6eGWtwg/ttgiSfZ/z360yWKNq4wAAAAASUVORK5CYII=":An==="EDEN"?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAADjElEQVR4Xu2Zy0prMRiFq1ZrFUFwKkJHDi0WZ04E5/o2YhXfRF/AkU4E30AcdCoUiiCCIxXxhpfmsDbksFnpbnP547lkf7CoJ+z8+bNOspOdVFTiVLggNUoDuCA1SgO4IDVKA7ggNUoDuCA1/rgB39/fXPSj/LgBnU5Hra2tqYmJCVWpVNTY2Jianp5WBwcH6uXlhR+PTnQD2u22mpmZUbVaLessOl0kmIJn8Ds5OcmhoiBuAIb05+en2tzcNDroo7m5OW5CFFED+v2+urm5UePj40ZHQoRRMTU1lcWXRsQA/I+D1dVVI3lpgbe3t3zzQYgYADBn6/W6kbC0MBq2t7e5eW+CDMCQxJzHS44TjSmYgJVEgiADACf3U8KI293d5XScCTKg2Ww6v/Cq1Wr2i6UOf+eXRvwbyyXXKRJivL6+clpOeBmAYY8NDSc0TOiozUan1WplJrgYG7Kb9DLg4+MjG4KcSJEeHh6yek9PTxTJRHdmdnY2W/o41iBtbGxQFHu8DFhZWTGSKBKGKAzzodfrGfGK5DsKvAzgxoskwdHRkdVIaDQaXNUK5yy3traMxvPSHzmS7O3tGe2w0K4PzpmOmvtI5P7+nqsFw+0MUrfb5WojcTaAG2VhKXt/f+dqwWC7rUfXMLniXIMbzAtz9e7ujquIofcQRfL5hLY2ANve8/PzkUnEAm/5w8NDoz2WK041lpeXjQZZseH2WK5Y18ActPnai82wUyWflcA6Y0wBbE/RSJEwPWKjOzpIMMcVawP+V0oDuCA1SgO4IDVKA7ggFH1E/q8gboBmZ2eHi7zRx2MxEI2KzRKusvRX2+LiIj9ijb4Fmp+fz2LBBJwVXlxc0JNhiBqAW17eni4sLDh/HuvjLY6lBVOkCDIgf1c3bI8OXV9fF97t5a+6YBbXLZIEwVFw6GnzkaS1tLTEITJOT09/PzPKTP0MpsXz8zOHciLIAJz2cmK20u8JdMLlDiAvmPD4+MhpORFkAObqycmJ1amttGBa0ZRyIcgAzfHxsZFgTEl+dosYAG5vb72Hso0QW68ykohF029yTlxK6Pz+/n7Whu9N0yDEDNBgK3x5eWn1JreVHvK+11/DEDcgz9nZWdYB/ca3lTYPv19fX5liEdUAgOSxuVlfXzeuvfUtE8p0p2HW1dUVh4lGdAP+dkoDuCA1SgO4IDVKA7ggNUoDuCA1SgO4IDWSN+AXxfi0jU1sI9sAAAAASUVORK5CYII=":An==="AERO"?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAGo0lEQVR4XuWbeWwUVRzHF8Ha0oOi4Sw0RoP6HyCUQ0MQEqOBkNQY/4AEY4z/STwS8EqM/5giIkaDicihUI5EoGgQGg0YFFHBSAQ5Qists0dnd2Z2etCWskDn5/u9YY/5vWmb7ry94Jd8spOdmffe9/eu33v71ufLkkUiV+YZqv+IFlZiRsQPbvB77BlTU+bT9wvOolqglgpMi7Afomqglqafl2aElaWCAMnoYWUJzTfnpqv+OlrQTKNH/GtpObJuhhqYTQuWdVgZaLmyYkJBcgwtX8YsGg1W0czzBSwbLa9UY5lsopnmIZtouaWYHhYyymto+T0ZTbxQoDrSMt0l4UKC6hmWGYXR54civTHBDIWmuCRWkKAWqm9Io4kUOlTfoIYLEJrAnQDV6WrRcKCGvningNqoXsHoS/lCVBO/Sweq12FsVbeWvpArTD0I6z5aD+UV1VBaNgXKyqdy8Hv67HBg03od1Z0w+nA2MfUANOzbx0WmCqbQ99KB6uaWjc0MSrsRgvXrPoHiksmCUA46oqwKiqvrYNTMPqhcYIGUkJxppfqzWvs7tm+HktEDiy56pBFGzgIY5UJTs7cuEIfqz4oDWpovuNd22WQomfQKE20JguOMfBzgnpnABkNFSDcdHOI1VXmOPiCTSNsVUTgTfd9DmwesaRRc8STA6g0AX38HsLUBYMt+YOnJcQBqTjhAD8tJ1I0JEx91CC+tnO5a0yj43tkA73wGsO2ALdgNTRXzSAdc5CUcQG/KIBxqdYzmo+9fINR2vJa//FYUGgdrfefBW3CxuR2ihirk44WMOeDM6VOOQY0KL54D8NVeW5yb4O+PxqCzIwy93W0M1QHNywtcvKYp8+kNL+ysr0+IL3rsuEN4zQpRsC3aguYW01VwnJ4e5hCGzO6Kv1b5DFU5Qm94gTd7UuvVz7qL1vWIu+irbdBzTYPrOzaCNaEIoNIHMNZG9xgJOmDafYP9Vjdc/K2X+OgeF4/TVuqAhs376B+9rqKxhvt+awRr3CiHYIohsQVoESUmtf/jPB8XP/UZZx///XS3IJzXcv1GgHJRaAJ278biWWD+fQJ0FjnSPL0i1QHtusLFP/FiUvjuQ7ccwnsYfT/uHVh0hQ+uL1/Kazob+5FSHfDvhRAsfzvZ3O2RPCn85ool7s2bie5s2AW6FhDSzDRSHYBRWrzmTdMp3q3G+6srwDz5S1ZqeiCkOkBjKzWs+audSeHWww84hbMW0P15XU5FpyLVAcFAELq7klOZo7mz60Xl4+2osLQKamoW8VkjmoNmn4rUaRCDFC6+9Yyj1k9NnAPLVvWCqdtT2KpX3+TL4XiojJ+48/PWmvfgctN5vk9A084EqF1qIIT7dn2H9jjEHz3cBL4ZyaAIr+sP6AlnIO1GEE4cPwZvvL4Gpk2bxZ2DYEspLpnEnbPwqSVCfp7BQIgfXqI30gR3a1Kb/ZaGfj4gHvz5Gp8iv9gVZQsgiy+C4oHS6LkWfPqNeXudP3CQI2tTNBVcBshdDCmXEuJjGz4Avz/sCIa2HbAg3IZ9XuEOOXm6DVZ92AWl8ywYMeP2pgcDr6e/EIOPt5pw9lwITOYcRMjPI9JXg9GmswkH9AYu2DMBGwxRcMNP1xPOsD8tOHdRgyiv9VRxtnNwRjl/MQj7GjVYvb4TVr7bLeTnlYQD9EGa3nDAqS3RBcb4nGEvcwQOkij4v8sq7PrhJmzenwyX8XrP4RvwzzmDi7edIqdcbjg2RKRuiSlNSSewT0Nt5eJTndHVESLLWoWPH5dbVDj2ZxfsZs5Bx8QdhJ/YfYS8PODYEkOjD3gBvWuNK0p0h/6qUraMtae27i5xJXi1M8QHOZlr/aFwiJftgDjXXnvZ0RpiyxbyFV1caGd7UGgdCDqp3bADJHw2E46h+jP2wwi2BvOvX8EaOyIZH7DFz42n54IRanEsgFLF4i9FHWaQtw50kj2YiumnhdsPI2jCg5Lh8T8T3bey1l4cpQyYuPPTve59PobEu0umoLoTlqMjr3ybq6NxP/S99Dz0P1hpO2fMbdi1Nb4IYrWLhXfTYcgjtvSFfIA7yeX7dKB6BbvrD0igZWLUzTWoieoc1GgChQ7VN6Td9cfk0LQ74KAkaqC6hmUFfWQunEbTdzMh4QKB6vBkNPG8RlbNUyuEMcFznx/KosE8/stMMMN/mUm1fAqWhh3kyLK7+m9zqZaLI7aDHnnNlWVqU8XBQJsZ+WaaeqVWxjiBO9aYFk2/4IwfxlKVwf8+H8F7yhF+eClL9j+y7eB1y657sQAAAABJRU5ErkJggg==":An==="MYX"?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAL5ElEQVR4nO3db2xV9R3H8ffvtgnX0Qc/266osU0hdPOJGRoTupEpo2aSJUUhEnyAkYypLItLfGR8NJ9sxj1zmRMFjPzZhGAitJP5YE7GEgOLMSwsUYFJLYTwp2U/lxJr0vLbg/ZCqe3pvb3nnt85535ej1ruued+H/DO75zbc881BGRt821QuA9YBr4LQyeeNoxpBZqAYsj5JCl+DIwDHPjzeAYw5gSeT8EfdW54KNRkJskXs7bVYliJpxfDSmBJkq8vmXUa748A70DhsHOXR5J64ZoHYq1thIbVGB4HswatClIVPwocwrPNueH3av1qNQvE2lYLfguGzWCW1up1pJ75AeBl/PhW59xoLV4h9kCstUVofB7DLwEb9/5FvslfAF6qRSixBmJt80ZM4UXgzjj3K1IefwHvn3Xuyt649hhLILa5tZNrfgfGrIpjfyJV8f4IBfOEuzI0UO2uCtXuwNrmTXhOKA5JDWPux/tPrG3ZVPWu5vtEa20R0/AKmJ9WO4RI7fhd+PGn53tuMq9ArG25DXgXY+6dz/NFEuX9h2A2ODd0rtKnVhyIta2dwAcYOit9rkhAAxh+VOl5SUXnILb523dh+IfikAzqxPOBbW65q5Inlb2CaOWQnDiH4YflriRlBWJt851Q0MoheTGA9993bvjCXBvOeYg18Zdxs09xSI50gnl34v92tLnPQUzDaxjzgzimEkkNw72Yxlfm2qwh6kFrmzdhCr+KbyqRVLmnWLzli9HRr47PtsGs5yDWtnZi/CdgdHm65NkIhrtnO2mPOMTyOxWH1IEmrrFjtgdnDMTa5scw5v7azSSSIoZV1rZsnPmhaSavsfoCTFvtJxNJjXP4sa7p12x9cwUxDVsUh9ShO6Hx+en/eNMKotVD6pzDs9i5IVf6h5tXEK0eUt8m7qMwxc0ryK0tX4DpSHYmkVT5HD/2XefcGExZQaxtWa04RFgCjatLv0w9xHoywDAi6WP849d/BLDWNmEaLusPgyIAfhRvbnduyE2uIA0rFYdIiSlO3hr3+iHW2nDDiKSQ971QCmSyFhGZNNmEsbalFWMuBx5HJH38tdsLQHfoOUTSqXBfAWMqusuDSP3wywp4f3foMURSqqsAuhmDyIwMnQXgjtBziKSSp62AMfqSG5GZGFoL4BWIyMyaCmAaQ08hkk6mWPUX6IjkmQIRiaBARCIoEJEICkQkggIRiaBARCIoEJEICkQkggIRiaBARCIoEJEICkQkggIRiaBARCIE/yxIR3s7/f0H6OjI1o3lR0ausn79Bo4eOxZ6lDlt2fIUL/7m16HHqNhf33+fjRuf4Ouvvw42Q/AVZPDsWXp7H2FwcDD0KBVpalrI/v376F6+PPQokRRHdYIHAoqkVhRH9Yy9tdWHHqJEh1vxWbduLTu2vx56jIqlKQ5IyQpSopUkHmvW9PLa1j+EHqNiaYsDUhYIZD+SZcu+F3SONWt62bH9dRobg7//UpE0xgEpDASyHcnet/5EV9fSIK+vOOKXykAgu5EsWtRGf9/BxCNRHLWR2kBAkZRLcdROqgMBRTIXxVFbqQ8EFMlsFEftZSIQUCTTKY5kZCYQUCQlWY3j6NGjbNq0OTNxQMYCAUWS5TgeXf8YV69eDT1KRTIXCExE8sjaR7l48VLoUSpSbSSKI3mZDATgzJkz9K55uG4iURxhZDYQgFOnTtdFJIojnEwHAtmOZN26tXNupzjCStXl7tXo6lpKf99BFi1qCz1KWQ4e7GPzz55ifHx81m16elaxZ/dOisVigpNVLy9xQA5WkJIsrSSKIztyEwhkIxLFkS25CgTSHYniyJ7cBQLpjERxZFMuA4F0RaI4sis372LNpqtraVlvp9bK1ZGrvLr1NcWRUbkPJO0UR7rl9hArC7Iax4kTJ+oiDlAgwWQ1jpMnT9VNHKBAgshyHL1rHuHSpfBvfCRFgSRMcWSLAkmQ4sgeBZIQxZFNCiQBiiO7FEiNKY5sUyA1pDiyT4HUiOLIBwVSA4ojPxRIzBRHviiQGCmO/FEgMVEc+aRAYqA48kuBVCmrcQwODiqOMiiQKmQ6jl7FUQ4FMk9Zj2Pw7NnQo2SCApkHxVE/FEiFFEd9USAVUBz1R4GUacWKFYqjDimQMnQvX87et/6oOOqQAplD9/Ll7N+/j6amhaFHqYjiiIcCiaA4RIHMQnEIKJAZKQ4pUSDTKA6ZSoFMoThkOgUySXHITBQIikNmV/eBKA6JUteBKA6ZS90GojikHHUZiOKQctVdIIpDKlFXgXR1LWXPnp2KQ8pWN4F0dS2lv+8gLS0toUepiOIIqzH0AEkoxbFoUVvoUSpSThxtbW309KxKcKob+vr6c/9lnrn/nvS8x9Hfd4DvfKcrwcluqIfvSs/1IZbiqK3u7m7e3r+XhQuzdU5XidwGojiSkfdIchmI4khWniPJXSCKI4y8RpKrQPIcx8KFC1MbR0keI8lNIFmN4+LFSzy6fsOccby9f1+q4yjJWyS5CCTLcfSueZhTp05Hbrdn9y66u5cnNFX18hRJ5gPJexwA27ZvZ2xsLIGp4pOXSDIdSD3EAXDo0F/YvPkpRRJAZgOplzhK+vr7FUkAmQxk8eLFdRVHiSJJXuYCaW9v58A7b9ddHCWKJFmZCqS9vZ0/9x+go6Mj9CgViSuOEkWSnMwEojhuluVI3nzzDRYsWBB6lLJkIhDFMbOsRvJgzyr27NmViUhSH4jiiKZIaivVgSiO8iiS2kltIIqjMoqkNlIZiOKYH0USv9QFktU4RkZGgsZRokjilapAshzH+vUbgsdRokjik5pAsh7H0WP/DD3KTRRJPBqKt3zrhdBDKI7a+OzkSYYuD/HQQz8OPUpFlixZzLJ7ltHX18/4+HjQWYIHojhq6/jxf/Hll1/yYE9P6FEqkpZIcn/jOJFqpOYcRCSNFIhIBAUiEkGBiERQICIRFIhIBAUiEkGBiERQICIRFIhIBAUiEkGBiERQICIRFIhIBAUiEqEAjIYeQiSlxgrASOgpRNLJuwLeXwk9hkgqefO/AnAh9BwiqWT8uQIwEHoOkVTyDBTAnAo9h0gqGXOiAP546DlEUsnzaQH8R6HnEEknf7Tg3JULeD4PPYpIqnh/2rnhodJf0g+HnEUkhY7AjUtN+gMOIpJC5h24EchhdMmJyCQ/CuYwTAbi3JDD+76gM4mkxyHnLo/AzVfz7g40jEi6eLaVfjSlH6y1jdDwGcYsCTOVSAp4P+Dc8OLSr9dXEOfcGNwoR6ROvTz1FzP1F2tbLXAGg010JJE08P4CjC92zl1/w+qmTxQ6N+SA3yU+mEg6vDQ1Dpi2ggBYa4vQ8B+MuSO5uUQCm2H1gBk+kz6xgX8uuclE0sA/Oz0OmGEFKbG25X2MWVXboURSwPsjzg0/MNNDEXc1MZvR59Ul9/woBfPEbI/OGohzQwP4a8/UZiiRlPD83F0ZGpjt4Yao546OfnW8WLylA2PuiX0wkeD8LueGX4jaoowbx43/Au8/jmkikXTw/kP8+NNzbTbrSfpU1rbcBuYYho7qJxMJbhDPCueGzs21YVm3HnVu+ALwAN6fr3o0kbAGMTxQThxQwb15nRsaoFDowTM4/9lEQvLnMeahqJPy6co6xJrK2tZO4O863JKMmVg5KogD5nF3d+eGBuDaCrz/sNLnigTh/cd4v7zSOGCeX3/g3JVzMN6D97vm83yR5Pg3YHzF5Hl0xSo+xJrO2uZNGPMqmGK1+xKJ0QjeP+Pc8JvV7KTqQKB0XuJ3Ysz9cexPpCre/w3M5onTgerEEkiJtc2PgXkZY9ri3K9Iefx5PM85N7wnrj1GXmpSqdHRr/5dLC74PZhh4F6MWRjn/kVm5HHAb2F8vXP/jfWqj1hXkKkmP3i1BXgWY/SWsMTP+8+BbWC2Tn4aNnY1C2Qqa1tWA09i+IlO5qVKo5P3cNsN4+9N3mykZhIJpMRa2wQNK4G1wErdYkjKMnFz9cNM3CL3cK1Wi5kkGsh01ra0At1g7gJ/N9AJ3AHGYrwF0xhyPknMKJ4R8EPAJWBg4oud/HHwHzl3JdjXBP4fQFHoFHnhJJwAAAAASUVORK5CYII=":An==="CC"?"https://app.lighter.xyz/assets/cc-D4WHZ-w6.png":`https://app.hyperliquid.xyz/coins/${An}.svg`;return{...yt,icon:or}});Lt==="variational"&&oe==="ON"&&(Ft=Ft.filter(yt=>Me.includes(yt.label))),dt(Ft)}}catch(pe){console.error("Failed to fetch coin list:",pe)}}Xt()},[e,Lt,oe]);const Ye=Xt=>{var pe;return((pe=at==null?void 0:at.find(st=>st.value===Xt))==null?void 0:pe.maxLeverage)??100},Fe=Xt=>{["e","E","+","-"].includes(Xt.key)&&Xt.preventDefault()},rt=Xt=>/^\d*\.?\d{0,6}$/.test(Xt),se=Xt=>/^\d*$/.test(Xt),Ce=m.useMemo(()=>{if(kt==="")return!1;const Xt=Number(kt);return Number.isInteger(Xt)&&Xt>=1&&Xt<=180},[kt]),De=m.useMemo(()=>{if(jt==="")return!1;const Xt=Number(jt),pe=Ye(it);return Number.isInteger(Xt)&&Xt>=1&&Xt<=pe},[jt,it,at]),Le=m.useMemo(()=>{if(en==="")return!1;const Xt=Number(en);return Number.isNaN(Xt)?!1:Xt===0?!0:Xt>=1&&Xt<=1e7},[en]),_e=m.useMemo(()=>{if(At==="")return!1;const Xt=Number(At);if(Number.isNaN(Xt))return!1;const pe=jt===""?null:Number(jt),st=pe?pe*100-1:4999;return Xt===0?!0:Xt>0&&Xt<1?!1:Xt>=1&&Xt<=st},[At,jt]);m.useMemo(()=>{if(He==="")return!1;const Xt=Number(He);return!Number.isNaN(Xt)&&Xt>0&&Xt<=100},[He]);const nt=re&&be.trim()!==""&&V.trim()!==""&&Ae.trim()!==""&&it!==""&&Ce&&De&&ct&&(!en||Le)&&(!At||_e)&&(cn==="LONG"||cn==="SHORT"||cn==="RANDOM")&&(Ke==="LIMIT"||Ke==="MARKET"||Ke==="RANDOM")&&an,ot=re&&V.trim()!==""&&Ae.trim()!==""&&be.trim()!==""&&(Lt!=="lighter"||ae.trim()!=="")&&(Lt!=="lighter"||ye.trim()!=="")&&(Lt!=="lighter"||Ie.trim()!=="")&&(Lt!=="lighter"||V.trim()!==ae.trim())&&(Lt!=="lighter"||Ae.trim()!==ye.trim())&&(Lt!=="lighter"||be.trim().toLowerCase()!==Ie.trim().toLowerCase())&&it!==""&&Ce&&De&&ct&&(Lt!=="variational"||S.trim()!=="")&&(Lt!=="variational"||!B)&&(Lt!=="variational"||!de)&&an;m.useEffect(()=>{if(oe==="ON"&&Lt==="lighter"){if(Ae&&ye&&Ae.trim()===ye.trim()){kn("Make sure the wallet API indexes are unique for each Slot.");return}if(be&&Ie&&be.trim().toLowerCase()===Ie.trim().toLowerCase()){kn("Make sure both the Lighter wallet addresses are unique for each Slot.");return}if(V&&ae&&V.trim()===ae.trim()){kn("Please create an API key for each wallet.");return}kn("")}else kn("")},[oe,Ae,ye,V,ae,be,Ie]);const gt=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),Jt=()=>`lighterCreds:${gt()}`,Ge=()=>{try{const Xt=localStorage.getItem(Jt());if(!Xt)return;const pe=JSON.parse(Xt);pe.apiKey&&ee(pe.apiKey),pe.apiKeyTwo&&fe(pe.apiKeyTwo),pe.apiKeyIndex&&ce(pe.apiKeyIndex),pe.apiKeyIndexTwo&&Ne(pe.apiKeyIndexTwo),pe.lighterLoginAddress&&je(pe.lighterLoginAddress),pe.lighterLoginAddressTwo&&Re(pe.lighterLoginAddressTwo),typeof pe.remember=="boolean"&&$n(pe.remember)}catch{}},et=()=>{if(Hn)try{localStorage.setItem(Jt(),JSON.stringify({apiKey:V,apiKeyIndex:Ae,lighterLoginAddress:be,remember:!0}))}catch{}},We=()=>{try{localStorage.removeItem(Jt())}catch{}};m.useEffect(()=>{if(!e)return;const Xt=localStorage.getItem("hyperToken"),pe=localStorage.getItem("hyperAddress");he(!!(Xt&&pe));const st=setInterval(()=>{const Ft=localStorage.getItem("hyperToken"),yt=localStorage.getItem("hyperAddress");he(!!(Ft&&yt))},800);return()=>clearInterval(st)},[e]),m.useEffect(()=>{!e||!re||(wt(),dr())},[e,re]),m.useEffect(()=>{e&&(At===""&&Je(we),en===""&&Dt(we),He===""&&Rt(we))},[e]),m.useEffect(()=>{if(!it)return;const Xt=Ye(it),pe=Number(jt);!Number.isNaN(pe)&&pe>Xt&&un(String(Xt)),!Number.isNaN(pe)&&pe<1&&jt!==""&&un("1")},[it]),m.useEffect(()=>{e&&(Hn&&et(),Hn||We())},[V,Ae,be,Qe,Hn,e]);async function wt(){var Xt,pe,st,Ft,yt,pn,An,or,_r,wr,pr,es,ts,Lr,Qr,Ir;try{Nt(!0),kn("");const Ss=window.localStorage.getItem("hyperToken"),hi=window.localStorage.getItem("hyperAddress");if(!Ss||!hi){ie(!1),Ge();return}const Pr=await(await fetch(`${xe}/api/hyper/new_farming_app/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:hi.toLowerCase(),token:Ss})})).json();if(!(Pr!=null&&Pr.success)){if(console.warn("INFO API RESPONSE:",Pr==null?void 0:Pr.error_message),(Pr==null?void 0:Pr.error_message)==="You have not a running process"){const En=ct?ct.toLowerCase().replace("-","_"):null,Rn=L==null?void 0:L[En];if(En&&Rn){const Dn={...L,[En]:{...Rn,isStop:!0}};z(Dn);const Mr=Object.keys(Dn).filter(cr=>cr.startsWith("lighter"));if(Mr.length>0&&!ct){const Kr=Mr.sort((Ms,ei)=>{var mr,Vr;const Tt=parseInt(((mr=Ms.match(/\d+/))==null?void 0:mr[0])||0,10),sr=parseInt(((Vr=ei.match(/\d+/))==null?void 0:Vr[0])||0,10);return Tt-sr})[0].match(/\d+/);Kr&&Ut(`Lighter-${Kr[0]}`)}}else Ut("Lighter-1")}Pr!=null&&Pr.slots_info&&(I((pe=(Xt=Pr==null?void 0:Pr.slots_info)==null?void 0:Xt.lighter)==null?void 0:pe.total_qty),C((Ft=(st=Pr==null?void 0:Pr.slots_info)==null?void 0:st.lighter)==null?void 0:Ft.active_qty),U((pn=(yt=Pr==null?void 0:Pr.slots_info)==null?void 0:yt.variational)==null?void 0:pn.total_qty),R((or=(An=Pr==null?void 0:Pr.slots_info)==null?void 0:An.variational)==null?void 0:or.active_qty));return}if(Pr!=null&&Pr.success&&(Pr!=null&&Pr.data)){const En=ct?ct.toLowerCase().replace("-","_"):null,Rn=L==null?void 0:L[En],Dn=Pr.data||{};En&&!Dn[En]&&Rn&&(Dn[En]={...Rn,isStop:!0}),z(Dn);const Mr=Object.keys(Dn).filter(cr=>cr.startsWith("lighter"));if(Mr.length>0&&!ct){const Kr=Mr.sort((Ms,ei)=>{var mr,Vr;const Tt=parseInt(((mr=Ms.match(/\d+/))==null?void 0:mr[0])||0,10),sr=parseInt(((Vr=ei.match(/\d+/))==null?void 0:Vr[0])||0,10);return Tt-sr})[0].match(/\d+/);Kr&&Ut(`Lighter-${Kr[0]}`)}Pr!=null&&Pr.slots_info&&(I((wr=(_r=Pr==null?void 0:Pr.slots_info)==null?void 0:_r.lighter)==null?void 0:wr.total_qty),C((es=(pr=Pr==null?void 0:Pr.slots_info)==null?void 0:pr.lighter)==null?void 0:es.active_qty),U((Lr=(ts=Pr==null?void 0:Pr.slots_info)==null?void 0:ts.variational)==null?void 0:Lr.total_qty),R((Ir=(Qr=Pr==null?void 0:Pr.slots_info)==null?void 0:Qr.variational)==null?void 0:Ir.active_qty))}}catch{ie(!1),Ge(),G("OFF"),Z(!1)}finally{Nt(!1)}}const St=m.useMemo(()=>ct?ct.toLowerCase().replace("-","_"):"",[ct]),Kt=!!((gi=L==null?void 0:L[St])!=null&&gi.delta)&&!!((oi=L==null?void 0:L[St])!=null&&oi.from_slot),gn=Kt?`lighter_${(la=L==null?void 0:L[St])==null?void 0:la.from_slot}`:St;m.useEffect(()=>{var st,Ft,yt,pn,An,or,_r,wr,pr,es,ts,Lr,Qr,Ir,Ss,hi,li,Pr,En,Rn;if(!ct||!L)return;const Xt=gn,pe=L==null?void 0:L[Xt];if(!pe){ee(""),fe(""),ce(""),Ne(""),je(""),Re(""),tt(""),tn(""),un(""),Pt("LONG"),ft("MARKET"),ie(!1),G("OFF"),Z(!1),Qt("Hour"),Dt(""),Je(""),_(""),Fn("lighter"),T(null);return}if(pe!=null&&pe.farming_params){pe!=null&&pe.isStop?ie(!1):ie(!0),G("OFF"),Z(!1);const Dn=pe.farming_params,Nr=(pe==null?void 0:pe.lighter_api_pkey)??"",Mr=(pe==null?void 0:pe.lighter_login_address)??"",cr=(pe==null?void 0:pe.lighter_api_index)??"",bs=(pe==null?void 0:pe.slot_number)??"";Nr&&ee(String(Nr)),Mr&&je(String(Mr)),cr&&ce(String(cr)),bs&&!Kt&&Ut(`Lighter-${bs}`),Dn!=null&&Dn.cycleSeconds&&Qt((Dn==null?void 0:Dn.cycleSeconds)===86400?"Day":"Hour"),Dn!=null&&Dn.coin&&tt(String(Dn.coin)),(Dn==null?void 0:Dn.orderPerHour)!=null&&tn(String(Dn.orderPerHour)),(Dn==null?void 0:Dn.leverage)!=null&&un(String(Dn.leverage)),Dn!=null&&Dn.direction&&Pt(String(Dn.direction).toUpperCase()==="SHORT"?"SHORT":String(Dn.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG"),Dn!=null&&Dn.orderType&&ft(String(Dn.orderType).toUpperCase()==="MARKET"?"MARKET":String(Dn.orderType).toUpperCase()==="LIMIT"?"LIMIT":"RANDOM"),Dn!=null&&Dn.accountType&&Yn(Dn.accountType==="standart"?1:2),Dn!=null&&Dn.accountType&&Vt(Dn.accountType==="standart"?"STANDARD":"PREMIUM"),(Dn==null?void 0:Dn.tp)!=null&&Dt(String(Dn.tp)),(Dn==null?void 0:Dn.sl)!=null&&Je(String(Dn.sl)),(Dn==null?void 0:Dn.spread)!=null&&Rt(String(Dn.spread))}else if(pe!=null&&pe.source_params){pe!=null&&pe.isStop?ie(!1):ie(!0),G("ON"),Z(!1);const Dn=((st=pe==null?void 0:pe.source_params)==null?void 0:st.api_pkey)??"",Nr=((Ft=pe==null?void 0:pe.source_params)==null?void 0:Ft.login_wallet)??"",Mr=((yt=pe==null?void 0:pe.source_params)==null?void 0:yt.api_index)??"",cr=((pn=pe==null?void 0:pe.target_params)==null?void 0:pn.api_pkey)??"",bs=((An=pe==null?void 0:pe.target_params)==null?void 0:An.login_wallet)??"",Kr=((or=pe==null?void 0:pe.target_params)==null?void 0:or.api_index)??"",Ms=(pe==null?void 0:pe.slot_number)??"";Ms&&!Kt&&Ut(`Lighter-${Ms}`),Dn&&ee(String(Dn)),cr&&fe(String(cr)),Nr&&je(String(Nr)),bs&&Re(String(bs)),Mr&&ce(String(Mr)),Kr&&Ne(String(Kr)),(_r=pe==null?void 0:pe.source_params)!=null&&_r.coin&&tt(String((wr=pe==null?void 0:pe.source_params)==null?void 0:wr.coin)),((pr=pe==null?void 0:pe.source_params)==null?void 0:pr.orderPerHour)!=null&&tn(String((es=pe==null?void 0:pe.source_params)==null?void 0:es.orderPerHour)),((ts=pe==null?void 0:pe.source_params)==null?void 0:ts.leverage)!=null&&un(String((Lr=pe==null?void 0:pe.source_params)==null?void 0:Lr.leverage)),(Qr=pe==null?void 0:pe.source_params)!=null&&Qr.accountType&&Yn(((Ir=pe==null?void 0:pe.source_params)==null?void 0:Ir.accountType)==="standart"?1:2),(Ss=pe==null?void 0:pe.source_params)!=null&&Ss.accountType&&Vt(((hi=pe==null?void 0:pe.source_params)==null?void 0:hi.accountType)==="standart"?"STANDARD":"PREMIUM"),(li=pe==null?void 0:pe.target_params)!=null&&li.accountType&&Ve(((Pr=pe==null?void 0:pe.target_params)==null?void 0:Pr.accountType)==="standart"?"STANDARD":"PREMIUM"),pe!=null&&pe.target_app&&Fn((pe==null?void 0:pe.target_app)==="lighter"?"lighter":"variational"),(En=pe==null?void 0:pe.target_params)!=null&&En.vr_token&&_((Rn=pe==null?void 0:pe.target_params)==null?void 0:Rn.vr_token)}else ie(!1),G("OFF"),Z(!1)},[ct,L,Kt,gn]);const yn=Xt=>{var pe;return Number(((pe=String(Xt||"").match(/\d+/))==null?void 0:pe[0])||0)},hn=Xt=>(Xt||"").toLowerCase().replace("-","_"),br=m.useMemo(()=>{const Xt=L==null?void 0:L[hn(ct)];if(Xt!=null&&Xt.delta&&(Xt!=null&&Xt.from_slot))return Number(Xt.from_slot);const pe=Number(Xt==null?void 0:Xt.slot_number);return Number.isFinite(pe)?pe:yn(ct)},[ct,L]),pt=m.useMemo(()=>{const Xt=Number(g)||0,pe=Array.from({length:Xt},()=>({used:!1,kind:null})),st=L||{};for(const[Ft,yt]of Object.entries(st)){if(!Ft.startsWith("lighter_"))continue;const pn=yn(Ft)-1;pn<0||pn>=Xt||((yt==null?void 0:yt.isStop)===!0?pe[pn]={used:!1,kind:null}:yt!=null&&yt.source_params?pe[pn]={used:!0,kind:"delta-src"}:yt!=null&&yt.target_params||yt!=null&&yt.delta?pe[pn]={used:!0,kind:"delta-shadow"}:yt!=null&&yt.farming_params?pe[pn]={used:!0,kind:"single"}:pe[pn]={used:!0,kind:"unknown"})}return pe},[L,g]),Wt=m.useMemo(()=>pt.map((Xt,pe)=>Xt.used&&Xt.kind!=="delta-src-inferred"?`Lighter-${pe+1}`:null).filter(Boolean),[pt]);m.useMemo(()=>pt.filter(Xt=>!Xt.used).length,[pt]);async function Zt(){if(!re){n(!0);return}if(nt)try{xn(!0),kn("");const Xt=window.localStorage.getItem("hyperToken"),pe=window.localStorage.getItem("hyperAddress");if(!Xt||!pe){n(!0);return}const st={coin:it,orderPerHour:Number(kt),leverage:Number(jt),direction:cn,orderType:Ke,tp:Number(en),sl:Number(At),cycleSeconds:tr==="Hour"?3600:86400},Ft={address:pe.toLowerCase(),token:Xt,api_pkey:V,api_index:Number(Ae),login_wallet:be,slot_number:Number(ct==null?void 0:ct.replace("Lighter-","")),farming_params:st},pn=await(await fetch(`${xe}/api/hyper/lighter_farming/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ft)})).json();pn!=null&&pn.success?(ie(!0),wt(),Hn&&et()):kn((pn==null?void 0:pn.error_message)||"Start failed.")}catch(Xt){kn(Xt.message||"An error occurred while saving.")}finally{xn(!1)}}async function vt(){var pe;const Xt=yn(ct)-1;if(Xt<0){kn("Please select a slot."),xn(!1);return}if((pe=pt[Xt])!=null&&pe.used){kn("Selected slot is already in use."),xn(!1);return}if(!re){n(!0);return}if(ot)try{xn(!0),kn("");const st=window.localStorage.getItem("hyperToken"),Ft=window.localStorage.getItem("hyperAddress");if(!st||!Ft){n(!0);return}const yt={api_pkey:V,api_index:Ae,login_wallet:be,coin:it,orderPerHour:Number(kt),leverage:Number(jt)},pn={...Lt==="lighter"&&{api_pkey:ae,api_index:ye,login_wallet:Ie},coin:it==null?void 0:it.replace("USDT",""),orderPerHour:Number(kt),leverage:Number(jt),...Lt==="variational"&&{vr_token:S}},An={address:Ft.toLowerCase(),token:st,slot_number:Number(ct==null?void 0:ct.replace("Lighter-","")),source_app:"lighter",source_params:yt,target_app:Lt==="lighter"?"lighter":"variational_delta",target_params:pn},_r=await(await fetch(`${xe}/api/hyper/farming_app/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(An)})).json();_r!=null&&_r.success?(ie(!0),wt(),Hn&&et()):kn((_r==null?void 0:_r.error_message)||fallback)}catch(st){kn(st.message||"An error occurred while saving.")}finally{xn(!1)}}async function Ot(){if(!re){n(!0);return}try{Mn(!0),kn("");const Xt=window.localStorage.getItem("hyperToken"),pe=window.localStorage.getItem("hyperAddress");if(!Xt||!pe){n(!0);return}const Ft=await(await fetch(`${xe}/api/hyper/lighter_farming/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:pe.toLowerCase(),token:Xt,slot_number:br})})).json();Ft!=null&&Ft.success?(ie(!1),wt()):kn((Ft==null?void 0:Ft.error_message)||"Stop failed.")}catch(Xt){kn(Xt.message||"An error occurred while stopping.")}finally{Mn(!1)}}async function wn(){if(!re){n(!0);return}try{Mn(!0),kn("");const Xt=window.localStorage.getItem("hyperToken"),pe=window.localStorage.getItem("hyperAddress");if(!Xt||!pe){n(!0);return}const Ft=await(await fetch(`${xe}/api/hyper/farming_app/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:pe.toLowerCase(),token:Xt,source_app:"lighter",target_app:Lt==="lighter"?"lighter":"variational_delta",slot_number:br})})).json();Ft!=null&&Ft.success?(ie(!1),wt()):kn((Ft==null?void 0:Ft.error_message)||"Stop failed.")}catch(Xt){kn(Xt.message||"An error occurred while stopping.")}finally{Mn(!1)}}const Gn=Xt=>{Fn(Xt??"lighter"),p(!1)},fr=[{value:"lighter",label:"Lighter"},{value:"variational",label:"Variational"}];function ur(Xt){try{const pe=Xt.split(".");if(pe.length!==3)throw new Error("Invalid JWT format");const Ft=pe[1].replace(/-/g,"+").replace(/_/g,"/"),yt=decodeURIComponent(atob(Ft).split("").map(pn=>"%"+("00"+pn.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(yt)}catch{return null}}const $t={control:(Xt,pe)=>({...Xt,backgroundColor:"#242424",borderColor:pe.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center",minWidth:"max-content"}),valueContainer:Xt=>({...Xt,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:Xt=>({...Xt,height:32}),input:Xt=>({...Xt,color:"#FFFFFF",margin:0,padding:0}),singleValue:Xt=>({...Xt,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:Xt=>({...Xt,color:"#7F7F7F",fontSize:"12px"}),menu:Xt=>({...Xt,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:Xt=>({...Xt,paddingTop:0,paddingBottom:0,maxHeight:200}),option:(Xt,pe)=>({...Xt,backgroundColor:pe.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:Xt=>({...Xt,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:Xt=>({...Xt,backgroundColor:"#353535"})},nn=({max:Xt})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[Xt,"x"]}),Vn=Xt=>{var pe,st,Ft;return i.jsx($a.Option,{...Xt,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(pe=Xt.data)!=null&&pe.icon?i.jsx("img",{src:Xt.data.icon,alt:Xt.data.label,className:`${((st=Xt.data)==null?void 0:st.label)==="XRP"||((Ft=Xt.data)==null?void 0:Ft.label)==="MEGA"?"bg-[#4F4F4F] rounded-full":""} w-4 h-4 rounded-[4px]`,onError:yt=>yt.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:Xt.data.label}),i.jsx(nn,{max:Xt.data.maxLeverage})]})})},lr=Xt=>{var pe,st,Ft;return i.jsx($a.SingleValue,{...Xt,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(pe=Xt.data)!=null&&pe.icon?i.jsx("img",{src:Xt.data.icon,alt:Xt.data.label,className:`${((st=Xt.data)==null?void 0:st.label)==="XRP"||((Ft=Xt.data)==null?void 0:Ft.label)==="MEGA"?"bg-[#4F4F4F] rounded-full":""} w-4 h-4 rounded-[4px]`,onError:yt=>yt.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:Xt.data.label}),i.jsx(nn,{max:Xt.data.maxLeverage})]})})},er=Xt=>{const pe=Wt.includes(Xt.data.value);return i.jsx($a.Option,{...Xt,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[i.jsx("span",{className:"text-white text-[13px]",children:Xt.data.label}),pe&&i.jsx("span",{className:"ml-auto w-2 h-2 rounded-full bg-[#67FFBD]",title:"Active"})]})})},gr=Xt=>i.jsx($a.SingleValue,{...Xt,children:i.jsx("div",{className:"flex items-center gap-2 px-3",children:i.jsx("span",{className:"text-white text-[13px]",children:Xt.data.label})})}),dr=async()=>{var st,Ft,yt,pn,An,or,_r,wr;const Xt=window.localStorage.getItem("hyperToken"),pe=window.localStorage.getItem("hyperAddress");if(!(!Xt||!pe))try{lt(!0);const pr=await Si(pe.toLowerCase(),Xt);pr!=null&&pr.success?(r(pr==null?void 0:pr.telegram_chat_id),s(pr==null?void 0:pr.subscriber_role),a(pr==null?void 0:pr.subs_expire_day),o((st=pr==null?void 0:pr.mushboomer_counts)==null?void 0:st.eth),l((Ft=pr==null?void 0:pr.mushboomer_counts)==null?void 0:Ft.sol),c(pr==null?void 0:pr.referral_code),u(pr==null?void 0:pr.refcode),d(pr==null?void 0:pr.whitelist),f(Xt),x(pe),Pn(!0),v((pn=(yt=pr==null?void 0:pr.slots_info)==null?void 0:yt.lighter)==null?void 0:pn.total_qty),I((or=(An=pr==null?void 0:pr.slots_info)==null?void 0:An.lighter)==null?void 0:or.total_qty),C((wr=(_r=pr==null?void 0:pr.slots_info)==null?void 0:_r.lighter)==null?void 0:wr.active_qty),lt(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),lt(!1))}catch(pr){console.error("Token verification error:",pr),console.error(pr.message||"An unknown error occurred."),lt(!1)}},Fs=at,us=m.useMemo(()=>Array.from({length:g},(Xt,pe)=>({value:`Lighter-${pe+1}`,label:`Lighter-${pe+1}`})),[g]);if(!e)return null;const xr=xt||It||dn||qe,vr=Y&&!dn,rs=Ye(it),Zr=P===F;return i.jsxs(i.Fragment,{children:[i.jsx(fd,{open:Et,setOpen:Kn,transactionHash:Cn,transactionLoading:sn,paymentPresaleRole:an,errorFunds:vn,activeMethod:2}),i.jsx(d5,{open:qn,setOpen:nr,paymentLighterRole:an,oldSlotCount:X,checkAccountLighter:dr,tradeMarket:"lighter"}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!xr&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#F8D4AB] max-h-[97dvh] overflow-y-auto",children:[i.jsxs("div",{className:"pb-2 px-5 pt-3 border-b border-[#353535] rounded-t-3xl relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx(Hf,{className:"w-6 h-6 text-[#fff]"}),i.jsx("span",{className:"text-[24px] font-semibold text-[#fff]",children:"Lighter"}),i.jsx("span",{className:"text-[24px] font-semibold text-[#e87859] mt-[1px]",children:"farming"})]}),i.jsxs("div",{className:"flex justify-between items-center gap-4",children:[i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2",children:"Lighter Farming module lets you set up automated farming by providing your API Key, selecting a pair, defining orders per hour, leverage, direction, and TP/SL/Spread percentages."}),i.jsxs("div",{className:"flex flex-col items- justify-start gap-1 relative",children:[i.jsx("div",{className:"absolute -top-12 right-0 text-xs font-semibold text-[#7C7C7C] mt-2",children:i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/farm/lighter-farming-module","_blank"),className:"h-6 sm:h-7 w-max py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer border border-[#353535] px-4 bg-[#242424] hover:bg-[#2e2e2e]",children:[i.jsx("img",{src:s5,className:"w-[14px] h-[14px]"}),i.jsx("div",{className:"min-w-max text-white text-xs font-medium font-manrope leading-none pointer-events-none",children:"Docs"})]})}),i.jsxs("div",{onClick:()=>window.open("https://youtu.be/_TxVAzKU5LE","_blank"),className:"h-6 sm:h-7 w-[130px] py-2 bg-[#FF0000] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#ff4d4d] inline-flex justify-center items-center gap-1 cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsx(Wk,{})}),i.jsx("div",{className:"text-white text-[13px] font-medium leading-[8px]",children:"YouTube"})]})]})]})]}),i.jsxs("div",{className:"pb-2 space-y-3 pt-2 px-5",children:[_n&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:_n==="Get more slots to run Delta Neutral with Variational"?i.jsxs(i.Fragment,{children:[i.jsx("span",{children:_n}),i.jsx("button",{onClick:()=>{window.open("#variational-farming","_self")},className:"bg-[#67FFBD]/10 text-[#67FFBD] border border-[#67FFBD]/30 hover:bg-[#67FFBD]/20 text-[11px] px-2 py-[3px] rounded-md transition-colors ml-4",children:"Variational Farming"})]}):i.jsx("span",{children:_n})}),re&&an&&N===w&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:`No free Lighter slots. All ${(us==null?void 0:us.length)||N} in use.`}),re&&Zr&&Lt==="variational"&&!Y&&oe==="ON"&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:i.jsxs(i.Fragment,{children:[i.jsx("span",{children:'"No Variational slots available. Purchase Variational slot."'}),i.jsx("button",{onClick:()=>{window.open("#variational-farming","_self"),t(!1)},className:"bg-[#67FFBD]/10 text-[#67FFBD] border border-[#67FFBD]/30 hover:bg-[#67FFBD]/20 text-[11px] px-2 py-[3px] rounded-md transition-colors ml-4",children:"Variational Farming"})]})}),J&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:"You cannot use this area because the delta socket is active in another slot."}),re&&an&&i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 px-4 sm:px-5",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-[13px] text-[#7C7C7C] font-semibold",children:[i.jsx("span",{className:"pl-[2px]",children:"Slot"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(iA,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[w||0,"/",us.length]})]})]}),i.jsx(Zl,{styles:$t,components:{Option:er,SingleValue:gr},options:us,value:us.find(Xt=>Xt.value===ct)||null,onChange:Xt=>Ut((Xt==null?void 0:Xt.value)??""),placeholder:"Select",isSearchable:!0})]})}),i.jsxs("div",{className:"py-1 space-y-3 px-3 sm:px-5",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[oe==="ON"?i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:[i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 1"}),i.jsx("span",{className:"rounded-md w-max text-white font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px] bg-[#353535] px-2 h-6 flex items-center",children:"Lighter"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"1st Lighter Wallet Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:be,onChange:Xt=>je(Xt.target.value),autoComplete:"off",placeholder:"1st Lighter Wallet Address ",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${be===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:xr||vr})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/lighter-farming-module",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:V,onChange:Xt=>ee(Xt.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:Jn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${V===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:xr||vr}),i.jsx("button",{type:"button",onClick:()=>Nn(Xt=>!Xt),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:xr||vr,children:Jn?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Ae,onChange:Xt=>{const pe=Xt.target.value.trim();if(pe==="")return ce("");se(pe)&&ce(pe)},onKeyDown:Fe,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ae===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:xr||vr})})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Lighter Wallet Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:be,onChange:Xt=>je(Xt.target.value),autoComplete:"off",placeholder:"Lighter Wallet Address ",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${be===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:xr||vr})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/lighter-farming-module",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:V,onChange:Xt=>ee(Xt.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:Jn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${V===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:xr||vr}),i.jsx("button",{type:"button",onClick:()=>Nn(Xt=>!Xt),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:xr||vr,children:Jn?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]})]}),oe==="ON"&&i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:[i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 2"}),i.jsx("div",{children:i.jsxs("div",{ref:h,className:"relative w-[120px]",children:[i.jsxs("div",{className:`${xr||vr?"cursor-not-allowed":"cursor-pointer"} rounded-md bg-[#353535] text-white px-2 h-6 flex items-center justify-between`,onClick:Xt=>{Xt.preventDefault(),xr||vr||p(!Ee)},children:[i.jsx("span",{className:"text-white font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px]",children:(jr=fr==null?void 0:fr.find(Xt=>(Xt==null?void 0:Xt.value)===Lt))==null?void 0:jr.label}),i.jsx("svg",{className:`w-4 h-4 ml-2 transform transition ${Ee?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),Ee&&i.jsx("div",{className:"absolute z-10 mt-1 w-full bg-[#353535] rounded-md shadow-lg overflow-hidden p-1",children:i.jsx("div",{className:"flex flex-col gap-[2px] max-h-[170px] overflow-y-auto",children:fr==null?void 0:fr.map((Xt,pe)=>i.jsxs("div",{onClick:st=>{st.preventDefault(),xr||vr||Gn(Xt==null?void 0:Xt.value)},className:`py-2 px-2 h-8 min-h-8 flex justify-between items-center rounded-md font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px] min-w-max gap-1 ${(Xt==null?void 0:Xt.value)===Lt?"bg-[#2c2c2c]":"hover:bg-[#2c2c2c]"} text-white ${xr||vr?"cursor-not-allowed":"cursor-pointer"}`,children:[i.jsx("span",{className:"text-white",children:Xt==null?void 0:Xt.label}),(Xt==null?void 0:Xt.value)===Lt&&i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-[#1de674]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})]},pe))})})]})})]}),Lt==="lighter"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"2nd Lighter Wallet Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Ie,onChange:Xt=>Re(Xt.target.value),autoComplete:"off",placeholder:"2nd Lighter Wallet Address",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ie===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:xr||vr})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key 2"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/lighter-farming-module",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:ae,onChange:Xt=>fe(Xt.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY_2",type:ln?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ae===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:xr||vr}),i.jsx("button",{type:"button",onClick:()=>Oe(Xt=>!Xt),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:xr||vr,children:ln?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index 2"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ye,onChange:Xt=>{const pe=Xt.target.value.trim();if(pe==="")return Ne("");se(pe)&&Ne(pe)},onKeyDown:Fe,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX_2",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ye===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:xr||vr})})]})]}),Lt==="variational"&&i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Variational Token"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/variational-omni-farming-module#getting-your-variational-token",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get Variational Token?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:S,onChange:Xt=>{const pe=Xt.target.value;if(_(pe),!pe.trim()){T(null),q("");return}const st=ur(pe);if(st&&(st!=null&&st.exp)){const Ft=new Date((st==null?void 0:st.exp)*1e3);T(Ft),q("")}else st?(T(null),q("The token's expiration date could not be found.")):(T(null),q("Invalid token format."))},type:te?"text":"password",autoComplete:"off",placeholder:"Variational_Token",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${S===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:xr||vr}),k&&i.jsxs("div",{className:"text-[12px] mt-1 pl-[3px] flex justify-start items-center gap-2",children:[i.jsx("span",{className:"text-[10px] text-[#CECECE] font-medium",children:"Valid Until:"})," ",i.jsx("span",{className:"text-[11px] font-semibold "+(de?"text-[#FF797C]":"text-[#F8D4AB]"),children:k==null?void 0:k.toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}),de&&i.jsx("span",{children:i.jsx("img",{src:vc,alt:"",className:"w-3.5 h-3.5"})})]}),B&&i.jsx("div",{className:"text-[10px] text-[#FF797C] mt-[2px] pl-[3px]",children:B}),i.jsx("button",{type:"button",onClick:()=>ue(Xt=>!Xt),className:"absolute right-1 top-4 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:xr||vr,children:te?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Ae,onChange:Xt=>{const pe=Xt.target.value.trim();if(pe==="")return ce("");se(pe)&&ce(pe)},onKeyDown:Fe,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ae===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:xr||vr})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Zl,{styles:$t,components:{Option:Vn,SingleValue:lr},isDisabled:xr||vr,options:Fs,value:Fs.find(Xt=>Xt.value===it)||null,onChange:Xt=>tt((Xt==null?void 0:Xt.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:`${oe==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per Hour"}),i.jsx("input",{value:kt,onChange:Xt=>{const pe=Xt.target.value.trim();if(pe==="")return tn("");se(pe)&&tn(pe)},onKeyDown:Fe,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${kt===""?"border-[#353535]":Ce?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:xr||vr}),kt!==""&&!Ce&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-1`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per"}),i.jsxs("select",{value:tr,onChange:Xt=>Qt(Xt.target.value),className:`${xr||vr?"cursor-not-allowed":"cursor-pointer"} h-6 text-[12px] bg-[#242424] border border-[#353535] rounded-md px-2 text-white outline-none font-bold font-manrope`,disabled:xr||vr,children:[i.jsx("option",{value:"Hour",children:"Hour"}),i.jsx("option",{value:"Day",children:"Day"})]})]}),i.jsx("input",{value:kt,onChange:Xt=>{const pe=Xt.target.value.trim();if(pe==="")return tn("");se(pe)&&tn(pe)},onKeyDown:Fe,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${kt===""?"border-[#353535]":Ce?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:xr||vr}),kt!==""&&!Ce&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]}),i.jsxs("div",{className:`${oe==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral (Requires 2 slots to work)"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:oe==="ON"?"On":"Off"}),i.jsx(Oo,{checked:oe==="ON",onChange:Xt=>G(Xt?"ON":"OFF"),disabled:xr||vr,className:`${oe==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${xr||vr?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out  ${oe==="ON"?"translate-x-3":"translate-x-0"}`})})]})]}),i.jsxs("div",{className:" space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Leverage"}),i.jsx("input",{value:jt,onChange:Xt=>{const pe=Xt.target.value.trim();if(pe==="")return un("");se(pe)&&un(pe)},onKeyDown:Fe,inputMode:"numeric",autoComplete:"off",placeholder:it?`1–${rs}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${jt===""?"border-[#353535]":De?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:xr||vr})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-2 md:pr-6",children:[i.jsx("div",{"aria-pressed":cn==="LONG",onClick:()=>!vr&&Pt("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",xr||vr?"cursor-not-allowed":"cursor-pointer",cn==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["LONG",jt?` - ${jt}x`:""]})}),i.jsx("div",{"aria-pressed":cn==="SHORT",onClick:()=>!vr&&Pt("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",xr||vr?"cursor-not-allowed":"cursor-pointer",cn==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["SHORT",jt?` - ${jt}x`:""]})}),i.jsx("div",{"aria-pressed":cn==="RANDOM",onClick:()=>!vr&&Pt("RANDOM"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",xr||vr?"cursor-not-allowed":"cursor-pointer",cn==="RANDOM"?"bg-[#3b82f6] text-[#ffffff] border-[#93c5fd] shadow-[0_0_0_3px_rgba(59,130,246,0.3)]":"text-[#3b82f6] bg-[rgba(59,130,246,0.15)] border-[rgba(59,130,246,0.15)] hover:bg-[#2563eb] hover:text-white"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["RANDOM",jt?` - ${jt}x`:""]})})]})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"flex items-center gap-2 text-[13px] text-[#7C7C7C] font-semibold",children:i.jsx("span",{children:"Order Type"})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{"aria-pressed":Ke==="MARKET",onClick:()=>!vr&&ft("MARKET"),className:["inline-flex justify-center items-center gap-1.5 h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",xr||vr?"cursor-not-allowed":"cursor-pointer",Ke==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["MARKET ",Ke==="MARKET"?" ✓":""]})}),i.jsx("button",{"aria-pressed":Ke==="LIMIT",onClick:()=>!vr&&ft("LIMIT"),className:["inline-flex justify-center items-center gap-1.5 h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",xr||vr?"cursor-not-allowed":"cursor-pointer",Ke==="LIMIT"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["LIMIT ",Ke==="LIMIT"?" ✓":""]})}),i.jsx("button",{"aria-pressed":Ke==="RANDOM",onClick:()=>!vr&&ft("RANDOM"),className:["inline-flex justify-center items-center gap-1.5 h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",xr||vr?"cursor-not-allowed":"cursor-pointer",Ke==="RANDOM"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["RANDOM ",Ke==="RANDOM"?" ✓":""]})})]})]})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Take Profit %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:en,onChange:Xt=>{const pe=Xt.target.value.trim();if(pe==="")return Dt("");rt(pe)&&Dt(pe)},onKeyDown:Fe,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${en===""?"border-[#353535]":Le?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:xr||vr})]}),en!==""&&!Le&&i.jsx("div",{className:"text-[#FF797C] text-[11px]",children:"Value must be 0, or between 1 and 10000000. Numbers between 0 and 1 are not allowed."})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stop Loss %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:At,onChange:Xt=>{const pe=Xt.target.value.trim();if(pe==="")return Je("");rt(pe)&&Je(pe)},onKeyDown:Fe,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${At===""?"border-[#353535]":_e?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:xr||vr})]}),At!==""&&!_e&&i.jsxs("div",{className:"text-[#FF797C] text-[11px]",children:["Value must be 0, or between 1 and"," ",jt?Math.max(jt*100-1,0):4999,". Numbers between 0 and 1 are not allowed."]})]})]}),i.jsx("div",{className:`${oe==="ON"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:oe==="ON"?"On":"Off"}),i.jsx(Oo,{checked:oe==="ON",onChange:Xt=>G(Xt?"ON":"OFF"),disabled:xr||vr,className:`${oe==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${xr||vr?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out  ${oe==="ON"?"translate-x-3":"translate-x-0"}`})})]})]})}),!1]}),i.jsx("div",{className:"py-3 flex items-center gap-3 px-5 border-t border-[#353535] bg-[rgba(27,27,27,0.32)] rounded-b-3xl",children:i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!xr&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] hover:border-white disabled:opacity-60",disabled:xr,children:"Cancel"}),re?oe==="ON"?Y?i.jsx("button",{onClick:wn,disabled:xr,className:`${J?"hidden":""} inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60`,children:dn?"Stopping...":"Stop"}):i.jsx("button",{onClick:vt,disabled:!ot||xr||Lt==="variational"&&Zr&&oe==="ON",className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!ot||xr||Lt==="variational"&&Zr&&oe==="ON"?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"} ${J?"hidden":""}`,children:It?"Starting...":"Start"}):Y?i.jsx("button",{onClick:Ot,disabled:xr,className:`${J?"hidden":""} inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60`,children:dn?"Stopping...":"Stop"}):i.jsx("button",{onClick:Zt,disabled:!nt||xr,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!nt||xr?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"} ${J?"hidden":""}`,children:It?"Starting...":"Start"}):i.jsx("button",{onClick:()=>n(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})}),xt&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})},Hoe=({open:e=!1,setOpen:t=()=>{}})=>{const{setSignModalOpen:n,setTelegramChatId:r,setSubscriberRole:s,setSubsExpireDay:a,setMushboomerETH:o,setMushboomerSOL:l,setIsReferralCode:c,setIsReferralCodeName:u,setIsWhitelist:d,setHyperToken:f,setHyperAddress:x}=m.useContext(Gr);Yr();const[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,I]=m.useState(""),[P,R]=m.useState(""),[F,U]=m.useState(""),[L,z]=m.useState(""),[X,ne]=m.useState(""),[J,Z]=m.useState(""),[re,he]=m.useState(""),[Y,ie]=m.useState("LONG"),[oe,G]=m.useState(!1),[V,ee]=m.useState(!1),[ae,fe]=m.useState(!1),[Ae,ce]=m.useState(!1),[ye,Ne]=m.useState(""),[be,je]=m.useState(""),[Ie,Re]=m.useState(!0),[Qe,Be]=m.useState(!1),[it,tt]=m.useState(!1),[at,dt]=m.useState(!1),[ct,Ut]=m.useState(!1),[kt,tn]=m.useState(!1),[jt,un]=m.useState(!1),[cn,Pt]=m.useState(""),[Xe,Vt]=m.useState(!0);m.useState(1);const Yt="https://dextrabothypev2.nftinit.io",Ve=m.useMemo(()=>[{value:"BTC-USDT",label:"BTCUSDT",icon:"https://app.hyperliquid.xyz/coins/BTC.svg",maxLeverage:100},{value:"ETH-USDT",label:"ETHUSDT",icon:"https://app.hyperliquid.xyz/coins/ETH.svg",maxLeverage:100},{value:"APEX-USDT",label:"APEXUSDT",icon:"https://app.hyperliquid.xyz/coins/APEX.svg",maxLeverage:50},{value:"ASTER-USDT",label:"ASTERUSDT",icon:"https://static.astherus.finance/image/admin_mgs_image_upload/20250916/6dba1412-ddfb-4314-bfdf-87fa11f2daa6.png",maxLeverage:50},{value:"SOL-USDT",label:"SOLUSDT",icon:"https://app.hyperliquid.xyz/coins/SOL.svg",maxLeverage:50},{value:"HYPE-USDT",label:"HYPEUSDT",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg",maxLeverage:50}],[]),Ke=Nn=>{var ln;return((ln=Ve.find(Oe=>Oe.value===Nn))==null?void 0:ln.maxLeverage)??100},ft=Nn=>{["e","E","+","-"].includes(Nn.key)&&Nn.preventDefault()},en=Nn=>/^\d*$/.test(Nn),Dt=m.useMemo(()=>{if(J==="")return!1;const Nn=Number(J);return Number.isInteger(Nn)&&Nn>=1&&Nn<=100},[J]),At=m.useMemo(()=>{if(re==="")return!1;const Nn=Number(re),ln=Ke(X);return Number.isInteger(Nn)&&Nn>=1&&Nn<=ln},[re,X]),Je=g&&N.trim()!==""&&F.trim()!==""&&P.trim()!==""&&L.trim()!==""&&X!==""&&Dt&&At&&(Y==="LONG"||Y==="SHORT"||Y==="RANDOM"),He=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),Rt=()=>`apexCreds:${He()}`,qe=()=>{try{const Nn=localStorage.getItem(Rt());if(!Nn)return;const ln=JSON.parse(Nn);ln.apiKey&&I(ln.apiKey),ln.apiKeySecret&&R(ln.apiKeySecret),ln.omniKeySeed&&z(ln.omniKeySeed),ln.apiKeyPass&&U(ln.apiKeyPass),typeof ln.remember=="boolean"&&Re(ln.remember)}catch{}},lt=()=>{if(Ie)try{localStorage.setItem(Rt(),JSON.stringify({apiKey:N,apiKeyPass:F,apiKeySecret:P,omniKeySeed:L,remember:!0}))}catch{}},xt=()=>{try{localStorage.removeItem(Rt())}catch{}};m.useEffect(()=>{if(!e)return;const Nn=localStorage.getItem("hyperToken"),ln=localStorage.getItem("hyperAddress");v(!!(Nn&&ln));const Oe=setInterval(()=>{const sn=localStorage.getItem("hyperToken"),fn=localStorage.getItem("hyperAddress");v(!!(sn&&fn))},800);return()=>clearInterval(Oe)},[e]),m.useEffect(()=>{!e||!g||(Nt(),vn())},[e,g]),m.useEffect(()=>{if(!X)return;const Nn=Ke(X),ln=Number(re);!Number.isNaN(ln)&&ln>Nn&&he(String(Nn)),!Number.isNaN(ln)&&ln<1&&re!==""&&he("1")},[X]),m.useEffect(()=>{e&&(Ie&&lt(),Ie||xt())},[N,F,P,L,Ie,e]);async function Nt(){var Nn,ln,Oe,sn,fn;try{ee(!0),Ne("");const Et=window.localStorage.getItem("hyperToken"),Kn=window.localStorage.getItem("hyperAddress");if(!Et||!Kn){C(!1),qe();return}const Bt=await(await fetch(`${Yt}/api/hyper/apex_farming/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Kn.toLowerCase(),token:Et})})).json(),an=(Nn=Bt==null?void 0:Bt.data)==null?void 0:Nn.farming_params;if(Bt!=null&&Bt.success&&an){C(!0);const Pn=((ln=Bt==null?void 0:Bt.data)==null?void 0:ln.apex_api_pkey)??"",qn=((Oe=Bt==null?void 0:Bt.data)==null?void 0:Oe.apex_api_pass)??"",nr=((sn=Bt==null?void 0:Bt.data)==null?void 0:sn.apex_api_secret)??"",tr=((fn=Bt==null?void 0:Bt.data)==null?void 0:fn.apex_key_seed)??"";Pn&&I(String(Pn)),qn&&U(String(qn)),nr&&R(String(nr)),tr&&z(String(tr)),an!=null&&an.symbol&&ne(String(an.symbol)),(an==null?void 0:an.orderPerHour)!=null&&Z(String(an.orderPerHour)),(an==null?void 0:an.leverage)!=null&&he(String(an.leverage)),an!=null&&an.direction&&ie(String(an.direction).toUpperCase()==="SHORT"?"SHORT":String(an.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG")}else C(!1);!N&&!F&&!P&&!L&&qe()}catch{C(!1),qe()}finally{ee(!1)}}async function It(){if(!g){n(!0);return}if(Je)try{fe(!0),Ne("");const Nn=window.localStorage.getItem("hyperToken"),ln=window.localStorage.getItem("hyperAddress");if(!Nn||!ln){n(!0);return}const Oe={symbol:X,orderPerHour:Number(J),leverage:Number(re),direction:Y},sn={address:ln.toLowerCase(),token:Nn,apex_api_pkey:N,apex_api_secret:P,apex_api_pass:F,apex_key_seed:L,farming_params:Oe},Et=await(await fetch(`${Yt}/api/hyper/apex_farming/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(sn)})).json();Et!=null&&Et.success?(C(!0),Ie&&lt()):Ne((Et==null?void 0:Et.error_message)||"Start failed.")}catch(Nn){Ne(Nn.message||"An error occurred while saving.")}finally{fe(!1)}}async function xn(){if(!g){n(!0);return}try{ce(!0),Ne("");const Nn=window.localStorage.getItem("hyperToken"),ln=window.localStorage.getItem("hyperAddress");if(!Nn||!ln){n(!0);return}const sn=await(await fetch(`${Yt}/api/hyper/apex_farming/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:ln.toLowerCase(),token:Nn})})).json();sn!=null&&sn.success?C(!1):Ne((sn==null?void 0:sn.error_message)||"Stop failed.")}catch(Nn){Ne(Nn.message||"An error occurred while stopping.")}finally{ce(!1)}}const dn={control:(Nn,ln)=>({...Nn,backgroundColor:"#242424",borderColor:ln.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:Nn=>({...Nn,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:Nn=>({...Nn,height:32}),input:Nn=>({...Nn,color:"#FFFFFF",margin:0,padding:0}),singleValue:Nn=>({...Nn,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:Nn=>({...Nn,color:"#7F7F7F",fontSize:"12px"}),menu:Nn=>({...Nn,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:Nn=>({...Nn,paddingTop:0,paddingBottom:0}),option:(Nn,ln)=>({...Nn,backgroundColor:ln.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:Nn=>({...Nn,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:Nn=>({...Nn,backgroundColor:"#353535"})},Mn=({max:Nn})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[Nn,"x"]}),_n=Nn=>{var ln;return i.jsx($a.Option,{...Nn,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[((ln=Nn.data)==null?void 0:ln.icon)&&i.jsx("img",{src:Nn.data.icon,alt:Nn.data.label,className:"w-4 h-4 rounded-[4px]",onError:Oe=>Oe.currentTarget.style.display="none"}),i.jsx("span",{className:"text-white text-[13px]",children:Nn.data.label}),i.jsx(Mn,{max:Nn.data.maxLeverage})]})})},kn=Nn=>{var ln;return i.jsx($a.SingleValue,{...Nn,children:i.jsxs("div",{className:"flex items-center gap-2",children:[((ln=Nn.data)==null?void 0:ln.icon)&&i.jsx("img",{src:Nn.data.icon,alt:Nn.data.label,className:"w-4 h-4 rounded-[4px]",onError:Oe=>Oe.currentTarget.style.display="none"}),i.jsx("span",{className:"text-white text-[13px]",children:Nn.data.label}),i.jsx(Mn,{max:Nn.data.maxLeverage})]})})},vn=async()=>{var Oe,sn;const Nn=window.localStorage.getItem("hyperToken"),ln=window.localStorage.getItem("hyperAddress");if(!(!Nn||!ln))try{G(!0);const fn=await Si(ln.toLowerCase(),Nn);fn!=null&&fn.success?(r(fn==null?void 0:fn.telegram_chat_id),s(fn==null?void 0:fn.subscriber_role),a(fn==null?void 0:fn.subs_expire_day),o((Oe=fn==null?void 0:fn.mushboomer_counts)==null?void 0:Oe.eth),l((sn=fn==null?void 0:fn.mushboomer_counts)==null?void 0:sn.sol),c(fn==null?void 0:fn.referral_code),u(fn==null?void 0:fn.refcode),d(fn==null?void 0:fn.whitelist),f(Nn),x(ln),Vt(!0),G(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),G(!1))}catch(fn){console.error("Token verification error:",fn),console.error(fn.message||"An unknown error occurred."),G(!1)}},Qn=Ve;if(!e)return null;const Hn=V||ae||Ae||oe,$n=w&&!Ae,Jn=Ke(X);return i.jsxs(i.Fragment,{children:[i.jsx(fd,{open:jt,setOpen:un,transactionHash:cn,transactionLoading:kt,paymentPresaleRole:Xe,errorFunds:be,activeMethod:2}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!Hn&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#F8D4AB] max-h-[97dvh] overflow-y-auto",children:[i.jsxs("div",{className:"pb-2 px-5 pt-5 border-b border-[#353535] rounded-t-3xl relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("img",{src:"https://omni.apex.exchange/assets/logo_content-CY9uyFbz.svg",alt:""}),i.jsx("span",{className:"text-[24px] font-semibold text-[#e87859] -mt-1",children:"farming"})]}),i.jsxs("div",{className:"flex justify-between items-center gap-4",children:[i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2",children:"Apex Farming module lets you set up automated farming by providing your API Key, API Key Passphrase, API Key Secret, Omni Key Seed, selecting a pair, defining orders per hour, leverage and direction."}),i.jsx("div",{className:"flex flex-col items- justify-start gap-1 relative",children:i.jsxs("div",{onClick:()=>window.open("https://youtu.be/VczH7nAH0Gc","_blank"),className:"h-6 sm:h-7 w-[130px] py-2 bg-[#FF0000] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#ff4d4d] inline-flex justify-center items-center gap-1 cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsx(Wk,{})}),i.jsx("div",{className:"text-white text-[13px] font-medium leading-[8px]",children:"YouTube"})]})})]})]}),i.jsxs("div",{className:"space-y-2 pt-2 pb-2 px-5",children:[ye&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:ye}),i.jsxs("div",{className:"space-y-3 px-3 sm:px-5 py-2",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key"}),i.jsx("a",{href:"https://omni.apex.exchange/keyManagement",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:N,onChange:Nn=>I(Nn.target.value),autoComplete:"off",placeholder:"API_KEY",type:Qe?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${N===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Hn||$n}),i.jsx("button",{type:"button",onClick:()=>Be(Nn=>!Nn),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Hn||$n,children:Qe?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Passphrase"})}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:F,onChange:Nn=>U(Nn.target.value),autoComplete:"off",placeholder:"API_KEY_PAASSPHRASE",type:at?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${F===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Hn||$n}),i.jsx("button",{type:"button",onClick:()=>dt(Nn=>!Nn),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Hn||$n,children:at?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Secret"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:P,onChange:Nn=>R(Nn.target.value),autoComplete:"off",placeholder:"API_KEY_SECRET",type:it?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${P===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Hn||$n}),i.jsx("button",{type:"button",onClick:()=>tt(Nn=>!Nn),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Hn||$n,children:it?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Omni Key Seed"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:L,onChange:Nn=>z(Nn.target.value),autoComplete:"off",placeholder:"OMNI_KEY_SEED",type:ct?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${L===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Hn||$n}),i.jsx("button",{type:"button",onClick:()=>Ut(Nn=>!Nn),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Hn||$n,children:ct?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Zl,{styles:dn,components:{Option:_n,SingleValue:kn},isDisabled:Hn||$n,options:Qn,value:Qn.find(Nn=>Nn.value===X)||null,onChange:Nn=>ne((Nn==null?void 0:Nn.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per Hour"}),i.jsx("input",{value:J,onChange:Nn=>{const ln=Nn.target.value.trim();if(ln==="")return Z("");en(ln)&&Z(ln)},onKeyDown:ft,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 100)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${J===""?"border-[#353535]":Dt?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Hn||$n}),J!==""&&!Dt&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 100."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:" space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Leverage"}),i.jsx("input",{value:re,onChange:Nn=>{const ln=Nn.target.value.trim();if(ln==="")return he("");en(ln)&&he(ln)},onKeyDown:ft,inputMode:"numeric",autoComplete:"off",placeholder:X?`1–${Jn}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${re===""?"border-[#353535]":At?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Hn||$n})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{"aria-pressed":Y==="LONG",onClick:()=>!$n&&ie("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-8 rounded-[10px] uppercase tracking-wide font-semibold transition-all border w-1/2",re?"text-[10px] px-1.5":"text-[11px] px-2",Hn||$n?"opacity-60 cursor-not-allowed":"cursor-pointer",Y==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["LONG",re?` - ${re}x`:""]})}),i.jsx("div",{"aria-pressed":Y==="SHORT",onClick:()=>!$n&&ie("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-8 rounded-[10px] uppercase tracking-wide font-semibold transition-all border w-1/2",re?"text-[10px] px-1.5":"text-[11px] px-2",Hn||$n?"opacity-60 cursor-not-allowed":"cursor-pointer",Y==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["SHORT",re?` - ${re}x`:""]})}),i.jsx("div",{"aria-pressed":Y==="RANDOM",onClick:()=>!$n&&ie("RANDOM"),className:["inline-flex justify-center items-center gap-1.5 h-8 rounded-[10px] uppercase tracking-wide font-semibold transition-all border w-1/2",re?"text-[10px] px-1.5":"text-[11px] px-2",Hn||$n?"opacity-60 cursor-not-allowed":"cursor-pointer",Y==="RANDOM"?"bg-[#3b82f6] text-[#ffffff] border-[#93c5fd] shadow-[0_0_0_3px_rgba(59,130,246,0.3)]":"text-[#3b82f6] bg-[rgba(59,130,246,0.15)] border-[rgba(59,130,246,0.15)] hover:bg-[#2563eb] hover:text-white"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["RANDOM",re?` - ${re}x`:""]})})]})]})]})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-4 px-5 py-2 border-t border-[#353535] bg-[rgba(27,27,27,0.32)] rounded-b-3xl",children:[i.jsxs("div",{onClick:()=>window.open("https://join.omni.apex.exchange/AFF-7530","_blank"),className:"cursor-pointer text-[12px] text-zinc-400 text-start transition-colors duration-300 hover:text-zinc-200 flex-1",children:[i.jsxs("p",{children:["Be part of the"," ",i.jsx("span",{className:"text-white font-semibold",children:"Dextrabot x Apex squad!"})," ","Trade under our referral — unlock bonuses instantly"]}),i.jsx("div",{className:"mt-1 inline-flex items-center gap-1 text-emerald-400 font-medium hover:text-emerald-300 transition-colors duration-300",children:"🔗 Join Now"})]}),i.jsxs("div",{className:"ml-auto flex-1 flex justify-end items-center gap-2",children:[i.jsx("button",{onClick:()=>!Hn&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] hover:border-white disabled:opacity-60",disabled:Hn,children:"Cancel"}),g?w?i.jsx("button",{onClick:xn,disabled:Hn,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:Ae?"Stopping...":"Stop"}):i.jsx("button",{onClick:It,disabled:!Je||Hn,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Je||Hn?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:ae?"Starting...":"Start"}):i.jsx("button",{onClick:()=>n(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})]}),V&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})},Voe=({open:e=!1,setOpen:t=()=>{}})=>{var fr,ur;const{setSignModalOpen:n,setTelegramChatId:r,setSubscriberRole:s,setSubsExpireDay:a,setMushboomerETH:o,setMushboomerSOL:l,setIsReferralCode:c,setIsReferralCodeName:u,setIsWhitelist:d,setHyperToken:f,setHyperAddress:x}=m.useContext(Gr);Yr();const[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,I]=m.useState(1),[P,R]=m.useState(0),[F,U]=m.useState(0),[L,z]=m.useState({}),[X,ne]=m.useState(null),[J,Z]=m.useState(!1),[re,he]=m.useState("variational");m.useState(!1),m.useRef(null);const[Y,ie]=m.useState(!1),[oe,G]=m.useState(!1),[V,ee]=m.useState(0),[ae,fe]=m.useState("OFF"),[Ae,ce]=m.useState(""),[ye,Ne]=m.useState(""),[be,je]=m.useState(""),[Ie,Re]=m.useState(""),[Qe,Be]=m.useState(null),[it,tt]=m.useState(""),[at,dt]=m.useState(""),[ct,Ut]=m.useState(""),[kt,tn]=m.useState("");m.useState("");const[jt,un]=m.useState("");m.useState([]);const[cn,Pt]=m.useState(""),[Xe,Vt]=m.useState(""),[Yt,Ve]=m.useState(""),[Ke,ft]=m.useState("LONG"),[en,Dt]=m.useState("STANDARD"),[At,Je]=m.useState("STANDARD"),[He,Rt]=m.useState("MARKET"),[qe,lt]=m.useState(""),[xt,Nt]=m.useState(""),[It,xn]=m.useState(""),[dn,Mn]=m.useState("Hour"),[_n,kn]=m.useState(!1),[vn,Qn]=m.useState(!1),[Hn,$n]=m.useState(!1),[Jn,Nn]=m.useState(!1),[ln,Oe]=m.useState(""),[sn,fn]=m.useState(""),[Et,Kn]=m.useState(!0),[Cn,Bt]=m.useState(!1),[an,Pn]=m.useState(!1),[qn,nr]=m.useState(!1),[tr,Qt]=m.useState(!1),[zn,Yn]=m.useState(!1),[Lt,Fn]=m.useState(""),[Ee,p]=m.useState(!0),h=Qe?(Qe==null?void 0:Qe.getTime())<=Date.now():!1;m.useState(1);const S="https://dextrabothypev2.nftinit.io",_="",k=m.useMemo(()=>[{value:"BTC",label:"BTC",icon:"https://app.hyperliquid.xyz/coins/BTC.svg",maxLeverage:50},{value:"ETH",label:"ETH",icon:"https://app.hyperliquid.xyz/coins/ETH.svg",maxLeverage:50},{value:"SOL",label:"SOL",icon:"https://app.hyperliquid.xyz/coins/SOL.svg",maxLeverage:50},{value:"HYPE",label:"HYPE",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg",maxLeverage:50},{value:"XAUT",label:"XAUT",icon:"https://coin-images.coingecko.com/coins/images/10481/large/Tether_Gold.png",maxLeverage:50},{value:"BNB",label:"BNB",icon:"https://app.hyperliquid.xyz/coins/BNB.svg",maxLeverage:50},{value:"PUMPFUN",label:"PUMPFUN",icon:"https://coin-images.coingecko.com/coins/images/67164/large/pump.jpg",maxLeverage:50},{value:"KAITO",label:"KAITO",icon:"https://app.hyperliquid.xyz/coins/KAITO.svg",maxLeverage:50},{value:"ZEC",label:"ZEC",icon:"https://app.hyperliquid.xyz/coins/ZEC.svg",maxLeverage:50},{value:"SUI",label:"SUI",icon:"https://app.hyperliquid.xyz/coins/SUI.svg",maxLeverage:50},{value:"VIRTUAL",label:"VIRTUAL",icon:"https://app.hyperliquid.xyz/coins/VIRTUAL.svg",maxLeverage:50},{value:"TAO",label:"TAO",icon:"https://app.hyperliquid.xyz/coins/TAO.svg",maxLeverage:50},{value:"XRP",label:"XRP",icon:"https://app.hyperliquid.xyz/coins/XRP.svg",maxLeverage:50},{value:"TRUMP",label:"TRUMP",icon:"https://app.hyperliquid.xyz/coins/TRUMP.svg",maxLeverage:50},{value:"CRO",label:"CRO",icon:"https://coin-images.coingecko.com/coins/images/7310/large/cro_token_logo.png",maxLeverage:50},{value:"XPL",label:"XPL",icon:"https://app.hyperliquid.xyz/coins/XPL.svg",maxLeverage:50},{value:"IP",label:"IP",icon:"https://app.hyperliquid.xyz/coins/IP.svg",maxLeverage:50},{value:"PAXG",label:"PAXG",icon:"https://app.hyperliquid.xyz/coins/PAXG.svg",maxLeverage:50},{value:"ASTER",label:"ASTER",icon:"https://app.hyperliquid.xyz/coins/ASTER.svg",maxLeverage:50},{value:"DOLO",label:"DOLO",icon:"https://coin-images.coingecko.com/coins/images/54710/large/DOLO-small.png",maxLeverage:50},{value:"RESOLV",label:"RESOLV",icon:"https://app.hyperliquid.xyz/coins/RESOLV.svg",maxLeverage:50},{value:"GRASS",label:"GRASS",icon:"https://app.hyperliquid.xyz/coins/GRASS.svg",maxLeverage:50},{value:"YZY",label:"YZY",icon:"https://app.hyperliquid.xyz/coins/YZY.svg",maxLeverage:50},{value:"PROVE",label:"PROVE",icon:"https://app.hyperliquid.xyz/coins/PROVE.svg",maxLeverage:50},{value:"SYRUP",label:"SYRUP",icon:"https://app.hyperliquid.xyz/coins/SYRUP.svg",maxLeverage:50},{value:"NMR",label:"NMR",icon:"https://coin-images.coingecko.com/coins/images/752/large/numeraire.png",maxLeverage:50},{value:"GMX",label:"GMX",icon:"https://app.hyperliquid.xyz/coins/GMX.svg",maxLeverage:50}],[]),T=$t=>{var nn;return((nn=k.find(Vn=>Vn.value===$t))==null?void 0:nn.maxLeverage)??100},B=$t=>{["e","E","+","-"].includes($t.key)&&$t.preventDefault()},q=$t=>/^\d*\.?\d{0,6}$/.test($t),te=$t=>/^\d*$/.test($t),ue=m.useMemo(()=>{if(Xe==="")return!1;const $t=Number(Xe);return Number.isInteger($t)&&$t>=1&&$t<=120},[Xe]),de=m.useMemo(()=>{if(Yt==="")return!1;const $t=Number(Yt),nn=T(jt);return Number.isInteger($t)&&$t>=1&&$t<=nn},[Yt,jt]),xe=m.useMemo(()=>{if(qe==="")return!1;const $t=Number(qe);return Number.isNaN($t)?!1:$t===0?!0:$t>=1&&$t<=1e7},[qe]),we=m.useMemo(()=>{if(xt==="")return!1;const $t=Number(xt);if(Number.isNaN($t))return!1;const nn=Yt===""?null:Number(Yt),Vn=nn?nn*100-1:4999;return $t===0?!0:$t>0&&$t<1?!1:$t>=1&&$t<=Vn},[xt,Yt]);m.useMemo(()=>{if(It==="")return!1;const $t=Number(It);return!Number.isNaN($t)&&$t>0&&$t<=100},[It]);const ke=g&&Ie.trim()!==""&&jt!==""&&ue&&de&&(!qe||xe)&&(!xt||we)&&!h&&!it&&cn&&(Ke==="LONG"||Ke==="SHORT"||Ke==="RANDOM")&&(He==="LIMIT"||He==="MARKET"||He==="RANDOM")&&Ee,Me=g&&Ie.trim()!==""&&jt!==""&&ue&&cn&&de&&cn&&Ee,Ye=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),Fe=()=>`variationalCreds:${Ye()}`,rt=()=>{try{const $t=localStorage.getItem(Fe());if(!$t)return;const nn=JSON.parse($t);nn.variationalToken&&Re(nn.variationalToken),typeof nn.remember=="boolean"&&Kn(nn.remember)}catch{}},se=()=>{if(Et)try{localStorage.setItem(Fe(),JSON.stringify({variationalToken:Ie,remember:!0}))}catch{}},Ce=()=>{try{localStorage.removeItem(Fe())}catch{}};m.useEffect(()=>{if(!e)return;const $t=localStorage.getItem("hyperToken"),nn=localStorage.getItem("hyperAddress");v(!!($t&&nn));const Vn=setInterval(()=>{const lr=localStorage.getItem("hyperToken"),er=localStorage.getItem("hyperAddress");v(!!(lr&&er))},800);return()=>clearInterval(Vn)},[e]),m.useEffect(()=>{!e||!g||(De(),pt())},[e,g]),m.useEffect(()=>{e&&(xt===""&&Nt(_),qe===""&&lt(_),It===""&&xn(_))},[e]),m.useEffect(()=>{if(!jt)return;const $t=T(jt),nn=Number(Yt);!Number.isNaN(nn)&&nn>$t&&Ve(String($t)),!Number.isNaN(nn)&&nn<1&&Yt!==""&&Ve("1")},[jt]),m.useEffect(()=>{e&&(Et&&se(),Et||Ce())},[Ie,Et,e]);async function De(){var $t,nn,Vn,lr,er,gr,dr,Fs;try{Qn(!0),Oe("");const us=window.localStorage.getItem("hyperToken"),xr=window.localStorage.getItem("hyperAddress");if(!us||!xr){C(!1),rt();return}const rs=await(await fetch(`${S}/api/hyper/new_farming_app/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:xr.toLowerCase(),token:us})})).json();if(!(rs!=null&&rs.success)){if(console.warn("INFO API RESPONSE:",rs==null?void 0:rs.error_message),(rs==null?void 0:rs.error_message)==="You have not a running process"){const Zr=cn?cn.toLowerCase().replace("-","_farming_"):null,gi=L==null?void 0:L[Zr];if(Zr&&gi){const oi={...L,[Zr]:{...gi,isStop:!0}};z(oi);const jr=Object.keys(oi).filter(Xt=>Xt.startsWith("variational"));if(jr.length>0&&!cn){const st=jr.sort((Ft,yt)=>{var or,_r;const pn=parseInt(((or=Ft.match(/\d+/))==null?void 0:or[0])||0,10),An=parseInt(((_r=yt.match(/\d+/))==null?void 0:_r[0])||0,10);return pn-An})[0].match(/\d+/);st&&Pt(`Variational-${st[0]}`)}}else Pt("Variational-1")}rs!=null&&rs.slots_info&&(U((nn=($t=rs==null?void 0:rs.slots_info)==null?void 0:$t.variational)==null?void 0:nn.total_qty),R((lr=(Vn=rs==null?void 0:rs.slots_info)==null?void 0:Vn.variational)==null?void 0:lr.active_qty));return}if(rs!=null&&rs.success&&(rs!=null&&rs.data)){const Zr=cn?cn.toLowerCase().replace("-","_farming_"):null,gi=L==null?void 0:L[Zr],oi=rs.data||{};Zr&&!oi[Zr]&&gi&&(oi[Zr]={...gi,isStop:!0}),z(oi);const jr=Object.keys(oi).filter(Xt=>Xt.startsWith("variational"));if(jr.length>0&&!cn){const st=jr.sort((Ft,yt)=>{var or,_r;const pn=parseInt(((or=Ft.match(/\d+/))==null?void 0:or[0])||0,10),An=parseInt(((_r=yt.match(/\d+/))==null?void 0:_r[0])||0,10);return pn-An})[0].match(/\d+/);st&&Pt(`Variational-${st[0]}`)}rs!=null&&rs.slots_info&&(U((gr=(er=rs==null?void 0:rs.slots_info)==null?void 0:er.variational)==null?void 0:gr.total_qty),R((Fs=(dr=rs==null?void 0:rs.slots_info)==null?void 0:dr.variational)==null?void 0:Fs.active_qty))}}catch{C(!1),rt(),fe("OFF"),Z(!1)}finally{Qn(!1)}}const Le=m.useMemo(()=>cn?cn.toLowerCase().replace("-","_farming_"):"",[cn]),_e=!!((fr=L==null?void 0:L[Le])!=null&&fr.delta)&&!!((ur=L==null?void 0:L[Le])!=null&&ur.from_slot),nt=Le;m.useEffect(()=>{var Vn,lr,er,gr,dr,Fs,us,xr,vr,rs,Zr,gi,oi,la;if(!cn||!L)return;const $t=nt,nn=L==null?void 0:L[$t];if(!nn){ce(""),Ne(""),je(""),dt(""),Ut(""),tn(""),un(""),Vt(""),Ve(""),ft("LONG"),Rt("MARKET"),C(!1),fe("OFF"),Z(!1),Mn("Hour"),lt(""),Nt(""),Re(""),Be(null),he("variational"),G(!1),ee(0);return}if((nn==null?void 0:nn.target_params)==null&&nn.source_params){nn!=null&&nn.isStop?C(!1):C(!0),fe("OFF"),Z(!1),G(!1);const jr=nn.source_params,Xt=(nn==null?void 0:nn.slot_number)??"";Xt&&!_e&&Pt(`Variational-${Xt}`),jr!=null&&jr.cycleSeconds&&Mn((jr==null?void 0:jr.cycleSeconds)===86400?"Day":"Hour"),jr!=null&&jr.vr_token&&Re(String(jr.vr_token)),jr!=null&&jr.coin&&un(String(jr.coin)),(jr==null?void 0:jr.orderPerHour)!=null&&Vt(String(jr.orderPerHour)),(jr==null?void 0:jr.leverage)!=null&&Ve(String(jr.leverage)),jr!=null&&jr.direction&&ft(String(jr.direction).toUpperCase()==="SHORT"?"SHORT":String(jr.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG"),jr!=null&&jr.orderType&&Rt(String(jr.orderType).toUpperCase()==="MARKET"?"MARKET":String(jr.orderType).toUpperCase()==="LIMIT"?"LIMIT":"RANDOM"),(jr==null?void 0:jr.tp)!=null&&lt(String(jr.tp)),(jr==null?void 0:jr.sl)!=null&&Nt(String(jr.sl))}else if((nn==null?void 0:nn.target_params)!==null){nn!=null&&nn.isStop?(C(!1),G(!1)):(C(!0),G(!0)),fe("OFF"),Z(!1);const jr=(nn==null?void 0:nn.slot_number)??"";ee(jr),jr&&!_e&&Pt(`Variational-${jr}`),(Vn=nn==null?void 0:nn.source_params)!=null&&Vn.vr_token&&Re(String((lr=nn==null?void 0:nn.source_params)==null?void 0:lr.vr_token)),(er=nn==null?void 0:nn.source_params)!=null&&er.coin&&un(String((gr=nn==null?void 0:nn.source_params)==null?void 0:gr.coin)),((dr=nn==null?void 0:nn.source_params)==null?void 0:dr.orderPerHour)!=null&&Vt(String((Fs=nn==null?void 0:nn.source_params)==null?void 0:Fs.orderPerHour)),((us=nn==null?void 0:nn.source_params)==null?void 0:us.leverage)!=null&&Ve(String((xr=nn==null?void 0:nn.source_params)==null?void 0:xr.leverage)),(vr=nn==null?void 0:nn.source_params)!=null&&vr.accountType&&Dt(((rs=nn==null?void 0:nn.source_params)==null?void 0:rs.accountType)==="standart"?"STANDARD":"PREMIUM"),(Zr=nn==null?void 0:nn.target_params)!=null&&Zr.accountType&&Je(((gi=nn==null?void 0:nn.target_params)==null?void 0:gi.accountType)==="standart"?"STANDARD":"PREMIUM"),nn!=null&&nn.target_app&&he(((nn==null?void 0:nn.target_app)==="variational","variational")),(oi=nn==null?void 0:nn.target_params)!=null&&oi.vr_token&&Re((la=nn==null?void 0:nn.target_params)==null?void 0:la.vr_token)}else C(!1),fe("OFF"),Z(!1)},[cn,L,_e,nt]);const ot=$t=>{var nn;return Number(((nn=String($t||"").match(/\d+/))==null?void 0:nn[0])||0)},gt=$t=>($t||"").toLowerCase().replace("-","_"),Jt=m.useMemo(()=>{const $t=L==null?void 0:L[gt(cn)];if($t!=null&&$t.delta&&($t!=null&&$t.from_slot))return Number($t.from_slot);const nn=Number($t==null?void 0:$t.slot_number);return Number.isFinite(nn)?nn:ot(cn)},[cn,L]),Ge=m.useMemo(()=>{const $t=Number(N)||0,nn=Array.from({length:$t},()=>({used:!1,kind:null})),Vn=L||{};for(const[lr,er]of Object.entries(Vn)){if(!lr.startsWith("variational_farming"))continue;const gr=ot(lr)-1;gr<0||gr>=$t||((er==null?void 0:er.isStop)===!0?nn[gr]={used:!1,kind:null}:er!=null&&er.source_params?nn[gr]={used:!0,kind:"delta-src"}:er!=null&&er.target_params||er!=null&&er.delta?nn[gr]={used:!0,kind:"delta-shadow"}:er!=null&&er.farming_params?nn[gr]={used:!0,kind:"single"}:nn[gr]={used:!0,kind:"unknown"})}return nn},[L,N]),et=m.useMemo(()=>Ge.map(($t,nn)=>$t.used&&$t.kind!=="delta-src-inferred"?`Variational-${nn+1}`:null).filter(Boolean),[Ge]);m.useMemo(()=>Ge.filter($t=>!$t.used).length,[Ge]);async function We(){if(!g){n(!0);return}if(ke)try{$n(!0),Oe("");const $t=window.localStorage.getItem("hyperToken"),nn=window.localStorage.getItem("hyperAddress");if(!$t||!nn){n(!0);return}const Vn={vr_token:Ie,coin:jt,orderPerHour:Number(Xe),leverage:Number(Yt),direction:Ke,orderType:"MARKET",tp:Number(qe),sl:Number(xt),cycleSeconds:dn==="Hour"?3600:86400},lr={api_pkey:ye,api_index:at,login_wallet:kt,coin:jt==null?void 0:jt.replace("USDT",""),orderPerHour:Number(Xe),leverage:Number(Yt)},er={address:nn.toLowerCase(),token:$t,source_app:"variational_farming",source_params:Vn,slot_number:Number(cn==null?void 0:cn.replace("Variational-",""))},dr=await(await fetch(`${S}/api/hyper/farming_app/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(er)})).json();dr!=null&&dr.success?(C(!0),De(),Et&&se()):Oe((dr==null?void 0:dr.error_message)||"Start failed.")}catch($t){Oe($t.message||"An error occurred while saving.")}finally{$n(!1)}}async function wt(){if(!g){n(!0);return}try{Nn(!0),Oe("");const $t=window.localStorage.getItem("hyperToken"),nn=window.localStorage.getItem("hyperAddress");if(!$t||!nn){n(!0);return}const lr=await(await fetch(`${S}/api/hyper/farming_app/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:nn.toLowerCase(),token:$t,...oe?{slot_number:V,target_app:"variational_delta",source_app:"lighter"}:{source_app:"variational_farming",slot_number:Jt}})})).json();lr!=null&&lr.success?(C(!1),De()):Oe((lr==null?void 0:lr.error_message)||"Stop failed.")}catch($t){Oe($t.message||"An error occurred while stopping.")}finally{Nn(!1)}}const St={control:($t,nn)=>({...$t,backgroundColor:"#242424",borderColor:nn.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:$t=>({...$t,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:$t=>({...$t,height:32}),input:$t=>({...$t,color:"#FFFFFF",margin:0,padding:0}),singleValue:$t=>({...$t,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:$t=>({...$t,color:"#7F7F7F",fontSize:"12px"}),menu:$t=>({...$t,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:$t=>({...$t,paddingTop:0,paddingBottom:0,maxHeight:200}),option:($t,nn)=>({...$t,backgroundColor:nn.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:$t=>({...$t,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:$t=>({...$t,backgroundColor:"#353535"})};m.useEffect(()=>{if(!Ie){Be(null),tt("");return}const $t=Wt(Ie);if($t&&($t!=null&&$t.exp)){const nn=new Date($t.exp*1e3);Be(nn),tt("")}else $t?(Be(null),tt("The token's expiration date could not be found.")):(Be(null),tt("Invalid token format."))},[Ie]);const Kt=({max:$t})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[$t,"x"]}),gn=$t=>{var nn,Vn;return i.jsx($a.Option,{...$t,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(nn=$t.data)!=null&&nn.icon?i.jsx("img",{src:$t.data.icon,alt:$t.data.label,className:`w-4 h-4 ${((Vn=$t==null?void 0:$t.data)==null?void 0:Vn.label)==="XRP"?"bg-gray-600 rounded-full":"rounded-[4px]"}`,onError:lr=>lr.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:$t.data.label}),i.jsx(Kt,{max:$t.data.maxLeverage})]})})},yn=$t=>{var nn,Vn;return i.jsx($a.SingleValue,{...$t,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(nn=$t.data)!=null&&nn.icon?i.jsx("img",{src:$t.data.icon,alt:$t.data.label,className:`w-4 h-4 ${((Vn=$t==null?void 0:$t.data)==null?void 0:Vn.label)==="XRP"?"bg-gray-600 rounded-full":"rounded-[4px]"}`,onError:lr=>lr.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:$t.data.label}),i.jsx(Kt,{max:$t.data.maxLeverage})]})})},hn=$t=>{const nn=et.includes($t.data.value);return i.jsx($a.Option,{...$t,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[i.jsx("span",{className:"text-white text-[13px]",children:$t.data.label}),nn&&i.jsx("span",{className:"ml-auto w-2 h-2 rounded-full bg-[#67FFBD]",title:"Active"})]})})},br=$t=>i.jsx($a.SingleValue,{...$t,children:i.jsx("div",{className:"flex items-center gap-2 px-3",children:i.jsx("span",{className:"text-white text-[13px]",children:$t.data.label})})}),pt=async()=>{var Vn,lr,er,gr,dr,Fs,us,xr;const $t=window.localStorage.getItem("hyperToken"),nn=window.localStorage.getItem("hyperAddress");if(!(!$t||!nn))try{kn(!0);const vr=await Si(nn.toLowerCase(),$t);vr!=null&&vr.success?(r(vr==null?void 0:vr.telegram_chat_id),s(vr==null?void 0:vr.subscriber_role),a(vr==null?void 0:vr.subs_expire_day),o((Vn=vr==null?void 0:vr.mushboomer_counts)==null?void 0:Vn.eth),l((lr=vr==null?void 0:vr.mushboomer_counts)==null?void 0:lr.sol),c(vr==null?void 0:vr.referral_code),u(vr==null?void 0:vr.refcode),d(vr==null?void 0:vr.whitelist),f($t),x(nn),p(!0),I((gr=(er=vr==null?void 0:vr.slots_info)==null?void 0:er.variational)==null?void 0:gr.total_qty),U((Fs=(dr=vr==null?void 0:vr.slots_info)==null?void 0:dr.variational)==null?void 0:Fs.total_qty),R((xr=(us=vr==null?void 0:vr.slots_info)==null?void 0:us.variational)==null?void 0:xr.active_qty),kn(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),kn(!1))}catch(vr){console.error("Token verification error:",vr),console.error(vr.message||"An unknown error occurred."),kn(!1)}};function Wt($t){try{const nn=$t.split(".");if(nn.length!==3)throw new Error("Invalid JWT format");const lr=nn[1].replace(/-/g,"+").replace(/_/g,"/"),er=decodeURIComponent(atob(lr).split("").map(gr=>"%"+("00"+gr.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(er)}catch{return null}}const Zt=k,vt=m.useMemo(()=>Array.from({length:N},($t,nn)=>({value:`Variational-${nn+1}`,label:`Variational-${nn+1}`})),[N]);if(!e)return null;const Ot=vn||Hn||Jn||_n,wn=w&&!Jn,Gn=T(jt);return i.jsxs(i.Fragment,{children:[i.jsx(fd,{open:zn,setOpen:Yn,transactionHash:Lt,transactionLoading:tr,paymentPresaleRole:Ee,errorFunds:sn,activeMethod:2}),i.jsx(d5,{open:Y,setOpen:ie,paymentLighterRole:Ee,oldSlotCount:X,checkAccountLighter:pt,tradeMarket:"variational"}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!Ot&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#F8D4AB] max-h-[97dvh] overflow-y-auto",children:[i.jsxs("div",{className:"pb-2 px-5 pt-3 border-b border-[#353535] rounded-t-3xl relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("img",{src:"https://omni.variational.io/_app/immutable/assets/full_omni_wordmark.DwlcSpMk.svg",alt:"Variational",className:"h-[18px] text-white"}),i.jsx("span",{className:"text-[24px] font-semibold text-[#e87859] mt-[1px]",children:"farming"})]}),i.jsxs("div",{className:"flex justify-between items-center gap-4",children:[i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2",children:"Variational Farming module lets you set up automated farming by providing your Variational Token, selecting a pair, defining orders per hour, leverage, direction and order type ."}),i.jsx("div",{className:"flex flex-col items- justify-start gap-1 relative",children:i.jsx("div",{className:"text-xs font-semibold text-[#7C7C7C] mt-2",children:i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/farm/variational-omni-farming-module#getting-your-variational-token","_blank"),className:"h-6 sm:h-7 w-max py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer border border-[#353535] px-4 bg-[#242424] hover:bg-[#2e2e2e]",children:[i.jsx("img",{src:s5,className:"w-[14px] h-[14px]"}),i.jsx("div",{className:"min-w-max text-white text-xs font-medium font-manrope leading-none pointer-events-none",children:"Docs"})]})})})]})]}),i.jsxs("div",{className:"pb-2 space-y-3 pt-2 px-5",children:[ln&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:ln}),g&&Ee&&F===P&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:"No free Variational slots. Currently running on Delta Neutral."}),g&&oe&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:`Currently used for Delta Neutral in Lighter Farming (Slot-${V})`}),g&&Ee&&i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 px-4 sm:px-5",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-[13px] text-[#7C7C7C] font-semibold",children:[i.jsx("span",{className:"pl-[2px]",children:"Slot"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(iA,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[P||0,"/",vt.length]})]})]}),i.jsx(Zl,{styles:St,components:{Option:hn,SingleValue:br},options:vt,value:vt.find($t=>$t.value===cn)||null,onChange:$t=>Pt(($t==null?void 0:$t.value)??""),placeholder:"Select",isSearchable:!0})]})}),i.jsxs("div",{className:"py-1 space-y-3 px-3 sm:px-5",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[ae==="ON"?i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 1"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"1st Variational Wallet Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ct,onChange:$t=>Ut($t.target.value),autoComplete:"off",placeholder:"1st Variational Wallet Address ",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ct===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Ot||wn})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/variational-omni-farming-module#getting-your-variational-token",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:Ae,onChange:$t=>ce($t.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:Cn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ae===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Ot||wn}),i.jsx("button",{type:"button",onClick:()=>Bt($t=>!$t),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Ot||wn,children:Cn?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:be,onChange:$t=>{const nn=$t.target.value.trim();if(nn==="")return je("");te(nn)&&je(nn)},onKeyDown:B,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${be===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Ot||wn})})]})]}):i.jsx(i.Fragment,{}),ae==="ON"&&i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 2"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"2nd Variational Wallet Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:kt,onChange:$t=>tn($t.target.value),autoComplete:"off",placeholder:"2nd Variational Wallet Address",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${kt===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Ot||wn})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key 2"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/variational-omni-farming-module#getting-your-variational-token",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:ye,onChange:$t=>Ne($t.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY_2",type:qn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ye===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Ot||wn}),i.jsx("button",{type:"button",onClick:()=>nr($t=>!$t),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Ot||wn,children:qn?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index 2"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:at,onChange:$t=>{const nn=$t.target.value.trim();if(nn==="")return dt("");te(nn)&&dt(nn)},onKeyDown:B,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX_2",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${at===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Ot||wn})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${ae==="ON"?"hidden":""} space-y-2`,children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Variational Token"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/variational-omni-farming-module#getting-your-variational-token",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get Variational Token?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:Ie,onChange:$t=>{const nn=$t.target.value;if(Re(nn),!nn.trim()){Be(null),tt("");return}const Vn=Wt(nn);if(Vn&&(Vn!=null&&Vn.exp)){const lr=new Date((Vn==null?void 0:Vn.exp)*1e3);Be(lr),tt("")}else Vn?(Be(null),tt("The token's expiration date could not be found.")):(Be(null),tt("Invalid token format."))},type:an?"text":"password",autoComplete:"off",placeholder:"Variational_Token",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ie===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Ot||wn}),Qe&&i.jsxs("div",{className:"text-[12px] mt-1 pl-[3px] flex justify-start items-center gap-2",children:[i.jsx("span",{className:"text-[10px] text-[#CECECE] font-medium",children:"Valid Until:"})," ",i.jsx("span",{className:"text-[11px] font-semibold "+(h?"text-[#FF797C]":"text-[#F8D4AB]"),children:Qe==null?void 0:Qe.toLocaleString("en-US",{dateStyle:"medium",timeStyle:"short"})}),h&&i.jsx("span",{children:i.jsx("img",{src:vc,alt:"",className:"w-3.5 h-3.5"})})]}),it&&i.jsx("div",{className:"text-[10px] text-[#FF797C] mt-[2px] pl-[3px]",children:it}),i.jsx("button",{type:"button",onClick:()=>Pn($t=>!$t),className:"absolute right-1 top-4 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Ot||wn,children:an?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Zl,{styles:St,components:{Option:gn,SingleValue:yn},isDisabled:Ot||wn,options:Zt,value:Zt.find($t=>$t.value===jt)||null,onChange:$t=>un(($t==null?void 0:$t.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:`${ae==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per Hour"}),i.jsx("input",{value:Xe,onChange:$t=>{const nn=$t.target.value.trim();if(nn==="")return Vt("");te(nn)&&Vt(nn)},onKeyDown:B,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Xe===""?"border-[#353535]":ue?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Ot||wn}),Xe!==""&&!ue&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 120."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${ae==="ON"?"hidden":""} space-y-1`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per"}),i.jsxs("select",{value:dn,onChange:$t=>Mn($t.target.value),className:`${Ot||wn?"cursor-not-allowed":"cursor-pointer"} h-6 text-[12px] bg-[#242424] border border-[#353535] rounded-md px-2 text-white outline-none font-bold font-manrope`,disabled:Ot||wn,children:[i.jsx("option",{value:"Hour",children:"Hour"}),i.jsx("option",{value:"Day",children:"Day"})]})]}),i.jsx("input",{value:Xe,onChange:$t=>{const nn=$t.target.value.trim();if(nn==="")return Vt("");te(nn)&&Vt(nn)},onKeyDown:B,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 120)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Xe===""?"border-[#353535]":ue?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Ot||wn}),Xe!==""&&!ue&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 120."})]}),i.jsxs("div",{className:`${ae==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:ae==="ON"?"On":"Off"}),i.jsx(Oo,{checked:ae==="ON",onChange:$t=>fe($t?"ON":"OFF"),disabled:Ot||wn,className:`${ae==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${Ot||wn?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out  ${ae==="ON"?"translate-x-3":"translate-x-0"}`})})]})]}),i.jsxs("div",{className:" space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Leverage"}),i.jsx("input",{value:Yt,onChange:$t=>{const nn=$t.target.value.trim();if(nn==="")return Ve("");te(nn)&&Ve(nn)},onKeyDown:B,inputMode:"numeric",autoComplete:"off",placeholder:jt?`1–${Gn}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Yt===""?"border-[#353535]":de?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Ot||wn})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-2 md:pr-6",children:[i.jsx("div",{"aria-pressed":Ke==="LONG",onClick:()=>!wn&&ft("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Ot||wn?"cursor-not-allowed":"cursor-pointer",Ke==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["LONG",Yt?` - ${Yt}x`:""]})}),i.jsx("div",{"aria-pressed":Ke==="SHORT",onClick:()=>!wn&&ft("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Ot||wn?"cursor-not-allowed":"cursor-pointer",Ke==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["SHORT",Yt?` - ${Yt}x`:""]})}),i.jsx("div",{"aria-pressed":Ke==="RANDOM",onClick:()=>!wn&&ft("RANDOM"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Ot||wn?"cursor-not-allowed":"cursor-pointer",Ke==="RANDOM"?"bg-[#3b82f6] text-[#ffffff] border-[#93c5fd] shadow-[0_0_0_3px_rgba(59,130,246,0.3)]":"text-[#3b82f6] bg-[rgba(59,130,246,0.15)] border-[rgba(59,130,246,0.15)] hover:bg-[#2563eb] hover:text-white"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["RANDOM",Yt?` - ${Yt}x`:""]})})]})]}),i.jsxs("div",{className:`${oe?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"flex items-center gap-2 text-[13px] text-[#7C7C7C] font-semibold",children:i.jsx("span",{children:"Order Type"})}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{"aria-pressed":He==="MARKET",onClick:()=>!wn&&Rt("MARKET"),className:["inline-flex justify-center items-center gap-1.5 h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2 min-w-max",Ot||wn?"cursor-not-allowed":"cursor-pointer",He==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["MARKET ",He==="MARKET"?" ✓":""]})}),i.jsxs("button",{"aria-pressed":He==="LIMIT",className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2","cursor-not-allowed",He==="LIMIT"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:[i.jsxs("span",{children:["LIMIT ",He==="LIMIT"?" ✓":""]}),i.jsx("span",{className:"min-w-max text-[6px] -mt-[1px] text-[#FF9A3C]",children:"Coming Soon"})]}),i.jsxs("button",{"aria-pressed":He==="RANDOM",className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2","cursor-not-allowed",He==="RANDOM"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:[i.jsxs("span",{children:["RANDOM ",He==="RANDOM"?" ✓":""]}),i.jsx("span",{className:"min-w-max text-[6px] -mt-[1px] text-[#FF9A3C]",children:"Coming Soon"})]})]})]})]}),!1,i.jsxs("div",{className:`${oe?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Take Profit %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:qe,onChange:$t=>{const nn=$t.target.value.trim();if(nn==="")return lt("");q(nn)&&lt(nn)},onKeyDown:B,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${qe===""?"border-[#353535]":xe?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Ot||wn})]}),qe!==""&&!xe&&i.jsx("div",{className:"text-[#FF797C] text-[11px]",children:"Value must be 0, or between 1 and 10000000. Numbers between 0 and 1 are not allowed."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stop Loss %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:xt,onChange:$t=>{const nn=$t.target.value.trim();if(nn==="")return Nt("");q(nn)&&Nt(nn)},onKeyDown:B,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${xt===""?"border-[#353535]":we?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Ot||wn})]}),xt!==""&&!we&&i.jsxs("div",{className:"text-[#FF797C] text-[11px]",children:["Value must be 0, or between 1 and"," ",Yt?Math.max(Yt*100-1,0):4999,". Numbers between 0 and 1 are not allowed."]})]})]})]}),i.jsx("div",{className:`${ae==="ON"?"py-3":"py-6"} flex items-center gap-3 px-5 border-t border-[#353535] bg-[rgba(27,27,27,0.32)] rounded-b-3xl`,children:i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!Ot&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] hover:border-white disabled:opacity-60",disabled:Ot,children:"Cancel"}),g?ae==="ON"?w?i.jsx("button",{onClick:stopLighterFarming,disabled:Ot,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:Jn?"Stopping...":"Stop"}):i.jsx("button",{onClick:saveLighterFarming,disabled:!Me||Ot,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!Me||Ot?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Hn?"Starting...":"Start"}):w?i.jsx("button",{onClick:wt,disabled:Ot,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:Jn?"Stopping...":"Stop"}):i.jsx("button",{onClick:We,disabled:!ke||Ot,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!ke||Ot?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Hn?"Starting...":"Start"}):i.jsx("button",{onClick:()=>n(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})}),vn&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})},v$=({open:e=!1,setOpen:t=()=>{}})=>{var pt,Wt,Zt;const{setSignModalOpen:n,setTelegramChatId:r,setSubscriberRole:s,setSubsExpireDay:a,setMushboomerETH:o,setMushboomerSOL:l,setIsReferralCode:c,setIsReferralCodeName:u,setIsWhitelist:d,setHyperToken:f,setHyperAddress:x}=m.useContext(Gr),{address:g}=Yr(),[v,w]=m.useState(!1),[C,N]=m.useState(!1),[I,P]=m.useState(1),[R,F]=m.useState(0),[U,L]=m.useState(0),[z,X]=m.useState({}),[ne,J]=m.useState(null),[Z,re]=m.useState("extended");m.useState(!1),m.useRef(null);const[he,Y]=m.useState(!1),[ie,oe]=m.useState("Extended-1"),[G,V]=m.useState("OFF"),[ee,ae]=m.useState(""),[fe,Ae]=m.useState(""),[ce,ye]=m.useState(""),[Ne,be]=m.useState(""),[je,Ie]=m.useState(""),[Re,Qe]=m.useState(""),[Be,it]=m.useState(""),[tt,at]=m.useState(""),[dt,ct]=m.useState([]),[Ut,kt]=m.useState(""),[tn,jt]=m.useState(""),[un,cn]=m.useState("LONG"),[Pt,Xe]=m.useState("STANDARD"),[Vt,Yt]=m.useState("STANDARD"),[Ve,Ke]=m.useState("LIMIT"),[ft,en]=m.useState(""),[Dt,At]=m.useState(""),[Je,He]=m.useState(""),[Rt,qe]=m.useState(!1),[lt,xt]=m.useState(!1),[Nt,It]=m.useState(!1),[xn,dn]=m.useState(!1),[Mn,_n]=m.useState(""),[kn,vn]=m.useState(""),[Qn,Hn]=m.useState(!0),[$n,Jn]=m.useState(!1),[Nn,ln]=m.useState(!1),[Oe,sn]=m.useState(!1),[fn,Et]=m.useState(!1),[Kn,Cn]=m.useState(!1),[Bt,an]=m.useState(!1),[Pn,qn]=m.useState(!1),[nr,tr]=m.useState(""),[Qt,zn]=m.useState(!0),[Yn,Lt]=m.useState("Hour");m.useState(1);const Fn="https://dextrabothypev2.nftinit.io",Ee="",p=m.useMemo(()=>[{value:"BTC",label:"BTC",icon:"https://app.hyperliquid.xyz/coins/BTC.svg",maxLeverage:50},{value:"ETH",label:"ETH",icon:"https://app.hyperliquid.xyz/coins/ETH.svg",maxLeverage:50},{value:"SOL",label:"SOL",icon:"https://app.hyperliquid.xyz/coins/SOL.svg",maxLeverage:50},{value:"HYPE",label:"HYPE",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg",maxLeverage:50},{value:"ZEC",label:"ZEC",icon:"https://app.hyperliquid.xyz/coins/ZEC.svg",maxLeverage:10},{value:"BNB",label:"BNB",icon:"https://app.hyperliquid.xyz/coins/BNB.svg",maxLeverage:20},{value:"RESOLV",label:"RESOLV",icon:"https://app.hyperliquid.xyz/coins/RESOLV.svg",maxLeverage:5},{value:"XPL",label:"XPL",icon:"https://app.hyperliquid.xyz/coins/XPL.svg",maxLeverage:20},{value:"GOAT",label:"GOAT",icon:"https://app.hyperliquid.xyz/coins/GOAT.svg",maxLeverage:10},{value:"PUMP",label:"PUMP",icon:"https://app.hyperliquid.xyz/coins/PUMP.svg",maxLeverage:25},{value:"ASTER",label:"ASTER",icon:"https://static.astherus.finance/image/admin_mgs_image_upload/20250916/6dba1412-ddfb-4314-bfdf-87fa11f2daa6.png",maxLeverage:10}],[]),h={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI"};m.useEffect(()=>{async function vt(){if(e)try{const wn=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=extended")).json();if(wn!=null&&wn.coins){let Gn=wn.coins.map(fr=>{const ur=(fr==null?void 0:fr.label)||"",$t=h[ur]||ur,nn=$t==="XMR"?"https://app.lighter.xyz/assets/xmr-CV8khZ54.png":$t==="NMR"?"https://app.lighter.xyz/assets/nmr-2YIHMk6g.png":$t==="USELESS"?"https://app.lighter.xyz/assets/useless-BTmgr78l.png":$t==="DOLO"?"https://app.lighter.xyz/assets/dolo-DuOVl-Vo.png":$t==="CRO"?"https://app.lighter.xyz/assets/cro-C7lstwu3.png":$t==="FF"?"https://app.lighter.xyz/assets/ff-CvnDhHny.png":$t==="4"||$t=="EUR"||$t=="EDEN"||$t=="XAU"?"":`https://app.hyperliquid.xyz/coins/${$t}.svg`;return{...fr,icon:nn}});ct(Gn)}}catch(Ot){console.error("Failed to fetch coin list:",Ot)}}vt()},[e]);const S=vt=>{var Ot;return((Ot=p.find(wn=>wn.value===vt))==null?void 0:Ot.maxLeverage)??100},_=vt=>{["e","E","+","-"].includes(vt.key)&&vt.preventDefault()},k=vt=>/^\d*\.?\d{0,6}$/.test(vt),T=vt=>/^\d*$/.test(vt),B=m.useMemo(()=>{if(Ut==="")return!1;const vt=Number(Ut);return Number.isInteger(vt)&&vt>=1&&vt<=180},[Ut]),q=m.useMemo(()=>{if(tn==="")return!1;const vt=Number(tn),Ot=S(tt);return Number.isInteger(vt)&&vt>=1&&vt<=Ot},[tn,tt]),te=m.useMemo(()=>{if(ft==="")return!1;const vt=Number(ft);return Number.isNaN(vt)?!1:vt===0?!0:vt>=1&&vt<=1e7},[ft]),ue=m.useMemo(()=>{if(Dt==="")return!1;const vt=Number(Dt);if(Number.isNaN(vt))return!1;const Ot=tn===""?null:Number(tn),wn=Ot?Ot*100-1:4999;return vt===0?!0:vt>0&&vt<1?!1:vt>=1&&vt<=wn},[Dt,tn]);m.useMemo(()=>{if(Je==="")return!1;const vt=Number(Je);return!Number.isNaN(vt)&&vt>0&&vt<=100},[Je]);const de=v&&ee.trim()!==""&&Re.trim()!==""&&ce.trim()!==""&&Ne.trim()!==""&&tt!==""&&B&&q&&(!ft||te)&&(!Dt||ue)&&(un==="LONG"||un==="SHORT"||un==="RANDOM")&&(Ve==="LIMIT"||Ve==="MARKET"||Ve==="RANDOM")&&Qt;v&&Re.trim()!==""&&Be.trim()!==""&&ee.trim()!==""&&fe.trim()!==""&&ce.trim()!==""&&ee.trim()!==fe.trim()&&(Re.trim().toLowerCase(),Be.trim().toLowerCase());const xe=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),we=()=>`extendedCreds:${xe()}`,ke=()=>{try{const vt=localStorage.getItem(we());if(!vt)return;const Ot=JSON.parse(vt);Ot.apiKey&&ae(Ot.apiKey),Ot.apiPrivateKey&&ye(Ot.apiPrivateKey),Ot.vaultNumber&&be(Ot.vaultNumber),Ot.apiPublicKey&&Qe(Ot.apiPublicKey),typeof Ot.remember=="boolean"&&Hn(Ot.remember)}catch{}},Me=()=>{if(Qn)try{localStorage.setItem(we(),JSON.stringify({apiKey:ee,apiPrivateKey:ce,apiPublicKey:Re,vaultNumber:Ne,remember:!0}))}catch{}},Ye=()=>{try{localStorage.removeItem(we())}catch{}};m.useEffect(()=>{if(!e)return;const vt=localStorage.getItem("hyperToken"),Ot=localStorage.getItem("hyperAddress");w(!!(vt&&Ot));const wn=setInterval(()=>{const Gn=localStorage.getItem("hyperToken"),fr=localStorage.getItem("hyperAddress");w(!!(Gn&&fr))},800);return()=>clearInterval(wn)},[e]),m.useEffect(()=>{!e||!v||(Fe(),We())},[e,v]),m.useEffect(()=>{e&&(Dt===""&&At(Ee),ft===""&&en(Ee),Je===""&&He(Ee))},[e]),m.useEffect(()=>{if(!tt)return;const vt=S(tt),Ot=Number(tn);!Number.isNaN(Ot)&&Ot>vt&&jt(String(vt)),!Number.isNaN(Ot)&&Ot<1&&tn!==""&&jt("1")},[tt]),m.useEffect(()=>{e&&(Qn&&Me(),Qn||Ye())},[ee,ce,Ne,Re,Qn,e]);async function Fe(){var vt,Ot,wn,Gn,fr,ur,$t,nn;try{xt(!0),_n("");const Vn=window.localStorage.getItem("hyperToken"),lr=window.localStorage.getItem("hyperAddress");if(!Vn||!lr){N(!1),ke();return}const gr=await(await fetch(`${Fn}/api/hyper/new_farming_app/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:lr.toLowerCase(),token:Vn})})).json();if(!(gr!=null&&gr.success)){if(console.warn("INFO API RESPONSE:",gr==null?void 0:gr.error_message),(gr==null?void 0:gr.error_message)==="You have not a running process"){const dr=ie?ie.toLowerCase().replace("-","_"):null,Fs=z==null?void 0:z[dr];if(dr&&Fs){const us={...z,[dr]:{...Fs,isStop:!0}};X(us);const xr=Object.keys(us);xr.length>0&&!ie&&xr[0].match(/\d+/)&&oe("Extended-1")}else oe("Extended-1")}gr!=null&&gr.slots_info&&(L((Ot=(vt=gr==null?void 0:gr.slots_info)==null?void 0:vt.extended)==null?void 0:Ot.total_qty),F((Gn=(wn=gr==null?void 0:gr.slots_info)==null?void 0:wn.extended)==null?void 0:Gn.active_qty));return}if(gr!=null&&gr.success&&(gr!=null&&gr.data)){const dr=ie?ie.toLowerCase().replace("-","_"):null,Fs=z==null?void 0:z[dr],us=gr.data||{};dr&&!us[dr]&&Fs&&(us[dr]={...Fs,isStop:!0}),X(us);const xr=Object.keys(us);xr.length>0&&!ie&&xr[0].match(/\d+/)&&oe("Extended-1"),gr!=null&&gr.slots_info&&(L((ur=(fr=gr==null?void 0:gr.slots_info)==null?void 0:fr.extended)==null?void 0:ur.total_qty),F((nn=($t=gr==null?void 0:gr.slots_info)==null?void 0:$t.extended)==null?void 0:nn.active_qty))}}catch{N(!1),ke(),V("OFF")}finally{xt(!1)}}const rt=m.useMemo(()=>ie?ie.toLowerCase().replace("-","_"):"",[ie]),se=!!((pt=z==null?void 0:z[rt])!=null&&pt.delta)&&!!((Wt=z==null?void 0:z[rt])!=null&&Wt.from_slot),Ce=se?`extended_${(Zt=z==null?void 0:z[rt])==null?void 0:Zt.from_slot}`:rt;m.useEffect(()=>{var wn,Gn,fr,ur,$t,nn,Vn,lr,er,gr;if(!ie||!z)return;const vt=Ce,Ot=z==null?void 0:z[vt];if(!Ot){ae(""),ye(""),Qe(""),Ie(""),be(""),at(""),kt(""),jt(""),cn("LONG"),Ke("LIMIT"),N(!1),V("OFF"),Lt("Hour"),en(""),At(""),re("extended");return}if((Ot==null?void 0:Ot.target_params)==null&&Ot.source_params){Ot!=null&&Ot.isStop?N(!1):N(!0),V("OFF");const dr=Ot.source_params;((Ot==null?void 0:Ot.slot_number)??"")&&!se&&oe("Extended-1"),dr!=null&&dr.cycleSeconds&&Lt((dr==null?void 0:dr.cycleSeconds)===86400?"Day":"Hour");const us=(dr==null?void 0:dr.extendedapikey)??"",xr=(dr==null?void 0:dr.x10privatekey)??"",vr=(dr==null?void 0:dr.x10publickey)??"",rs=(dr==null?void 0:dr.x10vault)??"";if(us&&ae(String(us)),xr&&ye(String(xr)),vr&&Qe(String(vr)),rs&&be(String(rs)),dr!=null&&dr.coin){const Zr=String(dr.coin).replace(/-USD$/,"");at(Zr)}(dr==null?void 0:dr.orderPerHour)!=null&&kt(String(dr.orderPerHour)),(dr==null?void 0:dr.leverage)!=null&&jt(String(dr.leverage)),dr!=null&&dr.direction&&cn(String(dr.direction).toUpperCase()==="SHORT"?"SHORT":String(dr.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG"),dr!=null&&dr.orderType&&Ke(String(dr.orderType).toUpperCase()==="MARKET"?"MARKET":String(dr.orderType).toUpperCase()==="LIMIT"?"LIMIT":"RANDOM"),(dr==null?void 0:dr.tp)!=null&&en(String(dr.tp)),(dr==null?void 0:dr.sl)!=null&&At(String(dr.sl))}else(Ot==null?void 0:Ot.target_params)!==null?(Ot!=null&&Ot.isStop?N(!1):N(!0),V("OFF"),((Ot==null?void 0:Ot.slot_number)??"")&&!se&&oe("Extended-1"),(wn=Ot==null?void 0:Ot.source_params)!=null&&wn.coin&&at(String((Gn=Ot==null?void 0:Ot.source_params)==null?void 0:Gn.coin)),((fr=Ot==null?void 0:Ot.source_params)==null?void 0:fr.orderPerHour)!=null&&kt(String((ur=Ot==null?void 0:Ot.source_params)==null?void 0:ur.orderPerHour)),(($t=Ot==null?void 0:Ot.source_params)==null?void 0:$t.leverage)!=null&&jt(String((nn=Ot==null?void 0:Ot.source_params)==null?void 0:nn.leverage)),(Vn=Ot==null?void 0:Ot.source_params)!=null&&Vn.accountType&&Xe(((lr=Ot==null?void 0:Ot.source_params)==null?void 0:lr.accountType)==="standart"?"STANDARD":"PREMIUM"),(er=Ot==null?void 0:Ot.target_params)!=null&&er.accountType&&Yt(((gr=Ot==null?void 0:Ot.target_params)==null?void 0:gr.accountType)==="standart"?"STANDARD":"PREMIUM"),Ot!=null&&Ot.target_app&&re(((Ot==null?void 0:Ot.target_app)==="extended","extended"))):(N(!1),V("OFF"))},[ie,z,se,Ce]);const De=vt=>{var Ot;return Number(((Ot=String(vt||"").match(/\d+/))==null?void 0:Ot[0])||0)},Le=vt=>(vt||"").toLowerCase().replace("-","_");m.useMemo(()=>{const vt=z==null?void 0:z[Le(ie)];if(vt!=null&&vt.delta&&(vt!=null&&vt.from_slot))return Number(vt.from_slot);const Ot=Number(vt==null?void 0:vt.slot_number);return Number.isFinite(Ot)?Ot:De(ie)},[ie,z]);const _e=m.useMemo(()=>{const vt=Number(I)||0,Ot=Array.from({length:vt},()=>({used:!1,kind:null})),wn=z||{};for(const[Gn,fr]of Object.entries(wn)){if(!Gn.startsWith("extended"))continue;const ur=De(Gn)-1;ur<0||ur>=vt||((fr==null?void 0:fr.isStop)===!0?Ot[ur]={used:!1,kind:null}:fr!=null&&fr.source_params?Ot[ur]={used:!0,kind:"delta-src"}:fr!=null&&fr.target_params||fr!=null&&fr.delta?Ot[ur]={used:!0,kind:"delta-shadow"}:fr!=null&&fr.farming_params?Ot[ur]={used:!0,kind:"single"}:Ot[ur]={used:!0,kind:"unknown"})}return Ot},[z,I]);m.useMemo(()=>_e.map((vt,Ot)=>vt.used&&vt.kind!=="delta-src-inferred"?`Extended-${Ot+1}`:null).filter(Boolean),[_e]),m.useMemo(()=>_e.filter(vt=>!vt.used).length,[_e]);async function nt(){if(!v){n(!0);return}if(de)try{It(!0),_n("");const vt=window.localStorage.getItem("hyperToken"),Ot=window.localStorage.getItem("hyperAddress");if(!vt||!Ot){n(!0);return}const wn={extendedapikey:ee,x10publickey:Re,x10privatekey:ce,x10vault:Ne,cycleSeconds:Yn==="Hour"?3600:86400,tp:Number(ft),sl:Number(Dt),coin:`${tt}-USD`,orderPerHour:Number(Ut),leverage:Number(tn),direction:un,orderType:Ve},Gn={api_pkey:fe,login_wallet:Be,coin:tt==null?void 0:tt.replace("USDT",""),orderPerHour:Number(Ut),leverage:Number(tn)},fr={address:Ot.toLowerCase(),token:vt,source_app:"extended",source_params:wn},$t=await(await fetch(`${Fn}/api/hyper/farming_app/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(fr)})).json();$t!=null&&$t.success?(N(!0),Fe(),Qn&&Me()):_n(($t==null?void 0:$t.error_message)||"Start failed.")}catch(vt){_n(vt.message||"An error occurred while saving.")}finally{It(!1)}}async function ot(){if(!v){n(!0);return}try{dn(!0),_n("");const vt=window.localStorage.getItem("hyperToken"),Ot=window.localStorage.getItem("hyperAddress");if(!vt||!Ot){n(!0);return}const Gn=await(await fetch(`${Fn}/api/hyper/farming_app/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Ot.toLowerCase(),token:vt,source_app:"extended"})})).json();Gn!=null&&Gn.success?(N(!1),Fe()):_n((Gn==null?void 0:Gn.error_message)||"Stop failed.")}catch(vt){_n(vt.message||"An error occurred while stopping.")}finally{dn(!1)}}const gt={control:(vt,Ot)=>({...vt,backgroundColor:"#242424",borderColor:Ot.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:vt=>({...vt,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:vt=>({...vt,height:32}),input:vt=>({...vt,color:"#FFFFFF",margin:0,padding:0}),singleValue:vt=>({...vt,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:vt=>({...vt,color:"#7F7F7F",fontSize:"12px"}),menu:vt=>({...vt,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:vt=>({...vt,paddingTop:0,paddingBottom:0,maxHeight:200}),option:(vt,Ot)=>({...vt,backgroundColor:Ot.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:vt=>({...vt,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:vt=>({...vt,backgroundColor:"#353535"})},Jt=({max:vt})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[vt,"x"]}),Ge=vt=>{var Ot;return i.jsx($a.Option,{...vt,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(Ot=vt.data)!=null&&Ot.icon?i.jsx("img",{src:vt.data.icon,alt:vt.data.label,className:"w-4 h-4 rounded-[4px]",onError:wn=>wn.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:vt.data.label}),i.jsx(Jt,{max:vt.data.maxLeverage})]})})},et=vt=>{var Ot;return i.jsx($a.SingleValue,{...vt,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(Ot=vt.data)!=null&&Ot.icon?i.jsx("img",{src:vt.data.icon,alt:vt.data.label,className:"w-4 h-4 rounded-[4px]",onError:wn=>wn.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:vt.data.label}),i.jsx(Jt,{max:vt.data.maxLeverage})]})})},We=async()=>{var wn,Gn,fr,ur,$t,nn,Vn,lr;const vt=window.localStorage.getItem("hyperToken"),Ot=window.localStorage.getItem("hyperAddress");if(!(!vt||!Ot))try{qe(!0);const er=await Si(Ot.toLowerCase(),vt);er!=null&&er.success?(r(er==null?void 0:er.telegram_chat_id),s(er==null?void 0:er.subscriber_role),a(er==null?void 0:er.subs_expire_day),o((wn=er==null?void 0:er.mushboomer_counts)==null?void 0:wn.eth),l((Gn=er==null?void 0:er.mushboomer_counts)==null?void 0:Gn.sol),c(er==null?void 0:er.referral_code),u(er==null?void 0:er.refcode),d(er==null?void 0:er.whitelist),f(vt),x(Ot),zn(!0),P((ur=(fr=er==null?void 0:er.slots_info)==null?void 0:fr.extended)==null?void 0:ur.total_qty),L((nn=($t=er==null?void 0:er.slots_info)==null?void 0:$t.extended)==null?void 0:nn.total_qty),F((lr=(Vn=er==null?void 0:er.slots_info)==null?void 0:Vn.extended)==null?void 0:lr.active_qty),qe(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),qe(!1))}catch(er){console.error("Token verification error:",er),console.error(er.message||"An unknown error occurred."),qe(!1)}},wt=async()=>new yl(window.ethereum).eth.getAccounts(Ot=>Ot),St=async(vt="extended",Ot=24,wn=5e3)=>{Ot<=0||(await new Promise(Gn=>setTimeout(Gn,wn)),await We(),vt==="extended"&&!Qt&&St(vt,Ot-1,wn))},Kt=async()=>{vn("");const vt=window.localStorage.getItem("hyperToken"),Ot=window.localStorage.getItem("hyperAddress");if(!vt||!g){n(!0);return}qn(!0),an(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(fr){console.error("Failed to switch network",fr),an(!1);return}const wn=new yl(window.ethereum);var Gn=await wt();if(Gn.length>0?Gn=Gn[0]:Gn=void 0,Gn){const ur={from:Gn,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:"120000000000000000"};await wn.eth.sendTransaction(ur).then($t=>{console.log("txHash :>> ",$t),an(!1),tr($t.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:g?g.toLowerCase():Ot,token:vt,payment_tx:$t.transactionHash,payment_role:"farming_tools"})}),We(),St("extended")}).catch($t=>{console.log($t),$t.code===-32003||$t.message.includes("insufficient funds")?vn("Insufficient funds."):$t.message==="MetaMask Tx Signature: User denied transaction signature."&&qn(!1)})}else await wn.eth.requestAccounts()},gn=p;if(m.useMemo(()=>Array.from({length:I},(vt,Ot)=>({value:`Extended-${Ot+1}`,label:`Extended-${Ot+1}`})),[I]),!e)return null;const yn=lt||Nt||xn||Rt,hn=C&&!xn,br=S(tt);return i.jsxs(i.Fragment,{children:[i.jsx(fd,{open:Pn,setOpen:qn,transactionHash:nr,transactionLoading:Bt,paymentPresaleRole:Qt,errorFunds:kn,activeMethod:2}),i.jsx(d5,{open:he,setOpen:Y,paymentLighterRole:Qt,oldSlotCount:ne,checkAccountLighter:We,tradeMarket:"extended"}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!yn&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#F8D4AB] max-h-[97dvh] overflow-y-auto",children:[i.jsxs("div",{className:"pb-2 px-5 pt-3 border-b border-[#353535] rounded-t-3xl relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("img",{src:"https://app.extended.exchange/assets/logo/extended-long.svg",alt:"Extended",className:"h-[20px] text-white"}),i.jsx("span",{className:"text-[24px] font-semibold text-[#e87859]",children:"farming"})]}),i.jsxs("div",{className:"flex justify-between items-center gap-4",children:[i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2",children:"Extended Farming module lets you set up automated farming by providing your Extended Token, selecting a pair, defining orders per hour, leverage, direction and order type ."}),i.jsx("div",{className:"flex flex-col items- justify-start gap-1 relative",children:i.jsx("div",{className:"text-xs font-semibold text-[#7C7C7C] mt-2",children:i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/farm/extended-farming-module#getting-your-api-credentials","_blank"),className:"h-6 sm:h-7 w-max py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer border border-[#353535] px-4 bg-[#242424] hover:bg-[#2e2e2e]",children:[i.jsx("img",{src:s5,className:"w-[14px] h-[14px]"}),i.jsx("div",{className:"min-w-max text-white text-xs font-medium font-manrope leading-none pointer-events-none",children:"Docs"})]})})})]})]}),i.jsxs("div",{className:"pb-2 space-y-3 pt-2 px-5",children:[Mn&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:Mn}),v&&!Qt&&i.jsx("div",{className:"px-5",children:i.jsxs("div",{className:"flex flex-col items-center justify-start sm:flex-row sm:items-center sm:justify-between gap-2.5 rounded-[12px] border border-[#2A2A2A] bg-[#1f1f1f] px-3 py-2",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("img",{src:vc,alt:"",className:""}),i.jsx("span",{className:"text-[#FF797C] text-[12px] leading-4 font-manrope -mb-0.5",children:"You need an active subscription to start farming. Please complete your subscription first to unlock bot. Make sure you have sufficient Ethereum funds on the Ethereum Mainnet."})]}),i.jsx("div",{onClick:()=>{Kt()},className:"flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer min-w-max font-semibold",children:"Subscribe / 0.12 ETH"})]})}),i.jsxs("div",{className:"py-1 space-y-3 px-3 sm:px-5",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[G==="ON"?i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 1"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"1st Stark Key Public"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Re,onChange:vt=>Qe(vt.target.value),autoComplete:"off",placeholder:"1st Stark Key Public ",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Re===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:yn||hn})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/extended-farming-module#getting-your-api-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:ee,onChange:vt=>ae(vt.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:$n?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ee===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:yn||hn}),i.jsx("button",{type:"button",onClick:()=>Jn(vt=>!vt),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:yn||hn,children:$n?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ce,onChange:vt=>{const Ot=vt.target.value.trim();if(Ot==="")return ye("");T(Ot)&&ye(Ot)},onKeyDown:_,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ce===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:yn||hn})})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/extended-farming-module#getting-your-api-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:ee,onChange:vt=>ae(vt.target.value),autoComplete:"off",placeholder:"API_KEY",type:$n?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ee===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:yn||hn}),i.jsx("button",{type:"button",onClick:()=>Jn(vt=>!vt),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:yn||hn,children:$n?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stark Key Public"})}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:Re,onChange:vt=>Qe(vt.target.value),autoComplete:"off",placeholder:"STARK_KEY_PUBLIC",type:Nn?"text":"password",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Re===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:yn||hn}),i.jsx("button",{type:"button",onClick:()=>ln(vt=>!vt),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:yn||hn,children:Nn?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]})]}),G==="ON"&&i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 2"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"2nd Stark key Public"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Be,onChange:vt=>it(vt.target.value),autoComplete:"off",placeholder:"2nd Stark key Public",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Be===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:yn||hn})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key 2"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/extended-farming-module#getting-your-api-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:fe,onChange:vt=>Ae(vt.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY_2",type:Kn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${fe===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:yn||hn}),i.jsx("button",{type:"button",onClick:()=>Cn(vt=>!vt),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:yn||hn,children:Kn?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index 2"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:je,onChange:vt=>{const Ot=vt.target.value.trim();if(Ot==="")return Ie("");T(Ot)&&Ie(Ot)},onKeyDown:_,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX_2",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${je===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:yn||hn})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${G==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stark Key Private"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:ce,onChange:vt=>ye(vt.target.value),autoComplete:"off",placeholder:"STARK_KEY_PRIVATE",type:Oe?"text":"password",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ce===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:yn||hn}),i.jsx("button",{type:"button",onClick:()=>sn(vt=>!vt),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:yn||hn,children:Oe?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:`${G==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Vault Number"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:Ne,onChange:vt=>{const Ot=vt.target.value.trim();if(Ot==="")return be("");T(Ot)&&be(Ot)},onKeyDown:_,inputMode:"numeric",autoComplete:"off",placeholder:"VAULT_NUMBER",type:fn?"text":"password",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ne===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:yn||hn}),i.jsx("button",{type:"button",onClick:()=>Et(vt=>!vt),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:yn||hn,children:fn?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:`${G==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per Hour"}),i.jsx("input",{value:Ut,onChange:vt=>{const Ot=vt.target.value.trim();if(Ot==="")return kt("");T(Ot)&&kt(Ot)},onKeyDown:_,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ut===""?"border-[#353535]":B?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:yn||hn}),Ut!==""&&!B&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Zl,{styles:gt,components:{Option:Ge,SingleValue:et},isDisabled:yn||hn,options:gn,value:gn.find(vt=>vt.value===tt)||null,onChange:vt=>at((vt==null?void 0:vt.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:`${G==="ON"?"hidden":""} space-y-1`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per"}),i.jsxs("select",{value:Yn,onChange:vt=>Lt(vt.target.value),className:`${yn||hn?"cursor-not-allowed":"cursor-pointer"} h-6 text-[12px] bg-[#242424] border border-[#353535] rounded-md px-2 text-white outline-none font-bold font-manrope`,disabled:yn||hn,children:[i.jsx("option",{value:"Hour",children:"Hour"}),i.jsx("option",{value:"Day",children:"Day"})]})]}),i.jsx("input",{value:Ut,onChange:vt=>{const Ot=vt.target.value.trim();if(Ot==="")return kt("");T(Ot)&&kt(Ot)},onKeyDown:_,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ut===""?"border-[#353535]":B?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:yn||hn}),Ut!==""&&!B&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${G==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:G==="ON"?"On":"Off"}),i.jsx(Oo,{checked:G==="ON",onChange:vt=>V(vt?"ON":"OFF"),disabled:yn||hn,className:`${G==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${yn||hn?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out  ${G==="ON"?"translate-x-3":"translate-x-0"}`})})]})]}),i.jsxs("div",{className:" space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Leverage"}),i.jsx("input",{value:tn,onChange:vt=>{const Ot=vt.target.value.trim();if(Ot==="")return jt("");T(Ot)&&jt(Ot)},onKeyDown:_,inputMode:"numeric",autoComplete:"off",placeholder:tt?`1–${br}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${tn===""?"border-[#353535]":q?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:yn||hn})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${G==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-2 md:pr-6",children:[i.jsx("div",{"aria-pressed":un==="LONG",onClick:()=>!hn&&cn("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",yn||hn?"cursor-not-allowed":"cursor-pointer",un==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["LONG",tn?` - ${tn}x`:""]})}),i.jsx("div",{"aria-pressed":un==="SHORT",onClick:()=>!hn&&cn("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",yn||hn?"cursor-not-allowed":"cursor-pointer",un==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["SHORT",tn?` - ${tn}x`:""]})}),i.jsx("div",{"aria-pressed":un==="RANDOM",onClick:()=>!hn&&cn("RANDOM"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",yn||hn?"cursor-not-allowed":"cursor-pointer",un==="RANDOM"?"bg-[#3b82f6] text-[#ffffff] border-[#93c5fd] shadow-[0_0_0_3px_rgba(59,130,246,0.3)]":"text-[#3b82f6] bg-[rgba(59,130,246,0.15)] border-[rgba(59,130,246,0.15)] hover:bg-[#2563eb] hover:text-white"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["RANDOM",tn?` - ${tn}x`:""]})})]})]}),i.jsxs("div",{className:`${G==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"flex items-center gap-2 text-[13px] text-[#7C7C7C] font-semibold",children:i.jsx("span",{children:"Order Type"})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("button",{"aria-pressed":Ve==="MARKET",className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2","cursor-not-allowed",Ve==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:[i.jsxs("span",{children:["MARKET ",Ve==="MARKET"?" ✓":""]}),i.jsx("span",{className:"min-w-max text-[6px] -mt-[1px] text-[#FF9A3C]",children:"Coming Soon"})]}),i.jsx("button",{"aria-pressed":Ve==="LIMIT",onClick:()=>!hn&&Ke("LIMIT"),className:["inline-flex flex-col justify-center items-center h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",yn||hn?"cursor-not-allowed":"cursor-pointer",Ve==="LIMIT"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["LIMIT ",Ve==="LIMIT"?" ✓":""]})}),i.jsxs("button",{"aria-pressed":Ve==="RANDOM",className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2","cursor-not-allowed",Ve==="RANDOM"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:[i.jsxs("span",{children:["RANDOM ",Ve==="RANDOM"?" ✓":""]}),i.jsx("span",{className:"min-w-max text-[6px] -mt-[1px] text-[#FF9A3C]",children:"Coming Soon"})]})]})]})]}),i.jsxs("div",{className:`${G==="ON"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:[i.jsxs("div",{className:`${G==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Take Profit %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:ft,onChange:vt=>{const Ot=vt.target.value.trim();if(Ot==="")return en("");k(Ot)&&en(Ot)},onKeyDown:_,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ft===""?"border-[#353535]":te?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:yn||hn})]}),ft!==""&&!te&&i.jsx("div",{className:"text-[#FF797C] text-[11px]",children:"Value must be 0, or between 1 and 10000000. Numbers between 0 and 1 are not allowed."})]}),i.jsxs("div",{className:`${G==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stop Loss %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:Dt,onChange:vt=>{const Ot=vt.target.value.trim();if(Ot==="")return At("");k(Ot)&&At(Ot)},onKeyDown:_,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Dt===""?"border-[#353535]":ue?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:yn||hn})]}),Dt!==""&&!ue&&i.jsxs("div",{className:"text-[#FF797C] text-[11px]",children:["Value must be 0, or between 1 and"," ",tn?Math.max(tn*100-1,0):4999,". Numbers between 0 and 1 are not allowed."]})]})]}),!1]}),i.jsx("div",{className:`${G==="ON"?"py-3":"py-6"} flex items-center gap-3 px-5 border-t border-[#353535] bg-[rgba(27,27,27,0.32)] rounded-b-3xl`,children:i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!yn&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] hover:border-white disabled:opacity-60",disabled:yn,children:"Cancel"}),v?G==="ON"?C?i.jsx("button",{onClick:ot,disabled:yn,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:xn?"Stopping...":"Stop"}):i.jsx("button",{onClick:nt,disabled:!de||yn,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!de||yn?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Nt?"Starting...":"Start"}):C?i.jsx("button",{onClick:ot,disabled:yn,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:xn?"Stopping...":"Stop"}):i.jsx("button",{onClick:nt,disabled:!de||yn,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!de||yn?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:Nt?"Starting...":"Start"}):i.jsx("button",{onClick:()=>n(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})}),lt&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})},nMe=({className:e})=>i.jsx("svg",{class:"Logo___StyledParadexLogoText-qr0or9-1 jECvji",width:"128",viewBox:"0 0 836 114",version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("g",{id:"New-Logos",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd",children:i.jsx("g",{id:"Dark_1080x1080",transform:"translate(-122, -183)",fill:"white",children:i.jsxs("g",{id:"paradex-white",transform:"translate(122.2947, 183)",fill:"white",children:[i.jsx("path",{d:"M94.6678094,15.1179294 C93.2804251,13.1247857 91.6650668,11.27494 89.8477888,9.60095989 C83.3993829,3.66712376 74.5149126,0.00651354131 64.6729517,0.00651354131 L0,0.00651354131 L7.88789853,13.7370586 C9.6335276,16.7723689 12.8642441,18.6417552 16.3620158,18.6417552 L35.2903668,18.6417552 L64.6794652,18.6091875 C68.9393212,18.6091875 72.7823106,20.1919781 75.5570792,22.7648269 C78.3448749,25.3181351 80.0709633,28.8615015 80.0709633,32.7631128 C80.0709633,40.5858759 73.1861502,46.9300651 64.6794652,46.9300651 L55.3651011,46.8974974 L12.1347275,46.8974974 L20.022626,60.6280425 C21.7682551,63.6633528 24.9989715,65.5327391 28.4967432,65.5327391 L32.3267055,65.5327391 C33.9681179,65.5327391 35.2968804,66.8615015 35.2968804,68.502914 L35.2968804,114 L50.4669181,102.288653 C52.8639013,100.438807 54.2643126,97.5793624 54.2643126,94.5570792 L54.2643126,68.5094275 C54.2643126,66.8680151 55.5930751,65.5392527 57.2344875,65.5392527 L64.6794652,65.5392527 C78.8268769,65.5392527 91.0397669,57.9444635 96.7781968,46.9365787 C99.018855,42.6506685 100.275968,37.843675 100.275968,32.7696263 C100.275968,26.2691121 98.2176894,20.2245458 94.6743229,15.1309565 L94.6678094,15.1179294 Z",id:"Path"}),i.jsx("polygon",{id:"Vector","fill-rule":"nonzero",points:"835.410613 0.00651354131 811.890215 0.00651354131 789.933067 32.958519 767.975919 0.00651354131 744.455522 0.00651354131 778.176125 50.6037024 744.455522 101.207405 767.975919 101.207405 789.933067 68.2488858 811.890215 101.207405 835.410613 101.207405 801.690009 50.6037024"}),i.jsx("path",{d:"M633.673211,101.207405 L703.719834,101.207405 L703.719834,82.5786767 L633.673211,82.5786767 L633.673211,101.207405 Z M633.673211,18.6352417 L703.576536,18.6352417 L703.576536,0.00651354131 L633.673211,0.00651354131 L633.673211,18.6352417 L633.673211,18.6352417 Z M633.608076,59.9180665 L677.072937,59.9180665 L677.072937,41.2893384 L633.608076,41.2893384 L633.608076,59.9180665 Z",id:"Vector1"}),i.jsx("path",{d:"M595.712292,50.6037024 C595.712292,64.5882756 589.817537,77.2310593 580.281713,86.3825848 C570.745889,95.5471375 557.575508,101.207405 543.037284,101.207405 L515.185381,101.207405 L515.185381,82.5786767 L543.037284,82.5786767 C561.425011,82.5786767 576.32148,68.2619129 576.32148,50.6037024 C576.32148,41.7713404 572.595734,33.7857388 566.570709,27.9952005 C560.545683,22.2111759 552.227891,18.6287281 543.037284,18.6287281 L515.185381,18.6287281 L515.185381,0 L543.037284,0 C572.120246,0 595.712292,22.6475831 595.712292,50.6037024 Z",id:"Vector2","fill-rule":"nonzero"}),i.jsx("polygon",{id:"Vector3","fill-rule":"nonzero",points:"475.394157 101.200891 437.394157 0.00651354131 413.945409 0.00651354131 413.951922 0.00651354131 413.919354 0.00651354131 375.919354 101.207405 399.36159 101.207405 425.656756 31.1868358 451.951922 101.200891"}),i.jsx("path",{d:"M312.868275,63.943435 L338.017058,101.207405 L314.197037,101.207405 L290.136015,65.5262256 L257.483633,65.5262256 L257.483633,46.9300651 L301.684524,46.9300651 C310.360561,46.9300651 317.388672,40.5793624 317.388672,32.7565992 C317.388672,28.854988 315.643043,25.3181351 312.796626,22.7713404 C309.963235,20.1919781 306.042083,18.6091875 301.691038,18.6091875 L257.490146,18.6091875 L257.490146,0.0130270826 L301.691038,0.0130270826 C311.741432,0.0130270826 320.801768,3.68015084 327.386958,9.61398697 C329.23029,11.2814535 330.878216,13.1378128 332.298168,15.1244429 C335.919697,20.2245458 338.023571,26.2691121 338.023571,32.7565992 C338.023571,37.8371615 336.73389,42.6311279 334.447637,46.9300651 C330.181267,54.9482345 322.397585,61.17518 312.874788,63.943435 L312.868275,63.943435 Z",id:"Vector4","fill-rule":"nonzero"}),i.jsx("polygon",{id:"Vector5","fill-rule":"nonzero",points:"217.698922 101.200891 179.698922 0.00651354131 156.256687 0.00651354131 156.256687 0.00651354131 156.22412 0.00651354131 118.22412 101.207405 141.666355 101.207405 167.961521 31.1868358 194.256687 101.200891"})]})})})}),Woe=({open:e=!1,setOpen:t=()=>{}})=>{var ot,gt,Jt;const{setSignModalOpen:n,setTelegramChatId:r,setSubscriberRole:s,setSubsExpireDay:a,setMushboomerETH:o,setMushboomerSOL:l,setIsReferralCode:c,setIsReferralCodeName:u,setIsWhitelist:d,setHyperToken:f,setHyperAddress:x}=m.useContext(Gr);Yr();const[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,I]=m.useState(1),[P,R]=m.useState(0),[F,U]=m.useState(0),[L,z]=m.useState({}),[X,ne]=m.useState(null),[J,Z]=m.useState("paradex");m.useState(!1),m.useRef(null);const[re,he]=m.useState(!1),[Y,ie]=m.useState(""),[oe,G]=m.useState("OFF"),[V,ee]=m.useState(""),[ae,fe]=m.useState(""),[Ae,ce]=m.useState("");m.useState("");const[ye,Ne]=m.useState(""),[be,je]=m.useState(""),[Ie,Re]=m.useState(""),[Qe,Be]=m.useState(""),[it,tt]=m.useState([]),[at,dt]=m.useState(""),[ct,Ut]=m.useState(""),[kt,tn]=m.useState("LONG"),[jt,un]=m.useState("MARKET"),[cn,Pt]=m.useState(""),[Xe,Vt]=m.useState(""),[Yt,Ve]=m.useState(""),[Ke,ft]=m.useState(!1),[en,Dt]=m.useState(!1),[At,Je]=m.useState(!1),[He,Rt]=m.useState(!1),[qe,lt]=m.useState(""),[xt,Nt]=m.useState(""),[It,xn]=m.useState(!0),[dn,Mn]=m.useState(!1),[_n,kn]=m.useState(!1),[vn,Qn]=m.useState(!1),[Hn,$n]=m.useState(!1),[Jn,Nn]=m.useState(""),[ln,Oe]=m.useState(!0),[sn,fn]=m.useState("Hour"),Et="https://dextrabothypev2.nftinit.io",Kn="";m.useEffect(()=>{async function Ge(){if(e)try{const We=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=paradex")).json();if(We!=null&&We.coins){const wt=[...We.coins].sort((Kt,gn)=>(gn.maxLeverage||0)-(Kt.maxLeverage||0)),St=wt==null?void 0:wt.map(Kt=>{const hn=`https://app.paradex.trade/static/market/${(Kt==null?void 0:Kt.label)||""}.svg`;return{...Kt,icon:hn}});tt(St)}}catch(et){console.error("Failed to fetch coin list:",et)}}Ge()},[e]);const Cn=Ge=>{var et;return((et=it.find(We=>We.value===Ge))==null?void 0:et.maxLeverage)??100},Bt=Ge=>{["e","E","+","-"].includes(Ge.key)&&Ge.preventDefault()},an=Ge=>/^\d*\.?\d{0,6}$/.test(Ge),Pn=Ge=>/^\d*$/.test(Ge),qn=m.useMemo(()=>{if(at==="")return!1;const Ge=Number(at);return Number.isInteger(Ge)&&Ge>=1&&Ge<=180},[at]),nr=m.useMemo(()=>{if(ct==="")return!1;const Ge=Number(ct),et=Cn(Qe);return Number.isInteger(Ge)&&Ge>=1&&Ge<=et},[ct,Qe,it]),tr=m.useMemo(()=>{if(cn==="")return!1;const Ge=Number(cn);return Number.isNaN(Ge)?!1:Ge===0?!0:Ge>=1&&Ge<=1e7},[cn]),Qt=m.useMemo(()=>{if(Xe==="")return!1;const Ge=Number(Xe);if(Number.isNaN(Ge))return!1;const et=ct===""?null:Number(ct),We=et?et*100-1:4999;return Ge===0?!0:Ge>0&&Ge<1?!1:Ge>=1&&Ge<=We},[Xe,ct]);m.useMemo(()=>{if(Yt==="")return!1;const Ge=Number(Yt);return!Number.isNaN(Ge)&&Ge>0&&Ge<=100},[Yt]);const zn=g&&V.trim()!==""&&be.trim()!==""&&Qe!==""&&qn&&nr&&(!cn||tr)&&(!Xe||Qt)&&(kt==="LONG"||kt==="SHORT"||kt==="RANDOM")&&(jt==="LIMIT"||jt==="MARKET"||jt==="RANDOM")&&ln,Yn=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),Lt=()=>`paradexCreds:${Yn()}`,Fn=()=>{try{const Ge=localStorage.getItem(Lt());if(!Ge)return;const et=JSON.parse(Ge);et.privateKey&&ee(et.privateKey),et.paradexAddress&&je(et.paradexAddress),typeof et.remember=="boolean"&&xn(et.remember)}catch{}},Ee=()=>{if(It)try{localStorage.setItem(Lt(),JSON.stringify({privateKey:V,paradexAddress:be,remember:!0}))}catch{}},p=()=>{try{localStorage.removeItem(Lt())}catch{}};m.useEffect(()=>{if(!e)return;const Ge=localStorage.getItem("hyperToken"),et=localStorage.getItem("hyperAddress");v(!!(Ge&&et));const We=setInterval(()=>{const wt=localStorage.getItem("hyperToken"),St=localStorage.getItem("hyperAddress");v(!!(wt&&St))},800);return()=>clearInterval(We)},[e]),m.useEffect(()=>{!e||!g||(h(),se())},[e,g]),m.useEffect(()=>{e&&(Xe===""&&Vt(Kn),cn===""&&Pt(Kn),Yt===""&&Ve(Kn))},[e]),m.useEffect(()=>{if(!Qe)return;const Ge=Cn(Qe),et=Number(ct);!Number.isNaN(et)&&et>Ge&&Ut(String(Ge)),!Number.isNaN(et)&&et<1&&ct!==""&&Ut("1")},[Qe]),m.useEffect(()=>{e&&(It&&Ee(),It||p())},[V,be,It,e]);async function h(){var Ge,et,We,wt,St,Kt,gn,yn;try{Dt(!0),lt("");const hn=window.localStorage.getItem("hyperToken"),br=window.localStorage.getItem("hyperAddress");if(!hn||!br){C(!1),Fn();return}const Wt=await(await fetch(`${Et}/api/hyper/new_farming_app/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:br.toLowerCase(),token:hn})})).json();if(!(Wt!=null&&Wt.success)){if(console.warn("INFO API RESPONSE:",Wt==null?void 0:Wt.error_message),(Wt==null?void 0:Wt.error_message)==="You have not a running process"){const Zt=Y?Y.toLowerCase().replace("-","_"):null,vt=L==null?void 0:L[Zt];if(Zt&&vt){const Ot={...L,[Zt]:{...vt,isStop:!0}};z(Ot);const Gn=Object.keys(Ot).filter(fr=>fr.startsWith("paradex"));if(Gn.length>0&&!Y){const $t=Gn.sort((nn,Vn)=>{var gr,dr;const lr=parseInt(((gr=nn.match(/\d+/))==null?void 0:gr[0])||0,10),er=parseInt(((dr=Vn.match(/\d+/))==null?void 0:dr[0])||0,10);return lr-er})[0].match(/\d+/);$t&&ie(`Paradex-${$t[0]}`)}}else ie("Paradex-1")}Wt!=null&&Wt.slots_info&&(U((et=(Ge=Wt==null?void 0:Wt.slots_info)==null?void 0:Ge.paradex)==null?void 0:et.total_qty),R((wt=(We=Wt==null?void 0:Wt.slots_info)==null?void 0:We.paradex)==null?void 0:wt.active_qty));return}if(Wt!=null&&Wt.success&&(Wt!=null&&Wt.data)){const Zt=Y?Y.toLowerCase().replace("-","_"):null,vt=L==null?void 0:L[Zt],Ot=Wt.data||{};Zt&&!Ot[Zt]&&vt&&(Ot[Zt]={...vt,isStop:!0}),z(Ot);const Gn=Object.keys(Ot).filter(fr=>fr.startsWith("paradex"));if(Gn.length>0&&!Y){const $t=Gn.sort((nn,Vn)=>{var gr,dr;const lr=parseInt(((gr=nn.match(/\d+/))==null?void 0:gr[0])||0,10),er=parseInt(((dr=Vn.match(/\d+/))==null?void 0:dr[0])||0,10);return lr-er})[0].match(/\d+/);$t&&ie(`Paradex-${$t[0]}`)}Wt!=null&&Wt.slots_info&&(U((Kt=(St=Wt==null?void 0:Wt.slots_info)==null?void 0:St.paradex)==null?void 0:Kt.total_qty),R((yn=(gn=Wt==null?void 0:Wt.slots_info)==null?void 0:gn.paradex)==null?void 0:yn.active_qty))}}catch{C(!1),Fn(),G("OFF")}finally{Dt(!1)}}const S=m.useMemo(()=>Y?Y.toLowerCase().replace("-","_"):"",[Y]),_=!!((ot=L==null?void 0:L[S])!=null&&ot.delta)&&!!((gt=L==null?void 0:L[S])!=null&&gt.from_slot),k=_?`paradex_${(Jt=L==null?void 0:L[S])==null?void 0:Jt.from_slot}`:S;m.useEffect(()=>{var We,wt,St,Kt,gn,yn,hn,br,pt,Wt;if(!Y||!L)return;const Ge=k,et=L==null?void 0:L[Ge];if(!et){ee(""),je(""),Be(""),dt(""),Ut(""),tn("LONG"),un("LIMIT"),C(!1),G("OFF"),fn("Hour"),Pt(""),Vt(""),Z("paradex");return}if((et==null?void 0:et.target_params)==null&&et.source_params){et!=null&&et.isStop?C(!1):C(!0),G("OFF");const Zt=et.source_params,vt=(et==null?void 0:et.slot_number)??"";vt&&!_&&ie(`Paradex-${vt}`),Zt!=null&&Zt.cycleSeconds&&fn((Zt==null?void 0:Zt.cycleSeconds)===86400?"Day":"Hour");const Ot=(Zt==null?void 0:Zt.paradex_pkey)??"",wn=(Zt==null?void 0:Zt.paradex_address)??"";if(Ot&&ee(String(Ot)),wn&&je(String(wn)),Zt!=null&&Zt.coin){const Gn=String(Zt.coin).replace(/-USD$/,"");Be(Gn)}(Zt==null?void 0:Zt.orderPerHour)!=null&&dt(String(Zt.orderPerHour)),(Zt==null?void 0:Zt.leverage)!=null&&Ut(String(Zt.leverage)),Zt!=null&&Zt.direction&&tn(String(Zt.direction).toUpperCase()==="SHORT"?"SHORT":String(Zt.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG"),Zt!=null&&Zt.orderType&&un(String(Zt.orderType).toUpperCase()==="MARKET"?"MARKET":String(Zt.orderType).toUpperCase()==="LIMIT"?"LIMIT":"RANDOM"),(Zt==null?void 0:Zt.tp)!=null&&Pt(String(Zt.tp)),(Zt==null?void 0:Zt.sl)!=null&&Vt(String(Zt.sl))}else if((et==null?void 0:et.target_params)!==null){et!=null&&et.isStop?C(!1):C(!0),G("OFF");const Zt=(et==null?void 0:et.slot_number)??"";Zt&&!_&&ie(`Paradex-${Zt}`),(We=et==null?void 0:et.source_params)!=null&&We.coin&&Be(String((wt=et==null?void 0:et.source_params)==null?void 0:wt.coin)),((St=et==null?void 0:et.source_params)==null?void 0:St.orderPerHour)!=null&&dt(String((Kt=et==null?void 0:et.source_params)==null?void 0:Kt.orderPerHour)),((gn=et==null?void 0:et.source_params)==null?void 0:gn.leverage)!=null&&Ut(String((yn=et==null?void 0:et.source_params)==null?void 0:yn.leverage)),(hn=et==null?void 0:et.source_params)!=null&&hn.accountType&&setStatusType(((br=et==null?void 0:et.source_params)==null?void 0:br.accountType)==="standart"?"STANDARD":"PREMIUM"),(pt=et==null?void 0:et.target_params)!=null&&pt.accountType&&setStatusTypeTwo(((Wt=et==null?void 0:et.target_params)==null?void 0:Wt.accountType)==="standart"?"STANDARD":"PREMIUM"),et!=null&&et.target_app&&Z(((et==null?void 0:et.target_app)==="paradex","paradex"))}else C(!1),G("OFF")},[Y,L,_,k]);const T=Ge=>{var et;return Number(((et=String(Ge||"").match(/\d+/))==null?void 0:et[0])||0)},B=Ge=>(Ge||"").toLowerCase().replace("-","_"),q=m.useMemo(()=>{const Ge=L==null?void 0:L[B(Y)];if(Ge!=null&&Ge.delta&&(Ge!=null&&Ge.from_slot))return Number(Ge.from_slot);const et=Number(Ge==null?void 0:Ge.slot_number);return Number.isFinite(et)?et:T(Y)},[Y,L]),te=m.useMemo(()=>{const Ge=Number(N)||0,et=Array.from({length:Ge},()=>({used:!1,kind:null})),We=L||{};for(const[wt,St]of Object.entries(We)){if(!wt.startsWith("paradex"))continue;const Kt=T(wt)-1;Kt<0||Kt>=Ge||((St==null?void 0:St.isStop)===!0?et[Kt]={used:!1,kind:null}:St!=null&&St.source_params?et[Kt]={used:!0,kind:"delta-src"}:St!=null&&St.target_params||St!=null&&St.delta?et[Kt]={used:!0,kind:"delta-shadow"}:St!=null&&St.farming_params?et[Kt]={used:!0,kind:"single"}:et[Kt]={used:!0,kind:"unknown"})}return et},[L,N]),ue=m.useMemo(()=>te.map((Ge,et)=>Ge.used&&Ge.kind!=="delta-src-inferred"?`Paradex-${et+1}`:null).filter(Boolean),[te]);m.useMemo(()=>te.filter(Ge=>!Ge.used).length,[te]);async function de(){if(!g){n(!0);return}if(zn)try{Je(!0),lt("");const Ge=window.localStorage.getItem("hyperToken"),et=window.localStorage.getItem("hyperAddress");if(!Ge||!et){n(!0);return}const We={paradex_address:be,paradex_pkey:V,cycleSeconds:sn==="Hour"?3600:86400,tp:Number(cn),sl:Number(Xe),coin:`${Qe}`,orderPerHour:Number(at),leverage:Number(ct),direction:kt,orderType:jt},wt={api_pkey:ae,login_wallet:Ie,coin:Qe==null?void 0:Qe.replace("USDT",""),orderPerHour:Number(at),leverage:Number(ct)},St={address:et.toLowerCase(),token:Ge,slot_number:Number(Y==null?void 0:Y.replace("Paradex-","")),source_app:"paradex",source_params:We},gn=await(await fetch(`${Et}/api/hyper/farming_app/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(St)})).json();gn!=null&&gn.success?(C(!0),h(),It&&Ee()):lt((gn==null?void 0:gn.error_message)||"Start failed.")}catch(Ge){lt(Ge.message||"An error occurred while saving.")}finally{Je(!1)}}async function xe(){if(!g){n(!0);return}try{Rt(!0),lt("");const Ge=window.localStorage.getItem("hyperToken"),et=window.localStorage.getItem("hyperAddress");if(!Ge||!et){n(!0);return}const wt=await(await fetch(`${Et}/api/hyper/farming_app/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:et.toLowerCase(),token:Ge,source_app:"paradex",slot_number:q})})).json();wt!=null&&wt.success?(C(!1),h()):lt((wt==null?void 0:wt.error_message)||"Stop failed.")}catch(Ge){lt(Ge.message||"An error occurred while stopping.")}finally{Rt(!1)}}const we={control:(Ge,et)=>({...Ge,backgroundColor:"#242424",borderColor:et.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:Ge=>({...Ge,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:Ge=>({...Ge,height:32}),input:Ge=>({...Ge,color:"#FFFFFF",margin:0,padding:0}),singleValue:Ge=>({...Ge,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:Ge=>({...Ge,color:"#7F7F7F",fontSize:"12px"}),menu:Ge=>({...Ge,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:Ge=>({...Ge,paddingTop:0,paddingBottom:0,maxHeight:200}),option:(Ge,et)=>({...Ge,backgroundColor:et.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:Ge=>({...Ge,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:Ge=>({...Ge,backgroundColor:"#353535"})},ke=({max:Ge})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[Ge,"x"]}),Me=Ge=>{var et;return i.jsx($a.Option,{...Ge,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(et=Ge.data)!=null&&et.icon?i.jsx("img",{src:Ge.data.icon,alt:Ge.data.label,className:"w-4 h-4 rounded-[4px]",onError:We=>We.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:Ge.data.label}),i.jsx(ke,{max:Ge.data.maxLeverage})]})})},Ye=Ge=>{var et;return i.jsx($a.SingleValue,{...Ge,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(et=Ge.data)!=null&&et.icon?i.jsx("img",{src:Ge.data.icon,alt:Ge.data.label,className:"w-4 h-4 rounded-[4px]",onError:We=>We.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:Ge.data.label}),i.jsx(ke,{max:Ge.data.maxLeverage})]})})},Fe=Ge=>{const et=ue.includes(Ge.data.value);return i.jsx($a.Option,{...Ge,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[i.jsx("span",{className:"text-white text-[13px]",children:Ge.data.label}),et&&i.jsx("span",{className:"ml-auto w-2 h-2 rounded-full bg-[#67FFBD]",title:"Active"})]})})},rt=Ge=>i.jsx($a.SingleValue,{...Ge,children:i.jsx("div",{className:"flex items-center gap-2 px-3",children:i.jsx("span",{className:"text-white text-[13px]",children:Ge.data.label})})}),se=async()=>{var We,wt,St,Kt,gn,yn,hn,br;const Ge=window.localStorage.getItem("hyperToken"),et=window.localStorage.getItem("hyperAddress");if(!(!Ge||!et))try{ft(!0);const pt=await Si(et.toLowerCase(),Ge);pt!=null&&pt.success?(r(pt==null?void 0:pt.telegram_chat_id),s(pt==null?void 0:pt.subscriber_role),a(pt==null?void 0:pt.subs_expire_day),o((We=pt==null?void 0:pt.mushboomer_counts)==null?void 0:We.eth),l((wt=pt==null?void 0:pt.mushboomer_counts)==null?void 0:wt.sol),c(pt==null?void 0:pt.referral_code),u(pt==null?void 0:pt.refcode),d(pt==null?void 0:pt.whitelist),f(Ge),x(et),Oe(!0),I((Kt=(St=pt==null?void 0:pt.slots_info)==null?void 0:St.paradex)==null?void 0:Kt.total_qty),U((yn=(gn=pt==null?void 0:pt.slots_info)==null?void 0:gn.paradex)==null?void 0:yn.total_qty),R((br=(hn=pt==null?void 0:pt.slots_info)==null?void 0:hn.paradex)==null?void 0:br.active_qty),ft(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),ft(!1))}catch(pt){console.error("Token verification error:",pt),console.error(pt.message||"An unknown error occurred."),ft(!1)}},Ce=it,De=m.useMemo(()=>Array.from({length:N},(Ge,et)=>({value:`Paradex-${et+1}`,label:`Paradex-${et+1}`})),[N]);if(!e)return null;const Le=en||At||He||Ke,_e=w&&!He,nt=Cn(Qe);return i.jsxs(i.Fragment,{children:[i.jsx(fd,{open:Hn,setOpen:$n,transactionHash:Jn,transactionLoading:vn,paymentPresaleRole:ln,errorFunds:xt,activeMethod:2}),i.jsx(d5,{open:re,setOpen:he,paymentLighterRole:ln,oldSlotCount:X,checkAccountLighter:se,tradeMarket:"paradex"}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!Le&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#F8D4AB] max-h-[97dvh] overflow-y-auto",children:[i.jsxs("div",{className:"pb-2 px-5 pt-3 border-b border-[#353535] rounded-t-3xl relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-3",children:[i.jsx(nMe,{className:"text-white"}),i.jsx("span",{className:"text-[24px] font-semibold text-[#e87859] -mt-1",children:"farming"})]}),i.jsxs("div",{className:"flex justify-between items-center gap-4",children:[i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2",children:"Paradex Farming module lets you set up automated farming by providing your Paradex Address, Paradex Private Key, selecting a pair, defining trade per hour, leverage, direction, order type, take profit and stop loss."}),i.jsx("div",{className:"flex flex-col items- justify-start gap-1 relative",children:i.jsx("div",{className:"text-xs font-semibold text-[#7C7C7C] mt-2",children:i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/farm/paradex-farming-module#getting-your-paradex-credentials","_blank"),className:"h-6 sm:h-7 w-max py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer border border-[#353535] px-4 bg-[#242424] hover:bg-[#2e2e2e]",children:[i.jsx("img",{src:s5,className:"w-[14px] h-[14px]"}),i.jsx("div",{className:"min-w-max text-white text-xs font-medium font-manrope leading-none pointer-events-none",children:"Docs"})]})})})]})]}),i.jsxs("div",{className:"pb-2 space-y-3 pt-2 px-5",children:[qe&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:qe}),g&&ln&&F===P&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:"No free Paradex slots."}),g&&ln&&i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 px-4 sm:px-5",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-[13px] text-[#7C7C7C] font-semibold",children:[i.jsx("span",{className:"pl-[2px]",children:"Slot"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(iA,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[P||0,"/",De.length]})]})]}),i.jsx(Zl,{styles:we,components:{Option:Fe,SingleValue:rt},options:De,value:De.find(Ge=>Ge.value===Y)||null,onChange:Ge=>ie((Ge==null?void 0:Ge.value)??""),placeholder:"Select",isSearchable:!0})]})}),i.jsxs("div",{className:`${oe==="ON"?"py-1":"py-5"} space-y-3 px-3 sm:px-5`,children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[oe==="ON"?i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 1"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"1st Stark Key Public"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:be,onChange:Ge=>je(Ge.target.value),autoComplete:"off",placeholder:"1st Stark Key Public ",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${be===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/paradex-farming-module#getting-your-paradex-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:V,onChange:Ge=>ee(Ge.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:dn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${V===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e}),i.jsx("button",{type:"button",onClick:()=>Mn(Ge=>!Ge),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Le||_e,children:dn?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Ae,onChange:Ge=>{const et=Ge.target.value.trim();if(et==="")return ce("");Pn(et)&&ce(et)},onKeyDown:Bt,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ae===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e})})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Paradex Adress"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:be,onChange:Ge=>je(Ge.target.value),autoComplete:"off",placeholder:"PARADEX_ADDRESS",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${be===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/paradex-farming-module#getting-your-paradex-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get Paradex Private Key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:V,onChange:Ge=>ee(Ge.target.value),autoComplete:"off",placeholder:"PARADEX_PRIVATE_KEY",type:dn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${V===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e}),i.jsx("button",{type:"button",onClick:()=>Mn(Ge=>!Ge),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Le||_e,children:dn?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]})]}),oe==="ON"&&i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 2"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"2nd Stark key Public"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Ie,onChange:Ge=>Re(Ge.target.value),autoComplete:"off",placeholder:"2nd Stark key Public",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ie===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key 2"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/paradex-farming-module#getting-your-paradex-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:ae,onChange:Ge=>fe(Ge.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY_2",type:_n?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ae===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e}),i.jsx("button",{type:"button",onClick:()=>kn(Ge=>!Ge),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Le||_e,children:_n?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index 2"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ye,onChange:Ge=>{const et=Ge.target.value.trim();if(et==="")return Ne("");Pn(et)&&Ne(et)},onKeyDown:Bt,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX_2",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ye===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e})})]})]})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:i.jsxs("div",{className:`${oe==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per Hour"}),i.jsx("input",{value:at,onChange:Ge=>{const et=Ge.target.value.trim();if(et==="")return dt("");Pn(et)&&dt(et)},onKeyDown:Bt,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${at===""?"border-[#353535]":qn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Le||_e}),at!==""&&!qn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Zl,{styles:we,components:{Option:Me,SingleValue:Ye},isDisabled:Le||_e,options:Ce,value:Ce.find(Ge=>Ge.value===Qe)||null,onChange:Ge=>Be((Ge==null?void 0:Ge.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-1`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per"}),i.jsxs("select",{value:sn,onChange:Ge=>fn(Ge.target.value),className:`${Le||_e?"cursor-not-allowed":"cursor-pointer"} h-6 text-[12px] bg-[#242424] border border-[#353535] rounded-md px-2 text-white outline-none font-bold font-manrope`,disabled:Le||_e,children:[i.jsx("option",{value:"Hour",children:"Hour"}),i.jsx("option",{value:"Day",children:"Day"})]})]}),i.jsx("input",{value:at,onChange:Ge=>{const et=Ge.target.value.trim();if(et==="")return dt("");Pn(et)&&dt(et)},onKeyDown:Bt,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${at===""?"border-[#353535]":qn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Le||_e}),at!==""&&!qn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:oe==="ON"?"On":"Off"}),i.jsx(Oo,{checked:oe==="ON",onChange:Ge=>G(Ge?"ON":"OFF"),disabled:Le||_e,className:`${oe==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${Le||_e?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out  ${oe==="ON"?"translate-x-3":"translate-x-0"}`})})]})]}),i.jsxs("div",{className:" space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Leverage"}),i.jsx("input",{value:ct,onChange:Ge=>{const et=Ge.target.value.trim();if(et==="")return Ut("");Pn(et)&&Ut(et)},onKeyDown:Bt,inputMode:"numeric",autoComplete:"off",placeholder:Qe?`1–${nt}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ct===""?"border-[#353535]":nr?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Le||_e})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-2 md:pr-6",children:[i.jsx("div",{"aria-pressed":kt==="LONG",onClick:()=>!_e&&tn("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Le||_e?"cursor-not-allowed":"cursor-pointer",kt==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["LONG",ct?` - ${ct}x`:""]})}),i.jsx("div",{"aria-pressed":kt==="SHORT",onClick:()=>!_e&&tn("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Le||_e?"cursor-not-allowed":"cursor-pointer",kt==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["SHORT",ct?` - ${ct}x`:""]})}),i.jsx("div",{"aria-pressed":kt==="RANDOM",onClick:()=>!_e&&tn("RANDOM"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Le||_e?"cursor-not-allowed":"cursor-pointer",kt==="RANDOM"?"bg-[#3b82f6] text-[#ffffff] border-[#93c5fd] shadow-[0_0_0_3px_rgba(59,130,246,0.3)]":"text-[#3b82f6] bg-[rgba(59,130,246,0.15)] border-[rgba(59,130,246,0.15)] hover:bg-[#2563eb] hover:text-white"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["RANDOM",ct?` - ${ct}x`:""]})})]})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"flex items-center gap-2 text-[13px] text-[#7C7C7C] font-semibold",children:i.jsx("span",{children:"Order Type"})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{"aria-pressed":jt==="MARKET",onClick:()=>!_e&&un("MARKET"),className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",Le||_e?"cursor-not-allowed":"cursor-pointer",jt==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["MARKET ",jt==="MARKET"?" ✓":""]})}),i.jsx("button",{"aria-pressed":jt==="LIMIT",onClick:()=>!_e&&un("LIMIT"),className:["inline-flex flex-col justify-center items-center h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",Le||_e?"cursor-not-allowed":"cursor-pointer",jt==="LIMIT"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["LIMIT ",jt==="LIMIT"?" ✓":""]})}),i.jsx("button",{"aria-pressed":jt==="RANDOM",onClick:()=>!_e&&un("RANDOM"),className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",Le||_e?"cursor-not-allowed":"cursor-pointer",jt==="RANDOM"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["RANDOM ",jt==="RANDOM"?" ✓":""]})})]})]})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Take Profit %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:cn,onChange:Ge=>{const et=Ge.target.value.trim();if(et==="")return Pt("");an(et)&&Pt(et)},onKeyDown:Bt,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${cn===""?"border-[#353535]":tr?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Le||_e})]}),cn!==""&&!tr&&i.jsx("div",{className:"text-[#FF797C] text-[11px]",children:"Value must be 0, or between 1 and 10000000. Numbers between 0 and 1 are not allowed."})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stop Loss %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:Xe,onChange:Ge=>{const et=Ge.target.value.trim();if(et==="")return Vt("");an(et)&&Vt(et)},onKeyDown:Bt,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Xe===""?"border-[#353535]":Qt?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Le||_e})]}),Xe!==""&&!Qt&&i.jsxs("div",{className:"text-[#FF797C] text-[11px]",children:["Value must be 0, or between 1 and"," ",ct?Math.max(ct*100-1,0):4999,". Numbers between 0 and 1 are not allowed."]})]})]}),!1]}),i.jsx("div",{className:`${oe==="ON"?"py-3":"py-6"} flex items-center gap-3 px-5 border-t border-[#353535] bg-[rgba(27,27,27,0.32)] rounded-b-3xl`,children:i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!Le&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] hover:border-white disabled:opacity-60",disabled:Le,children:"Cancel"}),g?oe==="ON"?w?i.jsx("button",{onClick:xe,disabled:Le,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:He?"Stopping...":"Stop"}):i.jsx("button",{onClick:de,disabled:!zn||Le,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!zn||Le?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:At?"Starting...":"Start"}):w?i.jsx("button",{onClick:xe,disabled:Le,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:He?"Stopping...":"Stop"}):i.jsx("button",{onClick:de,disabled:!zn||Le,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!zn||Le?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:At?"Starting...":"Start"}):i.jsx("button",{onClick:()=>n(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})}),en&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})},qoe=({open:e=!1,setOpen:t=()=>{}})=>{var ot,gt,Jt;const{setSignModalOpen:n,setTelegramChatId:r,setSubscriberRole:s,setSubsExpireDay:a,setMushboomerETH:o,setMushboomerSOL:l,setIsReferralCode:c,setIsReferralCodeName:u,setIsWhitelist:d,setHyperToken:f,setHyperAddress:x}=m.useContext(Gr);Yr();const[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,I]=m.useState(1),[P,R]=m.useState(0),[F,U]=m.useState(0),[L,z]=m.useState({}),[X,ne]=m.useState(null),[J,Z]=m.useState("pacifica");m.useState(!1),m.useRef(null);const[re,he]=m.useState(!1),[Y,ie]=m.useState(""),[oe,G]=m.useState("OFF"),[V,ee]=m.useState(""),[ae,fe]=m.useState(""),[Ae,ce]=m.useState("");m.useState("");const[ye,Ne]=m.useState(""),[be,je]=m.useState(""),[Ie,Re]=m.useState(""),[Qe,Be]=m.useState(""),[it,tt]=m.useState([]),[at,dt]=m.useState(""),[ct,Ut]=m.useState(""),[kt,tn]=m.useState("LONG"),[jt,un]=m.useState("MARKET"),[cn,Pt]=m.useState(""),[Xe,Vt]=m.useState(""),[Yt,Ve]=m.useState(""),[Ke,ft]=m.useState(!1),[en,Dt]=m.useState(!1),[At,Je]=m.useState(!1),[He,Rt]=m.useState(!1),[qe,lt]=m.useState(""),[xt,Nt]=m.useState(""),[It,xn]=m.useState(!0),[dn,Mn]=m.useState(!1),[_n,kn]=m.useState(!1),[vn,Qn]=m.useState(!1),[Hn,$n]=m.useState(!1),[Jn,Nn]=m.useState(""),[ln,Oe]=m.useState(!0),[sn,fn]=m.useState("Hour"),Et="https://dextrabothypev2.nftinit.io",Kn="";m.useEffect(()=>{async function Ge(){if(e)try{const We=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=pacifica")).json();if(We!=null&&We.coins){let wt=We.coins.map(St=>{const yn=`https://app.pacifica.fi/imgs/tokens/${(St==null?void 0:St.label)||""}.svg`;return{...St,icon:yn}});tt(wt)}}catch(et){console.error("Failed to fetch coin list:",et)}}Ge()},[e]);const Cn=Ge=>{var et;return((et=it.find(We=>We.value===Ge))==null?void 0:et.maxLeverage)??100},Bt=Ge=>{["e","E","+","-"].includes(Ge.key)&&Ge.preventDefault()},an=Ge=>/^\d*\.?\d{0,6}$/.test(Ge),Pn=Ge=>/^\d*$/.test(Ge),qn=m.useMemo(()=>{if(at==="")return!1;const Ge=Number(at);return Number.isInteger(Ge)&&Ge>=1&&Ge<=180},[at]),nr=m.useMemo(()=>{if(ct==="")return!1;const Ge=Number(ct),et=Cn(Qe);return Number.isInteger(Ge)&&Ge>=1&&Ge<=et},[ct,Qe,it]),tr=m.useMemo(()=>{if(cn==="")return!1;const Ge=Number(cn);return Number.isNaN(Ge)?!1:Ge===0?!0:Ge>=1&&Ge<=1e7},[cn]),Qt=m.useMemo(()=>{if(Xe==="")return!1;const Ge=Number(Xe);if(Number.isNaN(Ge))return!1;const et=ct===""?null:Number(ct),We=et?et*100-1:4999;return Ge===0?!0:Ge>0&&Ge<1?!1:Ge>=1&&Ge<=We},[Xe,ct]);m.useMemo(()=>{if(Yt==="")return!1;const Ge=Number(Yt);return!Number.isNaN(Ge)&&Ge>0&&Ge<=100},[Yt]);const zn=g&&V.trim()!==""&&be.trim()!==""&&Qe!==""&&qn&&nr&&Y&&(!cn||tr)&&(!Xe||Qt)&&(kt==="LONG"||kt==="SHORT"||kt==="RANDOM")&&(jt==="LIMIT"||jt==="MARKET"||jt==="RANDOM")&&ln,Yn=()=>(localStorage.getItem("hyperAddress")||"dextra").toLowerCase(),Lt=()=>`pacificaCreds:${Yn()}`,Fn=()=>{try{const Ge=localStorage.getItem(Lt());if(!Ge)return;const et=JSON.parse(Ge);et.privateKey&&ee(et.privateKey),et.loginAddress&&je(et.loginAddress),typeof et.remember=="boolean"&&xn(et.remember)}catch{}},Ee=()=>{if(It)try{localStorage.setItem(Lt(),JSON.stringify({privateKey:V,loginAddress:be,remember:!0}))}catch{}},p=()=>{try{localStorage.removeItem(Lt())}catch{}};m.useEffect(()=>{if(!e)return;const Ge=localStorage.getItem("hyperToken"),et=localStorage.getItem("hyperAddress");v(!!(Ge&&et));const We=setInterval(()=>{const wt=localStorage.getItem("hyperToken"),St=localStorage.getItem("hyperAddress");v(!!(wt&&St))},800);return()=>clearInterval(We)},[e]),m.useEffect(()=>{!e||!g||(h(),se())},[e,g]),m.useEffect(()=>{e&&(Xe===""&&Vt(Kn),cn===""&&Pt(Kn),Yt===""&&Ve(Kn))},[e]),m.useEffect(()=>{if(!Qe)return;const Ge=Cn(Qe),et=Number(ct);!Number.isNaN(et)&&et>Ge&&Ut(String(Ge)),!Number.isNaN(et)&&et<1&&ct!==""&&Ut("1")},[Qe]),m.useEffect(()=>{e&&(It&&Ee(),It||p())},[V,be,It,e]);async function h(){var Ge,et,We,wt,St,Kt,gn,yn;try{Dt(!0),lt("");const hn=window.localStorage.getItem("hyperToken"),br=window.localStorage.getItem("hyperAddress");if(!hn||!br){C(!1),Fn();return}const Wt=await(await fetch(`${Et}/api/hyper/new_farming_app/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:br.toLowerCase(),token:hn})})).json();if(!(Wt!=null&&Wt.success)){if(console.warn("INFO API RESPONSE:",Wt==null?void 0:Wt.error_message),(Wt==null?void 0:Wt.error_message)==="You have not a running process"){const Zt=Y?Y.toLowerCase().replace("-","_"):null,vt=L==null?void 0:L[Zt];if(Zt&&vt){const Ot={...L,[Zt]:{...vt,isStop:!0}};z(Ot);const Gn=Object.keys(Ot).filter(fr=>fr.startsWith("pacifica"));if(Gn.length>0&&!Y){const $t=Gn.sort((nn,Vn)=>{var gr,dr;const lr=parseInt(((gr=nn.match(/\d+/))==null?void 0:gr[0])||0,10),er=parseInt(((dr=Vn.match(/\d+/))==null?void 0:dr[0])||0,10);return lr-er})[0].match(/\d+/);$t&&ie(`Pacifica-${$t[0]}`)}}else ie("Pacifica-1")}Wt!=null&&Wt.slots_info&&(U((et=(Ge=Wt==null?void 0:Wt.slots_info)==null?void 0:Ge.pacifica)==null?void 0:et.total_qty),R((wt=(We=Wt==null?void 0:Wt.slots_info)==null?void 0:We.pacifica)==null?void 0:wt.active_qty));return}if(Wt!=null&&Wt.success&&(Wt!=null&&Wt.data)){const Zt=Y?Y.toLowerCase().replace("-","_"):null,vt=L==null?void 0:L[Zt],Ot=Wt.data||{};Zt&&!Ot[Zt]&&vt&&(Ot[Zt]={...vt,isStop:!0}),z(Ot);const Gn=Object.keys(Ot).filter(fr=>fr.startsWith("pacifica"));if(Gn.length>0&&!Y){const $t=Gn.sort((nn,Vn)=>{var gr,dr;const lr=parseInt(((gr=nn.match(/\d+/))==null?void 0:gr[0])||0,10),er=parseInt(((dr=Vn.match(/\d+/))==null?void 0:dr[0])||0,10);return lr-er})[0].match(/\d+/);$t&&ie(`Pacifica-${$t[0]}`)}Wt!=null&&Wt.slots_info&&(U((Kt=(St=Wt==null?void 0:Wt.slots_info)==null?void 0:St.pacifica)==null?void 0:Kt.total_qty),R((yn=(gn=Wt==null?void 0:Wt.slots_info)==null?void 0:gn.pacifica)==null?void 0:yn.active_qty))}}catch{C(!1),Fn(),G("OFF")}finally{Dt(!1)}}const S=m.useMemo(()=>Y?Y.toLowerCase().replace("-","_"):"",[Y]),_=!!((ot=L==null?void 0:L[S])!=null&&ot.delta)&&!!((gt=L==null?void 0:L[S])!=null&&gt.from_slot),k=_?`pacifica_${(Jt=L==null?void 0:L[S])==null?void 0:Jt.from_slot}`:S;m.useEffect(()=>{var We,wt,St,Kt,gn,yn,hn,br,pt,Wt;if(!Y||!L)return;const Ge=k,et=L==null?void 0:L[Ge];if(!et){ee(""),je(""),Be(""),dt(""),Ut(""),tn("LONG"),un("LIMIT"),C(!1),G("OFF"),fn("Hour"),Pt(""),Vt(""),Z("pacifica");return}if((et==null?void 0:et.target_params)==null&&et.source_params){et!=null&&et.isStop?C(!1):C(!0),G("OFF");const Zt=et.source_params,vt=(et==null?void 0:et.slot_number)??"";vt&&!_&&ie(`Pacifica-${vt}`),Zt!=null&&Zt.cycleSeconds&&fn((Zt==null?void 0:Zt.cycleSeconds)===86400?"Day":"Hour");const Ot=(Zt==null?void 0:Zt.agent_pkey)??"",wn=(Zt==null?void 0:Zt.login_address)??"";if(Ot&&ee(String(Ot)),wn&&je(String(wn)),Zt!=null&&Zt.coin){const Gn=String(Zt.coin);Be(Gn)}(Zt==null?void 0:Zt.orderPerHour)!=null&&dt(String(Zt.orderPerHour)),(Zt==null?void 0:Zt.leverage)!=null&&Ut(String(Zt.leverage)),Zt!=null&&Zt.direction&&tn(String(Zt.direction).toUpperCase()==="SHORT"?"SHORT":String(Zt.direction).toUpperCase()==="RANDOM"?"RANDOM":"LONG"),Zt!=null&&Zt.orderType&&un(String(Zt.orderType).toUpperCase()==="MARKET"?"MARKET":String(Zt.orderType).toUpperCase()==="LIMIT"?"LIMIT":"RANDOM"),(Zt==null?void 0:Zt.tp)!=null&&Pt(String(Zt.tp)),(Zt==null?void 0:Zt.sl)!=null&&Vt(String(Zt.sl))}else if((et==null?void 0:et.target_params)!==null){et!=null&&et.isStop?C(!1):C(!0),G("OFF");const Zt=(et==null?void 0:et.slot_number)??"";Zt&&!_&&ie(`Pacifica-${Zt}`),(We=et==null?void 0:et.source_params)!=null&&We.coin&&Be(String((wt=et==null?void 0:et.source_params)==null?void 0:wt.coin)),((St=et==null?void 0:et.source_params)==null?void 0:St.orderPerHour)!=null&&dt(String((Kt=et==null?void 0:et.source_params)==null?void 0:Kt.orderPerHour)),((gn=et==null?void 0:et.source_params)==null?void 0:gn.leverage)!=null&&Ut(String((yn=et==null?void 0:et.source_params)==null?void 0:yn.leverage)),(hn=et==null?void 0:et.source_params)!=null&&hn.accountType&&setStatusType(((br=et==null?void 0:et.source_params)==null?void 0:br.accountType)==="standart"?"STANDARD":"PREMIUM"),(pt=et==null?void 0:et.target_params)!=null&&pt.accountType&&setStatusTypeTwo(((Wt=et==null?void 0:et.target_params)==null?void 0:Wt.accountType)==="standart"?"STANDARD":"PREMIUM"),et!=null&&et.target_app&&Z(((et==null?void 0:et.target_app)==="pacifica","pacifica"))}else C(!1),G("OFF")},[Y,L,_,k]);const T=Ge=>{var et;return Number(((et=String(Ge||"").match(/\d+/))==null?void 0:et[0])||0)},B=Ge=>(Ge||"").toLowerCase().replace("-","_"),q=m.useMemo(()=>{const Ge=L==null?void 0:L[B(Y)];if(Ge!=null&&Ge.delta&&(Ge!=null&&Ge.from_slot))return Number(Ge.from_slot);const et=Number(Ge==null?void 0:Ge.slot_number);return Number.isFinite(et)?et:T(Y)},[Y,L]),te=m.useMemo(()=>{const Ge=Number(N)||0,et=Array.from({length:Ge},()=>({used:!1,kind:null})),We=L||{};for(const[wt,St]of Object.entries(We)){if(!wt.startsWith("pacifica"))continue;const Kt=T(wt)-1;Kt<0||Kt>=Ge||((St==null?void 0:St.isStop)===!0?et[Kt]={used:!1,kind:null}:St!=null&&St.source_params?et[Kt]={used:!0,kind:"delta-src"}:St!=null&&St.target_params||St!=null&&St.delta?et[Kt]={used:!0,kind:"delta-shadow"}:St!=null&&St.farming_params?et[Kt]={used:!0,kind:"single"}:et[Kt]={used:!0,kind:"unknown"})}return et},[L,N]),ue=m.useMemo(()=>te.map((Ge,et)=>Ge.used&&Ge.kind!=="delta-src-inferred"?`Pacifica-${et+1}`:null).filter(Boolean),[te]);m.useMemo(()=>te.filter(Ge=>!Ge.used).length,[te]);async function de(){if(!g){n(!0);return}if(zn)try{Je(!0),lt("");const Ge=window.localStorage.getItem("hyperToken"),et=window.localStorage.getItem("hyperAddress");if(!Ge||!et){n(!0);return}const We={login_address:be,agent_pkey:V,cycleSeconds:sn==="Hour"?3600:86400,tp:Number(cn),sl:Number(Xe),coin:`${Qe}`,orderPerHour:Number(at),leverage:Number(ct),direction:kt,orderType:jt},wt={api_pkey:ae,login_wallet:Ie,coin:Qe==null?void 0:Qe.replace("USDT",""),orderPerHour:Number(at),leverage:Number(ct)},St={address:et.toLowerCase(),token:Ge,slot_number:Number(Y==null?void 0:Y.replace("Pacifica-","")),source_app:"pacifica",source_params:We},gn=await(await fetch(`${Et}/api/hyper/farming_app/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(St)})).json();gn!=null&&gn.success?(C(!0),h(),It&&Ee()):lt((gn==null?void 0:gn.error_message)||"Start failed.")}catch(Ge){lt(Ge.message||"An error occurred while saving.")}finally{Je(!1)}}async function xe(){if(!g){n(!0);return}try{Rt(!0),lt("");const Ge=window.localStorage.getItem("hyperToken"),et=window.localStorage.getItem("hyperAddress");if(!Ge||!et){n(!0);return}const wt=await(await fetch(`${Et}/api/hyper/farming_app/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:et.toLowerCase(),token:Ge,source_app:"pacifica",slot_number:q})})).json();wt!=null&&wt.success?(C(!1),h()):lt((wt==null?void 0:wt.error_message)||"Stop failed.")}catch(Ge){lt(Ge.message||"An error occurred while stopping.")}finally{Rt(!1)}}const we={control:(Ge,et)=>({...Ge,backgroundColor:"#242424",borderColor:et.isFocused?"#67FFBD":"#353535",minHeight:32,height:32,boxShadow:"none",cursor:"pointer",alignItems:"center"}),valueContainer:Ge=>({...Ge,height:32,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:Ge=>({...Ge,height:32}),input:Ge=>({...Ge,color:"#FFFFFF",margin:0,padding:0}),singleValue:Ge=>({...Ge,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:Ge=>({...Ge,color:"#7F7F7F",fontSize:"12px"}),menu:Ge=>({...Ge,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:Ge=>({...Ge,paddingTop:0,paddingBottom:0,maxHeight:200}),option:(Ge,et)=>({...Ge,backgroundColor:et.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:32,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:Ge=>({...Ge,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:Ge=>({...Ge,backgroundColor:"#353535"})},ke=({max:Ge})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[Ge,"x"]}),Me=Ge=>{var et;return i.jsx($a.Option,{...Ge,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(et=Ge.data)!=null&&et.icon?i.jsx("img",{src:Ge.data.icon,alt:Ge.data.label,className:"w-4 h-4 rounded-[4px]",onError:We=>We.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:Ge.data.label}),i.jsx(ke,{max:Ge.data.maxLeverage})]})})},Ye=Ge=>{var et;return i.jsx($a.SingleValue,{...Ge,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(et=Ge.data)!=null&&et.icon?i.jsx("img",{src:Ge.data.icon,alt:Ge.data.label,className:"w-4 h-4 rounded-[4px]",onError:We=>We.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}),i.jsx("span",{className:"text-white text-[13px]",children:Ge.data.label}),i.jsx(ke,{max:Ge.data.maxLeverage})]})})},Fe=Ge=>{const et=ue.includes(Ge.data.value);return i.jsx($a.Option,{...Ge,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[i.jsx("span",{className:"text-white text-[13px]",children:Ge.data.label}),et&&i.jsx("span",{className:"ml-auto w-2 h-2 rounded-full bg-[#67FFBD]",title:"Active"})]})})},rt=Ge=>i.jsx($a.SingleValue,{...Ge,children:i.jsx("div",{className:"flex items-center gap-2 px-3",children:i.jsx("span",{className:"text-white text-[13px]",children:Ge.data.label})})}),se=async()=>{var We,wt,St,Kt,gn,yn,hn,br;const Ge=window.localStorage.getItem("hyperToken"),et=window.localStorage.getItem("hyperAddress");if(!(!Ge||!et))try{ft(!0);const pt=await Si(et.toLowerCase(),Ge);pt!=null&&pt.success?(r(pt==null?void 0:pt.telegram_chat_id),s(pt==null?void 0:pt.subscriber_role),a(pt==null?void 0:pt.subs_expire_day),o((We=pt==null?void 0:pt.mushboomer_counts)==null?void 0:We.eth),l((wt=pt==null?void 0:pt.mushboomer_counts)==null?void 0:wt.sol),c(pt==null?void 0:pt.referral_code),u(pt==null?void 0:pt.refcode),d(pt==null?void 0:pt.whitelist),f(Ge),x(et),Oe(!0),I((Kt=(St=pt==null?void 0:pt.slots_info)==null?void 0:St.pacifica)==null?void 0:Kt.total_qty),U((yn=(gn=pt==null?void 0:pt.slots_info)==null?void 0:gn.pacifica)==null?void 0:yn.total_qty),R((br=(hn=pt==null?void 0:pt.slots_info)==null?void 0:hn.pacifica)==null?void 0:br.active_qty),ft(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),f(""),x(""),ft(!1))}catch(pt){console.error("Token verification error:",pt),console.error(pt.message||"An unknown error occurred."),ft(!1)}},Ce=it,De=m.useMemo(()=>Array.from({length:N},(Ge,et)=>({value:`Pacifica-${et+1}`,label:`Pacifica-${et+1}`})),[N]);if(!e)return null;const Le=en||At||He||Ke,_e=w&&!He,nt=Cn(Qe);return i.jsxs(i.Fragment,{children:[i.jsx(fd,{open:Hn,setOpen:$n,transactionHash:Jn,transactionLoading:vn,paymentPresaleRole:ln,errorFunds:xt,activeMethod:2}),i.jsx(d5,{open:re,setOpen:he,paymentLighterRole:ln,oldSlotCount:X,checkAccountLighter:se,tradeMarket:"pacifica"}),i.jsxs("div",{className:"fixed inset-0 z-[9000] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>!Le&&t(!1)}),i.jsxs("div",{className:"relative w-[680px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#F8D4AB] max-h-[97dvh] overflow-y-auto",children:[i.jsxs("div",{className:"pb-2 px-5 pt-3 border-b border-[#353535] rounded-t-3xl relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-3",children:[i.jsx("img",{src:"https://app.pacifica.fi/imgs/logo.svg",alt:"",className:"h-9"}),i.jsx("span",{className:"text-[24px] font-semibold text-[#e87859] mt-1",children:"farming"})]}),i.jsxs("div",{className:"flex justify-between items-center gap-4",children:[i.jsx("div",{className:"text-xs font-normal text-[#7C7C7C] mt-2",children:"Pacifica Farming module lets you set up automated farming by providing your Pacifica Address, Pacifica Private Key, selecting a pair, defining trade per hour, leverage, direction, order type, take profit and stop loss."}),i.jsx("div",{className:"flex flex-col items- justify-start gap-1 relative",children:i.jsx("div",{className:"text-xs font-semibold text-[#7C7C7C] mt-2",children:i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/farm/pacifica-farming-module#getting-your-api-credentials","_blank"),className:"h-6 sm:h-7 w-max py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer border border-[#353535] px-4 bg-[#242424] hover:bg-[#2e2e2e]",children:[i.jsx("img",{src:s5,className:"w-[14px] h-[14px]"}),i.jsx("div",{className:"min-w-max text-white text-xs font-medium font-manrope leading-none pointer-events-none",children:"Docs"})]})})})]})]}),i.jsxs("div",{className:"pb-2 space-y-3 pt-2 px-5",children:[qe&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:qe}),g&&ln&&F===P&&i.jsx("div",{className:"text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-2",children:"No free Pacifica slots."}),g&&ln&&i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 px-4 sm:px-5",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-[13px] text-[#7C7C7C] font-semibold",children:[i.jsx("span",{className:"pl-[2px]",children:"Slot"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(iA,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[P||0,"/",De.length]})]})]}),i.jsx(Zl,{styles:we,components:{Option:Fe,SingleValue:rt},options:De,value:De.find(Ge=>Ge.value===Y)||null,onChange:Ge=>ie((Ge==null?void 0:Ge.value)??""),placeholder:"Select",isSearchable:!0})]})}),i.jsxs("div",{className:`${oe==="ON"?"py-1":"py-5"} space-y-3 px-3 sm:px-5`,children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[oe==="ON"?i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 1"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"1st Stark Key Public"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:be,onChange:Ge=>je(Ge.target.value),autoComplete:"off",placeholder:"1st Stark Key Public ",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${be===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/pacifica-farming-module#getting-your-api-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:V,onChange:Ge=>ee(Ge.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY",type:dn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${V===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e}),i.jsx("button",{type:"button",onClick:()=>Mn(Ge=>!Ge),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Le||_e,children:dn?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Ae,onChange:Ge=>{const et=Ge.target.value.trim();if(et==="")return ce("");Pn(et)&&ce(et)},onKeyDown:Bt,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ae===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e})})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Login Wallet Address"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:be,onChange:Ge=>je(Ge.target.value),autoComplete:"off",placeholder:"LOGIN_WALLET_ADDRESS",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${be===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/pacifica-farming-module#getting-your-api-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get Pacifica Private Key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:V,onChange:Ge=>ee(Ge.target.value),autoComplete:"off",placeholder:"PACIFICA_PRIVATE_KEY",type:dn?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${V===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e}),i.jsx("button",{type:"button",onClick:()=>Mn(Ge=>!Ge),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Le||_e,children:dn?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]})]}),oe==="ON"&&i.jsxs("div",{className:"col-span-1 space-y-4 border border-[#6f604d] hover:border-[#F8D4AB]/70 rounded-lg p-2.5",children:[i.jsx("div",{className:"flex items-center justify-between border-b border-[#353535] pb-2 mb-3",children:i.jsx("span",{className:"text-[13px] font-semibold text-[#F8D4AB]",children:"API - 2"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"2nd Stark key Public"})}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:Ie,onChange:Ge=>Re(Ge.target.value),autoComplete:"off",placeholder:"2nd Stark key Public",type:"text",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Ie===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Private Key 2"}),i.jsx("a",{href:"https://docs.dextrabot.com/farm/pacifica-farming-module#getting-your-api-credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] underline text-[#F8D4AB] hover:text-[#eee0d0]",children:"How to get API Private key?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:ae,onChange:Ge=>fe(Ge.target.value),autoComplete:"off",placeholder:"API_PRIVATE_KEY_2",type:_n?"text":"password",className:`w-full h-8 pl-3 pr-16 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ae===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e}),i.jsx("button",{type:"button",onClick:()=>kn(Ge=>!Ge),className:"absolute right-1 top-1/2 -translate-y-1/2 text-[11px] text-[#9B9B9B] hover:text-white h-6 flex justify-center items-center hover:border-none hover:ring-0 focus:outline-none focus:border-none bg-transparent",disabled:Le||_e,children:_n?i.jsx(ia,{size:14}):i.jsx(aa,{size:14})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"API Key Index 2"}),i.jsx("div",{className:"relative",children:i.jsx("input",{value:ye,onChange:Ge=>{const et=Ge.target.value.trim();if(et==="")return Ne("");Pn(et)&&Ne(et)},onKeyDown:Bt,inputMode:"numeric",autoComplete:"off",placeholder:"API_KEY_INDEX_2",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ye===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Le||_e})})]})]})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:i.jsxs("div",{className:`${oe==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per Hour"}),i.jsx("input",{value:at,onChange:Ge=>{const et=Ge.target.value.trim();if(et==="")return dt("");Pn(et)&&dt(et)},onKeyDown:Bt,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${at===""?"border-[#353535]":qn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Le||_e}),at!==""&&!qn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Select Pair"}),i.jsx(Zl,{styles:we,components:{Option:Me,SingleValue:Ye},isDisabled:Le||_e,options:Ce,value:Ce.find(Ge=>Ge.value===Qe)||null,onChange:Ge=>Be((Ge==null?void 0:Ge.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-1`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Trade Per"}),i.jsxs("select",{value:sn,onChange:Ge=>fn(Ge.target.value),className:`${Le||_e?"cursor-not-allowed":"cursor-pointer"} h-6 text-[12px] bg-[#242424] border border-[#353535] rounded-md px-2 text-white outline-none font-bold font-manrope`,disabled:Le||_e,children:[i.jsx("option",{value:"Hour",children:"Hour"}),i.jsx("option",{value:"Day",children:"Day"})]})]}),i.jsx("input",{value:at,onChange:Ge=>{const et=Ge.target.value.trim();if(et==="")return dt("");Pn(et)&&dt(et)},onKeyDown:Bt,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10 (max 180)",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${at===""?"border-[#353535]":qn?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Le||_e}),at!==""&&!qn&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer between 1 and 180."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe==="ON"?"":"hidden"} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Delta Neutral"}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 border border-[#353535] bg-[#242424] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:oe==="ON"?"On":"Off"}),i.jsx(Oo,{checked:oe==="ON",onChange:Ge=>G(Ge?"ON":"OFF"),disabled:Le||_e,className:`${oe==="ON"?"bg-[#1DE674]":"bg-white/10"} relative inline-flex h-5 w-9 items-center rounded-full p-1 transition-colors duration-200 ease-in-out ${Le||_e?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:i.jsx("span",{"aria-hidden":"true",className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-lg transition duration-200 ease-in-out  ${oe==="ON"?"translate-x-3":"translate-x-0"}`})})]})]}),i.jsxs("div",{className:" space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Leverage"}),i.jsx("input",{value:ct,onChange:Ge=>{const et=Ge.target.value.trim();if(et==="")return Ut("");Pn(et)&&Ut(et)},onKeyDown:Bt,inputMode:"numeric",autoComplete:"off",placeholder:Qe?`1–${nt}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ct===""?"border-[#353535]":nr?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Le||_e})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Direction"}),i.jsxs("div",{className:"flex items-center gap-2 md:pr-6",children:[i.jsx("div",{"aria-pressed":kt==="LONG",onClick:()=>!_e&&tn("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Le||_e?"cursor-not-allowed":"cursor-pointer",kt==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["LONG",ct?` - ${ct}x`:""]})}),i.jsx("div",{"aria-pressed":kt==="SHORT",onClick:()=>!_e&&tn("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Le||_e?"cursor-not-allowed":"cursor-pointer",kt==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["SHORT",ct?` - ${ct}x`:""]})}),i.jsx("div",{"aria-pressed":kt==="RANDOM",onClick:()=>!_e&&tn("RANDOM"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Le||_e?"cursor-not-allowed":"cursor-pointer",kt==="RANDOM"?"bg-[#3b82f6] text-[#ffffff] border-[#93c5fd] shadow-[0_0_0_3px_rgba(59,130,246,0.3)]":"text-[#3b82f6] bg-[rgba(59,130,246,0.15)] border-[rgba(59,130,246,0.15)] hover:bg-[#2563eb] hover:text-white"].join(" "),children:i.jsxs("span",{className:"min-w-max",children:["RANDOM",ct?` - ${ct}x`:""]})})]})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"flex items-center gap-2 text-[13px] text-[#7C7C7C] font-semibold",children:i.jsx("span",{children:"Order Type"})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{"aria-pressed":jt==="MARKET",onClick:()=>!_e&&un("MARKET"),className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",Le||_e?"cursor-not-allowed":"cursor-pointer",jt==="MARKET"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["MARKET ",jt==="MARKET"?" ✓":""]})}),i.jsx("button",{"aria-pressed":jt==="LIMIT",onClick:()=>!_e&&un("LIMIT"),className:["inline-flex flex-col justify-center items-center h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",Le||_e?"cursor-not-allowed":"cursor-pointer",jt==="LIMIT"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["LIMIT ",jt==="LIMIT"?" ✓":""]})}),i.jsx("button",{"aria-pressed":jt==="RANDOM",onClick:()=>!_e&&un("RANDOM"),className:["inline-flex flex-col justify-center items-center h-6 px-1 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",Le||_e?"cursor-not-allowed":"cursor-pointer",jt==="RANDOM"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["RANDOM ",jt==="RANDOM"?" ✓":""]})})]})]})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} grid grid-cols-1 md:grid-cols-2 gap-4`,children:[i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Take Profit %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:cn,onChange:Ge=>{const et=Ge.target.value.trim();if(et==="")return Pt("");an(et)&&Pt(et)},onKeyDown:Bt,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${cn===""?"border-[#353535]":tr?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Le||_e})]}),cn!==""&&!tr&&i.jsx("div",{className:"text-[#FF797C] text-[11px]",children:"Value must be 0, or between 1 and 10000000. Numbers between 0 and 1 are not allowed."})]}),i.jsxs("div",{className:`${oe==="ON"?"hidden":""} space-y-2`,children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Stop Loss %"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"%"}),i.jsx("input",{value:Xe,onChange:Ge=>{const et=Ge.target.value.trim();if(et==="")return Vt("");an(et)&&Vt(et)},onKeyDown:Bt,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${Xe===""?"border-[#353535]":Qt?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Le||_e})]}),Xe!==""&&!Qt&&i.jsxs("div",{className:"text-[#FF797C] text-[11px]",children:["Value must be 0, or between 1 and"," ",ct?Math.max(ct*100-1,0):4999,". Numbers between 0 and 1 are not allowed."]})]})]}),!1]}),i.jsx("div",{className:`${oe==="ON"?"py-3":"py-6"} flex items-center gap-3 px-5 border-t border-[#353535] bg-[rgba(27,27,27,0.32)] rounded-b-3xl`,children:i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("button",{onClick:()=>!Le&&t(!1),className:"inline-flex items-center justify-center h-8 px-5 rounded-[10px] border bg-black/5 border-[#353535] text-white text-[13px] hover:border-white disabled:opacity-60",disabled:Le,children:"Cancel"}),g?oe==="ON"?w?i.jsx("button",{onClick:xe,disabled:Le,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:He?"Stopping...":"Stop"}):i.jsx("button",{onClick:de,disabled:!zn||Le,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!zn||Le?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:At?"Starting...":"Start"}):w?i.jsx("button",{onClick:xe,disabled:Le,className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border border-[#353535] hover:border-[#FF797C] text-[#FF797C] bg-[rgba(27,27,27,0.32)] disabled:opacity-60",children:He?"Stopping...":"Stop"}):i.jsx("button",{onClick:de,disabled:!zn||Le,className:`inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!zn||Le?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3]"}`,children:At?"Starting...":"Start"}):i.jsx("button",{onClick:()=>n(!0),className:"inline-flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#67FFBD] border-[#67FFBD] text-black hover:opacity-90",children:"Connect"})]})}),en&&i.jsx("div",{className:"absolute inset-0 rounded-3xl bg-black/40 flex items-center justify-center text-sm",children:"Loading..."})]})]})]})]})},XTt=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState(!1),[s,a]=m.useState(2),[o,l]=m.useState(!1),[c,u]=m.useState(!1),[d,f]=m.useState(!1),[x,g]=m.useState(!1),[v,w]=m.useState(!1),[C,N]=m.useState(!1),I=(P=[])=>P==null?void 0:P.map(R=>R.submenu?{...R,submenu:I(R.submenu)}:R.action==="openAster"?{...R,onClick:()=>{a(2),r(!0)}}:R.action==="openFarm"?{...R,onClick:()=>t(!0)}:R.action==="openLighter"?{...R,onClick:()=>l(!0)}:R.action==="openApex"?{...R,onClick:()=>u(!0)}:R.action==="openVariational"?{...R,onClick:()=>f(!0)}:R.action==="openExtended"?{...R,onClick:()=>g(!0)}:R.action==="openParadex"?{...R,onClick:()=>w(!0)}:R.action==="openPacifica"?{...R,onClick:()=>N(!0)}:R);return i.jsxs(i.Fragment,{children:[i.jsx(ul,{to:"https://dextrabot.com/",className:"cursor-pointer",children:i.jsx("div",{className:"flex items-center gap-2 font-manrope",children:i.jsx("img",{src:i5,alt:"Dextrabot",loading:"eager",decoding:"async",width:32,height:32,className:"w-8 h-8 object-contain"})})}),i.jsx("div",{className:"flex items-center gap-1",children:iit.map(P=>P.type==="link"?i.jsx(YTt,{linkTo:P.to,title:P.label},P.to):P.type==="dropdown"?i.jsx(sit,{label:P.label,items:I(P.items),activePaths:P.activePaths,badgeLabel:P.badgeLabel,badgeTone:P.badgeTone},P.label):null)}),i.jsx($oe,{open:e,setOpen:t}),i.jsx(Uoe,{open:n,setOpen:r,defaultMethod:s}),i.jsx(zoe,{open:o,setOpen:l}),i.jsx(Hoe,{open:c,setOpen:u}),i.jsx(Voe,{open:d,setOpen:f}),i.jsx(v$,{open:x,setOpen:g}),i.jsx(Woe,{open:v,setOpen:w}),i.jsx(qoe,{open:C,setOpen:N})]})},Ny=({className:e})=>i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[i.jsx("path",{d:"M8.625 15.75C12.56 15.75 15.75 12.56 15.75 8.625C15.75 4.68997 12.56 1.5 8.625 1.5C4.68997 1.5 1.5 4.68997 1.5 8.625C1.5 12.56 4.68997 15.75 8.625 15.75Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M16.5 16.5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),sm=(e,t=null)=>{t&&e.target.src===t?e.target.src=TH:t&&e.target.src!==t?e.target.src=t:e.target.src!==TH&&(e.target.src=TH)},QTt=m.forwardRef(({setOpen:e},t)=>{const{searchTerminalCoin:n,isSearchTerminalError:r}=m.useContext(Gr),[s,a]=m.useState(""),[o,l]=m.useState([]),[c,u]=m.useState([]),[d,f]=m.useState([]),x={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};m.useEffect(()=>{const C=JSON.parse(localStorage.getItem("recentWallets")||"[]");l(C);const N=JSON.parse(localStorage.getItem("recentCoins")||"[]");u(N)},[]);const g=C=>{a(C.target.value.toLowerCase())},v=C=>{C.key==="Enter"&&w()},w=()=>{if(s)if(s.match(/^0x[a-fA-F0-9]{40}$/)){const C=s==null?void 0:s.toLowerCase(),N=[C,...o.filter(I=>(I==null?void 0:I.toLowerCase())!==C)];N.length>12&&N.pop(),l(N),localStorage.setItem("recentWallets",JSON.stringify(N)),window.open(`/wallet-details/${s}`,"_blank"),e(!1)}else on.success(i.jsx(i.Fragment,{children:i.jsx("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:"Please enter a valid Ethereum address"})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"380px",minWidth:"380px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})};return m.useEffect(()=>{if(s.length>0){const C=s==null?void 0:s.toLowerCase(),N=n.filter(I=>Array.isArray(I)&&I.some(P=>{var R;return(R=P==null?void 0:P.toLowerCase())==null?void 0:R.includes(C)})).map(I=>I[0]);f(N)}else f([])},[s,n]),i.jsxs("div",{children:[i.jsx("div",{className:"sm:w-[416px] h-12 font-manrope z-[999]",children:i.jsxs("div",{className:"flex justify-between items-center bg-[#303030] h-full px-4 gap-1 sm:gap-2.5",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1 sm:gap-2.5 w-full",children:[i.jsx(Ny,{className:"text-white"}),i.jsx("input",{type:"text",ref:t,placeholder:"Search coin or wallet",value:s,onChange:g,onKeyDown:v,className:"w-full bg-transparent text-white placeholder-[#989898] text-sm font-medium font-manrope leading-[8px] placeholder:leading-[8px] tracking-tight focus:outline-none h-12"})]}),i.jsx("div",{onClick:()=>a(""),className:`${(s==null?void 0:s.length)>0?"":"hidden"} text-[#aaa] hover:text-white outline-none focus:outline-none focus:ring-0 border-none w-6 min-w-6 h-[24px] bg-[#353535] hover:bg-[#585858] rounded-md flex justify-center items-center cursor-pointer`,children:i.jsx("img",{src:Oa,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})}),i.jsx("div",{className:`${s.match(/^0x[a-fA-F0-9]{40}$/)?"":"hidden"}`,children:i.jsx("div",{onClick:w,className:"w-16 h-7 px-4 py-3 rounded-[256px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#989898] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-xs font-medium font-inter leading-[8px]",children:"Search"})})})]})}),i.jsxs("div",{className:"recent-wallets",children:[i.jsx("div",{className:`${(d==null?void 0:d.length)===0&&"hidden"} text-white text-[11px] font-bold font-manrope leading-none tracking-wider bg-[#1f1f1f] pl-4 pb-2  pt-4`,children:"SEARCH RESULTS"}),i.jsx("ul",{className:`${(c==null?void 0:c.length)===0&&(o==null?void 0:o.length)===0?"h-full max-h-[320px]":"max-h-[120px]"} overflow-y-scroll overflow-x-hidden h-full  pl-4 pb-4 flex flex-wrap gap-1 sm:gap-2`,children:(d==null?void 0:d.length)===0?i.jsx("div",{className:`${!s.match(/^0x[a-fA-F0-9]{40}$/)&&(s==null?void 0:s.length)>0?"min-h-10":""} w-full h-full flex justify-center items-center`,children:i.jsx("div",{className:`${!s.match(/^0x[a-fA-F0-9]{40}$/)&&(s==null?void 0:s.length)>0?"":"hidden"} text-[#989898] text-[13px] font-semibold font-manrope leading-none pt-4`,children:"No results for your search."})}):d==null?void 0:d.map((C,N)=>i.jsx("li",{className:"mt-1 sm:mt-2",children:i.jsx("div",{className:"flex justify-start items-center gap-2 h-6 px-1 rounded-md border border-[#3a3a3a] max-w-max",children:i.jsx("div",{className:"flex justify-start items-center gap-2.5",children:i.jsxs("a",{href:`/terminal/${C}`,target:"_blank",className:"text-[#989898] text-[13px] font-semibold font-manrope leading-none hover:text-white flex gap-1.5 items-center",onClick:()=>{e(!1);const I=JSON.parse(localStorage.getItem("recentCoins")||"[]");I!=null&&I.includes(C)||(I.unshift(C),I.length>14&&I.pop(),localStorage.setItem("recentCoins",JSON.stringify(I)))},children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${x[C]||(C==null?void 0:C.split("/")[0])}.svg`,alt:C,className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-gray-700",loading:"lazy",onError:I=>sm(I)}),C]})})})},N))})]}),i.jsxs("div",{className:`${(c==null?void 0:c.length)===0?"hidden":""} recent-wallets pt-4`,children:[i.jsx("div",{className:"text-white text-[11px] font-bold font-manrope leading-none tracking-wider bg-[#1f1f1f] pl-4 pb-2",children:"RECENT COINS"}),i.jsx("ul",{className:"overflow-y-scroll overflow-x-hidden h-full max-h-[142px] sm:max-h-[132px] pl-4 pb-4 flex flex-wrap gap-1 sm:gap-2",children:Array.isArray(c)&&(c==null?void 0:c.map((C,N)=>i.jsx("li",{className:"mt-1 sm:mt-2",children:i.jsx("div",{className:"flex justify-start items-center gap-2 h-6 px-1 rounded-md border border-[#3a3a3a] max-w-max",children:i.jsx("div",{className:"flex justify-start items-center gap-2.5",children:i.jsxs("a",{href:`/terminal/${C}`,target:"_blank",className:"text-[#989898] text-[13px] font-semibold font-manrope leading-none hover:text-white flex gap-1.5 items-center",onClick:()=>e(!1),children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${x[C]||(C==null?void 0:C.split("/")[0])}.svg`,alt:C,className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-gray-700",loading:"lazy",onError:I=>sm(I)}),C]})})})},N)))})]}),i.jsxs("div",{className:`${(o==null?void 0:o.length)===0?"hidden":""} recent-wallets pt-4`,children:[i.jsx("div",{className:"text-white text-[11px] font-bold font-manrope leading-none tracking-wider bg-[#1f1f1f] pl-4 pb-2",children:"RECENT WALLETS"}),i.jsx("ul",{className:"overflow-y-scroll overflow-x-hidden h-full max-h-[120px] sm:max-h-[190px] pl-4 pb-4 sm:pb-8 flex flex-wrap gap-2",children:o==null?void 0:o.map((C,N)=>i.jsx("li",{className:"mt-1 sm:mt-2",children:i.jsx("div",{className:"flex justify-start items-center gap-2 h-6 px-1 rounded-md border border-[#3a3a3a] w-[120px]",children:i.jsx("div",{className:"flex justify-start items-center gap-2.5",children:i.jsxs("a",{href:`/wallet-details/${C}`,target:"_blank",className:"text-[#989898] text-[13px] font-semibold font-manrope leading-none hover:text-white flex gap-1.5 items-center",onClick:()=>e(!1),children:[i.jsx("img",{src:Ubt,alt:"",className:"w-4 h-4"}),C&&C.slice(0,6)+"..."+C.slice(-4)]})})})},N))})]})]})}),ZTt=({open:e,setOpen:t})=>{const n=m.useRef(null);return m.useEffect(()=>{e&&setTimeout(()=>{var r;(r=n.current)==null||r.focus()},0)},[e]),i.jsxs(ga,{open:e,onClose:t,className:"relative z-50",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-center justify-center p-4 text-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative transform overflow-hidden rounded-lg text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in sm:my-8 max-w-max data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95",children:i.jsx("div",{className:"max-w-[320px] sm:max-w-[416px] min-h-[200px] max-h-[600px] relative bg-[#1f1f1f] border-[#404040] rounded-lg shadow backdrop-blur-[32px]",children:i.jsx(QTt,{ref:n,setOpen:t})})})})})]})},rMe=()=>{const[e,t]=m.useState(!1);return i.jsxs(i.Fragment,{children:[i.jsx(ZTt,{open:e,setOpen:t}),i.jsx("div",{onClick:()=>{t(!0)},className:"flex-shrink w-full min-w-[80px] lg:max-w-[250px] h-8 bg-[#353535] rounded-[256px] flex justify-between items-center px-4 cursor-pointer font-manrope group",children:i.jsxs("div",{className:"flex justify-start items-center gap-[11px]",children:[i.jsx("div",{children:i.jsx(Ny,{className:"text-[#646464] group-hover:text-[#e2e2e2]"})}),i.jsx("div",{className:"font-manrope leading-none text-[#666666]  group-hover:text-[#e2e2e2] text-sm font-medium min-w-max",children:"Search..."})]})})]})};var Gge='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',JTt={rounded:`SFRounded, ui-rounded, "SF Pro Rounded", ${Gge}`,system:Gge},T7={large:{actionButton:"9999px",connectButton:"12px",modal:"24px",modalMobile:"28px"},medium:{actionButton:"10px",connectButton:"8px",modal:"16px",modalMobile:"18px"},none:{actionButton:"0px",connectButton:"0px",modal:"0px",modalMobile:"0px"},small:{actionButton:"4px",connectButton:"4px",modal:"8px",modalMobile:"8px"}},eIt={large:{modalOverlay:"blur(20px)"},none:{modalOverlay:"blur(0px)"},small:{modalOverlay:"blur(4px)"}},sMe=({borderRadius:e="large",fontStack:t="rounded",overlayBlur:n="none"})=>({blurs:{modalOverlay:eIt[n].modalOverlay},fonts:{body:JTt[t]},radii:{actionButton:T7[e].actionButton,connectButton:T7[e].connectButton,menuButton:T7[e].connectButton,modal:T7[e].modal,modalMobile:T7[e].modalMobile}}),iMe={blue:{accentColor:"#0E76FD",accentColorForeground:"#FFF"},green:{accentColor:"#1DB847",accentColorForeground:"#FFF"},orange:{accentColor:"#FF801F",accentColorForeground:"#FFF"},pink:{accentColor:"#FF5CA0",accentColorForeground:"#FFF"},purple:{accentColor:"#5F5AFA",accentColorForeground:"#FFF"},red:{accentColor:"#FA423C",accentColorForeground:"#FFF"}},Kge=iMe.blue,aMe=({accentColor:e=Kge.accentColor,accentColorForeground:t=Kge.accentColorForeground,...n}={})=>({...sMe(n),colors:{accentColor:e,accentColorForeground:t,actionButtonBorder:"rgba(0, 0, 0, 0.04)",actionButtonBorderMobile:"rgba(0, 0, 0, 0.06)",actionButtonSecondaryBackground:"rgba(0, 0, 0, 0.06)",closeButton:"rgba(60, 66, 66, 0.8)",closeButtonBackground:"rgba(0, 0, 0, 0.06)",connectButtonBackground:"#FFF",connectButtonBackgroundError:"#FF494A",connectButtonInnerBackground:"linear-gradient(0deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.06))",connectButtonText:"#25292E",connectButtonTextError:"#FFF",connectionIndicator:"#30E000",downloadBottomCardBackground:"linear-gradient(126deg, rgba(255, 255, 255, 0) 9.49%, rgba(171, 171, 171, 0.04) 71.04%), #FFFFFF",downloadTopCardBackground:"linear-gradient(126deg, rgba(171, 171, 171, 0.2) 9.49%, rgba(255, 255, 255, 0) 71.04%), #FFFFFF",error:"#FF494A",generalBorder:"rgba(0, 0, 0, 0.06)",generalBorderDim:"rgba(0, 0, 0, 0.03)",menuItemBackground:"rgba(60, 66, 66, 0.1)",modalBackdrop:"rgba(0, 0, 0, 0.3)",modalBackground:"#FFF",modalBorder:"transparent",modalText:"#25292E",modalTextDim:"rgba(60, 66, 66, 0.3)",modalTextSecondary:"rgba(60, 66, 66, 0.6)",profileAction:"#FFF",profileActionHover:"rgba(255, 255, 255, 0.5)",profileForeground:"rgba(60, 66, 66, 0.06)",selectedOptionBorder:"rgba(60, 66, 66, 0.1)",standby:"#FFD641"},shadows:{connectButton:"0px 4px 12px rgba(0, 0, 0, 0.1)",dialog:"0px 8px 32px rgba(0, 0, 0, 0.32)",profileDetailsAction:"0px 2px 6px rgba(37, 41, 46, 0.04)",selectedOption:"0px 2px 6px rgba(0, 0, 0, 0.24)",selectedWallet:"0px 2px 6px rgba(0, 0, 0, 0.12)",walletLogo:"0px 2px 16px rgba(0, 0, 0, 0.16)"}});aMe.accentColors=iMe;var xO="#1A1B1F",oMe={blue:{accentColor:"#3898FF",accentColorForeground:"#FFF"},green:{accentColor:"#4BD166",accentColorForeground:xO},orange:{accentColor:"#FF983D",accentColorForeground:xO},pink:{accentColor:"#FF7AB8",accentColorForeground:xO},purple:{accentColor:"#7A70FF",accentColorForeground:"#FFF"},red:{accentColor:"#FF6257",accentColorForeground:"#FFF"}},Yge=oMe.blue,lMe=({accentColor:e=Yge.accentColor,accentColorForeground:t=Yge.accentColorForeground,...n}={})=>({...sMe(n),colors:{accentColor:e,accentColorForeground:t,actionButtonBorder:"rgba(255, 255, 255, 0.04)",actionButtonBorderMobile:"rgba(255, 255, 255, 0.08)",actionButtonSecondaryBackground:"rgba(255, 255, 255, 0.08)",closeButton:"rgba(224, 232, 255, 0.6)",closeButtonBackground:"rgba(255, 255, 255, 0.08)",connectButtonBackground:xO,connectButtonBackgroundError:"#FF494A",connectButtonInnerBackground:"linear-gradient(0deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.15))",connectButtonText:"#FFF",connectButtonTextError:"#FFF",connectionIndicator:"#30E000",downloadBottomCardBackground:"linear-gradient(126deg, rgba(0, 0, 0, 0) 9.49%, rgba(120, 120, 120, 0.2) 71.04%), #1A1B1F",downloadTopCardBackground:"linear-gradient(126deg, rgba(120, 120, 120, 0.2) 9.49%, rgba(0, 0, 0, 0) 71.04%), #1A1B1F",error:"#FF494A",generalBorder:"rgba(255, 255, 255, 0.08)",generalBorderDim:"rgba(255, 255, 255, 0.04)",menuItemBackground:"rgba(224, 232, 255, 0.1)",modalBackdrop:"rgba(0, 0, 0, 0.5)",modalBackground:"#1A1B1F",modalBorder:"rgba(255, 255, 255, 0.08)",modalText:"#FFF",modalTextDim:"rgba(224, 232, 255, 0.3)",modalTextSecondary:"rgba(255, 255, 255, 0.6)",profileAction:"rgba(224, 232, 255, 0.1)",profileActionHover:"rgba(224, 232, 255, 0.2)",profileForeground:"rgba(224, 232, 255, 0.05)",selectedOptionBorder:"rgba(224, 232, 255, 0.1)",standby:"#FFD641"},shadows:{connectButton:"0px 4px 12px rgba(0, 0, 0, 0.1)",dialog:"0px 8px 32px rgba(0, 0, 0, 0.32)",profileDetailsAction:"0px 2px 6px rgba(37, 41, 46, 0.04)",selectedOption:"0px 2px 6px rgba(0, 0, 0, 0.24)",selectedWallet:"0px 2px 6px rgba(0, 0, 0, 0.24)",walletLogo:"0px 2px 16px rgba(0, 0, 0, 0.16)"}});lMe.accentColors=oMe;var Vee=`{
  "connect_wallet": {
    "label": "Connect Wallet",
    "wrong_network": {
      "label": "Wrong network"
    }
  },

  "intro": {
    "title": "What is a Wallet?",
    "description": "A wallet is used to send, receive, store, and display digital assets. It's also a new way to log in, without needing to create new accounts and passwords on every website.",
    "digital_asset": {
      "title": "A Home for your Digital Assets",
      "description": "Wallets are used to send, receive, store, and display digital assets like Ethereum and NFTs."
    },
    "login": {
      "title": "A New Way to Log In",
      "description": "Instead of creating new accounts and passwords on every website, just connect your wallet."
    },
    "get": {
      "label": "Get a Wallet"
    },
    "learn_more": {
      "label": "Learn More"
    }
  },

  "sign_in": {
    "label": "Verify your account",
    "description": "To finish connecting, you must sign a message in your wallet to verify that you are the owner of this account.",
    "message": {
      "send": "Sign message",
      "preparing": "Preparing message...",
      "cancel": "Cancel",
      "preparing_error": "Error preparing message, please retry!"
    },
    "signature": {
      "waiting": "Waiting for signature...",
      "verifying": "Verifying signature...",
      "signing_error": "Error signing message, please retry!",
      "verifying_error": "Error verifying signature, please retry!",
      "oops_error": "Oops, something went wrong!"
    }
  },

  "connect": {
    "label": "Connect",
    "title": "Connect a Wallet",
    "new_to_ethereum": {
      "description": "New to Ethereum wallets?",
      "learn_more": {
        "label": "Learn More"
      }
    },
    "learn_more": {
      "label": "Learn more"
    },
    "recent": "Recent",
    "status": {
      "opening": "Opening %{wallet}...",
      "connecting": "Connecting",
      "connect_mobile": "Continue in %{wallet}",
      "not_installed": "%{wallet} is not installed",
      "not_available": "%{wallet} is not available",
      "confirm": "Confirm connection in the extension",
      "confirm_mobile": "Accept connection request in the wallet"
    },
    "secondary_action": {
      "get": {
        "description": "Don't have %{wallet}?",
        "label": "GET"
      },
      "install": {
        "label": "INSTALL"
      },
      "retry": {
        "label": "RETRY"
      }
    },
    "walletconnect": {
      "description": {
        "full": "Need the official WalletConnect modal?",
        "compact": "Need the WalletConnect modal?"
      },
      "open": {
        "label": "OPEN"
      }
    }
  },

  "connect_scan": {
    "title": "Scan with %{wallet}",
    "fallback_title": "Scan with your phone"
  },

  "connector_group": {
    "installed": "Installed",
    "recommended": "Recommended",
    "other": "Other",
    "popular": "Popular",
    "more": "More",
    "others": "Others"
  },

  "get": {
    "title": "Get a Wallet",
    "action": {
      "label": "GET"
    },
    "mobile": {
      "description": "Mobile Wallet"
    },
    "extension": {
      "description": "Browser Extension"
    },
    "mobile_and_extension": {
      "description": "Mobile Wallet and Extension"
    },
    "mobile_and_desktop": {
      "description": "Mobile and Desktop Wallet"
    },
    "looking_for": {
      "title": "Not what you're looking for?",
      "mobile": {
        "description": "Select a wallet on the main screen to get started with a different wallet provider."
      },
      "desktop": {
        "compact_description": "Select a wallet on the main screen to get started with a different wallet provider.",
        "wide_description": "Select a wallet on the left to get started with a different wallet provider."
      }
    }
  },

  "get_options": {
    "title": "Get started with %{wallet}",
    "short_title": "Get %{wallet}",
    "mobile": {
      "title": "%{wallet} for Mobile",
      "description": "Use the mobile wallet to explore the world of Ethereum.",
      "download": {
        "label": "Get the app"
      }
    },
    "extension": {
      "title": "%{wallet} for %{browser}",
      "description": "Access your wallet right from your favorite web browser.",
      "download": {
        "label": "Add to %{browser}"
      }
    },
    "desktop": {
      "title": "%{wallet} for %{platform}",
      "description": "Access your wallet natively from your powerful desktop.",
      "download": {
        "label": "Add to %{platform}"
      }
    }
  },

  "get_mobile": {
    "title": "Install %{wallet}",
    "description": "Scan with your phone to download on iOS or Android",
    "continue": {
      "label": "Continue"
    }
  },

  "get_instructions": {
    "mobile": {
      "connect": {
        "label": "Connect"
      },
      "learn_more": {
        "label": "Learn More"
      }
    },
    "extension": {
      "refresh": {
        "label": "Refresh"
      },
      "learn_more": {
        "label": "Learn More"
      }
    },
    "desktop": {
      "connect": {
        "label": "Connect"
      },
      "learn_more": {
        "label": "Learn More"
      }
    }
  },

  "chains": {
    "title": "Switch Networks",
    "wrong_network": "Wrong network detected, switch or disconnect to continue.",
    "confirm": "Confirm in Wallet",
    "switching_not_supported": "Your wallet does not support switching networks from %{appName}. Try switching networks from within your wallet instead.",
    "switching_not_supported_fallback": "Your wallet does not support switching networks from this app. Try switching networks from within your wallet instead.",
    "disconnect": "Disconnect",
    "connected": "Connected"
  },

  "profile": {
    "disconnect": {
      "label": "Disconnect"
    },
    "copy_address": {
      "label": "Copy Address",
      "copied": "Copied!"
    },
    "explorer": {
      "label": "View more on explorer"
    },
    "transactions": {
      "description": "%{appName} transactions will appear here...",
      "description_fallback": "Your transactions will appear here...",
      "recent": {
        "title": "Recent Transactions"
      },
      "clear": {
        "label": "Clear All"
      }
    }
  },

  "wallet_connectors": {
    "argent": {
      "qr_code": {
        "step1": {
          "description": "Put Argent on your home screen for faster access to your wallet.",
          "title": "Open the Argent app"
        },
        "step2": {
          "description": "Create a wallet and username, or import an existing wallet.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
          "title": "Tap the Scan QR button"
        }
      }
    },

    "berasig": {
      "extension": {
        "step1": {
          "title": "Install the BeraSig extension",
          "description": "We recommend pinning BeraSig to your taskbar for easier access to your wallet."
        },
        "step2": {
          "title": "Create a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
        }
      }
    },

    "best": {
      "qr_code": {
        "step1": {
          "title": "Open the Best Wallet app",
          "description": "Add Best Wallet to your home screen for faster access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Create a new wallet or import an existing one."
        },
        "step3": {
          "title": "Tap the QR icon and scan",
          "description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
        }
      }
    },

    "bifrost": {
      "qr_code": {
        "step1": {
          "description": "We recommend putting Bifrost Wallet on your home screen for quicker access.",
          "title": "Open the Bifrost Wallet app"
        },
        "step2": {
          "description": "Create or import a wallet using your recovery phrase.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
          "title": "Tap the scan button"
        }
      }
    },

    "bitget": {
      "qr_code": {
        "step1": {
          "description": "We recommend putting Bitget Wallet on your home screen for quicker access.",
          "title": "Open the Bitget Wallet app"
        },
        "step2": {
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
          "title": "Tap the scan button"
        }
      },

      "extension": {
        "step1": {
          "description": "We recommend pinning Bitget Wallet to your taskbar for quicker access to your wallet.",
          "title": "Install the Bitget Wallet extension"
        },
        "step2": {
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
          "title": "Refresh your browser"
        }
      }
    },

    "bitski": {
      "extension": {
        "step1": {
          "description": "We recommend pinning Bitski to your taskbar for quicker access to your wallet.",
          "title": "Install the Bitski extension"
        },
        "step2": {
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
          "title": "Refresh your browser"
        }
      }
    },

    "bitverse": {
      "qr_code": {
        "step1": {
          "title": "Open the Bitverse Wallet app",
          "description": "Add Bitverse Wallet to your home screen for faster access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Create a new wallet or import an existing one."
        },
        "step3": {
          "title": "Tap the QR icon and scan",
          "description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
        }
      }
    },

    "bloom": {
      "desktop": {
        "step1": {
          "title": "Open the Bloom Wallet app",
          "description": "We recommend putting Bloom Wallet on your home screen for quicker access."
        },
        "step2": {
          "description": "Create or import a wallet using your recovery phrase.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "After you have a wallet, click on Connect to connect via Bloom. A connection prompt in the app will appear for you to confirm the connection.",
          "title": "Click on Connect"
        }
      }
    },

    "bybit": {
      "qr_code": {
        "step1": {
          "description": "We recommend putting Bybit on your home screen for faster access to your wallet.",
          "title": "Open the Bybit app"
        },
        "step2": {
          "description": "You can easily backup your wallet using our backup feature on your phone.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
          "title": "Tap the scan button"
        }
      },

      "extension": {
        "step1": {
          "description": "Click at the top right of your browser and pin Bybit Wallet for easy access.",
          "title": "Install the Bybit Wallet extension"
        },
        "step2": {
          "description": "Create a new wallet or import an existing one.",
          "title": "Create or Import a wallet"
        },
        "step3": {
          "description": "Once you set up Bybit Wallet, click below to refresh the browser and load up the extension.",
          "title": "Refresh your browser"
        }
      }
    },

    "binance": {
      "qr_code": {
        "step1": {
          "description": "We recommend putting Binance on your home screen for faster access to your wallet.",
          "title": "Open the Binance app"
        },
        "step2": {
          "description": "You can easily backup your wallet using our backup feature on your phone.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
          "title": "Tap the WalletConnect button"
        }
      }
    },

    "coin98": {
      "qr_code": {
        "step1": {
          "description": "We recommend putting Coin98 Wallet on your home screen for faster access to your wallet.",
          "title": "Open the Coin98 Wallet app"
        },
        "step2": {
          "description": "You can easily backup your wallet using our backup feature on your phone.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
          "title": "Tap the WalletConnect button"
        }
      },

      "extension": {
        "step1": {
          "description": "Click at the top right of your browser and pin Coin98 Wallet for easy access.",
          "title": "Install the Coin98 Wallet extension"
        },
        "step2": {
          "description": "Create a new wallet or import an existing one.",
          "title": "Create or Import a wallet"
        },
        "step3": {
          "description": "Once you set up Coin98 Wallet, click below to refresh the browser and load up the extension.",
          "title": "Refresh your browser"
        }
      }
    },

    "coinbase": {
      "qr_code": {
        "step1": {
          "description": "We recommend putting Coinbase Wallet on your home screen for quicker access.",
          "title": "Open the Coinbase Wallet app"
        },
        "step2": {
          "description": "You can easily backup your wallet using the cloud backup feature.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
          "title": "Tap the scan button"
        }
      },

      "extension": {
        "step1": {
          "description": "We recommend pinning Coinbase Wallet to your taskbar for quicker access to your wallet.",
          "title": "Install the Coinbase Wallet extension"
        },
        "step2": {
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
          "title": "Refresh your browser"
        }
      }
    },

    "compass": {
      "extension": {
        "step1": {
          "description": "We recommend pinning Compass Wallet to your taskbar for quicker access to your wallet.",
          "title": "Install the Compass Wallet extension"
        },
        "step2": {
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
          "title": "Refresh your browser"
        }
      }
    },

    "core": {
      "qr_code": {
        "step1": {
          "description": "We recommend putting Core on your home screen for faster access to your wallet.",
          "title": "Open the Core app"
        },
        "step2": {
          "description": "You can easily backup your wallet using our backup feature on your phone.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
          "title": "Tap the WalletConnect button"
        }
      },

      "extension": {
        "step1": {
          "description": "We recommend pinning Core to your taskbar for quicker access to your wallet.",
          "title": "Install the Core extension"
        },
        "step2": {
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
          "title": "Refresh your browser"
        }
      }
    },

    "fox": {
      "qr_code": {
        "step1": {
          "description": "We recommend putting FoxWallet on your home screen for quicker access.",
          "title": "Open the FoxWallet app"
        },
        "step2": {
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
          "title": "Tap the scan button"
        }
      }
    },

    "frontier": {
      "qr_code": {
        "step1": {
          "description": "We recommend putting Frontier Wallet on your home screen for quicker access.",
          "title": "Open the Frontier Wallet app"
        },
        "step2": {
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
          "title": "Tap the scan button"
        }
      },

      "extension": {
        "step1": {
          "description": "We recommend pinning Frontier Wallet to your taskbar for quicker access to your wallet.",
          "title": "Install the Frontier Wallet extension"
        },
        "step2": {
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
          "title": "Refresh your browser"
        }
      }
    },

    "im_token": {
      "qr_code": {
        "step1": {
          "title": "Open the imToken app",
          "description": "Put imToken app on your home screen for faster access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Create a new wallet or import an existing one."
        },
        "step3": {
          "title": "Tap Scanner Icon in top right corner",
          "description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."
        }
      }
    },

    "iopay": {
      "qr_code": {
        "step1": {
          "description": "We recommend putting ioPay on your home screen for faster access to your wallet.",
          "title": "Open the ioPay app"
        },
        "step2": {
          "description": "You can easily backup your wallet using our backup feature on your phone.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
          "title": "Tap the WalletConnect button"
        }
      }
    },

    "kaikas": {
      "extension": {
        "step1": {
          "description": "We recommend pinning Kaikas to your taskbar for quicker access to your wallet.",
          "title": "Install the Kaikas extension"
        },
        "step2": {
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
          "title": "Refresh your browser"
        }
      },
      "qr_code": {
        "step1": {
          "title": "Open the Kaikas app",
          "description": "Put Kaikas app on your home screen for faster access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Create a new wallet or import an existing one."
        },
        "step3": {
          "title": "Tap Scanner Icon in top right corner",
          "description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."
        }
      }
    },

    "kaia": {
      "extension": {
        "step1": {
          "description": "We recommend pinning Kaia to your taskbar for quicker access to your wallet.",
          "title": "Install the Kaia extension"
        },
        "step2": {
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
          "title": "Refresh your browser"
        }
      },
      "qr_code": {
        "step1": {
          "title": "Open the Kaia app",
          "description": "Put Kaia app on your home screen for faster access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Create a new wallet or import an existing one."
        },
        "step3": {
          "title": "Tap Scanner Icon in top right corner",
          "description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."
        }
      }
    },

    "kraken": {
      "qr_code": {
        "step1": {
          "title": "Open the Kraken Wallet app",
          "description": "Add Kraken Wallet to your home screen for faster access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Create a new wallet or import an existing one."
        },
        "step3": {
          "title": "Tap the QR icon and scan",
          "description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
        }
      }
    },

    "kresus": {
      "qr_code": {
        "step1": {
          "title": "Open the Kresus Wallet app",
          "description": "Add Kresus Wallet to your home screen for faster access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Create a new wallet or import an existing one."
        },
        "step3": {
          "title": "Tap the QR icon and scan",
          "description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
        }
      }
    },

    "magicEden": {
      "extension": {
        "step1": {
          "title": "Install the Magic Eden extension",
          "description": "We recommend pinning Magic Eden to your taskbar for easier access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret recovery phrase with anyone."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
        }
      }
    },

    "metamask": {
      "qr_code": {
        "step1": {
          "title": "Open the MetaMask app",
          "description": "We recommend putting MetaMask on your home screen for quicker access."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Tap the scan button",
          "description": "After you scan, a connection prompt will appear for you to connect your wallet."
        }
      },

      "extension": {
        "step1": {
          "title": "Install the MetaMask extension",
          "description": "We recommend pinning MetaMask to your taskbar for quicker access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
        }
      }
    },

    "nestwallet": {
      "extension": {
        "step1": {
          "title": "Install the NestWallet extension",
          "description": "We recommend pinning NestWallet to your taskbar for quicker access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
        }
      }
    },

    "okx": {
      "qr_code": {
        "step1": {
          "title": "Open the OKX Wallet app",
          "description": "We recommend putting OKX Wallet on your home screen for quicker access."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Tap the scan button",
          "description": "After you scan, a connection prompt will appear for you to connect your wallet."
        }
      },

      "extension": {
        "step1": {
          "title": "Install the OKX Wallet extension",
          "description": "We recommend pinning OKX Wallet to your taskbar for quicker access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
        }
      }
    },

    "omni": {
      "qr_code": {
        "step1": {
          "title": "Open the Omni app",
          "description": "Add Omni to your home screen for faster access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Create a new wallet or import an existing one."
        },
        "step3": {
          "title": "Tap the QR icon and scan",
          "description": "Tap the QR icon on your home screen, scan the code and confirm the prompt to connect."
        }
      }
    },

    "1inch": {
      "qr_code": {
        "step1": {
          "description": "Put 1inch Wallet on your home screen for faster access to your wallet.",
          "title": "Open the 1inch Wallet app"
        },
        "step2": {
          "description": "Create a wallet and username, or import an existing wallet.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
          "title": "Tap the Scan QR button"
        }
      }
    },

    "token_pocket": {
      "qr_code": {
        "step1": {
          "title": "Open the TokenPocket app",
          "description": "We recommend putting TokenPocket on your home screen for quicker access."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Tap the scan button",
          "description": "After you scan, a connection prompt will appear for you to connect your wallet."
        }
      },

      "extension": {
        "step1": {
          "title": "Install the TokenPocket extension",
          "description": "We recommend pinning TokenPocket to your taskbar for quicker access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
        }
      }
    },

    "trust": {
      "qr_code": {
        "step1": {
          "title": "Open the Trust Wallet app",
          "description": "Put Trust Wallet on your home screen for faster access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Create a new wallet or import an existing one."
        },
        "step3": {
          "title": "Tap WalletConnect in Settings",
          "description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."
        }
      },

      "extension": {
        "step1": {
          "title": "Install the Trust Wallet extension",
          "description": "Click at the top right of your browser and pin Trust Wallet for easy access."
        },
        "step2": {
          "title": "Create or Import a wallet",
          "description": "Create a new wallet or import an existing one."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up Trust Wallet, click below to refresh the browser and load up the extension."
        }
      }
    },

    "uniswap": {
      "qr_code": {
        "step1": {
          "title": "Open the Uniswap app",
          "description": "Add Uniswap Wallet to your home screen for faster access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Create a new wallet or import an existing one."
        },
        "step3": {
          "title": "Tap the QR icon and scan",
          "description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
        }
      }
    },

    "zerion": {
      "qr_code": {
        "step1": {
          "title": "Open the Zerion app",
          "description": "We recommend putting Zerion on your home screen for quicker access."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Tap the scan button",
          "description": "After you scan, a connection prompt will appear for you to connect your wallet."
        }
      },

      "extension": {
        "step1": {
          "title": "Install the Zerion extension",
          "description": "We recommend pinning Zerion to your taskbar for quicker access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
        }
      }
    },

    "rainbow": {
      "qr_code": {
        "step1": {
          "title": "Open the Rainbow app",
          "description": "We recommend putting Rainbow on your home screen for faster access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "You can easily backup your wallet using our backup feature on your phone."
        },
        "step3": {
          "title": "Tap the scan button",
          "description": "After you scan, a connection prompt will appear for you to connect your wallet."
        }
      }
    },

    "enkrypt": {
      "extension": {
        "step1": {
          "description": "We recommend pinning Enkrypt Wallet to your taskbar for quicker access to your wallet.",
          "title": "Install the Enkrypt Wallet extension"
        },
        "step2": {
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
          "title": "Refresh your browser"
        }
      }
    },

    "frame": {
      "extension": {
        "step1": {
          "description": "We recommend pinning Frame to your taskbar for quicker access to your wallet.",
          "title": "Install Frame & the companion extension"
        },
        "step2": {
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
          "title": "Refresh your browser"
        }
      }
    },

    "one_key": {
      "extension": {
        "step1": {
          "title": "Install the OneKey Wallet extension",
          "description": "We recommend pinning OneKey Wallet to your taskbar for quicker access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
        }
      }
    },

    "paraswap": {
      "qr_code": {
        "step1": {
          "title": "Open the ParaSwap app",
          "description": "Add ParaSwap Wallet to your home screen for faster access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Create a new wallet or import an existing one."
        },
        "step3": {
          "title": "Tap the QR icon and scan",
          "description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
        }
      }
    },

    "phantom": {
      "extension": {
        "step1": {
          "title": "Install the Phantom extension",
          "description": "We recommend pinning Phantom to your taskbar for easier access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret recovery phrase with anyone."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
        }
      }
    },

    "rabby": {
      "extension": {
        "step1": {
          "title": "Install the Rabby extension",
          "description": "We recommend pinning Rabby to your taskbar for quicker access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
        }
      }
    },

    "ronin": {
      "qr_code": {
        "step1": {
          "description": "We recommend putting Ronin Wallet on your home screen for quicker access.",
          "title": "Open the Ronin Wallet app"
        },
        "step2": {
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "After you scan, a connection prompt will appear for you to connect your wallet.",
          "title": "Tap the scan button"
        }
      },

      "extension": {
        "step1": {
          "description": "We recommend pinning Ronin Wallet to your taskbar for quicker access to your wallet.",
          "title": "Install the Ronin Wallet extension"
        },
        "step2": {
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
          "title": "Create or Import a Wallet"
        },
        "step3": {
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
          "title": "Refresh your browser"
        }
      }
    },

    "ramper": {
      "extension": {
        "step1": {
          "title": "Install the Ramper extension",
          "description": "We recommend pinning Ramper to your taskbar for easier access to your wallet."
        },
        "step2": {
          "title": "Create a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
        }
      }
    },

    "safeheron": {
      "extension": {
        "step1": {
          "title": "Install the Core extension",
          "description": "We recommend pinning Safeheron to your taskbar for quicker access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
        }
      }
    },

    "taho": {
      "extension": {
        "step1": {
          "title": "Install the Taho extension",
          "description": "We recommend pinning Taho to your taskbar for quicker access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
        }
      }
    },

    "wigwam": {
      "extension": {
        "step1": {
          "title": "Install the Wigwam extension",
          "description": "We recommend pinning Wigwam to your taskbar for quicker access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
        }
      }
    },

    "talisman": {
      "extension": {
        "step1": {
          "title": "Install the Talisman extension",
          "description": "We recommend pinning Talisman to your taskbar for quicker access to your wallet."
        },
        "step2": {
          "title": "Create or Import an Ethereum Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your recovery phrase with anyone."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
        }
      }
    },

    "xdefi": {
      "extension": {
        "step1": {
          "title": "Install the XDEFI Wallet extension",
          "description": "We recommend pinning XDEFI Wallet to your taskbar for quicker access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
        }
      }
    },

    "zeal": {
      "qr_code": {
        "step1": {
          "title": "Open the Zeal app",
          "description": "Add Zeal Wallet to your home screen for faster access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Create a new wallet or import an existing one."
        },
        "step3": {
          "title": "Tap the QR icon and scan",
          "description": "Tap the QR icon on your homescreen, scan the code and confirm the prompt to connect."
        }
      },
      "extension": {
        "step1": {
          "title": "Install the Zeal extension",
          "description": "We recommend pinning Zeal to your taskbar for quicker access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
        }
      }
    },

    "safepal": {
      "extension": {
        "step1": {
          "title": "Install the SafePal Wallet extension",
          "description": "Click at the top right of your browser and pin SafePal Wallet for easy access."
        },
        "step2": {
          "title": "Create or Import a wallet",
          "description": "Create a new wallet or import an existing one."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up SafePal Wallet, click below to refresh the browser and load up the extension."
        }
      },
      "qr_code": {
        "step1": {
          "title": "Open the SafePal Wallet app",
          "description": "Put SafePal Wallet on your home screen for faster access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Create a new wallet or import an existing one."
        },
        "step3": {
          "title": "Tap WalletConnect in Settings",
          "description": "Choose New Connection, then scan the QR code and confirm the prompt to connect."
        }
      }
    },

    "desig": {
      "extension": {
        "step1": {
          "title": "Install the Desig extension",
          "description": "We recommend pinning Desig to your taskbar for easier access to your wallet."
        },
        "step2": {
          "title": "Create a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
        }
      }
    },

    "subwallet": {
      "extension": {
        "step1": {
          "title": "Install the SubWallet extension",
          "description": "We recommend pinning SubWallet to your taskbar for quicker access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your recovery phrase with anyone."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
        }
      },
      "qr_code": {
        "step1": {
          "title": "Open the SubWallet app",
          "description": "We recommend putting SubWallet on your home screen for quicker access."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Tap the scan button",
          "description": "After you scan, a connection prompt will appear for you to connect your wallet."
        }
      }
    },

    "clv": {
      "extension": {
        "step1": {
          "title": "Install the CLV Wallet extension",
          "description": "We recommend pinning CLV Wallet to your taskbar for quicker access to your wallet."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Refresh your browser",
          "description": "Once you set up your wallet, click below to refresh the browser and load up the extension."
        }
      },
      "qr_code": {
        "step1": {
          "title": "Open the CLV Wallet app",
          "description": "We recommend putting CLV Wallet on your home screen for quicker access."
        },
        "step2": {
          "title": "Create or Import a Wallet",
          "description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone."
        },
        "step3": {
          "title": "Tap the scan button",
          "description": "After you scan, a connection prompt will appear for you to connect your wallet."
        }
      }
    },

    "okto": {
      "qr_code": {
        "step1": {
          "title": "Open the Okto app",
          "description": "Add Okto to your home screen for quick access"
        },
        "step2": {
          "title": "Create an MPC Wallet",
          "description": "Create an account and generate a wallet"
        },
        "step3": {
          "title": "Tap WalletConnect in Settings",
          "description": "Tap the Scan QR icon at the top right and confirm the prompt to connect."
        }
      }
    },

    "ledger": {
      "desktop": {
        "step1": {
          "title": "Open the Ledger Live app",
          "description": "We recommend putting Ledger Live on your home screen for quicker access."
        },
        "step2": {
          "title": "Set up your Ledger",
          "description": "Set up a new Ledger or connect to an existing one."
        },
        "step3": {
          "title": "Connect",
          "description": "A connection prompt will appear for you to connect your wallet."
        }
      },
      "qr_code": {
        "step1": {
          "title": "Open the Ledger Live app",
          "description": "We recommend putting Ledger Live on your home screen for quicker access."
        },
        "step2": {
          "title": "Set up your Ledger",
          "description": "You can either sync with the desktop app or connect your Ledger."
        },
        "step3": {
          "title": "Scan the code",
          "description": "Tap WalletConnect then Switch to Scanner. After you scan, a connection prompt will appear for you to connect your wallet."
        }
      }
    },

    "valora": {
      "qr_code": {
        "step1": {
          "title": "Open the Valora app",
          "description": "We recommend putting Valora on your home screen for quicker access."
        },
        "step2": {
          "title": "Create or import a wallet",
          "description": "Create a new wallet or import an existing one."
        },
        "step3": {
          "title": "Tap the scan button",
          "description": "After you scan, a connection prompt will appear for you to connect your wallet."
        }
      }
    }
  }
}
`;function tIt(e,t){return Object.defineProperty(e,"__recipe__",{value:t,writable:!1}),e}var cMe=tIt;function uMe(e){var{conditions:t}=e;if(!t)throw new Error("Styles have no conditions");function n(r){if(typeof r=="string"||typeof r=="number"||typeof r=="boolean"){if(!t.defaultCondition)throw new Error("No default condition");return{[t.defaultCondition]:r}}if(Array.isArray(r)){if(!("responsiveArray"in t))throw new Error("Responsive arrays are not supported");var s={};for(var a in t.responsiveArray)r[a]!=null&&(s[t.responsiveArray[a]]=r[a]);return s}return r}return cMe(n,{importPath:"@vanilla-extract/sprinkles/createUtils",importName:"createNormalizeValueFn",args:[{conditions:e.conditions}]})}function nIt(e){var{conditions:t}=e;if(!t)throw new Error("Styles have no conditions");var n=uMe(e);function r(s,a){if(typeof s=="string"||typeof s=="number"||typeof s=="boolean"){if(!t.defaultCondition)throw new Error("No default condition");return a(s,t.defaultCondition)}var o=Array.isArray(s)?n(s):s,l={};for(var c in o)o[c]!=null&&(l[c]=a(o[c],c));return l}return cMe(r,{importPath:"@vanilla-extract/sprinkles/createUtils",importName:"createMapValueFn",args:[{conditions:e.conditions}]})}function rIt(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sIt(e){var t=rIt(e,"string");return typeof t=="symbol"?t:String(t)}function iIt(e,t,n){return t=sIt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xge(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function jV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xge(Object(n),!0).forEach(function(r){iIt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xge(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var aIt=e=>function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var s=Object.assign({},...n.map(c=>c.styles)),a=Object.keys(s),o=a.filter(c=>"mappings"in s[c]),l=c=>{var u=[],d={},f=jV({},c),x=!1;for(var g of o){var v=c[g];if(v!=null){var w=s[g];x=!0;for(var C of w.mappings)d[C]=v,f[C]==null&&delete f[C]}}var N=x?jV(jV({},d),f):c,I=function(){var F=N[P],U=s[P];try{if(U.mappings)return 1;if(typeof F=="string"||typeof F=="number")u.push(U.values[F].defaultClass);else if(Array.isArray(F))for(var L=0;L<F.length;L++){var z=F[L];if(z!=null){var X=U.responsiveArray[L];u.push(U.values[z].conditions[X])}}else for(var ne in F){var J=F[ne];J!=null&&u.push(U.values[J].conditions[ne])}}catch(Z){throw Z}};for(var P in N)I();return e(u.join(" "))};return Object.assign(l,{properties:new Set(a)})},oIt=e=>e,lIt=function(){return aIt(oIt)(...arguments)};function dMe(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=dMe(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function fMe(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=dMe(e))&&(r&&(r+=" "),r+=t);return r}var cIt="AEkU4AngDVgB0QKRAQYBOwDqATEAnwDbAIUApABsAOAAbwCRAEYAiQBPAHYAPgA+ACsANwAlAGMAHwAvACsAJQAWAC8AGwAiACIALwAUACsAEQAiAAsAGwARABcAGAA6ACkALAAsADUAFgAsABEAHQAhAA8AGwAdABUAFgAZAA0ADQAXABAAGQAUABIEqgYJAR4UFjfDBdMAsQCuPwFnAKUBA10jAK5/Ly8vLwE/pwUJ6/0HPwbkMQVXBVgAPSs5APa2EQbIwQuUCkEDyJ4zAsUKLwKOoQKG2D+Ob4kCxcsCg/IBH98JAPKtAUECLY0KP48A4wDiChUAF9S5yAwLPZ0EG3cA/QI5GL0P6wkGKekFBIFnDRsHLQCrAGmR76WcfwBbBpMjBukAGwA7DJMAWxVbqfu75wzbIM8IuykDsRQ7APcta6MAoX0YABcEJdcWAR0AuRnNBPoJIEw3CZcJiB4bVllM44NCABMADAAVAA5rVAAhAA4AR+4V2D3zOVjKleYuChAdX01YPewAEwAMABUADmsgXECXAMPrABsAOQzFABsVW6n7Adq4HB0FWwXiAtCfAsSwCkwcpGUUcxptTPUAuw1nAuEACy00iRfJkQKBewETGwC9DWcC4QALLQFIUCWRTAoDLfsFMgnXaRetAddDAEkrEncCMRYhAusnuTdrADnhAfUlAMcOy7UBG2OBALEFAAUAitNJBRvDHwcXAKgn0QGhKy0DmwBnAQoZPu03dAQYFwCqAccCIQDTKxJzOvNQsAWQOncnNUgF+icFWQVYr7gFaTtdQhI6WEGXe5NmX6H4CxMDxQcl8XcjBKNLAlNTAnUbqycBj6OlNVsDRRcEg2EJANEGqz8vIwcpAjldAGsBYR9xAIMdGQCVAUm3ACdpFwGvxQM3LSFDUwFvWQZlAmUA8UkXAykBBQBJQQCrAF0AcwArtQYH8+8ZjX8ACSEAKQCzG0cB0QHbBwsxl3iB6AAKABEANAA9ADgzd3nTwBBfEFwBTQlMbDoVCwKsD6YL5REVDNEqy9PYADSpB+sDUwfrA1MDUwfrB+sDUwfrA1MDUwNTA1McCvAa08AQXw9IBG0FjgWLBNYIgyZJEYEHKAjSVA10HhxHA0UA/CMlSRw7kzMLJUJMDE0DB/w2QmynfTgDRzGrVPWQogPLMk85bAEecRKgACoPcxw1tU5+ekdxoApLT661f0liTmcCvjqoP/gKIQmTb7t3TgY9EBcnoRDzDC8BsQE3DelL1ATtBjcExR95GRUPyZWYCKEt2QzpJt8unYBWI/EqfwXpS/A82QtJUWQPVQthCd86X4FKAx0BCSKHCtkNNQhpEO8KxWcN4RFBBzUD0UmWAKEG/QsNHTEVsSYMYqgLBTlzBvca8guLJqsTJXr4Bc8aHQZJASUa+wDLLuOFrFotXBhPWwX/CyEjwxSkUBwNIUCzeEQaFwcRJaUCjUNsSoNRMh6PIfI8OQ1iLg9ReAfxPAEZSwt9PJpGp0UKEc4+iT1EIkVMKAQxeywrJ4cJyw+BDLV8bgFVCR0JrQxtEy0REzfBCDUHFSmXICcRCB1GkWCWBPObA+8TzQMHBTsJPQcPA7EcKRMqFSUFCYEg0wLvNtEurwKLVnwBEwXHDyEf2xBMR9wO5QiXAmEDfyXnACkVHQATIpcIP18AW4/UUwEuxwjDamgjcANjFONdEW8HjQ5TB6McLxW7HN1wxF4HhgQon6sJVwFxCZUBWwTfCAU1V4ycID1nT4tUGJcgXUE7XfgCLQxhFZtEuYd0AocPZxIXATEBbwc1DP0CcxHpEWcQkQjnhgA1sTP0OiEESyF/IA0KIwNLbMoLIyb1DPRlAZ8SXgMINDl36menYLIgF/kHFTLBQVwh7QuOT8kMmBq9GD5UKhngB7sD7xrvJ+ZBUwX7A58POkkz6gS5C2UIhwk7AEUOnxMH0xhmCm2MzAEthwGzlQNTjX8Ca4sGMwcHAGMHgwV14QAZAqMInwABAMsDUwA1AqkHmQAVAIE9ATkDIysBHeECiwOPCC3HAZErAe8lBBe/DBEA8zNuRgLDrQKAZmaeBdlUAooCRTEBSSEEAUpDTQOrbd0A1wBHBg/bQwERp0bHFt8/AdtrJwDDAPcAATEHAT0ByQHvaQCzAVsLLQmer7EBSeUlAH8AEWcB0wKFANkAMQB77QFPAEkFVfUFzwJLRQENLRQnU10BtwMbAS8BCQB1BseJocUDGwRpB88CEBcV3QLvKgexAyLbE8lCwQK92lEAMhIKNAq1CrQfX/NcLwItbj1MAAofpD7DP0oFTTtPO1Q7TztUO087VDtPO1Q7TztUA5O73rveCmhfQWHnDKIN0ETEOkUT12BNYC4TxC2zFL0VyiVSGTkauCcBJeBVBQ8ALc9mLAgoNHEXuAA7KWSDPWOCHiwKRxzjU41U9C0XAK1LnjOrDagbEUQ8BUN16WImFgoKHgJkfQJiPldJq1c3HAKh8wJolAJmBQKfgDgXBwJmNwJmIgRqBHsDfw8Dfo45AjlzEzl+Oh8fAmwZAjIyOAYCbcMCbarrhi9jQScBYwDaAN0ARgEHlAyJAPoHvgAJsQJ3KwJ2njsCeUc/Ani2GVjXRapG0wJ8OwJ6xAJ9BQJ87AVVBRxH/Eh5XyAAJxFJVEpXERNKyALQ/QLQyEsjA4hLA4fiRMGRLgLynVz/AwOqS8pMKSHLTUhNqwKLOwKK1L0XAxk/YwGzAo4zAo5YPJN9Ao7VAo5YdFGwUzEGUtBUgQKT9wKTCADlABhVGlWrVcwCLBcpkYIy3XhiRTc1ApebAu+uWB2kAFUhApaLApZ4mAClWahaBX1JADcClrEClkpcQFzNApnHAplgXMZdAxUCnJc5vjqZApwSAp+XAp60hgAZCy0mCwKd7QKejgCxOWEwYesCns8CoGoBpQKemxsCnkqhY8RkIyEnAierAiZ6AqD3AqBIAqLZAqHAAqYrAqXKAqf7AHkCp+5oeGit/0VqGGrNAqzfAqyqAq1jAqz+AlcZAlXYArHd0wMfSmyTArK5CQKy5BNs3G1fbURbAyXJArZYNztujAMpQQK4WgK5QxECuSZzcDJw3QK9FQK71nCSAzINAr6Ecf4DM20CvhZzHnNLAsPHAsMAc350RzFBdNwDPKMDPJYDPbsCxXgCxkMCxgyFAshlTQLIQALJSwLJKgJkmQLdznh1XXiqeSFLzAMYn2b+AmHwGe+VIHsHXo5etw0Cz2cCz2grR0/O7w+bAMKpAs9vASXmA04OfkcBAtwjAtuGAtJLA1JYA1NbAP0DVYiAhTvHEulcQYIYgs+CyoOJAtrDAtnahAyERac4A4ahACsDZAqGbVX1AFEC32EC3rRvcwLiK+0QAfMsIwH0lwHyzoMC6+8C6Wx1Aur1AurgAPVDAbUC7oUC65iWppb/Au47A4XcmHVw3HGdAvL/AGUDjhKZjwL3DwORagOSgwL3lAL51QL4YpoYmqe3M5saA51/Av72ARcANZ8Yn68DBYkDpmYDptUAzcEDBmahhKIBBQMMRQELARsHaQZdtWMBALcEZ7sNhx6vCQATcTUAHwMvEkkDhXsBXyMdAIzrAB0A5p8Dm40IswYbn8EApwURu+kdPT4WeAVoNz5AK0IhQrRfcRFfvACWxQUyAJBMGZu5OyZgMhG6zw4vGMYYicn2BVcFWAVXBVgFYwVYBVcFWAVXBVgFVwVYBVcFWEYVCNeFZwICAgpkXukrBMkDsQYvu7sAuwSnuwDnQCkWsgVGPmk+cEI/QrZfdTdf6ABYETOrAIz+zGvL/KbnRno9JiMEKxYnNjV+bd9qwfEZwixpAWvXbjAXBV8FasnBybgIz0lbAAAACnxefYu+ADM/gQADFtEG5a0jBQCMwwsDAQ0A5WUdPSQfSkKxQrxBOCNfJ2A2JzgjCcE9CkQ/Qz54PoE+cD5xAolCvElCO1/LTk9qTQosa1QvagtuH1/gMzobCWebCmIjKzwdJkKrQrwrzAHL/F/JDh8uCQgJIn6d32o6LUoXyavJrAllwcvMCmBBXw/lEKMRAJONHUVCJRupbTnOOAozP0M+cEI/HAcKHUxHbFssLVrhvBIKfe0dK0I/HF0ISgkOM1RDQjcEO0OcLAqBGy1CPxv1CFMiIxgwMQAFj2HwXgpxZMlgC2AtI25DYBk5AhseYLMGAmsQZU5gTREBZOdgFWCVYH1gs2BLYJFoFhcGtQ7cVam8WgtDFqsBuyvNwQIfFQAcAx4BeQJsLzCVUoABigq4RxoA5CN0jgrKDaZN6gGbAoecTwVAXwD39wkANBZXDAulDCQfuq9HAE8MNAAVE58rggh6AtILS2URGwDYTgZ1BAoeWgAxALa4AZonCxZvqyQ4nxkBWwGGCfwD2e0PBqoGSga5AB3LValaCbthE4kLLT8OuwG7ASICR1ooKCggHh8hLBImBiEMjQBUAm5XkEmVAW4fD3FHAdN1D85RIBmpsE3qBxEFTF8A9/cKAHoGJGwKKwulODAtx69WDQsAX7wLAGNAlQh6AOpN7yIbvwAxALa4AZonLTsOzgKQGHtQu1jIdHKO16WbDvWZFT0b7AEpEFwSBg8bAccJOhCTBRArDDYLABEAs84BAgCkAOEAmIIABWtXLwAUAFsbxi5sdioNwRACOyQz0+EcHgsbfQJ7Ls6hHATBCqrxbAA3OS0Opge7CQAQOi7OERkAfavaHA+7GkcczaF3HgE9Kl8cAuugCAHCAULz5B9lAb4Jtwz6CDwKPgAFwAs9AksNuwi8DTwKvC7OoSoJPA67BZgBG2sKD4sa4QHDARELuxY7AKALOxC7BBige9wAO2sMPAACpgm8BRvQ9QUBvgH6bsoGewAHuwG7D00RErwBAQDqAQAAdBVbBhbLFPxvF7sYOwAuuwLrDlaouwAeuwJVICp/AAG7AALjAAg7FTwVuwAbuwG9KOClWw6/xAD0AGj7L7ZtvgNIo7vIqDsDAbuVJ0sAAlsACrsEAOfdGbsIGnsIoQUK/3AA37unuxjbGruji3lyBvupm4MAErsGGwsBvAAAhgBtuwYAC7unOwEaO7oIoZzKAbsL7QfAqTsA4XsBvwAA5QAVuwAG+wAJuwBpiwAauwAOuwIYu45pFfsAAVsADmsALkseAAa7ABe7CCEADUoBwgC3ryYBwAAAtAAOmwG+J+QAsloAHBsBv/7hCqEABcYLFRXbAAebAEK7AQIAabsAC3sAHbsACLsJoQAFygBunxnVAJEIIQAFygABOwAH2wAdmwghAAaaAAl7ABsrAG0bAOa7gAAIWwAUuwkhAAbKAOOLAAk7C6EOxPtfAAc7AG6cQEgARwADOwAJrQM3AAcbABl7Abv/Aab7AAobAAo7AAn7p+sGuwAJGwADCwAQOwAAFDsAEWsAD4sADesADbsAGQsGFhsAFTsAbpsWswG7ALoAEzsDAGkrCgDhSwACOwAEUgAXewUbAAbQABi7AAv7AF+7AGv7AOSLAbsAF3YBvAABcguhAAVKHgF7KFIAOUUA/gcNDHIAKCpwAaQFCF4BvF4jDAkHb0tsXyqJHzwUYi02A6EKtAHYABYC0QNuAXZyR1IUIQNPAhU+ASwGA3NGvHtSekAAKQAxAfsAUwrbAHuQLAErAHblDREyRgFKAFcFAAFQAQeKzAB4OwQgpQBaANYVAJVoNx+LAM1rsQDP1BYIwnVzGxhWHQnRAYiQqyJTU01IEjzCifkAfxw3QCkr4BGXTwByASksMClCGQ8DMFUE98XuAEtl3ABqAnECPxF6Osd4LjXVBgUAEBsdCggMKgQfHSlOU04IuboAChLNACYAARoAhgCJAI41AO4AtADgAJ08ALsAqwCmAKEA8gCfANMAnADrAQwBBwDAAHkAWgDLAM0BBwDXAOsAiACiATUA4wDYANUDAQcqM9TU1NS2wNzN0M5DMhcBTQFXL0cBVQFkAWMBVgFHS0NFaA0BThUHCAMyNgwHACINJCYpLDg6Oj09PT4/DkAeUVFRUVNTUlMpVFVXVlYcXWFhYGJhI2ZocG9ycnJycnJ0dHR0dHR0dHR0dHZ2d3Z1WwBA7ABFAJYAdAAuAGLyAIoAUwBTADMCc+kAh//y8gBgAI/sAJsASwBeAGD5+aoAgQCBAGUAUgCtAB4AsgB/AjwCPwD4AOMA+gD6AOQA+wDlAOUA5ADiACkCdwFNATwBOgFQAToBOgE6ATUBNAE0ATQBGAFUDwArCAAATRcKFgMVFg4AigCSAKIASwBkGAItAHAAaQCRAxIDJCoDHkE+RykAiwJLAMMCUwKgALoCkgKSApICkgKSApIChwKSApICkgKSApICkgKRApEClAKcApMCkgKSApACkAKQApACjgKRAnEB0AKTApsCkgKSApEWeQsA+gUDpwJdAjYXAVAQNQLeEQorEwFKNxNNkQF3pDwBZVkA/wM9RwEAAJMpHhiPagApYABpAC4AiQOUzIvwroRaBborDsIRAZ3VdCoLBCMxbAEzWmwBsgDdfoB/foB+gYKCfoOGhH6FiIaAh4KIgol+in6LfoyKjX6Ofo+CkH6RfpJ+k36Ug5WIloKXftoC2WzhAtdsAIJsJGygAINsbARCBD8EQQREBEIESARFBEAERgRIBEcEQwRFBEgAlmZsAKMDh2wAtGYBBWwAyVFsbADPbAIMbAD2WmwA9gEZAPYA9AD0APUA9AN8XmzUhCNlvwD2APQA9AD1APQcbGwAiVpsAPYAiQEZAPYAiQLsAPYAiQN8XmzUhCNlvxxsAPdabAEZAPYA9gD0APQA9QD0APcA9AD0APUA9AN8XmzUhCNlvxxsbACJWmwBGQD2AIkA9gCJAuwA9gCJA3xebNSEI2W/HGwCQwE2bAJKATlsAkvBbGwCV2xsA54C7AOeA54DnwOfA58DnwN8XmzUhCNlvxxsbACJWmwBGQOeAIkDngCJAuwDngCJA3xebNSEI2W/HGwEN2wAiQQ4AIkGjTFtIC9s1m4DJmwA/QDGWgJsbABVWv4UMgJsbACJAmwAVAEAuV5sAmxebGwAiV5sAmxebD3YAEls1gJsbEZFNiJ9FGVAe8xvEZKvxVfKZszAVTBzYBH2d1iyUXEHH7twNw7eZF5JJRHI5EgaRr5D20/3dfONrFLSq5qSrrgd2CEUq722WBQ/LzpA+bx1oREI5xy4BDSZNun0ZWORUJqInZSyMaioyvfSI0l5uFDzbWaQ28/zdB0hwR4OQZ0/jn9ALSLNikjFYGfqR389qtFlhD3a6KdIh97rhZYpywuLc7o8ql5/X8KCbPU3L/QlmCowhRXhsGDvg6wUNprA9bM/49uxlAj7ZVy3ouEY/BgFXBNyK0TLrSjZWeJm/T4nz6QGLT3cJNtWRZVZTvIdtaxMMJRHgig9+S11LjBh7Inr06ykoch1U097Rw0hvgmOrydQyaWcEQDg0RavuMuT0zYabUZl1e33HNSK1oNUCS03eh+9C2EvF3fq9h+XBaAMFuoWeZf+mfZgL4HzyiKDIUtfNU4oFu0aE9qt3VA3U4D3fOSrAcYVnjG3cSkp1vhXZnp3JQm4JknKdBitO2NVnGCYQwU3YMWHWB87NEd+4AHuOKI8BSIH92reW0pfs+kWCTJxDCbRjFv8Cfc4/DSBYJScJYTeAEgg9wTEvcwd/QuHRHqGzAQ4fXf5FUI1lPrO+fvEcPl4JInM1z9AtBT2bL4QYEREe7KiSnnxTwtmAFjn8lqT3mND8qTktX2F16Ae9cakqJ6/pEQsHURqyqWlRMCzKXRKfCHT7sYHWx9/T/ugYTFY6iVN3Btm58ATJR5alYZybKMWojwOw3HbFn23NFyeLl7+Er82RchyYuBoGQ3j7SAWNxiYvp5U+Fq/DEzB9cG5DlJWsqkosRze92OVlCtQEYo1S1lF72Z8xWc4ld/+fFcfTEDTFb9d8tJGQ75dpJEvcWyGmGBiTbiWDdGOcw93Dmxq5ISUrmasygONfHLvhgo83HQZenbdBtSzBkvYrCEQ/xEDMhMZsN6gqplx5jGG9mSQLhM81UEdEeJ59sdNJDAFy/gPyJoKlwPZgB/MkC/kICLiCB8va+nCdO2ry4aDfkmPFpF/H/SGQ3LJ6aAv9dtJ8DniHtLOckZix0BVb0iR5V3LAp521LBSIi6AtV7r2ZB/hQEvAw54EFNOQcFnl1xGUIc67tqK1INNwD2n/RbwgzO9h45LM6VMuN8V1ZNIQ6t+Xy3lTqyVCD5kqLy/t3/b8MLbgDg8JIWDkSZ+LrGhhr+gYpH+pr1TnCUnZPjpUdw6bSL6MWVXoDDciQDWECwU2e6VEpfrcOBbrSOijqGkEIoJPbpmeJLkcwbvA0yWIixQVjo0HnYh7fji+Dfdq1mtV1lG2Zz9R7eFMHS+FK7nybutu2fwzDpFldO2pZBshsHJWaltn3PWOoGJpCT2jE8EHOuC6FkejNWcfsWCqNqMLP9xTwcWArj2EiiI7D+EaDi7/2cqHL1gPiF6C/J7aUo7RQqogPZ11WqbyP97nsoMxPOC78wZMF7B1Y0g7JNXJV/nN1m4xx8hbqWz07KSaqr5hE4icB326DMR/vUKX9LoNjle/ZWtbUhrTAcsdgrLlG5Ne8aiR0bS/2ZhpNOVVxavWIZsEM/rd68EB4vjbbD13NkMK1qvMk74vGbSkL7ULO0sZ9R6APSCo6KH+Xn98wEdw1bCPAnDTaBsD6sidAGN58uiH4a3ovG1KyZAu2XtyGgF/vgWKGxw9R1lfAVcfuYE71DHuxtTzfGZnHaDpDGWmfEq0N4GawE7yIkaoz8jcmVmzJe1ydM8q0p08YIxFcY1YcqQc1djWBEoNETDFcgk5waRftEJasPREkrV++N/TOKkERF1fCLrXS8DFGYGRBeECMQRNEs0ES3FzUtXCcNxpYEM3Uei6XodZruXUIRnn+UXf2b/r7n1vQutoi6WoIbW7svDNWBbUWcDUc7F9SJK3bvSy9KIqhgyJHoW2Kpvv0J4ob14HFXGWWVsYXJzjwxS+SADShTgCRjhoDgjAYRGxwJ1Vonw+cpnCKhz8NQPrb0SFxHIRbmG95Q2hlC4mDxvPBRbkFa60cvWakd7f0kVBxxktzZ9agPJEWyA63RSHYVqt8cPrs2uFJ3rS3k9ETGKn5+A6F9IOrdZHfT1biEyUJKEvwzuscwshGCBJvd16TrefW03xVnJf4xvs72PdxrMidjJO8EiWyN/VWyB3fv9kc34YIuZTFtXGo9DuG3H1Uka5FgBMwDPEvRcSabi3WakNQkXFecJlFk6buLVk5YHpuKWTw6oF632FPPSVIVl5hgUAeHhj0t/sw/PEEvThLQDDFE34eCg/rLOyXT3r+L98oRKrlTO0MdALYQ3rRQqC7d822dJPGxF1K4J2TtfPSMFaCAg0n0NGk9yiaKKOJD1v2aBX9HUOIawjjfvwCmjHZJTR62R9c9x33JnBjWrN4QYEOmehy0oZMP9XM9Zyi6TYoe07PaLceRXcCWZiY/imRUWW6+mci7+wMxSdwMdbXckXtvhJH8sc4iQcTwm7yp+3f7CaesTTQB2qkgeXh+wFiSMXfMlH7Yil0OoZ2QTtRLTip2O0cLZ4SstqWHZ6H+8A2kZXhpm0kPbL9dUanTOvziqIUh6Ambwa3WrCb2eWbuCN3L1hgWUmjRC3JoL3dBhR3imSQI8xuCMfsszlji7cSShNSYdqCXPxEVwbqO9i5B6hf93YI7aeyI8jxgcVXK0I/klbvhSXjkjOIwZgPdVwmsFW7HGPLUAvDRuKm+itybRg7c8+Yqqjg824Qf+/NxsBSUNAK9KCoJpauFqK0XQULrWYj4FnxeKDuvr54iokpi+D57e6Y1zxRJJdsHnDR3JyraCUufHBRTKODWBVzthjm4k3/Hv+Q990XDVR+KW+TcJX045LW86EKhz/97aqj89A8ZvTk1//tczosU90loIPVaHuWegJU3wP//7XHcO7c0yQM2jM/IhQKrf8hiObHWiWDZManF8Uf/HzbmDfC2wT//aiZ4hGTv/xzgKwdb1sD6cGEkceow0s3b89/zg+3plyRm0HlZi886j5wUwFhdHiDTaBidZRo5cx/tMeLyguOATbzq17ydhzbrpxunuHx6lbFGiO97gsd4dk//7iCIo+Ew+hG2so5kvv+ITG4c1fzHPtu1Xn5QfUnqY3/uByVmB7gmnE/E+5zdm+6nDmoews5fr+NzThdSHzK4bBQOL9c4O8OI0xLSqjJ4lbniLJg1aFpQRLwaSMZmpkC9e/j6FOVrTQ6a/a4alGgfrl2ZL1sbHUQ3DOI7ntq9diHFfm3t1mul3rdJEJCHnlW/hlQntipMrpeMs7fUr6wK370D7VbXH0DUHzdYfRg/6Z11Ult1sffJS+heHbco15Sxy3+rDnPesqH1lajk0yu02hPUvEUqvcUXWXL7Ad0wNGMx5gOle4XJxq/r/YY0xdco2wRSEGwcT7YADlBrHc9ZbvzOL0QwyWCWWChB9Obg800v7tyBWaNvdwz+fL7Ph9i2irEeJkRgOzeEDw+JiD/V93vH9FgMEoFIJMoIuogmicZohf94SBuPn6hXaV9jP4VVVA/bu+Wg8S88GLtmEPSNRLdtlXx2XL/nuM8nKkhnlnjaropiKKLIH94pLIASci0pDBfj9Hi5BfaTSXQg5+PMjQX91Ktk4MOqK1K99l4BRPv5+vNovGZ3IxQv8ICvjV4/diThpoaM8uvd3D9d/DE477w3yAbW3IDm2i73pZ9aEj38JqS6h/s8/xgmUIVcuq2JTgefAyuoafzQxAuRASeg3NtG3ach/JEkyuX+JDt2PnDZTShUhyHHG3ttBg/6lhAchGjLJBtopj4e01MlCp2yqQRTr4sBBXru+lKaoanwYX8y2aWCJiR3KnhCOkYVFSvsO0oDRujUFOEptiNDTYrJoUbvOyvl4AhC9h3wORiTXK1MrpMfnvdnndnR/HRVSusMBgIxwrLdn3vq1VcncPiD0SquTx/kNmxeFyCT4uXVUd9AL+rSGmuq7OOCzDKeVPjiNWVaoP5KOFqYq5Xcuf/xW9S+u9eIq9GAtZWtQlgkRecjRtvG1NR4WXXpn+pwsTBTIy079Ikg8rSef1aVapIFcXCd6C2wHVjLXR+N0tw4Taw6x6H90BFRgNrtlq2up6hHKuV3inM5RJaQWZHd84e6RsKkk9po3dk9by54tpPw7cBkFas/G+GbHwuG+AwP55BZyXILTHCIVrPpXHEaUPYfL6nphJP1Rc10xG4UaCeY4IHCwuur8xmSQDgY4aVwhzWhjbtSHG8JO6P2i2nC9/0Bfx0zk6dYQq3aw7k5vIObD7SEKrxhz0fQ0+YTOfHW23CBNeZci1qNsUDhoeqmfyP6PvjoEjHk8QbrFyQVZPHVWijnb8YCM65iYNoEbvnchStZ/9cKg5Vd45j8KnB6UjzXl/bkyZx7VoD47ocUUi117WwgySSb4rXgLJ52Mv5XJbp3I+uBP81BUvOjy4Cacgi+GWWlC/8dwgqwiojjUBDnEOxyRyowwLQfytFra1OZS4XvRYr4uoamAfG3I/p2bA7G90yqKThH8Ke00Tqd+3l3dmJpaCZelBMYjGqNLVa3SM4+LQeL56gY6Bymy2LQPVOxjWfj5tq4o74swcxhyGJPynkS5xAjOXZP1/FAYcBT3u6qLoIkEfErwo4gozmyI1YCvM0oyI3ghjGPQSsof2sKUhq91WsKy9cYWN+4A2v4pG/Mxpdc6w6kI/HX7Xb0TuihmsiOy2wQIsrZbUmr3OBSUo6oDJNgQp+YqYkgTgYcWZDgawJw3DFfdzT//PhVUidgB2qa8uw/j9ToHBAS33iT8YLhhAfyXG0bQUFp7QmH7oQ3i6Flf4OTZLvJdh8pfuflmWu2ohm5pTiSg1pl3vq9uluTJwqXfh1hqy8e2iHoD+Y35gCIViTo6VOtK5dD8HYClucJucXASzwe2kPj4S4eYQtmkYHagXhAzp/F541xE8YFYqSPszDuz3soWzHy0p3E2jwZNQaIcGU9FNQwQxeDw0ZlK9dxXrj9IUHGUPTOyib8CqXmbZ7Ex54bn1rLx3qqAavu/gh6XjV0GmN1p+yyMK9HN5uYEvxgbAk43tsheREhyI+Q5WLIneKTGPmYiM/lxOp8fvqHy8YgXK0TlMiX0tliLI2JtfmWZP8eVV732sdYm+pcWzDzEmKLJZyeelyaZKkjPnnUO9keDwtgiLnmd5+t+Sr5y8brRnlvxcWEWfCqIALQYHvaXx6jTg4dAlye469uGwwOZVZCILLfGjaMg4LUCNMTtMSp1aC2y/3wR2t1v3w/iNBRQ+bNbtDqL2NAr7K4rUcyqbSpNrXZgAWXvjxBBtfYLK1uRYt3q2pfXJOAL0HtWcEwJLddOSJKV1SwvcvEuzg/4MPnA8MIUJOLqm3qI6wFyN99Ck6zYaV/zGSAzF/PGsaNa4vPLe5QnyuqVUnVQ6xELA6gbe53aGgeke+R/ycb2LJVyc7BhuzI90zA+c6wUDTb7NH//gdDSl2u/aW7lRJm8m1fLtPxcNuEM5JbkOCZKPM88HUsLRoC1pmKKlvWyeAXuxILbu0snpSxf8N+RgtLUSe5n2gdjOjoSTaN7mMZ7bF+cWk/MS8mFD4pcyl5UN7CbpFZH2a+Pm1VAnUTVfbw8qrmz1G9m5aKmRzY1SMhhPrlCn2t4uNUXNA3IFe6NOjSC1DEaAFZAfDlEkQCsbNhsZPj6NQPDSB3tLiTo0ZYoEbIeEIaKtU3Wk60rEszawTFuyHVd365LA/c/uarABN5M5rGq/dqTG3Ilye/5EKiYisisuzqNaZjmWv0z9TORc0CKbaTea214oNM9u2sXUZub/eqM3Pi/PjRSyQiOSwPWif2asTgu6hS6fb5UGosCWxdedMqdViIUUSSdIJx+qQ4KShfTT39VAWZbi+mB+iKICNwpt6cflY57Rcbs6d1kA26Iru73cuxYVlSvuJdcR5VfDYZRk8X0AXePROyw3Le6LaUdmTLzYsoNhhgQpd67xVNiHgk3pakmndeIAtTC4DCXy9oS6eU4CWxDdVmY53pKNbdAKmQsP37lrJZC6iDXMELGKcHjNuuZgcDyY8W/yv6ha3DX7OWm/35fpvhw55oitf4V+GULlcPWYyGGuVBdro19c8u0RDddDun40W7G5cSIzHLh/qZxb59R+EPY+wZ2XerkUim92hhXpKyW6WtAh6zQS97DrPyjCvKi3pCw96LeKynOpyjtsMQc2RmI/20zFOZcSa2AK++PoRcT6zeJyxlBZ7kk5mhqXGkLlM2hFKc+/T544xXP0Ua38Q6xdPTLTeG1PHnLMaOvksUQMrEFTB/lizCirmFQL8zYVU+OTeYQEFaITsBSMMYexS9HkajO2gGIf2micvntCZJsZQEwIH3/4JGJQGflBuH5rNXmnRRYXDQs3ZoEQoMtYDr1kFKUS/siiQSUxcTH9XYeBZiKDDFQoExREO9dddKQLO3BwMHvymCSTFyY+vxn3D27NDx6OlU092D5EDUwilttqVHpjJQDUceJYCLsK2swfXeNUVrBJT/w/sk+7si8rPtiMFis+oxvGdGQxirMBID700T39mULuNHzOyN+xBfcFACZcyngF1aSpv0JPkNUrAZTqfplv509cGXFUiEEm5dZb+OsP/blizqdK45/dSsIrufYTrCPY2lgJD6k6QljTfXVlHfYKSq+MsagyUcaMintyr95bD8kdTAeYNLNsMmo/Wdd8a2nStBP49ARIjqqpUHWY4q4mvO5Cq/CgCP+4/B+5zutGwX5pssgVLr1+fIM7WWLfiUQDk4c6ZdHZOWv5hG3g2dgQ5NXnpIY+BWwJpaouf25bXnjDzbHnQNofH/c6m+dEAS9Gs2h7pFRPKOBDnqswZ8KZjhId1ytHUTs533KwBoSiImoxKQUgZ7z6pA9QB3sZ8Cq0vwutJTTkfbX8AzCpm2cFXx/P22niUMHauU8IGc+78R6TsutoonoqFuoNA3l80t387YHMoL5KGAT1JO4zmx+vJ0LbLHlicHraSVYvJjnO9p++qnWgKw9OwFVVUagvZuf9qfiuum+hIicxP1q4zDnzkHsCNriLxBpxY9N+UOmqzdY1MunLMDgkMyi3uvnN3UBXJeZ8YLs5xr8QrOhimYoKuGBebZHAiBIkViv3DG8k2oNpp5OIgX6ulqaRN8V62QUPjn5tl1kPXhT9bcd8qIm8gi4or/FGbvQ6pgGSHmnayrugmf5E0upGxPRf/3xOtitGMaHLKJVm5zhglmVfI91o0yxhJZVS/5wQ8zfxK8Ylw0WmHXoGfRkoBRx9Hsnl/6sgTjAVwpmNuSeZtBwlX4qB8Bh8lxjqBDIuFGJ4I1wxN0XRlAAslzqMKwQfyA7OkuivCXfv+i+3XmhcBFM2n4jdT+NyUmBnQJPV3F2sZfKvJhUlXzSosFR4VevVVcOkFnnjdiRWc0TeSYxj41sJGYMbZTeLI3GvyZ8/gAAudQ1+4oFX+enX5V49MczGCYVBuoC4kHjp7ZVxj+clBwPr9k+v05SsezQK3enxLs1Nt/N7c7AImVUysjGou4iOohHo83Zs9/MI/OWB+OyXzOBD93NbApGHXrv8CVRHp2bwH+xB55cfNrdqFD35HSMx4iVmtzYAmSCIV8kXsHoq3DIb93riTWbubnjxbBW5zConVtbxLRStXHkIyAByaozME952Gc9aAdAbBpZSVCH88Uwb/4bPTVOVl+WoMYD7JIvK8VcMrJ8zHV4bbG0Dg7Kx17A4ej/ZcZ2Z5pVuVLUH1E/AccUTKm81SE+LQ6STTUDscUk0x2OWIbEORhg69tdoTGNkA1RfkGIRZHr5mCXOpLC55WWzCZoGPFUVtZRHwh0nq039CDdjEPo+JyaxSQAvDgR6Iqvxy0frrtEG1A385N81l05SSzN+IDm9bypF9m92EUqblnauZ5sjc37wRykOdl7w4o8WMgQsjii3EE/aJYDfHs1cH6DNBEujjcCc8qAefYFyIAURDcDnzun5UmkbBQsU4eu/W8I9nBE0qJKTdg2hwjq0+XV7a3TJ7R+alvJZCRia9lJ+grNB9dbrOmWEvUotMjvDhq4wV/kq4fvIBkzUGpDeYH74rne8uU3dgoNZdR9pUL6q9YDNRfOiF6Dyk+SYXQIghTjm9qR4tBHh0gnmF/9q3Qv22EzaLhSvDlDOxMrrCNRmLCl1jApzLrBCPn2mjn5zqK7OYK7VxOfQ5GfBfoPdyQwqFEgCVHkJ9oTnagRM3R0+rsuN5jQv9icCav/p1WqiEXSzCdLd/WEA6z6dDP7tPqPbeDYKAkVcz1lLGbFOC9b7cBd3MV0Ve8dZ89oR7OnxGS7uVpSry8banVZwpJg+nkH1jRBYa2BvBMY2xITH9ERXCjHzdZxs+ipdXP2DY7X+eWiBhtT2L0RRGTLPeazn5tpl4tu8iE2rWig731iuJDRbCHHy+g/Mb9+miAyVqfIpXT/iZeOxOxODO0hEpLM78I1+G2Z45yi3lS1K3m4WMQ559Lp4UML5vZUjYGJuxl+OPpUH5klpyBujkjprhei0TmUik10gjvNUp8mDkWlNKikmYspaVTqewbnOzJrmz8FLIpsT67EJLHIIfeDcWEfiP+DJrZ1jfxpoAb2abeMqLx+9RuZGzQoYtYVGgAWwEM9Kek2vPIeBNAKD6ao7nw6sgvfeLZPoXkbYO/tStHJdKzk+WFSFEU2NcALJAEP6S8pcnqqBBt57dwTrzQNCIdk2SocK4dLRbD/pu/VryKnm65ZYXiJCfHJk3mx9MRSl+nSK6OqEBSoGjz0/LADddwF/HqcfK3K3O+6YUGQcmj8pZL4PhZ6KrGkb8B38FmDvvLd3XQXbvS/FQmrXFTvJNkaN/FGo83KuS43BK1UfVnIqigGkCoP5fBda2MwAGTGNKX9K9t4Bx83pMFc5KSORmWKv+8VoVggWxoaBz3/9IBh6RwLd1tebwy89xvE5z6EEpXpDfrXWfRsMs6+ekUHH6idVosno55+xQ8Zqzelh0bxtJTgCcH3Z3/Cxlx9eNIS4JIFKOAVrDqbrXRszmY55a5+niJGHtkO3b6mnIDxLa1WXc7BAe33mt2KyM4Fbc3R6/WVTQN8QhlqAtave2WsQTqzWeSlKuGUVIJRqtObpv294rS0kDN1RKzdstZTXJebR2HlzsQ4P3NbMHUqFZMZw+/IKXnh4t+lY8qocp/B1oMszR03EFs3bPeND8QkItMvllObeCz3SZAjqZrobmLcrpFyQV7mwBjg3C3C8/bc5goQhv8j/IXMLGnt4mF7tybRDG5G0polxoUScQkPvmnga2/K+aapKeqSL0BTmo1Cm5g+booNOtdyKva2KoefRURaBk7113QKo3y+WTuFKtgETIK8HRluYS9DvlcciCDvnG8UaJRfZE2siZsiTHvRmN80xkUIInHeRZl5Re/+ATL6VhKFi8CZ/n/jbFV6T5pZ+Uoppvsi3qjacVFOJgWWfdlwVHKPW/TJO3na9hRM9bS2yo2rEsC6IBzRReVO6IesJU7PItzOamr+ROFfwGZmZ7ue8HNxAgLJKb7P3p8dMqk6Be5PJaT/5Rdc1deYVihWH9cjVKc9uz5EnfHqxLUkOO8iJUENBNVf5LyNy8zjLu/78k5WNTywiPfYeX3CPk7yc6CI3lum/CEZwfUaNpcI3KsPqfn2lmz3kd/acQjKA1ebkJaiuLD+epQ/Fc1llHXXMzofWzz/Kd29SNmOhcjMWw1jq1g3YfrXZ9rzXDYW4ZttfgfMi6oCUtBs0PkMVuxmq5lxEoCaSXPSqCJJ7MlKdRDidVt0AFlxk5cTdX++sBF2+E35mjwfm8ERVxH0FvuAQtsfA4V2G0TKTUxeyRGVjd/u6F1SvuAiU2/WaQjcNCU4Ep7VunXCYSbZj3U3wzu/LWM5MPlYuyQ3FOOCD/zt7K295hY2JhwF+ODDIZ676vGQFKveEQYkWj7lkK7rVmD7MhU0Y/tF8EcTTpo4/yqOufbd/zWIpMajnbDuWK2vn6OPPtz2rc9MIBNlPd8tt+yf+7SC4wqEPbozKMCwY5Bygx4JmoIEDsixWRDcdHd6S3/dZMHXOJAAv7+NIstl00crgSqHZKAEe4g3G4dzIV51EeZB01r7p8GNlfUnG/GjZgNGsqXZdYMBVtAtFNv3hJWPve4GvqZ2XxuiNkHTz5kxWgr0PjQdJlVywJ9Zf2ZvqeeTbolKtvK54re2Lq5BoyzfsRtvDfyao3kmyFzDQ88nM+qx83w74RDlkngtYiArI05Epre3GgBeSlMig0pE6RGQaFznKkGeb0SozLCyiOtxh7hgwZlbKbClzUUfC8ntMiHUOZE375RhTy9c4DA+oMLkUDkztSybZbdmP1xpaIbjUpPAHBq3cIq+CBFzbMlMMCCkUQ6d9LGV6GYCsYiEWZIy3nBnuxOYXeU4YTGDSin9e4/pCjPtQSHlg5LMEvIlF0ElthqrF129iK2RPBEWd3XWOl3SWV5uz5VUyZYp5kEFmz7QfP/B1W1BBzQ2iTGbSVT79lUHzcGXz3PJceSgz4uknETUwo0xffpr2KUvZF0i/r2sL3IFIClYx8CbIZE6Qt7MDJbOPB3xMScwaOcWG66IJfCnDkb0D2Mb+PHzX+oiCbxeTIogtyN+s2NJirNACk/OACSOTtV6vscwbzW4M168xqaI+RzR47S1nlV/rOoZnid87n/Ima2XYa3un3BuGAisNjb8eLMT9OnMtazQROFCuO1HiZXaOc0oUDbNC4eKLToOx8DzVhMgGA8XIAQ2x3b6I0uEyLssQjJX3QphcUMx4KsMgJ+72km4N2aqkBF2coKmUEt1eqIMGn+5txMT4kYVGd3ALO+y9Z4PP3d3l48JQK8s9ZZ/Qx/+NBKgBEJFlQ32psoJiihGO7FSYM5L81q72kaAYcilEFMG+ZK1BcMqELkflyCV7v8JEXLO4Rf/oZYNZHZVjJhfL6fnpP9Tio3Euue5uS7FMkfGOeRCTrBZ06Caev7tgufeTrX34Ur/Vvc+b8ksiIShNJtuF9WmYxOZ4xg8y6zTdy3KAB2y5kYkcRnXsptWwAFyKZ2I/QGySNeoQLkINUMloC+5L3WuMMx297Q1xUYLKqZ9XHavaobo6QQv4auMm+i84IhxRpPt9nUmcav9NcjCcP+TcMmxsQZ/F3mgeoA0fQgwvTsyXuuTaM3Sqtv2jaaajmaFQpK9W6uIbeqwvSDo34ZrY6elDUHwSCjHRRmlwmyy+eOra64Ssq0XSXYljMHtKY+FShcMkHsEUY/4Bw63dJ6KpwDaxmthlDdbdE+TvYF3v33cGSKqO+1H1pKYhJMvZD5ckQcHyNF8zrtiR5b0ko6NPGoRexUZTYP6VbUdn3zzxGBOi8Z0OqHjGqYxRXwN3mYi0GYEEZYq+Q3QvdKcEHILLLj8S+VFepSfErtmfZCdvxbfIifFSpEzKi+7VJsLMT+zEFeyp1OdwRC1VZrfTLIyR7xTPUcZFYPD9qI7D70uTb4hdpqPXsJIRNYbZtNwch1OI3trh3u2ScoQyM9POnInsUa+OovcwkUP1UfIzPb95n4BaF2ev57NHAej0+BVMF9/Cj9663HN2/JN3SQgslL914bKfiTTDFAz9PlQEL/dSv1H8xl3mtWxh1McFO9EJXlRDaKQDsyKO4vOJW90NFE6yw2tjbc2GeF95sbs0I9enAa6QwQVf/kJQhAD2BzUDKggOyjy1TEhED6sfk+418lQy3c/uj8aw8UEzZ6hIMCd8RohAkumMtIj9m73l2yPWoGHVTPaywkC7Yj9tBM1NxMgcrDwRtk4RO2WHT7Ql5kQCKdJj6kNuOTeyEBYBjLMhGz+O5/YGa84HEiTYEpZ6fFzy26GG2hWtTyteuYrhSyG56BjsT/wQeLRytpTY3D7sIMqZnJ9z1FDrfyjFlGl2TNw9BQysbaxOuwYYZs/7I6BANgkqCknWZC7/BBXvaeKwAmC959I+G39BUE9bExkNlbRoFRyEtNzv+NJ91FuisG3JCS6uYBeRnfv8AkAfKTeg9EYamqnsGfAV7d0f9DghHEQ5IsPGDIUhgoSj7obM4Bu5uhQ3/CYEDTHc92AsFvDK4XGrwUeGBWBHPlS+f4x+CxmmHz2sAGmSFNt65kwZC64mnaoWlu2310laYn8r62AqsR5dfjyK18MEdurdagldzfJtjFXlZs7St4QhdPiye6TPh2/ZAQLU/Fip5s7TDEM16KtRWrK9hmxnQ7bmfa/+7pa10Z8WDPK3NuJ+NN/RAbQ5vHx2uX0Lm7/w7cAEH/hvZA+mt7J7zGw7YtQYwnNN6dpgwkGjjrS3yQoeoYt1EnczmtmJfQZWzUlP3Hlg9Wzlr9IH23q3thGth+QNEANFettxKfskkGOlLk8AqoKJwDqOxAa6UzAx07plSSyNBJSGco9zjnC5gGbDoKvsMDuBR6bGRlGzJ+hFsGa/Izt78aI+WZ6dJlZKp4pGISuv9rV0sAS0MWEwCmfauO7oQZMiakHU35LBxiyJoOMddhUWgcZuC8r4Ksvn75TTcQXLJ7kWtYhGuGqPd9dZuFjBWQHNwosXY5snbHFQq72CvHXhIg+shQxycuLOuWYErwCLZeF24b7F78pO7xw4X6lIAR02hUOf5087Rl0nOaeb6CK4i/KA/EZv76ftOWZtjwxslNr0E/u8rWUmnf3amfg6UZmBAluuoj3Dd7UV+9IAJ6iYcDfSJlgmIImohjfIUMJ27z+opj50Ak9af2LCNrWrBJvMovA1OeNO+MF/MwZvnaCxTgG7Cw4QfSPF6AYCGFt21M8PySZFeV3t2Rqqs5JMzMYzGRgq4o+UaKRgBf9GHi/9X9HXA3wxkCsd/UhnHSh2zUVDiraio/6nP4y3XJqs8ABfALAtCYU7DHPMPRjgcM6Ad/HiSXDAbOdSMkvGZPAkHs8wuQTy6X2Ov/JFvcPuKfV3/r9Q28";const Qge=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),Zge=4;function uIt(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),s=1,a=[0,1];for(let F=1;F<r;F++)a.push(s+=n());let o=n(),l=t;t+=o;let c=0,u=0;function d(){return c==0&&(u=u<<8|e[t++],c=8),u>>--c&1}const f=31,x=2**f,g=x>>>1,v=g>>1,w=x-1;let C=0;for(let F=0;F<f;F++)C=C<<1|d();let N=[],I=0,P=x;for(;;){let F=Math.floor(((C-I+1)*s-1)/P),U=0,L=r;for(;L-U>1;){let ne=U+L>>>1;F<a[ne]?L=ne:U=ne}if(U==0)break;N.push(U);let z=I+Math.floor(P*a[U]/s),X=I+Math.floor(P*a[U+1]/s)-1;for(;!((z^X)&g);)C=C<<1&w|d(),z=z<<1&w,X=X<<1&w|1;for(;z&~X&v;)C=C&g|C<<1&w>>>1|d(),z=z<<1^g,X=(X^g)<<1|g|1;I=z,P=1+X-z}let R=r-4;return N.map(F=>{switch(F-R){case 3:return R+65792+(e[l++]<<16|e[l++]<<8|e[l++]);case 2:return R+256+(e[l++]<<8|e[l++]);case 1:return R+e[l++];default:return F-1}})}function dIt(e){let t=0;return()=>e[t++]}function hMe(e){return dIt(uIt(fIt(e)))}function fIt(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,a)=>t[s.charCodeAt(0)]=a);let n=e.length,r=new Uint8Array(6*n>>3);for(let s=0,a=0,o=0,l=0;s<n;s++)l=l<<6|t[e.charCodeAt(s)],o+=6,o>=8&&(r[a++]=l>>(o-=8));return r}function hIt(e){return e&1?~e>>1:e>>1}function pIt(e,t){let n=Array(e);for(let r=0,s=0;r<e;r++)n[r]=s+=hIt(t());return n}function GE(e,t=0){let n=[];for(;;){let r=e(),s=e();if(!s)break;t+=r;for(let a=0;a<s;a++)n.push(t+a);t+=s+1}return n}function pMe(e){return KE(()=>{let t=GE(e);if(t.length)return t})}function mMe(e){let t=[];for(;;){let n=e();if(n==0)break;t.push(mIt(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(xIt(n,e))}return t.flat()}function KE(e){let t=[];for(;;){let n=e(t.length);if(!n)break;t.push(n)}return t}function xMe(e,t,n){let r=Array(e).fill().map(()=>[]);for(let s=0;s<t;s++)pIt(e,n).forEach((a,o)=>r[o].push(a));return r}function mIt(e,t){let n=1+t(),r=t(),s=KE(t);return xMe(s.length,1+e,t).flatMap((o,l)=>{let[c,...u]=o;return Array(s[l]).fill().map((d,f)=>{let x=f*r;return[c+f*n,u.map(g=>g+x)]})})}function xIt(e,t){let n=1+t();return xMe(n,1+e,t).map(s=>[s[0],s.slice(1)])}function gIt(e){let t=[],n=GE(e);return s(r([]),[]),t;function r(a){let o=e(),l=KE(()=>{let c=GE(e).map(u=>n[u]);if(c.length)return r(c)});return{S:o,B:l,Q:a}}function s({S:a,B:o},l,c){if(!(a&4&&c===l[l.length-1])){a&2&&(c=l[l.length-1]),a&1&&t.push(l);for(let u of o)for(let d of u.Q)s(u,[...l,d],c)}}}function bIt(e){return e.toString(16).toUpperCase().padStart(2,"0")}function gMe(e){return`{${bIt(e)}}`}function yIt(e){let t=[];for(let n=0,r=e.length;n<r;){let s=e.codePointAt(n);n+=s<65536?1:2,t.push(s)}return t}function hN(e){let n=e.length;if(n<4096)return String.fromCodePoint(...e);let r=[];for(let s=0;s<n;)r.push(String.fromCodePoint(...e.slice(s,s+=4096)));return r.join("")}function vIt(e,t){let n=e.length,r=n-t.length;for(let s=0;r==0&&s<n;s++)r=e[s]-t[s];return r}var wIt="AEUDVgHLCGMATwDUADIAdAAhADQAFAAtABQAIQAPACcADQASAAoAGAAJABIACQARAAUACwAFAAwABQAQAAMABwAEAAoABQAJAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACwANAA0AAwAKAAkABAAdAAYAZwDTAeYDMwCxCl8B8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgPi89uj00MsvBXxEPAGPCDwBnQKoEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiC+AZ4EWRJJFbEu7QDQLARtEbgECxDwAb/RyAk1AV4nD2cEQQKTAzsAGpobWgAahAGPCrysdy0OAKwAfFIcBAQFUmoA/PtZADkBIadVj2UMUgx5Il4ANQC9vAITAdQZWxDzALN9AhsZVwIcGSkCBAgXOhG7AqMZ4M7+1M0UAPDNAWsC+mcJDe8AAQA99zkEXLICyQozAo6lAobcP5JvjQLFzwKD9gU/OD8FEQCtEQL6bW+nAKUEvzjDHsuRyUvOFHcacUz5AqIFRSE2kzsBEQCuaQL5DQTlcgO6twSpTiUgCwIFCAUXBHQEqQV6swAVxUlmTmsCwjqsP/wKJQmXb793UgZBEBsnpRD3DDMBtQE7De1L2ATxBjsEyR99GRkPzZWcCKUt3QztJuMuoYBaI/UqgwXtS/Q83QtNUWgPWQtlCeM6Y4FOAyEBDSKLCt0NOQhtEPMKyWsN5RFFBzkD1UmaAKUHAQsRHTUVtSYQYqwLCTl3Bvsa9guPJq8TKXr8BdMaIQZNASka/wDPLueFsFoxXBxPXwYDCyUjxxSoUCANJUC3eEgaGwcVJakCkUNwSodRNh6TIfY8PQ1mLhNRfAf1PAUZTwuBPJ5Gq0UOEdI+jT1IIklMLAQ1fywvJ4sJzw+FDLl8cgFZCSEJsQxxEzERFzfFCDkHGS2XJCcVCCFGlWCaBPefA/MT0QMLBT8JQQcTA7UcLRMuFSkFDYEk1wLzNtUuswKPVoABFwXLDyUf3xBQR+AO6QibAmUDgyXrAC0VIQAXIpsIQ2MAX4/YUwUuywjHamwjdANnFOdhEXMHkQ5XB6ccMxW/HOFwyF4Lhggoo68JWwF1CZkBXwTjCAk1W4ygIEFnU4tYGJsgYUE/XfwCMQxlFZ9EvYd4AosPaxIbATUBcwc5DQECdxHtEWsQlQjrhgQ1tTP4OiUETyGDIBEKJwNPbM4LJyb5DPhpAaMSYgMMND137merYLYkF/0HGTLFQWAh8QuST80MnBrBGEJULhnkB78D8xrzJ+pBVwX/A6MDEzpNM+4EvQtpCIsJPwBJDqMXB9cYagpxjNABMYsBt5kDV5GDAm+PBjcHCwBnC4cFeeUAHQKnCKMABQDPA1cAOQKtB50AGQCFQQE9AycvASHlAo8DkwgxywGVLwHzKQQbwwwVAPc3bkoCw7ECgGpmogXdWAKOAkk1AU0lBAVOR1EDr3HhANsASwYT30cBFatKyxrjQwHfbysAxwD7AAU1BwVBAc0B820AtwFfCzEJorO1AU3pKQCDABVrAdcCiQDdADUAf/EBUwBNBVn5BdMCT0kBETEYK1dhAbsDHwEzAQ0AeQbLjaXJBx8EbQfTAhAbFeEC7y4HtQEDIt8TzULFAr3eVaFgAmSBAmJCW02vWzcgAqH3AmiYAmYJAp+EOBsLAmY7AmYmBG4EfwN/EwN+kjkGOXcXOYI6IyMCbB0CMjY4CgJtxwJtru+KM2dFKwFnAN4A4QBKBQeYDI0A/gvCAA21AncvAnaiPwJ5S0MCeLodXNtFrkbXAnw/AnrIAn0JAnzwBVkFIEgASH1jJAKBbQKAAAKABQJ/rklYSlsVF0rMAtEBAtDMSycDiE8Dh+ZExZEyAvKhXQMDA65LzkwtJQPPTUxNrwKLPwKK2MEbBx1DZwW3Ao43Ao5cQJeBAo7ZAo5ceFG0UzUKUtRUhQKT+wKTDADpABxVHlWvVdAGLBsplYYy4XhmRTs5ApefAu+yWCGoAFklApaPApZ8nACpWaxaCYFNADsClrUClk5cRFzRApnLAplkXMpdBxkCnJs5wjqdApwWAp+bAp64igAdDzEqDwKd8QKekgC1PWE0Ye8CntMCoG4BqQKenx8Cnk6lY8hkJyUrAievAiZ+AqD7AqBMAqLdAqHEAqYvAqXOAqf/AH0Cp/JofGixAANJahxq0QKs4wKsrgKtZwKtAgJXHQJV3AKx4dcDH05slwKyvQ0CsugXbOBtY21IXwMlzQK2XDs/bpADKUUCuF4CuUcVArkqd3A2cOECvRkCu9pwlgMyEQK+iHICAzNxAr4acyJzTwLDywLDBHOCdEs1RXTgAzynAzyaAz2/AsV8AsZHAsYQiQLIaVECyEQCyU8CyS4CZJ0C3dJ4eWF4rnklS9ADGKNnAgJh9BnzlSR7C16SXrsRAs9rAs9sL0tT0vMTnwDGrQLPcwEp6gNOEn5LBQLcJwLbigLSTwNSXANTXwEBA1WMgIk/AMsW7WBFghyC04LOg40C2scC2d6EEIRJpzwDhqUALwNkDoZxWfkAVQLfZQLeuHN3AuIv7RQB8zAnAfSbAfLShwLr8wLpcHkC6vkC6uQA+UcBuQLuiQLrnJaqlwMC7j8DheCYeXDgcaEC8wMAaQOOFpmTAvcTA5FuA5KHAveYAvnZAvhmmhyaq7s3mx4DnYMC/voBGwA5nxyfswMFjQOmagOm2QDRxQMGaqGIogUJAwxJAtQAPwMA4UEXUwER8wNrB5dnBQCTLSu3r73bAYmZFH8RBDkB+ykFIQ6dCZ8Akv0TtRQrxQL3LScApQC3BbmOkRc/xqdtQS4UJo0uAUMBgPwBtSYAdQMOBG0ALAIWDKEAAAoCPQJqA90DfgSRASBFBSF8CgAFAEQAEwA2EgJ3AQAF1QNr7wrFAgD3Cp8nv7G35QGRIUFCAekUfxE0wIkABAAbAFoCRQKEiwAGOlM6lI1tALg6jzrQAI04wTrcAKUA6ADLATqBOjs5/Dn5O3aJOls7nok6bzkYAVYBMwFsBS81XTWeNa01ZjV1NbY1xTWCNZE10jXhNZ41rTXuNf01sjXBNgI2ETXGNdU2FjYnNd417TYuNj02LjUtITY6Nj02PDbJNwgEkDxXNjg23TcgNw82yiA3iTcwCgSwPGc2JDcZN2w6jTchQtRDB0LgQwscDw8JmyhtKFFVBgDpfwDpsAD+mxQ91wLpNSMArQC9BbeOkRdLxptzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgELgEaJZkC7aMAoQCjBcGOmxdNxrsBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUHqSvAj5Gqwr7YrMUACT9AN3rlr3JG9m8w9lIAXltp/v8kfWaIaaR9OwpAES/I3ZVamDXSgB/UsOgAG6D0tq+5CIqE15FiAhV3yA2VhCQ7tj+m6xXaF53FIfGi/IAZIskMGAi2MU7MDVJNCbMzERyHZi+osdPtnFVbvq653O8rwaCy4IAf9OOok65AqJUtUriUfYsGPPVbe6jm0s9lbKlPCUKjdkHsFsEhvX4kT39ZCtAAbwQdn/h4TpO5hTByWAmr5n+Wuwhdegv6bmvX4LyOes3z2+cuHv2JFYwVMNuq2gzn8YHTjlUQd39osyWei4NKl3LAdfxlO876hh5ENp/cOvpuI9bF55guEthLLPOXjD4dktTH04P5TvZrWTM0e4+BHJxj7MLApXIFOs0sWKhNkG8iwuM5wR83my6V3wW06abhDzTXYfOr/ZpFXgXzmv4d12FFyP00/dPGbIVGV5ao8UufGzUwp/IHx6v/wDWJr9iaoCulhWwlZ7A8q/NMoD12+mBdNRgJYnThRLtMx1Bgwttn8/4Qn2CDfOSup9GVXEvA21ILgp0owHYxNOkpwLWz0G7K+WREIDjIzUzSn8I99CuJSmSpPyH0Ke6/NERYiNx+3dncSebPnOUnnWD61AhJ1n/tSLZmU5wYO5GfgzyAYJm6VL91LxZ8hL1lfximQxIDMRhIecQZBmeE5R0XlrpvwplVrJwpa8BBCdp93GPP9lyBeZ2zkRr920CR3cYbKpKHfogvm0nV7XdDz6EbjzlxADCMjSLXuXpIpyuizy39yY+I+H9rmpoIF3YwEjlH9MgGgWcCNTjHEWMqAbprn2Ox7rOHupaVE3lNyg3nt5XaZID6Y+uml5Ja+aOPu+BI+DZbiJVfaspUadakWUX6TA4dETkIqdJJHYnU4Z4yKpt5y8rVIahoMUf8A8kWtAQNCTbjp71gx3/zVdqNz1Sutkw0gFIMVm2BF4Xdv/0olw+NaDIR9Bb3DPweZA2K/cw+/b+AwyWl9ZOP67A9nexmeTNjfdzPGf9J6E6BMPKa5lJh+qNsdUz3HBUevU71eQFCqOcxiIYhacAhh/8PX0J5DdSViZ6WazDDx7cukJNpMfEkYLJ5Ao4vLoVd3d25Pg4qaVa2p2D2L3WvYPJ5Yf/A/MSxptjlgXL/KJtP2U0cRv2I09ATAiWCJYuRwiapeKFsqmi18yMMulDp3HdcIldq+7jkwsJUOHLHCzzzBw5XFvL0CAmo1ub456z7zb7shk3KPGCLZzr47oT1k/j06XNnJvG3Udv6XrP+wsqTBlZ5MaNPt9FOs/4Bt/ja/vbVhTNpBFl9Gq7MqINvGlWKOAwQzwOZy+EzSdjAqKJVV2YcskTuM94aIK+kc/AZaXiZLPREUDpkXIV947IFfj+85TrqPqLfkGcxgboMQjosf+az+odLNXdyp1mDNGsqSdK/pJ2Ca04mt/4d6s1X+lncOEYaGBBeW4pApGcjf7/XJCFbj3N3mFb+BtlIcw8ZiDKoClFX9Rf0bxCqtLpicObKJzBVVHr/6u4siH2hK75RNv7w9GfTbhJOQBYiFUZAByY4rn37tZBHT//kqKsNi3ryL9AqXJRzqiMIJMhILjoi/i8LVEsbu+Ih9bsyW16sgQqjYLO0qda6KaCPKj3DQcu6CfV5lKtjS3ZCdqLAZkOey9MR+QutJBGiz/r15GVD6rCVwJR4UUKC4GNJkfDf00OMW8aQtLSAGLXV8MIi9mbbl/qQEpxCm2L5hutFX4ekeLH4QgBWUFKs/2VVMKy46WtFE6AbwgmYm/Z0yHk5veDIrcl2HpVqb/rSE0PC9EbDzJEWqeaPhh7vF369Umq2kSiB3s5rBI6c/7N9bkRu4h2n+/h5nSwy+7n+/I+6oXQVANo2Jb5zDwtiBPf1ySCzHdT6yJShMzqSRZfnykX49CaFaxhoVF4PBhEuECJ1PrFYSpmHuyYsl14DTAV9ZxRms1XiR/kBrjhZjidOt0UNe+GSml7XNgpVw8YsUTmZXLTK+6iYnyW/wYR1W4UXwOi14xpFROHb6HcZzksgF5DbL2AFXzKNwHU2adjdAY+KCyM/cwRTBkkq/a227NI0q6DR2MkMCRu620t79bGcYUmACtqN3mk/0uNwd3JSXHqE1kzf6Yyj0W2083JNDRnIXDlgBxJ6uf58NN1f6FQiRCWB4egF8QDx74AixV8oTyw7PluIjr3/rj/WzgwPSq4xPojaF7V0xqG2u5ti2L1h6yYHv73Isrukr0kURDIEjClBsBx7kdcXUxaYMS0syT3ymLzDzslNDWQOT1Tao1YNmJHARUenhCkmV9tqCPGI5GqZaRpkiPxyjoncWjyOHYGqvbvRX+Bn1pn7EhRNXa1lqJPmoeN5VqdqIDPhEVhFsyG0d4iQEIYX0wZUbY2XbZWYlpZ/l66IrDDY0q1C1YzBDpHC4h05YqHQLqS9anyl22JQ6lEvjvdBwMHfE7z0luCXD34/rFeDa2TmSeEAykSpYO5j1G/nsgpR3qn0qaQEmLjnnLfcz+veoYqPnRqmRGwCJ6FJ3Gm/Z1/aVX5PSb03MMnjAf41ww54sD5k8FrkfBP+K0b1MrYpapWjtpZfve2HVf4ickX3LKSOhu7qI1Vd4c1kNrn2ajy1t4y93JhV4fnWCKq7OmFpcr7FjdJCXPTql0Drr14Ho3Z87+GPQ4Z/DcTiGqtvZxlRYi8cNuhXABveZIwNl/BX1huhVLaFax5OqypUrQRyb9OE3SSkPlDdy5uo5XGg2EIGEjLY1MO5cr1ibfiFWV7zspcTgkBKkwo5jPyAin04LqizZXb2tDRgwKJjGx4cVk3ngAQixwcxjYAg2Q7vmUR/hpwInMdw7OhC2qyf41vTPkudQAORS0DdLtOGQxb4fH2VYGsvJCkeWPeUwtf1/tuIhzXEThoCZzzSJqqjUtbaPI3ntHm3T5uf849hGUA0zU8ni5W+EEn3/0Y6oUhQFw9z0aGjkljBbAlFXc0y82G2wkd7VdgWa5KTgJJNjNwZMfmdnUIUn1JU5LiWX5UZEZbVlKSN76mlmjUR2ku+fucTNlO4IAAahnLjBhlvQNR9pe9swGBgq0YR7P3VCyI/seYwQ4QBzy9X+HPePgoF8WfKaJ4MBOhLCGHae6Z8xkNXwni9QAKvTNtVA56x8YJflZ/VvONRSlsSLmiSyNMnTjTaE1ko81zkzGEnVwEhjCzlwIqpxmpDAqwsEmtpdr3xpc7i/ZX3f2TzT3M0FdxIEQvO1jgmmiN+D1YpMduAzEhBtj2OBkMN/rv6p7Th4pSH6f5aH3aTvwFTl7EOSgGASI7ttyMehzpm4AVyK+bFEaFg9gnZsSUPpsbAe/0RFhrH+EXZ12Z7thf4dzN1+Sn+G8QrDA1VKaN4IFxD1rQz9Xq9Coii9S9/hPbTGjyBwFH3H1UdQuz5KsgPDEHua4/kPg2Gp/IIItsaLWBqiT9XH45MiQxSosGJ56H/0F2cjcCFd72l1665RNHURdC3lspI77esfJsl+rXXabkAy7vxDXG/XGGcKpwiKDPFfvMEgjkAHil4Za1F36RnyxxvdIAzvgfH8knukYDck07tc++DP4TdWeI7HXuq5Yl6VVFrUQtf64/dkXewlKZSHQo6YvCSpREB0GDrz+Ys2GfO8nw2SwrYwaf88AifzlPvP17bf1mI3AuccJvAjZIpBmqvharKFAebEjVKfGAwpQjWoXlm9LROsq9bCk1UeQ3CJxJqprzssS/Q04JeS1ReCCubL3J7sx86spkP4eNpp95UF+8K748icIs8vdILFklk9skQqi1So6cx3X906pvy1vz+KipTJ8fiVJxsV5MmT0XwA";const YE=44032,_R=4352,kR=4449,TR=4519,bMe=19,yMe=21,pN=28,IR=yMe*pN,CIt=bMe*IR,SIt=YE+CIt,NIt=_R+bMe,AIt=kR+yMe,jIt=TR+pN;function Sj(e){return e>>24&255}function vMe(e){return e&16777215}let Wee,Jge,qee,gO;function EIt(){let e=hMe(wIt);Wee=new Map(pMe(e).flatMap((t,n)=>t.map(r=>[r,n+1<<24]))),Jge=new Set(GE(e)),qee=new Map,gO=new Map;for(let[t,n]of mMe(e)){if(!Jge.has(t)&&n.length==2){let[r,s]=n,a=gO.get(r);a||(a=new Map,gO.set(r,a)),a.set(s,t)}qee.set(t,n.reverse())}}function wMe(e){return e>=YE&&e<SIt}function _It(e,t){if(e>=_R&&e<NIt&&t>=kR&&t<AIt)return YE+(e-_R)*IR+(t-kR)*pN;if(wMe(e)&&t>TR&&t<jIt&&(e-YE)%pN==0)return e+(t-TR);{let n=gO.get(e);return n&&(n=n.get(t),n)?n:-1}}function CMe(e){Wee||EIt();let t=[],n=[],r=!1;function s(a){let o=Wee.get(a);o&&(r=!0,a|=o),t.push(a)}for(let a of e)for(;;){if(a<128)t.push(a);else if(wMe(a)){let o=a-YE,l=o/IR|0,c=o%IR/pN|0,u=o%pN;s(_R+l),s(kR+c),u>0&&s(TR+u)}else{let o=qee.get(a);o?n.push(...o):s(a)}if(!n.length)break;a=n.pop()}if(r&&t.length>1){let a=Sj(t[0]);for(let o=1;o<t.length;o++){let l=Sj(t[o]);if(l==0||a<=l){a=l;continue}let c=o-1;for(;;){let u=t[c+1];if(t[c+1]=t[c],t[c]=u,!c||(a=Sj(t[--c]),a<=l))break}a=Sj(t[o])}}return t}function kIt(e){let t=[],n=[],r=-1,s=0;for(let a of e){let o=Sj(a),l=vMe(a);if(r==-1)o==0?r=l:t.push(l);else if(s>0&&s>=o)o==0?(t.push(r,...n),n.length=0,r=l):n.push(l),s=o;else{let c=_It(r,l);c>=0?r=c:s==0&&o==0?(t.push(r),r=l):(n.push(l),s=o)}}return r>=0&&t.push(r,...n),t}function SMe(e){return CMe(e).map(vMe)}function TIt(e){return kIt(CMe(e))}const e1e=45,NMe=".",AMe=65039,jMe=1,PR=e=>Array.from(e);function XE(e,t){return e.P.has(t)||e.Q.has(t)}class IIt extends Array{get is_emoji(){return!0}}let Gee,EMe,Zv,Kee,_Me,c4,EV,NC,Av,t1e,Yee;function Goe(){if(Gee)return;let e=hMe(cIt);const t=()=>GE(e),n=()=>new Set(t()),r=(d,f)=>f.forEach(x=>d.add(x));Gee=new Map(mMe(e)),EMe=n(),Zv=t(),Kee=new Set(t().map(d=>Zv[d])),Zv=new Set(Zv),_Me=n(),n();let s=pMe(e),a=e();const o=()=>{let d=new Set;return t().forEach(f=>r(d,s[f])),r(d,t()),d};c4=KE(d=>{let f=KE(e).map(x=>x+96);if(f.length){let x=d>=a;f[0]-=32,f=hN(f),x&&(f=`Restricted[${f}]`);let g=o(),v=o(),w=!e();return{N:f,P:g,Q:v,M:w,R:x}}}),EV=n(),NC=new Map;let l=t().concat(PR(EV)).sort((d,f)=>d-f);l.forEach((d,f)=>{let x=e(),g=l[f]=x?l[f-x]:{V:[],M:new Map};g.V.push(d),EV.has(d)||NC.set(d,g)});for(let{V:d,M:f}of new Set(NC.values())){let x=[];for(let v of d){let w=c4.filter(N=>XE(N,v)),C=x.find(({G:N})=>w.some(I=>N.has(I)));C||(C={G:new Set,V:[]},x.push(C)),C.V.push(v),r(C.G,w)}let g=x.flatMap(v=>PR(v.G));for(let{G:v,V:w}of x){let C=new Set(g.filter(N=>!v.has(N)));for(let N of w)f.set(N,C)}}Av=new Set;let c=new Set;const u=d=>Av.has(d)?c.add(d):Av.add(d);for(let d of c4){for(let f of d.P)u(f);for(let f of d.Q)u(f)}for(let d of Av)!NC.has(d)&&!c.has(d)&&NC.set(d,jMe);r(Av,SMe(Av)),t1e=gIt(e).map(d=>IIt.from(d)).sort(vIt),Yee=new Map;for(let d of t1e){let f=[Yee];for(let x of d){let g=f.map(v=>{let w=v.get(x);return w||(w=new Map,v.set(x,w)),w});x===AMe?f.push(...g):f=g}for(let x of f)x.V=d}}function Koe(e){return(kMe(e)?"":`${Yoe(w$([e]))} `)+gMe(e)}function Yoe(e){return`"${e}"‎`}function PIt(e){if(e.length>=4&&e[2]==e1e&&e[3]==e1e)throw new Error(`invalid label extension: "${hN(e.slice(0,4))}"`)}function FIt(e){for(let n=e.lastIndexOf(95);n>0;)if(e[--n]!==95)throw new Error("underscore allowed only at start")}function OIt(e){let t=e[0],n=Qge.get(t);if(n)throw e9(`leading ${n}`);let r=e.length,s=-1;for(let a=1;a<r;a++){t=e[a];let o=Qge.get(t);if(o){if(s==a)throw e9(`${n} + ${o}`);s=a+1,n=o}}if(s==r)throw e9(`trailing ${n}`)}function w$(e,t=1/0,n=gMe){let r=[];MIt(e[0])&&r.push("◌"),e.length>t&&(t>>=1,e=[...e.slice(0,t),8230,...e.slice(-t)]);let s=0,a=e.length;for(let o=0;o<a;o++){let l=e[o];kMe(l)&&(r.push(hN(e.slice(s,o))),r.push(n(l)),s=o+1)}return r.push(hN(e.slice(s,a))),r.join("")}function MIt(e,t){return Goe(),Zv.has(e)}function kMe(e){return Goe(),_Me.has(e)}function RIt(e){return $It(LIt(e,TIt,HIt))}function LIt(e,t,n){if(!e)return[];Goe();let r=0;return e.split(NMe).map(s=>{let a=yIt(s),o={input:a,offset:r};r+=a.length+1;try{let l=o.tokens=zIt(a,t,n),c=l.length,u;if(!c)throw new Error("empty label");let d=o.output=l.flat();if(FIt(d),!(o.emoji=c>1||l[0].is_emoji)&&d.every(x=>x<128))PIt(d),u="ASCII";else{let x=l.flatMap(g=>g.is_emoji?[]:g);if(!x.length)u="Emoji";else{if(Zv.has(d[0]))throw e9("leading combining mark");for(let w=1;w<c;w++){let C=l[w];if(!C.is_emoji&&Zv.has(C[0]))throw e9(`emoji + combining mark: "${hN(l[w-1])} + ${w$([C[0]])}"`)}OIt(d);let g=PR(new Set(x)),[v]=BIt(g);UIt(v,x),DIt(v,g),u=v.N}}o.type=u}catch(l){o.error=l}return o})}function DIt(e,t){let n,r=[];for(let s of t){let a=NC.get(s);if(a===jMe)return;if(a){let o=a.M.get(s);if(n=n?n.filter(l=>o.has(l)):PR(o),!n.length)return}else r.push(s)}if(n){for(let s of n)if(r.every(a=>XE(s,a)))throw new Error(`whole-script confusable: ${e.N}/${s.N}`)}}function BIt(e){let t=c4;for(let n of e){let r=t.filter(s=>XE(s,n));if(!r.length)throw c4.some(s=>XE(s,n))?IMe(t[0],n):TMe(n);if(t=r,r.length==1)break}return t}function $It(e){return e.map(({input:t,error:n,output:r})=>{if(n){let s=n.message;throw new Error(e.length==1?s:`Invalid label ${Yoe(w$(t,63))}: ${s}`)}return hN(r)}).join(NMe)}function TMe(e){return new Error(`disallowed character: ${Koe(e)}`)}function IMe(e,t){let n=Koe(t),r=c4.find(s=>s.P.has(t));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${e.N} + ${n}`)}function e9(e){return new Error(`illegal placement: ${e}`)}function UIt(e,t){for(let n of t)if(!XE(e,n))throw IMe(e,n);if(e.M){let n=SMe(t);for(let r=1,s=n.length;r<s;r++)if(Kee.has(n[r])){let a=r+1;for(let o;a<s&&Kee.has(o=n[a]);a++)for(let l=r;l<a;l++)if(n[l]==o)throw new Error(`duplicate non-spacing marks: ${Koe(o)}`);if(a-r>Zge)throw new Error(`excessive non-spacing marks: ${Yoe(w$(n.slice(r-1,a)))} (${a-r}/${Zge})`);r=a}}}function zIt(e,t,n){let r=[],s=[];for(e=e.slice().reverse();e.length;){let a=VIt(e);if(a)s.length&&(r.push(t(s)),s=[]),r.push(n(a));else{let o=e.pop();if(Av.has(o))s.push(o);else{let l=Gee.get(o);if(l)s.push(...l);else if(!EMe.has(o))throw TMe(o)}}}return s.length&&r.push(t(s)),r}function HIt(e){return e.filter(t=>t!=AMe)}function VIt(e,t){let n=Yee,r,s=e.length;for(;s&&(n=n.get(e[--s]),!!n);){let{V:a}=n;a&&(r=a,e.length=s)}return r}function WIt(e){return RIt(e)}function qIt(e){return WIt(e)}const GIt={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},KIt={block:Fut({format(e){var n;return{transactions:(n=e.transactions)==null?void 0:n.map(r=>{if(typeof r=="string")return r;const s=sB(r);return s.typeHex==="0x7e"&&(s.isSystemTx=r.isSystemTx,s.mint=r.mint?Xu(r.mint):void 0,s.sourceHash=r.sourceHash,s.type="deposit"),s}),stateRoot:e.stateRoot}}}),transaction:Iut({format(e){const t={};return e.type==="0x7e"&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?Xu(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:nht({format(e){return{l1GasPrice:e.l1GasPrice?Xu(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?Xu(e.l1GasUsed):null,l1Fee:e.l1Fee?Xu(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null}}})};function YIt(e,t){return ZIt(e)?QIt(e):Hpt(e,t)}const XIt={transaction:YIt};function QIt(e){JIt(e);const{sourceHash:t,data:n,from:r,gas:s,isSystemTx:a,mint:o,to:l,value:c}=e,u=[t,r,l??"0x",o?ri(o):"0x",c?ri(c):"0x",s?ri(s):"0x",a?"0x1":"0x",n??"0x"];return mm(["0x7e",My(u)])}function ZIt(e){return e.type==="deposit"||typeof e.sourceHash<"u"}function JIt(e){const{from:t,to:n}=e;if(t&&!Jl(t))throw new ld({address:t});if(n&&!Jl(n))throw new ld({address:n})}const n1e={contracts:GIt,formatters:KIt,serializers:XIt},r1e=fB({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),QE=fB({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),I7=1,s1e=fB({...n1e,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...n1e.contracts,disputeGameFactory:{[I7]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[I7]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[I7]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[I7]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:I7}),i1e=fB({id:137,name:"Polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}});var kb=function(){return kb=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},kb.apply(this,arguments)};function ePt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function tPt(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var t9="right-scroll-bar-position",n9="width-before-scroll-bar",nPt="with-scroll-bars-hidden",rPt="--removed-body-scroll-bar-size";function _V(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function sPt(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var iPt=typeof window<"u"?m.useLayoutEffect:m.useEffect,a1e=new WeakMap;function PMe(e,t){var n=sPt(null,function(r){return e.forEach(function(s){return _V(s,r)})});return iPt(function(){var r=a1e.get(n);if(r){var s=new Set(r),a=new Set(e),o=n.current;s.forEach(function(l){a.has(l)||_V(l,null)}),a.forEach(function(l){s.has(l)||_V(l,o)})}a1e.set(n,e)},[e]),n}var Xee=function(e,t){return Xee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[s]=r[s])},Xee(e,t)};function FMe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Xee(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var mN=function(){return mN=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},mN.apply(this,arguments)};function Xoe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function OMe(e,t,n,r){var s=arguments.length,a=s<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(s<3?o(a):s>3?o(t,n,a):o(t,n))||a);return s>3&&a&&Object.defineProperty(t,n,a),a}function MMe(e,t){return function(n,r){t(n,r,e)}}function RMe(e,t,n,r,s,a){function o(N){if(N!==void 0&&typeof N!="function")throw new TypeError("Function expected");return N}for(var l=r.kind,c=l==="getter"?"get":l==="setter"?"set":"value",u=!t&&e?r.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),f,x=!1,g=n.length-1;g>=0;g--){var v={};for(var w in r)v[w]=w==="access"?{}:r[w];for(var w in r.access)v.access[w]=r.access[w];v.addInitializer=function(N){if(x)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(N||null))};var C=(0,n[g])(l==="accessor"?{get:d.get,set:d.set}:d[c],v);if(l==="accessor"){if(C===void 0)continue;if(C===null||typeof C!="object")throw new TypeError("Object expected");(f=o(C.get))&&(d.get=f),(f=o(C.set))&&(d.set=f),(f=o(C.init))&&s.unshift(f)}else(f=o(C))&&(l==="field"?s.unshift(f):d[c]=f)}u&&Object.defineProperty(u,r.name,d),x=!0}function LMe(e,t,n){for(var r=arguments.length>2,s=0;s<t.length;s++)n=r?t[s].call(e,n):t[s].call(e);return r?n:void 0}function DMe(e){return typeof e=="symbol"?e:"".concat(e)}function BMe(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function $Me(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function UMe(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})}function zMe(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=l(0),o.throw=l(1),o.return=l(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,s=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],s=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var C$=Object.create?function(e,t,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(t,n);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,s)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]};function HMe(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&C$(t,e,n)}function FR(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Qoe(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,a=[],o;try{for(;(t===void 0||t-- >0)&&!(s=r.next()).done;)a.push(s.value)}catch(l){o={error:l}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function VMe(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Qoe(arguments[t]));return e}function WMe(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),s=0,t=0;t<n;t++)for(var a=arguments[t],o=0,l=a.length;o<l;o++,s++)r[s]=a[o];return r}function qMe(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function xN(e){return this instanceof xN?(this.v=e,this):new xN(e)}function GMe(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),s,a=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(g){return function(v){return Promise.resolve(v).then(g,f)}}function l(g,v){r[g]&&(s[g]=function(w){return new Promise(function(C,N){a.push([g,w,C,N])>1||c(g,w)})},v&&(s[g]=v(s[g])))}function c(g,v){try{u(r[g](v))}catch(w){x(a[0][3],w)}}function u(g){g.value instanceof xN?Promise.resolve(g.value.v).then(d,f):x(a[0][2],g)}function d(g){c("next",g)}function f(g){c("throw",g)}function x(g,v){g(v),a.shift(),a.length&&c(a[0][0],a[0][1])}}function KMe(e){var t,n;return t={},r("next"),r("throw",function(s){throw s}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(s,a){t[s]=e[s]?function(o){return(n=!n)?{value:xN(e[s](o)),done:!1}:a?a(o):o}:a}}function YMe(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof FR=="function"?FR(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=e[a]&&function(o){return new Promise(function(l,c){o=e[a](o),s(l,c,o.done,o.value)})}}function s(a,o,l,c){Promise.resolve(c).then(function(u){a({value:u,done:l})},o)}}function XMe(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var aPt=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function QMe(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&C$(t,e,n);return aPt(t,e),t}function ZMe(e){return e&&e.__esModule?e:{default:e}}function JMe(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function eRe(e,t,n,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(e,n):s?s.value=n:t.set(e,n),n}function tRe(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function nRe(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var r,s;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],n&&(s=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");s&&(r=function(){try{s.call(this)}catch(a){return Promise.reject(a)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var oPt=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function rRe(e){function t(a){e.error=e.hasError?new oPt(a,e.error,"An error was suppressed during disposal."):a,e.hasError=!0}var n,r=0;function s(){for(;n=e.stack.pop();)try{if(!n.async&&r===1)return r=0,e.stack.push(n),Promise.resolve().then(s);if(n.dispose){var a=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(a).then(s,function(o){return t(o),s()})}else r|=1}catch(o){t(o)}if(r===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return s()}function sRe(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,r,s,a,o){return r?t?".jsx":".js":s&&(!a||!o)?n:s+a+"."+o.toLowerCase()+"js"}):e}const lPt={__extends:FMe,__assign:mN,__rest:Xoe,__decorate:OMe,__param:MMe,__esDecorate:RMe,__runInitializers:LMe,__propKey:DMe,__setFunctionName:BMe,__metadata:$Me,__awaiter:UMe,__generator:zMe,__createBinding:C$,__exportStar:HMe,__values:FR,__read:Qoe,__spread:VMe,__spreadArrays:WMe,__spreadArray:qMe,__await:xN,__asyncGenerator:GMe,__asyncDelegator:KMe,__asyncValues:YMe,__makeTemplateObject:XMe,__importStar:QMe,__importDefault:ZMe,__classPrivateFieldGet:JMe,__classPrivateFieldSet:eRe,__classPrivateFieldIn:tRe,__addDisposableResource:nRe,__disposeResources:rRe,__rewriteRelativeImportExtension:sRe},mvn=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:nRe,get __assign(){return mN},__asyncDelegator:KMe,__asyncGenerator:GMe,__asyncValues:YMe,__await:xN,__awaiter:UMe,__classPrivateFieldGet:JMe,__classPrivateFieldIn:tRe,__classPrivateFieldSet:eRe,__createBinding:C$,__decorate:OMe,__disposeResources:rRe,__esDecorate:RMe,__exportStar:HMe,__extends:FMe,__generator:zMe,__importDefault:ZMe,__importStar:QMe,__makeTemplateObject:XMe,__metadata:$Me,__param:MMe,__propKey:DMe,__read:Qoe,__rest:Xoe,__rewriteRelativeImportExtension:sRe,__runInitializers:LMe,__setFunctionName:BMe,__spread:VMe,__spreadArray:qMe,__spreadArrays:WMe,__values:FR,default:lPt},Symbol.toStringTag,{value:"Module"}));function cPt(e){return e}function uPt(e,t){t===void 0&&(t=cPt);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(l){return a(l)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(a),o=n}var c=function(){var d=o;o=[],d.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),n}}}};return s}function iRe(e){e===void 0&&(e={});var t=uPt(null);return t.options=mN({async:!0,ssr:!1},e),t}var aRe=function(e){var t=e.sideCar,n=Xoe(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,mN({},n))};aRe.isSideCarExport=!0;function oRe(e,t){return e.useMedium(t),aRe}var lRe=iRe(),kV=function(){},S$=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:kV,onWheelCapture:kV,onTouchMoveCapture:kV}),s=r[0],a=r[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,x=e.sideCar,g=e.noIsolation,v=e.inert,w=e.allowPinchZoom,C=e.as,N=C===void 0?"div":C,I=e.gapMode,P=ePt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=x,F=PMe([n,t]),U=kb(kb({},P),s);return m.createElement(m.Fragment,null,d&&m.createElement(R,{sideCar:lRe,removeScrollBar:u,shards:f,noIsolation:g,inert:v,setCallbacks:a,allowPinchZoom:!!w,lockRef:n,gapMode:I}),o?m.cloneElement(m.Children.only(l),kb(kb({},U),{ref:F})):m.createElement(N,kb({},U,{className:c,ref:F}),l))});S$.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};S$.classNames={fullWidth:n9,zeroRight:t9};var dPt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function fPt(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=dPt();return t&&e.setAttribute("nonce",t),e}function hPt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function pPt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var mPt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=fPt())&&(hPt(t,n),pPt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},xPt=function(){var e=mPt();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Zoe=function(){var e=xPt(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},gPt={left:0,top:0,right:0,gap:0},TV=function(e){return parseInt(e||"",10)||0},bPt=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[TV(n),TV(r),TV(s)]},yPt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return gPt;var t=bPt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},vPt=Zoe(),u4="data-scroll-locked",wPt=function(e,t,n,r){var s=e.left,a=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
  .`.concat(nPt,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(l,"px ").concat(r,`;
  }
  body[`).concat(u4,`] {
    overflow: hidden `).concat(r,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
    padding-left: `.concat(s,`px;
    padding-top: `).concat(a,`px;
    padding-right: `).concat(o,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(l,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(t9,` {
    right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(n9,` {
    margin-right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(t9," .").concat(t9,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(n9," .").concat(n9,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(u4,`] {
    `).concat(rPt,": ").concat(l,`px;
  }
`)},o1e=function(){var e=parseInt(document.body.getAttribute(u4)||"0",10);return isFinite(e)?e:0},CPt=function(){m.useEffect(function(){return document.body.setAttribute(u4,(o1e()+1).toString()),function(){var e=o1e()-1;e<=0?document.body.removeAttribute(u4):document.body.setAttribute(u4,e.toString())}},[])},cRe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;CPt();var a=m.useMemo(function(){return yPt(s)},[s]);return m.createElement(vPt,{styles:wPt(a,!t,s,n?"":"!important")})},Qee=!1;if(typeof window<"u")try{var hP=Object.defineProperty({},"passive",{get:function(){return Qee=!0,!0}});window.addEventListener("test",hP,hP),window.removeEventListener("test",hP,hP)}catch{Qee=!1}var W6=Qee?{passive:!1}:!1,SPt=function(e){return e.tagName==="TEXTAREA"},uRe=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!SPt(e)&&n[t]==="visible")},NPt=function(e){return uRe(e,"overflowY")},APt=function(e){return uRe(e,"overflowX")},l1e=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=dRe(e,r);if(s){var a=fRe(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},jPt=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},EPt=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},dRe=function(e,t){return e==="v"?NPt(t):APt(t)},fRe=function(e,t){return e==="v"?jPt(t):EPt(t)},_Pt=function(e,t){return e==="h"&&t==="rtl"?-1:1},kPt=function(e,t,n,r,s){var a=_Pt(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),u=!1,d=o>0,f=0,x=0;do{var g=fRe(e,l),v=g[0],w=g[1],C=g[2],N=w-C-a*v;(v||N)&&dRe(e,l)&&(f+=N,x+=v),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&Math.abs(f)<1||!d&&Math.abs(x)<1)&&(u=!0),u},pP=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},c1e=function(e){return[e.deltaX,e.deltaY]},u1e=function(e){return e&&"current"in e?e.current:e},TPt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},IPt=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},PPt=0,q6=[];function FPt(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(PPt++)[0],a=m.useState(Zoe)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=tPt([e.lockRef.current],(e.shards||[]).map(u1e),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var N=pP(w),I=n.current,P="deltaX"in w?w.deltaX:I[0]-N[0],R="deltaY"in w?w.deltaY:I[1]-N[1],F,U=w.target,L=Math.abs(P)>Math.abs(R)?"h":"v";if("touches"in w&&L==="h"&&U.type==="range")return!1;var z=l1e(L,U);if(!z)return!0;if(z?F=L:(F=L==="v"?"h":"v",z=l1e(L,U)),!z)return!1;if(!r.current&&"changedTouches"in w&&(P||R)&&(r.current=F),!F)return!0;var X=r.current||F;return kPt(X,C,w,X==="h"?P:R)},[]),c=m.useCallback(function(w){var C=w;if(!(!q6.length||q6[q6.length-1]!==a)){var N="deltaY"in C?c1e(C):pP(C),I=t.current.filter(function(F){return F.name===C.type&&(F.target===C.target||C.target===F.shadowParent)&&TPt(F.delta,N)})[0];if(I&&I.should){C.cancelable&&C.preventDefault();return}if(!I){var P=(o.current.shards||[]).map(u1e).filter(Boolean).filter(function(F){return F.contains(C.target)}),R=P.length>0?l(C,P[0]):!o.current.noIsolation;R&&C.cancelable&&C.preventDefault()}}},[]),u=m.useCallback(function(w,C,N,I){var P={name:w,delta:C,target:N,should:I,shadowParent:OPt(N)};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(R){return R!==P})},1)},[]),d=m.useCallback(function(w){n.current=pP(w),r.current=void 0},[]),f=m.useCallback(function(w){u(w.type,c1e(w),w.target,l(w,e.lockRef.current))},[]),x=m.useCallback(function(w){u(w.type,pP(w),w.target,l(w,e.lockRef.current))},[]);m.useEffect(function(){return q6.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:x}),document.addEventListener("wheel",c,W6),document.addEventListener("touchmove",c,W6),document.addEventListener("touchstart",d,W6),function(){q6=q6.filter(function(w){return w!==a}),document.removeEventListener("wheel",c,W6),document.removeEventListener("touchmove",c,W6),document.removeEventListener("touchstart",d,W6)}},[]);var g=e.removeScrollBar,v=e.inert;return m.createElement(m.Fragment,null,v?m.createElement(a,{styles:IPt(s)}):null,g?m.createElement(cRe,{gapMode:e.gapMode}):null)}function OPt(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const MPt=oRe(lRe,FPt);var hRe=m.forwardRef(function(e,t){return m.createElement(S$,kb({},e,{ref:t,sideCar:MPt}))});hRe.classNames=S$.classNames;function d1e(e){var t=e.match(/^var\((.*)\)$/);return t?t[1]:e}function RPt(e,t){var n=e;for(var r of t){if(!(r in n))throw new Error("Path ".concat(t.join(" -> ")," does not exist in object"));n=n[r]}return n}function pRe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r={};for(var s in e){var a=e[s],o=[...n,s];typeof a=="string"||typeof a=="number"||a==null?r[s]=t(a,o):typeof a=="object"&&!Array.isArray(a)?r[s]=pRe(a,t,o):console.warn('Skipping invalid key "'.concat(o.join("."),'". Should be a string, number, null or object. Received: "').concat(Array.isArray(a)?"Array":typeof a,'"'))}return r}function f1e(e,t){var n={};if(typeof t=="object"){var r=e;pRe(t,(l,c)=>{if(l!=null){var u=RPt(r,c);n[d1e(u)]=String(l)}})}else{var s=e;for(var a in s){var o=s[a];o!=null&&(n[d1e(a)]=o)}}return Object.defineProperty(n,"toString",{value:function(){return Object.keys(this).map(c=>"".concat(c,":").concat(this[c])).join(";")},writable:!1}),n}var Nj={exports:{}},LPt=Nj.exports,h1e;function DPt(){return h1e||(h1e=1,function(e,t){(function(n,r){var s="1.0.40",a="",o="?",l="function",c="undefined",u="object",d="string",f="major",x="model",g="name",v="type",w="vendor",C="version",N="architecture",I="console",P="mobile",R="tablet",F="smarttv",U="wearable",L="embedded",z=500,X="Amazon",ne="Apple",J="ASUS",Z="BlackBerry",re="Browser",he="Chrome",Y="Edge",ie="Firefox",oe="Google",G="Huawei",V="LG",ee="Microsoft",ae="Motorola",fe="Opera",Ae="Samsung",ce="Sharp",ye="Sony",Ne="Xiaomi",be="Zebra",je="Facebook",Ie="Chromium OS",Re="Mac OS",Qe=" Browser",Be=function(Vt,Yt){var Ve={};for(var Ke in Vt)Yt[Ke]&&Yt[Ke].length%2===0?Ve[Ke]=Yt[Ke].concat(Vt[Ke]):Ve[Ke]=Vt[Ke];return Ve},it=function(Vt){for(var Yt={},Ve=0;Ve<Vt.length;Ve++)Yt[Vt[Ve].toUpperCase()]=Vt[Ve];return Yt},tt=function(Vt,Yt){return typeof Vt===d?at(Yt).indexOf(at(Vt))!==-1:!1},at=function(Vt){return Vt.toLowerCase()},dt=function(Vt){return typeof Vt===d?Vt.replace(/[^\d\.]/g,a).split(".")[0]:r},ct=function(Vt,Yt){if(typeof Vt===d)return Vt=Vt.replace(/^\s\s*/,a),typeof Yt===c?Vt:Vt.substring(0,z)},Ut=function(Vt,Yt){for(var Ve=0,Ke,ft,en,Dt,At,Je;Ve<Yt.length&&!At;){var He=Yt[Ve],Rt=Yt[Ve+1];for(Ke=ft=0;Ke<He.length&&!At&&He[Ke];)if(At=He[Ke++].exec(Vt),At)for(en=0;en<Rt.length;en++)Je=At[++ft],Dt=Rt[en],typeof Dt===u&&Dt.length>0?Dt.length===2?typeof Dt[1]==l?this[Dt[0]]=Dt[1].call(this,Je):this[Dt[0]]=Dt[1]:Dt.length===3?typeof Dt[1]===l&&!(Dt[1].exec&&Dt[1].test)?this[Dt[0]]=Je?Dt[1].call(this,Je,Dt[2]):r:this[Dt[0]]=Je?Je.replace(Dt[1],Dt[2]):r:Dt.length===4&&(this[Dt[0]]=Je?Dt[3].call(this,Je.replace(Dt[1],Dt[2])):r):this[Dt]=Je||r;Ve+=2}},kt=function(Vt,Yt){for(var Ve in Yt)if(typeof Yt[Ve]===u&&Yt[Ve].length>0){for(var Ke=0;Ke<Yt[Ve].length;Ke++)if(tt(Yt[Ve][Ke],Vt))return Ve===o?r:Ve}else if(tt(Yt[Ve],Vt))return Ve===o?r:Ve;return Yt.hasOwnProperty("*")?Yt["*"]:Vt},tn={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},jt={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},un={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[C,[g,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[C,[g,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[g,C],[/opios[\/ ]+([\w\.]+)/i],[C,[g,fe+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[C,[g,fe+" GX"]],[/\bopr\/([\w\.]+)/i],[C,[g,fe]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[C,[g,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[C,[g,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[g,C],[/quark(?:pc)?\/([-\w\.]+)/i],[C,[g,"Quark"]],[/\bddg\/([\w\.]+)/i],[C,[g,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[C,[g,"UC"+re]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[C,[g,"WeChat"]],[/konqueror\/([\w\.]+)/i],[C,[g,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[C,[g,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[C,[g,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[C,[g,"Smart Lenovo "+re]],[/(avast|avg)\/([\w\.]+)/i],[[g,/(.+)/,"$1 Secure "+re],C],[/\bfocus\/([\w\.]+)/i],[C,[g,ie+" Focus"]],[/\bopt\/([\w\.]+)/i],[C,[g,fe+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[C,[g,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[C,[g,"Dolphin"]],[/coast\/([\w\.]+)/i],[C,[g,fe+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[C,[g,"MIUI"+Qe]],[/fxios\/([\w\.-]+)/i],[C,[g,ie]],[/\bqihoobrowser\/?([\w\.]*)/i],[C,[g,"360"]],[/\b(qq)\/([\w\.]+)/i],[[g,/(.+)/,"$1Browser"],C],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[g,/(.+)/,"$1"+Qe],C],[/samsungbrowser\/([\w\.]+)/i],[C,[g,Ae+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[C,[g,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[g,"Sogou Mobile"],C],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[g,C],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[g],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[C,g],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[g,je],C],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[g,C],[/\bgsa\/([\w\.]+) .*safari\//i],[C,[g,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[C,[g,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[C,[g,he+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[g,he+" WebView"],C],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[C,[g,"Android "+re]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[g,C],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[C,[g,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[C,g],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[g,[C,kt,tn]],[/(webkit|khtml)\/([\w\.]+)/i],[g,C],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[g,"Netscape"],C],[/(wolvic|librewolf)\/([\w\.]+)/i],[g,C],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[C,[g,ie+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[g,[C,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[g,[C,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[N,"amd64"]],[/(ia32(?=;))/i],[[N,at]],[/((?:i[346]|x)86)[;\)]/i],[[N,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[N,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[N,"armhf"]],[/windows (ce|mobile); ppc;/i],[[N,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[N,/ower/,a,at]],[/(sun4\w)[;\)]/i],[[N,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[N,at]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[x,[w,Ae],[v,R]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[x,[w,Ae],[v,P]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[x,[w,ne],[v,P]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[x,[w,ne],[v,R]],[/(macintosh);/i],[x,[w,ne]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[x,[w,ce],[v,P]],[/(?:honor)([-\w ]+)[;\)]/i],[x,[w,"Honor"],[v,P]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[x,[w,G],[v,R]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[x,[w,G],[v,P]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[x,/_/g," "],[w,Ne],[v,P]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[x,/_/g," "],[w,Ne],[v,R]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[x,[w,"OPPO"],[v,P]],[/\b(opd2\d{3}a?) bui/i],[x,[w,"OPPO"],[v,R]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[x,[w,"Vivo"],[v,P]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[x,[w,"Realme"],[v,P]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[x,[w,ae],[v,P]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[x,[w,ae],[v,R]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[x,[w,V],[v,R]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[x,[w,V],[v,P]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[x,[w,"Lenovo"],[v,R]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[x,/_/g," "],[w,"Nokia"],[v,P]],[/(pixel c)\b/i],[x,[w,oe],[v,R]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[x,[w,oe],[v,P]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[x,[w,ye],[v,P]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[x,"Xperia Tablet"],[w,ye],[v,R]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[x,[w,"OnePlus"],[v,P]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[x,[w,X],[v,R]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[x,/(.+)/g,"Fire Phone $1"],[w,X],[v,P]],[/(playbook);[-\w\),; ]+(rim)/i],[x,w,[v,R]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[x,[w,Z],[v,P]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[x,[w,J],[v,R]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[x,[w,J],[v,P]],[/(nexus 9)/i],[x,[w,"HTC"],[v,R]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[w,[x,/_/g," "],[v,P]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[x,[w,"TCL"],[v,R]],[/(itel) ((\w+))/i],[[w,at],x,[v,kt,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[x,[w,"Acer"],[v,R]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[x,[w,"Meizu"],[v,P]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[x,[w,"Ulefone"],[v,P]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[x,[w,"Energizer"],[v,P]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[x,[w,"Cat"],[v,P]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[x,[w,"Smartfren"],[v,P]],[/droid.+; (a(?:015|06[35]|142p?))/i],[x,[w,"Nothing"],[v,P]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[w,x,[v,P]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[w,x,[v,R]],[/(surface duo)/i],[x,[w,ee],[v,R]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[x,[w,"Fairphone"],[v,P]],[/(u304aa)/i],[x,[w,"AT&T"],[v,P]],[/\bsie-(\w*)/i],[x,[w,"Siemens"],[v,P]],[/\b(rct\w+) b/i],[x,[w,"RCA"],[v,R]],[/\b(venue[\d ]{2,7}) b/i],[x,[w,"Dell"],[v,R]],[/\b(q(?:mv|ta)\w+) b/i],[x,[w,"Verizon"],[v,R]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[x,[w,"Barnes & Noble"],[v,R]],[/\b(tm\d{3}\w+) b/i],[x,[w,"NuVision"],[v,R]],[/\b(k88) b/i],[x,[w,"ZTE"],[v,R]],[/\b(nx\d{3}j) b/i],[x,[w,"ZTE"],[v,P]],[/\b(gen\d{3}) b.+49h/i],[x,[w,"Swiss"],[v,P]],[/\b(zur\d{3}) b/i],[x,[w,"Swiss"],[v,R]],[/\b((zeki)?tb.*\b) b/i],[x,[w,"Zeki"],[v,R]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[w,"Dragon Touch"],x,[v,R]],[/\b(ns-?\w{0,9}) b/i],[x,[w,"Insignia"],[v,R]],[/\b((nxa|next)-?\w{0,9}) b/i],[x,[w,"NextBook"],[v,R]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[w,"Voice"],x,[v,P]],[/\b(lvtel\-)?(v1[12]) b/i],[[w,"LvTel"],x,[v,P]],[/\b(ph-1) /i],[x,[w,"Essential"],[v,P]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[x,[w,"Envizen"],[v,R]],[/\b(trio[-\w\. ]+) b/i],[x,[w,"MachSpeed"],[v,R]],[/\btu_(1491) b/i],[x,[w,"Rotor"],[v,R]],[/(shield[\w ]+) b/i],[x,[w,"Nvidia"],[v,R]],[/(sprint) (\w+)/i],[w,x,[v,P]],[/(kin\.[onetw]{3})/i],[[x,/\./g," "],[w,ee],[v,P]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[x,[w,be],[v,R]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[x,[w,be],[v,P]],[/smart-tv.+(samsung)/i],[w,[v,F]],[/hbbtv.+maple;(\d+)/i],[[x,/^/,"SmartTV"],[w,Ae],[v,F]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[w,V],[v,F]],[/(apple) ?tv/i],[w,[x,ne+" TV"],[v,F]],[/crkey/i],[[x,he+"cast"],[w,oe],[v,F]],[/droid.+aft(\w+)( bui|\))/i],[x,[w,X],[v,F]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[x,[w,ce],[v,F]],[/(bravia[\w ]+)( bui|\))/i],[x,[w,ye],[v,F]],[/(mitv-\w{5}) bui/i],[x,[w,Ne],[v,F]],[/Hbbtv.*(technisat) (.*);/i],[w,x,[v,F]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[w,ct],[x,ct],[v,F]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[v,F]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[w,x,[v,I]],[/droid.+; (shield) bui/i],[x,[w,"Nvidia"],[v,I]],[/(playstation [345portablevi]+)/i],[x,[w,ye],[v,I]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[x,[w,ee],[v,I]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[x,[w,Ae],[v,U]],[/((pebble))app/i],[w,x,[v,U]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[x,[w,ne],[v,U]],[/droid.+; (glass) \d/i],[x,[w,oe],[v,U]],[/droid.+; (wt63?0{2,3})\)/i],[x,[w,be],[v,U]],[/droid.+; (glass) \d/i],[x,[w,oe],[v,U]],[/(pico) (4|neo3(?: link|pro)?)/i],[w,x,[v,U]],[/; (quest( \d| pro)?)/i],[x,[w,je],[v,U]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[w,[v,L]],[/(aeobc)\b/i],[x,[w,X],[v,L]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[x,[v,P]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[x,[v,R]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[v,R]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[v,P]],[/(android[-\w\. ]{0,9});.+buil/i],[x,[w,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[C,[g,Y+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[g,C],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[C,[g,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[g,C],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[C,g]],os:[[/microsoft (windows) (vista|xp)/i],[g,C],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[g,[C,kt,jt]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[C,kt,jt],[g,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[C,/_/g,"."],[g,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[g,Re],[C,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[C,g],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[g,C],[/\(bb(10);/i],[C,[g,Z]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[C,[g,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[C,[g,ie+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[C,[g,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[C,[g,"watchOS"]],[/crkey\/([\d\.]+)/i],[C,[g,he+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[g,Ie],C],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[g,C],[/(sunos) ?([\w\.\d]*)/i],[[g,"Solaris"],C],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[g,C]]},cn=function(Vt,Yt){if(typeof Vt===u&&(Yt=Vt,Vt=r),!(this instanceof cn))return new cn(Vt,Yt).getResult();var Ve=typeof n!==c&&n.navigator?n.navigator:r,Ke=Vt||(Ve&&Ve.userAgent?Ve.userAgent:a),ft=Ve&&Ve.userAgentData?Ve.userAgentData:r,en=Yt?Be(un,Yt):un,Dt=Ve&&Ve.userAgent==Ke;return this.getBrowser=function(){var At={};return At[g]=r,At[C]=r,Ut.call(At,Ke,en.browser),At[f]=dt(At[C]),Dt&&Ve&&Ve.brave&&typeof Ve.brave.isBrave==l&&(At[g]="Brave"),At},this.getCPU=function(){var At={};return At[N]=r,Ut.call(At,Ke,en.cpu),At},this.getDevice=function(){var At={};return At[w]=r,At[x]=r,At[v]=r,Ut.call(At,Ke,en.device),Dt&&!At[v]&&ft&&ft.mobile&&(At[v]=P),Dt&&At[x]=="Macintosh"&&Ve&&typeof Ve.standalone!==c&&Ve.maxTouchPoints&&Ve.maxTouchPoints>2&&(At[x]="iPad",At[v]=R),At},this.getEngine=function(){var At={};return At[g]=r,At[C]=r,Ut.call(At,Ke,en.engine),At},this.getOS=function(){var At={};return At[g]=r,At[C]=r,Ut.call(At,Ke,en.os),Dt&&!At[g]&&ft&&ft.platform&&ft.platform!="Unknown"&&(At[g]=ft.platform.replace(/chrome os/i,Ie).replace(/macos/i,Re)),At},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Ke},this.setUA=function(At){return Ke=typeof At===d&&At.length>z?ct(At,z):At,this},this.setUA(Ke),this};cn.VERSION=s,cn.BROWSER=it([g,C,f]),cn.CPU=it([N]),cn.DEVICE=it([x,w,v,I,P,F,R,U,L]),cn.ENGINE=cn.OS=it([g,C]),e.exports&&(t=e.exports=cn),t.UAParser=cn;var Pt=typeof n!==c&&(n.jQuery||n.Zepto);if(Pt&&!Pt.ua){var Xe=new cn;Pt.ua=Xe.getResult(),Pt.ua.get=function(){return Xe.getUA()},Pt.ua.set=function(Vt){Xe.setUA(Vt);var Yt=Xe.getResult();for(var Ve in Yt)Pt.ua[Ve]=Yt[Ve]}}})(typeof window=="object"?window:LPt)}(Nj,Nj.exports)),Nj.exports}var BPt=DPt(),G6={},IV,p1e;function $Pt(){return p1e||(p1e=1,IV=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),IV}var PV={},cb={},m1e;function f5(){if(m1e)return cb;m1e=1;let e;const t=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return cb.getSymbolSize=function(r){if(!r)throw new Error('"version" cannot be null or undefined');if(r<1||r>40)throw new Error('"version" should be in range from 1 to 40');return r*4+17},cb.getSymbolTotalCodewords=function(r){return t[r]},cb.getBCHDigit=function(n){let r=0;for(;n!==0;)r++,n>>>=1;return r},cb.setToSJISFunction=function(r){if(typeof r!="function")throw new Error('"toSJISFunc" is not a valid function.');e=r},cb.isKanjiModeEnabled=function(){return typeof e<"u"},cb.toSJIS=function(r){return e(r)},cb}var FV={},x1e;function Joe(){return x1e||(x1e=1,function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+n)}}e.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},e.from=function(r,s){if(e.isValid(r))return r;try{return t(r)}catch{return s}}}(FV)),FV}var OV,g1e;function UPt(){if(g1e)return OV;g1e=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const n=Math.floor(t/8);return(this.buffer[n]>>>7-t%8&1)===1},put:function(t,n){for(let r=0;r<n;r++)this.putBit((t>>>n-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},OV=e,OV}var MV,b1e;function zPt(){if(b1e)return MV;b1e=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,n,r,s){const a=t*this.size+n;this.data[a]=r,s&&(this.reservedBit[a]=!0)},e.prototype.get=function(t,n){return this.data[t*this.size+n]},e.prototype.xor=function(t,n,r){this.data[t*this.size+n]^=r},e.prototype.isReserved=function(t,n){return this.reservedBit[t*this.size+n]},MV=e,MV}var RV={},y1e;function HPt(){return y1e||(y1e=1,function(e){const t=f5().getSymbolSize;e.getRowColCoords=function(r){if(r===1)return[];const s=Math.floor(r/7)+2,a=t(r),o=a===145?26:Math.ceil((a-13)/(2*s-2))*2,l=[a-7];for(let c=1;c<s-1;c++)l[c]=l[c-1]-o;return l.push(6),l.reverse()},e.getPositions=function(r){const s=[],a=e.getRowColCoords(r),o=a.length;for(let l=0;l<o;l++)for(let c=0;c<o;c++)l===0&&c===0||l===0&&c===o-1||l===o-1&&c===0||s.push([a[l],a[c]]);return s}}(RV)),RV}var LV={},v1e;function VPt(){if(v1e)return LV;v1e=1;const e=f5().getSymbolSize,t=7;return LV.getPositions=function(r){const s=e(r);return[[0,0],[s-t,0],[0,s-t]]},LV}var DV={},w1e;function WPt(){return w1e||(w1e=1,function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(s){return s!=null&&s!==""&&!isNaN(s)&&s>=0&&s<=7},e.from=function(s){return e.isValid(s)?parseInt(s,10):void 0},e.getPenaltyN1=function(s){const a=s.size;let o=0,l=0,c=0,u=null,d=null;for(let f=0;f<a;f++){l=c=0,u=d=null;for(let x=0;x<a;x++){let g=s.get(f,x);g===u?l++:(l>=5&&(o+=t.N1+(l-5)),u=g,l=1),g=s.get(x,f),g===d?c++:(c>=5&&(o+=t.N1+(c-5)),d=g,c=1)}l>=5&&(o+=t.N1+(l-5)),c>=5&&(o+=t.N1+(c-5))}return o},e.getPenaltyN2=function(s){const a=s.size;let o=0;for(let l=0;l<a-1;l++)for(let c=0;c<a-1;c++){const u=s.get(l,c)+s.get(l,c+1)+s.get(l+1,c)+s.get(l+1,c+1);(u===4||u===0)&&o++}return o*t.N2},e.getPenaltyN3=function(s){const a=s.size;let o=0,l=0,c=0;for(let u=0;u<a;u++){l=c=0;for(let d=0;d<a;d++)l=l<<1&2047|s.get(u,d),d>=10&&(l===1488||l===93)&&o++,c=c<<1&2047|s.get(d,u),d>=10&&(c===1488||c===93)&&o++}return o*t.N3},e.getPenaltyN4=function(s){let a=0;const o=s.data.length;for(let c=0;c<o;c++)a+=s.data[c];return Math.abs(Math.ceil(a*100/o/5)-10)*t.N4};function n(r,s,a){switch(r){case e.Patterns.PATTERN000:return(s+a)%2===0;case e.Patterns.PATTERN001:return s%2===0;case e.Patterns.PATTERN010:return a%3===0;case e.Patterns.PATTERN011:return(s+a)%3===0;case e.Patterns.PATTERN100:return(Math.floor(s/2)+Math.floor(a/3))%2===0;case e.Patterns.PATTERN101:return s*a%2+s*a%3===0;case e.Patterns.PATTERN110:return(s*a%2+s*a%3)%2===0;case e.Patterns.PATTERN111:return(s*a%3+(s+a)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}e.applyMask=function(s,a){const o=a.size;for(let l=0;l<o;l++)for(let c=0;c<o;c++)a.isReserved(c,l)||a.xor(c,l,n(s,c,l))},e.getBestMask=function(s,a){const o=Object.keys(e.Patterns).length;let l=0,c=1/0;for(let u=0;u<o;u++){a(u),e.applyMask(u,s);const d=e.getPenaltyN1(s)+e.getPenaltyN2(s)+e.getPenaltyN3(s)+e.getPenaltyN4(s);e.applyMask(u,s),d<c&&(c=d,l=u)}return l}}(DV)),DV}var mP={},C1e;function mRe(){if(C1e)return mP;C1e=1;const e=Joe(),t=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],n=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return mP.getBlocksCount=function(s,a){switch(a){case e.L:return t[(s-1)*4+0];case e.M:return t[(s-1)*4+1];case e.Q:return t[(s-1)*4+2];case e.H:return t[(s-1)*4+3];default:return}},mP.getTotalCodewordsCount=function(s,a){switch(a){case e.L:return n[(s-1)*4+0];case e.M:return n[(s-1)*4+1];case e.Q:return n[(s-1)*4+2];case e.H:return n[(s-1)*4+3];default:return}},mP}var BV={},P7={},S1e;function qPt(){if(S1e)return P7;S1e=1;const e=new Uint8Array(512),t=new Uint8Array(256);return function(){let r=1;for(let s=0;s<255;s++)e[s]=r,t[r]=s,r<<=1,r&256&&(r^=285);for(let s=255;s<512;s++)e[s]=e[s-255]}(),P7.log=function(r){if(r<1)throw new Error("log("+r+")");return t[r]},P7.exp=function(r){return e[r]},P7.mul=function(r,s){return r===0||s===0?0:e[t[r]+t[s]]},P7}var N1e;function GPt(){return N1e||(N1e=1,function(e){const t=qPt();e.mul=function(r,s){const a=new Uint8Array(r.length+s.length-1);for(let o=0;o<r.length;o++)for(let l=0;l<s.length;l++)a[o+l]^=t.mul(r[o],s[l]);return a},e.mod=function(r,s){let a=new Uint8Array(r);for(;a.length-s.length>=0;){const o=a[0];for(let c=0;c<s.length;c++)a[c]^=t.mul(s[c],o);let l=0;for(;l<a.length&&a[l]===0;)l++;a=a.slice(l)}return a},e.generateECPolynomial=function(r){let s=new Uint8Array([1]);for(let a=0;a<r;a++)s=e.mul(s,new Uint8Array([1,t.exp(a)]));return s}}(BV)),BV}var $V,A1e;function KPt(){if(A1e)return $V;A1e=1;const e=GPt();function t(n){this.genPoly=void 0,this.degree=n,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(r){this.degree=r,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(r){if(!this.genPoly)throw new Error("Encoder not initialized");const s=new Uint8Array(r.length+this.degree);s.set(r);const a=e.mod(s,this.genPoly),o=this.degree-a.length;if(o>0){const l=new Uint8Array(this.degree);return l.set(a,o),l}return a},$V=t,$V}var UV={},zV={},HV={},j1e;function xRe(){return j1e||(j1e=1,HV.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),HV}var qm={},E1e;function gRe(){if(E1e)return qm;E1e=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const r="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+`)(?:.|[\r
]))+`;qm.KANJI=new RegExp(n,"g"),qm.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),qm.BYTE=new RegExp(r,"g"),qm.NUMERIC=new RegExp(e,"g"),qm.ALPHANUMERIC=new RegExp(t,"g");const s=new RegExp("^"+n+"$"),a=new RegExp("^"+e+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return qm.testKanji=function(c){return s.test(c)},qm.testNumeric=function(c){return a.test(c)},qm.testAlphanumeric=function(c){return o.test(c)},qm}var _1e;function h5(){return _1e||(_1e=1,function(e){const t=xRe(),n=gRe();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(a,o){if(!a.ccBits)throw new Error("Invalid mode: "+a);if(!t.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?a.ccBits[0]:o<27?a.ccBits[1]:a.ccBits[2]},e.getBestModeForData=function(a){return n.testNumeric(a)?e.NUMERIC:n.testAlphanumeric(a)?e.ALPHANUMERIC:n.testKanji(a)?e.KANJI:e.BYTE},e.toString=function(a){if(a&&a.id)return a.id;throw new Error("Invalid mode")},e.isValid=function(a){return a&&a.bit&&a.ccBits};function r(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+s)}}e.from=function(a,o){if(e.isValid(a))return a;try{return r(a)}catch{return o}}}(zV)),zV}var k1e;function YPt(){return k1e||(k1e=1,function(e){const t=f5(),n=mRe(),r=Joe(),s=h5(),a=xRe(),o=7973,l=t.getBCHDigit(o);function c(x,g,v){for(let w=1;w<=40;w++)if(g<=e.getCapacity(w,v,x))return w}function u(x,g){return s.getCharCountIndicator(x,g)+4}function d(x,g){let v=0;return x.forEach(function(w){const C=u(w.mode,g);v+=C+w.getBitsLength()}),v}function f(x,g){for(let v=1;v<=40;v++)if(d(x,v)<=e.getCapacity(v,g,s.MIXED))return v}e.from=function(g,v){return a.isValid(g)?parseInt(g,10):v},e.getCapacity=function(g,v,w){if(!a.isValid(g))throw new Error("Invalid QR Code version");typeof w>"u"&&(w=s.BYTE);const C=t.getSymbolTotalCodewords(g),N=n.getTotalCodewordsCount(g,v),I=(C-N)*8;if(w===s.MIXED)return I;const P=I-u(w,g);switch(w){case s.NUMERIC:return Math.floor(P/10*3);case s.ALPHANUMERIC:return Math.floor(P/11*2);case s.KANJI:return Math.floor(P/13);case s.BYTE:default:return Math.floor(P/8)}},e.getBestVersionForData=function(g,v){let w;const C=r.from(v,r.M);if(Array.isArray(g)){if(g.length>1)return f(g,C);if(g.length===0)return 1;w=g[0]}else w=g;return c(w.mode,w.getLength(),C)},e.getEncodedBits=function(g){if(!a.isValid(g)||g<7)throw new Error("Invalid QR Code version");let v=g<<12;for(;t.getBCHDigit(v)-l>=0;)v^=o<<t.getBCHDigit(v)-l;return g<<12|v}}(UV)),UV}var VV={},T1e;function XPt(){if(T1e)return VV;T1e=1;const e=f5(),t=1335,n=21522,r=e.getBCHDigit(t);return VV.getEncodedBits=function(a,o){const l=a.bit<<3|o;let c=l<<10;for(;e.getBCHDigit(c)-r>=0;)c^=t<<e.getBCHDigit(c)-r;return(l<<10|c)^n},VV}var WV={},qV,I1e;function QPt(){if(I1e)return qV;I1e=1;const e=h5();function t(n){this.mode=e.NUMERIC,this.data=n.toString()}return t.getBitsLength=function(r){return 10*Math.floor(r/3)+(r%3?r%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(r){let s,a,o;for(s=0;s+3<=this.data.length;s+=3)a=this.data.substr(s,3),o=parseInt(a,10),r.put(o,10);const l=this.data.length-s;l>0&&(a=this.data.substr(s),o=parseInt(a,10),r.put(o,l*3+1))},qV=t,qV}var GV,P1e;function ZPt(){if(P1e)return GV;P1e=1;const e=h5(),t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function n(r){this.mode=e.ALPHANUMERIC,this.data=r}return n.getBitsLength=function(s){return 11*Math.floor(s/2)+6*(s%2)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(s){let a;for(a=0;a+2<=this.data.length;a+=2){let o=t.indexOf(this.data[a])*45;o+=t.indexOf(this.data[a+1]),s.put(o,11)}this.data.length%2&&s.put(t.indexOf(this.data[a]),6)},GV=n,GV}var KV,F1e;function JPt(){if(F1e)return KV;F1e=1;const e=h5();function t(n){this.mode=e.BYTE,typeof n=="string"?this.data=new TextEncoder().encode(n):this.data=new Uint8Array(n)}return t.getBitsLength=function(r){return r*8},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(n){for(let r=0,s=this.data.length;r<s;r++)n.put(this.data[r],8)},KV=t,KV}var YV,O1e;function eFt(){if(O1e)return YV;O1e=1;const e=h5(),t=f5();function n(r){this.mode=e.KANJI,this.data=r}return n.getBitsLength=function(s){return s*13},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(r){let s;for(s=0;s<this.data.length;s++){let a=t.toSJIS(this.data[s]);if(a>=33088&&a<=40956)a-=33088;else if(a>=57408&&a<=60351)a-=49472;else throw new Error("Invalid SJIS character: "+this.data[s]+`
Make sure your charset is UTF-8`);a=(a>>>8&255)*192+(a&255),r.put(a,13)}},YV=n,YV}var XV={exports:{}},M1e;function tFt(){return M1e||(M1e=1,function(e){var t={single_source_shortest_paths:function(n,r,s){var a={},o={};o[r]=0;var l=t.PriorityQueue.make();l.push(r,0);for(var c,u,d,f,x,g,v,w,C;!l.empty();){c=l.pop(),u=c.value,f=c.cost,x=n[u]||{};for(d in x)x.hasOwnProperty(d)&&(g=x[d],v=f+g,w=o[d],C=typeof o[d]>"u",(C||w>v)&&(o[d]=v,l.push(d,v),a[d]=u))}if(typeof s<"u"&&typeof o[s]>"u"){var N=["Could not find a path from ",r," to ",s,"."].join("");throw new Error(N)}return a},extract_shortest_path_from_predecessor_list:function(n,r){for(var s=[],a=r;a;)s.push(a),n[a],a=n[a];return s.reverse(),s},find_path:function(n,r,s){var a=t.single_source_shortest_paths(n,r,s);return t.extract_shortest_path_from_predecessor_list(a,s)},PriorityQueue:{make:function(n){var r=t.PriorityQueue,s={},a;n=n||{};for(a in r)r.hasOwnProperty(a)&&(s[a]=r[a]);return s.queue=[],s.sorter=n.sorter||r.default_sorter,s},default_sorter:function(n,r){return n.cost-r.cost},push:function(n,r){var s={value:n,cost:r};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t}(XV)),XV.exports}var R1e;function nFt(){return R1e||(R1e=1,function(e){const t=h5(),n=QPt(),r=ZPt(),s=JPt(),a=eFt(),o=gRe(),l=f5(),c=tFt();function u(N){return unescape(encodeURIComponent(N)).length}function d(N,I,P){const R=[];let F;for(;(F=N.exec(P))!==null;)R.push({data:F[0],index:F.index,mode:I,length:F[0].length});return R}function f(N){const I=d(o.NUMERIC,t.NUMERIC,N),P=d(o.ALPHANUMERIC,t.ALPHANUMERIC,N);let R,F;return l.isKanjiModeEnabled()?(R=d(o.BYTE,t.BYTE,N),F=d(o.KANJI,t.KANJI,N)):(R=d(o.BYTE_KANJI,t.BYTE,N),F=[]),I.concat(P,R,F).sort(function(L,z){return L.index-z.index}).map(function(L){return{data:L.data,mode:L.mode,length:L.length}})}function x(N,I){switch(I){case t.NUMERIC:return n.getBitsLength(N);case t.ALPHANUMERIC:return r.getBitsLength(N);case t.KANJI:return a.getBitsLength(N);case t.BYTE:return s.getBitsLength(N)}}function g(N){return N.reduce(function(I,P){const R=I.length-1>=0?I[I.length-1]:null;return R&&R.mode===P.mode?(I[I.length-1].data+=P.data,I):(I.push(P),I)},[])}function v(N){const I=[];for(let P=0;P<N.length;P++){const R=N[P];switch(R.mode){case t.NUMERIC:I.push([R,{data:R.data,mode:t.ALPHANUMERIC,length:R.length},{data:R.data,mode:t.BYTE,length:R.length}]);break;case t.ALPHANUMERIC:I.push([R,{data:R.data,mode:t.BYTE,length:R.length}]);break;case t.KANJI:I.push([R,{data:R.data,mode:t.BYTE,length:u(R.data)}]);break;case t.BYTE:I.push([{data:R.data,mode:t.BYTE,length:u(R.data)}])}}return I}function w(N,I){const P={},R={start:{}};let F=["start"];for(let U=0;U<N.length;U++){const L=N[U],z=[];for(let X=0;X<L.length;X++){const ne=L[X],J=""+U+X;z.push(J),P[J]={node:ne,lastCount:0},R[J]={};for(let Z=0;Z<F.length;Z++){const re=F[Z];P[re]&&P[re].node.mode===ne.mode?(R[re][J]=x(P[re].lastCount+ne.length,ne.mode)-x(P[re].lastCount,ne.mode),P[re].lastCount+=ne.length):(P[re]&&(P[re].lastCount=ne.length),R[re][J]=x(ne.length,ne.mode)+4+t.getCharCountIndicator(ne.mode,I))}}F=z}for(let U=0;U<F.length;U++)R[F[U]].end=0;return{map:R,table:P}}function C(N,I){let P;const R=t.getBestModeForData(N);if(P=t.from(I,R),P!==t.BYTE&&P.bit<R.bit)throw new Error('"'+N+'" cannot be encoded with mode '+t.toString(P)+`.
 Suggested mode is: `+t.toString(R));switch(P===t.KANJI&&!l.isKanjiModeEnabled()&&(P=t.BYTE),P){case t.NUMERIC:return new n(N);case t.ALPHANUMERIC:return new r(N);case t.KANJI:return new a(N);case t.BYTE:return new s(N)}}e.fromArray=function(I){return I.reduce(function(P,R){return typeof R=="string"?P.push(C(R,null)):R.data&&P.push(C(R.data,R.mode)),P},[])},e.fromString=function(I,P){const R=f(I,l.isKanjiModeEnabled()),F=v(R),U=w(F,P),L=c.find_path(U.map,"start","end"),z=[];for(let X=1;X<L.length-1;X++)z.push(U.table[L[X]].node);return e.fromArray(g(z))},e.rawSplit=function(I){return e.fromArray(f(I,l.isKanjiModeEnabled()))}}(WV)),WV}var L1e;function rFt(){if(L1e)return PV;L1e=1;const e=f5(),t=Joe(),n=UPt(),r=zPt(),s=HPt(),a=VPt(),o=WPt(),l=mRe(),c=KPt(),u=YPt(),d=XPt(),f=h5(),x=nFt();function g(U,L){const z=U.size,X=a.getPositions(L);for(let ne=0;ne<X.length;ne++){const J=X[ne][0],Z=X[ne][1];for(let re=-1;re<=7;re++)if(!(J+re<=-1||z<=J+re))for(let he=-1;he<=7;he++)Z+he<=-1||z<=Z+he||(re>=0&&re<=6&&(he===0||he===6)||he>=0&&he<=6&&(re===0||re===6)||re>=2&&re<=4&&he>=2&&he<=4?U.set(J+re,Z+he,!0,!0):U.set(J+re,Z+he,!1,!0))}}function v(U){const L=U.size;for(let z=8;z<L-8;z++){const X=z%2===0;U.set(z,6,X,!0),U.set(6,z,X,!0)}}function w(U,L){const z=s.getPositions(L);for(let X=0;X<z.length;X++){const ne=z[X][0],J=z[X][1];for(let Z=-2;Z<=2;Z++)for(let re=-2;re<=2;re++)Z===-2||Z===2||re===-2||re===2||Z===0&&re===0?U.set(ne+Z,J+re,!0,!0):U.set(ne+Z,J+re,!1,!0)}}function C(U,L){const z=U.size,X=u.getEncodedBits(L);let ne,J,Z;for(let re=0;re<18;re++)ne=Math.floor(re/3),J=re%3+z-8-3,Z=(X>>re&1)===1,U.set(ne,J,Z,!0),U.set(J,ne,Z,!0)}function N(U,L,z){const X=U.size,ne=d.getEncodedBits(L,z);let J,Z;for(J=0;J<15;J++)Z=(ne>>J&1)===1,J<6?U.set(J,8,Z,!0):J<8?U.set(J+1,8,Z,!0):U.set(X-15+J,8,Z,!0),J<8?U.set(8,X-J-1,Z,!0):J<9?U.set(8,15-J-1+1,Z,!0):U.set(8,15-J-1,Z,!0);U.set(X-8,8,1,!0)}function I(U,L){const z=U.size;let X=-1,ne=z-1,J=7,Z=0;for(let re=z-1;re>0;re-=2)for(re===6&&re--;;){for(let he=0;he<2;he++)if(!U.isReserved(ne,re-he)){let Y=!1;Z<L.length&&(Y=(L[Z]>>>J&1)===1),U.set(ne,re-he,Y),J--,J===-1&&(Z++,J=7)}if(ne+=X,ne<0||z<=ne){ne-=X,X=-X;break}}}function P(U,L,z){const X=new n;z.forEach(function(he){X.put(he.mode.bit,4),X.put(he.getLength(),f.getCharCountIndicator(he.mode,U)),he.write(X)});const ne=e.getSymbolTotalCodewords(U),J=l.getTotalCodewordsCount(U,L),Z=(ne-J)*8;for(X.getLengthInBits()+4<=Z&&X.put(0,4);X.getLengthInBits()%8!==0;)X.putBit(0);const re=(Z-X.getLengthInBits())/8;for(let he=0;he<re;he++)X.put(he%2?17:236,8);return R(X,U,L)}function R(U,L,z){const X=e.getSymbolTotalCodewords(L),ne=l.getTotalCodewordsCount(L,z),J=X-ne,Z=l.getBlocksCount(L,z),re=X%Z,he=Z-re,Y=Math.floor(X/Z),ie=Math.floor(J/Z),oe=ie+1,G=Y-ie,V=new c(G);let ee=0;const ae=new Array(Z),fe=new Array(Z);let Ae=0;const ce=new Uint8Array(U.buffer);for(let Ie=0;Ie<Z;Ie++){const Re=Ie<he?ie:oe;ae[Ie]=ce.slice(ee,ee+Re),fe[Ie]=V.encode(ae[Ie]),ee+=Re,Ae=Math.max(Ae,Re)}const ye=new Uint8Array(X);let Ne=0,be,je;for(be=0;be<Ae;be++)for(je=0;je<Z;je++)be<ae[je].length&&(ye[Ne++]=ae[je][be]);for(be=0;be<G;be++)for(je=0;je<Z;je++)ye[Ne++]=fe[je][be];return ye}function F(U,L,z,X){let ne;if(Array.isArray(U))ne=x.fromArray(U);else if(typeof U=="string"){let Y=L;if(!Y){const ie=x.rawSplit(U);Y=u.getBestVersionForData(ie,z)}ne=x.fromString(U,Y||40)}else throw new Error("Invalid data");const J=u.getBestVersionForData(ne,z);if(!J)throw new Error("The amount of data is too big to be stored in a QR Code");if(!L)L=J;else if(L<J)throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+J+`.
`);const Z=P(L,z,ne),re=e.getSymbolSize(L),he=new r(re);return g(he,L),v(he),w(he,L),N(he,z,0),L>=7&&C(he,L),I(he,Z),isNaN(X)&&(X=o.getBestMask(he,N.bind(null,he,z))),o.applyMask(X,he),N(he,z,X),{modules:he,version:L,errorCorrectionLevel:z,maskPattern:X,segments:ne}}return PV.create=function(L,z){if(typeof L>"u"||L==="")throw new Error("No input text");let X=t.M,ne,J;return typeof z<"u"&&(X=t.from(z.errorCorrectionLevel,t.M),ne=u.from(z.version),J=o.from(z.maskPattern),z.toSJISFunc&&e.setToSJISFunction(z.toSJISFunc)),F(L,ne,X,J)},PV}var QV={},ZV={},D1e;function bRe(){return D1e||(D1e=1,function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let r=n.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+n);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(a){return[a,a]}))),r.length===6&&r.push("F","F");const s=parseInt(r.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+r.slice(0,6).join("")}}e.getOptions=function(r){r||(r={}),r.color||(r.color={});const s=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,a=r.width&&r.width>=21?r.width:void 0,o=r.scale||4;return{width:a,scale:a?4:o,margin:s,color:{dark:t(r.color.dark||"#000000ff"),light:t(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},e.getScale=function(r,s){return s.width&&s.width>=r+s.margin*2?s.width/(r+s.margin*2):s.scale},e.getImageWidth=function(r,s){const a=e.getScale(r,s);return Math.floor((r+s.margin*2)*a)},e.qrToImageData=function(r,s,a){const o=s.modules.size,l=s.modules.data,c=e.getScale(o,a),u=Math.floor((o+a.margin*2)*c),d=a.margin*c,f=[a.color.light,a.color.dark];for(let x=0;x<u;x++)for(let g=0;g<u;g++){let v=(x*u+g)*4,w=a.color.light;if(x>=d&&g>=d&&x<u-d&&g<u-d){const C=Math.floor((x-d)/c),N=Math.floor((g-d)/c);w=f[l[C*o+N]?1:0]}r[v++]=w.r,r[v++]=w.g,r[v++]=w.b,r[v]=w.a}}}(ZV)),ZV}var B1e;function sFt(){return B1e||(B1e=1,function(e){const t=bRe();function n(s,a,o){s.clearRect(0,0,a.width,a.height),a.style||(a.style={}),a.height=o,a.width=o,a.style.height=o+"px",a.style.width=o+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(a,o,l){let c=l,u=o;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),o||(u=r()),c=t.getOptions(c);const d=t.getImageWidth(a.modules.size,c),f=u.getContext("2d"),x=f.createImageData(d,d);return t.qrToImageData(x.data,a,c),n(f,u,d),f.putImageData(x,0,0),u},e.renderToDataURL=function(a,o,l){let c=l;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),c||(c={});const u=e.render(a,o,c),d=c.type||"image/png",f=c.rendererOpts||{};return u.toDataURL(d,f.quality)}}(QV)),QV}var JV={},$1e;function iFt(){if($1e)return JV;$1e=1;const e=bRe();function t(s,a){const o=s.a/255,l=a+'="'+s.hex+'"';return o<1?l+" "+a+'-opacity="'+o.toFixed(2).slice(1)+'"':l}function n(s,a,o){let l=s+a;return typeof o<"u"&&(l+=" "+o),l}function r(s,a,o){let l="",c=0,u=!1,d=0;for(let f=0;f<s.length;f++){const x=Math.floor(f%a),g=Math.floor(f/a);!x&&!u&&(u=!0),s[f]?(d++,f>0&&x>0&&s[f-1]||(l+=u?n("M",x+o,.5+g+o):n("m",c,0),c=0,u=!1),x+1<a&&s[f+1]||(l+=n("h",d),d=0)):c++}return l}return JV.render=function(a,o,l){const c=e.getOptions(o),u=a.modules.size,d=a.modules.data,f=u+c.margin*2,x=c.color.light.a?"<path "+t(c.color.light,"fill")+' d="M0 0h'+f+"v"+f+'H0z"/>':"",g="<path "+t(c.color.dark,"stroke")+' d="'+r(d,u,c.margin)+'"/>',v='viewBox="0 0 '+f+" "+f+'"',C='<svg xmlns="http://www.w3.org/2000/svg" '+(c.width?'width="'+c.width+'" height="'+c.width+'" ':"")+v+' shape-rendering="crispEdges">'+x+g+`</svg>
`;return typeof l=="function"&&l(null,C),C},JV}var U1e;function aFt(){if(U1e)return G6;U1e=1;const e=$Pt(),t=rFt(),n=sFt(),r=iFt();function s(a,o,l,c,u){const d=[].slice.call(arguments,1),f=d.length,x=typeof d[f-1]=="function";if(!x&&!e())throw new Error("Callback required as last argument");if(x){if(f<2)throw new Error("Too few arguments provided");f===2?(u=l,l=o,o=c=void 0):f===3&&(o.getContext&&typeof u>"u"?(u=c,c=void 0):(u=c,c=l,l=o,o=void 0))}else{if(f<1)throw new Error("Too few arguments provided");return f===1?(l=o,o=c=void 0):f===2&&!o.getContext&&(c=l,l=o,o=void 0),new Promise(function(g,v){try{const w=t.create(l,c);g(a(w,o,c))}catch(w){v(w)}})}try{const g=t.create(l,c);u(null,a(g,o,c))}catch(g){u(g)}}return G6.create=t.create,G6.toCanvas=s.bind(null,n.render),G6.toDataURL=s.bind(null,n.renderToDataURL),G6.toString=s.bind(null,function(a,o,l){return r.render(a,l)}),G6}var oFt=aFt();const lFt=ji(oFt);N$.type="coinbaseWallet";function N$(e={}){return e.version==="3"||e.headlessMode?uFt(e):cFt(e)}function cFt(e){let t,n,r,s;return a=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:N$.type,async connect({chainId:o,...l}={}){try{const c=await this.getProvider(),u=(await c.request({method:"eth_requestAccounts",params:"instantOnboarding"in l&&l.instantOnboarding?[{onboarding:"instant"}]:[]})).map(f=>wc(f));n||(n=this.onAccountsChanged.bind(this),c.on("accountsChanged",n)),r||(r=this.onChainChanged.bind(this),c.on("chainChanged",r)),s||(s=this.onDisconnect.bind(this),c.on("disconnect",s));let d=await this.getChainId();if(o&&d!==o){const f=await this.switchChain({chainId:o}).catch(x=>{if(x.code===mo.code)throw x;return{id:d}});d=(f==null?void 0:f.id)??d}return{accounts:u,chainId:d}}catch(c){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(c.message)?new mo(c):c}},async disconnect(){var l;const o=await this.getProvider();n&&(o.removeListener("accountsChanged",n),n=void 0),r&&(o.removeListener("chainChanged",r),r=void 0),s&&(o.removeListener("disconnect",s),s=void 0),o.disconnect(),(l=o.close)==null||l.call(o)},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(l=>wc(l))},async getChainId(){const l=await(await this.getProvider()).request({method:"eth_chainId"});return Number(l)},async getProvider(){if(!t){const o=(()=>{var u;return typeof e.preference=="string"?{options:e.preference}:{...e.preference,options:((u=e.preference)==null?void 0:u.options)??"all"}})(),{createCoinbaseWalletSDK:l}=await Jr(async()=>{const{createCoinbaseWalletSDK:u}=await import("./index-D5_qkcvx.js");return{createCoinbaseWalletSDK:u}},__vite__mapDeps([0,1,2,3]));t=l({...e,appChainIds:a.chains.map(u=>u.id),preference:o}).getProvider()}return t},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:o,chainId:l}){var d,f,x,g;const c=a.chains.find(v=>v.id===l);if(!c)throw new Zh(new v3);const u=await this.getProvider();try{return await u.request({method:"wallet_switchEthereumChain",params:[{chainId:Os(c.id)}]}),c}catch(v){if(v.code===4902)try{let w;o!=null&&o.blockExplorerUrls?w=o.blockExplorerUrls:w=(d=c.blockExplorers)!=null&&d.default.url?[(f=c.blockExplorers)==null?void 0:f.default.url]:[];let C;(x=o==null?void 0:o.rpcUrls)!=null&&x.length?C=o.rpcUrls:C=[((g=c.rpcUrls.default)==null?void 0:g.http[0])??""];const N={blockExplorerUrls:w,chainId:Os(l),chainName:(o==null?void 0:o.chainName)??c.name,iconUrls:o==null?void 0:o.iconUrls,nativeCurrency:(o==null?void 0:o.nativeCurrency)??c.nativeCurrency,rpcUrls:C};return await u.request({method:"wallet_addEthereumChain",params:[N]}),c}catch(w){throw new mo(w)}throw new Zh(v)}},onAccountsChanged(o){o.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:o.map(l=>wc(l))})},onChainChanged(o){const l=Number(o);a.emitter.emit("change",{chainId:l})},async onDisconnect(o){a.emitter.emit("disconnect");const l=await this.getProvider();n&&(l.removeListener("accountsChanged",n),n=void 0),r&&(l.removeListener("chainChanged",r),r=void 0),s&&(l.removeListener("disconnect",s),s=void 0)}})}function uFt(e){let n,r,s,a,o;return l=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",type:N$.type,async connect({chainId:c}={}){try{const u=await this.getProvider(),d=(await u.request({method:"eth_requestAccounts"})).map(x=>wc(x));s||(s=this.onAccountsChanged.bind(this),u.on("accountsChanged",s)),a||(a=this.onChainChanged.bind(this),u.on("chainChanged",a)),o||(o=this.onDisconnect.bind(this),u.on("disconnect",o));let f=await this.getChainId();if(c&&f!==c){const x=await this.switchChain({chainId:c}).catch(g=>{if(g.code===mo.code)throw g;return{id:f}});f=(x==null?void 0:x.id)??f}return{accounts:d,chainId:f}}catch(u){throw/(user closed modal|accounts received is empty|user denied account)/i.test(u.message)?new mo(u):u}},async disconnect(){const c=await this.getProvider();s&&(c.removeListener("accountsChanged",s),s=void 0),a&&(c.removeListener("chainChanged",a),a=void 0),o&&(c.removeListener("disconnect",o),o=void 0),c.disconnect(),c.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(u=>wc(u))},async getChainId(){const u=await(await this.getProvider()).request({method:"eth_chainId"});return Number(u)},async getProvider(){var c;if(!r){const u=await(async()=>{const{default:v}=await Jr(async()=>{const{default:w}=await import("./index-Clsy6Hc8.js").then(C=>C.i);return{default:w}},__vite__mapDeps([4,3,5]));return typeof v!="function"&&typeof v.default=="function"?v.default:v})();n=new u({...e,reloadOnDisconnect:!1});const d=(c=n.walletExtension)==null?void 0:c.getChainId(),f=l.chains.find(v=>e.chainId?v.id===e.chainId:v.id===d)||l.chains[0],x=e.chainId||(f==null?void 0:f.id),g=e.jsonRpcUrl||(f==null?void 0:f.rpcUrls.default.http[0]);r=n.makeWeb3Provider(g,x)}return r},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:c,chainId:u}){var x,g,v,w;const d=l.chains.find(C=>C.id===u);if(!d)throw new Zh(new v3);const f=await this.getProvider();try{return await f.request({method:"wallet_switchEthereumChain",params:[{chainId:Os(d.id)}]}),d}catch(C){if(C.code===4902)try{let N;c!=null&&c.blockExplorerUrls?N=c.blockExplorerUrls:N=(x=d.blockExplorers)!=null&&x.default.url?[(g=d.blockExplorers)==null?void 0:g.default.url]:[];let I;(v=c==null?void 0:c.rpcUrls)!=null&&v.length?I=c.rpcUrls:I=[((w=d.rpcUrls.default)==null?void 0:w.http[0])??""];const P={blockExplorerUrls:N,chainId:Os(u),chainName:(c==null?void 0:c.chainName)??d.name,iconUrls:c==null?void 0:c.iconUrls,nativeCurrency:(c==null?void 0:c.nativeCurrency)??d.nativeCurrency,rpcUrls:I};return await f.request({method:"wallet_addEthereumChain",params:[P]}),d}catch(N){throw new mo(N)}throw new Zh(C)}},onAccountsChanged(c){c.length===0?this.onDisconnect():l.emitter.emit("change",{accounts:c.map(u=>wc(u))})},onChainChanged(c){const u=Number(c);l.emitter.emit("change",{chainId:u})},async onDisconnect(c){l.emitter.emit("disconnect");const u=await this.getProvider();s&&(u.removeListener("accountsChanged",s),s=void 0),a&&(u.removeListener("chainChanged",a),a=void 0),o&&(u.removeListener("disconnect",o),o=void 0)}})}ele.type="safe";function ele(e={}){const{shimDisconnect:t=!1}=e;let n,r;return s=>({id:"safe",name:"Safe",type:ele.type,async connect(){var c;const a=await this.getProvider();if(!a)throw new Dh;const o=await this.getAccounts(),l=await this.getChainId();return r||(r=this.onDisconnect.bind(this),a.on("disconnect",r)),t&&await((c=s.storage)==null?void 0:c.removeItem("safe.disconnected")),{accounts:o,chainId:l}},async disconnect(){var o;const a=await this.getProvider();if(!a)throw new Dh;r&&(a.removeListener("disconnect",r),r=void 0),t&&await((o=s.storage)==null?void 0:o.setItem("safe.disconnected",!0))},async getAccounts(){const a=await this.getProvider();if(!a)throw new Dh;return(await a.request({method:"eth_accounts"})).map(wc)},async getProvider(){if(typeof window<"u"&&(window==null?void 0:window.parent)!==window){if(!n){const{default:o}=await Jr(async()=>{const{default:d}=await import("./index-B8lqC164.js");return{default:d}},__vite__mapDeps([6,7,2])),l=new o(e),c=await Tie(()=>l.safe.getInfo(),{timeout:e.unstable_getInfoTimeout??10});if(!c)throw new Error("Could not load Safe information");const u=await(async()=>{const d=await Jr(()=>import("./index-T8pJAHMX.js").then(f=>f.i),__vite__mapDeps([8,7,1,5]));return typeof d.SafeAppProvider!="function"&&typeof d.default.SafeAppProvider=="function"?d.default.SafeAppProvider:d.SafeAppProvider})();n=new u(c,l)}return n}},async getChainId(){const a=await this.getProvider();if(!a)throw new Dh;return Number(a.chainId)},async isAuthorized(){var a;try{return t&&await((a=s.storage)==null?void 0:a.getItem("safe.disconnected"))?!1:!!(await this.getAccounts()).length}catch{return!1}},onAccountsChanged(){},onChainChanged(){},onDisconnect(){s.emitter.emit("disconnect")}})}tle.type="walletConnect";function tle(e){const t=e.isNewChainsStale??!0;let n,r;const s="eip155";let a,o,l,c,u,d;return f=>({id:"walletConnect",name:"WalletConnect",type:tle.type,async setup(){const x=await this.getProvider().catch(()=>null);x&&(l||(l=this.onConnect.bind(this),x.on("connect",l)),u||(u=this.onSessionDelete.bind(this),x.on("session_delete",u)))},async connect({chainId:x,...g}={}){var v,w;try{const C=await this.getProvider();if(!C)throw new Dh;c||(c=this.onDisplayUri,C.on("display_uri",c));let N=x;if(!N){const F=await((v=f.storage)==null?void 0:v.getItem("state"))??{};f.chains.some(L=>L.id===F.chainId)?N=F.chainId:N=(w=f.chains[0])==null?void 0:w.id}if(!N)throw new Error("No chains found on connector.");const I=await this.isChainsStale();if(C.session&&I&&await C.disconnect(),!C.session||I){const F=f.chains.filter(U=>U.id!==N).map(U=>U.id);await C.connect({optionalChains:[N,...F],..."pairingTopic"in g?{pairingTopic:g.pairingTopic}:{}}),this.setRequestedChainsIds(f.chains.map(U=>U.id))}const P=(await C.enable()).map(F=>wc(F)),R=await this.getChainId();return c&&(C.removeListener("display_uri",c),c=void 0),l&&(C.removeListener("connect",l),l=void 0),a||(a=this.onAccountsChanged.bind(this),C.on("accountsChanged",a)),o||(o=this.onChainChanged.bind(this),C.on("chainChanged",o)),d||(d=this.onDisconnect.bind(this),C.on("disconnect",d)),u||(u=this.onSessionDelete.bind(this),C.on("session_delete",u)),{accounts:P,chainId:R}}catch(C){throw/(user rejected|connection request reset)/i.test(C==null?void 0:C.message)?new mo(C):C}},async disconnect(){const x=await this.getProvider();try{await(x==null?void 0:x.disconnect())}catch(g){if(!/No matching key/i.test(g.message))throw g}finally{o&&(x==null||x.removeListener("chainChanged",o),o=void 0),d&&(x==null||x.removeListener("disconnect",d),d=void 0),l||(l=this.onConnect.bind(this),x==null||x.on("connect",l)),a&&(x==null||x.removeListener("accountsChanged",a),a=void 0),u&&(x==null||x.removeListener("session_delete",u),u=void 0),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(g=>wc(g))},async getProvider({chainId:x}={}){var v;async function g(){const w=f.chains.map(N=>N.id);if(!w.length)return;const{EthereumProvider:C}=await Jr(async()=>{const{EthereumProvider:N}=await import("./index.es-B-kD0bVs.js");return{EthereumProvider:N}},__vite__mapDeps([9,5]));return await C.init({...e,disableProviderPing:!0,optionalChains:w,projectId:e.projectId,rpcMap:Object.fromEntries(f.chains.map(N=>{const[I]=W0t({chain:N,transports:f.transports});return[N.id,I]})),showQrModal:e.showQrModal??!0})}return n||(r||(r=g()),n=await r,n==null||n.events.setMaxListeners(Number.POSITIVE_INFINITY)),x&&await((v=this.switchChain)==null?void 0:v.call(this,{chainId:x})),n},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[x,g]=await Promise.all([this.getAccounts(),this.getProvider()]);return x.length?await this.isChainsStale()&&g.session?(await g.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:x,chainId:g}){var C,N,I;const v=await this.getProvider();if(!v)throw new Dh;const w=f.chains.find(P=>P.id===g);if(!w)throw new Zh(new v3);try{await Promise.all([new Promise(R=>{const F=({chainId:U})=>{U===g&&(f.emitter.off("change",F),R())};f.emitter.on("change",F)}),v.request({method:"wallet_switchEthereumChain",params:[{chainId:Os(g)}]})]);const P=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...P,g]),w}catch(P){const R=P;if(/(user rejected)/i.test(R.message))throw new mo(R);try{let F;x!=null&&x.blockExplorerUrls?F=x.blockExplorerUrls:F=(C=w.blockExplorers)!=null&&C.default.url?[(N=w.blockExplorers)==null?void 0:N.default.url]:[];let U;(I=x==null?void 0:x.rpcUrls)!=null&&I.length?U=x.rpcUrls:U=[...w.rpcUrls.default.http];const L={blockExplorerUrls:F,chainId:Os(g),chainName:(x==null?void 0:x.chainName)??w.name,iconUrls:x==null?void 0:x.iconUrls,nativeCurrency:(x==null?void 0:x.nativeCurrency)??w.nativeCurrency,rpcUrls:U};await v.request({method:"wallet_addEthereumChain",params:[L]});const z=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...z,g]),w}catch(F){throw new mo(F)}}},onAccountsChanged(x){x.length===0?this.onDisconnect():f.emitter.emit("change",{accounts:x.map(g=>wc(g))})},onChainChanged(x){const g=Number(x);f.emitter.emit("change",{chainId:g})},async onConnect(x){const g=Number(x.chainId),v=await this.getAccounts();f.emitter.emit("connect",{accounts:v,chainId:g})},async onDisconnect(x){this.setRequestedChainsIds([]),f.emitter.emit("disconnect");const g=await this.getProvider();a&&(g.removeListener("accountsChanged",a),a=void 0),o&&(g.removeListener("chainChanged",o),o=void 0),d&&(g.removeListener("disconnect",d),d=void 0),u&&(g.removeListener("session_delete",u),u=void 0),l||(l=this.onConnect.bind(this),g.on("connect",l))},onDisplayUri(x){f.emitter.emit("message",{type:"display_uri",data:x})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var g,v,w;return n?((w=(v=(g=n.session)==null?void 0:g.namespaces[s])==null?void 0:v.accounts)==null?void 0:w.map(C=>Number.parseInt(C.split(":")[1]||"")))??[]:[]},async getRequestedChainsIds(){var x;return await((x=f.storage)==null?void 0:x.getItem(this.requestedChainsStorageKey))??[]},async isChainsStale(){if(!t)return!1;const x=f.chains.map(w=>w.id),g=this.getNamespaceChainsIds();if(g.length&&!g.some(w=>x.includes(w)))return!1;const v=await this.getRequestedChainsIds();return!x.every(w=>v.includes(w))},async setRequestedChainsIds(x){var g;await((g=f.storage)==null?void 0:g.setItem(this.requestedChainsStorageKey,x))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}var OR={},dFt=768;nIt({conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0}});var fFt=uMe({conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0}}),Zee=lIt({conditions:{defaultCondition:"base",conditionNames:["base","hover","active"],responsiveArray:void 0},styles:{background:{values:{accentColor:{conditions:{base:"ju367v9i",hover:"ju367v9j",active:"ju367v9k"},defaultClass:"ju367v9i"},accentColorForeground:{conditions:{base:"ju367v9l",hover:"ju367v9m",active:"ju367v9n"},defaultClass:"ju367v9l"},actionButtonBorder:{conditions:{base:"ju367v9o",hover:"ju367v9p",active:"ju367v9q"},defaultClass:"ju367v9o"},actionButtonBorderMobile:{conditions:{base:"ju367v9r",hover:"ju367v9s",active:"ju367v9t"},defaultClass:"ju367v9r"},actionButtonSecondaryBackground:{conditions:{base:"ju367v9u",hover:"ju367v9v",active:"ju367v9w"},defaultClass:"ju367v9u"},closeButton:{conditions:{base:"ju367v9x",hover:"ju367v9y",active:"ju367v9z"},defaultClass:"ju367v9x"},closeButtonBackground:{conditions:{base:"ju367va0",hover:"ju367va1",active:"ju367va2"},defaultClass:"ju367va0"},connectButtonBackground:{conditions:{base:"ju367va3",hover:"ju367va4",active:"ju367va5"},defaultClass:"ju367va3"},connectButtonBackgroundError:{conditions:{base:"ju367va6",hover:"ju367va7",active:"ju367va8"},defaultClass:"ju367va6"},connectButtonInnerBackground:{conditions:{base:"ju367va9",hover:"ju367vaa",active:"ju367vab"},defaultClass:"ju367va9"},connectButtonText:{conditions:{base:"ju367vac",hover:"ju367vad",active:"ju367vae"},defaultClass:"ju367vac"},connectButtonTextError:{conditions:{base:"ju367vaf",hover:"ju367vag",active:"ju367vah"},defaultClass:"ju367vaf"},connectionIndicator:{conditions:{base:"ju367vai",hover:"ju367vaj",active:"ju367vak"},defaultClass:"ju367vai"},downloadBottomCardBackground:{conditions:{base:"ju367val",hover:"ju367vam",active:"ju367van"},defaultClass:"ju367val"},downloadTopCardBackground:{conditions:{base:"ju367vao",hover:"ju367vap",active:"ju367vaq"},defaultClass:"ju367vao"},error:{conditions:{base:"ju367var",hover:"ju367vas",active:"ju367vat"},defaultClass:"ju367var"},generalBorder:{conditions:{base:"ju367vau",hover:"ju367vav",active:"ju367vaw"},defaultClass:"ju367vau"},generalBorderDim:{conditions:{base:"ju367vax",hover:"ju367vay",active:"ju367vaz"},defaultClass:"ju367vax"},menuItemBackground:{conditions:{base:"ju367vb0",hover:"ju367vb1",active:"ju367vb2"},defaultClass:"ju367vb0"},modalBackdrop:{conditions:{base:"ju367vb3",hover:"ju367vb4",active:"ju367vb5"},defaultClass:"ju367vb3"},modalBackground:{conditions:{base:"ju367vb6",hover:"ju367vb7",active:"ju367vb8"},defaultClass:"ju367vb6"},modalBorder:{conditions:{base:"ju367vb9",hover:"ju367vba",active:"ju367vbb"},defaultClass:"ju367vb9"},modalText:{conditions:{base:"ju367vbc",hover:"ju367vbd",active:"ju367vbe"},defaultClass:"ju367vbc"},modalTextDim:{conditions:{base:"ju367vbf",hover:"ju367vbg",active:"ju367vbh"},defaultClass:"ju367vbf"},modalTextSecondary:{conditions:{base:"ju367vbi",hover:"ju367vbj",active:"ju367vbk"},defaultClass:"ju367vbi"},profileAction:{conditions:{base:"ju367vbl",hover:"ju367vbm",active:"ju367vbn"},defaultClass:"ju367vbl"},profileActionHover:{conditions:{base:"ju367vbo",hover:"ju367vbp",active:"ju367vbq"},defaultClass:"ju367vbo"},profileForeground:{conditions:{base:"ju367vbr",hover:"ju367vbs",active:"ju367vbt"},defaultClass:"ju367vbr"},selectedOptionBorder:{conditions:{base:"ju367vbu",hover:"ju367vbv",active:"ju367vbw"},defaultClass:"ju367vbu"},standby:{conditions:{base:"ju367vbx",hover:"ju367vby",active:"ju367vbz"},defaultClass:"ju367vbx"}}},borderColor:{values:{accentColor:{conditions:{base:"ju367vc0",hover:"ju367vc1",active:"ju367vc2"},defaultClass:"ju367vc0"},accentColorForeground:{conditions:{base:"ju367vc3",hover:"ju367vc4",active:"ju367vc5"},defaultClass:"ju367vc3"},actionButtonBorder:{conditions:{base:"ju367vc6",hover:"ju367vc7",active:"ju367vc8"},defaultClass:"ju367vc6"},actionButtonBorderMobile:{conditions:{base:"ju367vc9",hover:"ju367vca",active:"ju367vcb"},defaultClass:"ju367vc9"},actionButtonSecondaryBackground:{conditions:{base:"ju367vcc",hover:"ju367vcd",active:"ju367vce"},defaultClass:"ju367vcc"},closeButton:{conditions:{base:"ju367vcf",hover:"ju367vcg",active:"ju367vch"},defaultClass:"ju367vcf"},closeButtonBackground:{conditions:{base:"ju367vci",hover:"ju367vcj",active:"ju367vck"},defaultClass:"ju367vci"},connectButtonBackground:{conditions:{base:"ju367vcl",hover:"ju367vcm",active:"ju367vcn"},defaultClass:"ju367vcl"},connectButtonBackgroundError:{conditions:{base:"ju367vco",hover:"ju367vcp",active:"ju367vcq"},defaultClass:"ju367vco"},connectButtonInnerBackground:{conditions:{base:"ju367vcr",hover:"ju367vcs",active:"ju367vct"},defaultClass:"ju367vcr"},connectButtonText:{conditions:{base:"ju367vcu",hover:"ju367vcv",active:"ju367vcw"},defaultClass:"ju367vcu"},connectButtonTextError:{conditions:{base:"ju367vcx",hover:"ju367vcy",active:"ju367vcz"},defaultClass:"ju367vcx"},connectionIndicator:{conditions:{base:"ju367vd0",hover:"ju367vd1",active:"ju367vd2"},defaultClass:"ju367vd0"},downloadBottomCardBackground:{conditions:{base:"ju367vd3",hover:"ju367vd4",active:"ju367vd5"},defaultClass:"ju367vd3"},downloadTopCardBackground:{conditions:{base:"ju367vd6",hover:"ju367vd7",active:"ju367vd8"},defaultClass:"ju367vd6"},error:{conditions:{base:"ju367vd9",hover:"ju367vda",active:"ju367vdb"},defaultClass:"ju367vd9"},generalBorder:{conditions:{base:"ju367vdc",hover:"ju367vdd",active:"ju367vde"},defaultClass:"ju367vdc"},generalBorderDim:{conditions:{base:"ju367vdf",hover:"ju367vdg",active:"ju367vdh"},defaultClass:"ju367vdf"},menuItemBackground:{conditions:{base:"ju367vdi",hover:"ju367vdj",active:"ju367vdk"},defaultClass:"ju367vdi"},modalBackdrop:{conditions:{base:"ju367vdl",hover:"ju367vdm",active:"ju367vdn"},defaultClass:"ju367vdl"},modalBackground:{conditions:{base:"ju367vdo",hover:"ju367vdp",active:"ju367vdq"},defaultClass:"ju367vdo"},modalBorder:{conditions:{base:"ju367vdr",hover:"ju367vds",active:"ju367vdt"},defaultClass:"ju367vdr"},modalText:{conditions:{base:"ju367vdu",hover:"ju367vdv",active:"ju367vdw"},defaultClass:"ju367vdu"},modalTextDim:{conditions:{base:"ju367vdx",hover:"ju367vdy",active:"ju367vdz"},defaultClass:"ju367vdx"},modalTextSecondary:{conditions:{base:"ju367ve0",hover:"ju367ve1",active:"ju367ve2"},defaultClass:"ju367ve0"},profileAction:{conditions:{base:"ju367ve3",hover:"ju367ve4",active:"ju367ve5"},defaultClass:"ju367ve3"},profileActionHover:{conditions:{base:"ju367ve6",hover:"ju367ve7",active:"ju367ve8"},defaultClass:"ju367ve6"},profileForeground:{conditions:{base:"ju367ve9",hover:"ju367vea",active:"ju367veb"},defaultClass:"ju367ve9"},selectedOptionBorder:{conditions:{base:"ju367vec",hover:"ju367ved",active:"ju367vee"},defaultClass:"ju367vec"},standby:{conditions:{base:"ju367vef",hover:"ju367veg",active:"ju367veh"},defaultClass:"ju367vef"}}},boxShadow:{values:{connectButton:{conditions:{base:"ju367vei",hover:"ju367vej",active:"ju367vek"},defaultClass:"ju367vei"},dialog:{conditions:{base:"ju367vel",hover:"ju367vem",active:"ju367ven"},defaultClass:"ju367vel"},profileDetailsAction:{conditions:{base:"ju367veo",hover:"ju367vep",active:"ju367veq"},defaultClass:"ju367veo"},selectedOption:{conditions:{base:"ju367ver",hover:"ju367ves",active:"ju367vet"},defaultClass:"ju367ver"},selectedWallet:{conditions:{base:"ju367veu",hover:"ju367vev",active:"ju367vew"},defaultClass:"ju367veu"},walletLogo:{conditions:{base:"ju367vex",hover:"ju367vey",active:"ju367vez"},defaultClass:"ju367vex"}}},color:{values:{accentColor:{conditions:{base:"ju367vf0",hover:"ju367vf1",active:"ju367vf2"},defaultClass:"ju367vf0"},accentColorForeground:{conditions:{base:"ju367vf3",hover:"ju367vf4",active:"ju367vf5"},defaultClass:"ju367vf3"},actionButtonBorder:{conditions:{base:"ju367vf6",hover:"ju367vf7",active:"ju367vf8"},defaultClass:"ju367vf6"},actionButtonBorderMobile:{conditions:{base:"ju367vf9",hover:"ju367vfa",active:"ju367vfb"},defaultClass:"ju367vf9"},actionButtonSecondaryBackground:{conditions:{base:"ju367vfc",hover:"ju367vfd",active:"ju367vfe"},defaultClass:"ju367vfc"},closeButton:{conditions:{base:"ju367vff",hover:"ju367vfg",active:"ju367vfh"},defaultClass:"ju367vff"},closeButtonBackground:{conditions:{base:"ju367vfi",hover:"ju367vfj",active:"ju367vfk"},defaultClass:"ju367vfi"},connectButtonBackground:{conditions:{base:"ju367vfl",hover:"ju367vfm",active:"ju367vfn"},defaultClass:"ju367vfl"},connectButtonBackgroundError:{conditions:{base:"ju367vfo",hover:"ju367vfp",active:"ju367vfq"},defaultClass:"ju367vfo"},connectButtonInnerBackground:{conditions:{base:"ju367vfr",hover:"ju367vfs",active:"ju367vft"},defaultClass:"ju367vfr"},connectButtonText:{conditions:{base:"ju367vfu",hover:"ju367vfv",active:"ju367vfw"},defaultClass:"ju367vfu"},connectButtonTextError:{conditions:{base:"ju367vfx",hover:"ju367vfy",active:"ju367vfz"},defaultClass:"ju367vfx"},connectionIndicator:{conditions:{base:"ju367vg0",hover:"ju367vg1",active:"ju367vg2"},defaultClass:"ju367vg0"},downloadBottomCardBackground:{conditions:{base:"ju367vg3",hover:"ju367vg4",active:"ju367vg5"},defaultClass:"ju367vg3"},downloadTopCardBackground:{conditions:{base:"ju367vg6",hover:"ju367vg7",active:"ju367vg8"},defaultClass:"ju367vg6"},error:{conditions:{base:"ju367vg9",hover:"ju367vga",active:"ju367vgb"},defaultClass:"ju367vg9"},generalBorder:{conditions:{base:"ju367vgc",hover:"ju367vgd",active:"ju367vge"},defaultClass:"ju367vgc"},generalBorderDim:{conditions:{base:"ju367vgf",hover:"ju367vgg",active:"ju367vgh"},defaultClass:"ju367vgf"},menuItemBackground:{conditions:{base:"ju367vgi",hover:"ju367vgj",active:"ju367vgk"},defaultClass:"ju367vgi"},modalBackdrop:{conditions:{base:"ju367vgl",hover:"ju367vgm",active:"ju367vgn"},defaultClass:"ju367vgl"},modalBackground:{conditions:{base:"ju367vgo",hover:"ju367vgp",active:"ju367vgq"},defaultClass:"ju367vgo"},modalBorder:{conditions:{base:"ju367vgr",hover:"ju367vgs",active:"ju367vgt"},defaultClass:"ju367vgr"},modalText:{conditions:{base:"ju367vgu",hover:"ju367vgv",active:"ju367vgw"},defaultClass:"ju367vgu"},modalTextDim:{conditions:{base:"ju367vgx",hover:"ju367vgy",active:"ju367vgz"},defaultClass:"ju367vgx"},modalTextSecondary:{conditions:{base:"ju367vh0",hover:"ju367vh1",active:"ju367vh2"},defaultClass:"ju367vh0"},profileAction:{conditions:{base:"ju367vh3",hover:"ju367vh4",active:"ju367vh5"},defaultClass:"ju367vh3"},profileActionHover:{conditions:{base:"ju367vh6",hover:"ju367vh7",active:"ju367vh8"},defaultClass:"ju367vh6"},profileForeground:{conditions:{base:"ju367vh9",hover:"ju367vha",active:"ju367vhb"},defaultClass:"ju367vh9"},selectedOptionBorder:{conditions:{base:"ju367vhc",hover:"ju367vhd",active:"ju367vhe"},defaultClass:"ju367vhc"},standby:{conditions:{base:"ju367vhf",hover:"ju367vhg",active:"ju367vhh"},defaultClass:"ju367vhf"}}}}},{conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0},styles:{alignItems:{values:{"flex-start":{conditions:{smallScreen:"ju367v0",largeScreen:"ju367v1"},defaultClass:"ju367v0"},"flex-end":{conditions:{smallScreen:"ju367v2",largeScreen:"ju367v3"},defaultClass:"ju367v2"},center:{conditions:{smallScreen:"ju367v4",largeScreen:"ju367v5"},defaultClass:"ju367v4"}}},display:{values:{none:{conditions:{smallScreen:"ju367v6",largeScreen:"ju367v7"},defaultClass:"ju367v6"},block:{conditions:{smallScreen:"ju367v8",largeScreen:"ju367v9"},defaultClass:"ju367v8"},flex:{conditions:{smallScreen:"ju367va",largeScreen:"ju367vb"},defaultClass:"ju367va"},inline:{conditions:{smallScreen:"ju367vc",largeScreen:"ju367vd"},defaultClass:"ju367vc"}}}}},{conditions:void 0,styles:{margin:{mappings:["marginTop","marginBottom","marginLeft","marginRight"]},marginX:{mappings:["marginLeft","marginRight"]},marginY:{mappings:["marginTop","marginBottom"]},padding:{mappings:["paddingTop","paddingBottom","paddingLeft","paddingRight"]},paddingX:{mappings:["paddingLeft","paddingRight"]},paddingY:{mappings:["paddingTop","paddingBottom"]},alignSelf:{values:{"flex-start":{defaultClass:"ju367ve"},"flex-end":{defaultClass:"ju367vf"},center:{defaultClass:"ju367vg"}}},backgroundSize:{values:{cover:{defaultClass:"ju367vh"}}},borderRadius:{values:{1:{defaultClass:"ju367vi"},6:{defaultClass:"ju367vj"},10:{defaultClass:"ju367vk"},13:{defaultClass:"ju367vl"},actionButton:{defaultClass:"ju367vm"},connectButton:{defaultClass:"ju367vn"},menuButton:{defaultClass:"ju367vo"},modal:{defaultClass:"ju367vp"},modalMobile:{defaultClass:"ju367vq"},"25%":{defaultClass:"ju367vr"},full:{defaultClass:"ju367vs"}}},borderStyle:{values:{solid:{defaultClass:"ju367vt"}}},borderWidth:{values:{0:{defaultClass:"ju367vu"},1:{defaultClass:"ju367vv"},2:{defaultClass:"ju367vw"},4:{defaultClass:"ju367vx"}}},cursor:{values:{pointer:{defaultClass:"ju367vy"},none:{defaultClass:"ju367vz"}}},pointerEvents:{values:{none:{defaultClass:"ju367v10"},all:{defaultClass:"ju367v11"}}},minHeight:{values:{8:{defaultClass:"ju367v12"},44:{defaultClass:"ju367v13"}}},flexDirection:{values:{row:{defaultClass:"ju367v14"},column:{defaultClass:"ju367v15"}}},fontFamily:{values:{body:{defaultClass:"ju367v16"}}},fontSize:{values:{12:{defaultClass:"ju367v17"},13:{defaultClass:"ju367v18"},14:{defaultClass:"ju367v19"},16:{defaultClass:"ju367v1a"},18:{defaultClass:"ju367v1b"},20:{defaultClass:"ju367v1c"},23:{defaultClass:"ju367v1d"}}},fontWeight:{values:{regular:{defaultClass:"ju367v1e"},medium:{defaultClass:"ju367v1f"},semibold:{defaultClass:"ju367v1g"},bold:{defaultClass:"ju367v1h"},heavy:{defaultClass:"ju367v1i"}}},gap:{values:{0:{defaultClass:"ju367v1j"},1:{defaultClass:"ju367v1k"},2:{defaultClass:"ju367v1l"},3:{defaultClass:"ju367v1m"},4:{defaultClass:"ju367v1n"},5:{defaultClass:"ju367v1o"},6:{defaultClass:"ju367v1p"},8:{defaultClass:"ju367v1q"},10:{defaultClass:"ju367v1r"},12:{defaultClass:"ju367v1s"},14:{defaultClass:"ju367v1t"},16:{defaultClass:"ju367v1u"},18:{defaultClass:"ju367v1v"},20:{defaultClass:"ju367v1w"},24:{defaultClass:"ju367v1x"},28:{defaultClass:"ju367v1y"},32:{defaultClass:"ju367v1z"},36:{defaultClass:"ju367v20"},44:{defaultClass:"ju367v21"},64:{defaultClass:"ju367v22"},"-1":{defaultClass:"ju367v23"}}},height:{values:{1:{defaultClass:"ju367v24"},2:{defaultClass:"ju367v25"},4:{defaultClass:"ju367v26"},8:{defaultClass:"ju367v27"},12:{defaultClass:"ju367v28"},20:{defaultClass:"ju367v29"},24:{defaultClass:"ju367v2a"},28:{defaultClass:"ju367v2b"},30:{defaultClass:"ju367v2c"},32:{defaultClass:"ju367v2d"},34:{defaultClass:"ju367v2e"},36:{defaultClass:"ju367v2f"},40:{defaultClass:"ju367v2g"},44:{defaultClass:"ju367v2h"},48:{defaultClass:"ju367v2i"},54:{defaultClass:"ju367v2j"},60:{defaultClass:"ju367v2k"},200:{defaultClass:"ju367v2l"},full:{defaultClass:"ju367v2m"},max:{defaultClass:"ju367v2n"}}},justifyContent:{values:{"flex-start":{defaultClass:"ju367v2o"},"flex-end":{defaultClass:"ju367v2p"},center:{defaultClass:"ju367v2q"},"space-between":{defaultClass:"ju367v2r"},"space-around":{defaultClass:"ju367v2s"}}},textAlign:{values:{left:{defaultClass:"ju367v2t"},center:{defaultClass:"ju367v2u"},inherit:{defaultClass:"ju367v2v"}}},marginBottom:{values:{0:{defaultClass:"ju367v2w"},1:{defaultClass:"ju367v2x"},2:{defaultClass:"ju367v2y"},3:{defaultClass:"ju367v2z"},4:{defaultClass:"ju367v30"},5:{defaultClass:"ju367v31"},6:{defaultClass:"ju367v32"},8:{defaultClass:"ju367v33"},10:{defaultClass:"ju367v34"},12:{defaultClass:"ju367v35"},14:{defaultClass:"ju367v36"},16:{defaultClass:"ju367v37"},18:{defaultClass:"ju367v38"},20:{defaultClass:"ju367v39"},24:{defaultClass:"ju367v3a"},28:{defaultClass:"ju367v3b"},32:{defaultClass:"ju367v3c"},36:{defaultClass:"ju367v3d"},44:{defaultClass:"ju367v3e"},64:{defaultClass:"ju367v3f"},"-1":{defaultClass:"ju367v3g"}}},marginLeft:{values:{0:{defaultClass:"ju367v3h"},1:{defaultClass:"ju367v3i"},2:{defaultClass:"ju367v3j"},3:{defaultClass:"ju367v3k"},4:{defaultClass:"ju367v3l"},5:{defaultClass:"ju367v3m"},6:{defaultClass:"ju367v3n"},8:{defaultClass:"ju367v3o"},10:{defaultClass:"ju367v3p"},12:{defaultClass:"ju367v3q"},14:{defaultClass:"ju367v3r"},16:{defaultClass:"ju367v3s"},18:{defaultClass:"ju367v3t"},20:{defaultClass:"ju367v3u"},24:{defaultClass:"ju367v3v"},28:{defaultClass:"ju367v3w"},32:{defaultClass:"ju367v3x"},36:{defaultClass:"ju367v3y"},44:{defaultClass:"ju367v3z"},64:{defaultClass:"ju367v40"},"-1":{defaultClass:"ju367v41"}}},marginRight:{values:{0:{defaultClass:"ju367v42"},1:{defaultClass:"ju367v43"},2:{defaultClass:"ju367v44"},3:{defaultClass:"ju367v45"},4:{defaultClass:"ju367v46"},5:{defaultClass:"ju367v47"},6:{defaultClass:"ju367v48"},8:{defaultClass:"ju367v49"},10:{defaultClass:"ju367v4a"},12:{defaultClass:"ju367v4b"},14:{defaultClass:"ju367v4c"},16:{defaultClass:"ju367v4d"},18:{defaultClass:"ju367v4e"},20:{defaultClass:"ju367v4f"},24:{defaultClass:"ju367v4g"},28:{defaultClass:"ju367v4h"},32:{defaultClass:"ju367v4i"},36:{defaultClass:"ju367v4j"},44:{defaultClass:"ju367v4k"},64:{defaultClass:"ju367v4l"},"-1":{defaultClass:"ju367v4m"}}},marginTop:{values:{0:{defaultClass:"ju367v4n"},1:{defaultClass:"ju367v4o"},2:{defaultClass:"ju367v4p"},3:{defaultClass:"ju367v4q"},4:{defaultClass:"ju367v4r"},5:{defaultClass:"ju367v4s"},6:{defaultClass:"ju367v4t"},8:{defaultClass:"ju367v4u"},10:{defaultClass:"ju367v4v"},12:{defaultClass:"ju367v4w"},14:{defaultClass:"ju367v4x"},16:{defaultClass:"ju367v4y"},18:{defaultClass:"ju367v4z"},20:{defaultClass:"ju367v50"},24:{defaultClass:"ju367v51"},28:{defaultClass:"ju367v52"},32:{defaultClass:"ju367v53"},36:{defaultClass:"ju367v54"},44:{defaultClass:"ju367v55"},64:{defaultClass:"ju367v56"},"-1":{defaultClass:"ju367v57"}}},maxWidth:{values:{1:{defaultClass:"ju367v58"},2:{defaultClass:"ju367v59"},4:{defaultClass:"ju367v5a"},8:{defaultClass:"ju367v5b"},12:{defaultClass:"ju367v5c"},20:{defaultClass:"ju367v5d"},24:{defaultClass:"ju367v5e"},28:{defaultClass:"ju367v5f"},30:{defaultClass:"ju367v5g"},32:{defaultClass:"ju367v5h"},34:{defaultClass:"ju367v5i"},36:{defaultClass:"ju367v5j"},40:{defaultClass:"ju367v5k"},44:{defaultClass:"ju367v5l"},48:{defaultClass:"ju367v5m"},54:{defaultClass:"ju367v5n"},60:{defaultClass:"ju367v5o"},200:{defaultClass:"ju367v5p"},full:{defaultClass:"ju367v5q"},max:{defaultClass:"ju367v5r"}}},minWidth:{values:{1:{defaultClass:"ju367v5s"},2:{defaultClass:"ju367v5t"},4:{defaultClass:"ju367v5u"},8:{defaultClass:"ju367v5v"},12:{defaultClass:"ju367v5w"},20:{defaultClass:"ju367v5x"},24:{defaultClass:"ju367v5y"},28:{defaultClass:"ju367v5z"},30:{defaultClass:"ju367v60"},32:{defaultClass:"ju367v61"},34:{defaultClass:"ju367v62"},36:{defaultClass:"ju367v63"},40:{defaultClass:"ju367v64"},44:{defaultClass:"ju367v65"},48:{defaultClass:"ju367v66"},54:{defaultClass:"ju367v67"},60:{defaultClass:"ju367v68"},200:{defaultClass:"ju367v69"},full:{defaultClass:"ju367v6a"},max:{defaultClass:"ju367v6b"}}},overflow:{values:{hidden:{defaultClass:"ju367v6c"}}},paddingBottom:{values:{0:{defaultClass:"ju367v6d"},1:{defaultClass:"ju367v6e"},2:{defaultClass:"ju367v6f"},3:{defaultClass:"ju367v6g"},4:{defaultClass:"ju367v6h"},5:{defaultClass:"ju367v6i"},6:{defaultClass:"ju367v6j"},8:{defaultClass:"ju367v6k"},10:{defaultClass:"ju367v6l"},12:{defaultClass:"ju367v6m"},14:{defaultClass:"ju367v6n"},16:{defaultClass:"ju367v6o"},18:{defaultClass:"ju367v6p"},20:{defaultClass:"ju367v6q"},24:{defaultClass:"ju367v6r"},28:{defaultClass:"ju367v6s"},32:{defaultClass:"ju367v6t"},36:{defaultClass:"ju367v6u"},44:{defaultClass:"ju367v6v"},64:{defaultClass:"ju367v6w"},"-1":{defaultClass:"ju367v6x"}}},paddingLeft:{values:{0:{defaultClass:"ju367v6y"},1:{defaultClass:"ju367v6z"},2:{defaultClass:"ju367v70"},3:{defaultClass:"ju367v71"},4:{defaultClass:"ju367v72"},5:{defaultClass:"ju367v73"},6:{defaultClass:"ju367v74"},8:{defaultClass:"ju367v75"},10:{defaultClass:"ju367v76"},12:{defaultClass:"ju367v77"},14:{defaultClass:"ju367v78"},16:{defaultClass:"ju367v79"},18:{defaultClass:"ju367v7a"},20:{defaultClass:"ju367v7b"},24:{defaultClass:"ju367v7c"},28:{defaultClass:"ju367v7d"},32:{defaultClass:"ju367v7e"},36:{defaultClass:"ju367v7f"},44:{defaultClass:"ju367v7g"},64:{defaultClass:"ju367v7h"},"-1":{defaultClass:"ju367v7i"}}},paddingRight:{values:{0:{defaultClass:"ju367v7j"},1:{defaultClass:"ju367v7k"},2:{defaultClass:"ju367v7l"},3:{defaultClass:"ju367v7m"},4:{defaultClass:"ju367v7n"},5:{defaultClass:"ju367v7o"},6:{defaultClass:"ju367v7p"},8:{defaultClass:"ju367v7q"},10:{defaultClass:"ju367v7r"},12:{defaultClass:"ju367v7s"},14:{defaultClass:"ju367v7t"},16:{defaultClass:"ju367v7u"},18:{defaultClass:"ju367v7v"},20:{defaultClass:"ju367v7w"},24:{defaultClass:"ju367v7x"},28:{defaultClass:"ju367v7y"},32:{defaultClass:"ju367v7z"},36:{defaultClass:"ju367v80"},44:{defaultClass:"ju367v81"},64:{defaultClass:"ju367v82"},"-1":{defaultClass:"ju367v83"}}},paddingTop:{values:{0:{defaultClass:"ju367v84"},1:{defaultClass:"ju367v85"},2:{defaultClass:"ju367v86"},3:{defaultClass:"ju367v87"},4:{defaultClass:"ju367v88"},5:{defaultClass:"ju367v89"},6:{defaultClass:"ju367v8a"},8:{defaultClass:"ju367v8b"},10:{defaultClass:"ju367v8c"},12:{defaultClass:"ju367v8d"},14:{defaultClass:"ju367v8e"},16:{defaultClass:"ju367v8f"},18:{defaultClass:"ju367v8g"},20:{defaultClass:"ju367v8h"},24:{defaultClass:"ju367v8i"},28:{defaultClass:"ju367v8j"},32:{defaultClass:"ju367v8k"},36:{defaultClass:"ju367v8l"},44:{defaultClass:"ju367v8m"},64:{defaultClass:"ju367v8n"},"-1":{defaultClass:"ju367v8o"}}},position:{values:{absolute:{defaultClass:"ju367v8p"},fixed:{defaultClass:"ju367v8q"},relative:{defaultClass:"ju367v8r"}}},WebkitUserSelect:{values:{none:{defaultClass:"ju367v8s"}}},right:{values:{0:{defaultClass:"ju367v8t"}}},transition:{values:{default:{defaultClass:"ju367v8u"},transform:{defaultClass:"ju367v8v"}}},userSelect:{values:{none:{defaultClass:"ju367v8w"}}},width:{values:{1:{defaultClass:"ju367v8x"},2:{defaultClass:"ju367v8y"},4:{defaultClass:"ju367v8z"},8:{defaultClass:"ju367v90"},12:{defaultClass:"ju367v91"},20:{defaultClass:"ju367v92"},24:{defaultClass:"ju367v93"},28:{defaultClass:"ju367v94"},30:{defaultClass:"ju367v95"},32:{defaultClass:"ju367v96"},34:{defaultClass:"ju367v97"},36:{defaultClass:"ju367v98"},40:{defaultClass:"ju367v99"},44:{defaultClass:"ju367v9a"},48:{defaultClass:"ju367v9b"},54:{defaultClass:"ju367v9c"},60:{defaultClass:"ju367v9d"},200:{defaultClass:"ju367v9e"},full:{defaultClass:"ju367v9f"},max:{defaultClass:"ju367v9g"}}},backdropFilter:{values:{modalOverlay:{defaultClass:"ju367v9h"}}}}}),z1e={colors:{accentColor:"var(--rk-colors-accentColor)",accentColorForeground:"var(--rk-colors-accentColorForeground)",actionButtonBorder:"var(--rk-colors-actionButtonBorder)",actionButtonBorderMobile:"var(--rk-colors-actionButtonBorderMobile)",actionButtonSecondaryBackground:"var(--rk-colors-actionButtonSecondaryBackground)",closeButton:"var(--rk-colors-closeButton)",closeButtonBackground:"var(--rk-colors-closeButtonBackground)",connectButtonBackground:"var(--rk-colors-connectButtonBackground)",connectButtonBackgroundError:"var(--rk-colors-connectButtonBackgroundError)",connectButtonInnerBackground:"var(--rk-colors-connectButtonInnerBackground)",connectButtonText:"var(--rk-colors-connectButtonText)",connectButtonTextError:"var(--rk-colors-connectButtonTextError)",connectionIndicator:"var(--rk-colors-connectionIndicator)",downloadBottomCardBackground:"var(--rk-colors-downloadBottomCardBackground)",downloadTopCardBackground:"var(--rk-colors-downloadTopCardBackground)",error:"var(--rk-colors-error)",generalBorder:"var(--rk-colors-generalBorder)",generalBorderDim:"var(--rk-colors-generalBorderDim)",menuItemBackground:"var(--rk-colors-menuItemBackground)",modalBackdrop:"var(--rk-colors-modalBackdrop)",modalBackground:"var(--rk-colors-modalBackground)",modalBorder:"var(--rk-colors-modalBorder)",modalText:"var(--rk-colors-modalText)",modalTextDim:"var(--rk-colors-modalTextDim)",modalTextSecondary:"var(--rk-colors-modalTextSecondary)",profileAction:"var(--rk-colors-profileAction)",profileActionHover:"var(--rk-colors-profileActionHover)",profileForeground:"var(--rk-colors-profileForeground)",selectedOptionBorder:"var(--rk-colors-selectedOptionBorder)",standby:"var(--rk-colors-standby)"},fonts:{body:"var(--rk-fonts-body)"},radii:{actionButton:"var(--rk-radii-actionButton)",connectButton:"var(--rk-radii-connectButton)",menuButton:"var(--rk-radii-menuButton)",modal:"var(--rk-radii-modal)",modalMobile:"var(--rk-radii-modalMobile)"},shadows:{connectButton:"var(--rk-shadows-connectButton)",dialog:"var(--rk-shadows-dialog)",profileDetailsAction:"var(--rk-shadows-profileDetailsAction)",selectedOption:"var(--rk-shadows-selectedOption)",selectedWallet:"var(--rk-shadows-selectedWallet)",walletLogo:"var(--rk-shadows-walletLogo)"},blurs:{modalOverlay:"var(--rk-blurs-modalOverlay)"}},hFt={shrink:"_12cbo8i6",shrinkSm:"_12cbo8i7"},pFt="_12cbo8i3 ju367v8r",mFt={grow:"_12cbo8i4",growLg:"_12cbo8i5"};function tu({active:e,hover:t}){return[pFt,t&&mFt[t],hFt[e]]}var yRe=m.createContext(null);function xFt(){const{adapter:e}=m.useContext(yRe)??{};if(!e)throw new Error("No authentication adapter found");return e}function A$(){const e=m.useContext(yRe);return(e==null?void 0:e.status)??null}function vRe(){const e=A$(),{isConnected:t}=Yr();return t?e&&(e==="loading"||e==="unauthenticated")?e:"connected":"disconnected"}function nle(){return typeof navigator<"u"&&/android/i.test(navigator.userAgent)}function gFt(){return typeof navigator<"u"&&/iPhone|iPod/.test(navigator.userAgent)}function bFt(){return typeof navigator<"u"&&(/iPad/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function p5(){return gFt()||bFt()}function ru(){return nle()||p5()}var yFt="iekbcc0",vFt={a:"iekbcca",blockquote:"iekbcc2",button:"iekbcc9",input:"iekbcc8 iekbcc5 iekbcc4",mark:"iekbcc6",ol:"iekbcc1",q:"iekbcc2",select:"iekbcc7 iekbcc5 iekbcc4",table:"iekbcc3",textarea:"iekbcc5 iekbcc4",ul:"iekbcc1"},wFt=({reset:e,...t})=>{if(!e)return Zee(t);const n=vFt[e],r=Zee(t);return fMe(yFt,n,r)},jn=Se.forwardRef(({as:e="div",className:t,testId:n,...r},s)=>{const a={},o={};for(const c in r)Zee.properties.has(c)?a[c]=r[c]:o[c]=r[c];const l=wFt({reset:typeof e=="string"?e:"div",...a});return Se.createElement(e,{className:fMe(l,t),...o,"data-testid":n?`rk-${n.replace(/^rk-/,"")}`:void 0,ref:s})});jn.displayName="Box";var wRe=new Map,eW=new Map;async function CRe(e){const t=eW.get(e);if(t)return t;const n=async()=>e().then(async s=>(wRe.set(e,s),s)),r=n().catch(s=>n().catch(a=>{eW.delete(e)}));return eW.set(e,r),r}async function J0(...e){return await Promise.all(e.map(t=>typeof t=="function"?CRe(t):t))}function CFt(){const[,e]=m.useReducer(t=>t+1,0);return e}function rle(e){const t=typeof e=="function"?wRe.get(e):void 0,n=CFt();return m.useEffect(()=>{typeof e=="function"&&!t&&CRe(e).then(n)},[e,t,n]),typeof e=="function"?t:e}function Ec({alt:e,background:t,borderColor:n,borderRadius:r,useAsImage:s,boxShadow:a,height:o,src:l,width:c,testId:u}){const d=p5(),f=rle(l),x=f&&/^http/.test(f),[g,v]=m.useReducer(()=>!0,!1);return Se.createElement(jn,{"aria-label":e,borderRadius:r,boxShadow:a,height:typeof o=="string"?o:void 0,overflow:"hidden",position:"relative",role:"img",style:{background:t,height:typeof o=="number"?o:void 0,width:typeof c=="number"?c:void 0},width:typeof c=="string"?c:void 0,testId:u},Se.createElement(jn,{...x?{"aria-hidden":!0,as:"img",onLoad:v,src:f}:{"aria-hidden":!0,as:"img",src:f},height:"full",position:"absolute",...d?{WebkitUserSelect:"none"}:{},style:{WebkitTouchCallout:"none",transition:"opacity .15s linear",userSelect:"none",...!s&&x?{opacity:g?1:0}:{}},width:"full"}),n?Se.createElement(jn,{...typeof n=="object"&&"custom"in n?{style:{borderColor:n.custom}}:{borderColor:n},borderRadius:r,borderStyle:"solid",borderWidth:"1",height:"full",position:"relative",width:"full"}):null)}var SFt="_1luule42",NFt="_1luule43",AFt=e=>m.useMemo(()=>`${e}_${Math.round(Math.random()*1e9)}`,[e]),ZE=({height:e=21,width:t=21})=>{const n=AFt("spinner");return Se.createElement("svg",{className:SFt,fill:"none",height:e,viewBox:"0 0 21 21",width:t,xmlns:"http://www.w3.org/2000/svg"},Se.createElement("title",null,"Loading"),Se.createElement("clipPath",{id:n},Se.createElement("path",{d:"M10.5 3C6.35786 3 3 6.35786 3 10.5C3 14.6421 6.35786 18 10.5 18C11.3284 18 12 18.6716 12 19.5C12 20.3284 11.3284 21 10.5 21C4.70101 21 0 16.299 0 10.5C0 4.70101 4.70101 0 10.5 0C16.299 0 21 4.70101 21 10.5C21 11.3284 20.3284 12 19.5 12C18.6716 12 18 11.3284 18 10.5C18 6.35786 14.6421 3 10.5 3Z"})),Se.createElement("foreignObject",{clipPath:`url(#${n})`,height:"21",width:"21",x:"0",y:"0"},Se.createElement("div",{className:NFt})))},Ki=["#FC5C54","#FFD95A","#E95D72","#6A87C8","#5FD0F3","#75C06B","#FFDD86","#5FC6D4","#FF949A","#FF8024","#9BA1A4","#EC66FF","#FF8CBC","#FF9A23","#C5DADB","#A8CE63","#71ABFF","#FFE279","#B6B1B6","#FF6780","#A575FF","#4D82FF","#FFB35A"],H1e=[{color:Ki[0],emoji:"🌶"},{color:Ki[1],emoji:"🤑"},{color:Ki[2],emoji:"🐙"},{color:Ki[3],emoji:"🫐"},{color:Ki[4],emoji:"🐳"},{color:Ki[0],emoji:"🤶"},{color:Ki[5],emoji:"🌲"},{color:Ki[6],emoji:"🌞"},{color:Ki[7],emoji:"🐒"},{color:Ki[8],emoji:"🐵"},{color:Ki[9],emoji:"🦊"},{color:Ki[10],emoji:"🐼"},{color:Ki[11],emoji:"🦄"},{color:Ki[12],emoji:"🐷"},{color:Ki[13],emoji:"🐧"},{color:Ki[8],emoji:"🦩"},{color:Ki[14],emoji:"👽"},{color:Ki[0],emoji:"🎈"},{color:Ki[8],emoji:"🍉"},{color:Ki[1],emoji:"🎉"},{color:Ki[15],emoji:"🐲"},{color:Ki[16],emoji:"🌎"},{color:Ki[17],emoji:"🍊"},{color:Ki[18],emoji:"🐭"},{color:Ki[19],emoji:"🍣"},{color:Ki[1],emoji:"🐥"},{color:Ki[20],emoji:"👾"},{color:Ki[15],emoji:"🥦"},{color:Ki[0],emoji:"👹"},{color:Ki[17],emoji:"🙀"},{color:Ki[4],emoji:"⛱"},{color:Ki[21],emoji:"⛵️"},{color:Ki[17],emoji:"🥳"},{color:Ki[8],emoji:"🤯"},{color:Ki[22],emoji:"🤠"}];function jFt(e){let t=0;if(e.length===0)return t;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}function EFt(e){const n=Math.abs(jFt((typeof e=="string"?e:"").toLowerCase())%H1e.length);return H1e[n??0]}var _Ft=({address:e,ensImage:t,size:n})=>{const[r,s]=m.useState(!1);m.useEffect(()=>{if(t){const l=new Image;l.src=t,l.onload=()=>s(!0)}},[t]);const{color:a,emoji:o}=m.useMemo(()=>EFt(e),[e]);return t?r?Se.createElement(jn,{backgroundSize:"cover",borderRadius:"full",position:"absolute",style:{backgroundImage:`url(${t})`,backgroundPosition:"center",height:n,width:n}}):Se.createElement(jn,{alignItems:"center",backgroundSize:"cover",borderRadius:"full",color:"modalText",display:"flex",justifyContent:"center",position:"absolute",style:{height:n,width:n}},Se.createElement(ZE,null)):Se.createElement(jn,{alignItems:"center",display:"flex",justifyContent:"center",overflow:"hidden",style:{...!t&&{backgroundColor:a},height:n,width:n}},o)},SRe=_Ft,NRe=m.createContext(SRe);function kFt({address:e,imageUrl:t,loading:n,size:r}){const s=m.useContext(NRe);return Se.createElement(jn,{"aria-hidden":!0,borderRadius:"full",overflow:"hidden",position:"relative",style:{height:`${r}px`,width:`${r}px`},userSelect:"none"},Se.createElement(jn,{alignItems:"center",borderRadius:"full",display:"flex",justifyContent:"center",overflow:"hidden",position:"absolute",style:{fontSize:`${Math.round(r*.55)}px`,height:`${r}px`,transform:n?"scale(0.72)":void 0,transition:".25s ease",transitionDelay:n?void 0:".1s",width:`${r}px`,willChange:"transform"},userSelect:"none"},Se.createElement(s,{address:e,ensImage:t,size:r})),n&&Se.createElement(jn,{color:"accentColor",display:"flex",height:"full",position:"absolute",width:"full"},Se.createElement(ZE,{height:"100%",width:"100%"})))}var V1e={defaultLocale:"en",locale:"en"},TFt=class{constructor(e){this.listeners=new Set,this.defaultLocale=V1e.defaultLocale,this.enableFallback=!1,this.locale=V1e.locale,this.cachedLocales=[],this.translations={};for(const[t,n]of Object.entries(e))this.cachedLocales=[...this.cachedLocales,t],this.translations={...this.translations,...this.flattenTranslation(n,t)}}missingMessage(e){return`[missing: "${this.locale}.${e}" translation]`}flattenTranslation(e,t){const n={},r=(s,a)=>{for(const o of Object.keys(s)){const l=`${a}.${o}`,c=s[o];typeof c=="object"&&c!==null?r(c,l):n[l]=c}};return r(e,t),n}translateWithReplacements(e,t={}){let n=e;for(const r in t){const s=t[r];n=n.replace(`%{${r}}`,s)}return n}t(e,t,n){const r=`${this.locale}.${e}`,s=this.translations[r];if(!s){if(this.enableFallback){const a=`${this.defaultLocale}.${e}`,o=this.translations[a];if(o)return this.translateWithReplacements(o,t)}return n!=null&&n.rawKeyIfTranslationMissing?e:this.missingMessage(e)}return this.translateWithReplacements(s,t)}isLocaleCached(e){return this.cachedLocales.includes(e)}updateLocale(e){this.locale=e,this.notifyListeners()}setTranslations(e,t){this.isLocaleCached(e)||(this.cachedLocales=[...this.cachedLocales,e],this.translations={...this.translations,...this.flattenTranslation(t,e)}),this.locale=e,this.notifyListeners()}notifyListeners(){for(const e of this.listeners)e()}onChange(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}},Hh=new TFt({en:JSON.parse(Vee),"en-US":JSON.parse(Vee)});Hh.defaultLocale="en-US";Hh.locale="en-US";Hh.enableFallback=!0;var IFt=async e=>{switch(e){case"ar":case"ar-AR":return(await Jr(async()=>{const{default:t}=await import("./ar_AR-ZRPPM56D-d2WEfzQ_.js");return{default:t}},[])).default;case"de":case"de-DE":return(await Jr(async()=>{const{default:t}=await import("./de_DE-GYZFZXWH-CYZf24IR.js");return{default:t}},[])).default;case"en":case"en-US":return(await Jr(async()=>{const{default:t}=await Promise.resolve().then(()=>yNe);return{default:t}},void 0)).default;case"es":case"es-419":return(await Jr(async()=>{const{default:t}=await import("./es_419-OGVOQEFZ-D6BJPTeQ.js");return{default:t}},[])).default;case"fr":case"fr-FR":return(await Jr(async()=>{const{default:t}=await import("./fr_FR-Q5QBQBX2-lQoTmpTH.js");return{default:t}},[])).default;case"hi":case"hi-IN":return(await Jr(async()=>{const{default:t}=await import("./hi_IN-7I7LRHGW-CTQjmeYe.js");return{default:t}},[])).default;case"id":case"id-ID":return(await Jr(async()=>{const{default:t}=await import("./id_ID-ZMGZ2JFV-CgKQKAmU.js");return{default:t}},[])).default;case"ja":case"ja-JP":return(await Jr(async()=>{const{default:t}=await import("./ja_JP-NYBCHQTZ-CMaBl8Za.js");return{default:t}},[])).default;case"ko":case"ko-KR":return(await Jr(async()=>{const{default:t}=await import("./ko_KR-67WE736M-DHWhIjcm.js");return{default:t}},[])).default;case"ms":case"ms-MY":return(await Jr(async()=>{const{default:t}=await import("./ms_MY-65AJIBUS-BLlUrxe6.js");return{default:t}},[])).default;case"pt":case"pt-BR":return(await Jr(async()=>{const{default:t}=await import("./pt_BR-DMJANC65-DMs4DrlC.js");return{default:t}},[])).default;case"ru":case"ru-RU":return(await Jr(async()=>{const{default:t}=await import("./ru_RU-WER7RQ6A-DsJK55uv.js");return{default:t}},[])).default;case"th":case"th-TH":return(await Jr(async()=>{const{default:t}=await import("./th_TH-JOSHEZ6D-Cp87mIRZ.js");return{default:t}},[])).default;case"tr":case"tr-TR":return(await Jr(async()=>{const{default:t}=await import("./tr_TR-EAMG2YPO-C52_xfsf.js");return{default:t}},[])).default;case"ua":case"uk-UA":return(await Jr(async()=>{const{default:t}=await import("./uk_UA-GO2TRVWA-C1C1400t.js");return{default:t}},[])).default;case"vi":case"vi-VN":return(await Jr(async()=>{const{default:t}=await import("./vi_VN-5HLLSOJA-Dj7ferOp.js");return{default:t}},[])).default;case"zh":case"zh-CN":case"zh-Hans":return(await Jr(async()=>{const{default:t}=await import("./zh_CN-THPIFVWJ-Cbp71xMR.js");return{default:t}},[])).default;case"zh-HK":return(await Jr(async()=>{const{default:t}=await import("./zh_HK-R7XP4TGF-CyJtfKGw.js");return{default:t}},[])).default;case"zh-Hant":case"zh-TW":return(await Jr(async()=>{const{default:t}=await import("./zh_TW-F5LD752V-AHFgsYw-.js");return{default:t}},[])).default;default:return(await Jr(async()=>{const{default:t}=await Promise.resolve().then(()=>yNe);return{default:t}},void 0)).default}};async function W1e(e){if(Hh.isLocaleCached(e)){Hh.updateLocale(e);return}const n=await IFt(e);Hh.setTranslations(e,JSON.parse(n))}var PFt=()=>{var e;if(typeof window<"u"&&typeof navigator<"u"){if((e=navigator.languages)!=null&&e.length)return navigator.languages[0];if(navigator.language)return navigator.language}},nc=m.createContext({i18n:Hh}),FFt=({children:e,locale:t})=>{const[n,r]=m.useState(0),s=m.useMemo(()=>PFt(),[]);m.useEffect(()=>Hh.onChange(()=>{r(l=>l+1)}),[]),m.useEffect(()=>{t&&t!==Hh.locale?W1e(t):!t&&s&&s!==Hh.locale&&W1e(s)},[t,s]);const a=m.useMemo(()=>({t:(l,c)=>Hh.t(l,c),i18n:Hh}),[n]);return Se.createElement(nc.Provider,{value:a},e)};function ARe(e){return e!=null}var q1e={iconBackground:"#7290CC",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./apechain-COEQ5RUI-0TDoXOYf.js");return{default:e}},[])).default},tW={iconBackground:"#96bedc",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./arbitrum-HW44W6XR-hPA5bMPt.js");return{default:e}},[])).default},G1e={iconBackground:"#e84141",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./avalanche-MXEFEDSW-DcC5FNt3.js");return{default:e}},[])).default},nW={iconBackground:"#0052ff",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./base-Z4LFBE5D-DHfqMzJC.js");return{default:e}},[])).default},rW={iconBackground:"#814625",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./berachain-ZN3U5LDZ-CAvW_8ws.js");return{default:e}},[])).default},K1e={iconBackground:"#000000",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./blast-46UQLYYY-BV_Xlsq4.js");return{default:e}},[])).default},Y1e={iconBackground:"#ebac0e",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./bsc-RVE67I5L-DVYEF0vl.js");return{default:e}},[])).default},X1e={iconBackground:"#FCFF52",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./celo-E6XU57FO-C5IguUgF.js");return{default:e}},[])).default},Q1e={iconBackground:"#002D74",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./cronos-ROYR77VZ-Prn3LRPZ.js");return{default:e}},[])).default},OFt={iconBackground:"#A36EFD",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./degen-7ROC3GCY-9HqAkHtZ.js");return{default:e}},[])).default},ub={iconBackground:"#484c50",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./ethereum-RFBAMUVK-WsW8NXqo.js");return{default:e}},[])).default},Z1e={iconBackground:"transparent",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./flow-NBCRNYVF-D2XasjKk.js");return{default:e}},[])).default},MFt={iconBackground:"#04795c",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./gnosis-Y56LN66M-D4_J-ZQH.js");return{default:e}},[])).default},J1e={iconBackground:"#000000",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./gravity-LMEBVSFN-DLxWpxhy.js");return{default:e}},[])).default},RFt={iconBackground:"#f9f7ec",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./hardhat-NEEC6JX7-DzuWQYyS.js");return{default:e}},[])).default},LFt={iconBackground:"#000000",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./hyperevm-J6CONVCX-C6oeYIAP.js");return{default:e}},[])).default},ebe={iconBackground:"#7132F5",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./ink-4U4ZVNAB-AlM1MLfQ.js");return{default:e}},[])).default},tbe={iconBackground:"transparent",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./kaia-A33DVQBT-Fgclbhio.js");return{default:e}},[])).default},sW={iconBackground:"#ffffff",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./linea-IALBSJQC-Cmyd7vgA.js");return{default:e}},[])).default},iW={iconBackground:"#ffffff",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./manta-5V6W5D7G-BnjsGzeJ.js");return{default:e}},[])).default},nbe={iconBackground:"#000000",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./mantle-KBL3OIYT-DIpe0poV.js");return{default:e}},[])).default},xP={iconBackground:"#ff5a57",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./optimism-YWJ3IQHA-DYER-OR5.js");return{default:e}},[])).default},aW={iconBackground:"#9f71ec",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./polygon-WWEUOMKW-CNBYSB1T.js");return{default:e}},[])).default},DFt={iconBackground:"#1273EA",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./ronin-PNHX5V6H-BS-WPXjQ.js");return{default:e}},[])).default},BFt={iconBackground:"#000000",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./sanko-RHQYXGM5-OX010CbN.js");return{default:e}},[])).default},rbe={iconBackground:"#FFEEDA",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./scroll-MCKFTBRS-C2gqZSab.js");return{default:e}},[])).default},sbe={iconBackground:"#F50DB4",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./unichain-OQ3BZUDH-CyMLDmFg.js");return{default:e}},[])).default},ibe={iconBackground:"#f9f7ec",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./xdc-X7V4QFNF-CSGs0o6M.js");return{default:e}},[])).default},abe={iconBackground:"#000000",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./zetachain-BMJKVYBN-IK2CZBr3.js");return{default:e}},[])).default},obe={iconBackground:"#f9f7ec",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./zksync-UWUXFL74-Bt0brpXu.js");return{default:e}},[])).default},oW={iconBackground:"#000000",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./zora-YZH32HP3-CY3tp3EJ.js");return{default:e}},[])).default},$Ft={apechain:{chainId:33139,name:"ApeChain",...q1e},apechainCurtis:{chainId:33111,name:"ApeChain Curtis",...q1e},arbitrum:{chainId:42161,name:"Arbitrum",...tW},arbitrumGoerli:{chainId:421613,...tW},arbitrumSepolia:{chainId:421614,...tW},avalanche:{chainId:43114,...G1e},avalancheFuji:{chainId:43113,...G1e},base:{chainId:8453,name:"Base",...nW},baseGoerli:{chainId:84531,...nW},baseSepolia:{chainId:84532,...nW},berachain:{chainId:80094,name:"Berachain",...rW},berachainArtio:{chainId:80085,name:"Berachain Artio",...rW},berachainBArtio:{chainId:80084,name:"Berachain bArtio",...rW},blast:{chainId:81457,name:"Blast",...K1e},blastSepolia:{chainId:168587773,...K1e},bsc:{chainId:56,name:"BSC",...Y1e},bscTestnet:{chainId:97,...Y1e},celo:{chainId:42220,name:"Celo",...X1e},celoAlfajores:{chainId:44787,name:"Celo Alfajores",...X1e},cronos:{chainId:25,...Q1e},cronosTestnet:{chainId:338,...Q1e},degen:{chainId:666666666,name:"Degen",...OFt},flow:{chainId:747,...Z1e},flowTestnet:{chainId:545,...Z1e},gnosis:{chainId:100,name:"Gnosis",...MFt},goerli:{chainId:5,...ub},gravity:{chainId:1625,name:"Gravity",...J1e},gravitySepolia:{chainId:13505,name:"Gravity Sepolia",...J1e},hardhat:{chainId:31337,...RFt},holesky:{chainId:17e3,...ub},hyperevm:{chainId:999,...LFt},ink:{chainId:57073,...ebe},inkSepolia:{chainId:763373,...ebe},kaia:{chainId:8217,name:"Kaia",...tbe},kairos:{chainId:1001,name:"Kairos",...tbe},kovan:{chainId:42,...ub},linea:{chainId:59144,name:"Linea",...sW},lineaGoerli:{chainId:59140,name:"Linea Goerli",...sW},lineaSepolia:{chainId:59141,name:"Linea Sepolia",...sW},localhost:{chainId:1337,...ub},mainnet:{chainId:1,name:"Ethereum",...ub},manta:{chainId:169,name:"Manta",...iW},mantaSepolia:{chainId:3441006,...iW},mantaTestnet:{chainId:3441005,...iW},mantle:{chainId:5e3,...nbe},mantleTestnet:{chainId:5001,...nbe},optimism:{chainId:10,name:"Optimism",...xP},optimismGoerli:{chainId:420,...xP},optimismKovan:{chainId:69,...xP},optimismSepolia:{chainId:11155420,...xP},polygon:{chainId:137,name:"Polygon",...aW},polygonAmoy:{chainId:80002,...aW},polygonMumbai:{chainId:80001,...aW},rinkeby:{chainId:4,...ub},ronin:{chainId:2020,...DFt},ropsten:{chainId:3,...ub},sanko:{chainId:1996,name:"Sanko",...BFt},scroll:{chainId:534352,...rbe},scrollSepolia:{chainId:534351,...rbe},sepolia:{chainId:11155111,...ub},unichain:{chainId:130,...sbe},unichainSepolia:{chainId:1301,...sbe},xdc:{chainId:50,name:"XinFin",...ibe},xdcTestnet:{chainId:51,...ibe},zetachain:{chainId:7e3,name:"ZetaChain",...abe},zetachainAthensTestnet:{chainId:7001,name:"Zeta Athens",...abe},zkSync:{chainId:324,name:"zkSync",...obe},zkSyncTestnet:{chainId:280,...obe},zora:{chainId:7777777,name:"Zora",...oW},zoraSepolia:{chainId:999999999,...oW},zoraTestnet:{chainId:999,...oW}},UFt=Object.fromEntries(Object.values($Ft).filter(ARe).map(({chainId:e,...t})=>[e,t])),zFt=e=>e.map(t=>{const n=UFt[t.id]??{};return{...t,name:n.name??t.name,iconUrl:t.iconUrl??n.iconUrl,iconBackground:t.iconBackground??n.iconBackground}}),sle=m.createContext({chains:[]});function HFt({children:e,initialChain:t}){const{chains:n}=wl();return Se.createElement(sle.Provider,{value:m.useMemo(()=>({chains:zFt(n),initialChainId:typeof t=="number"?t:t==null?void 0:t.id}),[n,t])},e)}var $A=()=>m.useContext(sle).chains,VFt=()=>m.useContext(sle).initialChainId,WFt=()=>{const e=$A();return m.useMemo(()=>{const t={};for(const n of e)t[n.id]=n;return t},[e])},jRe=m.createContext({showBalance:void 0,setShowBalance:()=>{}});function qFt({children:e}){const[t,n]=m.useState();return Se.createElement(jRe.Provider,{value:{showBalance:t,setShowBalance:n}},e)}var GFt=()=>m.useContext(jRe);function KFt(){const[e,t]=m.useState(!1);return m.useEffect(()=>(t(!0),()=>{t(!1)}),[]),m.useCallback(()=>e,[e])}function ERe(){const e=$A(),t=QE.id;return e.some(r=>r.id===t)}function YFt(e){const t=ERe(),n=s=>{try{return qIt(s)}catch{}},{data:r}=rgt({chainId:QE.id,name:e?n(e):void 0,query:{enabled:t}});return r}async function ov(e,t){if(t={headers:{},method:"get",...t,timeout:t.timeout??1e4},!e)throw new Error("rainbowFetch: Missing url argument");const n=new AbortController,r=setTimeout(()=>n.abort(),t.timeout),{body:s,params:a,headers:o,...l}=t,c=s&&typeof s=="object"?JSON.stringify(t.body):t.body,u=await fetch(`${e}${QFt(a)}`,{...l,body:c,headers:{Accept:"application/json","Content-Type":"application/json",...o},signal:n.signal});clearTimeout(r);const d=await XFt(u);if(u.ok){const{headers:g,status:v}=u;return{data:d,headers:g,status:v}}throw ZFt({requestBody:s,response:u,responseBody:typeof d=="string"?{error:d}:d})}function XFt(e){const t=e.headers.get("Content-Type");return t!=null&&t.startsWith("application/json")?e.json():e.text()}function QFt(e){return e&&Object.keys(e).length?`?${new URLSearchParams(e)}`:""}function ZFt({requestBody:e,response:t,responseBody:n}){const r=(n==null?void 0:n.error)||(t==null?void 0:t.statusText)||"There was an error with the request.",s=new Error(r);return s.response=t,s.responseBody=n,s.requestBody=e,s}var JFt=class{constructor(e={}){const{baseUrl:t="",...n}=e;this.baseUrl=t,this.opts=n}get(e,t){return ov(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"get"})}delete(e,t){return ov(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"delete"})}head(e,t){return ov(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"head"})}options(e,t){return ov(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"options"})}post(e,t,n){return ov(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"post"})}put(e,t,n){return ov(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"put"})}patch(e,t,n){return ov(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"patch"})}};function eOt({baseUrl:e,headers:t,params:n,timeout:r}){return new JFt({baseUrl:e,headers:t,params:n,timeout:r})}var tOt=!!(typeof process<"u"&&typeof OR<"u"&&OR.RAINBOW_PROVIDER_API_KEY),nOt=eOt({baseUrl:"https://enhanced-provider.rainbow.me",headers:{"x-api-key":typeof process<"u"&&typeof OR<"u"&&OR.RAINBOW_PROVIDER_API_KEY||"LzbasoBiLqltex3VkcQ7LRmL4PtfiiZ1EMJrizrgfonWN6byJReu/l6yrUoo3zLW"}});function rOt(e,t,n={}){return[e,t,n]}function bO(e){return`rk-ens-name-${e}`}function sOt(e){try{const t=e?JSON.parse(e):null;return typeof t=="object"?t:null}catch{return null}}function iOt(e,t){if(!Jl(e))return;const n=new Date,r=new Date(n.getTime()+180*6e4);localStorage.setItem(bO(e),JSON.stringify({ensName:t,expires:r.getTime()}))}function aOt(e){const t=sOt(localStorage.getItem(bO(e)));if(!t)return null;const{ensName:n,expires:r}=t;return typeof n!="string"||Number.isNaN(Number(r))||new Date().getTime()>Number(r)?(localStorage.removeItem(bO(e)),null):n}async function oOt({address:e}){const t=aOt(e);if(t)return t;const r=(await nOt.get("/v1/resolve-ens",{params:{address:e}})).data.data;return r&&iOt(e,r),r}function lOt(e){const t=ERe(),{data:n}=sgt({chainId:QE.id,address:e,query:{enabled:t}}),{data:r}=p_e({queryKey:rOt("address",e),queryFn:()=>oOt({address:e}),enabled:!t&&!!e&&tOt,staleTime:10*(60*1e3),retry:1});return n||r}function _Re({address:e,includeBalance:t}){const n=lOt(e),r=YFt(n),{data:s}=m_e({address:t?e:void 0});return{ensName:n,ensAvatar:r,balance:s}}function ile(){const{chain:e}=Yr();return(e==null?void 0:e.id)??null}var kRe="rk-transactions";function cOt(e){try{const t=e?JSON.parse(e):{};return typeof t=="object"?t:{}}catch{return{}}}function lbe(){return cOt(typeof localStorage<"u"?localStorage.getItem(kRe):null)}var uOt=/^0x([A-Fa-f0-9]{64})$/;function dOt(e){const t=[];return uOt.test(e.hash)||t.push("Invalid transaction hash"),typeof e.description!="string"&&t.push("Transaction must have a description"),typeof e.confirmations<"u"&&(!Number.isInteger(e.confirmations)||e.confirmations<1)&&t.push("Transaction confirmations must be a positiver integer"),t}function fOt({provider:e}){let t=lbe(),n=e;const r=new Set,s=new Set,a=new Map;function o(I){n=I}function l(I,P){var R;return((R=t[I])==null?void 0:R[P])??[]}function c(I,P,R){const F=dOt(R);if(F.length>0)throw new Error(["Unable to add transaction",...F].join(`
`));x(I,P,U=>[{...R,status:"pending"},...U.filter(({hash:L})=>L!==R.hash)])}function u(I,P){x(I,P,()=>[])}function d(I,P,R,F){x(I,P,U=>U.map(L=>L.hash===R?{...L,status:F}:L))}async function f(I,P){await Promise.all(l(I,P).filter(R=>R.status==="pending").map(async R=>{const{confirmations:F,hash:U}=R,L=a.get(U);if(L)return await L;const z=n.waitForTransactionReceipt({confirmations:F,hash:U,timeout:3e5}).then(({status:X})=>{a.delete(U),X!==void 0&&(d(I,P,U,X===0||X==="reverted"?"failed":"confirmed"),w(X))}).catch(()=>{d(I,P,U,"failed")});return a.set(U,z),await z}))}function x(I,P,R){t=lbe(),t[I]=t[I]??{};let F=0;const U=10,L=R(t[I][P]??[]).filter(({status:z})=>z==="pending"?!0:F++<=U);t[I][P]=L.length>0?L:void 0,g(),v(),f(I,P)}function g(){localStorage.setItem(kRe,JSON.stringify(t))}function v(){for(const I of r)I()}function w(I){for(const P of s)P(I)}function C(I){return r.add(I),()=>{r.delete(I)}}function N(I){return s.add(I),()=>{s.delete(I)}}return{addTransaction:c,clearTransactions:u,getTransactions:l,onTransactionStatus:N,onChange:C,setProvider:o,waitForPendingTransactions:f}}var cbe,TRe=Se.createContext(null);function hOt({children:e}){const t=x_e(),{address:n}=Yr(),r=ile(),{refetch:s}=m_e({address:n,query:{enabled:!1}}),[a]=Se.useState(()=>cbe??(cbe=fOt({provider:t}))),o=Se.useCallback(l=>{l==="success"&&s()},[s]);return Se.useEffect(()=>{a.setProvider(t)},[a,t]),Se.useEffect(()=>{n&&r&&a.waitForPendingTransactions(n,r)},[a,n,r]),Se.useEffect(()=>{if(a&&n&&r)return a.onTransactionStatus(o)},[a,n,r,o]),Se.createElement(TRe.Provider,{value:a},e)}function IRe(){const e=Se.useContext(TRe);if(!e)throw new Error("Transaction hooks must be used within RainbowKitProvider");return e}function PRe(){const e=IRe(),{address:t}=Yr(),n=ile(),[r,s]=m.useState(()=>e&&t&&n?e.getTransactions(t,n):[]);return m.useEffect(()=>{if(e&&t&&n)return s(e.getTransactions(t,n)),e.onChange(()=>{s(e.getTransactions(t,n))})},[e,t,n]),r}var ube=e=>typeof e=="function"?e():e;function pOt(e,{extends:t}={}){const n={...f1e(z1e,ube(e))};if(!t)return n;const r=f1e(z1e,ube(t));return Object.fromEntries(Object.entries(n).filter(([a,o])=>o!==r[a]))}function dbe(e,t={}){return Object.entries(pOt(e,t)).map(([n,r])=>`${n}:${r.replace(/[:;{}</>]/g,"")};`).join("")}var FRe={appName:void 0,disclaimer:void 0,learnMoreUrl:"https://learn.rainbow.me/understanding-web3?utm_source=rainbowkit&utm_campaign=learnmore"},sT=m.createContext(FRe),ORe=m.createContext(!1);function mOt(e,t){let n;return()=>{n&&clearTimeout(n),n=setTimeout(()=>{n=null,e()},t)}}var MRe=()=>{const[e,t]=m.useState({height:void 0,width:void 0});return m.useEffect(()=>{const n=mOt(()=>{t({height:window.innerHeight,width:window.innerWidth})},500);return window.addEventListener("resize",n),n(),()=>window.removeEventListener("resize",n)},[]),e},iT=m.createContext({connector:null,setConnector:()=>{}});function xOt({children:e}){const[t,n]=m.useState(null);return Se.createElement(iT.Provider,{value:m.useMemo(()=>({connector:t,setConnector:n}),[t])},e)}var aT={COMPACT:"compact",WIDE:"wide"},j$=m.createContext(aT.WIDE);function gOt({children:e,modalSize:t}){const{width:n}=MRe(),r=n&&n<dFt,{connector:s}=m.useContext(iT);return Se.createElement(j$.Provider,{value:r||s?aT.COMPACT:t},e)}var ale=m.createContext(!1),bOt="rk-version";function yOt({version:e}){localStorage.setItem(bOt,e)}function vOt(){const e=m.useCallback(()=>{yOt({version:"2.2.4"})},[]);m.useEffect(()=>{e()},[e])}function wOt(e,t){const n={};for(const r of e){const s=t(r);s&&(n[s]=r)}return n}function ole(){return typeof navigator<"u"&&typeof navigator.userAgent<"u"&&/Version\/([0-9._]+).*Safari/.test(navigator.userAgent)}function COt(){return typeof document<"u"&&getComputedStyle(document.body).getPropertyValue("--arc-palette-focus")!==""}function lle(){var t,n;if(typeof navigator>"u")return"Browser";const e=(t=navigator.userAgent)==null?void 0:t.toLowerCase();return(n=navigator.brave)!=null&&n.isBrave?"Brave":(e==null?void 0:e.indexOf("edg/"))>-1?"Edge":(e==null?void 0:e.indexOf("op"))>-1?"Opera":COt()?"Arc":(e==null?void 0:e.indexOf("chrome"))>-1?"Chrome":(e==null?void 0:e.indexOf("firefox"))>-1?"Firefox":ole()?"Safari":"Browser"}var SOt=BPt.UAParser(),{os:cle}=SOt;function NOt(){return cle.name==="Windows"}function AOt(){return cle.name==="Mac OS"}function jOt(){return["Ubuntu","Mint","Fedora","Debian","Arch","Linux"].includes(cle.name)}function ule(){return NOt()?"Windows":AOt()?"macOS":jOt()?"Linux":"Desktop"}var EOt=e=>{var n,r,s,a,o,l,c,u,d,f,x;const t=lle();return{Arc:(n=e==null?void 0:e.downloadUrls)==null?void 0:n.chrome,Brave:(r=e==null?void 0:e.downloadUrls)==null?void 0:r.chrome,Chrome:(s=e==null?void 0:e.downloadUrls)==null?void 0:s.chrome,Edge:((a=e==null?void 0:e.downloadUrls)==null?void 0:a.edge)||((o=e==null?void 0:e.downloadUrls)==null?void 0:o.chrome),Firefox:(l=e==null?void 0:e.downloadUrls)==null?void 0:l.firefox,Opera:((c=e==null?void 0:e.downloadUrls)==null?void 0:c.opera)||((u=e==null?void 0:e.downloadUrls)==null?void 0:u.chrome),Safari:(d=e==null?void 0:e.downloadUrls)==null?void 0:d.safari,Browser:(f=e==null?void 0:e.downloadUrls)==null?void 0:f.browserExtension}[t]??((x=e==null?void 0:e.downloadUrls)==null?void 0:x.browserExtension)},_Ot=e=>{var n,r,s;return(p5()?(n=e==null?void 0:e.downloadUrls)==null?void 0:n.ios:(r=e==null?void 0:e.downloadUrls)==null?void 0:r.android)??((s=e==null?void 0:e.downloadUrls)==null?void 0:s.mobile)},kOt=e=>{var n,r,s,a,o;const t=ule();return{Windows:(n=e==null?void 0:e.downloadUrls)==null?void 0:n.windows,macOS:(r=e==null?void 0:e.downloadUrls)==null?void 0:r.macos,Linux:(s=e==null?void 0:e.downloadUrls)==null?void 0:s.linux,Desktop:(a=e==null?void 0:e.downloadUrls)==null?void 0:a.desktop}[t]??((o=e==null?void 0:e.downloadUrls)==null?void 0:o.desktop)},RRe=(e,t)=>e.some(n=>n.id===t),TOt=e=>!!e.isRainbowKitConnector,fbe=e=>{var t;return!!(!e.isRainbowKitConnector&&((t=e.icon)!=null&&t.replace(/\n/g,"").startsWith("data:image"))&&e.uid&&e.name)},IOt=(e,t)=>e.id==="walletConnect"&&t?{...e,walletConnectModalConnector:t}:e,POt=({wallets:e,recentWallets:t})=>[...t,...e.filter(n=>!RRe(t,n.id))],LRe="rk-recent";function FOt(e){try{const t=e?JSON.parse(e):[];return Array.isArray(t)?t:[]}catch{return[]}}function DRe(){return typeof localStorage<"u"?FOt(localStorage.getItem(LRe)):[]}function OOt(e){return[...new Set(e)]}function MOt(e){const t=OOt([e,...DRe()]);localStorage.setItem(LRe,JSON.stringify(t))}function JE(e=!1){var R,F,U;const t=$A(),n=VFt(),{connectAsync:r,connectors:s}=tgt(),a=s,{setIsWalletConnectModalOpen:o}=cLe(),l=a.map(L=>({...L,...L.rkDetails||{}}));async function c(L){var ne,J;const z=await L.getChainId(),X=await r({chainId:n??((ne=t.find(({id:Z})=>Z===z))==null?void 0:ne.id)??((J=t[0])==null?void 0:J.id),connector:L});return X&&MOt(L.id),X}async function u(L){try{o(!0),await c(L),o(!1)}catch(z){const X=z.name==="UserRejectedRequestError"||z.message==="Connection request reset. Please try again.";if(o(!1),!X)throw z}}const d=async(L,z)=>{const X=await L.getProvider();return L.id==="coinbase"?X.qrUrl:new Promise(ne=>X.once("display_uri",J=>{ne(z(J))}))},f=l.find(L=>L.id==="walletConnect"&&L.isWalletConnectModalConnector),x=l.filter(fbe).map(L=>({...L,groupIndex:0})),g=l.filter(TOt).filter(L=>!L.isWalletConnectModalConnector).filter(L=>e?!x.some(X=>X.id===L.rdns):!0).map(L=>IOt(L,f)),v=[...x,...g],w=wOt(v,L=>L.id),N=DRe().map(L=>w[L]).filter(Boolean).slice(0,3),I=[],P=POt({wallets:v,recentWallets:N});for(const L of P){if(!L)continue;const z=fbe(L),X=RRe(N,L.id);if(z){I.push({...L,iconUrl:L.icon,ready:!0,connect:()=>c(L),groupName:"Installed",recent:X});continue}I.push({...L,ready:L.installed??!0,connect:()=>c(L),desktopDownloadUrl:kOt(L),extensionDownloadUrl:EOt(L),groupName:L.groupName,mobileDownloadUrl:_Ot(L),getQrCodeUri:(R=L.qrCode)!=null&&R.getUri?()=>d(L,L.qrCode.getUri):void 0,getDesktopUri:(F=L.desktop)!=null&&F.getUri?()=>d(L,L.desktop.getUri):void 0,getMobileUri:(U=L.mobile)!=null&&U.getUri?()=>{var ne;return d(L,(ne=L.mobile)==null?void 0:ne.getUri)}:void 0,recent:X,showWalletConnectModal:L.walletConnectModalConnector?()=>u(L.walletConnectModalConnector):void 0})}return I}var BRe=async()=>(await Jr(async()=>{const{default:e}=await import("./assets-NU2OP443-COMs-Mo6.js");return{default:e}},[])).default,ROt=()=>J0(BRe),LOt=()=>Se.createElement(Ec,{background:"#d0d5de",borderRadius:"10",height:"48",src:BRe,width:"48"}),$Re=async()=>(await Jr(async()=>{const{default:e}=await import("./login-CWDTIDNK-DhDUYE4b.js");return{default:e}},[])).default,DOt=()=>J0($Re),BOt=()=>Se.createElement(Ec,{background:"#d0d5de",borderRadius:"10",height:"48",src:$Re,width:"48"}),ks=Se.forwardRef(({as:e="div",children:t,className:n,color:r,display:s,font:a="body",id:o,size:l="16",style:c,tabIndex:u,textAlign:d="inherit",weight:f="regular",testId:x},g)=>Se.createElement(jn,{as:e,className:n,color:r,display:s,fontFamily:a,fontSize:l,fontWeight:f,id:o,ref:g,style:c,tabIndex:u,textAlign:d,testId:x},t));ks.displayName="Text";var $Ot={large:{fontSize:"16",paddingX:"24",paddingY:"10"},medium:{fontSize:"14",height:"28",paddingX:"12",paddingY:"4"},small:{fontSize:"14",paddingX:"10",paddingY:"5"}};function od({disabled:e=!1,href:t,label:n,onClick:r,rel:s="noreferrer noopener",size:a="medium",target:o="_blank",testId:l,type:c="primary"}){const u=c==="primary",d=a!=="large",f=ru(),x=e?"actionButtonSecondaryBackground":u?"accentColor":d?"actionButtonSecondaryBackground":null,{fontSize:g,height:v,paddingX:w,paddingY:C}=$Ot[a],N=!f||!d;return Se.createElement(jn,{...t?e?{}:{as:"a",href:t,rel:s,target:o}:{as:"button",type:"button"},onClick:e?void 0:r,...N?{borderColor:f&&!d&&!u?"actionButtonBorderMobile":"actionButtonBorder",borderStyle:"solid",borderWidth:"1"}:{},borderRadius:"actionButton",className:!e&&tu({active:"shrinkSm",hover:"grow"}),display:"block",paddingX:w,paddingY:C,style:{willChange:"transform"},testId:l,textAlign:"center",transition:"transform",...x?{background:x}:{},...v?{height:v}:{}},Se.createElement(ks,{color:e?"modalTextSecondary":u?"accentColorForeground":"accentColor",size:g,weight:"bold"},n))}var UOt=()=>ru()?Se.createElement("svg",{"aria-hidden":!0,fill:"none",height:"11.5",viewBox:"0 0 11.5 11.5",width:"11.5",xmlns:"http://www.w3.org/2000/svg"},Se.createElement("title",null,"Close"),Se.createElement("path",{d:"M2.13388 0.366117C1.64573 -0.122039 0.854272 -0.122039 0.366117 0.366117C-0.122039 0.854272 -0.122039 1.64573 0.366117 2.13388L3.98223 5.75L0.366117 9.36612C-0.122039 9.85427 -0.122039 10.6457 0.366117 11.1339C0.854272 11.622 1.64573 11.622 2.13388 11.1339L5.75 7.51777L9.36612 11.1339C9.85427 11.622 10.6457 11.622 11.1339 11.1339C11.622 10.6457 11.622 9.85427 11.1339 9.36612L7.51777 5.75L11.1339 2.13388C11.622 1.64573 11.622 0.854272 11.1339 0.366117C10.6457 -0.122039 9.85427 -0.122039 9.36612 0.366117L5.75 3.98223L2.13388 0.366117Z",fill:"currentColor"})):Se.createElement("svg",{"aria-hidden":!0,fill:"none",height:"10",viewBox:"0 0 10 10",width:"10",xmlns:"http://www.w3.org/2000/svg"},Se.createElement("title",null,"Close"),Se.createElement("path",{d:"M1.70711 0.292893C1.31658 -0.0976311 0.683417 -0.0976311 0.292893 0.292893C-0.0976311 0.683417 -0.0976311 1.31658 0.292893 1.70711L3.58579 5L0.292893 8.29289C-0.0976311 8.68342 -0.0976311 9.31658 0.292893 9.70711C0.683417 10.0976 1.31658 10.0976 1.70711 9.70711L5 6.41421L8.29289 9.70711C8.68342 10.0976 9.31658 10.0976 9.70711 9.70711C10.0976 9.31658 10.0976 8.68342 9.70711 8.29289L6.41421 5L9.70711 1.70711C10.0976 1.31658 10.0976 0.683417 9.70711 0.292893C9.31658 -0.0976311 8.68342 -0.0976311 8.29289 0.292893L5 3.58579L1.70711 0.292893Z",fill:"currentColor"})),z3=({"aria-label":e="Close",onClose:t})=>{const n=ru();return Se.createElement(jn,{alignItems:"center","aria-label":e,as:"button",background:"closeButtonBackground",borderColor:"actionButtonBorder",borderRadius:"full",borderStyle:"solid",borderWidth:n?"0":"1",className:tu({active:"shrinkSm",hover:"growLg"}),color:"closeButton",display:"flex",height:n?"30":"28",justifyContent:"center",onClick:t,style:{willChange:"transform"},transition:"default",type:"button",width:n?"30":"28"},Se.createElement(UOt,null))},URe=async()=>(await Jr(async()=>{const{default:e}=await import("./sign-A7IJEUT5-CGsRnPrd.js");return{default:e}},[])).default;function zOt({onClose:e,onCloseModal:t}){const{i18n:n}=m.useContext(nc),[{status:r,...s},a]=Se.useState({status:"idle"}),o=xFt(),l=m.useCallback(async()=>{try{const v=await o.getNonce();a(w=>({...w,nonce:v}))}catch{a(v=>({...v,errorMessage:n.t("sign_in.message.preparing_error"),status:"idle"}))}},[o,n.t]),c=m.useRef(!1);Se.useEffect(()=>{c.current||(c.current=!0,l())},[l]);const u=ru(),{address:d,chain:f}=Yr(),{signMessageAsync:x}=g_e(),g=async()=>{try{const v=f==null?void 0:f.id,{nonce:w}=s;if(!d||!v||!w)return;a(I=>({...I,errorMessage:void 0,status:"signing"}));const C=o.createMessage({address:d,chainId:v,nonce:w});let N;try{N=await x({message:C})}catch(I){return I instanceof mo?a(P=>({...P,status:"idle"})):a(P=>({...P,errorMessage:n.t("sign_in.signature.signing_error"),status:"idle"}))}a(I=>({...I,status:"verifying"}));try{if(await o.verify({message:C,signature:N})){t();return}throw new Error}catch{return a(I=>({...I,errorMessage:n.t("sign_in.signature.verifying_error"),status:"idle"}))}}catch{a({errorMessage:n.t("sign_in.signature.oops_error"),status:"idle"})}};return Se.createElement(jn,{position:"relative"},Se.createElement(jn,{display:"flex",paddingRight:"16",paddingTop:"16",position:"absolute",right:"0"},Se.createElement(z3,{onClose:e})),Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",gap:u?"32":"24",padding:"24",paddingX:"18",style:{paddingTop:u?"60px":"36px"}},Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",gap:u?"6":"4",style:{maxWidth:u?320:280}},Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",gap:u?"32":"16"},Se.createElement(Ec,{height:40,src:URe,width:40}),Se.createElement(ks,{color:"modalText",size:u?"20":"18",textAlign:"center",weight:"heavy"},n.t("sign_in.label"))),Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",gap:u?"16":"12"},Se.createElement(ks,{color:"modalTextSecondary",size:u?"16":"14",textAlign:"center"},n.t("sign_in.description")),r==="idle"&&s.errorMessage?Se.createElement(ks,{color:"error",size:u?"16":"14",textAlign:"center",weight:"bold"},s.errorMessage):null)),Se.createElement(jn,{alignItems:u?void 0:"center",display:"flex",flexDirection:"column",gap:"8",width:"full"},Se.createElement(od,{disabled:!s.nonce||r==="signing"||r==="verifying",label:s.nonce?r==="signing"?n.t("sign_in.signature.waiting"):r==="verifying"?n.t("sign_in.signature.verifying"):n.t("sign_in.message.send"):n.t("sign_in.message.preparing"),onClick:g,size:u?"large":"medium",testId:"auth-message-button"}),u?Se.createElement(od,{label:"Cancel",onClick:e,size:"large",type:"secondary"}):Se.createElement(jn,{as:"button",borderRadius:"full",className:tu({active:"shrink",hover:"grow"}),display:"block",onClick:e,paddingX:"10",paddingY:"5",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},Se.createElement(ks,{color:"closeButton",size:u?"16":"14",weight:"bold"},n.t("sign_in.message.cancel"))))))}function HOt(){const e=$A(),t=JE(),n=A$()==="unauthenticated",r=m.useCallback(()=>{J0(...t.map(s=>s.iconUrl),...e.map(s=>s.iconUrl).filter(ARe)),ru()||(ROt(),DOt()),n&&J0(URe)},[t,e,n]);m.useEffect(()=>{r()},[r])}var zRe="WALLETCONNECT_DEEPLINK_CHOICE";function VOt({mobileUri:e,name:t}){localStorage.setItem(zRe,JSON.stringify({href:e.split("?")[0],name:t}))}function WOt(){localStorage.removeItem(zRe)}var HRe=m.createContext(void 0),Jee="data-rk",VRe=e=>({[Jee]:e||""}),qOt=e=>{if(e&&!/^[a-zA-Z0-9_]+$/.test(e))throw new Error(`Invalid ID: ${e}`);return e?`[${Jee}="${e}"]`:`[${Jee}]`},GOt=()=>{const e=m.useContext(HRe);return VRe(e)},KOt=aMe();function YOt({appInfo:e,avatar:t,children:n,coolMode:r=!1,id:s,initialChain:a,locale:o,modalSize:l=aT.WIDE,showRecentTransactions:c=!1,theme:u=KOt}){if(HOt(),vOt(),e_e({onDisconnect:WOt}),typeof u=="function")throw new Error('A theme function was provided to the "theme" prop instead of a theme object. You must execute this function to get the resulting theme object.');const d=qOt(s),f={...FRe,...e},x=t??SRe;return Se.createElement(HFt,{initialChain:a},Se.createElement(xOt,null,Se.createElement(FFt,{locale:o},Se.createElement(ORe.Provider,{value:r},Se.createElement(gOt,{modalSize:l},Se.createElement(ale.Provider,{value:c},Se.createElement(hOt,null,Se.createElement(NRe.Provider,{value:x},Se.createElement(sT.Provider,{value:f},Se.createElement(HRe.Provider,{value:s},Se.createElement(qFt,null,Se.createElement(uRt,null,u?Se.createElement("div",{...VRe(s)},Se.createElement("style",{dangerouslySetInnerHTML:{__html:[`${d}{${dbe("lightMode"in u?u.lightMode:u)}}`,"darkMode"in u?`@media(prefers-color-scheme:dark){${d}{${dbe(u.darkMode,{extends:u.lightMode})}}}`:null].join("")}}),n):n))))))))))))}var XOt="_9pm4ki5 ju367va ju367v15 ju367v8r",QOt="_9pm4ki3 ju367v9h ju367vb3 ju367va ju367v2q ju367v8q",hbe=(e,t)=>{const n=e.querySelectorAll("button:not(:disabled), a[href]");n.length!==0&&n[t==="end"?n.length-1:0].focus()};function ZOt(e){const t=m.useRef(null);return m.useEffect(()=>{const n=document.activeElement;return()=>{var r;(r=n.focus)==null||r.call(n)}},[]),m.useEffect(()=>{if(t.current){const n=t.current.querySelector("[data-auto-focus]");n?n.focus():t.current.focus()}},[]),Se.createElement(Se.Fragment,null,Se.createElement("div",{onFocus:m.useCallback(()=>t.current&&hbe(t.current,"end"),[]),tabIndex:0}),Se.createElement("div",{ref:t,style:{outline:"none"},tabIndex:-1,...e}),Se.createElement("div",{onFocus:m.useCallback(()=>t.current&&hbe(t.current,"start"),[]),tabIndex:0}))}var JOt=e=>e.stopPropagation();function MR({children:e,onClose:t,open:n,titleId:r}){m.useEffect(()=>{const u=d=>n&&d.key==="Escape"&&t();return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[n,t]);const[s,a]=m.useState(!0);m.useEffect(()=>{a(getComputedStyle(window.document.body).overflow!=="hidden")},[]);const o=m.useCallback(()=>t(),[t]),l=GOt(),c=ru();return Se.createElement(Se.Fragment,null,n?Ia.createPortal(Se.createElement(hRe,{enabled:s},Se.createElement(jn,{...l},Se.createElement(jn,{...l,alignItems:c?"flex-end":"center","aria-labelledby":r,"aria-modal":!0,className:QOt,onClick:o,position:"fixed",role:"dialog"},Se.createElement(ZOt,{className:XOt,onClick:JOt,role:"document"},e)))),document.body):null)}var eMt="_1ckjpok7",tMt="_1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r",nMt="_1ckjpok4 _1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r",rMt="_1ckjpok6 ju367vq",sMt="_1ckjpok3 _1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r",iMt="_1ckjpok2 _1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r";function RR({bottomSheetOnMobile:e=!1,children:t,marginTop:n,padding:r="16",paddingBottom:s,wide:a=!1}){const o=ru(),c=m.useContext(j$)===aT.COMPACT;return Se.createElement(jn,{marginTop:n},Se.createElement(jn,{className:[a?o?iMt:c?nMt:sMt:tMt,o?rMt:null,o&&e?eMt:null].join(" ")},Se.createElement(jn,{padding:r,paddingBottom:s??r},t)))}var pbe=["k","m","b","t"];function gP(e,t=1){return e.toString().replace(new RegExp(`(.+\\.\\d{${t}})\\d+`),"$1").replace(/(\.[1-9]*)0+$/,"$1").replace(/\.$/,"")}function WRe(e){if(e<1)return gP(e,3);if(e<10**2)return gP(e,2);if(e<10**4)return new Intl.NumberFormat().format(Number.parseFloat(gP(e,1)));const t=10**1;let n=String(e);for(let r=pbe.length-1;r>=0;r--){const s=10**((r+1)*3);if(s<=e){e=e*t/s/t,n=gP(e,1)+pbe[r];break}}return n}function qRe(e){return e.length<8?e:`${e.substring(0,4)}…${e.substring(e.length-4)}`}function GRe(e){if(!e)return"";const t=e.split("."),n=t.pop();return t.join(".").length>24?`${t.join(".").substring(0,24)}...`:`${t.join(".")}.${n}`}var aMt=()=>Se.createElement("svg",{fill:"none",height:"13",viewBox:"0 0 13 13",width:"13",xmlns:"http://www.w3.org/2000/svg"},Se.createElement("title",null,"Copied"),Se.createElement("path",{d:"M4.94568 12.2646C5.41052 12.2646 5.77283 12.0869 6.01892 11.7109L12.39 1.96973C12.5677 1.69629 12.6429 1.44336 12.6429 1.2041C12.6429 0.561523 12.1644 0.0966797 11.5082 0.0966797C11.057 0.0966797 10.7767 0.260742 10.5033 0.691406L4.9115 9.50977L2.07458 5.98926C1.82166 5.68848 1.54822 5.55176 1.16541 5.55176C0.502319 5.55176 0.0238037 6.02344 0.0238037 6.66602C0.0238037 6.95312 0.112671 7.20605 0.358765 7.48633L3.88611 11.7588C4.18005 12.1074 4.50818 12.2646 4.94568 12.2646Z",fill:"currentColor"})),oMt=()=>Se.createElement("svg",{fill:"none",height:"16",viewBox:"0 0 17 16",width:"17",xmlns:"http://www.w3.org/2000/svg"},Se.createElement("title",null,"Copy"),Se.createElement("path",{d:"M3.04236 12.3027H4.18396V13.3008C4.18396 14.8525 5.03845 15.7002 6.59705 15.7002H13.6244C15.183 15.7002 16.0375 14.8525 16.0375 13.3008V6.24609C16.0375 4.69434 15.183 3.84668 13.6244 3.84668H12.4828V2.8418C12.4828 1.29688 11.6283 0.442383 10.0697 0.442383H3.04236C1.48376 0.442383 0.629272 1.29004 0.629272 2.8418V9.90332C0.629272 11.4551 1.48376 12.3027 3.04236 12.3027ZM3.23376 10.5391C2.68689 10.5391 2.39294 10.2656 2.39294 9.68457V3.06055C2.39294 2.47949 2.68689 2.21289 3.23376 2.21289H9.8783C10.4252 2.21289 10.7191 2.47949 10.7191 3.06055V3.84668H6.59705C5.03845 3.84668 4.18396 4.69434 4.18396 6.24609V10.5391H3.23376ZM6.78845 13.9365C6.24158 13.9365 5.94763 13.6699 5.94763 13.0889V6.45801C5.94763 5.87695 6.24158 5.61035 6.78845 5.61035H13.433C13.9799 5.61035 14.2738 5.87695 14.2738 6.45801V13.0889C14.2738 13.6699 13.9799 13.9365 13.433 13.9365H6.78845Z",fill:"currentColor"})),lMt=()=>Se.createElement("svg",{fill:"none",height:"16",viewBox:"0 0 18 16",width:"18",xmlns:"http://www.w3.org/2000/svg"},Se.createElement("title",null,"Disconnect"),Se.createElement("path",{d:"M2.67834 15.5908H9.99963C11.5514 15.5908 12.399 14.7432 12.399 13.1777V10.2656H10.6354V12.9863C10.6354 13.5332 10.3688 13.8271 9.78772 13.8271H2.89026C2.3092 13.8271 2.0426 13.5332 2.0426 12.9863V3.15625C2.0426 2.60254 2.3092 2.30859 2.89026 2.30859H9.78772C10.3688 2.30859 10.6354 2.60254 10.6354 3.15625V5.89746H12.399V2.95801C12.399 1.39941 11.5514 0.544922 9.99963 0.544922H2.67834C1.12659 0.544922 0.278931 1.39941 0.278931 2.95801V13.1777C0.278931 14.7432 1.12659 15.5908 2.67834 15.5908ZM7.43616 8.85059H14.0875L15.0924 8.78906L14.566 9.14453L13.6842 9.96484C13.5406 10.1016 13.4586 10.2861 13.4586 10.4844C13.4586 10.8398 13.7321 11.168 14.1217 11.168C14.3199 11.168 14.4635 11.0928 14.6002 10.9561L16.7809 8.68652C16.986 8.48145 17.0543 8.27637 17.0543 8.06445C17.0543 7.85254 16.986 7.64746 16.7809 7.43555L14.6002 5.17285C14.4635 5.03613 14.3199 4.9541 14.1217 4.9541C13.7321 4.9541 13.4586 5.27539 13.4586 5.6377C13.4586 5.83594 13.5406 6.02734 13.6842 6.15723L14.566 6.98438L15.0924 7.33984L14.0875 7.27148H7.43616C7.01917 7.27148 6.65686 7.62012 6.65686 8.06445C6.65686 8.50195 7.01917 8.85059 7.43616 8.85059Z",fill:"currentColor"}));function cMt(){const e=IRe(),{address:t}=Yr(),n=ile();return m.useCallback(()=>{if(!t||!n)throw new Error("No address or chain ID found");e.clearTransactions(t,n)},[e,t,n])}var KRe=e=>{var t,n;return(n=(t=e==null?void 0:e.blockExplorers)==null?void 0:t.default)==null?void 0:n.url},YRe=()=>Se.createElement("svg",{fill:"none",height:"19",viewBox:"0 0 20 19",width:"20",xmlns:"http://www.w3.org/2000/svg"},Se.createElement("title",null,"Link"),Se.createElement("path",{d:"M10 18.9443C15.0977 18.9443 19.2812 14.752 19.2812 9.6543C19.2812 4.56543 15.0889 0.373047 10 0.373047C4.90234 0.373047 0.71875 4.56543 0.71875 9.6543C0.71875 14.752 4.91113 18.9443 10 18.9443ZM10 16.6328C6.1416 16.6328 3.03906 13.5215 3.03906 9.6543C3.03906 5.7959 6.13281 2.68457 10 2.68457C13.8584 2.68457 16.9697 5.7959 16.9697 9.6543C16.9785 13.5215 13.8672 16.6328 10 16.6328ZM12.7158 12.1416C13.2432 12.1416 13.5684 11.7549 13.5684 11.1836V7.19336C13.5684 6.44629 13.1377 6.05957 12.417 6.05957H8.40918C7.8291 6.05957 7.45117 6.38477 7.45117 6.91211C7.45117 7.43945 7.8291 7.77344 8.40918 7.77344H9.69238L10.7207 7.63281L9.53418 8.67871L6.73047 11.4912C6.53711 11.6758 6.41406 11.9395 6.41406 12.2031C6.41406 12.7832 6.85352 13.1699 7.39844 13.1699C7.68848 13.1699 7.92578 13.0732 8.1543 12.8623L10.9316 10.0762L11.9775 8.89844L11.8545 9.98828V11.1836C11.8545 11.7725 12.1885 12.1416 12.7158 12.1416Z",fill:"currentColor"})),uMt=()=>Se.createElement("svg",{fill:"none",height:"19",viewBox:"0 0 20 19",width:"20",xmlns:"http://www.w3.org/2000/svg"},Se.createElement("title",null,"Cancel"),Se.createElement("path",{d:"M10 18.9443C15.0977 18.9443 19.2812 14.752 19.2812 9.6543C19.2812 4.56543 15.0889 0.373047 10 0.373047C4.90234 0.373047 0.71875 4.56543 0.71875 9.6543C0.71875 14.752 4.91113 18.9443 10 18.9443ZM10 16.6328C6.1416 16.6328 3.03906 13.5215 3.03906 9.6543C3.03906 5.7959 6.13281 2.68457 10 2.68457C13.8584 2.68457 16.9697 5.7959 16.9697 9.6543C16.9785 13.5215 13.8672 16.6328 10 16.6328ZM7.29297 13.3018C7.58301 13.3018 7.81152 13.2139 7.99609 13.0205L10 11.0166L12.0127 13.0205C12.1973 13.2051 12.4258 13.3018 12.707 13.3018C13.2432 13.3018 13.6562 12.8887 13.6562 12.3525C13.6562 12.0977 13.5508 11.8691 13.3662 11.6934L11.3535 9.67188L13.375 7.6416C13.5596 7.44824 13.6562 7.22852 13.6562 6.98242C13.6562 6.44629 13.2432 6.0332 12.7158 6.0332C12.4346 6.0332 12.2148 6.12109 12.0215 6.31445L10 8.32715L7.9873 6.32324C7.80273 6.12988 7.58301 6.04199 7.29297 6.04199C6.76562 6.04199 6.35254 6.45508 6.35254 6.99121C6.35254 7.2373 6.44922 7.46582 6.63379 7.6416L8.65527 9.67188L6.63379 11.6934C6.44922 11.8691 6.35254 12.1064 6.35254 12.3525C6.35254 12.8887 6.76562 13.3018 7.29297 13.3018Z",fill:"currentColor"})),dMt=()=>Se.createElement("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},Se.createElement("title",null,"Success"),Se.createElement("path",{d:"M10 19.4443C15.0977 19.4443 19.2812 15.252 19.2812 10.1543C19.2812 5.06543 15.0889 0.873047 10 0.873047C4.90234 0.873047 0.71875 5.06543 0.71875 10.1543C0.71875 15.252 4.91113 19.4443 10 19.4443ZM10 17.1328C6.1416 17.1328 3.03906 14.0215 3.03906 10.1543C3.03906 6.2959 6.13281 3.18457 10 3.18457C13.8584 3.18457 16.9697 6.2959 16.9697 10.1543C16.9785 14.0215 13.8672 17.1328 10 17.1328ZM9.07715 14.3379C9.4375 14.3379 9.7627 14.1533 9.97363 13.8369L13.7441 8.00977C13.8848 7.79883 13.9814 7.5791 13.9814 7.36816C13.9814 6.84961 13.5244 6.48926 13.0322 6.48926C12.707 6.48926 12.4258 6.66504 12.2148 7.0166L9.05957 12.0967L7.5918 10.2949C7.37207 10.0225 7.13477 9.9082 6.84473 9.9082C6.33496 9.9082 5.92188 10.3125 5.92188 10.8223C5.92188 11.0684 6.00098 11.2793 6.18555 11.5078L8.1543 13.8545C8.40918 14.1709 8.70801 14.3379 9.07715 14.3379Z",fill:"currentColor"})),fMt=e=>{switch(e){case"pending":return ZE;case"confirmed":return dMt;case"failed":return uMt;default:return ZE}};function hMt({tx:e}){const t=ru(),n=fMt(e.status),r=e.status==="failed"?"error":"accentColor",{chain:s}=Yr(),a=e.status==="confirmed"?"Confirmed":e.status==="failed"?"Failed":"Pending",o=KRe(s);return Se.createElement(Se.Fragment,null,Se.createElement(jn,{...o?{as:"a",background:{hover:"profileForeground"},borderRadius:"menuButton",className:tu({active:"shrink"}),href:`${o}/tx/${e.hash}`,rel:"noreferrer noopener",target:"_blank",transition:"default"}:{},color:"modalText",display:"flex",flexDirection:"row",justifyContent:"space-between",padding:"8",width:"full"},Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"row",gap:t?"16":"14"},Se.createElement(jn,{color:r},Se.createElement(n,null)),Se.createElement(jn,{display:"flex",flexDirection:"column",gap:t?"3":"1"},Se.createElement(jn,null,Se.createElement(ks,{color:"modalText",font:"body",size:t?"16":"14",weight:"bold"},e==null?void 0:e.description)),Se.createElement(jn,null,Se.createElement(ks,{color:e.status==="pending"?"modalTextSecondary":r,font:"body",size:"14",weight:t?"medium":"regular"},a)))),o&&Se.createElement(jn,{alignItems:"center",color:"modalTextDim",display:"flex"},Se.createElement(YRe,null))))}var pMt=3;function mMt({address:e}){const t=PRe(),n=cMt(),{chain:r}=Yr(),s=KRe(r),a=t.slice(0,pMt),o=a.length>0,l=ru(),{appName:c}=m.useContext(sT),{i18n:u}=m.useContext(nc);return Se.createElement(Se.Fragment,null,Se.createElement(jn,{display:"flex",flexDirection:"column",gap:"10",paddingBottom:"2",paddingTop:"16",paddingX:l?"8":"18"},o&&Se.createElement(jn,{paddingBottom:l?"4":"0",paddingTop:"8",paddingX:l?"12":"6"},Se.createElement(jn,{display:"flex",justifyContent:"space-between"},Se.createElement(ks,{color:"modalTextSecondary",size:l?"16":"14",weight:"semibold"},u.t("profile.transactions.recent.title")),Se.createElement(jn,{style:{marginBottom:-6,marginLeft:-10,marginRight:-10,marginTop:-6}},Se.createElement(jn,{as:"button",background:{hover:"profileForeground"},borderRadius:"actionButton",className:tu({active:"shrink"}),onClick:n,paddingX:l?"8":"12",paddingY:l?"4":"5",transition:"default",type:"button"},Se.createElement(ks,{color:"modalTextSecondary",size:l?"16":"14",weight:"semibold"},u.t("profile.transactions.clear.label")))))),Se.createElement(jn,{display:"flex",flexDirection:"column",gap:"4"},o?a.map(d=>Se.createElement(hMt,{key:d.hash,tx:d})):Se.createElement(Se.Fragment,null,Se.createElement(jn,{padding:l?"12":"8"},Se.createElement(ks,{color:"modalTextDim",size:l?"16":"14",weight:l?"medium":"bold"},c?u.t("profile.transactions.description",{appName:c}):u.t("profile.transactions.description_fallback"))),l&&Se.createElement(jn,{background:"generalBorderDim",height:"1",marginX:"12",marginY:"8"})))),s&&Se.createElement(jn,{paddingBottom:"18",paddingX:l?"8":"18"},Se.createElement(jn,{alignItems:"center",as:"a",background:{hover:"profileForeground"},borderRadius:"menuButton",className:tu({active:"shrink"}),color:"modalTextDim",display:"flex",flexDirection:"row",href:`${s}/address/${e}`,justifyContent:"space-between",paddingX:"8",paddingY:"12",rel:"noreferrer noopener",style:{willChange:"transform"},target:"_blank",transition:"default",width:"full",...l?{paddingLeft:"12"}:{}},Se.createElement(ks,{color:"modalText",font:"body",size:l?"16":"14",weight:l?"semibold":"bold"},u.t("profile.explorer.label")),Se.createElement(YRe,null))))}function mbe({action:e,icon:t,label:n,testId:r,url:s}){const a=ru();return Se.createElement(jn,{...s?{as:"a",href:s,rel:"noreferrer noopener",target:"_blank"}:{as:"button",type:"button"},background:{base:"profileAction",...a?{}:{hover:"profileActionHover"}},borderRadius:"menuButton",boxShadow:"profileDetailsAction",className:tu({active:"shrinkSm",hover:a?void 0:"grow"}),display:"flex",onClick:e,padding:a?"6":"8",style:{willChange:"transform"},testId:r,transition:"default",width:"full"},Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"1",justifyContent:"center",paddingTop:"2",width:"full"},Se.createElement(jn,{color:"modalText",height:"max"},t),Se.createElement(jn,null,Se.createElement(ks,{color:"modalText",size:a?"12":"13",weight:"semibold"},n))))}function xMt({address:e,ensAvatar:t,ensName:n,balance:r,onClose:s,onDisconnect:a}){const o=m.useContext(ale),[l,c]=m.useState(!1),u=m.useCallback(()=>{e&&(navigator.clipboard.writeText(e),c(!0))},[e]);if(m.useEffect(()=>{if(l){const C=setTimeout(()=>{c(!1)},1500);return()=>clearTimeout(C)}},[l]),!e)return null;const d=n?GRe(n):qRe(e),f=r==null?void 0:r.formatted,x=f?WRe(Number.parseFloat(f)):void 0,g="rk_profile_title",v=ru(),{i18n:w}=m.useContext(nc);return Se.createElement(Se.Fragment,null,Se.createElement(jn,{display:"flex",flexDirection:"column"},Se.createElement(jn,{background:"profileForeground",padding:"16"},Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",gap:v?"16":"12",justifyContent:"center",margin:"8",style:{textAlign:"center"}},Se.createElement(jn,{style:{position:"absolute",right:16,top:16,willChange:"transform"}},Se.createElement(z3,{onClose:s}))," ",Se.createElement(jn,{marginTop:v?"24":"0"},Se.createElement(kFt,{address:e,imageUrl:t,size:v?82:74})),Se.createElement(jn,{display:"flex",flexDirection:"column",gap:v?"4":"0",textAlign:"center"},Se.createElement(jn,{textAlign:"center"},Se.createElement(ks,{as:"h1",color:"modalText",id:g,size:v?"20":"18",weight:"heavy"},d)),!!r&&Se.createElement(jn,{textAlign:"center"},Se.createElement(ks,{as:"h1",color:"modalTextSecondary",id:g,size:v?"16":"14",weight:"semibold"},x," ",r.symbol)))),Se.createElement(jn,{display:"flex",flexDirection:"row",gap:"8",margin:"2",marginTop:"16"},Se.createElement(mbe,{action:u,icon:l?Se.createElement(aMt,null):Se.createElement(oMt,null),label:l?w.t("profile.copy_address.copied"):w.t("profile.copy_address.label")}),Se.createElement(mbe,{action:a,icon:Se.createElement(lMt,null),label:w.t("profile.disconnect.label"),testId:"disconnect-button"}))),o&&Se.createElement(Se.Fragment,null,Se.createElement(jn,{background:"generalBorder",height:"1",marginTop:"-1"}),Se.createElement(jn,null,Se.createElement(mMt,{address:e})))))}function gMt({onClose:e,open:t}){const{address:n}=Yr(),{balance:r,ensAvatar:s,ensName:a}=_Re({address:n,includeBalance:t}),{disconnect:o}=vB();return n?Se.createElement(Se.Fragment,null,n&&Se.createElement(MR,{onClose:e,open:t,titleId:"rk_account_modal_title"},Se.createElement(RR,{bottomSheetOnMobile:!0,padding:"0"},Se.createElement(xMt,{address:n,ensAvatar:s,ensName:a,balance:r,onClose:e,onDisconnect:o})))):null}var bMt=({size:e})=>Se.createElement("svg",{fill:"none",height:e,viewBox:"0 0 28 28",width:e,xmlns:"http://www.w3.org/2000/svg"},Se.createElement("title",null,"Disconnect"),Se.createElement("path",{d:"M6.742 22.195h8.367c1.774 0 2.743-.968 2.743-2.758V16.11h-2.016v3.11c0 .625-.305.96-.969.96H6.984c-.664 0-.968-.335-.968-.96V7.984c0-.632.304-.968.968-.968h7.883c.664 0 .969.336.969.968v3.133h2.016v-3.36c0-1.78-.97-2.757-2.743-2.757H6.742C4.97 5 4 5.977 4 7.758v11.68c0 1.789.969 2.757 2.742 2.757Zm5.438-7.703h7.601l1.149-.07-.602.406-1.008.938a.816.816 0 0 0-.258.593c0 .407.313.782.758.782.227 0 .39-.086.547-.243l2.492-2.593c.235-.235.313-.47.313-.711 0-.242-.078-.477-.313-.719l-2.492-2.586c-.156-.156-.32-.25-.547-.25-.445 0-.758.367-.758.781 0 .227.094.446.258.594l1.008.945.602.407-1.149-.079H12.18a.904.904 0 0 0 0 1.805Z",fill:"currentColor"})),yMt="v9horb0",dle=Se.forwardRef(({children:e,currentlySelected:t=!1,onClick:n,testId:r,...s},a)=>{const o=ru();return Se.createElement(jn,{as:"button",borderRadius:"menuButton",disabled:t,display:"flex",onClick:n,ref:a,testId:r,type:"button"},Se.createElement(jn,{borderRadius:"menuButton",className:[o?yMt:void 0,!t&&tu({active:"shrink"})],padding:o?"8":"6",transition:"default",width:"full",...t?{background:"accentColor",borderColor:"selectedOptionBorder",borderStyle:"solid",borderWidth:"1",boxShadow:"selectedOption",color:"accentColorForeground"}:{background:{hover:"menuItemBackground"},color:"modalText",transition:"default"},...s},e))});dle.displayName="MenuButton";var vMt=({chainId:e,currentChainId:t,switchChain:n,chainIconSize:r,isLoading:s,src:a,name:o,iconBackground:l,idx:c})=>{const u=ru(),{i18n:d}=m.useContext(nc),f=$A(),x=t===e;return Se.createElement(m.Fragment,null,Se.createElement(dle,{currentlySelected:x,onClick:x?void 0:()=>n({chainId:e}),testId:`chain-option-${e}`},Se.createElement(jn,{fontFamily:"body",fontSize:"16",fontWeight:"bold"},Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"space-between"},Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"4",height:r},a&&Se.createElement(jn,{height:"full",marginRight:"8"},Se.createElement(Ec,{alt:o,background:l,borderRadius:"full",height:r,src:a,width:r,testId:`chain-option-${e}-icon`})),Se.createElement("div",null,o??o)),x&&Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"row",marginRight:"6"},Se.createElement(ks,{color:"accentColorForeground",size:"14",weight:"medium"},d.t("chains.connected")),Se.createElement(jn,{background:"connectionIndicator",borderColor:"selectedOptionBorder",borderRadius:"full",borderStyle:"solid",borderWidth:"1",height:"8",marginLeft:"8",width:"8"})),s&&Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"row",marginRight:"6"},Se.createElement(ks,{color:"modalText",size:"14",weight:"medium"},d.t("chains.confirm")),Se.createElement(jn,{background:"standby",borderRadius:"full",height:"8",marginLeft:"8",width:"8"}))))),u&&c<f.length-1&&Se.createElement(jn,{background:"generalBorderDim",height:"1",marginX:"8"}))},wMt=vMt,CMt="_18dqw9x0",SMt="_18dqw9x1";function NMt({onClose:e,open:t}){const{chainId:n}=Yr(),{chains:r}=wl(),[s,a]=m.useState(null),{switchChain:o}=Vie({mutation:{onMutate:({chainId:v})=>{a(v)},onSuccess:()=>{s&&a(null)},onError:()=>{s&&a(null)},onSettled:()=>{e()}}}),{i18n:l}=m.useContext(nc),{disconnect:c}=vB(),u="rk_chain_modal_title",d=ru(),f=r.some(v=>v.id===n),x=d?"36":"28",g=$A();return n?Se.createElement(MR,{onClose:e,open:t,titleId:u},Se.createElement(RR,{bottomSheetOnMobile:!0,paddingBottom:"0"},Se.createElement(jn,{display:"flex",flexDirection:"column",gap:"14"},Se.createElement(jn,{display:"flex",flexDirection:"row",justifyContent:"space-between"},d&&Se.createElement(jn,{width:"30"}),Se.createElement(jn,{paddingBottom:"0",paddingLeft:"8",paddingTop:"4"},Se.createElement(ks,{as:"h1",color:"modalText",id:u,size:d?"20":"18",weight:"heavy"},l.t("chains.title"))),Se.createElement(z3,{onClose:e})),!f&&Se.createElement(jn,{marginX:"8",textAlign:d?"center":"left"},Se.createElement(ks,{color:"modalTextSecondary",size:"14",weight:"medium"},l.t("chains.wrong_network"))),Se.createElement(jn,{className:d?SMt:CMt,display:"flex",flexDirection:"column",gap:"4",padding:"2",paddingBottom:"16"},g.map(({iconBackground:v,iconUrl:w,id:C,name:N},I)=>Se.createElement(wMt,{key:C,chainId:C,currentChainId:n,switchChain:o,chainIconSize:x,isLoading:s===C,src:w,name:N,iconBackground:v,idx:I})),!f&&Se.createElement(Se.Fragment,null,Se.createElement(jn,{background:"generalBorderDim",height:"1",marginX:"8"}),Se.createElement(dle,{onClick:()=>c(),testId:"chain-option-disconnect"},Se.createElement(jn,{color:"error",fontFamily:"body",fontSize:"16",fontWeight:"bold"},Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"space-between"},Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"4",height:x},Se.createElement(jn,{alignItems:"center",color:"error",height:x,justifyContent:"center",marginRight:"8"},Se.createElement(bMt,{size:Number(x)})),Se.createElement("div",null,l.t("chains.disconnect"))))))))))):null}function AMt(e,t){const n={};for(const r of e){const s=t(r);s&&(n[s]||(n[s]=[]),n[s].push(r))}return n}var fle=({children:e,href:t})=>Se.createElement(jn,{as:"a",color:"accentColor",href:t,rel:"noreferrer",target:"_blank"},e),hle=({children:e})=>Se.createElement(ks,{color:"modalTextSecondary",size:"12",weight:"medium"},e);function xbe({compactModeEnabled:e=!1,getWallet:t}){const{disclaimer:n,learnMoreUrl:r}=m.useContext(sT),{i18n:s}=m.useContext(nc);return Se.createElement(Se.Fragment,null,Se.createElement(jn,{alignItems:"center",color:"accentColor",display:"flex",flexDirection:"column",height:"full",justifyContent:"space-around"},Se.createElement(jn,{marginBottom:"10"},!e&&Se.createElement(ks,{color:"modalText",size:"18",weight:"heavy"},s.t("intro.title"))),Se.createElement(jn,{display:"flex",flexDirection:"column",gap:"32",justifyContent:"center",marginY:"20",style:{maxWidth:312}},Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16"},Se.createElement(jn,{borderRadius:"6",height:"48",minWidth:"48",width:"48"},Se.createElement(LOt,null)),Se.createElement(jn,{display:"flex",flexDirection:"column",gap:"4"},Se.createElement(ks,{color:"modalText",size:"14",weight:"bold"},s.t("intro.digital_asset.title")),Se.createElement(ks,{color:"modalTextSecondary",size:"14",weight:"medium"},s.t("intro.digital_asset.description")))),Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16"},Se.createElement(jn,{borderRadius:"6",height:"48",minWidth:"48",width:"48"},Se.createElement(BOt,null)),Se.createElement(jn,{display:"flex",flexDirection:"column",gap:"4"},Se.createElement(ks,{color:"modalText",size:"14",weight:"bold"},s.t("intro.login.title")),Se.createElement(ks,{color:"modalTextSecondary",size:"14",weight:"medium"},s.t("intro.login.description"))))),Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",margin:"10"},Se.createElement(od,{label:s.t("intro.get.label"),onClick:t}),Se.createElement(jn,{as:"a",className:tu({active:"shrink",hover:"grow"}),display:"block",href:r,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},Se.createElement(ks,{color:"accentColor",size:"14",weight:"bold"},s.t("intro.learn_more.label")))),n&&!e&&Se.createElement(jn,{marginBottom:"8",marginTop:"12",textAlign:"center"},Se.createElement(n,{Link:fle,Text:hle}))))}var XRe=()=>Se.createElement("svg",{fill:"none",height:"17",viewBox:"0 0 11 17",width:"11",xmlns:"http://www.w3.org/2000/svg"},Se.createElement("title",null,"Back"),Se.createElement("path",{d:"M0.99707 8.6543C0.99707 9.08496 1.15527 9.44531 1.51562 9.79688L8.16016 16.3096C8.43262 16.5732 8.74902 16.7051 9.13574 16.7051C9.90918 16.7051 10.5508 16.0811 10.5508 15.3076C10.5508 14.9121 10.3838 14.5605 10.0938 14.2705L4.30176 8.64551L10.0938 3.0293C10.3838 2.74805 10.5508 2.3877 10.5508 2.00098C10.5508 1.23633 9.90918 0.603516 9.13574 0.603516C8.74902 0.603516 8.43262 0.735352 8.16016 0.999023L1.51562 7.51172C1.15527 7.85449 1.00586 8.21484 0.99707 8.6543Z",fill:"currentColor"})),jMt=()=>Se.createElement("svg",{fill:"none",height:"12",viewBox:"0 0 8 12",width:"8",xmlns:"http://www.w3.org/2000/svg"},Se.createElement("title",null,"Info"),Se.createElement("path",{d:"M3.64258 7.99609C4.19336 7.99609 4.5625 7.73828 4.68555 7.24609C4.69141 7.21094 4.70312 7.16406 4.70898 7.13477C4.80859 6.60742 5.05469 6.35547 6.04492 5.76367C7.14648 5.10156 7.67969 4.3457 7.67969 3.24414C7.67969 1.39844 6.17383 0.255859 3.95898 0.255859C2.32422 0.255859 1.05859 0.894531 0.548828 1.86719C0.396484 2.14844 0.320312 2.44727 0.320312 2.74023C0.314453 3.37305 0.742188 3.79492 1.42188 3.79492C1.91406 3.79492 2.33594 3.54883 2.53516 3.11523C2.78711 2.47656 3.23242 2.21289 3.83594 2.21289C4.55664 2.21289 5.10742 2.65234 5.10742 3.29102C5.10742 3.9707 4.7793 4.29883 3.81836 4.87891C3.02148 5.36523 2.50586 5.92773 2.50586 6.76562V6.90039C2.50586 7.55664 2.96289 7.99609 3.64258 7.99609ZM3.67188 11.4473C4.42773 11.4473 5.04297 10.8672 5.04297 10.1406C5.04297 9.41406 4.42773 8.83984 3.67188 8.83984C2.91602 8.83984 2.30664 9.41406 2.30664 10.1406C2.30664 10.8672 2.91602 11.4473 3.67188 11.4473Z",fill:"currentColor"})),EMt=({"aria-label":e="Info",onClick:t})=>{const n=ru();return Se.createElement(jn,{alignItems:"center","aria-label":e,as:"button",background:"closeButtonBackground",borderColor:"actionButtonBorder",borderRadius:"full",borderStyle:"solid",borderWidth:n?"0":"1",className:tu({active:"shrinkSm",hover:"growLg"}),color:"closeButton",display:"flex",height:n?"30":"28",justifyContent:"center",onClick:t,style:{willChange:"transform"},transition:"default",type:"button",width:n?"30":"28"},Se.createElement(jMt,null))},QRe=e=>{const t=m.useRef(null),n=m.useContext(ORe),r=rle(e);return m.useEffect(()=>{if(n&&t.current&&r)return kMt(t.current,r)},[n,r]),t},_Mt=()=>{const e="_rk_coolMode",t=document.getElementById(e);if(t)return t;const n=document.createElement("div");return n.setAttribute("id",e),n.setAttribute("style",["overflow:hidden","position:fixed","height:100%","top:0","left:0","right:0","bottom:0","pointer-events:none","z-index:2147483647"].join(";")),document.body.appendChild(n),n},gbe=0;function kMt(e,t){gbe++;const n=[15,20,25,35,45],r=35;let s=[],a=!1,o=0,l=0;const c=_Mt();function u(){const R=n[Math.floor(Math.random()*n.length)],F=Math.random()*10,U=Math.random()*25,L=Math.random()*360,z=Math.random()*35*(Math.random()<=.5?-1:1),X=l-R/2,ne=o-R/2,J=Math.random()<=.5?-1:1,Z=document.createElement("div");Z.innerHTML=`<img src="${t}" width="${R}" height="${R}" style="border-radius: 25%">`,Z.setAttribute("style",["position:absolute","will-change:transform",`top:${X}px`,`left:${ne}px`,`transform:rotate(${L}deg)`].join(";")),c.appendChild(Z),s.push({direction:J,element:Z,left:ne,size:R,speedHorz:F,speedUp:U,spinSpeed:z,spinVal:L,top:X})}function d(){for(const R of s)R.left=R.left-R.speedHorz*R.direction,R.top=R.top-R.speedUp,R.speedUp=Math.min(R.size,R.speedUp-1),R.spinVal=R.spinVal+R.spinSpeed,R.top>=Math.max(window.innerHeight,document.body.clientHeight)+R.size&&(s=s.filter(F=>F!==R),R.element.remove()),R.element.setAttribute("style",["position:absolute","will-change:transform",`top:${R.top}px`,`left:${R.left}px`,`transform:rotate(${R.spinVal}deg)`].join(";"))}let f;function x(){a&&s.length<r&&u(),d(),f=requestAnimationFrame(x)}x();const g="ontouchstart"in window||navigator.msMaxTouchPoints,v=g?"touchstart":"mousedown",w=g?"touchend":"mouseup",C=g?"touchmove":"mousemove",N=R=>{var F,U;"touches"in R?(o=(F=R.touches)==null?void 0:F[0].clientX,l=(U=R.touches)==null?void 0:U[0].clientY):(o=R.clientX,l=R.clientY)},I=R=>{N(R),a=!0},P=()=>{a=!1};return e.addEventListener(C,N,{passive:!1}),e.addEventListener(v,I),e.addEventListener(w,P),e.addEventListener("mouseleave",P),()=>{e.removeEventListener(C,N),e.removeEventListener(v,I),e.removeEventListener(w,P),e.removeEventListener("mouseleave",P);const R=setInterval(()=>{f&&s.length===0&&(cancelAnimationFrame(f),clearInterval(R),--gbe===0&&c.remove())},500)}}var TMt="g5kl0l0",ZRe=({as:e="button",currentlySelected:t=!1,iconBackground:n,iconUrl:r,name:s,onClick:a,ready:o,recent:l,testId:c,isRainbowKitConnector:u,...d})=>{const f=QRe(r),[x,g]=Se.useState(!1),{i18n:v}=Se.useContext(nc);return Se.createElement(jn,{display:"flex",flexDirection:"column",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),ref:f},Se.createElement(jn,{as:e,borderRadius:"menuButton",borderStyle:"solid",borderWidth:"1",className:t?void 0:[TMt,tu({active:"shrink"})],disabled:t,onClick:a,padding:"5",style:{willChange:"transform"},testId:c,transition:"default",width:"full",...t?{background:"accentColor",borderColor:"selectedOptionBorder",boxShadow:"selectedWallet"}:{background:{hover:"menuItemBackground"}},...d},Se.createElement(jn,{color:t?"accentColorForeground":"modalText",disabled:!o,fontFamily:"body",fontSize:"16",fontWeight:"bold",transition:"default"},Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"12"},Se.createElement(Ec,{background:n,...!x&&u?{borderColor:"actionButtonBorder"}:{},useAsImage:!u,borderRadius:"6",height:"28",src:r,width:"28"}),Se.createElement(jn,null,Se.createElement(jn,{style:{marginTop:l?-2:void 0},maxWidth:"200"},s),l&&Se.createElement(ks,{color:t?"accentColorForeground":"accentColor",size:"12",style:{lineHeight:1,marginTop:-1},weight:"medium"},v.t("connect.recent")))))))};ZRe.displayName="ModalSelection";var IMt="rk-latest-id";function PMt(e){localStorage.setItem(IMt,e)}var lW=(e,t=1)=>{let n=e.replace("#","");n.length===3&&(n=`${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`);const r=Number.parseInt(n.substring(0,2),16),s=Number.parseInt(n.substring(2,4),16),a=Number.parseInt(n.substring(4,6),16);return t>1&&t<=100&&(t=t/100),`rgba(${r},${s},${a},${t})`},FMt=e=>e?[lW(e,.2),lW(e,.14),lW(e,.1)]:null,OMt=e=>/^#([0-9a-f]{3}){1,2}$/i.test(e),JRe=async()=>(await Jr(async()=>{const{default:e}=await import("./connect-MR6XDLIE-BET5HMNk.js");return{default:e}},[])).default,MMt=()=>J0(JRe),RMt=()=>Se.createElement(Ec,{background:"#515a70",borderColor:"generalBorder",borderRadius:"10",height:"48",src:JRe,width:"48"}),eLe=async()=>(await Jr(async()=>{const{default:e}=await import("./create-X4WFHLCW-De9pC3ym.js");return{default:e}},[])).default,tLe=()=>J0(eLe),LMt=()=>Se.createElement(Ec,{background:"#e3a5e8",borderColor:"generalBorder",borderRadius:"10",height:"48",src:eLe,width:"48"}),nLe=async()=>(await Jr(async()=>{const{default:e}=await import("./refresh-HJGJRASX-D0rkc63_.js");return{default:e}},[])).default,DMt=()=>J0(nLe),BMt=()=>Se.createElement(Ec,{background:"#515a70",borderColor:"generalBorder",borderRadius:"10",height:"48",src:nLe,width:"48"}),rLe=async()=>(await Jr(async()=>{const{default:e}=await import("./scan-DEOT2M37-1-mJ5OyF.js");return{default:e}},[])).default,sLe=()=>J0(rLe),$Mt=()=>Se.createElement(Ec,{background:"#515a70",borderColor:"generalBorder",borderRadius:"10",height:"48",src:rLe,width:"48"}),UMt="_1vwt0cg0",zMt="_1vwt0cg2 ju367v7a ju367v7v",HMt="_1vwt0cg3",VMt="_1vwt0cg4",WMt=(e,t)=>{const n=Array.prototype.slice.call(lFt.create(e,{errorCorrectionLevel:t}).modules.data,0),r=Math.sqrt(n.length);return n.reduce((s,a,o)=>(o%r===0?s.push([a]):s[s.length-1].push(a))&&s,[])};function iLe({ecl:e="M",logoBackground:t,logoMargin:n=10,logoSize:r=50,logoUrl:s,size:a=200,uri:o}){const l="20",c=a-Number.parseInt(l,10)*2,u=m.useMemo(()=>{const x=[],g=WMt(o,e),v=c/g.length;[{x:0,y:0},{x:1,y:0},{x:0,y:1}].forEach(({x:P,y:R})=>{const F=(g.length-7)*v*P,U=(g.length-7)*v*R;for(let L=0;L<3;L++)x.push(Se.createElement("rect",{fill:L%2!==0?"white":"black",height:v*(7-L*2),key:`${L}-${P}-${R}`,rx:(L-2)*-5+(L===0?2:0),ry:(L-2)*-5+(L===0?2:0),width:v*(7-L*2),x:F+v*L,y:U+v*L}))});const C=Math.floor((r+25)/v),N=g.length/2-C/2,I=g.length/2+C/2-1;return g.forEach((P,R)=>{P.forEach((F,U)=>{g[R][U]&&(R<7&&U<7||R>g.length-8&&U<7||R<7&&U>g.length-8||R>N&&R<I&&U>N&&U<I||x.push(Se.createElement("circle",{cx:R*v+v/2,cy:U*v+v/2,fill:"black",key:`circle-${R}-${U}`,r:v/3})))})}),x},[e,r,c,o]),d=c/2-r/2,f=r+n*2;return Se.createElement(jn,{borderColor:"generalBorder",borderRadius:"menuButton",borderStyle:"solid",borderWidth:"1",className:UMt,padding:l,width:"max"},Se.createElement(jn,{style:{height:c,userSelect:"none",width:c},userSelect:"none"},Se.createElement(jn,{display:"flex",justifyContent:"center",position:"relative",style:{height:0,top:d,width:c},width:"full"},Se.createElement(Ec,{background:t,borderColor:{custom:"rgba(0, 0, 0, 0.06)"},borderRadius:"13",height:r,src:s,width:r})),Se.createElement("svg",{height:c,style:{all:"revert"},width:c},Se.createElement("title",null,"QR Code"),Se.createElement("defs",null,Se.createElement("clipPath",{id:"clip-wrapper"},Se.createElement("rect",{height:f,width:f})),Se.createElement("clipPath",{id:"clip-logo"},Se.createElement("rect",{height:r,width:r}))),Se.createElement("rect",{fill:"transparent",height:c,width:c}),u)))}var aLe=async()=>{switch(lle()){case"Arc":return(await Jr(async()=>{const{default:t}=await import("./Arc-R3PUWRPJ-CUdEQO8X.js");return{default:t}},[])).default;case"Brave":return(await Jr(async()=>{const{default:t}=await import("./Brave-24BM36UM-C6C5mkTK.js");return{default:t}},[])).default;case"Chrome":return(await Jr(async()=>{const{default:t}=await import("./Chrome-TLI42HDP-BgiVz-ma.js");return{default:t}},[])).default;case"Edge":return(await Jr(async()=>{const{default:t}=await import("./Edge-AZ34LAFM-EBh9cG_z.js");return{default:t}},[])).default;case"Firefox":return(await Jr(async()=>{const{default:t}=await import("./Firefox-ZDK7RHKK-5nyhB0sj.js");return{default:t}},[])).default;case"Opera":return(await Jr(async()=>{const{default:t}=await import("./Opera-BKMCKUXC-CCypmVaM.js");return{default:t}},[])).default;case"Safari":return(await Jr(async()=>{const{default:t}=await import("./Safari-PXQIVS6N-B-Lfxb9r.js");return{default:t}},[])).default;default:return(await Jr(async()=>{const{default:t}=await import("./Browser-4R4QKTV2-D3ON1q-S.js");return{default:t}},[])).default}},qMt=()=>J0(aLe),oLe=async()=>{switch(ule()){case"Windows":return(await Jr(async()=>{const{default:t}=await import("./Windows-GTAT3OTE-K9Pt3pUF.js");return{default:t}},[])).default;case"macOS":return(await Jr(async()=>{const{default:t}=await import("./Macos-5QL4JBJE-DLNYPiln.js");return{default:t}},[])).default;case"Linux":return(await Jr(async()=>{const{default:t}=await import("./Linux-VYP66PDO--MOvpQUa.js");return{default:t}},[])).default;default:return(await Jr(async()=>{const{default:t}=await import("./Linux-VYP66PDO--MOvpQUa.js");return{default:t}},[])).default}},GMt=()=>J0(oLe);function KMt({getWalletDownload:e,compactModeEnabled:t}){const r=JE().filter(a=>a.isRainbowKitConnector).splice(0,5),{i18n:s}=m.useContext(nc);return Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",marginTop:"18",width:"full"},Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"28",height:"full",width:"full"},r==null?void 0:r.filter(a=>{var o;return a.extensionDownloadUrl||a.desktopDownloadUrl||a.qrCode&&((o=a.downloadUrls)==null?void 0:o.qrCode)}).map(a=>{const{downloadUrls:o,iconBackground:l,iconUrl:c,id:u,name:d,qrCode:f}=a,x=(o==null?void 0:o.qrCode)&&f,g=!!a.extensionDownloadUrl,v=(o==null?void 0:o.qrCode)&&g,w=(o==null?void 0:o.qrCode)&&!!a.desktopDownloadUrl;return Se.createElement(jn,{alignItems:"center",display:"flex",gap:"16",justifyContent:"space-between",key:a.id,width:"full"},Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16"},Se.createElement(Ec,{background:l,borderColor:"actionButtonBorder",borderRadius:"10",height:"48",src:c,width:"48"}),Se.createElement(jn,{display:"flex",flexDirection:"column",gap:"2"},Se.createElement(ks,{color:"modalText",size:"14",weight:"bold"},d),Se.createElement(ks,{color:"modalTextSecondary",size:"14",weight:"medium"},v?s.t("get.mobile_and_extension.description"):w?s.t("get.mobile_and_desktop.description"):x?s.t("get.mobile.description"):g?s.t("get.extension.description"):null))),Se.createElement(jn,{display:"flex",flexDirection:"column",gap:"4"},Se.createElement(od,{label:s.t("get.action.label"),onClick:()=>e(u),type:"secondary"})))})),Se.createElement(jn,{alignItems:"center",borderRadius:"10",display:"flex",flexDirection:"column",gap:"8",justifyContent:"space-between",marginBottom:"4",paddingY:"8",style:{maxWidth:275,textAlign:"center"}},Se.createElement(ks,{color:"modalText",size:"14",weight:"bold"},s.t("get.looking_for.title")),Se.createElement(ks,{color:"modalTextSecondary",size:"14",weight:"medium"},t?s.t("get.looking_for.desktop.compact_description"):s.t("get.looking_for.desktop.wide_description"))))}var cW="44";function YMt({changeWalletStep:e,compactModeEnabled:t,connectionError:n,onClose:r,qrCodeUri:s,reconnect:a,wallet:o}){const{downloadUrls:l,iconBackground:c,iconUrl:u,name:d,qrCode:f,ready:x,showWalletConnectModal:g,getDesktopUri:v}=o,w=!!v,C=ole(),{i18n:N}=m.useContext(nc),I=!!o.extensionDownloadUrl,P=(l==null?void 0:l.qrCode)&&I,R=(l==null?void 0:l.qrCode)&&!!o.desktopDownloadUrl,F=f&&s,U=async()=>{const ne=await(v==null?void 0:v());window.open(ne,C?"_blank":"_self")},L=g?{description:t?N.t("connect.walletconnect.description.compact"):N.t("connect.walletconnect.description.full"),label:N.t("connect.walletconnect.open.label"),onClick:()=>{r(),g()}}:F?{description:N.t("connect.secondary_action.get.description",{wallet:d}),label:N.t("connect.secondary_action.get.label"),onClick:()=>e(P||R?"DOWNLOAD_OPTIONS":"DOWNLOAD")}:null,{width:z}=MRe(),X=z&&z<768;return m.useEffect(()=>{qMt(),GMt()},[]),Se.createElement(jn,{display:"flex",flexDirection:"column",height:"full",width:"full"},F?Se.createElement(jn,{alignItems:"center",display:"flex",height:"full",justifyContent:"center"},Se.createElement(iLe,{logoBackground:c,logoSize:t?60:72,logoUrl:u,size:t?318:X?Math.max(280,Math.min(z-308,382)):382,uri:s})):Se.createElement(jn,{alignItems:"center",display:"flex",justifyContent:"center",style:{flexGrow:1}},Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"8"},Se.createElement(jn,{borderRadius:"10",height:cW,overflow:"hidden"},Se.createElement(Ec,{useAsImage:!o.isRainbowKitConnector,height:cW,src:u,width:cW})),Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"4",paddingX:"32",style:{textAlign:"center"}},Se.createElement(ks,{color:"modalText",size:"18",weight:"bold"},x?N.t("connect.status.opening",{wallet:d}):I?N.t("connect.status.not_installed",{wallet:d}):N.t("connect.status.not_available",{wallet:d})),!x&&I?Se.createElement(jn,{paddingTop:"20"},Se.createElement(od,{href:o.extensionDownloadUrl,label:N.t("connect.secondary_action.install.label"),type:"secondary"})):null,x&&!F&&Se.createElement(Se.Fragment,null,Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center"},Se.createElement(ks,{color:"modalTextSecondary",size:"14",textAlign:"center",weight:"medium"},N.t("connect.status.confirm"))),Se.createElement(jn,{alignItems:"center",color:"modalText",display:"flex",flexDirection:"row",height:"32",marginTop:"8"},n?Se.createElement(od,{label:N.t("connect.secondary_action.retry.label"),onClick:async()=>{w&&U(),a(o)}}):Se.createElement(jn,{color:"modalTextSecondary"},Se.createElement(ZE,null))))))),Se.createElement(jn,{alignItems:"center",borderRadius:"10",display:"flex",flexDirection:"row",gap:"8",height:"28",justifyContent:"space-between",marginTop:"12"},x&&L&&Se.createElement(Se.Fragment,null,Se.createElement(ks,{color:"modalTextSecondary",size:"14",weight:"medium"},L.description),Se.createElement(od,{label:L.label,onClick:L.onClick,type:"secondary"}))))}var uW=({actionLabel:e,description:t,iconAccent:n,iconBackground:r,iconUrl:s,isCompact:a,onAction:o,title:l,url:c,variant:u})=>{const d=u==="browser",f=!d&&n&&FMt(n);return Se.createElement(jn,{alignItems:"center",borderRadius:"13",display:"flex",justifyContent:"center",overflow:"hidden",paddingX:a?"18":"44",position:"relative",style:{flex:1,isolation:"isolate"},width:"full"},Se.createElement(jn,{borderColor:"actionButtonBorder",borderRadius:"13",borderStyle:"solid",borderWidth:"1",style:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0",zIndex:1}}),d&&Se.createElement(jn,{background:"downloadTopCardBackground",height:"full",position:"absolute",style:{zIndex:0},width:"full"},Se.createElement(jn,{display:"flex",flexDirection:"row",justifyContent:"space-between",style:{bottom:"0",filter:"blur(20px)",left:"0",position:"absolute",right:"0",top:"0",transform:"translate3d(0, 0, 0)"}},Se.createElement(jn,{style:{filter:"blur(100px)",marginLeft:-27,marginTop:-20,opacity:.6,transform:"translate3d(0, 0, 0)"}},Se.createElement(Ec,{borderRadius:"full",height:"200",src:s,width:"200"})),Se.createElement(jn,{style:{filter:"blur(100px)",marginRight:0,marginTop:105,opacity:.6,overflow:"auto",transform:"translate3d(0, 0, 0)"}},Se.createElement(Ec,{borderRadius:"full",height:"200",src:s,width:"200"})))),!d&&f&&Se.createElement(jn,{background:"downloadBottomCardBackground",style:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0"}},Se.createElement(jn,{position:"absolute",style:{background:`radial-gradient(50% 50% at 50% 50%, ${f[0]} 0%, ${f[1]} 25%, rgba(0,0,0,0) 100%)`,height:564,left:-215,top:-197,transform:"translate3d(0, 0, 0)",width:564}}),Se.createElement(jn,{position:"absolute",style:{background:`radial-gradient(50% 50% at 50% 50%, ${f[2]} 0%, rgba(0, 0, 0, 0) 100%)`,height:564,left:-1,top:-76,transform:"translate3d(0, 0, 0)",width:564}})),Se.createElement(jn,{alignItems:"flex-start",display:"flex",flexDirection:"row",gap:"24",height:"max",justifyContent:"center",style:{zIndex:1}},Se.createElement(jn,null,Se.createElement(Ec,{height:"60",src:s,width:"60",...r?{background:r,borderColor:"generalBorder",borderRadius:"10"}:null})),Se.createElement(jn,{display:"flex",flexDirection:"column",gap:"4",style:{flex:1},width:"full"},Se.createElement(ks,{color:"modalText",size:"14",weight:"bold"},l),Se.createElement(ks,{color:"modalTextSecondary",size:"14",weight:"medium"},t),Se.createElement(jn,{marginTop:"14",width:"max"},Se.createElement(od,{href:c,label:e,onClick:o,size:"medium"})))))};function XMt({changeWalletStep:e,wallet:t}){const n=lle(),r=ule(),a=m.useContext(j$)==="compact",{desktop:o,desktopDownloadUrl:l,extension:c,extensionDownloadUrl:u,mobileDownloadUrl:d}=t,{i18n:f}=m.useContext(nc);return m.useEffect(()=>{tLe(),sLe(),DMt(),MMt()},[]),Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"24",height:"full",marginBottom:"8",marginTop:"4",width:"full"},Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"8",height:"full",justifyContent:"center",width:"full"},u&&Se.createElement(uW,{actionLabel:f.t("get_options.extension.download.label",{browser:n}),description:f.t("get_options.extension.description"),iconUrl:aLe,isCompact:a,onAction:()=>e(c!=null&&c.instructions?"INSTRUCTIONS_EXTENSION":"CONNECT"),title:f.t("get_options.extension.title",{wallet:t.name,browser:n}),url:u,variant:"browser"}),l&&Se.createElement(uW,{actionLabel:f.t("get_options.desktop.download.label",{platform:r}),description:f.t("get_options.desktop.description"),iconUrl:oLe,isCompact:a,onAction:()=>e(o!=null&&o.instructions?"INSTRUCTIONS_DESKTOP":"CONNECT"),title:f.t("get_options.desktop.title",{wallet:t.name,platform:r}),url:l,variant:"desktop"}),d&&Se.createElement(uW,{actionLabel:f.t("get_options.mobile.download.label",{wallet:t.name}),description:f.t("get_options.mobile.description"),iconAccent:t.iconAccent,iconBackground:t.iconBackground,iconUrl:t.iconUrl,isCompact:a,onAction:()=>{e("DOWNLOAD")},title:f.t("get_options.mobile.title",{wallet:t.name}),variant:"app"})))}function QMt({changeWalletStep:e,wallet:t}){const{downloadUrls:n,qrCode:r}=t,{i18n:s}=m.useContext(nc);return m.useEffect(()=>{tLe(),sLe()},[]),Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"24",height:"full",width:"full"},Se.createElement(jn,{style:{maxWidth:220,textAlign:"center"}},Se.createElement(ks,{color:"modalTextSecondary",size:"14",weight:"semibold"},s.t("get_mobile.description"))),Se.createElement(jn,{height:"full"},n!=null&&n.qrCode?Se.createElement(iLe,{logoSize:0,size:268,uri:n.qrCode}):null),Se.createElement(jn,{alignItems:"center",borderRadius:"10",display:"flex",flexDirection:"row",gap:"8",height:"34",justifyContent:"space-between",marginBottom:"12",paddingY:"8"},Se.createElement(od,{label:s.t("get_mobile.continue.label"),onClick:()=>e(r!=null&&r.instructions?"INSTRUCTIONS_MOBILE":"CONNECT")})))}var zg={connect:()=>Se.createElement(RMt,null),create:()=>Se.createElement(LMt,null),install:e=>Se.createElement(Ec,{background:e.iconBackground,borderColor:"generalBorder",borderRadius:"10",height:"48",src:e.iconUrl,width:"48"}),refresh:()=>Se.createElement(BMt,null),scan:()=>Se.createElement($Mt,null)};function ZMt({connectWallet:e,wallet:t}){var r,s,a,o;const{i18n:n}=m.useContext(nc);return Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",width:"full"},Se.createElement(jn,{display:"flex",flexDirection:"column",gap:"28",height:"full",justifyContent:"center",paddingY:"32",style:{maxWidth:320}},(s=(r=t==null?void 0:t.qrCode)==null?void 0:r.instructions)==null?void 0:s.steps.map((l,c)=>{var u;return Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16",key:c},Se.createElement(jn,{borderRadius:"10",height:"48",minWidth:"48",overflow:"hidden",position:"relative",width:"48"},(u=zg[l.step])==null?void 0:u.call(zg,t)),Se.createElement(jn,{display:"flex",flexDirection:"column",gap:"4"},Se.createElement(ks,{color:"modalText",size:"14",weight:"bold"},n.t(l.title,void 0,{rawKeyIfTranslationMissing:!0})),Se.createElement(ks,{color:"modalTextSecondary",size:"14",weight:"medium"},n.t(l.description,void 0,{rawKeyIfTranslationMissing:!0}))))})),Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",marginBottom:"16"},Se.createElement(od,{label:n.t("get_instructions.mobile.connect.label"),onClick:()=>e(t)}),Se.createElement(jn,{as:"a",className:tu({active:"shrink",hover:"grow"}),display:"block",href:(o=(a=t==null?void 0:t.qrCode)==null?void 0:a.instructions)==null?void 0:o.learnMoreUrl,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},Se.createElement(ks,{color:"accentColor",size:"14",weight:"bold"},n.t("get_instructions.mobile.learn_more.label")))))}function JMt({wallet:e}){var n,r,s,a;const{i18n:t}=m.useContext(nc);return Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",width:"full"},Se.createElement(jn,{display:"flex",flexDirection:"column",gap:"28",height:"full",justifyContent:"center",paddingY:"32",style:{maxWidth:320}},(r=(n=e==null?void 0:e.extension)==null?void 0:n.instructions)==null?void 0:r.steps.map((o,l)=>{var c;return Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16",key:l},Se.createElement(jn,{borderRadius:"10",height:"48",minWidth:"48",overflow:"hidden",position:"relative",width:"48"},(c=zg[o.step])==null?void 0:c.call(zg,e)),Se.createElement(jn,{display:"flex",flexDirection:"column",gap:"4"},Se.createElement(ks,{color:"modalText",size:"14",weight:"bold"},t.t(o.title,void 0,{rawKeyIfTranslationMissing:!0})),Se.createElement(ks,{color:"modalTextSecondary",size:"14",weight:"medium"},t.t(o.description,void 0,{rawKeyIfTranslationMissing:!0}))))})),Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",marginBottom:"16"},Se.createElement(od,{label:t.t("get_instructions.extension.refresh.label"),onClick:window.location.reload.bind(window.location)}),Se.createElement(jn,{as:"a",className:tu({active:"shrink",hover:"grow"}),display:"block",href:(a=(s=e==null?void 0:e.extension)==null?void 0:s.instructions)==null?void 0:a.learnMoreUrl,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},Se.createElement(ks,{color:"accentColor",size:"14",weight:"bold"},t.t("get_instructions.extension.learn_more.label")))))}function eRt({connectWallet:e,wallet:t}){var r,s,a,o;const{i18n:n}=m.useContext(nc);return Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",width:"full"},Se.createElement(jn,{display:"flex",flexDirection:"column",gap:"28",height:"full",justifyContent:"center",paddingY:"32",style:{maxWidth:320}},(s=(r=t==null?void 0:t.desktop)==null?void 0:r.instructions)==null?void 0:s.steps.map((l,c)=>{var u;return Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16",key:c},Se.createElement(jn,{borderRadius:"10",height:"48",minWidth:"48",overflow:"hidden",position:"relative",width:"48"},(u=zg[l.step])==null?void 0:u.call(zg,t)),Se.createElement(jn,{display:"flex",flexDirection:"column",gap:"4"},Se.createElement(ks,{color:"modalText",size:"14",weight:"bold"},n.t(l.title,void 0,{rawKeyIfTranslationMissing:!0})),Se.createElement(ks,{color:"modalTextSecondary",size:"14",weight:"medium"},n.t(l.description,void 0,{rawKeyIfTranslationMissing:!0}))))})),Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",marginBottom:"16"},Se.createElement(od,{label:n.t("get_instructions.desktop.connect.label"),onClick:()=>e(t)}),Se.createElement(jn,{as:"a",className:tu({active:"shrink",hover:"grow"}),display:"block",href:(o=(a=t==null?void 0:t.desktop)==null?void 0:a.instructions)==null?void 0:o.learnMoreUrl,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},Se.createElement(ks,{color:"accentColor",size:"14",weight:"bold"},n.t("get_instructions.desktop.learn_more.label")))))}function tRt({onClose:e}){const t="rk_connect_title",[n,r]=m.useState(),[s,a]=m.useState(),[o,l]=m.useState(),c=!!(s!=null&&s.qrCode)&&o,[u,d]=m.useState(!1),x=m.useContext(j$)===aT.COMPACT,{disclaimer:g}=m.useContext(sT),{i18n:v}=m.useContext(nc),w=ole(),C=m.useRef(!1),{connector:N}=m.useContext(iT),P=JE(!N).filter(ce=>ce.ready||!!ce.extensionDownloadUrl).sort((ce,ye)=>ce.groupIndex-ye.groupIndex),R=JE(),F=AMt(P,ce=>ce.groupName),U=["Recommended","Other","Popular","More","Others","Installed"];m.useEffect(()=>{N&&!C.current&&(re("CONNECT"),ne(N),C.current=!0)},[N]);const L=ce=>{var ye,Ne;d(!1),ce.ready&&((Ne=(ye=ce==null?void 0:ce.connect)==null?void 0:ye.call(ce))==null||Ne.catch(()=>{d(!0)}))},z=async ce=>{const ye=P.find(Ne=>ce.id===Ne.id);ye!=null&&ye.getDesktopUri&&setTimeout(async()=>{var be;const Ne=await((be=ye==null?void 0:ye.getDesktopUri)==null?void 0:be.call(ye));Ne&&window.open(Ne,w?"_blank":"_self")},0)},X=async ce=>{var be;const ye=P.find(je=>ce.id===je.id),Ne=await((be=ye==null?void 0:ye.getQrCodeUri)==null?void 0:be.call(ye));l(Ne),setTimeout(()=>{a(ye),re("CONNECT")},Ne?0:50)},ne=async ce=>{PMt(ce.id),ce.ready&&(X(ce),z(ce)),L(ce),r(ce.id),ce.ready||(a(ce),re(ce!=null&&ce.extensionDownloadUrl?"DOWNLOAD_OPTIONS":"CONNECT"))},J=ce=>{var Ie;const ye=R.find(Re=>ce===Re.id),Ne=(Ie=ye==null?void 0:ye.downloadUrls)==null?void 0:Ie.qrCode,be=!!(ye!=null&&ye.desktopDownloadUrl),je=!!(ye!=null&&ye.extensionDownloadUrl);a(ye),re(Ne&&(je||be)?"DOWNLOAD_OPTIONS":Ne?"DOWNLOAD":be?"INSTRUCTIONS_DESKTOP":"INSTRUCTIONS_EXTENSION")},Z=()=>{r(void 0),a(void 0),l(void 0)},re=(ce,ye=!1)=>{ye&&ce==="GET"&&he==="GET"?Z():!ye&&ce==="GET"?Y("GET"):!ye&&ce==="CONNECT"&&Y("CONNECT"),oe(ce)},[he,Y]=m.useState("NONE"),[ie,oe]=m.useState("NONE");let G=null,V=null,ee=null,ae;m.useEffect(()=>{d(!1)},[ie,s]);const Ae=!!(!!(s!=null&&s.extensionDownloadUrl)&&(s!=null&&s.mobileDownloadUrl));switch(ie){case"NONE":G=Se.createElement(xbe,{getWallet:()=>re("GET")});break;case"LEARN_COMPACT":G=Se.createElement(xbe,{compactModeEnabled:x,getWallet:()=>re("GET")}),V=v.t("intro.title"),ee="NONE";break;case"GET":G=Se.createElement(KMt,{getWalletDownload:J,compactModeEnabled:x}),V=v.t("get.title"),ee=x?"LEARN_COMPACT":"NONE";break;case"CONNECT":G=s&&Se.createElement(YMt,{changeWalletStep:re,compactModeEnabled:x,connectionError:u,onClose:e,qrCodeUri:o,reconnect:L,wallet:s}),V=c&&(s.name==="WalletConnect"?v.t("connect_scan.fallback_title"):v.t("connect_scan.title",{wallet:s.name})),ee=x?N?null:"NONE":null,ae=x?N?()=>{}:Z:()=>{};break;case"DOWNLOAD_OPTIONS":G=s&&Se.createElement(XMt,{changeWalletStep:re,wallet:s}),V=s&&v.t("get_options.short_title",{wallet:s.name}),ee=N?"CONNECT":x?"NONE":he;break;case"DOWNLOAD":G=s&&Se.createElement(QMt,{changeWalletStep:re,wallet:s}),V=s&&v.t("get_mobile.title",{wallet:s.name}),ee=Ae?"DOWNLOAD_OPTIONS":he;break;case"INSTRUCTIONS_MOBILE":G=s&&Se.createElement(ZMt,{connectWallet:ne,wallet:s}),V=s&&v.t("get_options.title",{wallet:x&&s.shortName||s.name}),ee="DOWNLOAD";break;case"INSTRUCTIONS_EXTENSION":G=s&&Se.createElement(JMt,{wallet:s}),V=s&&v.t("get_options.title",{wallet:x&&s.shortName||s.name}),ee="DOWNLOAD_OPTIONS";break;case"INSTRUCTIONS_DESKTOP":G=s&&Se.createElement(eRt,{connectWallet:ne,wallet:s}),V=s&&v.t("get_options.title",{wallet:x&&s.shortName||s.name}),ee="DOWNLOAD_OPTIONS";break}return Se.createElement(jn,{display:"flex",flexDirection:"row",style:{maxHeight:x?468:504}},(x?ie==="NONE":!0)&&Se.createElement(jn,{className:x?VMt:HMt,display:"flex",flexDirection:"column",marginTop:"16"},Se.createElement(jn,{display:"flex",justifyContent:"space-between"},x&&g&&Se.createElement(jn,{marginLeft:"16",width:"28"},Se.createElement(EMt,{onClick:()=>re("LEARN_COMPACT")})),x&&!g&&Se.createElement(jn,{marginLeft:"16",width:"28"}),Se.createElement(jn,{marginLeft:x?"0":"6",paddingBottom:"8",paddingTop:"2",paddingX:"18"},Se.createElement(ks,{as:"h1",color:"modalText",id:t,size:"18",weight:"heavy",testId:"connect-header-label"},v.t("connect.title"))),x&&Se.createElement(jn,{marginRight:"16"},Se.createElement(z3,{onClose:e}))),Se.createElement(jn,{className:zMt,paddingBottom:"18"},Object.entries(F).map(([ce,ye],Ne)=>ye.length>0&&Se.createElement(m.Fragment,{key:Ne},ce?Se.createElement(jn,{marginBottom:"8",marginTop:"16",marginX:"6"},Se.createElement(ks,{color:ce==="Installed"?"accentColor":"modalTextSecondary",size:"14",weight:"bold"},U.includes(ce)?v.t(`connector_group.${ce.toLowerCase()}`):ce)):null,Se.createElement(jn,{display:"flex",flexDirection:"column",gap:"4"},ye.map(be=>Se.createElement(ZRe,{currentlySelected:be.id===n,iconBackground:be.iconBackground,iconUrl:be.iconUrl,key:be.id,name:be.name,onClick:()=>ne(be),ready:be.ready,recent:be.recent,testId:`wallet-option-${be.id}`,isRainbowKitConnector:be.isRainbowKitConnector})))))),x&&Se.createElement(Se.Fragment,null,Se.createElement(jn,{background:"generalBorder",height:"1",marginTop:"-1"}),g?Se.createElement(jn,{paddingX:"24",paddingY:"16",textAlign:"center"},Se.createElement(g,{Link:fle,Text:hle})):Se.createElement(jn,{alignItems:"center",display:"flex",justifyContent:"space-between",paddingX:"24",paddingY:"16"},Se.createElement(jn,{paddingY:"4"},Se.createElement(ks,{color:"modalTextSecondary",size:"14",weight:"medium"},v.t("connect.new_to_ethereum.description"))),Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"row",gap:"4",justifyContent:"center"},Se.createElement(jn,{className:tu({active:"shrink",hover:"grow"}),cursor:"pointer",onClick:()=>re("LEARN_COMPACT"),paddingY:"4",style:{willChange:"transform"},transition:"default"},Se.createElement(ks,{color:"accentColor",size:"14",weight:"bold"},v.t("connect.new_to_ethereum.learn_more.label"))))))),(x?ie!=="NONE":!0)&&Se.createElement(Se.Fragment,null,!x&&Se.createElement(jn,{background:"generalBorder",minWidth:"1",width:"1"}),Se.createElement(jn,{display:"flex",flexDirection:"column",margin:"16",style:{flexGrow:1}},Se.createElement(jn,{alignItems:"center",display:"flex",justifyContent:"space-between",marginBottom:"12"},Se.createElement(jn,{width:"28"},ee&&Se.createElement(jn,{as:"button",className:tu({active:"shrinkSm",hover:"growLg"}),color:"accentColor",onClick:()=>{ee&&re(ee,!0),ae==null||ae()},paddingX:"8",paddingY:"4",style:{boxSizing:"content-box",height:17,willChange:"transform"},transition:"default",type:"button"},Se.createElement(XRe,null))),Se.createElement(jn,{display:"flex",justifyContent:"center",style:{flexGrow:1}},V&&Se.createElement(ks,{color:"modalText",size:"18",textAlign:"center",weight:"heavy"},V)),Se.createElement(z3,{onClose:e})),Se.createElement(jn,{display:"flex",flexDirection:"column",style:{minHeight:x?396:432}},Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"6",height:"full",justifyContent:"center",marginX:"8"},G)))))}var nRt="_1am14412",rRt="_1am14410",sRt="_1am14413",iRt=({wallet:e})=>Se.createElement("svg",{className:sRt,viewBox:"0 0 86 86",width:"86",height:"86"},Se.createElement("title",null,"Loading"),Se.createElement("rect",{x:"3",y:"3",width:80,height:80,rx:20,ry:20,strokeDasharray:`${160/3} ${2*160/3}`,strokeDashoffset:160,className:nRt,style:{stroke:(e==null?void 0:e.iconAccent)||"#0D3887"}}));function lLe({onClose:e,wallet:t,connecting:n}){const{connect:r,iconBackground:s,iconUrl:a,id:o,name:l,getMobileUri:c,ready:u,shortName:d,showWalletConnectModal:f}=t,x=QRe(a),g=m.useRef(!1),{i18n:v}=m.useContext(nc),w=m.useCallback(async()=>{if(o!=="walletConnect"&&(async()=>{const N=await(c==null?void 0:c());if(N)if(N&&VOt({mobileUri:N,name:l}),N.startsWith("http")){const I=document.createElement("a");I.href=N,I.target="_blank",I.rel="noreferrer noopener",I.click()}else window.location.href=N})(),f){f(),e==null||e();return}r==null||r()},[r,c,f,e,l,o]);return m.useEffect(()=>{n&&!g.current&&(w(),g.current=!0)},[n,w]),Se.createElement(jn,{as:"button",color:u?"modalText":"modalTextSecondary",disabled:!u,fontFamily:"body",key:o,onClick:w,ref:x,style:{overflow:"visible",textAlign:"center"},testId:`wallet-option-${o}`,type:"button",width:"full"},Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center"},Se.createElement(jn,{display:"flex",alignItems:"center",justifyContent:"center",paddingBottom:"8",paddingTop:"10",position:"relative"},n?Se.createElement(iRt,{wallet:t}):null,Se.createElement(Ec,{background:s,borderRadius:"13",boxShadow:"walletLogo",height:"60",src:a,width:"60"})),n?null:Se.createElement(jn,{display:"flex",flexDirection:"column",textAlign:"center"},Se.createElement(ks,{as:"h2",color:t.ready?"modalText":"modalTextSecondary",size:"13",weight:"medium"},Se.createElement(jn,{as:"span",position:"relative"},d??l,!t.ready&&" (unsupported)")),t.recent&&Se.createElement(ks,{color:"accentColor",size:"12",weight:"medium"},v.t("connect.recent")))))}function aRt({onClose:e}){var g;const t="rk_connect_title",n=JE().filter(v=>v.isRainbowKitConnector),{disclaimer:r,learnMoreUrl:s}=m.useContext(sT);let a=null,o=null,l=!1,c=null;const[u,d]=m.useState("CONNECT"),{i18n:f}=m.useContext(nc),x=p5();switch(u){case"CONNECT":{a=f.t("connect.title"),l=!0,o=Se.createElement(jn,null,Se.createElement(jn,{background:"profileForeground",className:rRt,display:"flex",paddingBottom:"20",paddingTop:"6"},Se.createElement(jn,{display:"flex",style:{margin:"0 auto"}},n.filter(v=>v.ready).map(v=>Se.createElement(jn,{key:v.id,paddingX:"20"},Se.createElement(jn,{width:"60"},Se.createElement(lLe,{onClose:e,wallet:v})))))),Se.createElement(jn,{background:"generalBorder",height:"1",marginBottom:"32",marginTop:"-1"}),Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"32",paddingX:"32",style:{textAlign:"center"}},Se.createElement(jn,{display:"flex",flexDirection:"column",gap:"8",textAlign:"center"},Se.createElement(ks,{color:"modalText",size:"16",weight:"bold"},f.t("intro.title")),Se.createElement(ks,{color:"modalTextSecondary",size:"16"},f.t("intro.description")))),Se.createElement(jn,{paddingTop:"32",paddingX:"20"},Se.createElement(jn,{display:"flex",gap:"14",justifyContent:"center"},Se.createElement(od,{label:f.t("intro.get.label"),onClick:()=>d("GET"),size:"large",type:"secondary"}),Se.createElement(od,{href:s,label:f.t("intro.learn_more.label"),size:"large",type:"secondary"}))),r&&Se.createElement(jn,{marginTop:"28",marginX:"32",textAlign:"center"},Se.createElement(r,{Link:fle,Text:hle})));break}case"GET":{a=f.t("get.title"),c="CONNECT";const v=(g=n==null?void 0:n.filter(w=>{var C,N,I;return((C=w.downloadUrls)==null?void 0:C.ios)||((N=w.downloadUrls)==null?void 0:N.android)||((I=w.downloadUrls)==null?void 0:I.mobile)}))==null?void 0:g.splice(0,3);o=Se.createElement(jn,null,Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",marginBottom:"36",marginTop:"5",paddingTop:"12",width:"full"},v.map((w,C)=>{const{downloadUrls:N,iconBackground:I,iconUrl:P,name:R}=w;return!(N!=null&&N.ios)&&!(N!=null&&N.android)&&!(N!=null&&N.mobile)?null:Se.createElement(jn,{display:"flex",gap:"16",key:w.id,paddingX:"20",width:"full"},Se.createElement(jn,{style:{minHeight:48,minWidth:48}},Se.createElement(Ec,{background:I,borderColor:"generalBorder",borderRadius:"10",height:"48",src:P,width:"48"})),Se.createElement(jn,{display:"flex",flexDirection:"column",width:"full"},Se.createElement(jn,{alignItems:"center",display:"flex",height:"48"},Se.createElement(jn,{width:"full"},Se.createElement(ks,{color:"modalText",size:"18",weight:"bold"},R)),Se.createElement(od,{href:(x?N==null?void 0:N.ios:N==null?void 0:N.android)||(N==null?void 0:N.mobile),label:f.t("get.action.label"),size:"small",type:"secondary"})),C<v.length-1&&Se.createElement(jn,{background:"generalBorderDim",height:"1",marginY:"10",width:"full"})))})),Se.createElement(jn,{style:{marginBottom:"42px"}}),Se.createElement(jn,{alignItems:"center",display:"flex",flexDirection:"column",gap:"36",paddingX:"36",style:{textAlign:"center"}},Se.createElement(jn,{display:"flex",flexDirection:"column",gap:"12",textAlign:"center"},Se.createElement(ks,{color:"modalText",size:"16",weight:"bold"},f.t("get.looking_for.title")),Se.createElement(ks,{color:"modalTextSecondary",size:"16"},f.t("get.looking_for.mobile.description")))));break}}return Se.createElement(jn,{display:"flex",flexDirection:"column",paddingBottom:"36"},Se.createElement(jn,{background:l?"profileForeground":"modalBackground",display:"flex",flexDirection:"column",paddingBottom:"4",paddingTop:"14"},Se.createElement(jn,{display:"flex",justifyContent:"center",paddingBottom:"6",paddingX:"20",position:"relative"},c&&Se.createElement(jn,{display:"flex",position:"absolute",style:{left:0,marginBottom:-20,marginTop:-20}},Se.createElement(jn,{alignItems:"center",as:"button",className:tu({active:"shrinkSm",hover:"growLg"}),color:"accentColor",display:"flex",marginLeft:"4",marginTop:"20",onClick:()=>d(c),padding:"16",style:{height:17,willChange:"transform"},transition:"default",type:"button"},Se.createElement(XRe,null))),Se.createElement(jn,{marginTop:"4",textAlign:"center",width:"full"},Se.createElement(ks,{as:"h1",color:"modalText",id:t,size:"20",weight:"bold"},a)),Se.createElement(jn,{alignItems:"center",display:"flex",height:"32",paddingRight:"14",position:"absolute",right:"0"},Se.createElement(jn,{style:{marginBottom:-20,marginTop:-20}},Se.createElement(z3,{onClose:e}))))),Se.createElement(jn,{display:"flex",flexDirection:"column"},o))}var oRt=({onClose:e})=>{const{connector:t}=m.useContext(iT),{i18n:n}=m.useContext(nc),r=(t==null?void 0:t.name)||"";return Se.createElement(jn,null,Se.createElement(jn,{display:"flex",paddingBottom:"32",justifyContent:"center",alignItems:"center",background:"profileForeground",flexDirection:"column"},Se.createElement(jn,{width:"full",display:"flex",justifyContent:"flex-end",marginTop:"18",marginRight:"24"},Se.createElement(z3,{onClose:e})),Se.createElement(jn,{width:"60"},Se.createElement(lLe,{onClose:e,wallet:t,connecting:!0})),Se.createElement(jn,{marginTop:"20"},Se.createElement(ks,{textAlign:"center",color:"modalText",size:"18",weight:"semibold"},n.t("connect.status.connect_mobile",{wallet:r}))),Se.createElement(jn,{maxWidth:"full",marginTop:"8"},Se.createElement(ks,{textAlign:"center",color:"modalText",size:"16",weight:"medium"},n.t("connect.status.confirm_mobile",{wallet:r})))))};function lRt({onClose:e}){const{connector:t}=m.useContext(iT);return ru()?t?Se.createElement(oRt,{onClose:e}):Se.createElement(aRt,{onClose:e}):Se.createElement(tRt,{onClose:e})}function cRt({onClose:e,open:t}){const n="rk_connect_title",r=vRe(),{disconnect:s}=vB(),{isConnecting:a}=Yr(),o=Se.useCallback(()=>{e(),s()},[e,s]),l=Se.useCallback(()=>{a&&s(),e()},[e,s,a]);return r==="disconnected"?Se.createElement(MR,{onClose:l,open:t,titleId:n},Se.createElement(RR,{bottomSheetOnMobile:!0,padding:"0",wide:!0},Se.createElement(lRt,{onClose:l}))):r==="unauthenticated"?Se.createElement(MR,{onClose:o,open:t,titleId:n},Se.createElement(RR,{bottomSheetOnMobile:!0,padding:"0"},Se.createElement(zOt,{onClose:o,onCloseModal:e}))):null}function dW(){const[e,t]=m.useState(!1);return{closeModal:m.useCallback(()=>t(!1),[]),isModalOpen:e,openModal:m.useCallback(()=>t(!0),[])}}var UA=m.createContext({accountModalOpen:!1,chainModalOpen:!1,connectModalOpen:!1,isWalletConnectModalOpen:!1,setIsWalletConnectModalOpen:()=>{}});function uRt({children:e}){const{closeModal:t,isModalOpen:n,openModal:r}=dW(),{closeModal:s,isModalOpen:a,openModal:o}=dW(),{closeModal:l,isModalOpen:c,openModal:u}=dW(),[d,f]=m.useState(!1),x=vRe(),{chainId:g}=Yr(),{chains:v}=wl(),w=v.some(I=>I.id===g),C=m.useCallback(({keepConnectModalOpen:I=!1}={})=>{I||t(),s(),l()},[t,s,l]),N=A$()==="unauthenticated";return e_e({onConnect:()=>C({keepConnectModalOpen:N}),onDisconnect:()=>C()}),m.useEffect(()=>{N&&C()},[N,C]),Se.createElement(UA.Provider,{value:m.useMemo(()=>({accountModalOpen:a,chainModalOpen:c,connectModalOpen:n,isWalletConnectModalOpen:d,openAccountModal:w&&x==="connected"?o:void 0,openChainModal:x==="connected"?u:void 0,openConnectModal:x==="disconnected"||x==="unauthenticated"?r:void 0,setIsWalletConnectModalOpen:f}),[x,a,c,n,o,u,r,w,d])},e,Se.createElement(cRt,{onClose:t,open:n}),Se.createElement(gMt,{onClose:s,open:a}),Se.createElement(NMt,{onClose:l,open:c}))}function dRt(){const{accountModalOpen:e,chainModalOpen:t,connectModalOpen:n}=m.useContext(UA);return{accountModalOpen:e,chainModalOpen:t,connectModalOpen:n}}function fRt(){const{accountModalOpen:e,openAccountModal:t}=m.useContext(UA);return{accountModalOpen:e,openAccountModal:t}}function hRt(){const{chainModalOpen:e,openChainModal:t}=m.useContext(UA);return{chainModalOpen:e,openChainModal:t}}function cLe(){const{isWalletConnectModalOpen:e,setIsWalletConnectModalOpen:t}=m.useContext(UA);return{isWalletConnectModalOpen:e,setIsWalletConnectModalOpen:t}}function m5(){const{connectModalOpen:e,openConnectModal:t}=m.useContext(UA),{isWalletConnectModalOpen:n}=cLe();return{connectModalOpen:e||n,openConnectModal:t}}var fW=()=>{};function pRt({children:e}){const t=KFt(),{address:n}=Yr(),{chainId:r}=Yr(),{chains:s}=wl(),a=s.some(Z=>Z.id===r),o=WFt(),l=A$()??void 0,c=r?o[r]:void 0,u=(c==null?void 0:c.name)??void 0,d=(c==null?void 0:c.iconUrl)??void 0,f=(c==null?void 0:c.iconBackground)??void 0,x=rle(d),g=m.useContext(ale),v=PRe().some(({status:Z})=>Z==="pending")&&g,{showBalance:w}=GFt(),N=typeof w=="boolean"?w:w?fFt(w)[ru()?"smallScreen":"largeScreen"]:!0,{balance:I,ensAvatar:P,ensName:R}=_Re({address:n,includeBalance:N}),F=I?`${WRe(Number.parseFloat(I.formatted))} ${I.symbol}`:void 0,{openConnectModal:U}=m5(),{openChainModal:L}=hRt(),{openAccountModal:z}=fRt(),{accountModalOpen:X,chainModalOpen:ne,connectModalOpen:J}=dRt();return Se.createElement(Se.Fragment,null,e({account:n?{address:n,balanceDecimals:I==null?void 0:I.decimals,balanceFormatted:I==null?void 0:I.formatted,balanceSymbol:I==null?void 0:I.symbol,displayBalance:F,displayName:R?GRe(R):qRe(n),ensAvatar:P??void 0,ensName:R??void 0,hasPendingTransactions:v}:void 0,accountModalOpen:X,authenticationStatus:l,chain:r?{hasIcon:!!d,iconBackground:f,iconUrl:x,id:r,name:u,unsupported:!a}:void 0,chainModalOpen:ne,connectModalOpen:J,mounted:t(),openAccountModal:z??fW,openChainModal:L??fW,openConnectModal:U??fW}))}pRt.displayName="ConnectButton.Custom";var uLe=({appName:e,appDescription:t,appUrl:n,appIcon:r})=>({name:e,description:t??e,url:n??(typeof window<"u"?window.location.href:""),icons:[...r?[r]:[]]});function mRt(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>n!==void 0))}function xRt(e,t){const n=[];for(const r of e)n.some(s=>s[t]===r[t])||n.push(r);return n}var gRt=(e,{projectId:t,walletConnectParameters:n,appName:r,appDescription:s,appUrl:a,appIcon:o})=>{if(!e.length)throw new Error("No wallet list was provided");for(const{wallets:g,groupName:v}of e)if(!g.length)throw new Error(`No wallets provided for group: ${v}`);let l=-1;const c=[],u=[],d=[],f=uLe({appName:r,appDescription:s,appUrl:a,appIcon:o});for(const[g,{groupName:v,wallets:w}]of e.entries())for(const C of w){l++;const N=C({projectId:t,appName:r,appIcon:o,options:{metadata:f,...n},walletConnectParameters:{metadata:f,...n}});if(N!=null&&N.iconAccent&&!OMt(N==null?void 0:N.iconAccent))throw new Error(`Property \`iconAccent\` is not a hex value for wallet: ${N.name}`);const I={...N,groupIndex:g+1,groupName:v,index:l};typeof N.hidden=="function"?d.push(I):u.push(I)}const x=xRt([...u,...d],"id");for(const{createConnector:g,groupIndex:v,groupName:w,hidden:C,...N}of x){if(typeof C=="function"&&C())continue;const I=F=>({rkDetails:mRt({...N,groupIndex:v,groupName:w,isRainbowKitConnector:!0,...F||{}})});N.id==="walletConnect"&&c.push(g(I({isWalletConnectModalConnector:!0,showQrModal:!0})));const R=g(I());c.push(R)}return c},bbe=new Map,bRt=({projectId:e,walletConnectParameters:t,rkDetailsShowQrModal:n})=>{let r={...t||{},projectId:e,showQrModal:!1};n&&(r={...r,showQrModal:!0});const s=JSON.stringify(r),a=bbe.get(s);if(a)return a;const o=tle(r);return bbe.set(s,o),o};function yRt({projectId:e,walletDetails:t,walletConnectParameters:n}){return r=>({...bRt({projectId:e,walletConnectParameters:n,rkDetailsShowQrModal:t.rkDetails.showQrModal})(r),...t})}function ple({projectId:e,walletConnectParameters:t}){const n="21fef48091f12692cad574a6f7753643";if(!e||e==="")throw new Error("No projectId found. Every dApp must now provide a WalletConnect Cloud projectId to enable WalletConnect v2 https://www.rainbowkit.com/docs/installation#configure");return e==="YOUR_PROJECT_ID"&&(e=n),r=>yRt({projectId:e,walletDetails:r,walletConnectParameters:t})}function dLe(e){const t=typeof window<"u"?window:void 0;if(typeof t>"u"||typeof t.ethereum>"u")return;const n=t.ethereum.providers;return n?n.find(r=>r[e]):t.ethereum[e]?t.ethereum:void 0}function fLe(e){const t=(n,r)=>{const[s,...a]=r.split("."),o=n[s];if(o)return a.length===0?o:t(o,a.join("."))};if(typeof window<"u")return t(window,e)}function hLe({flag:e,namespace:t}){return!!(t&&typeof fLe(t)<"u"||e&&typeof dLe(e)<"u")}function vRt({flag:e,namespace:t}){var s;const n=typeof window<"u"?window:void 0;if(typeof n>"u")return;if(t){const a=fLe(t);if(a)return a}const r=(s=n.ethereum)==null?void 0:s.providers;if(e){const a=dLe(e);if(a)return a}return typeof r<"u"&&r.length>0?r[0]:n.ethereum}function wRt(e){return t=>{const n=e?{target:()=>({id:t.rkDetails.id,name:t.rkDetails.name,provider:e})}:{};return r=>({...gB(n)(r),...t})}}function pLe({flag:e,namespace:t,target:n}){const r=n||vRt({flag:e,namespace:t});return wRt(r)}var mLe=({appName:e,appIcon:t})=>{const n=s=>s,r=p5();return{id:"coinbase",name:"Coinbase Wallet",shortName:"Coinbase",rdns:"com.coinbase.wallet",iconUrl:async()=>(await Jr(async()=>{const{default:s}=await import("./coinbaseWallet-WWX6LF36-BMRj6mTC.js");return{default:s}},[])).default,iconAccent:"#2c5ff6",iconBackground:"#2c5ff6",installed:!0,downloadUrls:{android:"https://play.google.com/store/apps/details?id=org.toshi",ios:"https://apps.apple.com/us/app/coinbase-wallet-store-crypto/id1278383455",mobile:"https://coinbase.com/wallet/downloads",qrCode:"https://coinbase-wallet.onelink.me/q5Sx/fdb9b250",chrome:"https://chrome.google.com/webstore/detail/coinbase-wallet-extension/hnfanknocfeofbddgcijnmhnfnkdnaad",browserExtension:"https://coinbase.com/wallet"},...r?{}:{qrCode:{getUri:n,instructions:{learnMoreUrl:"https://coinbase.com/wallet/articles/getting-started-mobile",steps:[{description:"wallet_connectors.coinbase.qr_code.step1.description",step:"install",title:"wallet_connectors.coinbase.qr_code.step1.title"},{description:"wallet_connectors.coinbase.qr_code.step2.description",step:"create",title:"wallet_connectors.coinbase.qr_code.step2.title"},{description:"wallet_connectors.coinbase.qr_code.step3.description",step:"scan",title:"wallet_connectors.coinbase.qr_code.step3.title"}]}},extension:{instructions:{learnMoreUrl:"https://coinbase.com/wallet/articles/getting-started-extension",steps:[{description:"wallet_connectors.coinbase.extension.step1.description",step:"install",title:"wallet_connectors.coinbase.extension.step1.title"},{description:"wallet_connectors.coinbase.extension.step2.description",step:"create",title:"wallet_connectors.coinbase.extension.step2.title"},{description:"wallet_connectors.coinbase.extension.step3.description",step:"refresh",title:"wallet_connectors.coinbase.extension.step3.title"}]}}},createConnector:s=>{const a=N$({appName:e,appLogoUrl:t,preference:mLe.preference});return o=>({...a(o),...s})}}};function CRt(e){return!(!(e!=null&&e.isMetaMask)||e.isBraveWallet&&!e._events&&!e._state||e.isApexWallet||e.isAvalanche||e.isBackpack||e.isBifrost||e.isBitKeep||e.isBitski||e.isBlockWallet||e.isCoinbaseWallet||e.isDawn||e.isEnkrypt||e.isExodus||e.isFrame||e.isFrontier||e.isGamestop||e.isHyperPay||e.isImToken||e.isKuCoinWallet||e.isMathWallet||e.isNestWallet||e.isOkxWallet||e.isOKExWallet||e.isOneInchIOSWallet||e.isOneInchAndroidWallet||e.isOpera||e.isPhantom||e.isPortal||e.isRabby||e.isRainbow||e.isStatus||e.isTalisman||e.isTally||e.isTokenPocket||e.isTokenary||e.isTrust||e.isTrustWallet||e.isXDEFI||e.isZeal||e.isZerion||e.__seif)}var SRt=({projectId:e,walletConnectParameters:t})=>{var a,o;const n=hLe({flag:"isMetaMask"}),r=!n,s=l=>nle()?l:p5()?`metamask://wc?uri=${encodeURIComponent(l)}`:`https://metamask.app.link/wc?uri=${encodeURIComponent(l)}`;return{id:"metaMask",name:"MetaMask",rdns:"io.metamask",iconUrl:async()=>(await Jr(async()=>{const{default:l}=await import("./metaMaskWallet-YFHEHW7V-BggUDXad.js");return{default:l}},[])).default,iconAccent:"#f6851a",iconBackground:"#fff",installed:r?void 0:n,downloadUrls:{android:"https://play.google.com/store/apps/details?id=io.metamask",ios:"https://apps.apple.com/us/app/metamask/id1438144202",mobile:"https://metamask.io/download",qrCode:"https://metamask.io/download",chrome:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",edge:"https://microsoftedge.microsoft.com/addons/detail/metamask/ejbalbakoplchlghecdalmeeeajnimhm",firefox:"https://addons.mozilla.org/firefox/addon/ether-metamask",opera:"https://addons.opera.com/extensions/details/metamask-10",browserExtension:"https://metamask.io/download"},mobile:{getUri:r?s:void 0},qrCode:r?{getUri:s,instructions:{learnMoreUrl:"https://metamask.io/faqs/",steps:[{description:"wallet_connectors.metamask.qr_code.step1.description",step:"install",title:"wallet_connectors.metamask.qr_code.step1.title"},{description:"wallet_connectors.metamask.qr_code.step2.description",step:"create",title:"wallet_connectors.metamask.qr_code.step2.title"},{description:"wallet_connectors.metamask.qr_code.step3.description",step:"refresh",title:"wallet_connectors.metamask.qr_code.step3.title"}]}}:void 0,extension:{instructions:{learnMoreUrl:"https://metamask.io/faqs/",steps:[{description:"wallet_connectors.metamask.extension.step1.description",step:"install",title:"wallet_connectors.metamask.extension.step1.title"},{description:"wallet_connectors.metamask.extension.step2.description",step:"create",title:"wallet_connectors.metamask.extension.step2.title"},{description:"wallet_connectors.metamask.extension.step3.description",step:"refresh",title:"wallet_connectors.metamask.extension.step3.title"}]}},createConnector:r?ple({projectId:e,walletConnectParameters:t}):pLe({target:typeof window<"u"?((o=(a=window.ethereum)==null?void 0:a.providers)==null?void 0:o.find(CRt))??window.ethereum:void 0})}},NRt=({projectId:e,walletConnectParameters:t})=>{const n=hLe({flag:"isRainbow"}),r=!n,s=a=>nle()?a:p5()?`rainbow://wc?uri=${encodeURIComponent(a)}&connector=rainbowkit`:`https://rnbwapp.com/wc?uri=${encodeURIComponent(a)}&connector=rainbowkit`;return{id:"rainbow",name:"Rainbow",rdns:"me.rainbow",iconUrl:async()=>(await Jr(async()=>{const{default:a}=await import("./rainbowWallet-2SR6TVBF-kimcGeuf.js");return{default:a}},[])).default,iconBackground:"#0c2f78",installed:r?void 0:n,downloadUrls:{android:"https://play.google.com/store/apps/details?id=me.rainbow&referrer=utm_source%3Drainbowkit&utm_source=rainbowkit",ios:"https://apps.apple.com/app/apple-store/id1457119021?pt=119997837&ct=rainbowkit&mt=8",mobile:"https://rainbow.download?utm_source=rainbowkit",qrCode:"https://rainbow.download?utm_source=rainbowkit&utm_medium=qrcode",browserExtension:"https://rainbow.me/extension?utm_source=rainbowkit"},mobile:{getUri:r?s:void 0},qrCode:r?{getUri:s,instructions:{learnMoreUrl:"https://learn.rainbow.me/connect-to-a-website-or-app?utm_source=rainbowkit&utm_medium=connector&utm_campaign=learnmore",steps:[{description:"wallet_connectors.rainbow.qr_code.step1.description",step:"install",title:"wallet_connectors.rainbow.qr_code.step1.title"},{description:"wallet_connectors.rainbow.qr_code.step2.description",step:"create",title:"wallet_connectors.rainbow.qr_code.step2.title"},{description:"wallet_connectors.rainbow.qr_code.step3.description",step:"scan",title:"wallet_connectors.rainbow.qr_code.step3.title"}]}}:void 0,createConnector:r?ple({projectId:e,walletConnectParameters:t}):pLe({flag:"isRainbow"})}},ARt=()=>({id:"safe",name:"Safe",iconAccent:"#12ff80",iconBackground:"#fff",iconUrl:async()=>(await Jr(async()=>{const{default:e}=await import("./safeWallet-VUYZPLY4-CXnodgMs.js");return{default:e}},[])).default,installed:!(typeof window>"u")&&(window==null?void 0:window.parent)!==window,downloadUrls:{},createConnector:e=>t=>({...ele()(t),...e})}),jRt=({projectId:e,options:t})=>({id:"walletConnect",name:"WalletConnect",installed:void 0,iconUrl:async()=>(await Jr(async()=>{const{default:r}=await import("./walletConnectWallet-FNSU4KNU-B0ci71fU.js");return{default:r}},[])).default,iconBackground:"#3b99fc",qrCode:{getUri:r=>r},createConnector:ple({projectId:e,walletConnectParameters:t})}),ERt=e=>e.reduce((n,r)=>{const s=r.id;return n[s]=cj(),n},{}),_Rt=({appName:e,appDescription:t,appUrl:n,appIcon:r,wallets:s,projectId:a,...o})=>{const{transports:l,chains:c,...u}=o,d=uLe({appName:e,appDescription:t,appUrl:n,appIcon:r}),f=gRt(s||[{groupName:"Popular",wallets:[ARt,NRt,mLe,SRt,jRt]}],{projectId:a,appName:e,appDescription:t,appUrl:n,appIcon:r,walletConnectParameters:{metadata:d}});return H0t({connectors:f,chains:c,transports:l||ERt(c),...u})};function kRt({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M13.836 2.477a.75.75 0 0 1 .75.75v3.182a.75.75 0 0 1-.75.75h-3.182a.75.75 0 0 1 0-1.5h1.37l-.84-.841a4.5 4.5 0 0 0-7.08.932.75.75 0 0 1-1.3-.75 6 6 0 0 1 9.44-1.242l.842.84V3.227a.75.75 0 0 1 .75-.75Zm-.911 7.5A.75.75 0 0 1 13.199 11a6 6 0 0 1-9.44 1.241l-.84-.84v1.371a.75.75 0 0 1-1.5 0V9.591a.75.75 0 0 1 .75-.75H5.35a.75.75 0 0 1 0 1.5H3.98l.841.841a4.5 4.5 0 0 0 7.08-.932.75.75 0 0 1 1.025-.273Z",clipRule:"evenodd"}))}const ybe=m.forwardRef(kRt);function TRt({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M8 14a.75.75 0 0 1-.75-.75V4.56L4.03 7.78a.75.75 0 0 1-1.06-1.06l4.5-4.5a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1-1.06 1.06L8.75 4.56v8.69A.75.75 0 0 1 8 14Z",clipRule:"evenodd"}))}const fy=m.forwardRef(TRt);function IRt({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const PRt=m.forwardRef(IRt);function FRt({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M8.75 2.5a.75.75 0 0 0-1.5 0v.508a32.661 32.661 0 0 0-4.624.434.75.75 0 0 0 .246 1.48l.13-.021-1.188 4.75a.75.75 0 0 0 .33.817A3.487 3.487 0 0 0 4 11c.68 0 1.318-.195 1.856-.532a.75.75 0 0 0 .33-.818l-1.25-5a31.31 31.31 0 0 1 2.314-.141V12.012c-.882.027-1.752.104-2.607.226a.75.75 0 0 0 .213 1.485 22.188 22.188 0 0 1 6.288 0 .75.75 0 1 0 .213-1.485 23.657 23.657 0 0 0-2.607-.226V4.509c.779.018 1.55.066 2.314.14L9.814 9.65a.75.75 0 0 0 .329.818 3.487 3.487 0 0 0 1.856.532c.68 0 1.318-.195 1.856-.532a.75.75 0 0 0 .33-.818L12.997 4.9l.13.022a.75.75 0 1 0 .247-1.48 32.66 32.66 0 0 0-4.624-.434V2.5ZM3.42 9.415a2 2 0 0 0 1.16 0L4 7.092l-.58 2.323ZM12 9.5a2 2 0 0 1-.582-.085L12 7.092l.58 2.323A2 2 0 0 1 12 9.5Z",clipRule:"evenodd"}))}const ORt=m.forwardRef(FRt);function MRt({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{fillRule:"evenodd",d:"M5 3.25V4H2.75a.75.75 0 0 0 0 1.5h.3l.815 8.15A1.5 1.5 0 0 0 5.357 15h5.285a1.5 1.5 0 0 0 1.493-1.35l.815-8.15h.3a.75.75 0 0 0 0-1.5H11v-.75A2.25 2.25 0 0 0 8.75 1h-1.5A2.25 2.25 0 0 0 5 3.25Zm2.25-.75a.75.75 0 0 0-.75.75V4h3v-.75a.75.75 0 0 0-.75-.75h-1.5ZM6.05 6a.75.75 0 0 1 .787.713l.275 5.5a.75.75 0 0 1-1.498.075l-.275-5.5A.75.75 0 0 1 6.05 6Zm3.9 0a.75.75 0 0 1 .712.787l-.275 5.5a.75.75 0 0 1-1.498-.075l.275-5.5a.75.75 0 0 1 .786-.711Z",clipRule:"evenodd"}))}const RRt=m.forwardRef(MRt),LRt=()=>{const{address:e}=Yr(),{disconnect:t}=vB(),{subsExpireDay:n}=m.useContext(Gr),[r,s]=m.useState(!1),a=c=>c<=3?"red":c<=7?"yellow":"green",o=Number(n)||0,l=a(o);return i.jsxs(i.Fragment,{children:[i.jsx(FA,{open:r,setOpen:s,handleListRequest:()=>{},handlePageChange:()=>{}}),i.jsxs(OD,{as:"div",className:"relative inline-block text-left font-manrope",children:[i.jsx("div",{children:i.jsxs(PD,{className:"bg-[#232323] hover:bg-[#404040] border-none rounded-[256px] justify-start items-center gap-2 inline-flex focus:outline-none focus:ring-0 py-1.5 pl-4 pr-3 text-[13px] font-semibold text-white",children:[window.localStorage.getItem("hyperAddress")&&e.slice(0,6)+"..."+e.slice(-4),i.jsx(PRt,{className:"size-4 fill-white/60"})]})}),i.jsx(FD,{transition:!0,anchor:"bottom end",className:"origin-top-right absolute right-0 top-10 w-36 rounded-xl px-2 py-2.5 text-sm/6 text-white transition duration-100 ease-out [--anchor-gap:var(--spacing-1)] focus:outline-none data-[closed]:scale-95 data-[closed]:opacity-0 z-[60]",children:i.jsx(AC,{children:i.jsxs("button",{className:"group flex flex-col gap-[6px] items-center rounded-lg px-1 py-2 focus:outline-none focus:ring-0 border-none origin-top-right bg-[#363636] border border-[#404040] shadow-lg ring-1 ring-black ring-opacity-5 z-20 h-max w-full",children:[i.jsxs("div",{onClick:()=>{window.open("/wallet-management#hyperliquid#add-account#hyperliquid","_blank")},className:"h-8 px-1 py-3 bg-[#7445ff] rounded-md shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] flex justify-center items-center gap-1  cursor-pointer relative",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] min-w-max -mb-[1px]",children:"Add Account"}),i.jsx("div",{className:"absolute -top-[15.5px] right-[1px]",children:i.jsx("img",{src:tke,alt:""})})]}),i.jsx("div",{onClick:()=>{window.open("/my-profile","_blank")},className:"h-8 w-[calc(100%-6px)] px-1 py-3 bg-[#7445ff] rounded-md shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] flex justify-center items-center gap-1 cursor-pointer",children:i.jsxs("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] min-w-max -mb-[1px] flex items-center gap-2",children:[l!=="green"&&i.jsx("span",{className:`${l==="red"?"bg-[#FF4A4A]":""} ${l==="yellow"?"bg-[#FFD447]":""} w-2 h-2 min-w-2 min-h-2 rounded-full inline-block live-dot`}),"My Profile"]})}),i.jsx("div",{onClick:()=>{t(),window.localStorage.removeItem("hyperAddress"),window.localStorage.removeItem("hyperToken"),window.dispatchEvent(new Event("localStorageUpdated"))},className:"py-2 px-3 text-13px rounded-md flex justify-between items-center  hover:bg-[#404040] relative w-full",children:"Disconnect"})]})})})]})]})},DRt=()=>{const e=nl(),[t,n]=m.useState(Date.now()),{isConnected:r,address:s,isDisconnected:a}=Yr(),{walletLogin:o,signIn:l,hyperToken:c,hyperAddress:u,setTelegramChatId:d,setSubscriberRole:f,setSubsExpireDay:x,setIsReferralCode:g,setIsReferralCodeName:v,setMushboomerETH:w,setMushboomerSOL:C,setIsWhitelist:N,setHyperToken:I,setHyperAddress:P,setSignModalOpen:R,signInConnectButtonOpen:F,setSignInConnectButtonOpen:U}=m.useContext(Gr),{openConnectModal:L}=m5(),z=typeof window<"u"&&window.matchMedia("(max-width:640px)").matches;m.useEffect(()=>{!a&&s==null&&!z&&(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),I(""),P(""))},[a]);const X=()=>{window.localStorage.getItem("hyperToken")&&c?o():l(1)};m.useEffect(()=>{F&&(R(!0),U(!1))},[F]),m.useEffect(()=>{s!=null&&window.localStorage.getItem("hyperAddress")!=null&&window.localStorage.getItem("hyperAddress").toLowerCase()!==s.toLowerCase()&&!z&&(window.localStorage.removeItem("hyperToken"),I(""))},[s,u]);const ne=m.useRef(!1);return m.useEffect(()=>{const J=async()=>{var Y,ie;if(ne.current)return;ne.current=!0;const re=window.localStorage.getItem("hyperToken"),he=window.localStorage.getItem("hyperAddress");if(!re||!he){ne.current=!1;return}try{const oe=await Si(he.toLowerCase(),re);oe!=null&&oe.success?(d(oe==null?void 0:oe.telegram_chat_id),f(oe==null?void 0:oe.subscriber_role),x(oe==null?void 0:oe.subs_expire_day),w((Y=oe==null?void 0:oe.mushboomer_counts)==null?void 0:Y.eth),C((ie=oe==null?void 0:oe.mushboomer_counts)==null?void 0:ie.sol),g(oe==null?void 0:oe.referral_code),v(oe==null?void 0:oe.refcode),N(oe==null?void 0:oe.whitelist),I(re),P(he)):(window.localStorage.removeItem("hyperAddress"),window.localStorage.removeItem("hyperToken"),I(""),P(""))}catch(oe){console.error("Token verification error:",oe),oe.response?console.error("Server Error Response:",oe.response):oe.message?console.error("Network or Other Error:",oe.message):console.error("Unknown Error:",oe)}finally{ne.current=!1}},Z=()=>{if(document.visibilityState==="visible"){const re=Date.now();re-t>1e3&&J(),n(re)}};return document.addEventListener("visibilitychange",Z),()=>{document.removeEventListener("visibilitychange",Z)}},[e,t]),i.jsx(i.Fragment,{children:r?s&&window.localStorage.getItem("hyperAddress")?i.jsxs("div",{className:"sm:block relative font-manrope",children:[i.jsx(LRt,{}),i.jsx("div",{className:"absolute right-4",children:(s==null?void 0:s.toLowerCase())!==window.localStorage.getItem("hyperAddress")?i.jsxs("div",{className:"flex justify-end font-manrope",children:[i.jsx("img",{src:zbt,alt:""}),i.jsx("span",{className:"text-[#D35B5B] text-[10px] leading-4 font-medium",children:"Not connected"})]}):i.jsxs("div",{className:"flex justify-end font-manrope",children:[i.jsx("img",{src:Hbt,alt:""}),i.jsx("span",{className:"text-[#0A9C55] text-[10px] leading-4 font-medium",children:"Connected"})]})})]}):i.jsx("div",{onClick:J=>X(),style:{background:"linear-gradient(98deg, #FFF1FF 0%, #6FDBBF 28.15%, #57DCF5 57.96%, #D834D8 98.77%)"},className:"h-[30.60px] rounded-[256px] justify-center items-center gap-2.5  sm:inline-flex w-[91px] p-[1.4px] cursor-pointer font-manrope",children:i.jsx("div",{className:"text-white text-sm font-medium font-manrope leading-none w-full h-full flex items-center justify-center rounded-[256px] bg-[#161616]",children:"Sign In"})}):i.jsx("div",{onClick:()=>{L(),U(!0)},style:{background:"linear-gradient(98deg, #FFF1FF 0%, #6FDBBF 28.15%, #57DCF5 57.96%, #D834D8 98.77%)"},className:"h-[30.60px] rounded-[256px] justify-center items-center gap-2.5  sm:inline-flex w-[91px] p-[1.4px] cursor-pointer",children:i.jsx("div",{className:"text-white text-sm font-medium font-manrope leading-none w-full h-full flex items-center justify-center rounded-[256px] bg-[#161616]",children:"Connect"})})})};var K6={},hW={exports:{}},pW,vbe;function BRt(){if(vbe)return pW;vbe=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return pW=e,pW}var mW,wbe;function $Rt(){if(wbe)return mW;wbe=1;var e=BRt();function t(){}function n(){}return n.resetWarningCache=t,mW=function(){function r(o,l,c,u,d,f){if(f!==e){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}}r.isRequired=r;function s(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},mW}var Cbe;function E$(){return Cbe||(Cbe=1,hW.exports=$Rt()()),hW.exports}var xW,Sbe;function xLe(){return Sbe||(Sbe=1,xW={L:1,M:0,Q:3,H:2}),xW}var gW,Nbe;function gLe(){return Nbe||(Nbe=1,gW={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}),gW}var bW,Abe;function URt(){if(Abe)return bW;Abe=1;var e=gLe();function t(n){this.mode=e.MODE_8BIT_BYTE,this.data=n}return t.prototype={getLength:function(n){return this.data.length},write:function(n){for(var r=0;r<this.data.length;r++)n.put(this.data.charCodeAt(r),8)}},bW=t,bW}var yW,jbe;function zRt(){if(jbe)return yW;jbe=1;var e=xLe();function t(n,r){this.totalCount=n,this.dataCount=r}return t.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t.getRSBlocks=function(n,r){var s=t.getRsBlockTable(n,r);if(s==null)throw new Error("bad rs block @ typeNumber:"+n+"/errorCorrectLevel:"+r);for(var a=s.length/3,o=new Array,l=0;l<a;l++)for(var c=s[l*3+0],u=s[l*3+1],d=s[l*3+2],f=0;f<c;f++)o.push(new t(u,d));return o},t.getRsBlockTable=function(n,r){switch(r){case e.L:return t.RS_BLOCK_TABLE[(n-1)*4+0];case e.M:return t.RS_BLOCK_TABLE[(n-1)*4+1];case e.Q:return t.RS_BLOCK_TABLE[(n-1)*4+2];case e.H:return t.RS_BLOCK_TABLE[(n-1)*4+3];default:return}},yW=t,yW}var vW,Ebe;function HRt(){if(Ebe)return vW;Ebe=1;function e(){this.buffer=new Array,this.length=0}return e.prototype={get:function(t){var n=Math.floor(t/8);return(this.buffer[n]>>>7-t%8&1)==1},put:function(t,n){for(var r=0;r<n;r++)this.putBit((t>>>n-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},vW=e,vW}var wW,_be;function bLe(){if(_be)return wW;_be=1;for(var e={glog:function(n){if(n<1)throw new Error("glog("+n+")");return e.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return e.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},t=0;t<8;t++)e.EXP_TABLE[t]=1<<t;for(var t=8;t<256;t++)e.EXP_TABLE[t]=e.EXP_TABLE[t-4]^e.EXP_TABLE[t-5]^e.EXP_TABLE[t-6]^e.EXP_TABLE[t-8];for(var t=0;t<255;t++)e.LOG_TABLE[e.EXP_TABLE[t]]=t;return wW=e,wW}var CW,kbe;function yLe(){if(kbe)return CW;kbe=1;var e=bLe();function t(n,r){if(n.length==null)throw new Error(n.length+"/"+r);for(var s=0;s<n.length&&n[s]==0;)s++;this.num=new Array(n.length-s+r);for(var a=0;a<n.length-s;a++)this.num[a]=n[a+s]}return t.prototype={get:function(n){return this.num[n]},getLength:function(){return this.num.length},multiply:function(n){for(var r=new Array(this.getLength()+n.getLength()-1),s=0;s<this.getLength();s++)for(var a=0;a<n.getLength();a++)r[s+a]^=e.gexp(e.glog(this.get(s))+e.glog(n.get(a)));return new t(r,0)},mod:function(n){if(this.getLength()-n.getLength()<0)return this;for(var r=e.glog(this.get(0))-e.glog(n.get(0)),s=new Array(this.getLength()),a=0;a<this.getLength();a++)s[a]=this.get(a);for(var a=0;a<n.getLength();a++)s[a]^=e.gexp(e.glog(n.get(a))+r);return new t(s,0).mod(n)}},CW=t,CW}var SW,Tbe;function VRt(){if(Tbe)return SW;Tbe=1;var e=gLe(),t=yLe(),n=bLe(),r={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},s={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var o=a<<10;s.getBCHDigit(o)-s.getBCHDigit(s.G15)>=0;)o^=s.G15<<s.getBCHDigit(o)-s.getBCHDigit(s.G15);return(a<<10|o)^s.G15_MASK},getBCHTypeNumber:function(a){for(var o=a<<12;s.getBCHDigit(o)-s.getBCHDigit(s.G18)>=0;)o^=s.G18<<s.getBCHDigit(o)-s.getBCHDigit(s.G18);return a<<12|o},getBCHDigit:function(a){for(var o=0;a!=0;)o++,a>>>=1;return o},getPatternPosition:function(a){return s.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,o,l){switch(a){case r.PATTERN000:return(o+l)%2==0;case r.PATTERN001:return o%2==0;case r.PATTERN010:return l%3==0;case r.PATTERN011:return(o+l)%3==0;case r.PATTERN100:return(Math.floor(o/2)+Math.floor(l/3))%2==0;case r.PATTERN101:return o*l%2+o*l%3==0;case r.PATTERN110:return(o*l%2+o*l%3)%2==0;case r.PATTERN111:return(o*l%3+(o+l)%2)%2==0;default:throw new Error("bad maskPattern:"+a)}},getErrorCorrectPolynomial:function(a){for(var o=new t([1],0),l=0;l<a;l++)o=o.multiply(new t([1,n.gexp(l)],0));return o},getLengthInBits:function(a,o){if(1<=o&&o<10)switch(a){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw new Error("mode:"+a)}else if(o<27)switch(a){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw new Error("mode:"+a)}else if(o<41)switch(a){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw new Error("mode:"+a)}else throw new Error("type:"+o)},getLostPoint:function(a){for(var o=a.getModuleCount(),l=0,c=0;c<o;c++)for(var u=0;u<o;u++){for(var d=0,f=a.isDark(c,u),x=-1;x<=1;x++)if(!(c+x<0||o<=c+x))for(var g=-1;g<=1;g++)u+g<0||o<=u+g||x==0&&g==0||f==a.isDark(c+x,u+g)&&d++;d>5&&(l+=3+d-5)}for(var c=0;c<o-1;c++)for(var u=0;u<o-1;u++){var v=0;a.isDark(c,u)&&v++,a.isDark(c+1,u)&&v++,a.isDark(c,u+1)&&v++,a.isDark(c+1,u+1)&&v++,(v==0||v==4)&&(l+=3)}for(var c=0;c<o;c++)for(var u=0;u<o-6;u++)a.isDark(c,u)&&!a.isDark(c,u+1)&&a.isDark(c,u+2)&&a.isDark(c,u+3)&&a.isDark(c,u+4)&&!a.isDark(c,u+5)&&a.isDark(c,u+6)&&(l+=40);for(var u=0;u<o;u++)for(var c=0;c<o-6;c++)a.isDark(c,u)&&!a.isDark(c+1,u)&&a.isDark(c+2,u)&&a.isDark(c+3,u)&&a.isDark(c+4,u)&&!a.isDark(c+5,u)&&a.isDark(c+6,u)&&(l+=40);for(var w=0,u=0;u<o;u++)for(var c=0;c<o;c++)a.isDark(c,u)&&w++;var C=Math.abs(100*w/o/o-50)/5;return l+=C*10,l}};return SW=s,SW}var NW,Ibe;function WRt(){if(Ibe)return NW;Ibe=1;var e=URt(),t=zRt(),n=HRt(),r=VRt(),s=yLe();function a(l,c){this.typeNumber=l,this.errorCorrectLevel=c,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var o=a.prototype;return o.addData=function(l){var c=new e(l);this.dataList.push(c),this.dataCache=null},o.isDark=function(l,c){if(l<0||this.moduleCount<=l||c<0||this.moduleCount<=c)throw new Error(l+","+c);return this.modules[l][c]},o.getModuleCount=function(){return this.moduleCount},o.make=function(){if(this.typeNumber<1){var l=1;for(l=1;l<40;l++){for(var c=t.getRSBlocks(l,this.errorCorrectLevel),u=new n,d=0,f=0;f<c.length;f++)d+=c[f].dataCount;for(var f=0;f<this.dataList.length;f++){var x=this.dataList[f];u.put(x.mode,4),u.put(x.getLength(),r.getLengthInBits(x.mode,l)),x.write(u)}if(u.getLengthInBits()<=d*8)break}this.typeNumber=l}this.makeImpl(!1,this.getBestMaskPattern())},o.makeImpl=function(l,c){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var u=0;u<this.moduleCount;u++){this.modules[u]=new Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++)this.modules[u][d]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(l,c),this.typeNumber>=7&&this.setupTypeNumber(l),this.dataCache==null&&(this.dataCache=a.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,c)},o.setupPositionProbePattern=function(l,c){for(var u=-1;u<=7;u++)if(!(l+u<=-1||this.moduleCount<=l+u))for(var d=-1;d<=7;d++)c+d<=-1||this.moduleCount<=c+d||(0<=u&&u<=6&&(d==0||d==6)||0<=d&&d<=6&&(u==0||u==6)||2<=u&&u<=4&&2<=d&&d<=4?this.modules[l+u][c+d]=!0:this.modules[l+u][c+d]=!1)},o.getBestMaskPattern=function(){for(var l=0,c=0,u=0;u<8;u++){this.makeImpl(!0,u);var d=r.getLostPoint(this);(u==0||l>d)&&(l=d,c=u)}return c},o.createMovieClip=function(l,c,u){var d=l.createEmptyMovieClip(c,u),f=1;this.make();for(var x=0;x<this.modules.length;x++)for(var g=x*f,v=0;v<this.modules[x].length;v++){var w=v*f,C=this.modules[x][v];C&&(d.beginFill(0,100),d.moveTo(w,g),d.lineTo(w+f,g),d.lineTo(w+f,g+f),d.lineTo(w,g+f),d.endFill())}return d},o.setupTimingPattern=function(){for(var l=8;l<this.moduleCount-8;l++)this.modules[l][6]==null&&(this.modules[l][6]=l%2==0);for(var c=8;c<this.moduleCount-8;c++)this.modules[6][c]==null&&(this.modules[6][c]=c%2==0)},o.setupPositionAdjustPattern=function(){for(var l=r.getPatternPosition(this.typeNumber),c=0;c<l.length;c++)for(var u=0;u<l.length;u++){var d=l[c],f=l[u];if(this.modules[d][f]==null)for(var x=-2;x<=2;x++)for(var g=-2;g<=2;g++)x==-2||x==2||g==-2||g==2||x==0&&g==0?this.modules[d+x][f+g]=!0:this.modules[d+x][f+g]=!1}},o.setupTypeNumber=function(l){for(var c=r.getBCHTypeNumber(this.typeNumber),u=0;u<18;u++){var d=!l&&(c>>u&1)==1;this.modules[Math.floor(u/3)][u%3+this.moduleCount-8-3]=d}for(var u=0;u<18;u++){var d=!l&&(c>>u&1)==1;this.modules[u%3+this.moduleCount-8-3][Math.floor(u/3)]=d}},o.setupTypeInfo=function(l,c){for(var u=this.errorCorrectLevel<<3|c,d=r.getBCHTypeInfo(u),f=0;f<15;f++){var x=!l&&(d>>f&1)==1;f<6?this.modules[f][8]=x:f<8?this.modules[f+1][8]=x:this.modules[this.moduleCount-15+f][8]=x}for(var f=0;f<15;f++){var x=!l&&(d>>f&1)==1;f<8?this.modules[8][this.moduleCount-f-1]=x:f<9?this.modules[8][15-f-1+1]=x:this.modules[8][15-f-1]=x}this.modules[this.moduleCount-8][8]=!l},o.mapData=function(l,c){for(var u=-1,d=this.moduleCount-1,f=7,x=0,g=this.moduleCount-1;g>0;g-=2)for(g==6&&g--;;){for(var v=0;v<2;v++)if(this.modules[d][g-v]==null){var w=!1;x<l.length&&(w=(l[x]>>>f&1)==1);var C=r.getMask(c,d,g-v);C&&(w=!w),this.modules[d][g-v]=w,f--,f==-1&&(x++,f=7)}if(d+=u,d<0||this.moduleCount<=d){d-=u,u=-u;break}}},a.PAD0=236,a.PAD1=17,a.createData=function(l,c,u){for(var d=t.getRSBlocks(l,c),f=new n,x=0;x<u.length;x++){var g=u[x];f.put(g.mode,4),f.put(g.getLength(),r.getLengthInBits(g.mode,l)),g.write(f)}for(var v=0,x=0;x<d.length;x++)v+=d[x].dataCount;if(f.getLengthInBits()>v*8)throw new Error("code length overflow. ("+f.getLengthInBits()+">"+v*8+")");for(f.getLengthInBits()+4<=v*8&&f.put(0,4);f.getLengthInBits()%8!=0;)f.putBit(!1);for(;!(f.getLengthInBits()>=v*8||(f.put(a.PAD0,8),f.getLengthInBits()>=v*8));)f.put(a.PAD1,8);return a.createBytes(f,d)},a.createBytes=function(l,c){for(var u=0,d=0,f=0,x=new Array(c.length),g=new Array(c.length),v=0;v<c.length;v++){var w=c[v].dataCount,C=c[v].totalCount-w;d=Math.max(d,w),f=Math.max(f,C),x[v]=new Array(w);for(var N=0;N<x[v].length;N++)x[v][N]=255&l.buffer[N+u];u+=w;var I=r.getErrorCorrectPolynomial(C),P=new s(x[v],I.getLength()-1),R=P.mod(I);g[v]=new Array(I.getLength()-1);for(var N=0;N<g[v].length;N++){var F=N+R.getLength()-g[v].length;g[v][N]=F>=0?R.get(F):0}}for(var U=0,N=0;N<c.length;N++)U+=c[N].totalCount;for(var L=new Array(U),z=0,N=0;N<d;N++)for(var v=0;v<c.length;v++)N<x[v].length&&(L[z++]=x[v][N]);for(var N=0;N<f;N++)for(var v=0;v<c.length;v++)N<g[v].length&&(L[z++]=g[v][N]);return L},NW=a,NW}var bP={},Pbe;function qRt(){if(Pbe)return bP;Pbe=1,Object.defineProperty(bP,"__esModule",{value:!0});var e=Object.assign||function(u){for(var d=1;d<arguments.length;d++){var f=arguments[d];for(var x in f)Object.prototype.hasOwnProperty.call(f,x)&&(u[x]=f[x])}return u},t=E$(),n=a(t),r=tx(),s=a(r);function a(u){return u&&u.__esModule?u:{default:u}}function o(u,d){var f={};for(var x in u)d.indexOf(x)>=0||Object.prototype.hasOwnProperty.call(u,x)&&(f[x]=u[x]);return f}var l={bgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,bgD:n.default.string.isRequired,fgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,fgD:n.default.string.isRequired,size:n.default.number.isRequired,title:n.default.string,viewBoxSize:n.default.number.isRequired,xmlns:n.default.string},c=(0,r.forwardRef)(function(u,d){var f=u.bgColor,x=u.bgD,g=u.fgD,v=u.fgColor,w=u.size,C=u.title,N=u.viewBoxSize,I=u.xmlns,P=I===void 0?"http://www.w3.org/2000/svg":I,R=o(u,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return s.default.createElement("svg",e({},R,{height:w,ref:d,viewBox:"0 0 "+N+" "+N,width:w,xmlns:P}),C?s.default.createElement("title",null,C):null,s.default.createElement("path",{d:x,fill:f}),s.default.createElement("path",{d:g,fill:v}))});return c.displayName="QRCodeSvg",c.propTypes=l,bP.default=c,bP}var Fbe;function GRt(){if(Fbe)return K6;Fbe=1,Object.defineProperty(K6,"__esModule",{value:!0}),K6.QRCode=void 0;var e=Object.assign||function(w){for(var C=1;C<arguments.length;C++){var N=arguments[C];for(var I in N)Object.prototype.hasOwnProperty.call(N,I)&&(w[I]=N[I])}return w},t=E$(),n=f(t),r=xLe(),s=f(r),a=WRt(),o=f(a),l=tx(),c=f(l),u=qRt(),d=f(u);function f(w){return w&&w.__esModule?w:{default:w}}function x(w,C){var N={};for(var I in w)C.indexOf(I)>=0||Object.prototype.hasOwnProperty.call(w,I)&&(N[I]=w[I]);return N}var g={bgColor:n.default.oneOfType([n.default.object,n.default.string]),fgColor:n.default.oneOfType([n.default.object,n.default.string]),level:n.default.string,size:n.default.number,value:n.default.string.isRequired},v=(0,l.forwardRef)(function(w,C){var N=w.bgColor,I=N===void 0?"#FFFFFF":N,P=w.fgColor,R=P===void 0?"#000000":P,F=w.level,U=F===void 0?"L":F,L=w.size,z=L===void 0?256:L,X=w.value,ne=x(w,["bgColor","fgColor","level","size","value"]),J=new o.default(-1,s.default[U]);J.addData(X),J.make();var Z=J.modules;return c.default.createElement(d.default,e({},ne,{bgColor:I,bgD:Z.map(function(re,he){return re.map(function(Y,ie){return Y?"":"M "+ie+" "+he+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:R,fgD:Z.map(function(re,he){return re.map(function(Y,ie){return Y?"M "+ie+" "+he+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:C,size:z,viewBoxSize:Z.length}))});return K6.QRCode=v,v.displayName="QRCode",v.propTypes=g,K6.default=v,K6}var KRt=GRt();const YRt=ji(KRt),rp=({isOpen:e,onClose:t,children:n,fullscreen:r=!1,blurBackground:s=!1})=>{const[a,o]=m.useState(e),[l,c]=m.useState(!1);m.useEffect(()=>{e?(o(!0),c(!0)):(c(!1),o(!1))},[e]),m.useEffect(()=>{const d=f=>{f.key==="Escape"&&u()};return a&&(document.body.style.overflow="hidden",document.addEventListener("keydown",d)),()=>{document.body.style.overflow="",document.removeEventListener("keydown",d)}},[a]);const u=()=>{c(!1),t()};return a?Ia.createPortal(i.jsxs("div",{className:`fixed inset-0 z-[9999] transition-opacity duration-0 ${l?"opacity-100":"opacity-0"} flex items-center justify-center`,children:[i.jsx("div",{className:`absolute inset-0 ${s?"backdrop-blur-md bg-black/50":"bg-black/50"}`,onClick:u}),i.jsxs("div",{className:`relative bg-[#101010] shadow-lg transform transition-transform duration-0 ${l?"translate-y-0":"translate-y-full"} ${r?"w-screen h-[100dvh] rounded-none p-0":"w-auto max-w-[95vw] max-h-[95vh] rounded-[24px] p-2"}`,onClick:d=>d.stopPropagation(),children:[n,i.jsx("div",{className:`absolute ${r?"top-4 right-4 text-white":"top-2 right-4 text-gray-400 hover:text-white"} text-2xl cursor-pointer z-50`,onClick:u,children:"×"})]})]}),document.body):null},XRt=({progress:e=0,size:t=24,strokeWidth:n=3})=>{const r=(t-n)/2,s=2*Math.PI*r,a=s-e/100*s;return i.jsxs("svg",{width:t,height:t,style:{transform:"rotate(-90deg)"},children:[i.jsx("circle",{stroke:"#FFFFFF",fill:"transparent",strokeWidth:n,r,cx:t/2,cy:t/2}),i.jsx("circle",{stroke:"#000000",fill:"transparent",strokeWidth:n,r,cx:t/2,cy:t/2,strokeDasharray:s,strokeDashoffset:a,strokeLinecap:"round"})]})},QRt=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState(null),[s,a]=m.useState(0),[o,l]=m.useState(15),c=window.localStorage.getItem("hyperToken"),u=window.localStorage.getItem("hyperAddress"),d=m.useRef(null),f=m.useRef(null),x=2e3;m.useEffect(()=>{let I=null;return n&&(l(15),I=setInterval(()=>{l(P=>P<=1?(clearInterval(I),v(),0):P-1)},1e3)),()=>{I&&clearInterval(I)}},[n]);const g=()=>{r(null),a(0),t(!0)},v=()=>{t(!1),N()},w=()=>{a(0),f.current=Date.now(),d.current=setInterval(()=>{const P=(Date.now()-f.current)/x,R=Math.min(P*100,100);a(R),P>=1&&(clearInterval(d.current),d.current=null,a(100),ls.post("https://dextrabothypev2.nftinit.io/api/subscriber/sign_mobile_start/",{address:u,token:c}).then(F=>{const{temp_mobile_password:U}=F.data;r(U)}).catch(F=>{console.error("Axios error:",F)}))},30)},C=()=>{N()},N=()=>{d.current&&(clearInterval(d.current),d.current=null),a(0)};return m.useEffect(()=>()=>{d.current&&clearInterval(d.current)},[]),i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:g,className:"cursor-pointer text-white flex items-center justify-center",children:i.jsx(j6t,{className:"mr-2"})}),i.jsx(rp,{isOpen:e,onClose:v,children:i.jsx("div",{className:"flex flex-col items-center text-center text-white px-4 py-6 rounded-md mx-auto",children:n?i.jsxs(i.Fragment,{children:[i.jsx("img",{src:Hi,className:"w-12 h-12 mb-4",alt:"Dextrabot"}),i.jsx("h2",{className:"mt-2 text-xl font-semibold",children:"Link Mobile Device"}),i.jsx("p",{className:"mt-2 text-sm leading-normal text-gray-300",children:"Scan this QR code with your native camera to connect."}),i.jsx("div",{className:"mt-4 bg-white p-2",children:i.jsx(YRt,{value:`${window.location.origin}/mobile-auth?temp_mobile_password=${n}`})}),i.jsxs("p",{className:"mt-4 text-sm text-gray-400",children:["This window will close automatically in"," ",i.jsx("span",{className:"text-white font-semibold",children:o})," ","seconds."]})]}):i.jsxs(i.Fragment,{children:[i.jsx("img",{src:Hi,className:"w-12 h-12 mb-4",alt:"Dextrabot"}),i.jsx("h2",{className:"mt-2 text-xl font-semibold",children:"Link Mobile Device"}),i.jsxs("p",{className:"mt-2 text-sm leading-normal text-gray-300",children:["Just open your camera and scan the QR code to log in to"," ",i.jsx("span",{className:"text-[#46eda1]",children:"Dextra."}),i.jsx("br",{}),"This QR code enables mobile copy trading (not deposits or withdrawals). Do not share this code or screenshots of it with anyone. Make sure you're not sharing your screen."]}),i.jsxs("button",{onMouseDown:w,onMouseUp:C,onMouseLeave:C,onTouchStart:w,onTouchEnd:C,className:`mt-6 flex items-center space-x-2 px-4 py-2 rounded-md
                           bg-[#46eda1] text-black font-medium text-sm`,children:[i.jsx("div",{className:"text-black",children:i.jsx(XRt,{progress:s,size:16,strokeWidth:3})}),i.jsx("span",{children:"Hold to Reveal"})]})]})})})]})},Es=({className:e})=>i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[i.jsx("path",{d:"M13.5525 10.8225L9.00001 15.375L4.44751 10.8225",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9 2.62506V15.2476",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})]}),_a=({content:e,positionTop:t,alignRight:n})=>i.jsxs("span",{className:`tooltip ${n?"left-5 top-1/2 -translate-y-1/2 ":t?"-top-6 -translate-x-1/2 left-1/2":"-bottom-6 -translate-x-1/2 left-1/2"} transform bg-[#353535] text-white font-manrope font-semibold text-xs leading-3 py-1 px-1.5 rounded-sm relative whitespace-nowrap`,children:[e,i.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:`absolute transform -z-1 ${n?"-rotate-90 left-1 -translate-x-full -translate-y-1/2 top-1/2 ":t?"-bottom-1 rotate-180 -translate-x-1/2 left-1/2":"-top-1 -translate-x-1/2 left-1/2"}`,children:i.jsx("path",{d:"M3.70096 1.25C4.27831 0.25 5.72169 0.25 6.29904 1.25L8.89711 5.75C9.47446 6.75 8.75278 8 7.59808 8H2.40192C1.24722 8 0.525536 6.75 1.10289 5.75L3.70096 1.25Z",fill:"#353535"})})]}),ZRt=()=>{const{hyperToken:e,notificationData:t,setNotificationData:n,announcementData:r,setAnnouncementData:s,handleAnnouncement:a}=m.useContext(Gr),{isConnected:o,address:l}=Yr(),[c,u]=m.useState(window.localStorage.getItem("selectedNotificationTab")||"notification"),f=localStorage.getItem("isDateNotificationFormat")||"date",[x,g]=m.useState(f),w=localStorage.getItem("isDateAnnouncementFormat")||"date",[C,N]=m.useState(w),[I,P]=m.useState(!1);m.useEffect(()=>{localStorage.setItem("isDateNotificationFormat",x)},[x]),m.useEffect(()=>{localStorage.setItem("isDateNotificationFormat",C)},[C]),m.useEffect(()=>{if(!window.localStorage.getItem("hyperToken")||!l){n([]),s([]);return}const X=`notificationsFeedSocket_${l==null?void 0:l.toLowerCase()}`,ne=J=>{if(J.key===X){const Z=JSON.parse(J.newValue||"[]");n(Z)}};return window.addEventListener("storage",ne),()=>window.removeEventListener("storage",ne)},[e,l]),m.useEffect(()=>{const L=window.localStorage.getItem("hyperToken");if(!I||c!="notification"||!L)return;const X=`notificationsFeedSocket_${l==null?void 0:l.toLowerCase()}`;if(!t.some(Z=>!Z.is_read))return;const J=setTimeout(()=>{const Z=t.map(re=>re.is_read?re:{...re,is_read:!0});n(Z),localStorage.setItem(X,JSON.stringify(Z))},1e3);return()=>clearTimeout(J)},[t,I,c]),m.useEffect(()=>{var X;if(!I||c!=="announcement"||!(r!=null&&r.announcements)||((X=r==null?void 0:r.announcements)==null?void 0:X.length)===0)return;const L="readNotSignAnnouncementIds",z=setTimeout(()=>{const ne=JSON.parse(localStorage.getItem(L)||"[]"),J=r==null?void 0:r.announcements.map(Z=>Z.id).filter(Z=>!ne.includes(Z));if(J.length>0){const Z=[...ne,...J];localStorage.setItem(L,JSON.stringify(Z))}},1e3);return()=>clearTimeout(z)},[r,I,c,e]);const R=async()=>{try{const L=window.localStorage.getItem("hyperToken"),z="https://dextrabothypev2.nftinit.io/api/subscriber/announcement/setlastseenannouncement/";if(!o||!L)return;const X=await fetch(z,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:l==null?void 0:l.toLowerCase(),token:L})});if(!X.ok)throw new Error(`Server responded with status ${X.status}`);const ne=await X.json();ne.success?a():console.log(ne.error_message)}catch(L){console.error("Error in handleAnnouncement:",L)}};m.useEffect(()=>{!I||c!=="announcement"||(r==null?void 0:r.new_announcement_count)>0&&e&&o&&R()},[I,c]);const F=t.filter(L=>!L.is_read).length,U=(()=>{var X,ne;const L=l==null?void 0:l.toLowerCase(),z=window.localStorage.getItem("hyperToken");if(!L||!z){const J="readNotSignAnnouncementIds",Z=new Set(JSON.parse(localStorage.getItem(J)||"[]").map(String)),re=new Date,he=new Date;return he.setDate(re.getDate()-2),(X=r==null?void 0:r.announcements)==null?void 0:X.filter(Y=>{const ie=new Date(Y==null?void 0:Y.created_at);return!Z.has(String(Y==null?void 0:Y.id))&&ie>=he}).length}if(L&&z&&(r==null?void 0:r.new_announcement_count)>0){const J="readNotSignAnnouncementIds",Z=new Set(JSON.parse(localStorage.getItem(J)||"[]").map(String));return((ne=r==null?void 0:r.announcements)==null?void 0:ne.filter(he=>he.is_new&&!Z.has(String(he.id))).length)||0}return(r==null?void 0:r.new_announcement_count)||0})();return i.jsx(OD,{as:"div",className:"relative hidden sm:inline-block text-left",children:({open:L,close:z})=>{var X,ne;return m.useEffect(()=>{P(L)},[L]),i.jsxs(i.Fragment,{children:[i.jsx("div",{children:i.jsxs(PD,{className:"relative inline-flex w-full justify-center rounded-md gap-x-1.5 p-1 text-[11px] font-semibold text-gray-900 shadow-sm focus:outline-none focus:ring-0 border-none bg-transparent mt-[2px]",children:[i.jsxs("div",{className:"relative",children:[U>0&&i.jsx("span",{className:"absolute flex h-6 w-6 rounded-full bg-[#FF797C] opacity-55 animate-ping duration-[30000ms] top-0 left-0"}),i.jsx("img",{src:myt,alt:"",className:`${U>0?"bg-transparent":"bg-[#1a1a1a]"} w-[18px] h-[18px] min-w-[18px] min-h-[18px] relative z-10`})]}),(U>0||F>0)&&i.jsx("span",{className:`${U+F>99?"":"w-5 h-5"} absolute -top-1 bg-[#FF373B] text-white rounded-full flex items-center justify-center text-[10px] -right-1 p-0.5 z-20`,children:U+F>99?"99+":U+F})]})}),i.jsx(a8e,{as:m.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:i.jsxs(FD,{className:"absolute -right-3 mt-2 w-[432px] min-h-60 max-h-96 sm:max-h-[600px] origin-top-right rounded-lg bg-[#242424] ring-1 ring-black ring-opacity-5 focus:outline-none flex flex-col gap-[15px] z-[55]",children:[i.jsxs("div",{className:"flex flex-col gap-4 bg-[#242424] relative rounded-tl-lg rounded-tr-lg px-4 pt-4",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("div",{className:"absolute -top-2 right-[21px]",children:i.jsx("img",{src:tke})}),i.jsx("span",{className:"flex gap-1.5 items-center text-white text-base font-semibold font-['Manrope'] leading-[21px] select-none",children:"Notifications"}),i.jsx("div",{className:"flex justify-center items-center gap-2",children:c!="announcement"&&i.jsxs("div",{className:"flex justify-center items-center relative has-tooltip",children:[i.jsx(RRt,{onClick:J=>{J.preventDefault();const Z=window.localStorage.getItem("hyperToken");if(!l||!Z)return;const re=`notificationsFeedSocket_${l==null?void 0:l.toLowerCase()}`;n([]),localStorage.removeItem(re)},className:`${(t==null?void 0:t.length)>0?"text-[#7f7f7f] hover:text-[#c8c6c6]":"text-[#7f7f7f]"} w-4 h-4  cursor-pointer -mt-[2px]`}),i.jsx("span",{className:"",children:i.jsx(_a,{content:"Clear All",positionTop:!1,alignRight:!1})})]})})]}),i.jsx("div",{className:"flex flex-col justify-start items-start w-full",children:i.jsxs("div",{className:"flex justify-stretch w-full gap-[15px]",children:[i.jsxs("div",{onClick:()=>{u("notification"),window.localStorage.setItem("selectedNotificationTab","notification")},className:`relative ${c==="notification"?"text-white bg-[#494949] rounded-lg inline-flex justify-center items-center gap-1":"text-[#919191]"} flex h-7 px-1.5 py-1 justify-center items-center gap-2 itext-white text-[13px] font-semibold font-['Manrope'] leading-[18px] cursor-pointer select-none`,children:["Notifications",F>0&&i.jsx("div",{className:"w-[18px] h-[18px] bg-[#ff373b] rounded-[256px] inline-flex justify-center items-center gap-2.5",children:i.jsx("div",{className:"justify-start text-white text-[11px] font-bold font-['Manrope'] leading-[10px]",children:F})})]}),i.jsxs("div",{onClick:()=>{u("announcement"),window.localStorage.setItem("selectedNotificationTab","announcement")},className:`relative ${c==="announcement"?"text-white bg-[#494949] rounded-lg inline-flex justify-center items-center gap-1":"text-[#919191]"} flex h-7 px-1.5 py-1 justify-center items-center gap-2 itext-white text-[13px] font-semibold font-['Manrope'] leading-[18px] cursor-pointer select-none`,children:["Announcements",U>0&&i.jsx("div",{className:"w-[18px] h-[18px] bg-[#ff373b] rounded-[256px] inline-flex justify-center items-center gap-2.5",children:i.jsx("div",{className:"justify-start text-white text-[11px] font-bold font-['Manrope'] leading-[10px]",children:U})})]})]})})]}),i.jsx("div",{className:"px-2 mb-4 overflow-auto text-[13px] leading-4 font-semibold",children:c==="notification"&&(t==null?void 0:t.length)>0?i.jsx("div",{className:"flex flex-col items-start justify-center gap-1 w-full",children:t==null?void 0:t.map((J,Z)=>i.jsx(JRt,{listenUser:J==null?void 0:J.listen_user,asset:J==null?void 0:J.coin,feeToken:J==null?void 0:J.feeToken,dir:J==null?void 0:J.dir,leverage:J==null?void 0:J.leverage,type:J==null?void 0:J.fill_direction_type,time:J==null?void 0:J.time,status:J.message,isDateFormat:x,setIsDateFormat:g,close:z,isError:J==null?void 0:J.success,traderPNL:J==null?void 0:J.trader_pnl,targetPlatform:J==null?void 0:J.target_platform},Z))}):c==="announcement"&&((X=r==null?void 0:r.announcements)==null?void 0:X.length)>0?i.jsx("div",{className:"flex flex-col items-start justify-center gap-1 w-full",children:(ne=r==null?void 0:r.announcements)==null?void 0:ne.map((J,Z)=>i.jsx(eLt,{address:J==null?void 0:J.address,content:J==null?void 0:J.content,createdAt:J==null?void 0:J.created_at,typeId:J==null?void 0:J.type_id,isDateAnnouncementFormat:C,setIsDateAnnouncementFormat:N},Z))}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center gap-2 py-9",children:[i.jsx("span",{children:i.jsx("img",{src:tyt,alt:""})}),i.jsx("span",{className:"text-[#9C9C9C] text-[13px] leading-4 font-semibold text-center px-4",children:"So clean! You have no new notifications"})]})})]})})]})}})},JRt=({asset:e,type:t,status:n,feeToken:r,dir:s,leverage:a,listenUser:o,time:l,isDateFormat:c,setIsDateFormat:u,close:d,isError:f,traderPNL:x,targetPlatform:g})=>{function v({date:C}){const[N,I]=m.useState(To(C));return m.useEffect(()=>{const P=setInterval(()=>{I(To(C))},1e3);return()=>clearInterval(P)},[C]),i.jsx("span",{className:"text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight",children:N.dateTime})}const w={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return i.jsxs("span",{onClick:()=>{window.location.pathname+window.location.hash==="/tracker#my-activities"?d():window.open("/tracker","_self")},className:"flex gap-2 items-start justify-start px-3 pt-3 pb-2 bg-[#2b2b2b] rounded-2xl min-w-full hover:bg-[#373737] cursor-pointer min-h-16 relative",children:[i.jsx("div",{className:`${f?"bg-[#67ffbd]":"bg-[#ff787b]"} w-0.5 h-10 min-h-10 absolute left-0 top-[27.5%]`}),i.jsxs("div",{className:"flex flex-col items-center gap-3",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${w[e]||(e==null?void 0:e.split("/")[0])}.svg`||dummyImage,alt:e,className:"rounded-full w-8 h-8 min-w-8 min-h-8 bg-white",loading:"lazy",onError:C=>sm(C)}),g==="hyper"?i.jsx("div",{className:"flex justify-start items-center gap-2",children:i.jsx("img",{src:ax,alt:"hyper",className:"w-4 h-4 rounded-sm"})}):g==="lighter"?i.jsx("div",{className:"flex justify-start items-center gap-2",children:i.jsx(Hf,{className:"w-4 h-4 text-[#fff]"})}):""]}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-[3px] w-full",children:[i.jsxs("div",{className:"flex justify-between items-center gap-1 w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsxs("div",{className:"text-white text-[13px] font-bold font-['Manrope'] leading-[18px]",children:[e,"/",r??"USDC"]}),i.jsxs("div",{className:"flex justify-start gap-1 items-center ml-[2px]",children:[i.jsxs("div",{className:`${s!=null&&s.includes("Long")?s==="Short > Long"?"text-[#67ffbd] bg-[#67ffbd]/20":s==="Long > Short"?"text-[#ff787b] bg-[#ff797c]/20":"text-[#67ffbd] bg-[#67ffbd]/20":s=="Buy"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-[18px] pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex min-w-max`,children:[i.jsx("div",{className:"w-2.5 h-2.5 justify-center items-center flex",children:i.jsx("div",{className:"w-2.5 h-2.5 relative",children:s!=null&&s.includes("Long")?s==="Short > Long"?i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-2.5 h-2.5"}):s==="Long > Short"?i.jsx(Es,{className:"text-[#FF797C] w-2.5 h-2.5"}):i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-2.5 h-2.5"}):s=="Buy"?i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-2.5 h-2.5"}):i.jsx(Es,{className:"text-[#FF797C] w-2.5 h-2.5"})})}),i.jsxs("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-wide",children:[s=="Sell"?"Sell":s=="Buy"?"Buy":s=="Close Short"?"Short":s=="Close Long"?"Long":s=="Open Short"?"Short":s=="Open Long"?"Long":s||"--",a?" - "+a+"X":""]})]}),i.jsxs("div",{onClick:C=>{C.stopPropagation(),window.open(`/wallet-details/${o}`,"_blank")},className:"flex justify-start items-center gap-1 cursor-pointer min-w-max h-[18px] px-1.5 py-[3px] bg-white/20 rounded-md",children:[i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-none ",children:o&&(o==null?void 0:o.slice(0,5))+"..."+(o==null?void 0:o.slice(-4))}),i.jsx("img",{onClick:C=>{C.stopPropagation(),navigator.clipboard.writeText(o),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:bo,alt:"",className:"cursor-pointer"})]})]})]}),i.jsx("div",{className:"w-[18px] h-[18px] min-w-[18px] min-h-[18px] flex justify-center items-center rounded",children:i.jsx("img",{src:nae,alt:""})})]}),i.jsx("span",{className:"text-[#b7b7b7] text-xs font-medium font-['Manrope'] leading-[15px] tracking-tight select-none max-w-[92%]",children:n&&(n==null?void 0:n.length)>100?(n==null?void 0:n.slice(0,105))+"...":n}),i.jsxs("div",{className:`${x!=null&&x!==0?"justify-between":"justify-end"} flex  items-center w-full`,children:[i.jsx("div",{className:`${x!=null&&x!==0?x>0?"text-[#67ffbd] bg-[#67ffbd]/20":"bg-[#ff787b]/20 text-[#ff787b]":"hidden"} text-[11px] font-semibold font-['Manrope'] leading-[8px] p-1.5 rounded-md inline-flex justify-center items-center gap-1 max-h-5`,children:x!=null&&x!==0?x>0?`+$${Er(x)}`:`-$${Er(Math.abs(x))}`:""}),i.jsx("div",{onClick:C=>{C.stopPropagation(),u(c=="time"?"date":"time")},className:"flex justify-center items-center text-[#a5a5a5] text-[11px] font-medium font-['Manrope'] leading-[13px] tracking-tight cursor-pointer min-w-max w-max",children:c=="time"?i.jsx(v,{date:l}):eu(l)})]})]})]})},eLt=({address:e,content:t,createdAt:n,typeId:r,isDateAnnouncementFormat:s,setIsDateAnnouncementFormat:a})=>{function o({date:u}){const[d,f]=m.useState(To(u));return m.useEffect(()=>{const x=setInterval(()=>{f(To(u))},1e3);return()=>clearInterval(x)},[u]),i.jsx("span",{className:"text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight",children:d.dateTime})}function l(u){if(!u)return null;try{const f=new URL(u).searchParams.get("v");return f?`https://img.youtube.com/vi/${f}/default.jpg`:null}catch(d){return console.error("Invalid YouTube URL:",u,d),null}}const c=l(t==null?void 0:t.url);return i.jsxs("span",{onClick:u=>{var d;u.preventDefault(),typeof(t==null?void 0:t.url)=="string"&&t.url.trim()!==""&&window.open((d=t==null?void 0:t.url)==null?void 0:d.trim(),"_blank")},className:`${typeof(t==null?void 0:t.url)=="string"&&t.url.trim()!==""?"cursor-pointer":""} flex gap-2 items-start justify-start px-3 pt-3 pb-2 bg-[#2b2b2b] rounded-2xl min-w-full hover:bg-[#404040] min-h-16 relative`,children:[i.jsx("div",{className:`${r==1?"w-8 h-8 min-w-8 min-h-8 bg-[#ff4848] rounded-full":r==2?c?"w-[75px] h-[56px] min-w-[75px] min-h-[56px] rounded-xl":"w-8 h-8 min-w-8 min-h-8 bg-[#FF0000] rounded-full":"w-8 h-8 min-w-8 min-h-8 bg-[#191919] rounded-full"} flex justify-center items-center overflow-hidden`,children:i.jsx("img",{src:r==1?pyt:r==2?c||gyt:xyt,alt:"",className:`${r==2?c?"w-[75px] h-[56px] min-w-[75px] min-h-[56px]":"w-[10px] h-[12px] min-w-[10px] min-h-[12px] ml-[2px]":r==3?"w-[13.92px] h-[13px] min-w-[13.92px] min-h-[13px]":"w-[18px] h-[18px] min-w-[18px] min-h-[18px]"}  `,loading:"lazy",onError:u=>sm(u)})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-[3px] w-full",children:[i.jsxs("div",{className:"flex justify-between items-center gap-1 w-full",children:[i.jsx("div",{className:"text-white text-[13px] font-bold font-['Manrope'] leading-[18px]",children:t==null?void 0:t.title}),typeof(t==null?void 0:t.url)=="string"&&t.url.trim()!==""&&i.jsx("div",{className:"w-[18px] h-[18px] min-w-[18px] min-h-[18px] flex justify-center items-center rounded",children:i.jsx("img",{src:nae,alt:""})})]}),i.jsx("span",{className:"text-[#B7B7B7] text-xs font-medium font-['Manrope'] leading-[15px] tracking-tight select-none max-w-[92%]",children:t==null?void 0:t.message}),i.jsx("div",{className:"flex justify-end items-center w-full",children:i.jsx("div",{onClick:u=>{u.stopPropagation(),a(s=="time"?"date":"time")},className:"flex justify-end items-center text-[#a5a5a5] text-[11px] font-medium font-['Manrope'] leading-[13px] tracking-tight cursor-pointer min-w-max w-max",children:s=="time"?i.jsx(o,{date:n}):eu(n)})})]})]})},tLt=()=>{const{hyperToken:e}=m.useContext(Gr),[t,n]=m.useState(!1);return i.jsxs(i.Fragment,{children:[i.jsx(v$,{open:t,setOpen:n}),i.jsx("div",{className:"bg-[#171717] w-full px-2 sm:px-6 border-b border-[#2a2a2a] z-50",children:i.jsxs("div",{className:"flex items-center w-full h-16 gap-2",children:[i.jsx("div",{className:"flex-none",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(XTt,{}),i.jsx("div",{onClick:()=>{window.location.href="/terminal/extended/BTC#gridbot"},className:"inline-flex font-manrope justify-center items-center gap-2 text-[13px] font-semibold text-white border border-[#6bb8ff] rounded-full px-3 py-[4px] cursor-pointer mr-2 shadow-[0_0_6px_rgba(116,192,252,0.35)] hover:shadow-[0_0_10px_rgba(116,192,252,0.55)] hover:border-[#8ccaff] hover:bg-[#1b2836] transition-all duration-200",children:"Extended Grid Bot"}),i.jsx("div",{onClick:()=>{window.location.href="/dca-bot"},className:"inline-flex font-manrope justify-center items-center gap-2 text-[13px] font-semibold text-white border border-[#6bb8ff] rounded-full px-3 py-[4px] cursor-pointer mr-2 shadow-[0_0_6px_rgba(116,192,252,0.35)] hover:shadow-[0_0_10px_rgba(116,192,252,0.55)] hover:border-[#8ccaff] hover:bg-[#1b2836] transition-all duration-200",children:"Extended DCA Bot"}),i.jsxs("div",{onClick:()=>{n(!0)},className:"inline-flex font-manrope justify-center items-center gap-2 text-[13px] font-semibold text-white border border-[#6bb8ff] rounded-full px-3 py-[4px] cursor-pointer mr-2 shadow-[0_0_6px_rgba(116,192,252,0.35)] hover:shadow-[0_0_10px_rgba(116,192,252,0.55)] hover:border-[#8ccaff] hover:bg-[#1b2836] transition-all duration-200",children:["Extended Farming",i.jsx(m0,{label:"NEW",tone:"emerald"})]})]})}),i.jsxs("div",{className:"ml-auto flex items-center",children:[i.jsx("div",{className:"hidden sm:block w-[140px] mr-[12px]",children:i.jsx(rMe,{})}),e&&i.jsx(QRt,{}),i.jsx(ZRt,{}),i.jsx("span",{className:"hidden sm:block ml-2",children:i.jsx(DRt,{})})]})]})})]})},zh=({className:e})=>i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("path",{d:"M9.96004 4.4751L6.70004 7.7351C6.31504 8.1201 5.68504 8.1201 5.30004 7.7351L2.04004 4.4751",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})});var xs;(function(e){e[e.QR_CODE=0]="QR_CODE",e[e.AZTEC=1]="AZTEC",e[e.CODABAR=2]="CODABAR",e[e.CODE_39=3]="CODE_39",e[e.CODE_93=4]="CODE_93",e[e.CODE_128=5]="CODE_128",e[e.DATA_MATRIX=6]="DATA_MATRIX",e[e.MAXICODE=7]="MAXICODE",e[e.ITF=8]="ITF",e[e.EAN_13=9]="EAN_13",e[e.EAN_8=10]="EAN_8",e[e.PDF_417=11]="PDF_417",e[e.RSS_14=12]="RSS_14",e[e.RSS_EXPANDED=13]="RSS_EXPANDED",e[e.UPC_A=14]="UPC_A",e[e.UPC_E=15]="UPC_E",e[e.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(xs||(xs={}));var Obe=new Map([[xs.QR_CODE,"QR_CODE"],[xs.AZTEC,"AZTEC"],[xs.CODABAR,"CODABAR"],[xs.CODE_39,"CODE_39"],[xs.CODE_93,"CODE_93"],[xs.CODE_128,"CODE_128"],[xs.DATA_MATRIX,"DATA_MATRIX"],[xs.MAXICODE,"MAXICODE"],[xs.ITF,"ITF"],[xs.EAN_13,"EAN_13"],[xs.EAN_8,"EAN_8"],[xs.PDF_417,"PDF_417"],[xs.RSS_14,"RSS_14"],[xs.RSS_EXPANDED,"RSS_EXPANDED"],[xs.UPC_A,"UPC_A"],[xs.UPC_E,"UPC_E"],[xs.UPC_EAN_EXTENSION,"UPC_EAN_EXTENSION"]]),Mbe;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.URL=1]="URL"})(Mbe||(Mbe={}));function nLt(e){return Object.values(xs).includes(e)}var LR;(function(e){e[e.SCAN_TYPE_CAMERA=0]="SCAN_TYPE_CAMERA",e[e.SCAN_TYPE_FILE=1]="SCAN_TYPE_FILE"})(LR||(LR={}));var rLt=function(){function e(){}return e.GITHUB_PROJECT_URL="https://github.com/mebjas/html5-qrcode",e.SCAN_DEFAULT_FPS=2,e.DEFAULT_DISABLE_FLIP=!1,e.DEFAULT_REMEMBER_LAST_CAMERA_USED=!0,e.DEFAULT_SUPPORTED_SCAN_TYPE=[LR.SCAN_TYPE_CAMERA,LR.SCAN_TYPE_FILE],e}(),vLe=function(){function e(t,n){this.format=t,this.formatName=n}return e.prototype.toString=function(){return this.formatName},e.create=function(t){if(!Obe.has(t))throw"".concat(t," not in html5QrcodeSupportedFormatsTextMap");return new e(t,Obe.get(t))},e}(),Rbe=function(){function e(){}return e.createFromText=function(t){var n={text:t};return{decodedText:t,result:n}},e.createFromQrcodeResult=function(t){return{decodedText:t.text,result:t}},e}(),ete;(function(e){e[e.UNKWOWN_ERROR=0]="UNKWOWN_ERROR",e[e.IMPLEMENTATION_ERROR=1]="IMPLEMENTATION_ERROR",e[e.NO_CODE_FOUND_ERROR=2]="NO_CODE_FOUND_ERROR"})(ete||(ete={}));var sLt=function(){function e(){}return e.createFrom=function(t){return{errorMessage:t,type:ete.UNKWOWN_ERROR}},e}(),iLt=function(){function e(t){this.verbose=t}return e.prototype.log=function(t){this.verbose&&console.log(t)},e.prototype.warn=function(t){this.verbose&&console.warn(t)},e.prototype.logError=function(t,n){(this.verbose||n===!0)&&console.error(t)},e.prototype.logErrors=function(t){if(t.length===0)throw"Logger#logError called without arguments";this.verbose&&console.error(t)},e}();function tg(e){return typeof e>"u"||e===null}var RC=function(){function e(){}return e.codeParseError=function(t){return"QR code parse error, error = ".concat(t)},e.errorGettingUserMedia=function(t){return"Error getting userMedia, error = ".concat(t)},e.onlyDeviceSupportedError=function(){return"The device doesn't support navigator.mediaDevices , only supported cameraIdOrConfig in this case is deviceId parameter (string)."},e.cameraStreamingNotSupported=function(){return"Camera streaming not supported by the browser."},e.unableToQuerySupportedDevices=function(){return"Unable to query supported devices, unknown error."},e.insecureContextCameraQueryError=function(){return"Camera access is only supported in secure context like https or localhost."},e.scannerPaused=function(){return"Scanner paused"},e}(),wLe=function(){function e(){}return e.isMediaStreamConstraintsValid=function(t,n){if(typeof t!="object"){var r=typeof t;return n.logError("videoConstraints should be of type object, the "+"object passed is of type ".concat(r,"."),!0),!1}for(var s=["autoGainControl","channelCount","echoCancellation","latency","noiseSuppression","sampleRate","sampleSize","volume"],a=new Set(s),o=Object.keys(t),l=0,c=o;l<c.length;l++){var u=c[l];if(a.has(u))return n.logError("".concat(u," is not supported videoConstaints."),!0),!1}return!0},e}(),Aj={exports:{}},aLt=Aj.exports,Lbe;function oLt(){return Lbe||(Lbe=1,function(e,t){(function(n,r){r(t)})(aLt,function(n){function r(ut){return ut==null}var s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ut,y){ut.__proto__=y}||function(ut,y){for(var E in y)y.hasOwnProperty(E)&&(ut[E]=y[E])};function a(ut,y){s(ut,y);function E(){this.constructor=ut}ut.prototype=y===null?Object.create(y):(E.prototype=y.prototype,new E)}function o(ut,y){var E=Object.setPrototypeOf;E?E(ut,y):ut.__proto__=y}function l(ut,y){y===void 0&&(y=ut.constructor);var E=Error.captureStackTrace;E&&E(ut,y)}var c=function(ut){a(y,ut);function y(E){var O=this.constructor,$=ut.call(this,E)||this;return Object.defineProperty($,"name",{value:O.name,enumerable:!1}),o($,O.prototype),l($),$}return y}(Error);class u extends c{constructor(y=void 0){super(y),this.message=y}getKind(){return this.constructor.kind}}u.kind="Exception";class d extends u{}d.kind="ArgumentException";class f extends u{}f.kind="IllegalArgumentException";class x{constructor(y){if(this.binarizer=y,y===null)throw new f("Binarizer must be non-null.")}getWidth(){return this.binarizer.getWidth()}getHeight(){return this.binarizer.getHeight()}getBlackRow(y,E){return this.binarizer.getBlackRow(y,E)}getBlackMatrix(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix}isCropSupported(){return this.binarizer.getLuminanceSource().isCropSupported()}crop(y,E,O,$){const H=this.binarizer.getLuminanceSource().crop(y,E,O,$);return new x(this.binarizer.createBinarizer(H))}isRotateSupported(){return this.binarizer.getLuminanceSource().isRotateSupported()}rotateCounterClockwise(){const y=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new x(this.binarizer.createBinarizer(y))}rotateCounterClockwise45(){const y=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new x(this.binarizer.createBinarizer(y))}toString(){try{return this.getBlackMatrix().toString()}catch{return""}}}class g extends u{static getChecksumInstance(){return new g}}g.kind="ChecksumException";class v{constructor(y){this.source=y}getLuminanceSource(){return this.source}getWidth(){return this.source.getWidth()}getHeight(){return this.source.getHeight()}}class w{static arraycopy(y,E,O,$,H){for(;H--;)O[$++]=y[E++]}static currentTimeMillis(){return Date.now()}}class C extends u{}C.kind="IndexOutOfBoundsException";class N extends C{constructor(y=void 0,E=void 0){super(E),this.index=y,this.message=E}}N.kind="ArrayIndexOutOfBoundsException";class I{static fill(y,E){for(let O=0,$=y.length;O<$;O++)y[O]=E}static fillWithin(y,E,O,$){I.rangeCheck(y.length,E,O);for(let H=E;H<O;H++)y[H]=$}static rangeCheck(y,E,O){if(E>O)throw new f("fromIndex("+E+") > toIndex("+O+")");if(E<0)throw new N(E);if(O>y)throw new N(O)}static asList(...y){return y}static create(y,E,O){return Array.from({length:y}).map(H=>Array.from({length:E}).fill(O))}static createInt32Array(y,E,O){return Array.from({length:y}).map(H=>Int32Array.from({length:E}).fill(O))}static equals(y,E){if(!y||!E||!y.length||!E.length||y.length!==E.length)return!1;for(let O=0,$=y.length;O<$;O++)if(y[O]!==E[O])return!1;return!0}static hashCode(y){if(y===null)return 0;let E=1;for(const O of y)E=31*E+O;return E}static fillUint8Array(y,E){for(let O=0;O!==y.length;O++)y[O]=E}static copyOf(y,E){return y.slice(0,E)}static copyOfUint8Array(y,E){if(y.length<=E){const O=new Uint8Array(E);return O.set(y),O}return y.slice(0,E)}static copyOfRange(y,E,O){const $=O-E,H=new Int32Array($);return w.arraycopy(y,E,H,0,$),H}static binarySearch(y,E,O){O===void 0&&(O=I.numberComparator);let $=0,H=y.length-1;for(;$<=H;){const K=H+$>>1,le=O(E,y[K]);if(le>0)$=K+1;else if(le<0)H=K-1;else return K}return-$-1}static numberComparator(y,E){return y-E}}class P{static numberOfTrailingZeros(y){let E;if(y===0)return 32;let O=31;return E=y<<16,E!==0&&(O-=16,y=E),E=y<<8,E!==0&&(O-=8,y=E),E=y<<4,E!==0&&(O-=4,y=E),E=y<<2,E!==0&&(O-=2,y=E),O-(y<<1>>>31)}static numberOfLeadingZeros(y){if(y===0)return 32;let E=1;return y>>>16||(E+=16,y<<=16),y>>>24||(E+=8,y<<=8),y>>>28||(E+=4,y<<=4),y>>>30||(E+=2,y<<=2),E-=y>>>31,E}static toHexString(y){return y.toString(16)}static toBinaryString(y){return String(parseInt(String(y),2))}static bitCount(y){return y=y-(y>>>1&1431655765),y=(y&858993459)+(y>>>2&858993459),y=y+(y>>>4)&252645135,y=y+(y>>>8),y=y+(y>>>16),y&63}static truncDivision(y,E){return Math.trunc(y/E)}static parseInt(y,E=void 0){return parseInt(y,E)}}P.MIN_VALUE_32_BITS=-2147483648,P.MAX_VALUE=Number.MAX_SAFE_INTEGER;class R{constructor(y,E){y===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=y,E==null?this.bits=R.makeArray(y):this.bits=E)}getSize(){return this.size}getSizeInBytes(){return Math.floor((this.size+7)/8)}ensureCapacity(y){if(y>this.bits.length*32){const E=R.makeArray(y);w.arraycopy(this.bits,0,E,0,this.bits.length),this.bits=E}}get(y){return(this.bits[Math.floor(y/32)]&1<<(y&31))!==0}set(y){this.bits[Math.floor(y/32)]|=1<<(y&31)}flip(y){this.bits[Math.floor(y/32)]^=1<<(y&31)}getNextSet(y){const E=this.size;if(y>=E)return E;const O=this.bits;let $=Math.floor(y/32),H=O[$];H&=~((1<<(y&31))-1);const K=O.length;for(;H===0;){if(++$===K)return E;H=O[$]}const le=$*32+P.numberOfTrailingZeros(H);return le>E?E:le}getNextUnset(y){const E=this.size;if(y>=E)return E;const O=this.bits;let $=Math.floor(y/32),H=~O[$];H&=~((1<<(y&31))-1);const K=O.length;for(;H===0;){if(++$===K)return E;H=~O[$]}const le=$*32+P.numberOfTrailingZeros(H);return le>E?E:le}setBulk(y,E){this.bits[Math.floor(y/32)]=E}setRange(y,E){if(E<y||y<0||E>this.size)throw new f;if(E===y)return;E--;const O=Math.floor(y/32),$=Math.floor(E/32),H=this.bits;for(let K=O;K<=$;K++){const le=K>O?0:y&31,Te=(2<<(K<$?31:E&31))-(1<<le);H[K]|=Te}}clear(){const y=this.bits.length,E=this.bits;for(let O=0;O<y;O++)E[O]=0}isRange(y,E,O){if(E<y||y<0||E>this.size)throw new f;if(E===y)return!0;E--;const $=Math.floor(y/32),H=Math.floor(E/32),K=this.bits;for(let le=$;le<=H;le++){const ve=le>$?0:y&31,Ze=(2<<(le<H?31:E&31))-(1<<ve)&4294967295;if((K[le]&Ze)!==(O?Ze:0))return!1}return!0}appendBit(y){this.ensureCapacity(this.size+1),y&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++}appendBits(y,E){if(E<0||E>32)throw new f("Num bits must be between 0 and 32");this.ensureCapacity(this.size+E);for(let O=E;O>0;O--)this.appendBit((y>>O-1&1)===1)}appendBitArray(y){const E=y.size;this.ensureCapacity(this.size+E);for(let O=0;O<E;O++)this.appendBit(y.get(O))}xor(y){if(this.size!==y.size)throw new f("Sizes don't match");const E=this.bits;for(let O=0,$=E.length;O<$;O++)E[O]^=y.bits[O]}toBytes(y,E,O,$){for(let H=0;H<$;H++){let K=0;for(let le=0;le<8;le++)this.get(y)&&(K|=1<<7-le),y++;E[O+H]=K}}getBitArray(){return this.bits}reverse(){const y=new Int32Array(this.bits.length),E=Math.floor((this.size-1)/32),O=E+1,$=this.bits;for(let H=0;H<O;H++){let K=$[H];K=K>>1&1431655765|(K&1431655765)<<1,K=K>>2&858993459|(K&858993459)<<2,K=K>>4&252645135|(K&252645135)<<4,K=K>>8&16711935|(K&16711935)<<8,K=K>>16&65535|(K&65535)<<16,y[E-H]=K}if(this.size!==O*32){const H=O*32-this.size;let K=y[0]>>>H;for(let le=1;le<O;le++){const ve=y[le];K|=ve<<32-H,y[le-1]=K,K=ve>>>H}y[O-1]=K}this.bits=y}static makeArray(y){return new Int32Array(Math.floor((y+31)/32))}equals(y){if(!(y instanceof R))return!1;const E=y;return this.size===E.size&&I.equals(this.bits,E.bits)}hashCode(){return 31*this.size+I.hashCode(this.bits)}toString(){let y="";for(let E=0,O=this.size;E<O;E++)E&7||(y+=" "),y+=this.get(E)?"X":".";return y}clone(){return new R(this.size,this.bits.slice())}}var F;(function(ut){ut[ut.OTHER=0]="OTHER",ut[ut.PURE_BARCODE=1]="PURE_BARCODE",ut[ut.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",ut[ut.TRY_HARDER=3]="TRY_HARDER",ut[ut.CHARACTER_SET=4]="CHARACTER_SET",ut[ut.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",ut[ut.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",ut[ut.ASSUME_GS1=7]="ASSUME_GS1",ut[ut.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",ut[ut.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",ut[ut.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(F||(F={}));var U=F;class L extends u{static getFormatInstance(){return new L}}L.kind="FormatException";var z;(function(ut){ut[ut.Cp437=0]="Cp437",ut[ut.ISO8859_1=1]="ISO8859_1",ut[ut.ISO8859_2=2]="ISO8859_2",ut[ut.ISO8859_3=3]="ISO8859_3",ut[ut.ISO8859_4=4]="ISO8859_4",ut[ut.ISO8859_5=5]="ISO8859_5",ut[ut.ISO8859_6=6]="ISO8859_6",ut[ut.ISO8859_7=7]="ISO8859_7",ut[ut.ISO8859_8=8]="ISO8859_8",ut[ut.ISO8859_9=9]="ISO8859_9",ut[ut.ISO8859_10=10]="ISO8859_10",ut[ut.ISO8859_11=11]="ISO8859_11",ut[ut.ISO8859_13=12]="ISO8859_13",ut[ut.ISO8859_14=13]="ISO8859_14",ut[ut.ISO8859_15=14]="ISO8859_15",ut[ut.ISO8859_16=15]="ISO8859_16",ut[ut.SJIS=16]="SJIS",ut[ut.Cp1250=17]="Cp1250",ut[ut.Cp1251=18]="Cp1251",ut[ut.Cp1252=19]="Cp1252",ut[ut.Cp1256=20]="Cp1256",ut[ut.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",ut[ut.UTF8=22]="UTF8",ut[ut.ASCII=23]="ASCII",ut[ut.Big5=24]="Big5",ut[ut.GB18030=25]="GB18030",ut[ut.EUC_KR=26]="EUC_KR"})(z||(z={}));class X{constructor(y,E,O,...$){this.valueIdentifier=y,this.name=O,typeof E=="number"?this.values=Int32Array.from([E]):this.values=E,this.otherEncodingNames=$,X.VALUE_IDENTIFIER_TO_ECI.set(y,this),X.NAME_TO_ECI.set(O,this);const H=this.values;for(let K=0,le=H.length;K!==le;K++){const ve=H[K];X.VALUES_TO_ECI.set(ve,this)}for(const K of $)X.NAME_TO_ECI.set(K,this)}getValueIdentifier(){return this.valueIdentifier}getName(){return this.name}getValue(){return this.values[0]}static getCharacterSetECIByValue(y){if(y<0||y>=900)throw new L("incorect value");const E=X.VALUES_TO_ECI.get(y);if(E===void 0)throw new L("incorect value");return E}static getCharacterSetECIByName(y){const E=X.NAME_TO_ECI.get(y);if(E===void 0)throw new L("incorect value");return E}equals(y){if(!(y instanceof X))return!1;const E=y;return this.getName()===E.getName()}}X.VALUE_IDENTIFIER_TO_ECI=new Map,X.VALUES_TO_ECI=new Map,X.NAME_TO_ECI=new Map,X.Cp437=new X(z.Cp437,Int32Array.from([0,2]),"Cp437"),X.ISO8859_1=new X(z.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),X.ISO8859_2=new X(z.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),X.ISO8859_3=new X(z.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),X.ISO8859_4=new X(z.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),X.ISO8859_5=new X(z.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),X.ISO8859_6=new X(z.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),X.ISO8859_7=new X(z.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),X.ISO8859_8=new X(z.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),X.ISO8859_9=new X(z.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),X.ISO8859_10=new X(z.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),X.ISO8859_11=new X(z.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),X.ISO8859_13=new X(z.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),X.ISO8859_14=new X(z.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),X.ISO8859_15=new X(z.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),X.ISO8859_16=new X(z.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),X.SJIS=new X(z.SJIS,20,"SJIS","Shift_JIS"),X.Cp1250=new X(z.Cp1250,21,"Cp1250","windows-1250"),X.Cp1251=new X(z.Cp1251,22,"Cp1251","windows-1251"),X.Cp1252=new X(z.Cp1252,23,"Cp1252","windows-1252"),X.Cp1256=new X(z.Cp1256,24,"Cp1256","windows-1256"),X.UnicodeBigUnmarked=new X(z.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),X.UTF8=new X(z.UTF8,26,"UTF8","UTF-8"),X.ASCII=new X(z.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),X.Big5=new X(z.Big5,28,"Big5"),X.GB18030=new X(z.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),X.EUC_KR=new X(z.EUC_KR,30,"EUC_KR","EUC-KR");class ne extends u{}ne.kind="UnsupportedOperationException";class J{static decode(y,E){const O=this.encodingName(E);return this.customDecoder?this.customDecoder(y,O):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(O)?this.decodeFallback(y,O):new TextDecoder(O).decode(y)}static shouldDecodeOnFallback(y){return!J.isBrowser()&&y==="ISO-8859-1"}static encode(y,E){const O=this.encodingName(E);return this.customEncoder?this.customEncoder(y,O):typeof TextEncoder>"u"?this.encodeFallback(y):new TextEncoder().encode(y)}static isBrowser(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"}static encodingName(y){return typeof y=="string"?y:y.getName()}static encodingCharacterSet(y){return y instanceof X?y:X.getCharacterSetECIByName(y)}static decodeFallback(y,E){const O=this.encodingCharacterSet(E);if(J.isDecodeFallbackSupported(O)){let $="";for(let H=0,K=y.length;H<K;H++){let le=y[H].toString(16);le.length<2&&(le="0"+le),$+="%"+le}return decodeURIComponent($)}if(O.equals(X.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(y.buffer));throw new ne(`Encoding ${this.encodingName(E)} not supported by fallback.`)}static isDecodeFallbackSupported(y){return y.equals(X.UTF8)||y.equals(X.ISO8859_1)||y.equals(X.ASCII)}static encodeFallback(y){const O=btoa(unescape(encodeURIComponent(y))).split(""),$=[];for(let H=0;H<O.length;H++)$.push(O[H].charCodeAt(0));return new Uint8Array($)}}class Z{static castAsNonUtf8Char(y,E=null){const O=E?E.getName():this.ISO88591;return J.decode(new Uint8Array([y]),O)}static guessEncoding(y,E){if(E!=null&&E.get(U.CHARACTER_SET)!==void 0)return E.get(U.CHARACTER_SET).toString();const O=y.length;let $=!0,H=!0,K=!0,le=0,ve=0,Te=0,Ze=0,ht=0,_t=0,rn=0,bt=0,zt=0,qt=0,Tn=0;const ir=y.length>3&&y[0]===239&&y[1]===187&&y[2]===191;for(let Cr=0;Cr<O&&($||H||K);Cr++){const Ar=y[Cr]&255;K&&(le>0?Ar&128?le--:K=!1:Ar&128&&(Ar&64?(le++,Ar&32?(le++,Ar&16?(le++,Ar&8?K=!1:Ze++):Te++):ve++):K=!1)),$&&(Ar>127&&Ar<160?$=!1:Ar>159&&(Ar<192||Ar===215||Ar===247)&&Tn++),H&&(ht>0?Ar<64||Ar===127||Ar>252?H=!1:ht--:Ar===128||Ar===160||Ar>239?H=!1:Ar>160&&Ar<224?(_t++,bt=0,rn++,rn>zt&&(zt=rn)):Ar>127?(ht++,rn=0,bt++,bt>qt&&(qt=bt)):(rn=0,bt=0))}return K&&le>0&&(K=!1),H&&ht>0&&(H=!1),K&&(ir||ve+Te+Ze>0)?Z.UTF8:H&&(Z.ASSUME_SHIFT_JIS||zt>=3||qt>=3)?Z.SHIFT_JIS:$&&H?zt===2&&_t===2||Tn*10>=O?Z.SHIFT_JIS:Z.ISO88591:$?Z.ISO88591:H?Z.SHIFT_JIS:K?Z.UTF8:Z.PLATFORM_DEFAULT_ENCODING}static format(y,...E){let O=-1;function $(K,le,ve,Te,Ze,ht){if(K==="%%")return"%";if(E[++O]===void 0)return;K=Te?parseInt(Te.substr(1)):void 0;let _t=Ze?parseInt(Ze.substr(1)):void 0,rn;switch(ht){case"s":rn=E[O];break;case"c":rn=E[O][0];break;case"f":rn=parseFloat(E[O]).toFixed(K);break;case"p":rn=parseFloat(E[O]).toPrecision(K);break;case"e":rn=parseFloat(E[O]).toExponential(K);break;case"x":rn=parseInt(E[O]).toString(_t||16);break;case"d":rn=parseFloat(parseInt(E[O],_t||10).toPrecision(K)).toFixed(0);break}rn=typeof rn=="object"?JSON.stringify(rn):(+rn).toString(_t);let bt=parseInt(ve),zt=ve&&ve[0]+""=="0"?"0":" ";for(;rn.length<bt;)rn=le!==void 0?rn+zt:zt+rn;return rn}let H=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return y.replace(H,$)}static getBytes(y,E){return J.encode(y,E)}static getCharCode(y,E=0){return y.charCodeAt(E)}static getCharAt(y){return String.fromCharCode(y)}}Z.SHIFT_JIS=X.SJIS.getName(),Z.GB2312="GB2312",Z.ISO88591=X.ISO8859_1.getName(),Z.EUC_JP="EUC_JP",Z.UTF8=X.UTF8.getName(),Z.PLATFORM_DEFAULT_ENCODING=Z.UTF8,Z.ASSUME_SHIFT_JIS=!1;class re{constructor(y=""){this.value=y}enableDecoding(y){return this.encoding=y,this}append(y){return typeof y=="string"?this.value+=y.toString():this.encoding?this.value+=Z.castAsNonUtf8Char(y,this.encoding):this.value+=String.fromCharCode(y),this}appendChars(y,E,O){for(let $=E;E<E+O;$++)this.append(y[$]);return this}length(){return this.value.length}charAt(y){return this.value.charAt(y)}deleteCharAt(y){this.value=this.value.substr(0,y)+this.value.substring(y+1)}setCharAt(y,E){this.value=this.value.substr(0,y)+E+this.value.substr(y+1)}substring(y,E){return this.value.substring(y,E)}setLengthToZero(){this.value=""}toString(){return this.value}insert(y,E){this.value=this.value.substr(0,y)+E+this.value.substr(y+E.length)}}class he{constructor(y,E,O,$){if(this.width=y,this.height=E,this.rowSize=O,this.bits=$,E==null&&(E=y),this.height=E,y<1||E<1)throw new f("Both dimensions must be greater than 0");O==null&&(O=Math.floor((y+31)/32)),this.rowSize=O,$==null&&(this.bits=new Int32Array(this.rowSize*this.height))}static parseFromBooleanArray(y){const E=y.length,O=y[0].length,$=new he(O,E);for(let H=0;H<E;H++){const K=y[H];for(let le=0;le<O;le++)K[le]&&$.set(le,H)}return $}static parseFromString(y,E,O){if(y===null)throw new f("stringRepresentation cannot be null");const $=new Array(y.length);let H=0,K=0,le=-1,ve=0,Te=0;for(;Te<y.length;)if(y.charAt(Te)===`
`||y.charAt(Te)==="\r"){if(H>K){if(le===-1)le=H-K;else if(H-K!==le)throw new f("row lengths do not match");K=H,ve++}Te++}else if(y.substring(Te,Te+E.length)===E)Te+=E.length,$[H]=!0,H++;else if(y.substring(Te,Te+O.length)===O)Te+=O.length,$[H]=!1,H++;else throw new f("illegal character encountered: "+y.substring(Te));if(H>K){if(le===-1)le=H-K;else if(H-K!==le)throw new f("row lengths do not match");ve++}const Ze=new he(le,ve);for(let ht=0;ht<H;ht++)$[ht]&&Ze.set(Math.floor(ht%le),Math.floor(ht/le));return Ze}get(y,E){const O=E*this.rowSize+Math.floor(y/32);return(this.bits[O]>>>(y&31)&1)!==0}set(y,E){const O=E*this.rowSize+Math.floor(y/32);this.bits[O]|=1<<(y&31)&4294967295}unset(y,E){const O=E*this.rowSize+Math.floor(y/32);this.bits[O]&=~(1<<(y&31)&4294967295)}flip(y,E){const O=E*this.rowSize+Math.floor(y/32);this.bits[O]^=1<<(y&31)&4294967295}xor(y){if(this.width!==y.getWidth()||this.height!==y.getHeight()||this.rowSize!==y.getRowSize())throw new f("input matrix dimensions do not match");const E=new R(Math.floor(this.width/32)+1),O=this.rowSize,$=this.bits;for(let H=0,K=this.height;H<K;H++){const le=H*O,ve=y.getRow(H,E).getBitArray();for(let Te=0;Te<O;Te++)$[le+Te]^=ve[Te]}}clear(){const y=this.bits,E=y.length;for(let O=0;O<E;O++)y[O]=0}setRegion(y,E,O,$){if(E<0||y<0)throw new f("Left and top must be nonnegative");if($<1||O<1)throw new f("Height and width must be at least 1");const H=y+O,K=E+$;if(K>this.height||H>this.width)throw new f("The region must fit inside the matrix");const le=this.rowSize,ve=this.bits;for(let Te=E;Te<K;Te++){const Ze=Te*le;for(let ht=y;ht<H;ht++)ve[Ze+Math.floor(ht/32)]|=1<<(ht&31)&4294967295}}getRow(y,E){E==null||E.getSize()<this.width?E=new R(this.width):E.clear();const O=this.rowSize,$=this.bits,H=y*O;for(let K=0;K<O;K++)E.setBulk(K*32,$[H+K]);return E}setRow(y,E){w.arraycopy(E.getBitArray(),0,this.bits,y*this.rowSize,this.rowSize)}rotate180(){const y=this.getWidth(),E=this.getHeight();let O=new R(y),$=new R(y);for(let H=0,K=Math.floor((E+1)/2);H<K;H++)O=this.getRow(H,O),$=this.getRow(E-1-H,$),O.reverse(),$.reverse(),this.setRow(H,$),this.setRow(E-1-H,O)}getEnclosingRectangle(){const y=this.width,E=this.height,O=this.rowSize,$=this.bits;let H=y,K=E,le=-1,ve=-1;for(let Te=0;Te<E;Te++)for(let Ze=0;Ze<O;Ze++){const ht=$[Te*O+Ze];if(ht!==0){if(Te<K&&(K=Te),Te>ve&&(ve=Te),Ze*32<H){let _t=0;for(;!(ht<<31-_t&4294967295);)_t++;Ze*32+_t<H&&(H=Ze*32+_t)}if(Ze*32+31>le){let _t=31;for(;!(ht>>>_t);)_t--;Ze*32+_t>le&&(le=Ze*32+_t)}}}return le<H||ve<K?null:Int32Array.from([H,K,le-H+1,ve-K+1])}getTopLeftOnBit(){const y=this.rowSize,E=this.bits;let O=0;for(;O<E.length&&E[O]===0;)O++;if(O===E.length)return null;const $=O/y;let H=O%y*32;const K=E[O];let le=0;for(;!(K<<31-le&4294967295);)le++;return H+=le,Int32Array.from([H,$])}getBottomRightOnBit(){const y=this.rowSize,E=this.bits;let O=E.length-1;for(;O>=0&&E[O]===0;)O--;if(O<0)return null;const $=Math.floor(O/y);let H=Math.floor(O%y)*32;const K=E[O];let le=31;for(;!(K>>>le);)le--;return H+=le,Int32Array.from([H,$])}getWidth(){return this.width}getHeight(){return this.height}getRowSize(){return this.rowSize}equals(y){if(!(y instanceof he))return!1;const E=y;return this.width===E.width&&this.height===E.height&&this.rowSize===E.rowSize&&I.equals(this.bits,E.bits)}hashCode(){let y=this.width;return y=31*y+this.width,y=31*y+this.height,y=31*y+this.rowSize,y=31*y+I.hashCode(this.bits),y}toString(y="X ",E="  ",O=`
`){return this.buildToString(y,E,O)}buildToString(y,E,O){let $=new re;for(let H=0,K=this.height;H<K;H++){for(let le=0,ve=this.width;le<ve;le++)$.append(this.get(le,H)?y:E);$.append(O)}return $.toString()}clone(){return new he(this.width,this.height,this.rowSize,this.bits.slice())}}class Y extends u{static getNotFoundInstance(){return new Y}}Y.kind="NotFoundException";class ie extends v{constructor(y){super(y),this.luminances=ie.EMPTY,this.buckets=new Int32Array(ie.LUMINANCE_BUCKETS)}getBlackRow(y,E){const O=this.getLuminanceSource(),$=O.getWidth();E==null||E.getSize()<$?E=new R($):E.clear(),this.initArrays($);const H=O.getRow(y,this.luminances),K=this.buckets;for(let ve=0;ve<$;ve++)K[(H[ve]&255)>>ie.LUMINANCE_SHIFT]++;const le=ie.estimateBlackPoint(K);if($<3)for(let ve=0;ve<$;ve++)(H[ve]&255)<le&&E.set(ve);else{let ve=H[0]&255,Te=H[1]&255;for(let Ze=1;Ze<$-1;Ze++){const ht=H[Ze+1]&255;(Te*4-ve-ht)/2<le&&E.set(Ze),ve=Te,Te=ht}}return E}getBlackMatrix(){const y=this.getLuminanceSource(),E=y.getWidth(),O=y.getHeight(),$=new he(E,O);this.initArrays(E);const H=this.buckets;for(let ve=1;ve<5;ve++){const Te=Math.floor(O*ve/5),Ze=y.getRow(Te,this.luminances),ht=Math.floor(E*4/5);for(let _t=Math.floor(E/5);_t<ht;_t++){const rn=Ze[_t]&255;H[rn>>ie.LUMINANCE_SHIFT]++}}const K=ie.estimateBlackPoint(H),le=y.getMatrix();for(let ve=0;ve<O;ve++){const Te=ve*E;for(let Ze=0;Ze<E;Ze++)(le[Te+Ze]&255)<K&&$.set(Ze,ve)}return $}createBinarizer(y){return new ie(y)}initArrays(y){this.luminances.length<y&&(this.luminances=new Uint8ClampedArray(y));const E=this.buckets;for(let O=0;O<ie.LUMINANCE_BUCKETS;O++)E[O]=0}static estimateBlackPoint(y){const E=y.length;let O=0,$=0,H=0;for(let Ze=0;Ze<E;Ze++)y[Ze]>H&&($=Ze,H=y[Ze]),y[Ze]>O&&(O=y[Ze]);let K=0,le=0;for(let Ze=0;Ze<E;Ze++){const ht=Ze-$,_t=y[Ze]*ht*ht;_t>le&&(K=Ze,le=_t)}if($>K){const Ze=$;$=K,K=Ze}if(K-$<=E/16)throw new Y;let ve=K-1,Te=-1;for(let Ze=K-1;Ze>$;Ze--){const ht=Ze-$,_t=ht*ht*(K-Ze)*(O-y[Ze]);_t>Te&&(ve=Ze,Te=_t)}return ve<<ie.LUMINANCE_SHIFT}}ie.LUMINANCE_BITS=5,ie.LUMINANCE_SHIFT=8-ie.LUMINANCE_BITS,ie.LUMINANCE_BUCKETS=1<<ie.LUMINANCE_BITS,ie.EMPTY=Uint8ClampedArray.from([0]);class oe extends ie{constructor(y){super(y),this.matrix=null}getBlackMatrix(){if(this.matrix!==null)return this.matrix;const y=this.getLuminanceSource(),E=y.getWidth(),O=y.getHeight();if(E>=oe.MINIMUM_DIMENSION&&O>=oe.MINIMUM_DIMENSION){const $=y.getMatrix();let H=E>>oe.BLOCK_SIZE_POWER;E&oe.BLOCK_SIZE_MASK&&H++;let K=O>>oe.BLOCK_SIZE_POWER;O&oe.BLOCK_SIZE_MASK&&K++;const le=oe.calculateBlackPoints($,H,K,E,O),ve=new he(E,O);oe.calculateThresholdForBlock($,H,K,E,O,le,ve),this.matrix=ve}else this.matrix=super.getBlackMatrix();return this.matrix}createBinarizer(y){return new oe(y)}static calculateThresholdForBlock(y,E,O,$,H,K,le){const ve=H-oe.BLOCK_SIZE,Te=$-oe.BLOCK_SIZE;for(let Ze=0;Ze<O;Ze++){let ht=Ze<<oe.BLOCK_SIZE_POWER;ht>ve&&(ht=ve);const _t=oe.cap(Ze,2,O-3);for(let rn=0;rn<E;rn++){let bt=rn<<oe.BLOCK_SIZE_POWER;bt>Te&&(bt=Te);const zt=oe.cap(rn,2,E-3);let qt=0;for(let ir=-2;ir<=2;ir++){const Cr=K[_t+ir];qt+=Cr[zt-2]+Cr[zt-1]+Cr[zt]+Cr[zt+1]+Cr[zt+2]}const Tn=qt/25;oe.thresholdBlock(y,bt,ht,Tn,$,le)}}}static cap(y,E,O){return y<E?E:y>O?O:y}static thresholdBlock(y,E,O,$,H,K){for(let le=0,ve=O*H+E;le<oe.BLOCK_SIZE;le++,ve+=H)for(let Te=0;Te<oe.BLOCK_SIZE;Te++)(y[ve+Te]&255)<=$&&K.set(E+Te,O+le)}static calculateBlackPoints(y,E,O,$,H){const K=H-oe.BLOCK_SIZE,le=$-oe.BLOCK_SIZE,ve=new Array(O);for(let Te=0;Te<O;Te++){ve[Te]=new Int32Array(E);let Ze=Te<<oe.BLOCK_SIZE_POWER;Ze>K&&(Ze=K);for(let ht=0;ht<E;ht++){let _t=ht<<oe.BLOCK_SIZE_POWER;_t>le&&(_t=le);let rn=0,bt=255,zt=0;for(let Tn=0,ir=Ze*$+_t;Tn<oe.BLOCK_SIZE;Tn++,ir+=$){for(let Cr=0;Cr<oe.BLOCK_SIZE;Cr++){const Ar=y[ir+Cr]&255;rn+=Ar,Ar<bt&&(bt=Ar),Ar>zt&&(zt=Ar)}if(zt-bt>oe.MIN_DYNAMIC_RANGE)for(Tn++,ir+=$;Tn<oe.BLOCK_SIZE;Tn++,ir+=$)for(let Cr=0;Cr<oe.BLOCK_SIZE;Cr++)rn+=y[ir+Cr]&255}let qt=rn>>oe.BLOCK_SIZE_POWER*2;if(zt-bt<=oe.MIN_DYNAMIC_RANGE&&(qt=bt/2,Te>0&&ht>0)){const Tn=(ve[Te-1][ht]+2*ve[Te][ht-1]+ve[Te-1][ht-1])/4;bt<Tn&&(qt=Tn)}ve[Te][ht]=qt}}return ve}}oe.BLOCK_SIZE_POWER=3,oe.BLOCK_SIZE=1<<oe.BLOCK_SIZE_POWER,oe.BLOCK_SIZE_MASK=oe.BLOCK_SIZE-1,oe.MINIMUM_DIMENSION=oe.BLOCK_SIZE*5,oe.MIN_DYNAMIC_RANGE=24;class G{constructor(y,E){this.width=y,this.height=E}getWidth(){return this.width}getHeight(){return this.height}isCropSupported(){return!1}crop(y,E,O,$){throw new ne("This luminance source does not support cropping.")}isRotateSupported(){return!1}rotateCounterClockwise(){throw new ne("This luminance source does not support rotation by 90 degrees.")}rotateCounterClockwise45(){throw new ne("This luminance source does not support rotation by 45 degrees.")}toString(){const y=new Uint8ClampedArray(this.width);let E=new re;for(let O=0;O<this.height;O++){const $=this.getRow(O,y);for(let H=0;H<this.width;H++){const K=$[H]&255;let le;K<64?le="#":K<128?le="+":K<192?le=".":le=" ",E.append(le)}E.append(`
`)}return E.toString()}}class V extends G{constructor(y){super(y.getWidth(),y.getHeight()),this.delegate=y}getRow(y,E){const O=this.delegate.getRow(y,E),$=this.getWidth();for(let H=0;H<$;H++)O[H]=255-(O[H]&255);return O}getMatrix(){const y=this.delegate.getMatrix(),E=this.getWidth()*this.getHeight(),O=new Uint8ClampedArray(E);for(let $=0;$<E;$++)O[$]=255-(y[$]&255);return O}isCropSupported(){return this.delegate.isCropSupported()}crop(y,E,O,$){return new V(this.delegate.crop(y,E,O,$))}isRotateSupported(){return this.delegate.isRotateSupported()}invert(){return this.delegate}rotateCounterClockwise(){return new V(this.delegate.rotateCounterClockwise())}rotateCounterClockwise45(){return new V(this.delegate.rotateCounterClockwise45())}}class ee extends G{constructor(y){super(y.width,y.height),this.canvas=y,this.tempCanvasElement=null,this.buffer=ee.makeBufferFromCanvasImageData(y)}static makeBufferFromCanvasImageData(y){const E=y.getContext("2d").getImageData(0,0,y.width,y.height);return ee.toGrayscaleBuffer(E.data,y.width,y.height)}static toGrayscaleBuffer(y,E,O){const $=new Uint8ClampedArray(E*O);for(let H=0,K=0,le=y.length;H<le;H+=4,K++){let ve;if(y[H+3]===0)ve=255;else{const Ze=y[H],ht=y[H+1],_t=y[H+2];ve=306*Ze+601*ht+117*_t+512>>10}$[K]=ve}return $}getRow(y,E){if(y<0||y>=this.getHeight())throw new f("Requested row is outside the image: "+y);const O=this.getWidth(),$=y*O;return E===null?E=this.buffer.slice($,$+O):(E.length<O&&(E=new Uint8ClampedArray(O)),E.set(this.buffer.slice($,$+O))),E}getMatrix(){return this.buffer}isCropSupported(){return!0}crop(y,E,O,$){return super.crop(y,E,O,$),this}isRotateSupported(){return!0}rotateCounterClockwise(){return this.rotate(-90),this}rotateCounterClockwise45(){return this.rotate(-45),this}getTempCanvasElement(){if(this.tempCanvasElement===null){const y=this.canvas.ownerDocument.createElement("canvas");y.width=this.canvas.width,y.height=this.canvas.height,this.tempCanvasElement=y}return this.tempCanvasElement}rotate(y){const E=this.getTempCanvasElement(),O=E.getContext("2d"),$=y*ee.DEGREE_TO_RADIANS,H=this.canvas.width,K=this.canvas.height,le=Math.ceil(Math.abs(Math.cos($))*H+Math.abs(Math.sin($))*K),ve=Math.ceil(Math.abs(Math.sin($))*H+Math.abs(Math.cos($))*K);return E.width=le,E.height=ve,O.translate(le/2,ve/2),O.rotate($),O.drawImage(this.canvas,H/-2,K/-2),this.buffer=ee.makeBufferFromCanvasImageData(E),this}invert(){return new V(this)}}ee.DEGREE_TO_RADIANS=Math.PI/180;class ae{constructor(y,E,O){this.deviceId=y,this.label=E,this.kind="videoinput",this.groupId=O||void 0}toJSON(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}}}var fe=(globalThis||ju||self||window||void 0)&&(globalThis||ju||self||window||void 0).__awaiter||function(ut,y,E,O){function $(H){return H instanceof E?H:new E(function(K){K(H)})}return new(E||(E=Promise))(function(H,K){function le(Ze){try{Te(O.next(Ze))}catch(ht){K(ht)}}function ve(Ze){try{Te(O.throw(Ze))}catch(ht){K(ht)}}function Te(Ze){Ze.done?H(Ze.value):$(Ze.value).then(le,ve)}Te((O=O.apply(ut,y||[])).next())})};class Ae{constructor(y,E=500,O){this.reader=y,this.timeBetweenScansMillis=E,this._hints=O,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}get hasNavigator(){return typeof navigator<"u"}get isMediaDevicesSuported(){return this.hasNavigator&&!!navigator.mediaDevices}get canEnumerateDevices(){return!!(this.isMediaDevicesSuported&&navigator.mediaDevices.enumerateDevices)}get timeBetweenDecodingAttempts(){return this._timeBetweenDecodingAttempts}set timeBetweenDecodingAttempts(y){this._timeBetweenDecodingAttempts=y<0?0:y}set hints(y){this._hints=y||null}get hints(){return this._hints}listVideoInputDevices(){return fe(this,void 0,void 0,function*(){if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");const y=yield navigator.mediaDevices.enumerateDevices(),E=[];for(const O of y){const $=O.kind==="video"?"videoinput":O.kind;if($!=="videoinput")continue;const H=O.deviceId||O.id,K=O.label||`Video device ${E.length+1}`,le=O.groupId,ve={deviceId:H,label:K,kind:$,groupId:le};E.push(ve)}return E})}getVideoInputDevices(){return fe(this,void 0,void 0,function*(){return(yield this.listVideoInputDevices()).map(E=>new ae(E.deviceId,E.label))})}findDeviceById(y){return fe(this,void 0,void 0,function*(){const E=yield this.listVideoInputDevices();return E?E.find(O=>O.deviceId===y):null})}decodeFromInputVideoDevice(y,E){return fe(this,void 0,void 0,function*(){return yield this.decodeOnceFromVideoDevice(y,E)})}decodeOnceFromVideoDevice(y,E){return fe(this,void 0,void 0,function*(){this.reset();let O;y?O={deviceId:{exact:y}}:O={facingMode:"environment"};const $={video:O};return yield this.decodeOnceFromConstraints($,E)})}decodeOnceFromConstraints(y,E){return fe(this,void 0,void 0,function*(){const O=yield navigator.mediaDevices.getUserMedia(y);return yield this.decodeOnceFromStream(O,E)})}decodeOnceFromStream(y,E){return fe(this,void 0,void 0,function*(){this.reset();const O=yield this.attachStreamToVideo(y,E);return yield this.decodeOnce(O)})}decodeFromInputVideoDeviceContinuously(y,E,O){return fe(this,void 0,void 0,function*(){return yield this.decodeFromVideoDevice(y,E,O)})}decodeFromVideoDevice(y,E,O){return fe(this,void 0,void 0,function*(){let $;y?$={deviceId:{exact:y}}:$={facingMode:"environment"};const H={video:$};return yield this.decodeFromConstraints(H,E,O)})}decodeFromConstraints(y,E,O){return fe(this,void 0,void 0,function*(){const $=yield navigator.mediaDevices.getUserMedia(y);return yield this.decodeFromStream($,E,O)})}decodeFromStream(y,E,O){return fe(this,void 0,void 0,function*(){this.reset();const $=yield this.attachStreamToVideo(y,E);return yield this.decodeContinuously($,O)})}stopAsyncDecode(){this._stopAsyncDecode=!0}stopContinuousDecode(){this._stopContinuousDecode=!0}attachStreamToVideo(y,E){return fe(this,void 0,void 0,function*(){const O=this.prepareVideoElement(E);return this.addVideoSource(O,y),this.videoElement=O,this.stream=y,yield this.playVideoOnLoadAsync(O),O})}playVideoOnLoadAsync(y){return new Promise((E,O)=>this.playVideoOnLoad(y,()=>E()))}playVideoOnLoad(y,E){this.videoEndedListener=()=>this.stopStreams(),this.videoCanPlayListener=()=>this.tryPlayVideo(y),y.addEventListener("ended",this.videoEndedListener),y.addEventListener("canplay",this.videoCanPlayListener),y.addEventListener("playing",E),this.tryPlayVideo(y)}isVideoPlaying(y){return y.currentTime>0&&!y.paused&&!y.ended&&y.readyState>2}tryPlayVideo(y){return fe(this,void 0,void 0,function*(){if(this.isVideoPlaying(y)){console.warn("Trying to play video that is already playing.");return}try{yield y.play()}catch{console.warn("It was not possible to play the video.")}})}getMediaElement(y,E){const O=document.getElementById(y);if(!O)throw new d(`element with id '${y}' not found`);if(O.nodeName.toLowerCase()!==E.toLowerCase())throw new d(`element with id '${y}' must be an ${E} element`);return O}decodeFromImage(y,E){if(!y&&!E)throw new d("either imageElement with a src set or an url must be provided");return E&&!y?this.decodeFromImageUrl(E):this.decodeFromImageElement(y)}decodeFromVideo(y,E){if(!y&&!E)throw new d("Either an element with a src set or an URL must be provided");return E&&!y?this.decodeFromVideoUrl(E):this.decodeFromVideoElement(y)}decodeFromVideoContinuously(y,E,O){if(y===void 0&&E===void 0)throw new d("Either an element with a src set or an URL must be provided");return E&&!y?this.decodeFromVideoUrlContinuously(E,O):this.decodeFromVideoElementContinuously(y,O)}decodeFromImageElement(y){if(!y)throw new d("An image element must be provided.");this.reset();const E=this.prepareImageElement(y);this.imageElement=E;let O;return this.isImageLoaded(E)?O=this.decodeOnce(E,!1,!0):O=this._decodeOnLoadImage(E),O}decodeFromVideoElement(y){const E=this._decodeFromVideoElementSetup(y);return this._decodeOnLoadVideo(E)}decodeFromVideoElementContinuously(y,E){const O=this._decodeFromVideoElementSetup(y);return this._decodeOnLoadVideoContinuously(O,E)}_decodeFromVideoElementSetup(y){if(!y)throw new d("A video element must be provided.");this.reset();const E=this.prepareVideoElement(y);return this.videoElement=E,E}decodeFromImageUrl(y){if(!y)throw new d("An URL must be provided.");this.reset();const E=this.prepareImageElement();this.imageElement=E;const O=this._decodeOnLoadImage(E);return E.src=y,O}decodeFromVideoUrl(y){if(!y)throw new d("An URL must be provided.");this.reset();const E=this.prepareVideoElement(),O=this.decodeFromVideoElement(E);return E.src=y,O}decodeFromVideoUrlContinuously(y,E){if(!y)throw new d("An URL must be provided.");this.reset();const O=this.prepareVideoElement(),$=this.decodeFromVideoElementContinuously(O,E);return O.src=y,$}_decodeOnLoadImage(y){return new Promise((E,O)=>{this.imageLoadedListener=()=>this.decodeOnce(y,!1,!0).then(E,O),y.addEventListener("load",this.imageLoadedListener)})}_decodeOnLoadVideo(y){return fe(this,void 0,void 0,function*(){return yield this.playVideoOnLoadAsync(y),yield this.decodeOnce(y)})}_decodeOnLoadVideoContinuously(y,E){return fe(this,void 0,void 0,function*(){yield this.playVideoOnLoadAsync(y),this.decodeContinuously(y,E)})}isImageLoaded(y){return!(!y.complete||y.naturalWidth===0)}prepareImageElement(y){let E;return typeof y>"u"&&(E=document.createElement("img"),E.width=200,E.height=200),typeof y=="string"&&(E=this.getMediaElement(y,"img")),y instanceof HTMLImageElement&&(E=y),E}prepareVideoElement(y){let E;return!y&&typeof document<"u"&&(E=document.createElement("video"),E.width=200,E.height=200),typeof y=="string"&&(E=this.getMediaElement(y,"video")),y instanceof HTMLVideoElement&&(E=y),E.setAttribute("autoplay","true"),E.setAttribute("muted","true"),E.setAttribute("playsinline","true"),E}decodeOnce(y,E=!0,O=!0){this._stopAsyncDecode=!1;const $=(H,K)=>{if(this._stopAsyncDecode){K(new Y("Video stream has ended before any code could be detected.")),this._stopAsyncDecode=void 0;return}try{const le=this.decode(y);H(le)}catch(le){const ve=E&&le instanceof Y,Ze=(le instanceof g||le instanceof L)&&O;if(ve||Ze)return setTimeout($,this._timeBetweenDecodingAttempts,H,K);K(le)}};return new Promise((H,K)=>$(H,K))}decodeContinuously(y,E){this._stopContinuousDecode=!1;const O=()=>{if(this._stopContinuousDecode){this._stopContinuousDecode=void 0;return}try{const $=this.decode(y);E($,null),setTimeout(O,this.timeBetweenScansMillis)}catch($){E(null,$);const H=$ instanceof g||$ instanceof L,K=$ instanceof Y;(H||K)&&setTimeout(O,this._timeBetweenDecodingAttempts)}};O()}decode(y){const E=this.createBinaryBitmap(y);return this.decodeBitmap(E)}_isHTMLVideoElement(y){return y.videoWidth!==0}drawFrameOnCanvas(y,E,O){E||(E={sx:0,sy:0,sWidth:y.videoWidth,sHeight:y.videoHeight,dx:0,dy:0,dWidth:y.videoWidth,dHeight:y.videoHeight}),O||(O=this.captureCanvasContext),O.drawImage(y,E.sx,E.sy,E.sWidth,E.sHeight,E.dx,E.dy,E.dWidth,E.dHeight)}drawImageOnCanvas(y,E,O=this.captureCanvasContext){E||(E={sx:0,sy:0,sWidth:y.naturalWidth,sHeight:y.naturalHeight,dx:0,dy:0,dWidth:y.naturalWidth,dHeight:y.naturalHeight}),O||(O=this.captureCanvasContext),O.drawImage(y,E.sx,E.sy,E.sWidth,E.sHeight,E.dx,E.dy,E.dWidth,E.dHeight)}createBinaryBitmap(y){this.getCaptureCanvasContext(y),this._isHTMLVideoElement(y)?this.drawFrameOnCanvas(y):this.drawImageOnCanvas(y);const E=this.getCaptureCanvas(y),O=new ee(E),$=new oe(O);return new x($)}getCaptureCanvasContext(y){if(!this.captureCanvasContext){const O=this.getCaptureCanvas(y).getContext("2d");this.captureCanvasContext=O}return this.captureCanvasContext}getCaptureCanvas(y){if(!this.captureCanvas){const E=this.createCaptureCanvas(y);this.captureCanvas=E}return this.captureCanvas}decodeBitmap(y){return this.reader.decode(y,this._hints)}createCaptureCanvas(y){if(typeof document>"u")return this._destroyCaptureCanvas(),null;const E=document.createElement("canvas");let O,$;return typeof y<"u"&&(y instanceof HTMLVideoElement?(O=y.videoWidth,$=y.videoHeight):y instanceof HTMLImageElement&&(O=y.naturalWidth||y.width,$=y.naturalHeight||y.height)),E.style.width=O+"px",E.style.height=$+"px",E.width=O,E.height=$,E}stopStreams(){this.stream&&(this.stream.getVideoTracks().forEach(y=>y.stop()),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()}reset(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()}_destroyVideoElement(){this.videoElement&&(typeof this.videoEndedListener<"u"&&this.videoElement.removeEventListener("ended",this.videoEndedListener),typeof this.videoPlayingEventListener<"u"&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),typeof this.videoCanPlayListener<"u"&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)}_destroyImageElement(){this.imageElement&&(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)}_destroyCaptureCanvas(){this.captureCanvasContext=void 0,this.captureCanvas=void 0}addVideoSource(y,E){try{y.srcObject=E}catch{y.src=URL.createObjectURL(E)}}cleanVideoSource(y){try{y.srcObject=null}catch{y.src=""}this.videoElement.removeAttribute("src")}}class ce{constructor(y,E,O=E==null?0:8*E.length,$,H,K=w.currentTimeMillis()){this.text=y,this.rawBytes=E,this.numBits=O,this.resultPoints=$,this.format=H,this.timestamp=K,this.text=y,this.rawBytes=E,O==null?this.numBits=E==null?0:8*E.length:this.numBits=O,this.resultPoints=$,this.format=H,this.resultMetadata=null,K==null?this.timestamp=w.currentTimeMillis():this.timestamp=K}getText(){return this.text}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}getResultPoints(){return this.resultPoints}getBarcodeFormat(){return this.format}getResultMetadata(){return this.resultMetadata}putMetadata(y,E){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(y,E)}putAllMetadata(y){y!==null&&(this.resultMetadata===null?this.resultMetadata=y:this.resultMetadata=new Map(y))}addResultPoints(y){const E=this.resultPoints;if(E===null)this.resultPoints=y;else if(y!==null&&y.length>0){const O=new Array(E.length+y.length);w.arraycopy(E,0,O,0,E.length),w.arraycopy(y,0,O,E.length,y.length),this.resultPoints=O}}getTimestamp(){return this.timestamp}toString(){return this.text}}var ye;(function(ut){ut[ut.AZTEC=0]="AZTEC",ut[ut.CODABAR=1]="CODABAR",ut[ut.CODE_39=2]="CODE_39",ut[ut.CODE_93=3]="CODE_93",ut[ut.CODE_128=4]="CODE_128",ut[ut.DATA_MATRIX=5]="DATA_MATRIX",ut[ut.EAN_8=6]="EAN_8",ut[ut.EAN_13=7]="EAN_13",ut[ut.ITF=8]="ITF",ut[ut.MAXICODE=9]="MAXICODE",ut[ut.PDF_417=10]="PDF_417",ut[ut.QR_CODE=11]="QR_CODE",ut[ut.RSS_14=12]="RSS_14",ut[ut.RSS_EXPANDED=13]="RSS_EXPANDED",ut[ut.UPC_A=14]="UPC_A",ut[ut.UPC_E=15]="UPC_E",ut[ut.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(ye||(ye={}));var Ne=ye,be;(function(ut){ut[ut.OTHER=0]="OTHER",ut[ut.ORIENTATION=1]="ORIENTATION",ut[ut.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",ut[ut.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",ut[ut.ISSUE_NUMBER=4]="ISSUE_NUMBER",ut[ut.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",ut[ut.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",ut[ut.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",ut[ut.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",ut[ut.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",ut[ut.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(be||(be={}));var je=be;class Ie{constructor(y,E,O,$,H=-1,K=-1){this.rawBytes=y,this.text=E,this.byteSegments=O,this.ecLevel=$,this.structuredAppendSequenceNumber=H,this.structuredAppendParity=K,this.numBits=y==null?0:8*y.length}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}setNumBits(y){this.numBits=y}getText(){return this.text}getByteSegments(){return this.byteSegments}getECLevel(){return this.ecLevel}getErrorsCorrected(){return this.errorsCorrected}setErrorsCorrected(y){this.errorsCorrected=y}getErasures(){return this.erasures}setErasures(y){this.erasures=y}getOther(){return this.other}setOther(y){this.other=y}hasStructuredAppend(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0}getStructuredAppendParity(){return this.structuredAppendParity}getStructuredAppendSequenceNumber(){return this.structuredAppendSequenceNumber}}class Re{exp(y){return this.expTable[y]}log(y){if(y===0)throw new f;return this.logTable[y]}static addOrSubtract(y,E){return y^E}}class Qe{constructor(y,E){if(E.length===0)throw new f;this.field=y;const O=E.length;if(O>1&&E[0]===0){let $=1;for(;$<O&&E[$]===0;)$++;$===O?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(O-$),w.arraycopy(E,$,this.coefficients,0,this.coefficients.length))}else this.coefficients=E}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return this.coefficients[0]===0}getCoefficient(y){return this.coefficients[this.coefficients.length-1-y]}evaluateAt(y){if(y===0)return this.getCoefficient(0);const E=this.coefficients;let O;if(y===1){O=0;for(let K=0,le=E.length;K!==le;K++){const ve=E[K];O=Re.addOrSubtract(O,ve)}return O}O=E[0];const $=E.length,H=this.field;for(let K=1;K<$;K++)O=Re.addOrSubtract(H.multiply(y,O),E[K]);return O}addOrSubtract(y){if(!this.field.equals(y.field))throw new f("GenericGFPolys do not have same GenericGF field");if(this.isZero())return y;if(y.isZero())return this;let E=this.coefficients,O=y.coefficients;if(E.length>O.length){const K=E;E=O,O=K}let $=new Int32Array(O.length);const H=O.length-E.length;w.arraycopy(O,0,$,0,H);for(let K=H;K<O.length;K++)$[K]=Re.addOrSubtract(E[K-H],O[K]);return new Qe(this.field,$)}multiply(y){if(!this.field.equals(y.field))throw new f("GenericGFPolys do not have same GenericGF field");if(this.isZero()||y.isZero())return this.field.getZero();const E=this.coefficients,O=E.length,$=y.coefficients,H=$.length,K=new Int32Array(O+H-1),le=this.field;for(let ve=0;ve<O;ve++){const Te=E[ve];for(let Ze=0;Ze<H;Ze++)K[ve+Ze]=Re.addOrSubtract(K[ve+Ze],le.multiply(Te,$[Ze]))}return new Qe(le,K)}multiplyScalar(y){if(y===0)return this.field.getZero();if(y===1)return this;const E=this.coefficients.length,O=this.field,$=new Int32Array(E),H=this.coefficients;for(let K=0;K<E;K++)$[K]=O.multiply(H[K],y);return new Qe(O,$)}multiplyByMonomial(y,E){if(y<0)throw new f;if(E===0)return this.field.getZero();const O=this.coefficients,$=O.length,H=new Int32Array($+y),K=this.field;for(let le=0;le<$;le++)H[le]=K.multiply(O[le],E);return new Qe(K,H)}divide(y){if(!this.field.equals(y.field))throw new f("GenericGFPolys do not have same GenericGF field");if(y.isZero())throw new f("Divide by 0");const E=this.field;let O=E.getZero(),$=this;const H=y.getCoefficient(y.getDegree()),K=E.inverse(H);for(;$.getDegree()>=y.getDegree()&&!$.isZero();){const le=$.getDegree()-y.getDegree(),ve=E.multiply($.getCoefficient($.getDegree()),K),Te=y.multiplyByMonomial(le,ve),Ze=E.buildMonomial(le,ve);O=O.addOrSubtract(Ze),$=$.addOrSubtract(Te)}return[O,$]}toString(){let y="";for(let E=this.getDegree();E>=0;E--){let O=this.getCoefficient(E);if(O!==0){if(O<0?(y+=" - ",O=-O):y.length>0&&(y+=" + "),E===0||O!==1){const $=this.field.log(O);$===0?y+="1":$===1?y+="a":(y+="a^",y+=$)}E!==0&&(E===1?y+="x":(y+="x^",y+=E))}}return y}}class Be extends u{}Be.kind="ArithmeticException";class it extends Re{constructor(y,E,O){super(),this.primitive=y,this.size=E,this.generatorBase=O;const $=new Int32Array(E);let H=1;for(let le=0;le<E;le++)$[le]=H,H*=2,H>=E&&(H^=y,H&=E-1);this.expTable=$;const K=new Int32Array(E);for(let le=0;le<E-1;le++)K[$[le]]=le;this.logTable=K,this.zero=new Qe(this,Int32Array.from([0])),this.one=new Qe(this,Int32Array.from([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(y,E){if(y<0)throw new f;if(E===0)return this.zero;const O=new Int32Array(y+1);return O[0]=E,new Qe(this,O)}inverse(y){if(y===0)throw new Be;return this.expTable[this.size-this.logTable[y]-1]}multiply(y,E){return y===0||E===0?0:this.expTable[(this.logTable[y]+this.logTable[E])%(this.size-1)]}getSize(){return this.size}getGeneratorBase(){return this.generatorBase}toString(){return"GF(0x"+P.toHexString(this.primitive)+","+this.size+")"}equals(y){return y===this}}it.AZTEC_DATA_12=new it(4201,4096,1),it.AZTEC_DATA_10=new it(1033,1024,1),it.AZTEC_DATA_6=new it(67,64,1),it.AZTEC_PARAM=new it(19,16,1),it.QR_CODE_FIELD_256=new it(285,256,0),it.DATA_MATRIX_FIELD_256=new it(301,256,1),it.AZTEC_DATA_8=it.DATA_MATRIX_FIELD_256,it.MAXICODE_FIELD_64=it.AZTEC_DATA_6;class tt extends u{}tt.kind="ReedSolomonException";class at extends u{}at.kind="IllegalStateException";class dt{constructor(y){this.field=y}decode(y,E){const O=this.field,$=new Qe(O,y),H=new Int32Array(E);let K=!0;for(let rn=0;rn<E;rn++){const bt=$.evaluateAt(O.exp(rn+O.getGeneratorBase()));H[H.length-1-rn]=bt,bt!==0&&(K=!1)}if(K)return;const le=new Qe(O,H),ve=this.runEuclideanAlgorithm(O.buildMonomial(E,1),le,E),Te=ve[0],Ze=ve[1],ht=this.findErrorLocations(Te),_t=this.findErrorMagnitudes(Ze,ht);for(let rn=0;rn<ht.length;rn++){const bt=y.length-1-O.log(ht[rn]);if(bt<0)throw new tt("Bad error location");y[bt]=it.addOrSubtract(y[bt],_t[rn])}}runEuclideanAlgorithm(y,E,O){if(y.getDegree()<E.getDegree()){const rn=y;y=E,E=rn}const $=this.field;let H=y,K=E,le=$.getZero(),ve=$.getOne();for(;K.getDegree()>=(O/2|0);){let rn=H,bt=le;if(H=K,le=ve,H.isZero())throw new tt("r_{i-1} was zero");K=rn;let zt=$.getZero();const qt=H.getCoefficient(H.getDegree()),Tn=$.inverse(qt);for(;K.getDegree()>=H.getDegree()&&!K.isZero();){const ir=K.getDegree()-H.getDegree(),Cr=$.multiply(K.getCoefficient(K.getDegree()),Tn);zt=zt.addOrSubtract($.buildMonomial(ir,Cr)),K=K.addOrSubtract(H.multiplyByMonomial(ir,Cr))}if(ve=zt.multiply(le).addOrSubtract(bt),K.getDegree()>=H.getDegree())throw new at("Division algorithm failed to reduce polynomial?")}const Te=ve.getCoefficient(0);if(Te===0)throw new tt("sigmaTilde(0) was zero");const Ze=$.inverse(Te),ht=ve.multiplyScalar(Ze),_t=K.multiplyScalar(Ze);return[ht,_t]}findErrorLocations(y){const E=y.getDegree();if(E===1)return Int32Array.from([y.getCoefficient(1)]);const O=new Int32Array(E);let $=0;const H=this.field;for(let K=1;K<H.getSize()&&$<E;K++)y.evaluateAt(K)===0&&(O[$]=H.inverse(K),$++);if($!==E)throw new tt("Error locator degree does not match number of roots");return O}findErrorMagnitudes(y,E){const O=E.length,$=new Int32Array(O),H=this.field;for(let K=0;K<O;K++){const le=H.inverse(E[K]);let ve=1;for(let Te=0;Te<O;Te++)if(K!==Te){const Ze=H.multiply(E[Te],le),ht=Ze&1?Ze&-2:Ze|1;ve=H.multiply(ve,ht)}$[K]=H.multiply(y.evaluateAt(le),H.inverse(ve)),H.getGeneratorBase()!==0&&($[K]=H.multiply($[K],le))}return $}}var ct;(function(ut){ut[ut.UPPER=0]="UPPER",ut[ut.LOWER=1]="LOWER",ut[ut.MIXED=2]="MIXED",ut[ut.DIGIT=3]="DIGIT",ut[ut.PUNCT=4]="PUNCT",ut[ut.BINARY=5]="BINARY"})(ct||(ct={}));class Ut{decode(y){this.ddata=y;let E=y.getBits(),O=this.extractBits(E),$=this.correctBits(O),H=Ut.convertBoolArrayToByteArray($),K=Ut.getEncodedData($),le=new Ie(H,K,null,null);return le.setNumBits($.length),le}static highLevelDecode(y){return this.getEncodedData(y)}static getEncodedData(y){let E=y.length,O=ct.UPPER,$=ct.UPPER,H="",K=0;for(;K<E;)if($===ct.BINARY){if(E-K<5)break;let le=Ut.readCode(y,K,5);if(K+=5,le===0){if(E-K<11)break;le=Ut.readCode(y,K,11)+31,K+=11}for(let ve=0;ve<le;ve++){if(E-K<8){K=E;break}const Te=Ut.readCode(y,K,8);H+=Z.castAsNonUtf8Char(Te),K+=8}$=O}else{let le=$===ct.DIGIT?4:5;if(E-K<le)break;let ve=Ut.readCode(y,K,le);K+=le;let Te=Ut.getCharacter($,ve);Te.startsWith("CTRL_")?(O=$,$=Ut.getTable(Te.charAt(5)),Te.charAt(6)==="L"&&(O=$)):(H+=Te,$=O)}return H}static getTable(y){switch(y){case"L":return ct.LOWER;case"P":return ct.PUNCT;case"M":return ct.MIXED;case"D":return ct.DIGIT;case"B":return ct.BINARY;case"U":default:return ct.UPPER}}static getCharacter(y,E){switch(y){case ct.UPPER:return Ut.UPPER_TABLE[E];case ct.LOWER:return Ut.LOWER_TABLE[E];case ct.MIXED:return Ut.MIXED_TABLE[E];case ct.PUNCT:return Ut.PUNCT_TABLE[E];case ct.DIGIT:return Ut.DIGIT_TABLE[E];default:throw new at("Bad table")}}correctBits(y){let E,O;this.ddata.getNbLayers()<=2?(O=6,E=it.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(O=8,E=it.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(O=10,E=it.AZTEC_DATA_10):(O=12,E=it.AZTEC_DATA_12);let $=this.ddata.getNbDatablocks(),H=y.length/O;if(H<$)throw new L;let K=y.length%O,le=new Int32Array(H);for(let _t=0;_t<H;_t++,K+=O)le[_t]=Ut.readCode(y,K,O);try{new dt(E).decode(le,H-$)}catch(_t){throw new L(_t)}let ve=(1<<O)-1,Te=0;for(let _t=0;_t<$;_t++){let rn=le[_t];if(rn===0||rn===ve)throw new L;(rn===1||rn===ve-1)&&Te++}let Ze=new Array($*O-Te),ht=0;for(let _t=0;_t<$;_t++){let rn=le[_t];if(rn===1||rn===ve-1)Ze.fill(rn>1,ht,ht+O-1),ht+=O-1;else for(let bt=O-1;bt>=0;--bt)Ze[ht++]=(rn&1<<bt)!==0}return Ze}extractBits(y){let E=this.ddata.isCompact(),O=this.ddata.getNbLayers(),$=(E?11:14)+O*4,H=new Int32Array($),K=new Array(this.totalBitsInLayer(O,E));if(E)for(let le=0;le<H.length;le++)H[le]=le;else{let le=$+1+2*P.truncDivision(P.truncDivision($,2)-1,15),ve=$/2,Te=P.truncDivision(le,2);for(let Ze=0;Ze<ve;Ze++){let ht=Ze+P.truncDivision(Ze,15);H[ve-Ze-1]=Te-ht-1,H[ve+Ze]=Te+ht+1}}for(let le=0,ve=0;le<O;le++){let Te=(O-le)*4+(E?9:12),Ze=le*2,ht=$-1-Ze;for(let _t=0;_t<Te;_t++){let rn=_t*2;for(let bt=0;bt<2;bt++)K[ve+rn+bt]=y.get(H[Ze+bt],H[Ze+_t]),K[ve+2*Te+rn+bt]=y.get(H[Ze+_t],H[ht-bt]),K[ve+4*Te+rn+bt]=y.get(H[ht-bt],H[ht-_t]),K[ve+6*Te+rn+bt]=y.get(H[ht-_t],H[Ze+bt])}ve+=Te*8}return K}static readCode(y,E,O){let $=0;for(let H=E;H<E+O;H++)$<<=1,y[H]&&($|=1);return $}static readByte(y,E){let O=y.length-E;return O>=8?Ut.readCode(y,E,8):Ut.readCode(y,E,O)<<8-O}static convertBoolArrayToByteArray(y){let E=new Uint8Array((y.length+7)/8);for(let O=0;O<E.length;O++)E[O]=Ut.readByte(y,8*O);return E}totalBitsInLayer(y,E){return((E?88:112)+16*y)*y}}Ut.UPPER_TABLE=["CTRL_PS"," ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],Ut.LOWER_TABLE=["CTRL_PS"," ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],Ut.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b","	",`
`,"\\13","\f","\r","\\33","\\34","\\35","\\36","\\37","@","\\","^","_","`","|","~","\\177","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],Ut.PUNCT_TABLE=["","\r",`\r
`,". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],Ut.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"];class kt{constructor(){}static round(y){return y===NaN?0:y<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:y>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:y+(y<0?-.5:.5)|0}static distance(y,E,O,$){const H=y-O,K=E-$;return Math.sqrt(H*H+K*K)}static sum(y){let E=0;for(let O=0,$=y.length;O!==$;O++){const H=y[O];E+=H}return E}}class tn{static floatToIntBits(y){return y}}tn.MAX_VALUE=Number.MAX_SAFE_INTEGER;class jt{constructor(y,E){this.x=y,this.y=E}getX(){return this.x}getY(){return this.y}equals(y){if(y instanceof jt){const E=y;return this.x===E.x&&this.y===E.y}return!1}hashCode(){return 31*tn.floatToIntBits(this.x)+tn.floatToIntBits(this.y)}toString(){return"("+this.x+","+this.y+")"}static orderBestPatterns(y){const E=this.distance(y[0],y[1]),O=this.distance(y[1],y[2]),$=this.distance(y[0],y[2]);let H,K,le;if(O>=E&&O>=$?(K=y[0],H=y[1],le=y[2]):$>=O&&$>=E?(K=y[1],H=y[0],le=y[2]):(K=y[2],H=y[0],le=y[1]),this.crossProductZ(H,K,le)<0){const ve=H;H=le,le=ve}y[0]=H,y[1]=K,y[2]=le}static distance(y,E){return kt.distance(y.x,y.y,E.x,E.y)}static crossProductZ(y,E,O){const $=E.x,H=E.y;return(O.x-$)*(y.y-H)-(O.y-H)*(y.x-$)}}class un{constructor(y,E){this.bits=y,this.points=E}getBits(){return this.bits}getPoints(){return this.points}}class cn extends un{constructor(y,E,O,$,H){super(y,E),this.compact=O,this.nbDatablocks=$,this.nbLayers=H}getNbLayers(){return this.nbLayers}getNbDatablocks(){return this.nbDatablocks}isCompact(){return this.compact}}class Pt{constructor(y,E,O,$){this.image=y,this.height=y.getHeight(),this.width=y.getWidth(),E==null&&(E=Pt.INIT_SIZE),O==null&&(O=y.getWidth()/2|0),$==null&&($=y.getHeight()/2|0);const H=E/2|0;if(this.leftInit=O-H,this.rightInit=O+H,this.upInit=$-H,this.downInit=$+H,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new Y}detect(){let y=this.leftInit,E=this.rightInit,O=this.upInit,$=this.downInit,H=!1,K=!0,le=!1,ve=!1,Te=!1,Ze=!1,ht=!1;const _t=this.width,rn=this.height;for(;K;){K=!1;let bt=!0;for(;(bt||!ve)&&E<_t;)bt=this.containsBlackPoint(O,$,E,!1),bt?(E++,K=!0,ve=!0):ve||E++;if(E>=_t){H=!0;break}let zt=!0;for(;(zt||!Te)&&$<rn;)zt=this.containsBlackPoint(y,E,$,!0),zt?($++,K=!0,Te=!0):Te||$++;if($>=rn){H=!0;break}let qt=!0;for(;(qt||!Ze)&&y>=0;)qt=this.containsBlackPoint(O,$,y,!1),qt?(y--,K=!0,Ze=!0):Ze||y--;if(y<0){H=!0;break}let Tn=!0;for(;(Tn||!ht)&&O>=0;)Tn=this.containsBlackPoint(y,E,O,!0),Tn?(O--,K=!0,ht=!0):ht||O--;if(O<0){H=!0;break}K&&(le=!0)}if(!H&&le){const bt=E-y;let zt=null;for(let Cr=1;zt===null&&Cr<bt;Cr++)zt=this.getBlackPointOnSegment(y,$-Cr,y+Cr,$);if(zt==null)throw new Y;let qt=null;for(let Cr=1;qt===null&&Cr<bt;Cr++)qt=this.getBlackPointOnSegment(y,O+Cr,y+Cr,O);if(qt==null)throw new Y;let Tn=null;for(let Cr=1;Tn===null&&Cr<bt;Cr++)Tn=this.getBlackPointOnSegment(E,O+Cr,E-Cr,O);if(Tn==null)throw new Y;let ir=null;for(let Cr=1;ir===null&&Cr<bt;Cr++)ir=this.getBlackPointOnSegment(E,$-Cr,E-Cr,$);if(ir==null)throw new Y;return this.centerEdges(ir,zt,Tn,qt)}else throw new Y}getBlackPointOnSegment(y,E,O,$){const H=kt.round(kt.distance(y,E,O,$)),K=(O-y)/H,le=($-E)/H,ve=this.image;for(let Te=0;Te<H;Te++){const Ze=kt.round(y+Te*K),ht=kt.round(E+Te*le);if(ve.get(Ze,ht))return new jt(Ze,ht)}return null}centerEdges(y,E,O,$){const H=y.getX(),K=y.getY(),le=E.getX(),ve=E.getY(),Te=O.getX(),Ze=O.getY(),ht=$.getX(),_t=$.getY(),rn=Pt.CORR;return H<this.width/2?[new jt(ht-rn,_t+rn),new jt(le+rn,ve+rn),new jt(Te-rn,Ze-rn),new jt(H+rn,K-rn)]:[new jt(ht+rn,_t+rn),new jt(le+rn,ve-rn),new jt(Te-rn,Ze+rn),new jt(H-rn,K-rn)]}containsBlackPoint(y,E,O,$){const H=this.image;if($){for(let K=y;K<=E;K++)if(H.get(K,O))return!0}else for(let K=y;K<=E;K++)if(H.get(O,K))return!0;return!1}}Pt.INIT_SIZE=10,Pt.CORR=1;class Xe{static checkAndNudgePoints(y,E){const O=y.getWidth(),$=y.getHeight();let H=!0;for(let K=0;K<E.length&&H;K+=2){const le=Math.floor(E[K]),ve=Math.floor(E[K+1]);if(le<-1||le>O||ve<-1||ve>$)throw new Y;H=!1,le===-1?(E[K]=0,H=!0):le===O&&(E[K]=O-1,H=!0),ve===-1?(E[K+1]=0,H=!0):ve===$&&(E[K+1]=$-1,H=!0)}H=!0;for(let K=E.length-2;K>=0&&H;K-=2){const le=Math.floor(E[K]),ve=Math.floor(E[K+1]);if(le<-1||le>O||ve<-1||ve>$)throw new Y;H=!1,le===-1?(E[K]=0,H=!0):le===O&&(E[K]=O-1,H=!0),ve===-1?(E[K+1]=0,H=!0):ve===$&&(E[K+1]=$-1,H=!0)}}}class Vt{constructor(y,E,O,$,H,K,le,ve,Te){this.a11=y,this.a21=E,this.a31=O,this.a12=$,this.a22=H,this.a32=K,this.a13=le,this.a23=ve,this.a33=Te}static quadrilateralToQuadrilateral(y,E,O,$,H,K,le,ve,Te,Ze,ht,_t,rn,bt,zt,qt){const Tn=Vt.quadrilateralToSquare(y,E,O,$,H,K,le,ve);return Vt.squareToQuadrilateral(Te,Ze,ht,_t,rn,bt,zt,qt).times(Tn)}transformPoints(y){const E=y.length,O=this.a11,$=this.a12,H=this.a13,K=this.a21,le=this.a22,ve=this.a23,Te=this.a31,Ze=this.a32,ht=this.a33;for(let _t=0;_t<E;_t+=2){const rn=y[_t],bt=y[_t+1],zt=H*rn+ve*bt+ht;y[_t]=(O*rn+K*bt+Te)/zt,y[_t+1]=($*rn+le*bt+Ze)/zt}}transformPointsWithValues(y,E){const O=this.a11,$=this.a12,H=this.a13,K=this.a21,le=this.a22,ve=this.a23,Te=this.a31,Ze=this.a32,ht=this.a33,_t=y.length;for(let rn=0;rn<_t;rn++){const bt=y[rn],zt=E[rn],qt=H*bt+ve*zt+ht;y[rn]=(O*bt+K*zt+Te)/qt,E[rn]=($*bt+le*zt+Ze)/qt}}static squareToQuadrilateral(y,E,O,$,H,K,le,ve){const Te=y-O+H-le,Ze=E-$+K-ve;if(Te===0&&Ze===0)return new Vt(O-y,H-O,y,$-E,K-$,E,0,0,1);{const ht=O-H,_t=le-H,rn=$-K,bt=ve-K,zt=ht*bt-_t*rn,qt=(Te*bt-_t*Ze)/zt,Tn=(ht*Ze-Te*rn)/zt;return new Vt(O-y+qt*O,le-y+Tn*le,y,$-E+qt*$,ve-E+Tn*ve,E,qt,Tn,1)}}static quadrilateralToSquare(y,E,O,$,H,K,le,ve){return Vt.squareToQuadrilateral(y,E,O,$,H,K,le,ve).buildAdjoint()}buildAdjoint(){return new Vt(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)}times(y){return new Vt(this.a11*y.a11+this.a21*y.a12+this.a31*y.a13,this.a11*y.a21+this.a21*y.a22+this.a31*y.a23,this.a11*y.a31+this.a21*y.a32+this.a31*y.a33,this.a12*y.a11+this.a22*y.a12+this.a32*y.a13,this.a12*y.a21+this.a22*y.a22+this.a32*y.a23,this.a12*y.a31+this.a22*y.a32+this.a32*y.a33,this.a13*y.a11+this.a23*y.a12+this.a33*y.a13,this.a13*y.a21+this.a23*y.a22+this.a33*y.a23,this.a13*y.a31+this.a23*y.a32+this.a33*y.a33)}}class Yt extends Xe{sampleGrid(y,E,O,$,H,K,le,ve,Te,Ze,ht,_t,rn,bt,zt,qt,Tn,ir,Cr){const Ar=Vt.quadrilateralToQuadrilateral($,H,K,le,ve,Te,Ze,ht,_t,rn,bt,zt,qt,Tn,ir,Cr);return this.sampleGridWithTransform(y,E,O,Ar)}sampleGridWithTransform(y,E,O,$){if(E<=0||O<=0)throw new Y;const H=new he(E,O),K=new Float32Array(2*E);for(let le=0;le<O;le++){const ve=K.length,Te=le+.5;for(let Ze=0;Ze<ve;Ze+=2)K[Ze]=Ze/2+.5,K[Ze+1]=Te;$.transformPoints(K),Xe.checkAndNudgePoints(y,K);try{for(let Ze=0;Ze<ve;Ze+=2)y.get(Math.floor(K[Ze]),Math.floor(K[Ze+1]))&&H.set(Ze/2,le)}catch{throw new Y}}return H}}class Ve{static setGridSampler(y){Ve.gridSampler=y}static getInstance(){return Ve.gridSampler}}Ve.gridSampler=new Yt;class Ke{constructor(y,E){this.x=y,this.y=E}toResultPoint(){return new jt(this.getX(),this.getY())}getX(){return this.x}getY(){return this.y}}class ft{constructor(y){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=y}detect(){return this.detectMirror(!1)}detectMirror(y){let E=this.getMatrixCenter(),O=this.getBullsEyeCorners(E);if(y){let K=O[0];O[0]=O[2],O[2]=K}this.extractParameters(O);let $=this.sampleGrid(this.image,O[this.shift%4],O[(this.shift+1)%4],O[(this.shift+2)%4],O[(this.shift+3)%4]),H=this.getMatrixCornerPoints(O);return new cn($,H,this.compact,this.nbDataBlocks,this.nbLayers)}extractParameters(y){if(!this.isValidPoint(y[0])||!this.isValidPoint(y[1])||!this.isValidPoint(y[2])||!this.isValidPoint(y[3]))throw new Y;let E=2*this.nbCenterLayers,O=new Int32Array([this.sampleLine(y[0],y[1],E),this.sampleLine(y[1],y[2],E),this.sampleLine(y[2],y[3],E),this.sampleLine(y[3],y[0],E)]);this.shift=this.getRotation(O,E);let $=0;for(let K=0;K<4;K++){let le=O[(this.shift+K)%4];this.compact?($<<=7,$+=le>>1&127):($<<=10,$+=(le>>2&992)+(le>>1&31))}let H=this.getCorrectedParameterData($,this.compact);this.compact?(this.nbLayers=(H>>6)+1,this.nbDataBlocks=(H&63)+1):(this.nbLayers=(H>>11)+1,this.nbDataBlocks=(H&2047)+1)}getRotation(y,E){let O=0;y.forEach(($,H,K)=>{let le=($>>E-2<<1)+($&1);O=(O<<3)+le}),O=((O&1)<<11)+(O>>1);for(let $=0;$<4;$++)if(P.bitCount(O^this.EXPECTED_CORNER_BITS[$])<=2)return $;throw new Y}getCorrectedParameterData(y,E){let O,$;E?(O=7,$=2):(O=10,$=4);let H=O-$,K=new Int32Array(O);for(let ve=O-1;ve>=0;--ve)K[ve]=y&15,y>>=4;try{new dt(it.AZTEC_PARAM).decode(K,H)}catch{throw new Y}let le=0;for(let ve=0;ve<$;ve++)le=(le<<4)+K[ve];return le}getBullsEyeCorners(y){let E=y,O=y,$=y,H=y,K=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){let ht=this.getFirstDifferent(E,K,1,-1),_t=this.getFirstDifferent(O,K,1,1),rn=this.getFirstDifferent($,K,-1,1),bt=this.getFirstDifferent(H,K,-1,-1);if(this.nbCenterLayers>2){let zt=this.distancePoint(bt,ht)*this.nbCenterLayers/(this.distancePoint(H,E)*(this.nbCenterLayers+2));if(zt<.75||zt>1.25||!this.isWhiteOrBlackRectangle(ht,_t,rn,bt))break}E=ht,O=_t,$=rn,H=bt,K=!K}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new Y;this.compact=this.nbCenterLayers===5;let le=new jt(E.getX()+.5,E.getY()-.5),ve=new jt(O.getX()+.5,O.getY()+.5),Te=new jt($.getX()-.5,$.getY()+.5),Ze=new jt(H.getX()-.5,H.getY()-.5);return this.expandSquare([le,ve,Te,Ze],2*this.nbCenterLayers-3,2*this.nbCenterLayers)}getMatrixCenter(){let y,E,O,$;try{let le=new Pt(this.image).detect();y=le[0],E=le[1],O=le[2],$=le[3]}catch{let ve=this.image.getWidth()/2,Te=this.image.getHeight()/2;y=this.getFirstDifferent(new Ke(ve+7,Te-7),!1,1,-1).toResultPoint(),E=this.getFirstDifferent(new Ke(ve+7,Te+7),!1,1,1).toResultPoint(),O=this.getFirstDifferent(new Ke(ve-7,Te+7),!1,-1,1).toResultPoint(),$=this.getFirstDifferent(new Ke(ve-7,Te-7),!1,-1,-1).toResultPoint()}let H=kt.round((y.getX()+$.getX()+E.getX()+O.getX())/4),K=kt.round((y.getY()+$.getY()+E.getY()+O.getY())/4);try{let le=new Pt(this.image,15,H,K).detect();y=le[0],E=le[1],O=le[2],$=le[3]}catch{y=this.getFirstDifferent(new Ke(H+7,K-7),!1,1,-1).toResultPoint(),E=this.getFirstDifferent(new Ke(H+7,K+7),!1,1,1).toResultPoint(),O=this.getFirstDifferent(new Ke(H-7,K+7),!1,-1,1).toResultPoint(),$=this.getFirstDifferent(new Ke(H-7,K-7),!1,-1,-1).toResultPoint()}return H=kt.round((y.getX()+$.getX()+E.getX()+O.getX())/4),K=kt.round((y.getY()+$.getY()+E.getY()+O.getY())/4),new Ke(H,K)}getMatrixCornerPoints(y){return this.expandSquare(y,2*this.nbCenterLayers,this.getDimension())}sampleGrid(y,E,O,$,H){let K=Ve.getInstance(),le=this.getDimension(),ve=le/2-this.nbCenterLayers,Te=le/2+this.nbCenterLayers;return K.sampleGrid(y,le,le,ve,ve,Te,ve,Te,Te,ve,Te,E.getX(),E.getY(),O.getX(),O.getY(),$.getX(),$.getY(),H.getX(),H.getY())}sampleLine(y,E,O){let $=0,H=this.distanceResultPoint(y,E),K=H/O,le=y.getX(),ve=y.getY(),Te=K*(E.getX()-y.getX())/H,Ze=K*(E.getY()-y.getY())/H;for(let ht=0;ht<O;ht++)this.image.get(kt.round(le+ht*Te),kt.round(ve+ht*Ze))&&($|=1<<O-ht-1);return $}isWhiteOrBlackRectangle(y,E,O,$){let H=3;y=new Ke(y.getX()-H,y.getY()+H),E=new Ke(E.getX()-H,E.getY()-H),O=new Ke(O.getX()+H,O.getY()-H),$=new Ke($.getX()+H,$.getY()+H);let K=this.getColor($,y);if(K===0)return!1;let le=this.getColor(y,E);return le!==K||(le=this.getColor(E,O),le!==K)?!1:(le=this.getColor(O,$),le===K)}getColor(y,E){let O=this.distancePoint(y,E),$=(E.getX()-y.getX())/O,H=(E.getY()-y.getY())/O,K=0,le=y.getX(),ve=y.getY(),Te=this.image.get(y.getX(),y.getY()),Ze=Math.ceil(O);for(let _t=0;_t<Ze;_t++)le+=$,ve+=H,this.image.get(kt.round(le),kt.round(ve))!==Te&&K++;let ht=K/O;return ht>.1&&ht<.9?0:ht<=.1===Te?1:-1}getFirstDifferent(y,E,O,$){let H=y.getX()+O,K=y.getY()+$;for(;this.isValid(H,K)&&this.image.get(H,K)===E;)H+=O,K+=$;for(H-=O,K-=$;this.isValid(H,K)&&this.image.get(H,K)===E;)H+=O;for(H-=O;this.isValid(H,K)&&this.image.get(H,K)===E;)K+=$;return K-=$,new Ke(H,K)}expandSquare(y,E,O){let $=O/(2*E),H=y[0].getX()-y[2].getX(),K=y[0].getY()-y[2].getY(),le=(y[0].getX()+y[2].getX())/2,ve=(y[0].getY()+y[2].getY())/2,Te=new jt(le+$*H,ve+$*K),Ze=new jt(le-$*H,ve-$*K);H=y[1].getX()-y[3].getX(),K=y[1].getY()-y[3].getY(),le=(y[1].getX()+y[3].getX())/2,ve=(y[1].getY()+y[3].getY())/2;let ht=new jt(le+$*H,ve+$*K),_t=new jt(le-$*H,ve-$*K);return[Te,ht,Ze,_t]}isValid(y,E){return y>=0&&y<this.image.getWidth()&&E>0&&E<this.image.getHeight()}isValidPoint(y){let E=kt.round(y.getX()),O=kt.round(y.getY());return this.isValid(E,O)}distancePoint(y,E){return kt.distance(y.getX(),y.getY(),E.getX(),E.getY())}distanceResultPoint(y,E){return kt.distance(y.getX(),y.getY(),E.getX(),E.getY())}getDimension(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(P.truncDivision(this.nbLayers-4,8)+1)+15}}class en{decode(y,E=null){let O=null,$=new ft(y.getBlackMatrix()),H=null,K=null;try{let Ze=$.detectMirror(!1);H=Ze.getPoints(),this.reportFoundResultPoints(E,H),K=new Ut().decode(Ze)}catch(Ze){O=Ze}if(K==null)try{let Ze=$.detectMirror(!0);H=Ze.getPoints(),this.reportFoundResultPoints(E,H),K=new Ut().decode(Ze)}catch(Ze){throw O??Ze}let le=new ce(K.getText(),K.getRawBytes(),K.getNumBits(),H,Ne.AZTEC,w.currentTimeMillis()),ve=K.getByteSegments();ve!=null&&le.putMetadata(je.BYTE_SEGMENTS,ve);let Te=K.getECLevel();return Te!=null&&le.putMetadata(je.ERROR_CORRECTION_LEVEL,Te),le}reportFoundResultPoints(y,E){if(y!=null){let O=y.get(U.NEED_RESULT_POINT_CALLBACK);O!=null&&E.forEach(($,H,K)=>{O.foundPossibleResultPoint($)})}}reset(){}}class Dt extends Ae{constructor(y=500){super(new en,y)}}class At{decode(y,E){try{return this.doDecode(y,E)}catch{if(E&&E.get(U.TRY_HARDER)===!0&&y.isRotateSupported()){const H=y.rotateCounterClockwise(),K=this.doDecode(H,E),le=K.getResultMetadata();let ve=270;le!==null&&le.get(je.ORIENTATION)===!0&&(ve=ve+le.get(je.ORIENTATION)%360),K.putMetadata(je.ORIENTATION,ve);const Te=K.getResultPoints();if(Te!==null){const Ze=H.getHeight();for(let ht=0;ht<Te.length;ht++)Te[ht]=new jt(Ze-Te[ht].getY()-1,Te[ht].getX())}return K}else throw new Y}}reset(){}doDecode(y,E){const O=y.getWidth(),$=y.getHeight();let H=new R(O);const K=E&&E.get(U.TRY_HARDER)===!0,le=Math.max(1,$>>(K?8:5));let ve;K?ve=$:ve=15;const Te=Math.trunc($/2);for(let Ze=0;Ze<ve;Ze++){const ht=Math.trunc((Ze+1)/2),_t=(Ze&1)===0,rn=Te+le*(_t?ht:-ht);if(rn<0||rn>=$)break;try{H=y.getBlackRow(rn,H)}catch{continue}for(let bt=0;bt<2;bt++){if(bt===1&&(H.reverse(),E&&E.get(U.NEED_RESULT_POINT_CALLBACK)===!0)){const zt=new Map;E.forEach((qt,Tn)=>zt.set(Tn,qt)),zt.delete(U.NEED_RESULT_POINT_CALLBACK),E=zt}try{const zt=this.decodeRow(rn,H,E);if(bt===1){zt.putMetadata(je.ORIENTATION,180);const qt=zt.getResultPoints();qt!==null&&(qt[0]=new jt(O-qt[0].getX()-1,qt[0].getY()),qt[1]=new jt(O-qt[1].getX()-1,qt[1].getY()))}return zt}catch{}}}throw new Y}static recordPattern(y,E,O){const $=O.length;for(let Te=0;Te<$;Te++)O[Te]=0;const H=y.getSize();if(E>=H)throw new Y;let K=!y.get(E),le=0,ve=E;for(;ve<H;){if(y.get(ve)!==K)O[le]++;else{if(++le===$)break;O[le]=1,K=!K}ve++}if(!(le===$||le===$-1&&ve===H))throw new Y}static recordPatternInReverse(y,E,O){let $=O.length,H=y.get(E);for(;E>0&&$>=0;)y.get(--E)!==H&&($--,H=!H);if($>=0)throw new Y;At.recordPattern(y,E+1,O)}static patternMatchVariance(y,E,O){const $=y.length;let H=0,K=0;for(let Te=0;Te<$;Te++)H+=y[Te],K+=E[Te];if(H<K)return Number.POSITIVE_INFINITY;const le=H/K;O*=le;let ve=0;for(let Te=0;Te<$;Te++){const Ze=y[Te],ht=E[Te]*le,_t=Ze>ht?Ze-ht:ht-Ze;if(_t>O)return Number.POSITIVE_INFINITY;ve+=_t}return ve/H}}class Je extends At{static findStartPattern(y){const E=y.getSize(),O=y.getNextSet(0);let $=0,H=Int32Array.from([0,0,0,0,0,0]),K=O,le=!1;const ve=6;for(let Te=O;Te<E;Te++)if(y.get(Te)!==le)H[$]++;else{if($===ve-1){let Ze=Je.MAX_AVG_VARIANCE,ht=-1;for(let _t=Je.CODE_START_A;_t<=Je.CODE_START_C;_t++){const rn=At.patternMatchVariance(H,Je.CODE_PATTERNS[_t],Je.MAX_INDIVIDUAL_VARIANCE);rn<Ze&&(Ze=rn,ht=_t)}if(ht>=0&&y.isRange(Math.max(0,K-(Te-K)/2),K,!1))return Int32Array.from([K,Te,ht]);K+=H[0]+H[1],H=H.slice(2,H.length-1),H[$-1]=0,H[$]=0,$--}else $++;H[$]=1,le=!le}throw new Y}static decodeCode(y,E,O){At.recordPattern(y,O,E);let $=Je.MAX_AVG_VARIANCE,H=-1;for(let K=0;K<Je.CODE_PATTERNS.length;K++){const le=Je.CODE_PATTERNS[K],ve=this.patternMatchVariance(E,le,Je.MAX_INDIVIDUAL_VARIANCE);ve<$&&($=ve,H=K)}if(H>=0)return H;throw new Y}decodeRow(y,E,O){const $=O&&O.get(U.ASSUME_GS1)===!0,H=Je.findStartPattern(E),K=H[2];let le=0;const ve=new Uint8Array(20);ve[le++]=K;let Te;switch(K){case Je.CODE_START_A:Te=Je.CODE_CODE_A;break;case Je.CODE_START_B:Te=Je.CODE_CODE_B;break;case Je.CODE_START_C:Te=Je.CODE_CODE_C;break;default:throw new L}let Ze=!1,ht=!1,_t="",rn=H[0],bt=H[1];const zt=Int32Array.from([0,0,0,0,0,0]);let qt=0,Tn=0,ir=K,Cr=0,Ar=!0,ps=!1,Ws=!1;for(;!Ze;){const _i=ht;switch(ht=!1,qt=Tn,Tn=Je.decodeCode(E,zt,bt),ve[le++]=Tn,Tn!==Je.CODE_STOP&&(Ar=!0),Tn!==Je.CODE_STOP&&(Cr++,ir+=Cr*Tn),rn=bt,bt+=zt.reduce((Cm,_1)=>Cm+_1,0),Tn){case Je.CODE_START_A:case Je.CODE_START_B:case Je.CODE_START_C:throw new L}switch(Te){case Je.CODE_CODE_A:if(Tn<64)Ws===ps?_t+=String.fromCharCode(32+Tn):_t+=String.fromCharCode(32+Tn+128),Ws=!1;else if(Tn<96)Ws===ps?_t+=String.fromCharCode(Tn-64):_t+=String.fromCharCode(Tn+64),Ws=!1;else switch(Tn!==Je.CODE_STOP&&(Ar=!1),Tn){case Je.CODE_FNC_1:$&&(_t.length===0?_t+="]C1":_t+="");break;case Je.CODE_FNC_2:case Je.CODE_FNC_3:break;case Je.CODE_FNC_4_A:!ps&&Ws?(ps=!0,Ws=!1):ps&&Ws?(ps=!1,Ws=!1):Ws=!0;break;case Je.CODE_SHIFT:ht=!0,Te=Je.CODE_CODE_B;break;case Je.CODE_CODE_B:Te=Je.CODE_CODE_B;break;case Je.CODE_CODE_C:Te=Je.CODE_CODE_C;break;case Je.CODE_STOP:Ze=!0;break}break;case Je.CODE_CODE_B:if(Tn<96)Ws===ps?_t+=String.fromCharCode(32+Tn):_t+=String.fromCharCode(32+Tn+128),Ws=!1;else switch(Tn!==Je.CODE_STOP&&(Ar=!1),Tn){case Je.CODE_FNC_1:$&&(_t.length===0?_t+="]C1":_t+="");break;case Je.CODE_FNC_2:case Je.CODE_FNC_3:break;case Je.CODE_FNC_4_B:!ps&&Ws?(ps=!0,Ws=!1):ps&&Ws?(ps=!1,Ws=!1):Ws=!0;break;case Je.CODE_SHIFT:ht=!0,Te=Je.CODE_CODE_A;break;case Je.CODE_CODE_A:Te=Je.CODE_CODE_A;break;case Je.CODE_CODE_C:Te=Je.CODE_CODE_C;break;case Je.CODE_STOP:Ze=!0;break}break;case Je.CODE_CODE_C:if(Tn<100)Tn<10&&(_t+="0"),_t+=Tn;else switch(Tn!==Je.CODE_STOP&&(Ar=!1),Tn){case Je.CODE_FNC_1:$&&(_t.length===0?_t+="]C1":_t+="");break;case Je.CODE_CODE_A:Te=Je.CODE_CODE_A;break;case Je.CODE_CODE_B:Te=Je.CODE_CODE_B;break;case Je.CODE_STOP:Ze=!0;break}break}_i&&(Te=Te===Je.CODE_CODE_A?Je.CODE_CODE_B:Je.CODE_CODE_A)}const ic=bt-rn;if(bt=E.getNextUnset(bt),!E.isRange(bt,Math.min(E.getSize(),bt+(bt-rn)/2),!1))throw new Y;if(ir-=Cr*qt,ir%103!==qt)throw new g;const Ya=_t.length;if(Ya===0)throw new Y;Ya>0&&Ar&&(Te===Je.CODE_CODE_C?_t=_t.substring(0,Ya-2):_t=_t.substring(0,Ya-1));const Xa=(H[1]+H[0])/2,ua=rn+ic/2,Sa=ve.length,Uo=new Uint8Array(Sa);for(let _i=0;_i<Sa;_i++)Uo[_i]=ve[_i];const hd=[new jt(Xa,y),new jt(ua,y)];return new ce(_t,Uo,0,hd,Ne.CODE_128,new Date().getTime())}}Je.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],Je.MAX_AVG_VARIANCE=.25,Je.MAX_INDIVIDUAL_VARIANCE=.7,Je.CODE_SHIFT=98,Je.CODE_CODE_C=99,Je.CODE_CODE_B=100,Je.CODE_CODE_A=101,Je.CODE_FNC_1=102,Je.CODE_FNC_2=97,Je.CODE_FNC_3=96,Je.CODE_FNC_4_A=101,Je.CODE_FNC_4_B=100,Je.CODE_START_A=103,Je.CODE_START_B=104,Je.CODE_START_C=105,Je.CODE_STOP=106;class He extends At{constructor(y=!1,E=!1){super(),this.usingCheckDigit=y,this.extendedMode=E,this.decodeRowResult="",this.counters=new Int32Array(9)}decodeRow(y,E,O){let $=this.counters;$.fill(0),this.decodeRowResult="";let H=He.findAsteriskPattern(E,$),K=E.getNextSet(H[1]),le=E.getSize(),ve,Te;do{He.recordPattern(E,K,$);let zt=He.toNarrowWidePattern($);if(zt<0)throw new Y;ve=He.patternToChar(zt),this.decodeRowResult+=ve,Te=K;for(let qt of $)K+=qt;K=E.getNextSet(K)}while(ve!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);let Ze=0;for(let zt of $)Ze+=zt;let ht=K-Te-Ze;if(K!==le&&ht*2<Ze)throw new Y;if(this.usingCheckDigit){let zt=this.decodeRowResult.length-1,qt=0;for(let Tn=0;Tn<zt;Tn++)qt+=He.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(Tn));if(this.decodeRowResult.charAt(zt)!==He.ALPHABET_STRING.charAt(qt%43))throw new g;this.decodeRowResult=this.decodeRowResult.substring(0,zt)}if(this.decodeRowResult.length===0)throw new Y;let _t;this.extendedMode?_t=He.decodeExtended(this.decodeRowResult):_t=this.decodeRowResult;let rn=(H[1]+H[0])/2,bt=Te+Ze/2;return new ce(_t,null,0,[new jt(rn,y),new jt(bt,y)],Ne.CODE_39,new Date().getTime())}static findAsteriskPattern(y,E){let O=y.getSize(),$=y.getNextSet(0),H=0,K=$,le=!1,ve=E.length;for(let Te=$;Te<O;Te++)if(y.get(Te)!==le)E[H]++;else{if(H===ve-1){if(this.toNarrowWidePattern(E)===He.ASTERISK_ENCODING&&y.isRange(Math.max(0,K-Math.floor((Te-K)/2)),K,!1))return[K,Te];K+=E[0]+E[1],E.copyWithin(0,2,2+H-1),E[H-1]=0,E[H]=0,H--}else H++;E[H]=1,le=!le}throw new Y}static toNarrowWidePattern(y){let E=y.length,O=0,$;do{let H=2147483647;for(let ve of y)ve<H&&ve>O&&(H=ve);O=H,$=0;let K=0,le=0;for(let ve=0;ve<E;ve++){let Te=y[ve];Te>O&&(le|=1<<E-1-ve,$++,K+=Te)}if($===3){for(let ve=0;ve<E&&$>0;ve++){let Te=y[ve];if(Te>O&&($--,Te*2>=K))return-1}return le}}while($>3);return-1}static patternToChar(y){for(let E=0;E<He.CHARACTER_ENCODINGS.length;E++)if(He.CHARACTER_ENCODINGS[E]===y)return He.ALPHABET_STRING.charAt(E);if(y===He.ASTERISK_ENCODING)return"*";throw new Y}static decodeExtended(y){let E=y.length,O="";for(let $=0;$<E;$++){let H=y.charAt($);if(H==="+"||H==="$"||H==="%"||H==="/"){let K=y.charAt($+1),le="\0";switch(H){case"+":if(K>="A"&&K<="Z")le=String.fromCharCode(K.charCodeAt(0)+32);else throw new L;break;case"$":if(K>="A"&&K<="Z")le=String.fromCharCode(K.charCodeAt(0)-64);else throw new L;break;case"%":if(K>="A"&&K<="E")le=String.fromCharCode(K.charCodeAt(0)-38);else if(K>="F"&&K<="J")le=String.fromCharCode(K.charCodeAt(0)-11);else if(K>="K"&&K<="O")le=String.fromCharCode(K.charCodeAt(0)+16);else if(K>="P"&&K<="T")le=String.fromCharCode(K.charCodeAt(0)+43);else if(K==="U")le="\0";else if(K==="V")le="@";else if(K==="W")le="`";else if(K==="X"||K==="Y"||K==="Z")le="";else throw new L;break;case"/":if(K>="A"&&K<="O")le=String.fromCharCode(K.charCodeAt(0)-32);else if(K==="Z")le=":";else throw new L;break}O+=le,$++}else O+=H}return O}}He.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",He.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],He.ASTERISK_ENCODING=148;class Rt extends At{constructor(){super(...arguments),this.narrowLineWidth=-1}decodeRow(y,E,O){let $=this.decodeStart(E),H=this.decodeEnd(E),K=new re;Rt.decodeMiddle(E,$[1],H[0],K);let le=K.toString(),ve=null;O!=null&&(ve=O.get(U.ALLOWED_LENGTHS)),ve==null&&(ve=Rt.DEFAULT_ALLOWED_LENGTHS);let Te=le.length,Ze=!1,ht=0;for(let bt of ve){if(Te===bt){Ze=!0;break}bt>ht&&(ht=bt)}if(!Ze&&Te>ht&&(Ze=!0),!Ze)throw new L;const _t=[new jt($[1],y),new jt(H[0],y)];return new ce(le,null,0,_t,Ne.ITF,new Date().getTime())}static decodeMiddle(y,E,O,$){let H=new Int32Array(10),K=new Int32Array(5),le=new Int32Array(5);for(H.fill(0),K.fill(0),le.fill(0);E<O;){At.recordPattern(y,E,H);for(let Te=0;Te<5;Te++){let Ze=2*Te;K[Te]=H[Ze],le[Te]=H[Ze+1]}let ve=Rt.decodeDigit(K);$.append(ve.toString()),ve=this.decodeDigit(le),$.append(ve.toString()),H.forEach(function(Te){E+=Te})}}decodeStart(y){let E=Rt.skipWhiteSpace(y),O=Rt.findGuardPattern(y,E,Rt.START_PATTERN);return this.narrowLineWidth=(O[1]-O[0])/4,this.validateQuietZone(y,O[0]),O}validateQuietZone(y,E){let O=this.narrowLineWidth*10;O=O<E?O:E;for(let $=E-1;O>0&&$>=0&&!y.get($);$--)O--;if(O!==0)throw new Y}static skipWhiteSpace(y){const E=y.getSize(),O=y.getNextSet(0);if(O===E)throw new Y;return O}decodeEnd(y){y.reverse();try{let E=Rt.skipWhiteSpace(y),O;try{O=Rt.findGuardPattern(y,E,Rt.END_PATTERN_REVERSED[0])}catch(H){H instanceof Y&&(O=Rt.findGuardPattern(y,E,Rt.END_PATTERN_REVERSED[1]))}this.validateQuietZone(y,O[0]);let $=O[0];return O[0]=y.getSize()-O[1],O[1]=y.getSize()-$,O}finally{y.reverse()}}static findGuardPattern(y,E,O){let $=O.length,H=new Int32Array($),K=y.getSize(),le=!1,ve=0,Te=E;H.fill(0);for(let Ze=E;Ze<K;Ze++)if(y.get(Ze)!==le)H[ve]++;else{if(ve===$-1){if(At.patternMatchVariance(H,O,Rt.MAX_INDIVIDUAL_VARIANCE)<Rt.MAX_AVG_VARIANCE)return[Te,Ze];Te+=H[0]+H[1],w.arraycopy(H,2,H,0,ve-1),H[ve-1]=0,H[ve]=0,ve--}else ve++;H[ve]=1,le=!le}throw new Y}static decodeDigit(y){let E=Rt.MAX_AVG_VARIANCE,O=-1,$=Rt.PATTERNS.length;for(let H=0;H<$;H++){let K=Rt.PATTERNS[H],le=At.patternMatchVariance(y,K,Rt.MAX_INDIVIDUAL_VARIANCE);le<E?(E=le,O=H):le===E&&(O=-1)}if(O>=0)return O%10;throw new Y}}Rt.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],Rt.MAX_AVG_VARIANCE=.38,Rt.MAX_INDIVIDUAL_VARIANCE=.5,Rt.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],Rt.START_PATTERN=Int32Array.from([1,1,1,1]),Rt.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])];class qe extends At{constructor(){super(...arguments),this.decodeRowStringBuffer=""}static findStartGuardPattern(y){let E=!1,O,$=0,H=Int32Array.from([0,0,0]);for(;!E;){H=Int32Array.from([0,0,0]),O=qe.findGuardPattern(y,$,!1,this.START_END_PATTERN,H);let K=O[0];$=O[1];let le=K-($-K);le>=0&&(E=y.isRange(le,K,!1))}return O}static checkChecksum(y){return qe.checkStandardUPCEANChecksum(y)}static checkStandardUPCEANChecksum(y){let E=y.length;if(E===0)return!1;let O=parseInt(y.charAt(E-1),10);return qe.getStandardUPCEANChecksum(y.substring(0,E-1))===O}static getStandardUPCEANChecksum(y){let E=y.length,O=0;for(let $=E-1;$>=0;$-=2){let H=y.charAt($).charCodeAt(0)-48;if(H<0||H>9)throw new L;O+=H}O*=3;for(let $=E-2;$>=0;$-=2){let H=y.charAt($).charCodeAt(0)-48;if(H<0||H>9)throw new L;O+=H}return(1e3-O)%10}static decodeEnd(y,E){return qe.findGuardPattern(y,E,!1,qe.START_END_PATTERN,new Int32Array(qe.START_END_PATTERN.length).fill(0))}static findGuardPatternWithoutCounters(y,E,O,$){return this.findGuardPattern(y,E,O,$,new Int32Array($.length))}static findGuardPattern(y,E,O,$,H){let K=y.getSize();E=O?y.getNextUnset(E):y.getNextSet(E);let le=0,ve=E,Te=$.length,Ze=O;for(let ht=E;ht<K;ht++)if(y.get(ht)!==Ze)H[le]++;else{if(le===Te-1){if(At.patternMatchVariance(H,$,qe.MAX_INDIVIDUAL_VARIANCE)<qe.MAX_AVG_VARIANCE)return Int32Array.from([ve,ht]);ve+=H[0]+H[1];let _t=H.slice(2,H.length-1);for(let rn=0;rn<le-1;rn++)H[rn]=_t[rn];H[le-1]=0,H[le]=0,le--}else le++;H[le]=1,Ze=!Ze}throw new Y}static decodeDigit(y,E,O,$){this.recordPattern(y,O,E);let H=this.MAX_AVG_VARIANCE,K=-1,le=$.length;for(let ve=0;ve<le;ve++){let Te=$[ve],Ze=At.patternMatchVariance(E,Te,qe.MAX_INDIVIDUAL_VARIANCE);Ze<H&&(H=Ze,K=ve)}if(K>=0)return K;throw new Y}}qe.MAX_AVG_VARIANCE=.48,qe.MAX_INDIVIDUAL_VARIANCE=.7,qe.START_END_PATTERN=Int32Array.from([1,1,1]),qe.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),qe.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),qe.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])];class lt{constructor(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(y,E,O){let $=this.decodeRowStringBuffer,H=this.decodeMiddle(E,O,$),K=$.toString(),le=lt.parseExtensionString(K),ve=[new jt((O[0]+O[1])/2,y),new jt(H,y)],Te=new ce(K,null,0,ve,Ne.UPC_EAN_EXTENSION,new Date().getTime());return le!=null&&Te.putAllMetadata(le),Te}decodeMiddle(y,E,O){let $=this.decodeMiddleCounters;$[0]=0,$[1]=0,$[2]=0,$[3]=0;let H=y.getSize(),K=E[1],le=0;for(let Te=0;Te<5&&K<H;Te++){let Ze=qe.decodeDigit(y,$,K,qe.L_AND_G_PATTERNS);O+=String.fromCharCode(48+Ze%10);for(let ht of $)K+=ht;Ze>=10&&(le|=1<<4-Te),Te!==4&&(K=y.getNextSet(K),K=y.getNextUnset(K))}if(O.length!==5)throw new Y;let ve=this.determineCheckDigit(le);if(lt.extensionChecksum(O.toString())!==ve)throw new Y;return K}static extensionChecksum(y){let E=y.length,O=0;for(let $=E-2;$>=0;$-=2)O+=y.charAt($).charCodeAt(0)-48;O*=3;for(let $=E-1;$>=0;$-=2)O+=y.charAt($).charCodeAt(0)-48;return O*=3,O%10}determineCheckDigit(y){for(let E=0;E<10;E++)if(y===this.CHECK_DIGIT_ENCODINGS[E])return E;throw new Y}static parseExtensionString(y){if(y.length!==5)return null;let E=lt.parseExtension5String(y);return E==null?null:new Map([[je.SUGGESTED_PRICE,E]])}static parseExtension5String(y){let E;switch(y.charAt(0)){case"0":E="£";break;case"5":E="$";break;case"9":switch(y){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}E="";break;default:E="";break}let O=parseInt(y.substring(1)),$=(O/100).toString(),H=O%100,K=H<10?"0"+H:H.toString();return E+$+"."+K}}class xt{constructor(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(y,E,O){let $=this.decodeRowStringBuffer,H=this.decodeMiddle(E,O,$),K=$.toString(),le=xt.parseExtensionString(K),ve=[new jt((O[0]+O[1])/2,y),new jt(H,y)],Te=new ce(K,null,0,ve,Ne.UPC_EAN_EXTENSION,new Date().getTime());return le!=null&&Te.putAllMetadata(le),Te}decodeMiddle(y,E,O){let $=this.decodeMiddleCounters;$[0]=0,$[1]=0,$[2]=0,$[3]=0;let H=y.getSize(),K=E[1],le=0;for(let ve=0;ve<2&&K<H;ve++){let Te=qe.decodeDigit(y,$,K,qe.L_AND_G_PATTERNS);O+=String.fromCharCode(48+Te%10);for(let Ze of $)K+=Ze;Te>=10&&(le|=1<<1-ve),ve!==1&&(K=y.getNextSet(K),K=y.getNextUnset(K))}if(O.length!==2)throw new Y;if(parseInt(O.toString())%4!==le)throw new Y;return K}static parseExtensionString(y){return y.length!==2?null:new Map([[je.ISSUE_NUMBER,parseInt(y)]])}}class Nt{static decodeRow(y,E,O){let $=qe.findGuardPattern(E,O,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new lt().decodeRow(y,E,$)}catch{return new xt().decodeRow(y,E,$)}}}Nt.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]);class It extends qe{constructor(){super(),this.decodeRowStringBuffer="",It.L_AND_G_PATTERNS=It.L_PATTERNS.map(y=>Int32Array.from(y));for(let y=10;y<20;y++){let E=It.L_PATTERNS[y-10],O=new Int32Array(E.length);for(let $=0;$<E.length;$++)O[$]=E[E.length-$-1];It.L_AND_G_PATTERNS[y]=O}}decodeRow(y,E,O){let $=It.findStartGuardPattern(E),H=O==null?null:O.get(U.NEED_RESULT_POINT_CALLBACK);if(H!=null){const Ar=new jt(($[0]+$[1])/2,y);H.foundPossibleResultPoint(Ar)}let K=this.decodeMiddle(E,$,this.decodeRowStringBuffer),le=K.rowOffset,ve=K.resultString;if(H!=null){const Ar=new jt(le,y);H.foundPossibleResultPoint(Ar)}let Te=this.decodeEnd(E,le);if(H!=null){const Ar=new jt((Te[0]+Te[1])/2,y);H.foundPossibleResultPoint(Ar)}let Ze=Te[1],ht=Ze+(Ze-Te[0]);if(ht>=E.getSize()||!E.isRange(Ze,ht,!1))throw new Y;let _t=ve.toString();if(_t.length<8)throw new L;if(!It.checkChecksum(_t))throw new g;let rn=($[1]+$[0])/2,bt=(Te[1]+Te[0])/2,zt=this.getBarcodeFormat(),qt=[new jt(rn,y),new jt(bt,y)],Tn=new ce(_t,null,0,qt,zt,new Date().getTime()),ir=0;try{let Ar=Nt.decodeRow(y,E,Te[1]);Tn.putMetadata(je.UPC_EAN_EXTENSION,Ar.getText()),Tn.putAllMetadata(Ar.getResultMetadata()),Tn.addResultPoints(Ar.getResultPoints()),ir=Ar.getText().length}catch{}let Cr=O==null?null:O.get(U.ALLOWED_EAN_EXTENSIONS);if(Cr!=null){let Ar=!1;for(let ps in Cr)if(ir.toString()===ps){Ar=!0;break}if(!Ar)throw new Y}return Tn}decodeEnd(y,E){return It.findGuardPattern(y,E,!1,It.START_END_PATTERN,new Int32Array(It.START_END_PATTERN.length).fill(0))}static checkChecksum(y){return It.checkStandardUPCEANChecksum(y)}static checkStandardUPCEANChecksum(y){let E=y.length;if(E===0)return!1;let O=parseInt(y.charAt(E-1),10);return It.getStandardUPCEANChecksum(y.substring(0,E-1))===O}static getStandardUPCEANChecksum(y){let E=y.length,O=0;for(let $=E-1;$>=0;$-=2){let H=y.charAt($).charCodeAt(0)-48;if(H<0||H>9)throw new L;O+=H}O*=3;for(let $=E-2;$>=0;$-=2){let H=y.charAt($).charCodeAt(0)-48;if(H<0||H>9)throw new L;O+=H}return(1e3-O)%10}}class xn extends It{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(y,E,O){let $=this.decodeMiddleCounters;$[0]=0,$[1]=0,$[2]=0,$[3]=0;let H=y.getSize(),K=E[1],le=0;for(let Te=0;Te<6&&K<H;Te++){let Ze=It.decodeDigit(y,$,K,It.L_AND_G_PATTERNS);O+=String.fromCharCode(48+Ze%10);for(let ht of $)K+=ht;Ze>=10&&(le|=1<<5-Te)}O=xn.determineFirstDigit(O,le),K=It.findGuardPattern(y,K,!0,It.MIDDLE_PATTERN,new Int32Array(It.MIDDLE_PATTERN.length).fill(0))[1];for(let Te=0;Te<6&&K<H;Te++){let Ze=It.decodeDigit(y,$,K,It.L_PATTERNS);O+=String.fromCharCode(48+Ze);for(let ht of $)K+=ht}return{rowOffset:K,resultString:O}}getBarcodeFormat(){return Ne.EAN_13}static determineFirstDigit(y,E){for(let O=0;O<10;O++)if(E===this.FIRST_DIGIT_ENCODINGS[O])return y=String.fromCharCode(48+O)+y,y;throw new Y}}xn.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26];class dn extends It{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(y,E,O){const $=this.decodeMiddleCounters;$[0]=0,$[1]=0,$[2]=0,$[3]=0;let H=y.getSize(),K=E[1];for(let ve=0;ve<4&&K<H;ve++){let Te=It.decodeDigit(y,$,K,It.L_PATTERNS);O+=String.fromCharCode(48+Te);for(let Ze of $)K+=Ze}K=It.findGuardPattern(y,K,!0,It.MIDDLE_PATTERN,new Int32Array(It.MIDDLE_PATTERN.length).fill(0))[1];for(let ve=0;ve<4&&K<H;ve++){let Te=It.decodeDigit(y,$,K,It.L_PATTERNS);O+=String.fromCharCode(48+Te);for(let Ze of $)K+=Ze}return{rowOffset:K,resultString:O}}getBarcodeFormat(){return Ne.EAN_8}}class Mn extends It{constructor(){super(...arguments),this.ean13Reader=new xn}getBarcodeFormat(){return Ne.UPC_A}decode(y,E){return this.maybeReturnResult(this.ean13Reader.decode(y))}decodeRow(y,E,O){return this.maybeReturnResult(this.ean13Reader.decodeRow(y,E,O))}decodeMiddle(y,E,O){return this.ean13Reader.decodeMiddle(y,E,O)}maybeReturnResult(y){let E=y.getText();if(E.charAt(0)==="0"){let O=new ce(E.substring(1),null,null,y.getResultPoints(),Ne.UPC_A);return y.getResultMetadata()!=null&&O.putAllMetadata(y.getResultMetadata()),O}else throw new Y}reset(){this.ean13Reader.reset()}}class _n extends It{constructor(){super(),this.decodeMiddleCounters=new Int32Array(4)}decodeMiddle(y,E,O){const $=this.decodeMiddleCounters.map(Te=>Te);$[0]=0,$[1]=0,$[2]=0,$[3]=0;const H=y.getSize();let K=E[1],le=0;for(let Te=0;Te<6&&K<H;Te++){const Ze=_n.decodeDigit(y,$,K,_n.L_AND_G_PATTERNS);O+=String.fromCharCode(48+Ze%10);for(let ht of $)K+=ht;Ze>=10&&(le|=1<<5-Te)}let ve=_n.determineNumSysAndCheckDigit(O,le);return{rowOffset:K,resultString:ve}}decodeEnd(y,E){return _n.findGuardPatternWithoutCounters(y,E,!0,_n.MIDDLE_END_PATTERN)}checkChecksum(y){return It.checkChecksum(_n.convertUPCEtoUPCA(y))}static determineNumSysAndCheckDigit(y,E){for(let O=0;O<=1;O++)for(let $=0;$<10;$++)if(E===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[O][$]){let H=String.fromCharCode(48+O),K=String.fromCharCode(48+$);return H+y+K}throw Y.getNotFoundInstance()}getBarcodeFormat(){return Ne.UPC_E}static convertUPCEtoUPCA(y){const E=y.slice(1,7).split("").map(H=>H.charCodeAt(0)),O=new re;O.append(y.charAt(0));let $=E[5];switch($){case 0:case 1:case 2:O.appendChars(E,0,2),O.append($),O.append("0000"),O.appendChars(E,2,3);break;case 3:O.appendChars(E,0,3),O.append("00000"),O.appendChars(E,3,2);break;case 4:O.appendChars(E,0,4),O.append("00000"),O.append(E[4]);break;default:O.appendChars(E,0,5),O.append("0000"),O.append($);break}return y.length>=8&&O.append(y.charAt(7)),O.toString()}}_n.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),_n.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,26])];class kn extends At{constructor(y){super();let E=y==null?null:y.get(U.POSSIBLE_FORMATS),O=[];r(E)?(O.push(new xn),O.push(new Mn),O.push(new dn),O.push(new _n)):(E.indexOf(Ne.EAN_13)>-1&&O.push(new xn),E.indexOf(Ne.UPC_A)>-1&&O.push(new Mn),E.indexOf(Ne.EAN_8)>-1&&O.push(new dn),E.indexOf(Ne.UPC_E)>-1&&O.push(new _n)),this.readers=O}decodeRow(y,E,O){for(let $ of this.readers)try{const H=$.decodeRow(y,E,O),K=H.getBarcodeFormat()===Ne.EAN_13&&H.getText().charAt(0)==="0",le=O==null?null:O.get(U.POSSIBLE_FORMATS),ve=le==null||le.includes(Ne.UPC_A);if(K&&ve){const Te=H.getRawBytes(),Ze=new ce(H.getText().substring(1),Te,Te?Te.length:null,H.getResultPoints(),Ne.UPC_A);return Ze.putAllMetadata(H.getResultMetadata()),Ze}return H}catch{}throw new Y}reset(){for(let y of this.readers)y.reset()}}class vn extends At{constructor(){super(),this.decodeFinderCounters=new Int32Array(4),this.dataCharacterCounters=new Int32Array(8),this.oddRoundingErrors=new Array(4),this.evenRoundingErrors=new Array(4),this.oddCounts=new Array(this.dataCharacterCounters.length/2),this.evenCounts=new Array(this.dataCharacterCounters.length/2)}getDecodeFinderCounters(){return this.decodeFinderCounters}getDataCharacterCounters(){return this.dataCharacterCounters}getOddRoundingErrors(){return this.oddRoundingErrors}getEvenRoundingErrors(){return this.evenRoundingErrors}getOddCounts(){return this.oddCounts}getEvenCounts(){return this.evenCounts}parseFinderValue(y,E){for(let O=0;O<E.length;O++)if(At.patternMatchVariance(y,E[O],vn.MAX_INDIVIDUAL_VARIANCE)<vn.MAX_AVG_VARIANCE)return O;throw new Y}static count(y){return kt.sum(new Int32Array(y))}static increment(y,E){let O=0,$=E[0];for(let H=1;H<y.length;H++)E[H]>$&&($=E[H],O=H);y[O]++}static decrement(y,E){let O=0,$=E[0];for(let H=1;H<y.length;H++)E[H]<$&&($=E[H],O=H);y[O]--}static isFinderPattern(y){let E=y[0]+y[1],O=E+y[2]+y[3],$=E/O;if($>=vn.MIN_FINDER_PATTERN_RATIO&&$<=vn.MAX_FINDER_PATTERN_RATIO){let H=Number.MAX_SAFE_INTEGER,K=Number.MIN_SAFE_INTEGER;for(let le of y)le>K&&(K=le),le<H&&(H=le);return K<10*H}return!1}}vn.MAX_AVG_VARIANCE=.2,vn.MAX_INDIVIDUAL_VARIANCE=.45,vn.MIN_FINDER_PATTERN_RATIO=9.5/12,vn.MAX_FINDER_PATTERN_RATIO=12.5/14;class Qn{constructor(y,E){this.value=y,this.checksumPortion=E}getValue(){return this.value}getChecksumPortion(){return this.checksumPortion}toString(){return this.value+"("+this.checksumPortion+")"}equals(y){if(!(y instanceof Qn))return!1;const E=y;return this.value===E.value&&this.checksumPortion===E.checksumPortion}hashCode(){return this.value^this.checksumPortion}}class Hn{constructor(y,E,O,$,H){this.value=y,this.startEnd=E,this.value=y,this.startEnd=E,this.resultPoints=new Array,this.resultPoints.push(new jt(O,H)),this.resultPoints.push(new jt($,H))}getValue(){return this.value}getStartEnd(){return this.startEnd}getResultPoints(){return this.resultPoints}equals(y){if(!(y instanceof Hn))return!1;const E=y;return this.value===E.value}hashCode(){return this.value}}class $n{constructor(){}static getRSSvalue(y,E,O){let $=0;for(let ve of y)$+=ve;let H=0,K=0,le=y.length;for(let ve=0;ve<le-1;ve++){let Te;for(Te=1,K|=1<<ve;Te<y[ve];Te++,K&=~(1<<ve)){let Ze=$n.combins($-Te-1,le-ve-2);if(O&&K===0&&$-Te-(le-ve-1)>=le-ve-1&&(Ze-=$n.combins($-Te-(le-ve),le-ve-2)),le-ve-1>1){let ht=0;for(let _t=$-Te-(le-ve-2);_t>E;_t--)ht+=$n.combins($-Te-_t-1,le-ve-3);Ze-=ht*(le-1-ve)}else $-Te>E&&Ze--;H+=Ze}$-=Te}return H}static combins(y,E){let O,$;y-E>E?($=E,O=y-E):($=y-E,O=E);let H=1,K=1;for(let le=y;le>O;le--)H*=le,K<=$&&(H/=K,K++);for(;K<=$;)H/=K,K++;return H}}class Jn{static buildBitArray(y){let E=y.length*2-1;y[y.length-1].getRightChar()==null&&(E-=1);let O=12*E,$=new R(O),H=0,le=y[0].getRightChar().getValue();for(let ve=11;ve>=0;--ve)le&1<<ve&&$.set(H),H++;for(let ve=1;ve<y.length;++ve){let Te=y[ve],Ze=Te.getLeftChar().getValue();for(let ht=11;ht>=0;--ht)Ze&1<<ht&&$.set(H),H++;if(Te.getRightChar()!=null){let ht=Te.getRightChar().getValue();for(let _t=11;_t>=0;--_t)ht&1<<_t&&$.set(H),H++}}return $}}class Nn{constructor(y,E){E?this.decodedInformation=null:(this.finished=y,this.decodedInformation=E)}getDecodedInformation(){return this.decodedInformation}isFinished(){return this.finished}}class ln{constructor(y){this.newPosition=y}getNewPosition(){return this.newPosition}}class Oe extends ln{constructor(y,E){super(y),this.value=E}getValue(){return this.value}isFNC1(){return this.value===Oe.FNC1}}Oe.FNC1="$";class sn extends ln{constructor(y,E,O){super(y),O?(this.remaining=!0,this.remainingValue=this.remainingValue):(this.remaining=!1,this.remainingValue=0),this.newString=E}getNewString(){return this.newString}isRemaining(){return this.remaining}getRemainingValue(){return this.remainingValue}}class fn extends ln{constructor(y,E,O){if(super(y),E<0||E>10||O<0||O>10)throw new L;this.firstDigit=E,this.secondDigit=O}getFirstDigit(){return this.firstDigit}getSecondDigit(){return this.secondDigit}getValue(){return this.firstDigit*10+this.secondDigit}isFirstDigitFNC1(){return this.firstDigit===fn.FNC1}isSecondDigitFNC1(){return this.secondDigit===fn.FNC1}isAnyFNC1(){return this.firstDigit===fn.FNC1||this.secondDigit===fn.FNC1}}fn.FNC1=10;class Et{constructor(){}static parseFieldsInGeneralPurpose(y){if(!y)return null;if(y.length<2)throw new Y;let E=y.substring(0,2);for(let H of Et.TWO_DIGIT_DATA_LENGTH)if(H[0]===E)return H[1]===Et.VARIABLE_LENGTH?Et.processVariableAI(2,H[2],y):Et.processFixedAI(2,H[1],y);if(y.length<3)throw new Y;let O=y.substring(0,3);for(let H of Et.THREE_DIGIT_DATA_LENGTH)if(H[0]===O)return H[1]===Et.VARIABLE_LENGTH?Et.processVariableAI(3,H[2],y):Et.processFixedAI(3,H[1],y);for(let H of Et.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH)if(H[0]===O)return H[1]===Et.VARIABLE_LENGTH?Et.processVariableAI(4,H[2],y):Et.processFixedAI(4,H[1],y);if(y.length<4)throw new Y;let $=y.substring(0,4);for(let H of Et.FOUR_DIGIT_DATA_LENGTH)if(H[0]===$)return H[1]===Et.VARIABLE_LENGTH?Et.processVariableAI(4,H[2],y):Et.processFixedAI(4,H[1],y);throw new Y}static processFixedAI(y,E,O){if(O.length<y)throw new Y;let $=O.substring(0,y);if(O.length<y+E)throw new Y;let H=O.substring(y,y+E),K=O.substring(y+E),le="("+$+")"+H,ve=Et.parseFieldsInGeneralPurpose(K);return ve==null?le:le+ve}static processVariableAI(y,E,O){let $=O.substring(0,y),H;O.length<y+E?H=O.length:H=y+E;let K=O.substring(y,H),le=O.substring(H),ve="("+$+")"+K,Te=Et.parseFieldsInGeneralPurpose(le);return Te==null?ve:ve+Te}}Et.VARIABLE_LENGTH=[],Et.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",Et.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",Et.VARIABLE_LENGTH,20],["22",Et.VARIABLE_LENGTH,29],["30",Et.VARIABLE_LENGTH,8],["37",Et.VARIABLE_LENGTH,8],["90",Et.VARIABLE_LENGTH,30],["91",Et.VARIABLE_LENGTH,30],["92",Et.VARIABLE_LENGTH,30],["93",Et.VARIABLE_LENGTH,30],["94",Et.VARIABLE_LENGTH,30],["95",Et.VARIABLE_LENGTH,30],["96",Et.VARIABLE_LENGTH,30],["97",Et.VARIABLE_LENGTH,3],["98",Et.VARIABLE_LENGTH,30],["99",Et.VARIABLE_LENGTH,30]],Et.THREE_DIGIT_DATA_LENGTH=[["240",Et.VARIABLE_LENGTH,30],["241",Et.VARIABLE_LENGTH,30],["242",Et.VARIABLE_LENGTH,6],["250",Et.VARIABLE_LENGTH,30],["251",Et.VARIABLE_LENGTH,30],["253",Et.VARIABLE_LENGTH,17],["254",Et.VARIABLE_LENGTH,20],["400",Et.VARIABLE_LENGTH,30],["401",Et.VARIABLE_LENGTH,30],["402",17],["403",Et.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",Et.VARIABLE_LENGTH,20],["421",Et.VARIABLE_LENGTH,15],["422",3],["423",Et.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],Et.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[["310",6],["311",6],["312",6],["313",6],["314",6],["315",6],["316",6],["320",6],["321",6],["322",6],["323",6],["324",6],["325",6],["326",6],["327",6],["328",6],["329",6],["330",6],["331",6],["332",6],["333",6],["334",6],["335",6],["336",6],["340",6],["341",6],["342",6],["343",6],["344",6],["345",6],["346",6],["347",6],["348",6],["349",6],["350",6],["351",6],["352",6],["353",6],["354",6],["355",6],["356",6],["357",6],["360",6],["361",6],["362",6],["363",6],["364",6],["365",6],["366",6],["367",6],["368",6],["369",6],["390",Et.VARIABLE_LENGTH,15],["391",Et.VARIABLE_LENGTH,18],["392",Et.VARIABLE_LENGTH,15],["393",Et.VARIABLE_LENGTH,18],["703",Et.VARIABLE_LENGTH,30]],Et.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",Et.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",Et.VARIABLE_LENGTH,20],["8003",Et.VARIABLE_LENGTH,30],["8004",Et.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",Et.VARIABLE_LENGTH,30],["8008",Et.VARIABLE_LENGTH,12],["8018",18],["8020",Et.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",Et.VARIABLE_LENGTH,70],["8200",Et.VARIABLE_LENGTH,70]];class Kn{constructor(y){this.buffer=new re,this.information=y}decodeAllCodes(y,E){let O=E,$=null;do{let H=this.decodeGeneralPurposeField(O,$),K=Et.parseFieldsInGeneralPurpose(H.getNewString());if(K!=null&&y.append(K),H.isRemaining()?$=""+H.getRemainingValue():$=null,O===H.getNewPosition())break;O=H.getNewPosition()}while(!0);return y.toString()}isStillNumeric(y){if(y+7>this.information.getSize())return y+4<=this.information.getSize();for(let E=y;E<y+3;++E)if(this.information.get(E))return!0;return this.information.get(y+3)}decodeNumeric(y){if(y+7>this.information.getSize()){let H=this.extractNumericValueFromBitArray(y,4);return H===0?new fn(this.information.getSize(),fn.FNC1,fn.FNC1):new fn(this.information.getSize(),H-1,fn.FNC1)}let E=this.extractNumericValueFromBitArray(y,7),O=(E-8)/11,$=(E-8)%11;return new fn(y+7,O,$)}extractNumericValueFromBitArray(y,E){return Kn.extractNumericValueFromBitArray(this.information,y,E)}static extractNumericValueFromBitArray(y,E,O){let $=0;for(let H=0;H<O;++H)y.get(E+H)&&($|=1<<O-H-1);return $}decodeGeneralPurposeField(y,E){this.buffer.setLengthToZero(),E!=null&&this.buffer.append(E),this.current.setPosition(y);let O=this.parseBlocks();return O!=null&&O.isRemaining()?new sn(this.current.getPosition(),this.buffer.toString(),O.getRemainingValue()):new sn(this.current.getPosition(),this.buffer.toString())}parseBlocks(){let y,E;do{let O=this.current.getPosition();if(this.current.isAlpha()?(E=this.parseAlphaBlock(),y=E.isFinished()):this.current.isIsoIec646()?(E=this.parseIsoIec646Block(),y=E.isFinished()):(E=this.parseNumericBlock(),y=E.isFinished()),!(O!==this.current.getPosition())&&!y)break}while(!y);return E.getDecodedInformation()}parseNumericBlock(){for(;this.isStillNumeric(this.current.getPosition());){let y=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(y.getNewPosition()),y.isFirstDigitFNC1()){let E;return y.isSecondDigitFNC1()?E=new sn(this.current.getPosition(),this.buffer.toString()):E=new sn(this.current.getPosition(),this.buffer.toString(),y.getSecondDigit()),new Nn(!0,E)}if(this.buffer.append(y.getFirstDigit()),y.isSecondDigitFNC1()){let E=new sn(this.current.getPosition(),this.buffer.toString());return new Nn(!0,E)}this.buffer.append(y.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new Nn(!1)}parseIsoIec646Block(){for(;this.isStillIsoIec646(this.current.getPosition());){let y=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(y.getNewPosition()),y.isFNC1()){let E=new sn(this.current.getPosition(),this.buffer.toString());return new Nn(!0,E)}this.buffer.append(y.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new Nn(!1)}parseAlphaBlock(){for(;this.isStillAlpha(this.current.getPosition());){let y=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(y.getNewPosition()),y.isFNC1()){let E=new sn(this.current.getPosition(),this.buffer.toString());return new Nn(!0,E)}this.buffer.append(y.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new Nn(!1)}isStillIsoIec646(y){if(y+5>this.information.getSize())return!1;let E=this.extractNumericValueFromBitArray(y,5);if(E>=5&&E<16)return!0;if(y+7>this.information.getSize())return!1;let O=this.extractNumericValueFromBitArray(y,7);if(O>=64&&O<116)return!0;if(y+8>this.information.getSize())return!1;let $=this.extractNumericValueFromBitArray(y,8);return $>=232&&$<253}decodeIsoIec646(y){let E=this.extractNumericValueFromBitArray(y,5);if(E===15)return new Oe(y+5,Oe.FNC1);if(E>=5&&E<15)return new Oe(y+5,"0"+(E-5));let O=this.extractNumericValueFromBitArray(y,7);if(O>=64&&O<90)return new Oe(y+7,""+(O+1));if(O>=90&&O<116)return new Oe(y+7,""+(O+7));let $=this.extractNumericValueFromBitArray(y,8),H;switch($){case 232:H="!";break;case 233:H='"';break;case 234:H="%";break;case 235:H="&";break;case 236:H="'";break;case 237:H="(";break;case 238:H=")";break;case 239:H="*";break;case 240:H="+";break;case 241:H=",";break;case 242:H="-";break;case 243:H=".";break;case 244:H="/";break;case 245:H=":";break;case 246:H=";";break;case 247:H="<";break;case 248:H="=";break;case 249:H=">";break;case 250:H="?";break;case 251:H="_";break;case 252:H=" ";break;default:throw new L}return new Oe(y+8,H)}isStillAlpha(y){if(y+5>this.information.getSize())return!1;let E=this.extractNumericValueFromBitArray(y,5);if(E>=5&&E<16)return!0;if(y+6>this.information.getSize())return!1;let O=this.extractNumericValueFromBitArray(y,6);return O>=16&&O<63}decodeAlphanumeric(y){let E=this.extractNumericValueFromBitArray(y,5);if(E===15)return new Oe(y+5,Oe.FNC1);if(E>=5&&E<15)return new Oe(y+5,"0"+(E-5));let O=this.extractNumericValueFromBitArray(y,6);if(O>=32&&O<58)return new Oe(y+6,""+(O+33));let $;switch(O){case 58:$="*";break;case 59:$=",";break;case 60:$="-";break;case 61:$=".";break;case 62:$="/";break;default:throw new at("Decoding invalid alphanumeric value: "+O)}return new Oe(y+6,$)}isAlphaTo646ToAlphaLatch(y){if(y+1>this.information.getSize())return!1;for(let E=0;E<5&&E+y<this.information.getSize();++E)if(E===2){if(!this.information.get(y+2))return!1}else if(this.information.get(y+E))return!1;return!0}isAlphaOr646ToNumericLatch(y){if(y+3>this.information.getSize())return!1;for(let E=y;E<y+3;++E)if(this.information.get(E))return!1;return!0}isNumericToAlphaNumericLatch(y){if(y+1>this.information.getSize())return!1;for(let E=0;E<4&&E+y<this.information.getSize();++E)if(this.information.get(y+E))return!1;return!0}}class Cn{constructor(y){this.information=y,this.generalDecoder=new Kn(y)}getInformation(){return this.information}getGeneralDecoder(){return this.generalDecoder}}class Bt extends Cn{constructor(y){super(y)}encodeCompressedGtin(y,E){y.append("(01)");let O=y.length();y.append("9"),this.encodeCompressedGtinWithoutAI(y,E,O)}encodeCompressedGtinWithoutAI(y,E,O){for(let $=0;$<4;++$){let H=this.getGeneralDecoder().extractNumericValueFromBitArray(E+10*$,10);H/100===0&&y.append("0"),H/10===0&&y.append("0"),y.append(H)}Bt.appendCheckDigit(y,O)}static appendCheckDigit(y,E){let O=0;for(let $=0;$<13;$++){let H=y.charAt($+E).charCodeAt(0)-48;O+=$&1?H:3*H}O=10-O%10,O===10&&(O=0),y.append(O)}}Bt.GTIN_SIZE=40;class an extends Bt{constructor(y){super(y)}parseInformation(){let y=new re;y.append("(01)");let E=y.length(),O=this.getGeneralDecoder().extractNumericValueFromBitArray(an.HEADER_SIZE,4);return y.append(O),this.encodeCompressedGtinWithoutAI(y,an.HEADER_SIZE+4,E),this.getGeneralDecoder().decodeAllCodes(y,an.HEADER_SIZE+44)}}an.HEADER_SIZE=4;class Pn extends Cn{constructor(y){super(y)}parseInformation(){let y=new re;return this.getGeneralDecoder().decodeAllCodes(y,Pn.HEADER_SIZE)}}Pn.HEADER_SIZE=5;class qn extends Bt{constructor(y){super(y)}encodeCompressedWeight(y,E,O){let $=this.getGeneralDecoder().extractNumericValueFromBitArray(E,O);this.addWeightCode(y,$);let H=this.checkWeight($),K=1e5;for(let le=0;le<5;++le)H/K===0&&y.append("0"),K/=10;y.append(H)}}class nr extends qn{constructor(y){super(y)}parseInformation(){if(this.getInformation().getSize()!=nr.HEADER_SIZE+qn.GTIN_SIZE+nr.WEIGHT_SIZE)throw new Y;let y=new re;return this.encodeCompressedGtin(y,nr.HEADER_SIZE),this.encodeCompressedWeight(y,nr.HEADER_SIZE+qn.GTIN_SIZE,nr.WEIGHT_SIZE),y.toString()}}nr.HEADER_SIZE=5,nr.WEIGHT_SIZE=15;class tr extends nr{constructor(y){super(y)}addWeightCode(y,E){y.append("(3103)")}checkWeight(y){return y}}class Qt extends nr{constructor(y){super(y)}addWeightCode(y,E){E<1e4?y.append("(3202)"):y.append("(3203)")}checkWeight(y){return y<1e4?y:y-1e4}}class zn extends Bt{constructor(y){super(y)}parseInformation(){if(this.getInformation().getSize()<zn.HEADER_SIZE+Bt.GTIN_SIZE)throw new Y;let y=new re;this.encodeCompressedGtin(y,zn.HEADER_SIZE);let E=this.getGeneralDecoder().extractNumericValueFromBitArray(zn.HEADER_SIZE+Bt.GTIN_SIZE,zn.LAST_DIGIT_SIZE);y.append("(392"),y.append(E),y.append(")");let O=this.getGeneralDecoder().decodeGeneralPurposeField(zn.HEADER_SIZE+Bt.GTIN_SIZE+zn.LAST_DIGIT_SIZE,null);return y.append(O.getNewString()),y.toString()}}zn.HEADER_SIZE=8,zn.LAST_DIGIT_SIZE=2;class Yn extends Bt{constructor(y){super(y)}parseInformation(){if(this.getInformation().getSize()<Yn.HEADER_SIZE+Bt.GTIN_SIZE)throw new Y;let y=new re;this.encodeCompressedGtin(y,Yn.HEADER_SIZE);let E=this.getGeneralDecoder().extractNumericValueFromBitArray(Yn.HEADER_SIZE+Bt.GTIN_SIZE,Yn.LAST_DIGIT_SIZE);y.append("(393"),y.append(E),y.append(")");let O=this.getGeneralDecoder().extractNumericValueFromBitArray(Yn.HEADER_SIZE+Bt.GTIN_SIZE+Yn.LAST_DIGIT_SIZE,Yn.FIRST_THREE_DIGITS_SIZE);O/100==0&&y.append("0"),O/10==0&&y.append("0"),y.append(O);let $=this.getGeneralDecoder().decodeGeneralPurposeField(Yn.HEADER_SIZE+Bt.GTIN_SIZE+Yn.LAST_DIGIT_SIZE+Yn.FIRST_THREE_DIGITS_SIZE,null);return y.append($.getNewString()),y.toString()}}Yn.HEADER_SIZE=8,Yn.LAST_DIGIT_SIZE=2,Yn.FIRST_THREE_DIGITS_SIZE=10;class Lt extends qn{constructor(y,E,O){super(y),this.dateCode=O,this.firstAIdigits=E}parseInformation(){if(this.getInformation().getSize()!=Lt.HEADER_SIZE+Lt.GTIN_SIZE+Lt.WEIGHT_SIZE+Lt.DATE_SIZE)throw new Y;let y=new re;return this.encodeCompressedGtin(y,Lt.HEADER_SIZE),this.encodeCompressedWeight(y,Lt.HEADER_SIZE+Lt.GTIN_SIZE,Lt.WEIGHT_SIZE),this.encodeCompressedDate(y,Lt.HEADER_SIZE+Lt.GTIN_SIZE+Lt.WEIGHT_SIZE),y.toString()}encodeCompressedDate(y,E){let O=this.getGeneralDecoder().extractNumericValueFromBitArray(E,Lt.DATE_SIZE);if(O==38400)return;y.append("("),y.append(this.dateCode),y.append(")");let $=O%32;O/=32;let H=O%12+1;O/=12;let K=O;K/10==0&&y.append("0"),y.append(K),H/10==0&&y.append("0"),y.append(H),$/10==0&&y.append("0"),y.append($)}addWeightCode(y,E){y.append("("),y.append(this.firstAIdigits),y.append(E/1e5),y.append(")")}checkWeight(y){return y%1e5}}Lt.HEADER_SIZE=8,Lt.WEIGHT_SIZE=20,Lt.DATE_SIZE=16;function Fn(ut){try{if(ut.get(1))return new an(ut);if(!ut.get(2))return new Pn(ut);switch(Kn.extractNumericValueFromBitArray(ut,1,4)){case 4:return new tr(ut);case 5:return new Qt(ut)}switch(Kn.extractNumericValueFromBitArray(ut,1,5)){case 12:return new zn(ut);case 13:return new Yn(ut)}switch(Kn.extractNumericValueFromBitArray(ut,1,7)){case 56:return new Lt(ut,"310","11");case 57:return new Lt(ut,"320","11");case 58:return new Lt(ut,"310","13");case 59:return new Lt(ut,"320","13");case 60:return new Lt(ut,"310","15");case 61:return new Lt(ut,"320","15");case 62:return new Lt(ut,"310","17");case 63:return new Lt(ut,"320","17")}}catch(y){throw console.log(y),new at("unknown decoder: "+ut)}}class Ee{constructor(y,E,O,$){this.leftchar=y,this.rightchar=E,this.finderpattern=O,this.maybeLast=$}mayBeLast(){return this.maybeLast}getLeftChar(){return this.leftchar}getRightChar(){return this.rightchar}getFinderPattern(){return this.finderpattern}mustBeLast(){return this.rightchar==null}toString(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(this.finderpattern==null?"null":this.finderpattern.getValue())+" ]"}static equals(y,E){return y instanceof Ee?Ee.equalsOrNull(y.leftchar,E.leftchar)&&Ee.equalsOrNull(y.rightchar,E.rightchar)&&Ee.equalsOrNull(y.finderpattern,E.finderpattern):!1}static equalsOrNull(y,E){return y===null?E===null:Ee.equals(y,E)}hashCode(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()}}class p{constructor(y,E,O){this.pairs=y,this.rowNumber=E,this.wasReversed=O}getPairs(){return this.pairs}getRowNumber(){return this.rowNumber}isReversed(){return this.wasReversed}isEquivalent(y){return this.checkEqualitity(this,y)}toString(){return"{ "+this.pairs+" }"}equals(y,E){return y instanceof p?this.checkEqualitity(y,E)&&y.wasReversed===E.wasReversed:!1}checkEqualitity(y,E){if(!y||!E)return;let O;return y.forEach(($,H)=>{E.forEach(K=>{$.getLeftChar().getValue()===K.getLeftChar().getValue()&&$.getRightChar().getValue()===K.getRightChar().getValue()&&$.getFinderPatter().getValue()===K.getFinderPatter().getValue()&&(O=!0)})}),O}}class h extends vn{constructor(y){super(...arguments),this.pairs=new Array(h.MAX_PAIRS),this.rows=new Array,this.startEnd=[2],this.verbose=y===!0}decodeRow(y,E,O){this.pairs.length=0,this.startFromEven=!1;try{return h.constructResult(this.decodeRow2pairs(y,E))}catch($){this.verbose&&console.log($)}return this.pairs.length=0,this.startFromEven=!0,h.constructResult(this.decodeRow2pairs(y,E))}reset(){this.pairs.length=0,this.rows.length=0}decodeRow2pairs(y,E){let O=!1;for(;!O;)try{this.pairs.push(this.retrieveNextPair(E,this.pairs,y))}catch(H){if(H instanceof Y){if(!this.pairs.length)throw new Y;O=!0}}if(this.checkChecksum())return this.pairs;let $;if(this.rows.length?$=!0:$=!1,this.storeRow(y,!1),$){let H=this.checkRowsBoolean(!1);if(H!=null||(H=this.checkRowsBoolean(!0),H!=null))return H}throw new Y}checkRowsBoolean(y){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,y&&(this.rows=this.rows.reverse());let E=null;try{E=this.checkRows(new Array,0)}catch(O){this.verbose&&console.log(O)}return y&&(this.rows=this.rows.reverse()),E}checkRows(y,E){for(let O=E;O<this.rows.length;O++){let $=this.rows[O];this.pairs.length=0;for(let K of y)this.pairs.push(K.getPairs());if(this.pairs.push($.getPairs()),!h.isValidSequence(this.pairs))continue;if(this.checkChecksum())return this.pairs;let H=new Array(y);H.push($);try{return this.checkRows(H,O+1)}catch(K){this.verbose&&console.log(K)}}throw new Y}static isValidSequence(y){for(let E of h.FINDER_PATTERN_SEQUENCES){if(y.length>E.length)continue;let O=!0;for(let $=0;$<y.length;$++)if(y[$].getFinderPattern().getValue()!=E[$]){O=!1;break}if(O)return!0}return!1}storeRow(y,E){let O=0,$=!1,H=!1;for(;O<this.rows.length;){let K=this.rows[O];if(K.getRowNumber()>y){H=K.isEquivalent(this.pairs);break}$=K.isEquivalent(this.pairs),O++}H||$||h.isPartialRow(this.pairs,this.rows)||(this.rows.push(O,new p(this.pairs,y,E)),this.removePartialRows(this.pairs,this.rows))}removePartialRows(y,E){for(let O of E)if(O.getPairs().length!==y.length){for(let $ of O.getPairs())for(let H of y)if(Ee.equals($,H))break}}static isPartialRow(y,E){for(let O of E){let $=!0;for(let H of y){let K=!1;for(let le of O.getPairs())if(H.equals(le)){K=!0;break}if(!K){$=!1;break}}if($)return!0}return!1}getRows(){return this.rows}static constructResult(y){let E=Jn.buildBitArray(y),$=Fn(E).parseInformation(),H=y[0].getFinderPattern().getResultPoints(),K=y[y.length-1].getFinderPattern().getResultPoints(),le=[H[0],H[1],K[0],K[1]];return new ce($,null,null,le,Ne.RSS_EXPANDED,null)}checkChecksum(){let y=this.pairs.get(0),E=y.getLeftChar(),O=y.getRightChar();if(O==null)return!1;let $=O.getChecksumPortion(),H=2;for(let le=1;le<this.pairs.size();++le){let ve=this.pairs.get(le);$+=ve.getLeftChar().getChecksumPortion(),H++;let Te=ve.getRightChar();Te!=null&&($+=Te.getChecksumPortion(),H++)}return $%=211,211*(H-4)+$==E.getValue()}static getNextSecondBar(y,E){let O;return y.get(E)?(O=y.getNextUnset(E),O=y.getNextSet(O)):(O=y.getNextSet(E),O=y.getNextUnset(O)),O}retrieveNextPair(y,E,O){let $=E.length%2==0;this.startFromEven&&($=!$);let H,K=!0,le=-1;do this.findNextPair(y,E,le),H=this.parseFoundFinderPattern(y,O,$),H==null?le=h.getNextSecondBar(y,this.startEnd[0]):K=!1;while(K);let ve=this.decodeDataCharacter(y,H,$,!0);if(!this.isEmptyPair(E)&&E[E.length-1].mustBeLast())throw new Y;let Te;try{Te=this.decodeDataCharacter(y,H,$,!1)}catch(Ze){Te=null,this.verbose&&console.log(Ze)}return new Ee(ve,Te,H,!0)}isEmptyPair(y){return y.length===0}findNextPair(y,E,O){let $=this.getDecodeFinderCounters();$[0]=0,$[1]=0,$[2]=0,$[3]=0;let H=y.getSize(),K;O>=0?K=O:this.isEmptyPair(E)?K=0:K=E[E.length-1].getFinderPattern().getStartEnd()[1];let le=E.length%2!=0;this.startFromEven&&(le=!le);let ve=!1;for(;K<H&&(ve=!y.get(K),!!ve);)K++;let Te=0,Ze=K;for(let ht=K;ht<H;ht++)if(y.get(ht)!=ve)$[Te]++;else{if(Te==3){if(le&&h.reverseCounters($),h.isFinderPattern($)){this.startEnd[0]=Ze,this.startEnd[1]=ht;return}le&&h.reverseCounters($),Ze+=$[0]+$[1],$[0]=$[2],$[1]=$[3],$[2]=0,$[3]=0,Te--}else Te++;$[Te]=1,ve=!ve}throw new Y}static reverseCounters(y){let E=y.length;for(let O=0;O<E/2;++O){let $=y[O];y[O]=y[E-O-1],y[E-O-1]=$}}parseFoundFinderPattern(y,E,O){let $,H,K;if(O){let Te=this.startEnd[0]-1;for(;Te>=0&&!y.get(Te);)Te--;Te++,$=this.startEnd[0]-Te,H=Te,K=this.startEnd[1]}else H=this.startEnd[0],K=y.getNextUnset(this.startEnd[1]+1),$=K-this.startEnd[1];let le=this.getDecodeFinderCounters();w.arraycopy(le,0,le,1,le.length-1),le[0]=$;let ve;try{ve=this.parseFinderValue(le,h.FINDER_PATTERNS)}catch{return null}return new Hn(ve,[H,K],H,K,E)}decodeDataCharacter(y,E,O,$){let H=this.getDataCharacterCounters();for(let ua=0;ua<H.length;ua++)H[ua]=0;if($)h.recordPatternInReverse(y,E.getStartEnd()[0],H);else{h.recordPattern(y,E.getStartEnd()[1],H);for(let ua=0,Sa=H.length-1;ua<Sa;ua++,Sa--){let Uo=H[ua];H[ua]=H[Sa],H[Sa]=Uo}}let K=17,le=kt.sum(new Int32Array(H))/K,ve=(E.getStartEnd()[1]-E.getStartEnd()[0])/15;if(Math.abs(le-ve)/ve>.3)throw new Y;let Te=this.getOddCounts(),Ze=this.getEvenCounts(),ht=this.getOddRoundingErrors(),_t=this.getEvenRoundingErrors();for(let ua=0;ua<H.length;ua++){let Sa=1*H[ua]/le,Uo=Sa+.5;if(Uo<1){if(Sa<.3)throw new Y;Uo=1}else if(Uo>8){if(Sa>8.7)throw new Y;Uo=8}let hd=ua/2;ua&1?(Ze[hd]=Uo,_t[hd]=Sa-Uo):(Te[hd]=Uo,ht[hd]=Sa-Uo)}this.adjustOddEvenCounts(K);let rn=4*E.getValue()+(O?0:2)+($?0:1)-1,bt=0,zt=0;for(let ua=Te.length-1;ua>=0;ua--){if(h.isNotA1left(E,O,$)){let Sa=h.WEIGHTS[rn][2*ua];zt+=Te[ua]*Sa}bt+=Te[ua]}let qt=0;for(let ua=Ze.length-1;ua>=0;ua--)if(h.isNotA1left(E,O,$)){let Sa=h.WEIGHTS[rn][2*ua+1];qt+=Ze[ua]*Sa}let Tn=zt+qt;if(bt&1||bt>13||bt<4)throw new Y;let ir=(13-bt)/2,Cr=h.SYMBOL_WIDEST[ir],Ar=9-Cr,ps=$n.getRSSvalue(Te,Cr,!0),Ws=$n.getRSSvalue(Ze,Ar,!1),ic=h.EVEN_TOTAL_SUBSET[ir],Ya=h.GSUM[ir],Xa=ps*ic+Ws+Ya;return new Qn(Xa,Tn)}static isNotA1left(y,E,O){return!(y.getValue()==0&&E&&O)}adjustOddEvenCounts(y){let E=kt.sum(new Int32Array(this.getOddCounts())),O=kt.sum(new Int32Array(this.getEvenCounts())),$=!1,H=!1;E>13?H=!0:E<4&&($=!0);let K=!1,le=!1;O>13?le=!0:O<4&&(K=!0);let ve=E+O-y,Te=(E&1)==1,Ze=(O&1)==0;if(ve==1)if(Te){if(Ze)throw new Y;H=!0}else{if(!Ze)throw new Y;le=!0}else if(ve==-1)if(Te){if(Ze)throw new Y;$=!0}else{if(!Ze)throw new Y;K=!0}else if(ve==0){if(Te){if(!Ze)throw new Y;E<O?($=!0,le=!0):(H=!0,K=!0)}else if(Ze)throw new Y}else throw new Y;if($){if(H)throw new Y;h.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(H&&h.decrement(this.getOddCounts(),this.getOddRoundingErrors()),K){if(le)throw new Y;h.increment(this.getEvenCounts(),this.getOddRoundingErrors())}le&&h.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}h.SYMBOL_WIDEST=[7,5,4,3,1],h.EVEN_TOTAL_SUBSET=[4,20,52,104,204],h.GSUM=[0,348,1388,2948,3988],h.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],h.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],h.FINDER_PAT_A=0,h.FINDER_PAT_B=1,h.FINDER_PAT_C=2,h.FINDER_PAT_D=3,h.FINDER_PAT_E=4,h.FINDER_PAT_F=5,h.FINDER_PATTERN_SEQUENCES=[[h.FINDER_PAT_A,h.FINDER_PAT_A],[h.FINDER_PAT_A,h.FINDER_PAT_B,h.FINDER_PAT_B],[h.FINDER_PAT_A,h.FINDER_PAT_C,h.FINDER_PAT_B,h.FINDER_PAT_D],[h.FINDER_PAT_A,h.FINDER_PAT_E,h.FINDER_PAT_B,h.FINDER_PAT_D,h.FINDER_PAT_C],[h.FINDER_PAT_A,h.FINDER_PAT_E,h.FINDER_PAT_B,h.FINDER_PAT_D,h.FINDER_PAT_D,h.FINDER_PAT_F],[h.FINDER_PAT_A,h.FINDER_PAT_E,h.FINDER_PAT_B,h.FINDER_PAT_D,h.FINDER_PAT_E,h.FINDER_PAT_F,h.FINDER_PAT_F],[h.FINDER_PAT_A,h.FINDER_PAT_A,h.FINDER_PAT_B,h.FINDER_PAT_B,h.FINDER_PAT_C,h.FINDER_PAT_C,h.FINDER_PAT_D,h.FINDER_PAT_D],[h.FINDER_PAT_A,h.FINDER_PAT_A,h.FINDER_PAT_B,h.FINDER_PAT_B,h.FINDER_PAT_C,h.FINDER_PAT_C,h.FINDER_PAT_D,h.FINDER_PAT_E,h.FINDER_PAT_E],[h.FINDER_PAT_A,h.FINDER_PAT_A,h.FINDER_PAT_B,h.FINDER_PAT_B,h.FINDER_PAT_C,h.FINDER_PAT_C,h.FINDER_PAT_D,h.FINDER_PAT_E,h.FINDER_PAT_F,h.FINDER_PAT_F],[h.FINDER_PAT_A,h.FINDER_PAT_A,h.FINDER_PAT_B,h.FINDER_PAT_B,h.FINDER_PAT_C,h.FINDER_PAT_D,h.FINDER_PAT_D,h.FINDER_PAT_E,h.FINDER_PAT_E,h.FINDER_PAT_F,h.FINDER_PAT_F]],h.MAX_PAIRS=11;class S extends Qn{constructor(y,E,O){super(y,E),this.count=0,this.finderPattern=O}getFinderPattern(){return this.finderPattern}getCount(){return this.count}incrementCount(){this.count++}}class _ extends vn{constructor(){super(...arguments),this.possibleLeftPairs=[],this.possibleRightPairs=[]}decodeRow(y,E,O){const $=this.decodePair(E,!1,y,O);_.addOrTally(this.possibleLeftPairs,$),E.reverse();let H=this.decodePair(E,!0,y,O);_.addOrTally(this.possibleRightPairs,H),E.reverse();for(let K of this.possibleLeftPairs)if(K.getCount()>1){for(let le of this.possibleRightPairs)if(le.getCount()>1&&_.checkChecksum(K,le))return _.constructResult(K,le)}throw new Y}static addOrTally(y,E){if(E==null)return;let O=!1;for(let $ of y)if($.getValue()===E.getValue()){$.incrementCount(),O=!0;break}O||y.push(E)}reset(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0}static constructResult(y,E){let O=4537077*y.getValue()+E.getValue(),$=new String(O).toString(),H=new re;for(let Te=13-$.length;Te>0;Te--)H.append("0");H.append($);let K=0;for(let Te=0;Te<13;Te++){let Ze=H.charAt(Te).charCodeAt(0)-48;K+=Te&1?Ze:3*Ze}K=10-K%10,K===10&&(K=0),H.append(K.toString());let le=y.getFinderPattern().getResultPoints(),ve=E.getFinderPattern().getResultPoints();return new ce(H.toString(),null,0,[le[0],le[1],ve[0],ve[1]],Ne.RSS_14,new Date().getTime())}static checkChecksum(y,E){let O=(y.getChecksumPortion()+16*E.getChecksumPortion())%79,$=9*y.getFinderPattern().getValue()+E.getFinderPattern().getValue();return $>72&&$--,$>8&&$--,O===$}decodePair(y,E,O,$){try{let H=this.findFinderPattern(y,E),K=this.parseFoundFinderPattern(y,O,E,H),le=$==null?null:$.get(U.NEED_RESULT_POINT_CALLBACK);if(le!=null){let Ze=(H[0]+H[1])/2;E&&(Ze=y.getSize()-1-Ze),le.foundPossibleResultPoint(new jt(Ze,O))}let ve=this.decodeDataCharacter(y,K,!0),Te=this.decodeDataCharacter(y,K,!1);return new S(1597*ve.getValue()+Te.getValue(),ve.getChecksumPortion()+4*Te.getChecksumPortion(),K)}catch{return null}}decodeDataCharacter(y,E,O){let $=this.getDataCharacterCounters();for(let qt=0;qt<$.length;qt++)$[qt]=0;if(O)At.recordPatternInReverse(y,E.getStartEnd()[0],$);else{At.recordPattern(y,E.getStartEnd()[1]+1,$);for(let qt=0,Tn=$.length-1;qt<Tn;qt++,Tn--){let ir=$[qt];$[qt]=$[Tn],$[Tn]=ir}}let H=O?16:15,K=kt.sum(new Int32Array($))/H,le=this.getOddCounts(),ve=this.getEvenCounts(),Te=this.getOddRoundingErrors(),Ze=this.getEvenRoundingErrors();for(let qt=0;qt<$.length;qt++){let Tn=$[qt]/K,ir=Math.floor(Tn+.5);ir<1?ir=1:ir>8&&(ir=8);let Cr=Math.floor(qt/2);qt&1?(ve[Cr]=ir,Ze[Cr]=Tn-ir):(le[Cr]=ir,Te[Cr]=Tn-ir)}this.adjustOddEvenCounts(O,H);let ht=0,_t=0;for(let qt=le.length-1;qt>=0;qt--)_t*=9,_t+=le[qt],ht+=le[qt];let rn=0,bt=0;for(let qt=ve.length-1;qt>=0;qt--)rn*=9,rn+=ve[qt],bt+=ve[qt];let zt=_t+3*rn;if(O){if(ht&1||ht>12||ht<4)throw new Y;let qt=(12-ht)/2,Tn=_.OUTSIDE_ODD_WIDEST[qt],ir=9-Tn,Cr=$n.getRSSvalue(le,Tn,!1),Ar=$n.getRSSvalue(ve,ir,!0),ps=_.OUTSIDE_EVEN_TOTAL_SUBSET[qt],Ws=_.OUTSIDE_GSUM[qt];return new Qn(Cr*ps+Ar+Ws,zt)}else{if(bt&1||bt>10||bt<4)throw new Y;let qt=(10-bt)/2,Tn=_.INSIDE_ODD_WIDEST[qt],ir=9-Tn,Cr=$n.getRSSvalue(le,Tn,!0),Ar=$n.getRSSvalue(ve,ir,!1),ps=_.INSIDE_ODD_TOTAL_SUBSET[qt],Ws=_.INSIDE_GSUM[qt];return new Qn(Ar*ps+Cr+Ws,zt)}}findFinderPattern(y,E){let O=this.getDecodeFinderCounters();O[0]=0,O[1]=0,O[2]=0,O[3]=0;let $=y.getSize(),H=!1,K=0;for(;K<$&&(H=!y.get(K),E!==H);)K++;let le=0,ve=K;for(let Te=K;Te<$;Te++)if(y.get(Te)!==H)O[le]++;else{if(le===3){if(vn.isFinderPattern(O))return[ve,Te];ve+=O[0]+O[1],O[0]=O[2],O[1]=O[3],O[2]=0,O[3]=0,le--}else le++;O[le]=1,H=!H}throw new Y}parseFoundFinderPattern(y,E,O,$){let H=y.get($[0]),K=$[0]-1;for(;K>=0&&H!==y.get(K);)K--;K++;const le=$[0]-K,ve=this.getDecodeFinderCounters(),Te=new Int32Array(ve.length);w.arraycopy(ve,0,Te,1,ve.length-1),Te[0]=le;const Ze=this.parseFinderValue(Te,_.FINDER_PATTERNS);let ht=K,_t=$[1];return O&&(ht=y.getSize()-1-ht,_t=y.getSize()-1-_t),new Hn(Ze,[K,$[1]],ht,_t,E)}adjustOddEvenCounts(y,E){let O=kt.sum(new Int32Array(this.getOddCounts())),$=kt.sum(new Int32Array(this.getEvenCounts())),H=!1,K=!1,le=!1,ve=!1;y?(O>12?K=!0:O<4&&(H=!0),$>12?ve=!0:$<4&&(le=!0)):(O>11?K=!0:O<5&&(H=!0),$>10?ve=!0:$<4&&(le=!0));let Te=O+$-E,Ze=(O&1)===(y?1:0),ht=($&1)===1;if(Te===1)if(Ze){if(ht)throw new Y;K=!0}else{if(!ht)throw new Y;ve=!0}else if(Te===-1)if(Ze){if(ht)throw new Y;H=!0}else{if(!ht)throw new Y;le=!0}else if(Te===0){if(Ze){if(!ht)throw new Y;O<$?(H=!0,ve=!0):(K=!0,le=!0)}else if(ht)throw new Y}else throw new Y;if(H){if(K)throw new Y;vn.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(K&&vn.decrement(this.getOddCounts(),this.getOddRoundingErrors()),le){if(ve)throw new Y;vn.increment(this.getEvenCounts(),this.getOddRoundingErrors())}ve&&vn.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}_.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],_.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],_.OUTSIDE_GSUM=[0,161,961,2015,2715],_.INSIDE_GSUM=[0,336,1036,1516],_.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],_.INSIDE_ODD_WIDEST=[2,4,6,8],_.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])];class k extends At{constructor(y,E){super(),this.readers=[],this.verbose=E===!0;const O=y?y.get(U.POSSIBLE_FORMATS):null,$=y&&y.get(U.ASSUME_CODE_39_CHECK_DIGIT)!==void 0;O?((O.includes(Ne.EAN_13)||O.includes(Ne.UPC_A)||O.includes(Ne.EAN_8)||O.includes(Ne.UPC_E))&&this.readers.push(new kn(y)),O.includes(Ne.CODE_39)&&this.readers.push(new He($)),O.includes(Ne.CODE_128)&&this.readers.push(new Je),O.includes(Ne.ITF)&&this.readers.push(new Rt),O.includes(Ne.RSS_14)&&this.readers.push(new _),O.includes(Ne.RSS_EXPANDED)&&this.readers.push(new h(this.verbose))):(this.readers.push(new kn(y)),this.readers.push(new He),this.readers.push(new kn(y)),this.readers.push(new Je),this.readers.push(new Rt),this.readers.push(new _),this.readers.push(new h(this.verbose)))}decodeRow(y,E,O){for(let $=0;$<this.readers.length;$++)try{return this.readers[$].decodeRow(y,E,O)}catch{}throw new Y}reset(){this.readers.forEach(y=>y.reset())}}class T extends Ae{constructor(y=500,E){super(new k(E),y,E)}}class B{constructor(y,E,O){this.ecCodewords=y,this.ecBlocks=[E],O&&this.ecBlocks.push(O)}getECCodewords(){return this.ecCodewords}getECBlocks(){return this.ecBlocks}}class q{constructor(y,E){this.count=y,this.dataCodewords=E}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class te{constructor(y,E,O,$,H,K){this.versionNumber=y,this.symbolSizeRows=E,this.symbolSizeColumns=O,this.dataRegionSizeRows=$,this.dataRegionSizeColumns=H,this.ecBlocks=K;let le=0;const ve=K.getECCodewords(),Te=K.getECBlocks();for(let Ze of Te)le+=Ze.getCount()*(Ze.getDataCodewords()+ve);this.totalCodewords=le}getVersionNumber(){return this.versionNumber}getSymbolSizeRows(){return this.symbolSizeRows}getSymbolSizeColumns(){return this.symbolSizeColumns}getDataRegionSizeRows(){return this.dataRegionSizeRows}getDataRegionSizeColumns(){return this.dataRegionSizeColumns}getTotalCodewords(){return this.totalCodewords}getECBlocks(){return this.ecBlocks}static getVersionForDimensions(y,E){if(y&1||E&1)throw new L;for(let O of te.VERSIONS)if(O.symbolSizeRows===y&&O.symbolSizeColumns===E)return O;throw new L}toString(){return""+this.versionNumber}static buildVersions(){return[new te(1,10,10,8,8,new B(5,new q(1,3))),new te(2,12,12,10,10,new B(7,new q(1,5))),new te(3,14,14,12,12,new B(10,new q(1,8))),new te(4,16,16,14,14,new B(12,new q(1,12))),new te(5,18,18,16,16,new B(14,new q(1,18))),new te(6,20,20,18,18,new B(18,new q(1,22))),new te(7,22,22,20,20,new B(20,new q(1,30))),new te(8,24,24,22,22,new B(24,new q(1,36))),new te(9,26,26,24,24,new B(28,new q(1,44))),new te(10,32,32,14,14,new B(36,new q(1,62))),new te(11,36,36,16,16,new B(42,new q(1,86))),new te(12,40,40,18,18,new B(48,new q(1,114))),new te(13,44,44,20,20,new B(56,new q(1,144))),new te(14,48,48,22,22,new B(68,new q(1,174))),new te(15,52,52,24,24,new B(42,new q(2,102))),new te(16,64,64,14,14,new B(56,new q(2,140))),new te(17,72,72,16,16,new B(36,new q(4,92))),new te(18,80,80,18,18,new B(48,new q(4,114))),new te(19,88,88,20,20,new B(56,new q(4,144))),new te(20,96,96,22,22,new B(68,new q(4,174))),new te(21,104,104,24,24,new B(56,new q(6,136))),new te(22,120,120,18,18,new B(68,new q(6,175))),new te(23,132,132,20,20,new B(62,new q(8,163))),new te(24,144,144,22,22,new B(62,new q(8,156),new q(2,155))),new te(25,8,18,6,16,new B(7,new q(1,5))),new te(26,8,32,6,14,new B(11,new q(1,10))),new te(27,12,26,10,24,new B(14,new q(1,16))),new te(28,12,36,10,16,new B(18,new q(1,22))),new te(29,16,36,14,16,new B(24,new q(1,32))),new te(30,16,48,14,22,new B(28,new q(1,49)))]}}te.VERSIONS=te.buildVersions();class ue{constructor(y){const E=y.getHeight();if(E<8||E>144||E&1)throw new L;this.version=ue.readVersion(y),this.mappingBitMatrix=this.extractDataRegion(y),this.readMappingMatrix=new he(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}getVersion(){return this.version}static readVersion(y){const E=y.getHeight(),O=y.getWidth();return te.getVersionForDimensions(E,O)}readCodewords(){const y=new Int8Array(this.version.getTotalCodewords());let E=0,O=4,$=0;const H=this.mappingBitMatrix.getHeight(),K=this.mappingBitMatrix.getWidth();let le=!1,ve=!1,Te=!1,Ze=!1;do if(O===H&&$===0&&!le)y[E++]=this.readCorner1(H,K)&255,O-=2,$+=2,le=!0;else if(O===H-2&&$===0&&K&3&&!ve)y[E++]=this.readCorner2(H,K)&255,O-=2,$+=2,ve=!0;else if(O===H+4&&$===2&&!(K&7)&&!Te)y[E++]=this.readCorner3(H,K)&255,O-=2,$+=2,Te=!0;else if(O===H-2&&$===0&&(K&7)===4&&!Ze)y[E++]=this.readCorner4(H,K)&255,O-=2,$+=2,Ze=!0;else{do O<H&&$>=0&&!this.readMappingMatrix.get($,O)&&(y[E++]=this.readUtah(O,$,H,K)&255),O-=2,$+=2;while(O>=0&&$<K);O+=1,$+=3;do O>=0&&$<K&&!this.readMappingMatrix.get($,O)&&(y[E++]=this.readUtah(O,$,H,K)&255),O+=2,$-=2;while(O<H&&$>=0);O+=3,$+=1}while(O<H||$<K);if(E!==this.version.getTotalCodewords())throw new L;return y}readModule(y,E,O,$){return y<0&&(y+=O,E+=4-(O+4&7)),E<0&&(E+=$,y+=4-($+4&7)),this.readMappingMatrix.set(E,y),this.mappingBitMatrix.get(E,y)}readUtah(y,E,O,$){let H=0;return this.readModule(y-2,E-2,O,$)&&(H|=1),H<<=1,this.readModule(y-2,E-1,O,$)&&(H|=1),H<<=1,this.readModule(y-1,E-2,O,$)&&(H|=1),H<<=1,this.readModule(y-1,E-1,O,$)&&(H|=1),H<<=1,this.readModule(y-1,E,O,$)&&(H|=1),H<<=1,this.readModule(y,E-2,O,$)&&(H|=1),H<<=1,this.readModule(y,E-1,O,$)&&(H|=1),H<<=1,this.readModule(y,E,O,$)&&(H|=1),H}readCorner1(y,E){let O=0;return this.readModule(y-1,0,y,E)&&(O|=1),O<<=1,this.readModule(y-1,1,y,E)&&(O|=1),O<<=1,this.readModule(y-1,2,y,E)&&(O|=1),O<<=1,this.readModule(0,E-2,y,E)&&(O|=1),O<<=1,this.readModule(0,E-1,y,E)&&(O|=1),O<<=1,this.readModule(1,E-1,y,E)&&(O|=1),O<<=1,this.readModule(2,E-1,y,E)&&(O|=1),O<<=1,this.readModule(3,E-1,y,E)&&(O|=1),O}readCorner2(y,E){let O=0;return this.readModule(y-3,0,y,E)&&(O|=1),O<<=1,this.readModule(y-2,0,y,E)&&(O|=1),O<<=1,this.readModule(y-1,0,y,E)&&(O|=1),O<<=1,this.readModule(0,E-4,y,E)&&(O|=1),O<<=1,this.readModule(0,E-3,y,E)&&(O|=1),O<<=1,this.readModule(0,E-2,y,E)&&(O|=1),O<<=1,this.readModule(0,E-1,y,E)&&(O|=1),O<<=1,this.readModule(1,E-1,y,E)&&(O|=1),O}readCorner3(y,E){let O=0;return this.readModule(y-1,0,y,E)&&(O|=1),O<<=1,this.readModule(y-1,E-1,y,E)&&(O|=1),O<<=1,this.readModule(0,E-3,y,E)&&(O|=1),O<<=1,this.readModule(0,E-2,y,E)&&(O|=1),O<<=1,this.readModule(0,E-1,y,E)&&(O|=1),O<<=1,this.readModule(1,E-3,y,E)&&(O|=1),O<<=1,this.readModule(1,E-2,y,E)&&(O|=1),O<<=1,this.readModule(1,E-1,y,E)&&(O|=1),O}readCorner4(y,E){let O=0;return this.readModule(y-3,0,y,E)&&(O|=1),O<<=1,this.readModule(y-2,0,y,E)&&(O|=1),O<<=1,this.readModule(y-1,0,y,E)&&(O|=1),O<<=1,this.readModule(0,E-2,y,E)&&(O|=1),O<<=1,this.readModule(0,E-1,y,E)&&(O|=1),O<<=1,this.readModule(1,E-1,y,E)&&(O|=1),O<<=1,this.readModule(2,E-1,y,E)&&(O|=1),O<<=1,this.readModule(3,E-1,y,E)&&(O|=1),O}extractDataRegion(y){const E=this.version.getSymbolSizeRows(),O=this.version.getSymbolSizeColumns();if(y.getHeight()!==E)throw new f("Dimension of bitMatrix must match the version size");const $=this.version.getDataRegionSizeRows(),H=this.version.getDataRegionSizeColumns(),K=E/$|0,le=O/H|0,ve=K*$,Te=le*H,Ze=new he(Te,ve);for(let ht=0;ht<K;++ht){const _t=ht*$;for(let rn=0;rn<le;++rn){const bt=rn*H;for(let zt=0;zt<$;++zt){const qt=ht*($+2)+1+zt,Tn=_t+zt;for(let ir=0;ir<H;++ir){const Cr=rn*(H+2)+1+ir;if(y.get(Cr,qt)){const Ar=bt+ir;Ze.set(Ar,Tn)}}}}}return Ze}}class de{constructor(y,E){this.numDataCodewords=y,this.codewords=E}static getDataBlocks(y,E){const O=E.getECBlocks();let $=0;const H=O.getECBlocks();for(let zt of H)$+=zt.getCount();const K=new Array($);let le=0;for(let zt of H)for(let qt=0;qt<zt.getCount();qt++){const Tn=zt.getDataCodewords(),ir=O.getECCodewords()+Tn;K[le++]=new de(Tn,new Uint8Array(ir))}const Te=K[0].codewords.length-O.getECCodewords(),Ze=Te-1;let ht=0;for(let zt=0;zt<Ze;zt++)for(let qt=0;qt<le;qt++)K[qt].codewords[zt]=y[ht++];const _t=E.getVersionNumber()===24,rn=_t?8:le;for(let zt=0;zt<rn;zt++)K[zt].codewords[Te-1]=y[ht++];const bt=K[0].codewords.length;for(let zt=Te;zt<bt;zt++)for(let qt=0;qt<le;qt++){const Tn=_t?(qt+8)%le:qt,ir=_t&&Tn>7?zt-1:zt;K[Tn].codewords[ir]=y[ht++]}if(ht!==y.length)throw new f;return K}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}class xe{constructor(y){this.bytes=y,this.byteOffset=0,this.bitOffset=0}getBitOffset(){return this.bitOffset}getByteOffset(){return this.byteOffset}readBits(y){if(y<1||y>32||y>this.available())throw new f(""+y);let E=0,O=this.bitOffset,$=this.byteOffset;const H=this.bytes;if(O>0){const K=8-O,le=y<K?y:K,ve=K-le,Te=255>>8-le<<ve;E=(H[$]&Te)>>ve,y-=le,O+=le,O===8&&(O=0,$++)}if(y>0){for(;y>=8;)E=E<<8|H[$]&255,$++,y-=8;if(y>0){const K=8-y,le=255>>K<<K;E=E<<y|(H[$]&le)>>K,O+=y}}return this.bitOffset=O,this.byteOffset=$,E}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var we;(function(ut){ut[ut.PAD_ENCODE=0]="PAD_ENCODE",ut[ut.ASCII_ENCODE=1]="ASCII_ENCODE",ut[ut.C40_ENCODE=2]="C40_ENCODE",ut[ut.TEXT_ENCODE=3]="TEXT_ENCODE",ut[ut.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",ut[ut.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",ut[ut.BASE256_ENCODE=6]="BASE256_ENCODE"})(we||(we={}));class ke{static decode(y){const E=new xe(y),O=new re,$=new re,H=new Array;let K=we.ASCII_ENCODE;do if(K===we.ASCII_ENCODE)K=this.decodeAsciiSegment(E,O,$);else{switch(K){case we.C40_ENCODE:this.decodeC40Segment(E,O);break;case we.TEXT_ENCODE:this.decodeTextSegment(E,O);break;case we.ANSIX12_ENCODE:this.decodeAnsiX12Segment(E,O);break;case we.EDIFACT_ENCODE:this.decodeEdifactSegment(E,O);break;case we.BASE256_ENCODE:this.decodeBase256Segment(E,O,H);break;default:throw new L}K=we.ASCII_ENCODE}while(K!==we.PAD_ENCODE&&E.available()>0);return $.length()>0&&O.append($.toString()),new Ie(y,O.toString(),H.length===0?null:H,null)}static decodeAsciiSegment(y,E,O){let $=!1;do{let H=y.readBits(8);if(H===0)throw new L;if(H<=128)return $&&(H+=128),E.append(String.fromCharCode(H-1)),we.ASCII_ENCODE;if(H===129)return we.PAD_ENCODE;if(H<=229){const K=H-130;K<10&&E.append("0"),E.append(""+K)}else switch(H){case 230:return we.C40_ENCODE;case 231:return we.BASE256_ENCODE;case 232:E.append("");break;case 233:case 234:break;case 235:$=!0;break;case 236:E.append("[)>05"),O.insert(0,"");break;case 237:E.append("[)>06"),O.insert(0,"");break;case 238:return we.ANSIX12_ENCODE;case 239:return we.TEXT_ENCODE;case 240:return we.EDIFACT_ENCODE;case 241:break;default:if(H!==254||y.available()!==0)throw new L;break}}while(y.available()>0);return we.ASCII_ENCODE}static decodeC40Segment(y,E){let O=!1;const $=[];let H=0;do{if(y.available()===8)return;const K=y.readBits(8);if(K===254)return;this.parseTwoBytes(K,y.readBits(8),$);for(let le=0;le<3;le++){const ve=$[le];switch(H){case 0:if(ve<3)H=ve+1;else if(ve<this.C40_BASIC_SET_CHARS.length){const Te=this.C40_BASIC_SET_CHARS[ve];O?(E.append(String.fromCharCode(Te.charCodeAt(0)+128)),O=!1):E.append(Te)}else throw new L;break;case 1:O?(E.append(String.fromCharCode(ve+128)),O=!1):E.append(String.fromCharCode(ve)),H=0;break;case 2:if(ve<this.C40_SHIFT2_SET_CHARS.length){const Te=this.C40_SHIFT2_SET_CHARS[ve];O?(E.append(String.fromCharCode(Te.charCodeAt(0)+128)),O=!1):E.append(Te)}else switch(ve){case 27:E.append("");break;case 30:O=!0;break;default:throw new L}H=0;break;case 3:O?(E.append(String.fromCharCode(ve+224)),O=!1):E.append(String.fromCharCode(ve+96)),H=0;break;default:throw new L}}}while(y.available()>0)}static decodeTextSegment(y,E){let O=!1,$=[],H=0;do{if(y.available()===8)return;const K=y.readBits(8);if(K===254)return;this.parseTwoBytes(K,y.readBits(8),$);for(let le=0;le<3;le++){const ve=$[le];switch(H){case 0:if(ve<3)H=ve+1;else if(ve<this.TEXT_BASIC_SET_CHARS.length){const Te=this.TEXT_BASIC_SET_CHARS[ve];O?(E.append(String.fromCharCode(Te.charCodeAt(0)+128)),O=!1):E.append(Te)}else throw new L;break;case 1:O?(E.append(String.fromCharCode(ve+128)),O=!1):E.append(String.fromCharCode(ve)),H=0;break;case 2:if(ve<this.TEXT_SHIFT2_SET_CHARS.length){const Te=this.TEXT_SHIFT2_SET_CHARS[ve];O?(E.append(String.fromCharCode(Te.charCodeAt(0)+128)),O=!1):E.append(Te)}else switch(ve){case 27:E.append("");break;case 30:O=!0;break;default:throw new L}H=0;break;case 3:if(ve<this.TEXT_SHIFT3_SET_CHARS.length){const Te=this.TEXT_SHIFT3_SET_CHARS[ve];O?(E.append(String.fromCharCode(Te.charCodeAt(0)+128)),O=!1):E.append(Te),H=0}else throw new L;break;default:throw new L}}}while(y.available()>0)}static decodeAnsiX12Segment(y,E){const O=[];do{if(y.available()===8)return;const $=y.readBits(8);if($===254)return;this.parseTwoBytes($,y.readBits(8),O);for(let H=0;H<3;H++){const K=O[H];switch(K){case 0:E.append("\r");break;case 1:E.append("*");break;case 2:E.append(">");break;case 3:E.append(" ");break;default:if(K<14)E.append(String.fromCharCode(K+44));else if(K<40)E.append(String.fromCharCode(K+51));else throw new L;break}}}while(y.available()>0)}static parseTwoBytes(y,E,O){let $=(y<<8)+E-1,H=Math.floor($/1600);O[0]=H,$-=H*1600,H=Math.floor($/40),O[1]=H,O[2]=$-H*40}static decodeEdifactSegment(y,E){do{if(y.available()<=16)return;for(let O=0;O<4;O++){let $=y.readBits(6);if($===31){const H=8-y.getBitOffset();H!==8&&y.readBits(H);return}$&32||($|=64),E.append(String.fromCharCode($))}}while(y.available()>0)}static decodeBase256Segment(y,E,O){let $=1+y.getByteOffset();const H=this.unrandomize255State(y.readBits(8),$++);let K;if(H===0?K=y.available()/8|0:H<250?K=H:K=250*(H-249)+this.unrandomize255State(y.readBits(8),$++),K<0)throw new L;const le=new Uint8Array(K);for(let ve=0;ve<K;ve++){if(y.available()<8)throw new L;le[ve]=this.unrandomize255State(y.readBits(8),$++)}O.push(le);try{E.append(J.decode(le,Z.ISO88591))}catch(ve){throw new at("Platform does not support required encoding: "+ve.message)}}static unrandomize255State(y,E){const O=149*E%255+1,$=y-O;return $>=0?$:$+256}}ke.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ke.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],ke.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],ke.TEXT_SHIFT2_SET_CHARS=ke.C40_SHIFT2_SET_CHARS,ke.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",""];class Me{constructor(){this.rsDecoder=new dt(it.DATA_MATRIX_FIELD_256)}decode(y){const E=new ue(y),O=E.getVersion(),$=E.readCodewords(),H=de.getDataBlocks($,O);let K=0;for(let Te of H)K+=Te.getNumDataCodewords();const le=new Uint8Array(K),ve=H.length;for(let Te=0;Te<ve;Te++){const Ze=H[Te],ht=Ze.getCodewords(),_t=Ze.getNumDataCodewords();this.correctErrors(ht,_t);for(let rn=0;rn<_t;rn++)le[rn*ve+Te]=ht[rn]}return ke.decode(le)}correctErrors(y,E){const O=new Int32Array(y);try{this.rsDecoder.decode(O,y.length-E)}catch{throw new g}for(let $=0;$<E;$++)y[$]=O[$]}}class Ye{constructor(y){this.image=y,this.rectangleDetector=new Pt(this.image)}detect(){const y=this.rectangleDetector.detect();let E=this.detectSolid1(y);if(E=this.detectSolid2(E),E[3]=this.correctTopRight(E),!E[3])throw new Y;E=this.shiftToModuleCenter(E);const O=E[0],$=E[1],H=E[2],K=E[3];let le=this.transitionsBetween(O,K)+1,ve=this.transitionsBetween(H,K)+1;(le&1)===1&&(le+=1),(ve&1)===1&&(ve+=1),4*le<7*ve&&4*ve<7*le&&(le=ve=Math.max(le,ve));let Te=Ye.sampleGrid(this.image,O,$,H,K,le,ve);return new un(Te,[O,$,H,K])}static shiftPoint(y,E,O){let $=(E.getX()-y.getX())/(O+1),H=(E.getY()-y.getY())/(O+1);return new jt(y.getX()+$,y.getY()+H)}static moveAway(y,E,O){let $=y.getX(),H=y.getY();return $<E?$-=1:$+=1,H<O?H-=1:H+=1,new jt($,H)}detectSolid1(y){let E=y[0],O=y[1],$=y[3],H=y[2],K=this.transitionsBetween(E,O),le=this.transitionsBetween(O,$),ve=this.transitionsBetween($,H),Te=this.transitionsBetween(H,E),Ze=K,ht=[H,E,O,$];return Ze>le&&(Ze=le,ht[0]=E,ht[1]=O,ht[2]=$,ht[3]=H),Ze>ve&&(Ze=ve,ht[0]=O,ht[1]=$,ht[2]=H,ht[3]=E),Ze>Te&&(ht[0]=$,ht[1]=H,ht[2]=E,ht[3]=O),ht}detectSolid2(y){let E=y[0],O=y[1],$=y[2],H=y[3],K=this.transitionsBetween(E,H),le=Ye.shiftPoint(O,$,(K+1)*4),ve=Ye.shiftPoint($,O,(K+1)*4),Te=this.transitionsBetween(le,E),Ze=this.transitionsBetween(ve,H);return Te<Ze?(y[0]=E,y[1]=O,y[2]=$,y[3]=H):(y[0]=O,y[1]=$,y[2]=H,y[3]=E),y}correctTopRight(y){let E=y[0],O=y[1],$=y[2],H=y[3],K=this.transitionsBetween(E,H),le=this.transitionsBetween(O,H),ve=Ye.shiftPoint(E,O,(le+1)*4),Te=Ye.shiftPoint($,O,(K+1)*4);K=this.transitionsBetween(ve,H),le=this.transitionsBetween(Te,H);let Ze=new jt(H.getX()+($.getX()-O.getX())/(K+1),H.getY()+($.getY()-O.getY())/(K+1)),ht=new jt(H.getX()+(E.getX()-O.getX())/(le+1),H.getY()+(E.getY()-O.getY())/(le+1));if(!this.isValid(Ze))return this.isValid(ht)?ht:null;if(!this.isValid(ht))return Ze;let _t=this.transitionsBetween(ve,Ze)+this.transitionsBetween(Te,Ze),rn=this.transitionsBetween(ve,ht)+this.transitionsBetween(Te,ht);return _t>rn?Ze:ht}shiftToModuleCenter(y){let E=y[0],O=y[1],$=y[2],H=y[3],K=this.transitionsBetween(E,H)+1,le=this.transitionsBetween($,H)+1,ve=Ye.shiftPoint(E,O,le*4),Te=Ye.shiftPoint($,O,K*4);K=this.transitionsBetween(ve,H)+1,le=this.transitionsBetween(Te,H)+1,(K&1)===1&&(K+=1),(le&1)===1&&(le+=1);let Ze=(E.getX()+O.getX()+$.getX()+H.getX())/4,ht=(E.getY()+O.getY()+$.getY()+H.getY())/4;E=Ye.moveAway(E,Ze,ht),O=Ye.moveAway(O,Ze,ht),$=Ye.moveAway($,Ze,ht),H=Ye.moveAway(H,Ze,ht);let _t,rn;return ve=Ye.shiftPoint(E,O,le*4),ve=Ye.shiftPoint(ve,H,K*4),_t=Ye.shiftPoint(O,E,le*4),_t=Ye.shiftPoint(_t,$,K*4),Te=Ye.shiftPoint($,H,le*4),Te=Ye.shiftPoint(Te,O,K*4),rn=Ye.shiftPoint(H,$,le*4),rn=Ye.shiftPoint(rn,E,K*4),[ve,_t,Te,rn]}isValid(y){return y.getX()>=0&&y.getX()<this.image.getWidth()&&y.getY()>0&&y.getY()<this.image.getHeight()}static sampleGrid(y,E,O,$,H,K,le){return Ve.getInstance().sampleGrid(y,K,le,.5,.5,K-.5,.5,K-.5,le-.5,.5,le-.5,E.getX(),E.getY(),H.getX(),H.getY(),$.getX(),$.getY(),O.getX(),O.getY())}transitionsBetween(y,E){let O=Math.trunc(y.getX()),$=Math.trunc(y.getY()),H=Math.trunc(E.getX()),K=Math.trunc(E.getY()),le=Math.abs(K-$)>Math.abs(H-O);if(le){let zt=O;O=$,$=zt,zt=H,H=K,K=zt}let ve=Math.abs(H-O),Te=Math.abs(K-$),Ze=-ve/2,ht=$<K?1:-1,_t=O<H?1:-1,rn=0,bt=this.image.get(le?$:O,le?O:$);for(let zt=O,qt=$;zt!==H;zt+=_t){let Tn=this.image.get(le?qt:zt,le?zt:qt);if(Tn!==bt&&(rn++,bt=Tn),Ze+=Te,Ze>0){if(qt===K)break;qt+=ht,Ze-=ve}}return rn}}class Fe{constructor(){this.decoder=new Me}decode(y,E=null){let O,$;if(E!=null&&E.has(U.PURE_BARCODE)){const Te=Fe.extractPureBits(y.getBlackMatrix());O=this.decoder.decode(Te),$=Fe.NO_POINTS}else{const Te=new Ye(y.getBlackMatrix()).detect();O=this.decoder.decode(Te.getBits()),$=Te.getPoints()}const H=O.getRawBytes(),K=new ce(O.getText(),H,8*H.length,$,Ne.DATA_MATRIX,w.currentTimeMillis()),le=O.getByteSegments();le!=null&&K.putMetadata(je.BYTE_SEGMENTS,le);const ve=O.getECLevel();return ve!=null&&K.putMetadata(je.ERROR_CORRECTION_LEVEL,ve),K}reset(){}static extractPureBits(y){const E=y.getTopLeftOnBit(),O=y.getBottomRightOnBit();if(E==null||O==null)throw new Y;const $=this.moduleSize(E,y);let H=E[1];const K=O[1];let le=E[0];const Te=(O[0]-le+1)/$,Ze=(K-H+1)/$;if(Te<=0||Ze<=0)throw new Y;const ht=$/2;H+=ht,le+=ht;const _t=new he(Te,Ze);for(let rn=0;rn<Ze;rn++){const bt=H+rn*$;for(let zt=0;zt<Te;zt++)y.get(le+zt*$,bt)&&_t.set(zt,rn)}return _t}static moduleSize(y,E){const O=E.getWidth();let $=y[0];const H=y[1];for(;$<O&&E.get($,H);)$++;if($===O)throw new Y;const K=$-y[0];if(K===0)throw new Y;return K}}Fe.NO_POINTS=[];class rt extends Ae{constructor(y=500){super(new Fe,y)}}var se;(function(ut){ut[ut.L=0]="L",ut[ut.M=1]="M",ut[ut.Q=2]="Q",ut[ut.H=3]="H"})(se||(se={}));class Ce{constructor(y,E,O){this.value=y,this.stringValue=E,this.bits=O,Ce.FOR_BITS.set(O,this),Ce.FOR_VALUE.set(y,this)}getValue(){return this.value}getBits(){return this.bits}static fromString(y){switch(y){case"L":return Ce.L;case"M":return Ce.M;case"Q":return Ce.Q;case"H":return Ce.H;default:throw new d(y+"not available")}}toString(){return this.stringValue}equals(y){if(!(y instanceof Ce))return!1;const E=y;return this.value===E.value}static forBits(y){if(y<0||y>=Ce.FOR_BITS.size)throw new f;return Ce.FOR_BITS.get(y)}}Ce.FOR_BITS=new Map,Ce.FOR_VALUE=new Map,Ce.L=new Ce(se.L,"L",1),Ce.M=new Ce(se.M,"M",0),Ce.Q=new Ce(se.Q,"Q",3),Ce.H=new Ce(se.H,"H",2);class De{constructor(y){this.errorCorrectionLevel=Ce.forBits(y>>3&3),this.dataMask=y&7}static numBitsDiffering(y,E){return P.bitCount(y^E)}static decodeFormatInformation(y,E){const O=De.doDecodeFormatInformation(y,E);return O!==null?O:De.doDecodeFormatInformation(y^De.FORMAT_INFO_MASK_QR,E^De.FORMAT_INFO_MASK_QR)}static doDecodeFormatInformation(y,E){let O=Number.MAX_SAFE_INTEGER,$=0;for(const H of De.FORMAT_INFO_DECODE_LOOKUP){const K=H[0];if(K===y||K===E)return new De(H[1]);let le=De.numBitsDiffering(y,K);le<O&&($=H[1],O=le),y!==E&&(le=De.numBitsDiffering(E,K),le<O&&($=H[1],O=le))}return O<=3?new De($):null}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getDataMask(){return this.dataMask}hashCode(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask}equals(y){if(!(y instanceof De))return!1;const E=y;return this.errorCorrectionLevel===E.errorCorrectionLevel&&this.dataMask===E.dataMask}}De.FORMAT_INFO_MASK_QR=21522,De.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])];class Le{constructor(y,...E){this.ecCodewordsPerBlock=y,this.ecBlocks=E}getECCodewordsPerBlock(){return this.ecCodewordsPerBlock}getNumBlocks(){let y=0;const E=this.ecBlocks;for(const O of E)y+=O.getCount();return y}getTotalECCodewords(){return this.ecCodewordsPerBlock*this.getNumBlocks()}getECBlocks(){return this.ecBlocks}}class _e{constructor(y,E){this.count=y,this.dataCodewords=E}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class nt{constructor(y,E,...O){this.versionNumber=y,this.alignmentPatternCenters=E,this.ecBlocks=O;let $=0;const H=O[0].getECCodewordsPerBlock(),K=O[0].getECBlocks();for(const le of K)$+=le.getCount()*(le.getDataCodewords()+H);this.totalCodewords=$}getVersionNumber(){return this.versionNumber}getAlignmentPatternCenters(){return this.alignmentPatternCenters}getTotalCodewords(){return this.totalCodewords}getDimensionForVersion(){return 17+4*this.versionNumber}getECBlocksForLevel(y){return this.ecBlocks[y.getValue()]}static getProvisionalVersionForDimension(y){if(y%4!==1)throw new L;try{return this.getVersionForNumber((y-17)/4)}catch{throw new L}}static getVersionForNumber(y){if(y<1||y>40)throw new f;return nt.VERSIONS[y-1]}static decodeVersionInformation(y){let E=Number.MAX_SAFE_INTEGER,O=0;for(let $=0;$<nt.VERSION_DECODE_INFO.length;$++){const H=nt.VERSION_DECODE_INFO[$];if(H===y)return nt.getVersionForNumber($+7);const K=De.numBitsDiffering(y,H);K<E&&(O=$+7,E=K)}return E<=3?nt.getVersionForNumber(O):null}buildFunctionPattern(){const y=this.getDimensionForVersion(),E=new he(y);E.setRegion(0,0,9,9),E.setRegion(y-8,0,8,9),E.setRegion(0,y-8,9,8);const O=this.alignmentPatternCenters.length;for(let $=0;$<O;$++){const H=this.alignmentPatternCenters[$]-2;for(let K=0;K<O;K++)$===0&&(K===0||K===O-1)||$===O-1&&K===0||E.setRegion(this.alignmentPatternCenters[K]-2,H,5,5)}return E.setRegion(6,9,1,y-17),E.setRegion(9,6,y-17,1),this.versionNumber>6&&(E.setRegion(y-11,0,3,6),E.setRegion(0,y-11,6,3)),E}toString(){return""+this.versionNumber}}nt.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),nt.VERSIONS=[new nt(1,new Int32Array(0),new Le(7,new _e(1,19)),new Le(10,new _e(1,16)),new Le(13,new _e(1,13)),new Le(17,new _e(1,9))),new nt(2,Int32Array.from([6,18]),new Le(10,new _e(1,34)),new Le(16,new _e(1,28)),new Le(22,new _e(1,22)),new Le(28,new _e(1,16))),new nt(3,Int32Array.from([6,22]),new Le(15,new _e(1,55)),new Le(26,new _e(1,44)),new Le(18,new _e(2,17)),new Le(22,new _e(2,13))),new nt(4,Int32Array.from([6,26]),new Le(20,new _e(1,80)),new Le(18,new _e(2,32)),new Le(26,new _e(2,24)),new Le(16,new _e(4,9))),new nt(5,Int32Array.from([6,30]),new Le(26,new _e(1,108)),new Le(24,new _e(2,43)),new Le(18,new _e(2,15),new _e(2,16)),new Le(22,new _e(2,11),new _e(2,12))),new nt(6,Int32Array.from([6,34]),new Le(18,new _e(2,68)),new Le(16,new _e(4,27)),new Le(24,new _e(4,19)),new Le(28,new _e(4,15))),new nt(7,Int32Array.from([6,22,38]),new Le(20,new _e(2,78)),new Le(18,new _e(4,31)),new Le(18,new _e(2,14),new _e(4,15)),new Le(26,new _e(4,13),new _e(1,14))),new nt(8,Int32Array.from([6,24,42]),new Le(24,new _e(2,97)),new Le(22,new _e(2,38),new _e(2,39)),new Le(22,new _e(4,18),new _e(2,19)),new Le(26,new _e(4,14),new _e(2,15))),new nt(9,Int32Array.from([6,26,46]),new Le(30,new _e(2,116)),new Le(22,new _e(3,36),new _e(2,37)),new Le(20,new _e(4,16),new _e(4,17)),new Le(24,new _e(4,12),new _e(4,13))),new nt(10,Int32Array.from([6,28,50]),new Le(18,new _e(2,68),new _e(2,69)),new Le(26,new _e(4,43),new _e(1,44)),new Le(24,new _e(6,19),new _e(2,20)),new Le(28,new _e(6,15),new _e(2,16))),new nt(11,Int32Array.from([6,30,54]),new Le(20,new _e(4,81)),new Le(30,new _e(1,50),new _e(4,51)),new Le(28,new _e(4,22),new _e(4,23)),new Le(24,new _e(3,12),new _e(8,13))),new nt(12,Int32Array.from([6,32,58]),new Le(24,new _e(2,92),new _e(2,93)),new Le(22,new _e(6,36),new _e(2,37)),new Le(26,new _e(4,20),new _e(6,21)),new Le(28,new _e(7,14),new _e(4,15))),new nt(13,Int32Array.from([6,34,62]),new Le(26,new _e(4,107)),new Le(22,new _e(8,37),new _e(1,38)),new Le(24,new _e(8,20),new _e(4,21)),new Le(22,new _e(12,11),new _e(4,12))),new nt(14,Int32Array.from([6,26,46,66]),new Le(30,new _e(3,115),new _e(1,116)),new Le(24,new _e(4,40),new _e(5,41)),new Le(20,new _e(11,16),new _e(5,17)),new Le(24,new _e(11,12),new _e(5,13))),new nt(15,Int32Array.from([6,26,48,70]),new Le(22,new _e(5,87),new _e(1,88)),new Le(24,new _e(5,41),new _e(5,42)),new Le(30,new _e(5,24),new _e(7,25)),new Le(24,new _e(11,12),new _e(7,13))),new nt(16,Int32Array.from([6,26,50,74]),new Le(24,new _e(5,98),new _e(1,99)),new Le(28,new _e(7,45),new _e(3,46)),new Le(24,new _e(15,19),new _e(2,20)),new Le(30,new _e(3,15),new _e(13,16))),new nt(17,Int32Array.from([6,30,54,78]),new Le(28,new _e(1,107),new _e(5,108)),new Le(28,new _e(10,46),new _e(1,47)),new Le(28,new _e(1,22),new _e(15,23)),new Le(28,new _e(2,14),new _e(17,15))),new nt(18,Int32Array.from([6,30,56,82]),new Le(30,new _e(5,120),new _e(1,121)),new Le(26,new _e(9,43),new _e(4,44)),new Le(28,new _e(17,22),new _e(1,23)),new Le(28,new _e(2,14),new _e(19,15))),new nt(19,Int32Array.from([6,30,58,86]),new Le(28,new _e(3,113),new _e(4,114)),new Le(26,new _e(3,44),new _e(11,45)),new Le(26,new _e(17,21),new _e(4,22)),new Le(26,new _e(9,13),new _e(16,14))),new nt(20,Int32Array.from([6,34,62,90]),new Le(28,new _e(3,107),new _e(5,108)),new Le(26,new _e(3,41),new _e(13,42)),new Le(30,new _e(15,24),new _e(5,25)),new Le(28,new _e(15,15),new _e(10,16))),new nt(21,Int32Array.from([6,28,50,72,94]),new Le(28,new _e(4,116),new _e(4,117)),new Le(26,new _e(17,42)),new Le(28,new _e(17,22),new _e(6,23)),new Le(30,new _e(19,16),new _e(6,17))),new nt(22,Int32Array.from([6,26,50,74,98]),new Le(28,new _e(2,111),new _e(7,112)),new Le(28,new _e(17,46)),new Le(30,new _e(7,24),new _e(16,25)),new Le(24,new _e(34,13))),new nt(23,Int32Array.from([6,30,54,78,102]),new Le(30,new _e(4,121),new _e(5,122)),new Le(28,new _e(4,47),new _e(14,48)),new Le(30,new _e(11,24),new _e(14,25)),new Le(30,new _e(16,15),new _e(14,16))),new nt(24,Int32Array.from([6,28,54,80,106]),new Le(30,new _e(6,117),new _e(4,118)),new Le(28,new _e(6,45),new _e(14,46)),new Le(30,new _e(11,24),new _e(16,25)),new Le(30,new _e(30,16),new _e(2,17))),new nt(25,Int32Array.from([6,32,58,84,110]),new Le(26,new _e(8,106),new _e(4,107)),new Le(28,new _e(8,47),new _e(13,48)),new Le(30,new _e(7,24),new _e(22,25)),new Le(30,new _e(22,15),new _e(13,16))),new nt(26,Int32Array.from([6,30,58,86,114]),new Le(28,new _e(10,114),new _e(2,115)),new Le(28,new _e(19,46),new _e(4,47)),new Le(28,new _e(28,22),new _e(6,23)),new Le(30,new _e(33,16),new _e(4,17))),new nt(27,Int32Array.from([6,34,62,90,118]),new Le(30,new _e(8,122),new _e(4,123)),new Le(28,new _e(22,45),new _e(3,46)),new Le(30,new _e(8,23),new _e(26,24)),new Le(30,new _e(12,15),new _e(28,16))),new nt(28,Int32Array.from([6,26,50,74,98,122]),new Le(30,new _e(3,117),new _e(10,118)),new Le(28,new _e(3,45),new _e(23,46)),new Le(30,new _e(4,24),new _e(31,25)),new Le(30,new _e(11,15),new _e(31,16))),new nt(29,Int32Array.from([6,30,54,78,102,126]),new Le(30,new _e(7,116),new _e(7,117)),new Le(28,new _e(21,45),new _e(7,46)),new Le(30,new _e(1,23),new _e(37,24)),new Le(30,new _e(19,15),new _e(26,16))),new nt(30,Int32Array.from([6,26,52,78,104,130]),new Le(30,new _e(5,115),new _e(10,116)),new Le(28,new _e(19,47),new _e(10,48)),new Le(30,new _e(15,24),new _e(25,25)),new Le(30,new _e(23,15),new _e(25,16))),new nt(31,Int32Array.from([6,30,56,82,108,134]),new Le(30,new _e(13,115),new _e(3,116)),new Le(28,new _e(2,46),new _e(29,47)),new Le(30,new _e(42,24),new _e(1,25)),new Le(30,new _e(23,15),new _e(28,16))),new nt(32,Int32Array.from([6,34,60,86,112,138]),new Le(30,new _e(17,115)),new Le(28,new _e(10,46),new _e(23,47)),new Le(30,new _e(10,24),new _e(35,25)),new Le(30,new _e(19,15),new _e(35,16))),new nt(33,Int32Array.from([6,30,58,86,114,142]),new Le(30,new _e(17,115),new _e(1,116)),new Le(28,new _e(14,46),new _e(21,47)),new Le(30,new _e(29,24),new _e(19,25)),new Le(30,new _e(11,15),new _e(46,16))),new nt(34,Int32Array.from([6,34,62,90,118,146]),new Le(30,new _e(13,115),new _e(6,116)),new Le(28,new _e(14,46),new _e(23,47)),new Le(30,new _e(44,24),new _e(7,25)),new Le(30,new _e(59,16),new _e(1,17))),new nt(35,Int32Array.from([6,30,54,78,102,126,150]),new Le(30,new _e(12,121),new _e(7,122)),new Le(28,new _e(12,47),new _e(26,48)),new Le(30,new _e(39,24),new _e(14,25)),new Le(30,new _e(22,15),new _e(41,16))),new nt(36,Int32Array.from([6,24,50,76,102,128,154]),new Le(30,new _e(6,121),new _e(14,122)),new Le(28,new _e(6,47),new _e(34,48)),new Le(30,new _e(46,24),new _e(10,25)),new Le(30,new _e(2,15),new _e(64,16))),new nt(37,Int32Array.from([6,28,54,80,106,132,158]),new Le(30,new _e(17,122),new _e(4,123)),new Le(28,new _e(29,46),new _e(14,47)),new Le(30,new _e(49,24),new _e(10,25)),new Le(30,new _e(24,15),new _e(46,16))),new nt(38,Int32Array.from([6,32,58,84,110,136,162]),new Le(30,new _e(4,122),new _e(18,123)),new Le(28,new _e(13,46),new _e(32,47)),new Le(30,new _e(48,24),new _e(14,25)),new Le(30,new _e(42,15),new _e(32,16))),new nt(39,Int32Array.from([6,26,54,82,110,138,166]),new Le(30,new _e(20,117),new _e(4,118)),new Le(28,new _e(40,47),new _e(7,48)),new Le(30,new _e(43,24),new _e(22,25)),new Le(30,new _e(10,15),new _e(67,16))),new nt(40,Int32Array.from([6,30,58,86,114,142,170]),new Le(30,new _e(19,118),new _e(6,119)),new Le(28,new _e(18,47),new _e(31,48)),new Le(30,new _e(34,24),new _e(34,25)),new Le(30,new _e(20,15),new _e(61,16)))];var ot;(function(ut){ut[ut.DATA_MASK_000=0]="DATA_MASK_000",ut[ut.DATA_MASK_001=1]="DATA_MASK_001",ut[ut.DATA_MASK_010=2]="DATA_MASK_010",ut[ut.DATA_MASK_011=3]="DATA_MASK_011",ut[ut.DATA_MASK_100=4]="DATA_MASK_100",ut[ut.DATA_MASK_101=5]="DATA_MASK_101",ut[ut.DATA_MASK_110=6]="DATA_MASK_110",ut[ut.DATA_MASK_111=7]="DATA_MASK_111"})(ot||(ot={}));class gt{constructor(y,E){this.value=y,this.isMasked=E}unmaskBitMatrix(y,E){for(let O=0;O<E;O++)for(let $=0;$<E;$++)this.isMasked(O,$)&&y.flip($,O)}}gt.values=new Map([[ot.DATA_MASK_000,new gt(ot.DATA_MASK_000,(ut,y)=>(ut+y&1)===0)],[ot.DATA_MASK_001,new gt(ot.DATA_MASK_001,(ut,y)=>(ut&1)===0)],[ot.DATA_MASK_010,new gt(ot.DATA_MASK_010,(ut,y)=>y%3===0)],[ot.DATA_MASK_011,new gt(ot.DATA_MASK_011,(ut,y)=>(ut+y)%3===0)],[ot.DATA_MASK_100,new gt(ot.DATA_MASK_100,(ut,y)=>(Math.floor(ut/2)+Math.floor(y/3)&1)===0)],[ot.DATA_MASK_101,new gt(ot.DATA_MASK_101,(ut,y)=>ut*y%6===0)],[ot.DATA_MASK_110,new gt(ot.DATA_MASK_110,(ut,y)=>ut*y%6<3)],[ot.DATA_MASK_111,new gt(ot.DATA_MASK_111,(ut,y)=>(ut+y+ut*y%3&1)===0)]]);class Jt{constructor(y){const E=y.getHeight();if(E<21||(E&3)!==1)throw new L;this.bitMatrix=y}readFormatInformation(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==void 0)return this.parsedFormatInfo;let y=0;for(let H=0;H<6;H++)y=this.copyBit(H,8,y);y=this.copyBit(7,8,y),y=this.copyBit(8,8,y),y=this.copyBit(8,7,y);for(let H=5;H>=0;H--)y=this.copyBit(8,H,y);const E=this.bitMatrix.getHeight();let O=0;const $=E-7;for(let H=E-1;H>=$;H--)O=this.copyBit(8,H,O);for(let H=E-8;H<E;H++)O=this.copyBit(H,8,O);if(this.parsedFormatInfo=De.decodeFormatInformation(y,O),this.parsedFormatInfo!==null)return this.parsedFormatInfo;throw new L}readVersion(){if(this.parsedVersion!==null&&this.parsedVersion!==void 0)return this.parsedVersion;const y=this.bitMatrix.getHeight(),E=Math.floor((y-17)/4);if(E<=6)return nt.getVersionForNumber(E);let O=0;const $=y-11;for(let K=5;K>=0;K--)for(let le=y-9;le>=$;le--)O=this.copyBit(le,K,O);let H=nt.decodeVersionInformation(O);if(H!==null&&H.getDimensionForVersion()===y)return this.parsedVersion=H,H;O=0;for(let K=5;K>=0;K--)for(let le=y-9;le>=$;le--)O=this.copyBit(K,le,O);if(H=nt.decodeVersionInformation(O),H!==null&&H.getDimensionForVersion()===y)return this.parsedVersion=H,H;throw new L}copyBit(y,E,O){return(this.isMirror?this.bitMatrix.get(E,y):this.bitMatrix.get(y,E))?O<<1|1:O<<1}readCodewords(){const y=this.readFormatInformation(),E=this.readVersion(),O=gt.values.get(y.getDataMask()),$=this.bitMatrix.getHeight();O.unmaskBitMatrix(this.bitMatrix,$);const H=E.buildFunctionPattern();let K=!0;const le=new Uint8Array(E.getTotalCodewords());let ve=0,Te=0,Ze=0;for(let ht=$-1;ht>0;ht-=2){ht===6&&ht--;for(let _t=0;_t<$;_t++){const rn=K?$-1-_t:_t;for(let bt=0;bt<2;bt++)H.get(ht-bt,rn)||(Ze++,Te<<=1,this.bitMatrix.get(ht-bt,rn)&&(Te|=1),Ze===8&&(le[ve++]=Te,Ze=0,Te=0))}K=!K}if(ve!==E.getTotalCodewords())throw new L;return le}remask(){if(this.parsedFormatInfo===null)return;const y=gt.values[this.parsedFormatInfo.getDataMask()],E=this.bitMatrix.getHeight();y.unmaskBitMatrix(this.bitMatrix,E)}setMirror(y){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=y}mirror(){const y=this.bitMatrix;for(let E=0,O=y.getWidth();E<O;E++)for(let $=E+1,H=y.getHeight();$<H;$++)y.get(E,$)!==y.get($,E)&&(y.flip($,E),y.flip(E,$))}}class Ge{constructor(y,E){this.numDataCodewords=y,this.codewords=E}static getDataBlocks(y,E,O){if(y.length!==E.getTotalCodewords())throw new f;const $=E.getECBlocksForLevel(O);let H=0;const K=$.getECBlocks();for(const bt of K)H+=bt.getCount();const le=new Array(H);let ve=0;for(const bt of K)for(let zt=0;zt<bt.getCount();zt++){const qt=bt.getDataCodewords(),Tn=$.getECCodewordsPerBlock()+qt;le[ve++]=new Ge(qt,new Uint8Array(Tn))}const Te=le[0].codewords.length;let Ze=le.length-1;for(;Ze>=0&&le[Ze].codewords.length!==Te;)Ze--;Ze++;const ht=Te-$.getECCodewordsPerBlock();let _t=0;for(let bt=0;bt<ht;bt++)for(let zt=0;zt<ve;zt++)le[zt].codewords[bt]=y[_t++];for(let bt=Ze;bt<ve;bt++)le[bt].codewords[ht]=y[_t++];const rn=le[0].codewords.length;for(let bt=ht;bt<rn;bt++)for(let zt=0;zt<ve;zt++){const qt=zt<Ze?bt:bt+1;le[zt].codewords[qt]=y[_t++]}return le}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}var et;(function(ut){ut[ut.TERMINATOR=0]="TERMINATOR",ut[ut.NUMERIC=1]="NUMERIC",ut[ut.ALPHANUMERIC=2]="ALPHANUMERIC",ut[ut.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",ut[ut.BYTE=4]="BYTE",ut[ut.ECI=5]="ECI",ut[ut.KANJI=6]="KANJI",ut[ut.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",ut[ut.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",ut[ut.HANZI=9]="HANZI"})(et||(et={}));class We{constructor(y,E,O,$){this.value=y,this.stringValue=E,this.characterCountBitsForVersions=O,this.bits=$,We.FOR_BITS.set($,this),We.FOR_VALUE.set(y,this)}static forBits(y){const E=We.FOR_BITS.get(y);if(E===void 0)throw new f;return E}getCharacterCountBits(y){const E=y.getVersionNumber();let O;return E<=9?O=0:E<=26?O=1:O=2,this.characterCountBitsForVersions[O]}getValue(){return this.value}getBits(){return this.bits}equals(y){if(!(y instanceof We))return!1;const E=y;return this.value===E.value}toString(){return this.stringValue}}We.FOR_BITS=new Map,We.FOR_VALUE=new Map,We.TERMINATOR=new We(et.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),We.NUMERIC=new We(et.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),We.ALPHANUMERIC=new We(et.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),We.STRUCTURED_APPEND=new We(et.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),We.BYTE=new We(et.BYTE,"BYTE",Int32Array.from([8,16,16]),4),We.ECI=new We(et.ECI,"ECI",Int32Array.from([0,0,0]),7),We.KANJI=new We(et.KANJI,"KANJI",Int32Array.from([8,10,12]),8),We.FNC1_FIRST_POSITION=new We(et.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),We.FNC1_SECOND_POSITION=new We(et.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),We.HANZI=new We(et.HANZI,"HANZI",Int32Array.from([8,10,12]),13);class wt{static decode(y,E,O,$){const H=new xe(y);let K=new re;const le=new Array;let ve=-1,Te=-1;try{let Ze=null,ht=!1,_t;do{if(H.available()<4)_t=We.TERMINATOR;else{const rn=H.readBits(4);_t=We.forBits(rn)}switch(_t){case We.TERMINATOR:break;case We.FNC1_FIRST_POSITION:case We.FNC1_SECOND_POSITION:ht=!0;break;case We.STRUCTURED_APPEND:if(H.available()<16)throw new L;ve=H.readBits(8),Te=H.readBits(8);break;case We.ECI:const rn=wt.parseECIValue(H);if(Ze=X.getCharacterSetECIByValue(rn),Ze===null)throw new L;break;case We.HANZI:const bt=H.readBits(4),zt=H.readBits(_t.getCharacterCountBits(E));bt===wt.GB2312_SUBSET&&wt.decodeHanziSegment(H,K,zt);break;default:const qt=H.readBits(_t.getCharacterCountBits(E));switch(_t){case We.NUMERIC:wt.decodeNumericSegment(H,K,qt);break;case We.ALPHANUMERIC:wt.decodeAlphanumericSegment(H,K,qt,ht);break;case We.BYTE:wt.decodeByteSegment(H,K,qt,Ze,le,$);break;case We.KANJI:wt.decodeKanjiSegment(H,K,qt);break;default:throw new L}break}}while(_t!==We.TERMINATOR)}catch{throw new L}return new Ie(y,K.toString(),le.length===0?null:le,O===null?null:O.toString(),ve,Te)}static decodeHanziSegment(y,E,O){if(O*13>y.available())throw new L;const $=new Uint8Array(2*O);let H=0;for(;O>0;){const K=y.readBits(13);let le=K/96<<8&4294967295|K%96;le<959?le+=41377:le+=42657,$[H]=le>>8&255,$[H+1]=le&255,H+=2,O--}try{E.append(J.decode($,Z.GB2312))}catch(K){throw new L(K)}}static decodeKanjiSegment(y,E,O){if(O*13>y.available())throw new L;const $=new Uint8Array(2*O);let H=0;for(;O>0;){const K=y.readBits(13);let le=K/192<<8&4294967295|K%192;le<7936?le+=33088:le+=49472,$[H]=le>>8,$[H+1]=le,H+=2,O--}try{E.append(J.decode($,Z.SHIFT_JIS))}catch(K){throw new L(K)}}static decodeByteSegment(y,E,O,$,H,K){if(8*O>y.available())throw new L;const le=new Uint8Array(O);for(let Te=0;Te<O;Te++)le[Te]=y.readBits(8);let ve;$===null?ve=Z.guessEncoding(le,K):ve=$.getName();try{E.append(J.decode(le,ve))}catch(Te){throw new L(Te)}H.push(le)}static toAlphaNumericChar(y){if(y>=wt.ALPHANUMERIC_CHARS.length)throw new L;return wt.ALPHANUMERIC_CHARS[y]}static decodeAlphanumericSegment(y,E,O,$){const H=E.length();for(;O>1;){if(y.available()<11)throw new L;const K=y.readBits(11);E.append(wt.toAlphaNumericChar(Math.floor(K/45))),E.append(wt.toAlphaNumericChar(K%45)),O-=2}if(O===1){if(y.available()<6)throw new L;E.append(wt.toAlphaNumericChar(y.readBits(6)))}if($)for(let K=H;K<E.length();K++)E.charAt(K)==="%"&&(K<E.length()-1&&E.charAt(K+1)==="%"?E.deleteCharAt(K+1):E.setCharAt(K,""))}static decodeNumericSegment(y,E,O){for(;O>=3;){if(y.available()<10)throw new L;const $=y.readBits(10);if($>=1e3)throw new L;E.append(wt.toAlphaNumericChar(Math.floor($/100))),E.append(wt.toAlphaNumericChar(Math.floor($/10)%10)),E.append(wt.toAlphaNumericChar($%10)),O-=3}if(O===2){if(y.available()<7)throw new L;const $=y.readBits(7);if($>=100)throw new L;E.append(wt.toAlphaNumericChar(Math.floor($/10))),E.append(wt.toAlphaNumericChar($%10))}else if(O===1){if(y.available()<4)throw new L;const $=y.readBits(4);if($>=10)throw new L;E.append(wt.toAlphaNumericChar($))}}static parseECIValue(y){const E=y.readBits(8);if(!(E&128))return E&127;if((E&192)===128){const O=y.readBits(8);return(E&63)<<8&4294967295|O}if((E&224)===192){const O=y.readBits(16);return(E&31)<<16&4294967295|O}throw new L}}wt.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",wt.GB2312_SUBSET=1;class St{constructor(y){this.mirrored=y}isMirrored(){return this.mirrored}applyMirroredCorrection(y){if(!this.mirrored||y===null||y.length<3)return;const E=y[0];y[0]=y[2],y[2]=E}}class Kt{constructor(){this.rsDecoder=new dt(it.QR_CODE_FIELD_256)}decodeBooleanArray(y,E){return this.decodeBitMatrix(he.parseFromBooleanArray(y),E)}decodeBitMatrix(y,E){const O=new Jt(y);let $=null;try{return this.decodeBitMatrixParser(O,E)}catch(H){$=H}try{O.remask(),O.setMirror(!0),O.readVersion(),O.readFormatInformation(),O.mirror();const H=this.decodeBitMatrixParser(O,E);return H.setOther(new St(!0)),H}catch(H){throw $!==null?$:H}}decodeBitMatrixParser(y,E){const O=y.readVersion(),$=y.readFormatInformation().getErrorCorrectionLevel(),H=y.readCodewords(),K=Ge.getDataBlocks(H,O,$);let le=0;for(const Ze of K)le+=Ze.getNumDataCodewords();const ve=new Uint8Array(le);let Te=0;for(const Ze of K){const ht=Ze.getCodewords(),_t=Ze.getNumDataCodewords();this.correctErrors(ht,_t);for(let rn=0;rn<_t;rn++)ve[Te++]=ht[rn]}return wt.decode(ve,O,$,E)}correctErrors(y,E){const O=new Int32Array(y);try{this.rsDecoder.decode(O,y.length-E)}catch{throw new g}for(let $=0;$<E;$++)y[$]=O[$]}}class gn extends jt{constructor(y,E,O){super(y,E),this.estimatedModuleSize=O}aboutEquals(y,E,O){if(Math.abs(E-this.getY())<=y&&Math.abs(O-this.getX())<=y){const $=Math.abs(y-this.estimatedModuleSize);return $<=1||$<=this.estimatedModuleSize}return!1}combineEstimate(y,E,O){const $=(this.getX()+E)/2,H=(this.getY()+y)/2,K=(this.estimatedModuleSize+O)/2;return new gn($,H,K)}}class yn{constructor(y,E,O,$,H,K,le){this.image=y,this.startX=E,this.startY=O,this.width=$,this.height=H,this.moduleSize=K,this.resultPointCallback=le,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}find(){const y=this.startX,E=this.height,O=this.width,$=y+O,H=this.startY+E/2,K=new Int32Array(3),le=this.image;for(let ve=0;ve<E;ve++){const Te=H+(ve&1?-Math.floor((ve+1)/2):Math.floor((ve+1)/2));K[0]=0,K[1]=0,K[2]=0;let Ze=y;for(;Ze<$&&!le.get(Ze,Te);)Ze++;let ht=0;for(;Ze<$;){if(le.get(Ze,Te))if(ht===1)K[1]++;else if(ht===2){if(this.foundPatternCross(K)){const _t=this.handlePossibleCenter(K,Te,Ze);if(_t!==null)return _t}K[0]=K[2],K[1]=1,K[2]=0,ht=1}else K[++ht]++;else ht===1&&ht++,K[ht]++;Ze++}if(this.foundPatternCross(K)){const _t=this.handlePossibleCenter(K,Te,$);if(_t!==null)return _t}}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new Y}static centerFromEnd(y,E){return E-y[2]-y[1]/2}foundPatternCross(y){const E=this.moduleSize,O=E/2;for(let $=0;$<3;$++)if(Math.abs(E-y[$])>=O)return!1;return!0}crossCheckVertical(y,E,O,$){const H=this.image,K=H.getHeight(),le=this.crossCheckStateCount;le[0]=0,le[1]=0,le[2]=0;let ve=y;for(;ve>=0&&H.get(E,ve)&&le[1]<=O;)le[1]++,ve--;if(ve<0||le[1]>O)return NaN;for(;ve>=0&&!H.get(E,ve)&&le[0]<=O;)le[0]++,ve--;if(le[0]>O)return NaN;for(ve=y+1;ve<K&&H.get(E,ve)&&le[1]<=O;)le[1]++,ve++;if(ve===K||le[1]>O)return NaN;for(;ve<K&&!H.get(E,ve)&&le[2]<=O;)le[2]++,ve++;if(le[2]>O)return NaN;const Te=le[0]+le[1]+le[2];return 5*Math.abs(Te-$)>=2*$?NaN:this.foundPatternCross(le)?yn.centerFromEnd(le,ve):NaN}handlePossibleCenter(y,E,O){const $=y[0]+y[1]+y[2],H=yn.centerFromEnd(y,O),K=this.crossCheckVertical(E,H,2*y[1],$);if(!isNaN(K)){const le=(y[0]+y[1]+y[2])/3;for(const Te of this.possibleCenters)if(Te.aboutEquals(le,K,H))return Te.combineEstimate(K,H,le);const ve=new gn(H,K,le);this.possibleCenters.push(ve),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(ve)}return null}}class hn extends jt{constructor(y,E,O,$){super(y,E),this.estimatedModuleSize=O,this.count=$,$===void 0&&(this.count=1)}getEstimatedModuleSize(){return this.estimatedModuleSize}getCount(){return this.count}aboutEquals(y,E,O){if(Math.abs(E-this.getY())<=y&&Math.abs(O-this.getX())<=y){const $=Math.abs(y-this.estimatedModuleSize);return $<=1||$<=this.estimatedModuleSize}return!1}combineEstimate(y,E,O){const $=this.count+1,H=(this.count*this.getX()+E)/$,K=(this.count*this.getY()+y)/$,le=(this.count*this.estimatedModuleSize+O)/$;return new hn(H,K,le,$)}}class br{constructor(y){this.bottomLeft=y[0],this.topLeft=y[1],this.topRight=y[2]}getBottomLeft(){return this.bottomLeft}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}}class pt{constructor(y,E){this.image=y,this.resultPointCallback=E,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=E}getImage(){return this.image}getPossibleCenters(){return this.possibleCenters}find(y){const E=y!=null&&y.get(U.TRY_HARDER)!==void 0,O=y!=null&&y.get(U.PURE_BARCODE)!==void 0,$=this.image,H=$.getHeight(),K=$.getWidth();let le=Math.floor(3*H/(4*pt.MAX_MODULES));(le<pt.MIN_SKIP||E)&&(le=pt.MIN_SKIP);let ve=!1;const Te=new Int32Array(5);for(let ht=le-1;ht<H&&!ve;ht+=le){Te[0]=0,Te[1]=0,Te[2]=0,Te[3]=0,Te[4]=0;let _t=0;for(let rn=0;rn<K;rn++)if($.get(rn,ht))(_t&1)===1&&_t++,Te[_t]++;else if(_t&1)Te[_t]++;else if(_t===4)if(pt.foundPatternCross(Te)){if(this.handlePossibleCenter(Te,ht,rn,O)===!0)if(le=2,this.hasSkipped===!0)ve=this.haveMultiplyConfirmedCenters();else{const zt=this.findRowSkip();zt>Te[2]&&(ht+=zt-Te[2]-le,rn=K-1)}else{Te[0]=Te[2],Te[1]=Te[3],Te[2]=Te[4],Te[3]=1,Te[4]=0,_t=3;continue}_t=0,Te[0]=0,Te[1]=0,Te[2]=0,Te[3]=0,Te[4]=0}else Te[0]=Te[2],Te[1]=Te[3],Te[2]=Te[4],Te[3]=1,Te[4]=0,_t=3;else Te[++_t]++;pt.foundPatternCross(Te)&&this.handlePossibleCenter(Te,ht,K,O)===!0&&(le=Te[0],this.hasSkipped&&(ve=this.haveMultiplyConfirmedCenters()))}const Ze=this.selectBestPatterns();return jt.orderBestPatterns(Ze),new br(Ze)}static centerFromEnd(y,E){return E-y[4]-y[3]-y[2]/2}static foundPatternCross(y){let E=0;for(let H=0;H<5;H++){const K=y[H];if(K===0)return!1;E+=K}if(E<7)return!1;const O=E/7,$=O/2;return Math.abs(O-y[0])<$&&Math.abs(O-y[1])<$&&Math.abs(3*O-y[2])<3*$&&Math.abs(O-y[3])<$&&Math.abs(O-y[4])<$}getCrossCheckStateCount(){const y=this.crossCheckStateCount;return y[0]=0,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y}crossCheckDiagonal(y,E,O,$){const H=this.getCrossCheckStateCount();let K=0;const le=this.image;for(;y>=K&&E>=K&&le.get(E-K,y-K);)H[2]++,K++;if(y<K||E<K)return!1;for(;y>=K&&E>=K&&!le.get(E-K,y-K)&&H[1]<=O;)H[1]++,K++;if(y<K||E<K||H[1]>O)return!1;for(;y>=K&&E>=K&&le.get(E-K,y-K)&&H[0]<=O;)H[0]++,K++;if(H[0]>O)return!1;const ve=le.getHeight(),Te=le.getWidth();for(K=1;y+K<ve&&E+K<Te&&le.get(E+K,y+K);)H[2]++,K++;if(y+K>=ve||E+K>=Te)return!1;for(;y+K<ve&&E+K<Te&&!le.get(E+K,y+K)&&H[3]<O;)H[3]++,K++;if(y+K>=ve||E+K>=Te||H[3]>=O)return!1;for(;y+K<ve&&E+K<Te&&le.get(E+K,y+K)&&H[4]<O;)H[4]++,K++;if(H[4]>=O)return!1;const Ze=H[0]+H[1]+H[2]+H[3]+H[4];return Math.abs(Ze-$)<2*$&&pt.foundPatternCross(H)}crossCheckVertical(y,E,O,$){const H=this.image,K=H.getHeight(),le=this.getCrossCheckStateCount();let ve=y;for(;ve>=0&&H.get(E,ve);)le[2]++,ve--;if(ve<0)return NaN;for(;ve>=0&&!H.get(E,ve)&&le[1]<=O;)le[1]++,ve--;if(ve<0||le[1]>O)return NaN;for(;ve>=0&&H.get(E,ve)&&le[0]<=O;)le[0]++,ve--;if(le[0]>O)return NaN;for(ve=y+1;ve<K&&H.get(E,ve);)le[2]++,ve++;if(ve===K)return NaN;for(;ve<K&&!H.get(E,ve)&&le[3]<O;)le[3]++,ve++;if(ve===K||le[3]>=O)return NaN;for(;ve<K&&H.get(E,ve)&&le[4]<O;)le[4]++,ve++;if(le[4]>=O)return NaN;const Te=le[0]+le[1]+le[2]+le[3]+le[4];return 5*Math.abs(Te-$)>=2*$?NaN:pt.foundPatternCross(le)?pt.centerFromEnd(le,ve):NaN}crossCheckHorizontal(y,E,O,$){const H=this.image,K=H.getWidth(),le=this.getCrossCheckStateCount();let ve=y;for(;ve>=0&&H.get(ve,E);)le[2]++,ve--;if(ve<0)return NaN;for(;ve>=0&&!H.get(ve,E)&&le[1]<=O;)le[1]++,ve--;if(ve<0||le[1]>O)return NaN;for(;ve>=0&&H.get(ve,E)&&le[0]<=O;)le[0]++,ve--;if(le[0]>O)return NaN;for(ve=y+1;ve<K&&H.get(ve,E);)le[2]++,ve++;if(ve===K)return NaN;for(;ve<K&&!H.get(ve,E)&&le[3]<O;)le[3]++,ve++;if(ve===K||le[3]>=O)return NaN;for(;ve<K&&H.get(ve,E)&&le[4]<O;)le[4]++,ve++;if(le[4]>=O)return NaN;const Te=le[0]+le[1]+le[2]+le[3]+le[4];return 5*Math.abs(Te-$)>=$?NaN:pt.foundPatternCross(le)?pt.centerFromEnd(le,ve):NaN}handlePossibleCenter(y,E,O,$){const H=y[0]+y[1]+y[2]+y[3]+y[4];let K=pt.centerFromEnd(y,O),le=this.crossCheckVertical(E,Math.floor(K),y[2],H);if(!isNaN(le)&&(K=this.crossCheckHorizontal(Math.floor(K),Math.floor(le),y[2],H),!isNaN(K)&&(!$||this.crossCheckDiagonal(Math.floor(le),Math.floor(K),y[2],H)))){const ve=H/7;let Te=!1;const Ze=this.possibleCenters;for(let ht=0,_t=Ze.length;ht<_t;ht++){const rn=Ze[ht];if(rn.aboutEquals(ve,le,K)){Ze[ht]=rn.combineEstimate(le,K,ve),Te=!0;break}}if(!Te){const ht=new hn(K,le,ve);Ze.push(ht),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(ht)}return!0}return!1}findRowSkip(){if(this.possibleCenters.length<=1)return 0;let E=null;for(const O of this.possibleCenters)if(O.getCount()>=pt.CENTER_QUORUM)if(E==null)E=O;else return this.hasSkipped=!0,Math.floor((Math.abs(E.getX()-O.getX())-Math.abs(E.getY()-O.getY()))/2);return 0}haveMultiplyConfirmedCenters(){let y=0,E=0;const O=this.possibleCenters.length;for(const K of this.possibleCenters)K.getCount()>=pt.CENTER_QUORUM&&(y++,E+=K.getEstimatedModuleSize());if(y<3)return!1;const $=E/O;let H=0;for(const K of this.possibleCenters)H+=Math.abs(K.getEstimatedModuleSize()-$);return H<=.05*E}selectBestPatterns(){const y=this.possibleCenters.length;if(y<3)throw new Y;const E=this.possibleCenters;let O;if(y>3){let $=0,H=0;for(const ve of this.possibleCenters){const Te=ve.getEstimatedModuleSize();$+=Te,H+=Te*Te}O=$/y;let K=Math.sqrt(H/y-O*O);E.sort((ve,Te)=>{const Ze=Math.abs(Te.getEstimatedModuleSize()-O),ht=Math.abs(ve.getEstimatedModuleSize()-O);return Ze<ht?-1:Ze>ht?1:0});const le=Math.max(.2*O,K);for(let ve=0;ve<E.length&&E.length>3;ve++){const Te=E[ve];Math.abs(Te.getEstimatedModuleSize()-O)>le&&(E.splice(ve,1),ve--)}}if(E.length>3){let $=0;for(const H of E)$+=H.getEstimatedModuleSize();O=$/E.length,E.sort((H,K)=>{if(K.getCount()===H.getCount()){const le=Math.abs(K.getEstimatedModuleSize()-O),ve=Math.abs(H.getEstimatedModuleSize()-O);return le<ve?1:le>ve?-1:0}else return K.getCount()-H.getCount()}),E.splice(3)}return[E[0],E[1],E[2]]}}pt.CENTER_QUORUM=2,pt.MIN_SKIP=3,pt.MAX_MODULES=57;class Wt{constructor(y){this.image=y}getImage(){return this.image}getResultPointCallback(){return this.resultPointCallback}detect(y){this.resultPointCallback=y==null?null:y.get(U.NEED_RESULT_POINT_CALLBACK);const O=new pt(this.image,this.resultPointCallback).find(y);return this.processFinderPatternInfo(O)}processFinderPatternInfo(y){const E=y.getTopLeft(),O=y.getTopRight(),$=y.getBottomLeft(),H=this.calculateModuleSize(E,O,$);if(H<1)throw new Y("No pattern found in proccess finder.");const K=Wt.computeDimension(E,O,$,H),le=nt.getProvisionalVersionForDimension(K),ve=le.getDimensionForVersion()-7;let Te=null;if(le.getAlignmentPatternCenters().length>0){const rn=O.getX()-E.getX()+$.getX(),bt=O.getY()-E.getY()+$.getY(),zt=1-3/ve,qt=Math.floor(E.getX()+zt*(rn-E.getX())),Tn=Math.floor(E.getY()+zt*(bt-E.getY()));for(let ir=4;ir<=16;ir<<=1)try{Te=this.findAlignmentInRegion(H,qt,Tn,ir);break}catch(Cr){if(!(Cr instanceof Y))throw Cr}}const Ze=Wt.createTransform(E,O,$,Te,K),ht=Wt.sampleGrid(this.image,Ze,K);let _t;return Te===null?_t=[$,E,O]:_t=[$,E,O,Te],new un(ht,_t)}static createTransform(y,E,O,$,H){const K=H-3.5;let le,ve,Te,Ze;return $!==null?(le=$.getX(),ve=$.getY(),Te=K-3,Ze=Te):(le=E.getX()-y.getX()+O.getX(),ve=E.getY()-y.getY()+O.getY(),Te=K,Ze=K),Vt.quadrilateralToQuadrilateral(3.5,3.5,K,3.5,Te,Ze,3.5,K,y.getX(),y.getY(),E.getX(),E.getY(),le,ve,O.getX(),O.getY())}static sampleGrid(y,E,O){return Ve.getInstance().sampleGridWithTransform(y,O,O,E)}static computeDimension(y,E,O,$){const H=kt.round(jt.distance(y,E)/$),K=kt.round(jt.distance(y,O)/$);let le=Math.floor((H+K)/2)+7;switch(le&3){case 0:le++;break;case 2:le--;break;case 3:throw new Y("Dimensions could be not found.")}return le}calculateModuleSize(y,E,O){return(this.calculateModuleSizeOneWay(y,E)+this.calculateModuleSizeOneWay(y,O))/2}calculateModuleSizeOneWay(y,E){const O=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(y.getX()),Math.floor(y.getY()),Math.floor(E.getX()),Math.floor(E.getY())),$=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(E.getX()),Math.floor(E.getY()),Math.floor(y.getX()),Math.floor(y.getY()));return isNaN(O)?$/7:isNaN($)?O/7:(O+$)/14}sizeOfBlackWhiteBlackRunBothWays(y,E,O,$){let H=this.sizeOfBlackWhiteBlackRun(y,E,O,$),K=1,le=y-(O-y);le<0?(K=y/(y-le),le=0):le>=this.image.getWidth()&&(K=(this.image.getWidth()-1-y)/(le-y),le=this.image.getWidth()-1);let ve=Math.floor(E-($-E)*K);return K=1,ve<0?(K=E/(E-ve),ve=0):ve>=this.image.getHeight()&&(K=(this.image.getHeight()-1-E)/(ve-E),ve=this.image.getHeight()-1),le=Math.floor(y+(le-y)*K),H+=this.sizeOfBlackWhiteBlackRun(y,E,le,ve),H-1}sizeOfBlackWhiteBlackRun(y,E,O,$){const H=Math.abs($-E)>Math.abs(O-y);if(H){let rn=y;y=E,E=rn,rn=O,O=$,$=rn}const K=Math.abs(O-y),le=Math.abs($-E);let ve=-K/2;const Te=y<O?1:-1,Ze=E<$?1:-1;let ht=0;const _t=O+Te;for(let rn=y,bt=E;rn!==_t;rn+=Te){const zt=H?bt:rn,qt=H?rn:bt;if(ht===1===this.image.get(zt,qt)){if(ht===2)return kt.distance(rn,bt,y,E);ht++}if(ve+=le,ve>0){if(bt===$)break;bt+=Ze,ve-=K}}return ht===2?kt.distance(O+Te,$,y,E):NaN}findAlignmentInRegion(y,E,O,$){const H=Math.floor($*y),K=Math.max(0,E-H),le=Math.min(this.image.getWidth()-1,E+H);if(le-K<y*3)throw new Y("Alignment top exceeds estimated module size.");const ve=Math.max(0,O-H),Te=Math.min(this.image.getHeight()-1,O+H);if(Te-ve<y*3)throw new Y("Alignment bottom exceeds estimated module size.");return new yn(this.image,K,ve,le-K,Te-ve,y,this.resultPointCallback).find()}}class Zt{constructor(){this.decoder=new Kt}getDecoder(){return this.decoder}decode(y,E){let O,$;if(E!=null&&E.get(U.PURE_BARCODE)!==void 0){const ve=Zt.extractPureBits(y.getBlackMatrix());O=this.decoder.decodeBitMatrix(ve,E),$=Zt.NO_POINTS}else{const ve=new Wt(y.getBlackMatrix()).detect(E);O=this.decoder.decodeBitMatrix(ve.getBits(),E),$=ve.getPoints()}O.getOther()instanceof St&&O.getOther().applyMirroredCorrection($);const H=new ce(O.getText(),O.getRawBytes(),void 0,$,Ne.QR_CODE,void 0),K=O.getByteSegments();K!==null&&H.putMetadata(je.BYTE_SEGMENTS,K);const le=O.getECLevel();return le!==null&&H.putMetadata(je.ERROR_CORRECTION_LEVEL,le),O.hasStructuredAppend()&&(H.putMetadata(je.STRUCTURED_APPEND_SEQUENCE,O.getStructuredAppendSequenceNumber()),H.putMetadata(je.STRUCTURED_APPEND_PARITY,O.getStructuredAppendParity())),H}reset(){}static extractPureBits(y){const E=y.getTopLeftOnBit(),O=y.getBottomRightOnBit();if(E===null||O===null)throw new Y;const $=this.moduleSize(E,y);let H=E[1],K=O[1],le=E[0],ve=O[0];if(le>=ve||H>=K)throw new Y;if(K-H!==ve-le&&(ve=le+(K-H),ve>=y.getWidth()))throw new Y;const Te=Math.round((ve-le+1)/$),Ze=Math.round((K-H+1)/$);if(Te<=0||Ze<=0)throw new Y;if(Ze!==Te)throw new Y;const ht=Math.floor($/2);H+=ht,le+=ht;const _t=le+Math.floor((Te-1)*$)-ve;if(_t>0){if(_t>ht)throw new Y;le-=_t}const rn=H+Math.floor((Ze-1)*$)-K;if(rn>0){if(rn>ht)throw new Y;H-=rn}const bt=new he(Te,Ze);for(let zt=0;zt<Ze;zt++){const qt=H+Math.floor(zt*$);for(let Tn=0;Tn<Te;Tn++)y.get(le+Math.floor(Tn*$),qt)&&bt.set(Tn,zt)}return bt}static moduleSize(y,E){const O=E.getHeight(),$=E.getWidth();let H=y[0],K=y[1],le=!0,ve=0;for(;H<$&&K<O;){if(le!==E.get(H,K)){if(++ve===5)break;le=!le}H++,K++}if(H===$||K===O)throw new Y;return(H-y[0])/7}}Zt.NO_POINTS=new Array;class vt{PDF417Common(){}static getBitCountSum(y){return kt.sum(y)}static toIntArray(y){if(y==null||!y.length)return vt.EMPTY_INT_ARRAY;const E=new Int32Array(y.length);let O=0;for(const $ of y)E[O++]=$;return E}static getCodeword(y){const E=I.binarySearch(vt.SYMBOL_TABLE,y&262143);return E<0?-1:(vt.CODEWORD_TABLE[E]-1)%vt.NUMBER_OF_CODEWORDS}}vt.NUMBER_OF_CODEWORDS=929,vt.MAX_CODEWORDS_IN_BARCODE=vt.NUMBER_OF_CODEWORDS-1,vt.MIN_ROWS_IN_BARCODE=3,vt.MAX_ROWS_IN_BARCODE=90,vt.MODULES_IN_CODEWORD=17,vt.MODULES_IN_STOP_PATTERN=18,vt.BARS_IN_MODULE=8,vt.EMPTY_INT_ARRAY=new Int32Array([]),vt.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),vt.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]);class Ot{constructor(y,E){this.bits=y,this.points=E}getBits(){return this.bits}getPoints(){return this.points}}class wn{static detectMultiple(y,E,O){let $=y.getBlackMatrix(),H=wn.detect(O,$);return H.length||($=$.clone(),$.rotate180(),H=wn.detect(O,$)),new Ot($,H)}static detect(y,E){const O=new Array;let $=0,H=0,K=!1;for(;$<E.getHeight();){const le=wn.findVertices(E,$,H);if(le[0]==null&&le[3]==null){if(!K)break;K=!1,H=0;for(const ve of O)ve[1]!=null&&($=Math.trunc(Math.max($,ve[1].getY()))),ve[3]!=null&&($=Math.max($,Math.trunc(ve[3].getY())));$+=wn.ROW_STEP;continue}if(K=!0,O.push(le),!y)break;le[2]!=null?(H=Math.trunc(le[2].getX()),$=Math.trunc(le[2].getY())):(H=Math.trunc(le[4].getX()),$=Math.trunc(le[4].getY()))}return O}static findVertices(y,E,O){const $=y.getHeight(),H=y.getWidth(),K=new Array(8);return wn.copyToResult(K,wn.findRowsWithPattern(y,$,H,E,O,wn.START_PATTERN),wn.INDEXES_START_PATTERN),K[4]!=null&&(O=Math.trunc(K[4].getX()),E=Math.trunc(K[4].getY())),wn.copyToResult(K,wn.findRowsWithPattern(y,$,H,E,O,wn.STOP_PATTERN),wn.INDEXES_STOP_PATTERN),K}static copyToResult(y,E,O){for(let $=0;$<O.length;$++)y[O[$]]=E[$]}static findRowsWithPattern(y,E,O,$,H,K){const le=new Array(4);let ve=!1;const Te=new Int32Array(K.length);for(;$<E;$+=wn.ROW_STEP){let ht=wn.findGuardPattern(y,H,$,O,!1,K,Te);if(ht!=null){for(;$>0;){const _t=wn.findGuardPattern(y,H,--$,O,!1,K,Te);if(_t!=null)ht=_t;else{$++;break}}le[0]=new jt(ht[0],$),le[1]=new jt(ht[1],$),ve=!0;break}}let Ze=$+1;if(ve){let ht=0,_t=Int32Array.from([Math.trunc(le[0].getX()),Math.trunc(le[1].getX())]);for(;Ze<E;Ze++){const rn=wn.findGuardPattern(y,_t[0],Ze,O,!1,K,Te);if(rn!=null&&Math.abs(_t[0]-rn[0])<wn.MAX_PATTERN_DRIFT&&Math.abs(_t[1]-rn[1])<wn.MAX_PATTERN_DRIFT)_t=rn,ht=0;else{if(ht>wn.SKIPPED_ROW_COUNT_MAX)break;ht++}}Ze-=ht+1,le[2]=new jt(_t[0],Ze),le[3]=new jt(_t[1],Ze)}return Ze-$<wn.BARCODE_MIN_HEIGHT&&I.fill(le,null),le}static findGuardPattern(y,E,O,$,H,K,le){I.fillWithin(le,0,le.length,0);let ve=E,Te=0;for(;y.get(ve,O)&&ve>0&&Te++<wn.MAX_PIXEL_DRIFT;)ve--;let Ze=ve,ht=0,_t=K.length;for(let rn=H;Ze<$;Ze++)if(y.get(Ze,O)!==rn)le[ht]++;else{if(ht===_t-1){if(wn.patternMatchVariance(le,K,wn.MAX_INDIVIDUAL_VARIANCE)<wn.MAX_AVG_VARIANCE)return new Int32Array([ve,Ze]);ve+=le[0]+le[1],w.arraycopy(le,2,le,0,ht-1),le[ht-1]=0,le[ht]=0,ht--}else ht++;le[ht]=1,rn=!rn}return ht===_t-1&&wn.patternMatchVariance(le,K,wn.MAX_INDIVIDUAL_VARIANCE)<wn.MAX_AVG_VARIANCE?new Int32Array([ve,Ze-1]):null}static patternMatchVariance(y,E,O){let $=y.length,H=0,K=0;for(let Te=0;Te<$;Te++)H+=y[Te],K+=E[Te];if(H<K)return 1/0;let le=H/K;O*=le;let ve=0;for(let Te=0;Te<$;Te++){let Ze=y[Te],ht=E[Te]*le,_t=Ze>ht?Ze-ht:ht-Ze;if(_t>O)return 1/0;ve+=_t}return ve/H}}wn.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),wn.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),wn.MAX_AVG_VARIANCE=.42,wn.MAX_INDIVIDUAL_VARIANCE=.8,wn.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),wn.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),wn.MAX_PIXEL_DRIFT=3,wn.MAX_PATTERN_DRIFT=5,wn.SKIPPED_ROW_COUNT_MAX=25,wn.ROW_STEP=5,wn.BARCODE_MIN_HEIGHT=10;class Gn{constructor(y,E){if(E.length===0)throw new f;this.field=y;let O=E.length;if(O>1&&E[0]===0){let $=1;for(;$<O&&E[$]===0;)$++;$===O?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(O-$),w.arraycopy(E,$,this.coefficients,0,this.coefficients.length))}else this.coefficients=E}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return this.coefficients[0]===0}getCoefficient(y){return this.coefficients[this.coefficients.length-1-y]}evaluateAt(y){if(y===0)return this.getCoefficient(0);if(y===1){let $=0;for(let H of this.coefficients)$=this.field.add($,H);return $}let E=this.coefficients[0],O=this.coefficients.length;for(let $=1;$<O;$++)E=this.field.add(this.field.multiply(y,E),this.coefficients[$]);return E}add(y){if(!this.field.equals(y.field))throw new f("ModulusPolys do not have same ModulusGF field");if(this.isZero())return y;if(y.isZero())return this;let E=this.coefficients,O=y.coefficients;if(E.length>O.length){let K=E;E=O,O=K}let $=new Int32Array(O.length),H=O.length-E.length;w.arraycopy(O,0,$,0,H);for(let K=H;K<O.length;K++)$[K]=this.field.add(E[K-H],O[K]);return new Gn(this.field,$)}subtract(y){if(!this.field.equals(y.field))throw new f("ModulusPolys do not have same ModulusGF field");return y.isZero()?this:this.add(y.negative())}multiply(y){return y instanceof Gn?this.multiplyOther(y):this.multiplyScalar(y)}multiplyOther(y){if(!this.field.equals(y.field))throw new f("ModulusPolys do not have same ModulusGF field");if(this.isZero()||y.isZero())return new Gn(this.field,new Int32Array([0]));let E=this.coefficients,O=E.length,$=y.coefficients,H=$.length,K=new Int32Array(O+H-1);for(let le=0;le<O;le++){let ve=E[le];for(let Te=0;Te<H;Te++)K[le+Te]=this.field.add(K[le+Te],this.field.multiply(ve,$[Te]))}return new Gn(this.field,K)}negative(){let y=this.coefficients.length,E=new Int32Array(y);for(let O=0;O<y;O++)E[O]=this.field.subtract(0,this.coefficients[O]);return new Gn(this.field,E)}multiplyScalar(y){if(y===0)return new Gn(this.field,new Int32Array([0]));if(y===1)return this;let E=this.coefficients.length,O=new Int32Array(E);for(let $=0;$<E;$++)O[$]=this.field.multiply(this.coefficients[$],y);return new Gn(this.field,O)}multiplyByMonomial(y,E){if(y<0)throw new f;if(E===0)return new Gn(this.field,new Int32Array([0]));let O=this.coefficients.length,$=new Int32Array(O+y);for(let H=0;H<O;H++)$[H]=this.field.multiply(this.coefficients[H],E);return new Gn(this.field,$)}toString(){let y=new re;for(let E=this.getDegree();E>=0;E--){let O=this.getCoefficient(E);O!==0&&(O<0?(y.append(" - "),O=-O):y.length()>0&&y.append(" + "),(E===0||O!==1)&&y.append(O),E!==0&&(E===1?y.append("x"):(y.append("x^"),y.append(E))))}return y.toString()}}class fr{add(y,E){return(y+E)%this.modulus}subtract(y,E){return(this.modulus+y-E)%this.modulus}exp(y){return this.expTable[y]}log(y){if(y===0)throw new f;return this.logTable[y]}inverse(y){if(y===0)throw new Be;return this.expTable[this.modulus-this.logTable[y]-1]}multiply(y,E){return y===0||E===0?0:this.expTable[(this.logTable[y]+this.logTable[E])%(this.modulus-1)]}getSize(){return this.modulus}equals(y){return y===this}}class ur extends fr{constructor(y,E){super(),this.modulus=y,this.expTable=new Int32Array(y),this.logTable=new Int32Array(y);let O=1;for(let $=0;$<y;$++)this.expTable[$]=O,O=O*E%y;for(let $=0;$<y-1;$++)this.logTable[this.expTable[$]]=$;this.zero=new Gn(this,new Int32Array([0])),this.one=new Gn(this,new Int32Array([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(y,E){if(y<0)throw new f;if(E===0)return this.zero;let O=new Int32Array(y+1);return O[0]=E,new Gn(this,O)}}ur.PDF417_GF=new ur(vt.NUMBER_OF_CODEWORDS,3);class $t{constructor(){this.field=ur.PDF417_GF}decode(y,E,O){let $=new Gn(this.field,y),H=new Int32Array(E),K=!1;for(let bt=E;bt>0;bt--){let zt=$.evaluateAt(this.field.exp(bt));H[E-bt]=zt,zt!==0&&(K=!0)}if(!K)return 0;let le=this.field.getOne();if(O!=null)for(const bt of O){let zt=this.field.exp(y.length-1-bt),qt=new Gn(this.field,new Int32Array([this.field.subtract(0,zt),1]));le=le.multiply(qt)}let ve=new Gn(this.field,H),Te=this.runEuclideanAlgorithm(this.field.buildMonomial(E,1),ve,E),Ze=Te[0],ht=Te[1],_t=this.findErrorLocations(Ze),rn=this.findErrorMagnitudes(ht,Ze,_t);for(let bt=0;bt<_t.length;bt++){let zt=y.length-1-this.field.log(_t[bt]);if(zt<0)throw g.getChecksumInstance();y[zt]=this.field.subtract(y[zt],rn[bt])}return _t.length}runEuclideanAlgorithm(y,E,O){if(y.getDegree()<E.getDegree()){let _t=y;y=E,E=_t}let $=y,H=E,K=this.field.getZero(),le=this.field.getOne();for(;H.getDegree()>=Math.round(O/2);){let _t=$,rn=K;if($=H,K=le,$.isZero())throw g.getChecksumInstance();H=_t;let bt=this.field.getZero(),zt=$.getCoefficient($.getDegree()),qt=this.field.inverse(zt);for(;H.getDegree()>=$.getDegree()&&!H.isZero();){let Tn=H.getDegree()-$.getDegree(),ir=this.field.multiply(H.getCoefficient(H.getDegree()),qt);bt=bt.add(this.field.buildMonomial(Tn,ir)),H=H.subtract($.multiplyByMonomial(Tn,ir))}le=bt.multiply(K).subtract(rn).negative()}let ve=le.getCoefficient(0);if(ve===0)throw g.getChecksumInstance();let Te=this.field.inverse(ve),Ze=le.multiply(Te),ht=H.multiply(Te);return[Ze,ht]}findErrorLocations(y){let E=y.getDegree(),O=new Int32Array(E),$=0;for(let H=1;H<this.field.getSize()&&$<E;H++)y.evaluateAt(H)===0&&(O[$]=this.field.inverse(H),$++);if($!==E)throw g.getChecksumInstance();return O}findErrorMagnitudes(y,E,O){let $=E.getDegree(),H=new Int32Array($);for(let Te=1;Te<=$;Te++)H[$-Te]=this.field.multiply(Te,E.getCoefficient(Te));let K=new Gn(this.field,H),le=O.length,ve=new Int32Array(le);for(let Te=0;Te<le;Te++){let Ze=this.field.inverse(O[Te]),ht=this.field.subtract(0,y.evaluateAt(Ze)),_t=this.field.inverse(K.evaluateAt(Ze));ve[Te]=this.field.multiply(ht,_t)}return ve}}class nn{constructor(y,E,O,$,H){y instanceof nn?this.constructor_2(y):this.constructor_1(y,E,O,$,H)}constructor_1(y,E,O,$,H){const K=E==null||O==null,le=$==null||H==null;if(K&&le)throw new Y;K?(E=new jt(0,$.getY()),O=new jt(0,H.getY())):le&&($=new jt(y.getWidth()-1,E.getY()),H=new jt(y.getWidth()-1,O.getY())),this.image=y,this.topLeft=E,this.bottomLeft=O,this.topRight=$,this.bottomRight=H,this.minX=Math.trunc(Math.min(E.getX(),O.getX())),this.maxX=Math.trunc(Math.max($.getX(),H.getX())),this.minY=Math.trunc(Math.min(E.getY(),$.getY())),this.maxY=Math.trunc(Math.max(O.getY(),H.getY()))}constructor_2(y){this.image=y.image,this.topLeft=y.getTopLeft(),this.bottomLeft=y.getBottomLeft(),this.topRight=y.getTopRight(),this.bottomRight=y.getBottomRight(),this.minX=y.getMinX(),this.maxX=y.getMaxX(),this.minY=y.getMinY(),this.maxY=y.getMaxY()}static merge(y,E){return y==null?E:E==null?y:new nn(y.image,y.topLeft,y.bottomLeft,E.topRight,E.bottomRight)}addMissingRows(y,E,O){let $=this.topLeft,H=this.bottomLeft,K=this.topRight,le=this.bottomRight;if(y>0){let ve=O?this.topLeft:this.topRight,Te=Math.trunc(ve.getY()-y);Te<0&&(Te=0);let Ze=new jt(ve.getX(),Te);O?$=Ze:K=Ze}if(E>0){let ve=O?this.bottomLeft:this.bottomRight,Te=Math.trunc(ve.getY()+E);Te>=this.image.getHeight()&&(Te=this.image.getHeight()-1);let Ze=new jt(ve.getX(),Te);O?H=Ze:le=Ze}return new nn(this.image,$,H,K,le)}getMinX(){return this.minX}getMaxX(){return this.maxX}getMinY(){return this.minY}getMaxY(){return this.maxY}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}getBottomLeft(){return this.bottomLeft}getBottomRight(){return this.bottomRight}}class Vn{constructor(y,E,O,$){this.columnCount=y,this.errorCorrectionLevel=$,this.rowCountUpperPart=E,this.rowCountLowerPart=O,this.rowCount=E+O}getColumnCount(){return this.columnCount}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getRowCount(){return this.rowCount}getRowCountUpperPart(){return this.rowCountUpperPart}getRowCountLowerPart(){return this.rowCountLowerPart}}class lr{constructor(){this.buffer=""}static form(y,E){let O=-1;function $(K,le,ve,Te,Ze,ht){if(K==="%%")return"%";if(E[++O]===void 0)return;K=Te?parseInt(Te.substr(1)):void 0;let _t=Ze?parseInt(Ze.substr(1)):void 0,rn;switch(ht){case"s":rn=E[O];break;case"c":rn=E[O][0];break;case"f":rn=parseFloat(E[O]).toFixed(K);break;case"p":rn=parseFloat(E[O]).toPrecision(K);break;case"e":rn=parseFloat(E[O]).toExponential(K);break;case"x":rn=parseInt(E[O]).toString(_t||16);break;case"d":rn=parseFloat(parseInt(E[O],_t||10).toPrecision(K)).toFixed(0);break}rn=typeof rn=="object"?JSON.stringify(rn):(+rn).toString(_t);let bt=parseInt(ve),zt=ve&&ve[0]+""=="0"?"0":" ";for(;rn.length<bt;)rn=le!==void 0?rn+zt:zt+rn;return rn}let H=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return y.replace(H,$)}format(y,...E){this.buffer+=lr.form(y,E)}toString(){return this.buffer}}class er{constructor(y){this.boundingBox=new nn(y),this.codewords=new Array(y.getMaxY()-y.getMinY()+1)}getCodewordNearby(y){let E=this.getCodeword(y);if(E!=null)return E;for(let O=1;O<er.MAX_NEARBY_DISTANCE;O++){let $=this.imageRowToCodewordIndex(y)-O;if($>=0&&(E=this.codewords[$],E!=null)||($=this.imageRowToCodewordIndex(y)+O,$<this.codewords.length&&(E=this.codewords[$],E!=null)))return E}return null}imageRowToCodewordIndex(y){return y-this.boundingBox.getMinY()}setCodeword(y,E){this.codewords[this.imageRowToCodewordIndex(y)]=E}getCodeword(y){return this.codewords[this.imageRowToCodewordIndex(y)]}getBoundingBox(){return this.boundingBox}getCodewords(){return this.codewords}toString(){const y=new lr;let E=0;for(const O of this.codewords){if(O==null){y.format("%3d:    |   %n",E++);continue}y.format("%3d: %3d|%3d%n",E++,O.getRowNumber(),O.getValue())}return y.toString()}}er.MAX_NEARBY_DISTANCE=5;class gr{constructor(){this.values=new Map}setValue(y){y=Math.trunc(y);let E=this.values.get(y);E==null&&(E=0),E++,this.values.set(y,E)}getValue(){let y=-1,E=new Array;for(const[O,$]of this.values.entries()){const H={getKey:()=>O,getValue:()=>$};H.getValue()>y?(y=H.getValue(),E=[],E.push(H.getKey())):H.getValue()===y&&E.push(H.getKey())}return vt.toIntArray(E)}getConfidence(y){return this.values.get(y)}}class dr extends er{constructor(y,E){super(y),this._isLeft=E}setRowNumbers(){for(let y of this.getCodewords())y!=null&&y.setRowNumberAsRowIndicatorColumn()}adjustCompleteIndicatorColumnRowNumbers(y){let E=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(E,y);let O=this.getBoundingBox(),$=this._isLeft?O.getTopLeft():O.getTopRight(),H=this._isLeft?O.getBottomLeft():O.getBottomRight(),K=this.imageRowToCodewordIndex(Math.trunc($.getY())),le=this.imageRowToCodewordIndex(Math.trunc(H.getY())),ve=-1,Te=1,Ze=0;for(let ht=K;ht<le;ht++){if(E[ht]==null)continue;let _t=E[ht],rn=_t.getRowNumber()-ve;if(rn===0)Ze++;else if(rn===1)Te=Math.max(Te,Ze),Ze=1,ve=_t.getRowNumber();else if(rn<0||_t.getRowNumber()>=y.getRowCount()||rn>ht)E[ht]=null;else{let bt;Te>2?bt=(Te-2)*rn:bt=rn;let zt=bt>=ht;for(let qt=1;qt<=bt&&!zt;qt++)zt=E[ht-qt]!=null;zt?E[ht]=null:(ve=_t.getRowNumber(),Ze=1)}}}getRowHeights(){let y=this.getBarcodeMetadata();if(y==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(y);let E=new Int32Array(y.getRowCount());for(let O of this.getCodewords())if(O!=null){let $=O.getRowNumber();if($>=E.length)continue;E[$]++}return E}adjustIncompleteIndicatorColumnRowNumbers(y){let E=this.getBoundingBox(),O=this._isLeft?E.getTopLeft():E.getTopRight(),$=this._isLeft?E.getBottomLeft():E.getBottomRight(),H=this.imageRowToCodewordIndex(Math.trunc(O.getY())),K=this.imageRowToCodewordIndex(Math.trunc($.getY())),le=this.getCodewords(),ve=-1;for(let Te=H;Te<K;Te++){if(le[Te]==null)continue;let Ze=le[Te];Ze.setRowNumberAsRowIndicatorColumn();let ht=Ze.getRowNumber()-ve;ht===0||(ht===1?ve=Ze.getRowNumber():Ze.getRowNumber()>=y.getRowCount()?le[Te]=null:ve=Ze.getRowNumber())}}getBarcodeMetadata(){let y=this.getCodewords(),E=new gr,O=new gr,$=new gr,H=new gr;for(let le of y){if(le==null)continue;le.setRowNumberAsRowIndicatorColumn();let ve=le.getValue()%30,Te=le.getRowNumber();switch(this._isLeft||(Te+=2),Te%3){case 0:O.setValue(ve*3+1);break;case 1:H.setValue(ve/3),$.setValue(ve%3);break;case 2:E.setValue(ve+1);break}}if(E.getValue().length===0||O.getValue().length===0||$.getValue().length===0||H.getValue().length===0||E.getValue()[0]<1||O.getValue()[0]+$.getValue()[0]<vt.MIN_ROWS_IN_BARCODE||O.getValue()[0]+$.getValue()[0]>vt.MAX_ROWS_IN_BARCODE)return null;let K=new Vn(E.getValue()[0],O.getValue()[0],$.getValue()[0],H.getValue()[0]);return this.removeIncorrectCodewords(y,K),K}removeIncorrectCodewords(y,E){for(let O=0;O<y.length;O++){let $=y[O];if(y[O]==null)continue;let H=$.getValue()%30,K=$.getRowNumber();if(K>E.getRowCount()){y[O]=null;continue}switch(this._isLeft||(K+=2),K%3){case 0:H*3+1!==E.getRowCountUpperPart()&&(y[O]=null);break;case 1:(Math.trunc(H/3)!==E.getErrorCorrectionLevel()||H%3!==E.getRowCountLowerPart())&&(y[O]=null);break;case 2:H+1!==E.getColumnCount()&&(y[O]=null);break}}}isLeft(){return this._isLeft}toString(){return"IsLeft: "+this._isLeft+`
`+super.toString()}}class Fs{constructor(y,E){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=y,this.barcodeColumnCount=y.getColumnCount(),this.boundingBox=E,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}getDetectionResultColumns(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);let y=vt.MAX_CODEWORDS_IN_BARCODE,E;do E=y,y=this.adjustRowNumbersAndGetCount();while(y>0&&y<E);return this.detectionResultColumns}adjustIndicatorColumnRowNumbers(y){y!=null&&y.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)}adjustRowNumbersAndGetCount(){let y=this.adjustRowNumbersByRow();if(y===0)return 0;for(let E=1;E<this.barcodeColumnCount+1;E++){let O=this.detectionResultColumns[E].getCodewords();for(let $=0;$<O.length;$++)O[$]!=null&&(O[$].hasValidRowNumber()||this.adjustRowNumbers(E,$,O))}return y}adjustRowNumbersByRow(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()}adjustRowNumbersFromBothRI(){if(this.detectionResultColumns[0]==null||this.detectionResultColumns[this.barcodeColumnCount+1]==null)return;let y=this.detectionResultColumns[0].getCodewords(),E=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let O=0;O<y.length;O++)if(y[O]!=null&&E[O]!=null&&y[O].getRowNumber()===E[O].getRowNumber())for(let $=1;$<=this.barcodeColumnCount;$++){let H=this.detectionResultColumns[$].getCodewords()[O];H!=null&&(H.setRowNumber(y[O].getRowNumber()),H.hasValidRowNumber()||(this.detectionResultColumns[$].getCodewords()[O]=null))}}adjustRowNumbersFromRRI(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null)return 0;let y=0,E=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let O=0;O<E.length;O++){if(E[O]==null)continue;let $=E[O].getRowNumber(),H=0;for(let K=this.barcodeColumnCount+1;K>0&&H<this.ADJUST_ROW_NUMBER_SKIP;K--){let le=this.detectionResultColumns[K].getCodewords()[O];le!=null&&(H=Fs.adjustRowNumberIfValid($,H,le),le.hasValidRowNumber()||y++)}}return y}adjustRowNumbersFromLRI(){if(this.detectionResultColumns[0]==null)return 0;let y=0,E=this.detectionResultColumns[0].getCodewords();for(let O=0;O<E.length;O++){if(E[O]==null)continue;let $=E[O].getRowNumber(),H=0;for(let K=1;K<this.barcodeColumnCount+1&&H<this.ADJUST_ROW_NUMBER_SKIP;K++){let le=this.detectionResultColumns[K].getCodewords()[O];le!=null&&(H=Fs.adjustRowNumberIfValid($,H,le),le.hasValidRowNumber()||y++)}}return y}static adjustRowNumberIfValid(y,E,O){return O==null||O.hasValidRowNumber()||(O.isValidRowNumber(y)?(O.setRowNumber(y),E=0):++E),E}adjustRowNumbers(y,E,O){if(!this.detectionResultColumns[y-1])return;let $=O[E],H=this.detectionResultColumns[y-1].getCodewords(),K=H;this.detectionResultColumns[y+1]!=null&&(K=this.detectionResultColumns[y+1].getCodewords());let le=new Array(14);le[2]=H[E],le[3]=K[E],E>0&&(le[0]=O[E-1],le[4]=H[E-1],le[5]=K[E-1]),E>1&&(le[8]=O[E-2],le[10]=H[E-2],le[11]=K[E-2]),E<O.length-1&&(le[1]=O[E+1],le[6]=H[E+1],le[7]=K[E+1]),E<O.length-2&&(le[9]=O[E+2],le[12]=H[E+2],le[13]=K[E+2]);for(let ve of le)if(Fs.adjustRowNumber($,ve))return}static adjustRowNumber(y,E){return E==null?!1:E.hasValidRowNumber()&&E.getBucket()===y.getBucket()?(y.setRowNumber(E.getRowNumber()),!0):!1}getBarcodeColumnCount(){return this.barcodeColumnCount}getBarcodeRowCount(){return this.barcodeMetadata.getRowCount()}getBarcodeECLevel(){return this.barcodeMetadata.getErrorCorrectionLevel()}setBoundingBox(y){this.boundingBox=y}getBoundingBox(){return this.boundingBox}setDetectionResultColumn(y,E){this.detectionResultColumns[y]=E}getDetectionResultColumn(y){return this.detectionResultColumns[y]}toString(){let y=this.detectionResultColumns[0];y==null&&(y=this.detectionResultColumns[this.barcodeColumnCount+1]);let E=new lr;for(let O=0;O<y.getCodewords().length;O++){E.format("CW %3d:",O);for(let $=0;$<this.barcodeColumnCount+2;$++){if(this.detectionResultColumns[$]==null){E.format("    |   ");continue}let H=this.detectionResultColumns[$].getCodewords()[O];if(H==null){E.format("    |   ");continue}E.format(" %3d|%3d",H.getRowNumber(),H.getValue())}E.format("%n")}return E.toString()}}class us{constructor(y,E,O,$){this.rowNumber=us.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(y),this.endX=Math.trunc(E),this.bucket=Math.trunc(O),this.value=Math.trunc($)}hasValidRowNumber(){return this.isValidRowNumber(this.rowNumber)}isValidRowNumber(y){return y!==us.BARCODE_ROW_UNKNOWN&&this.bucket===y%3*3}setRowNumberAsRowIndicatorColumn(){this.rowNumber=Math.trunc(Math.trunc(this.value/30)*3+Math.trunc(this.bucket/3))}getWidth(){return this.endX-this.startX}getStartX(){return this.startX}getEndX(){return this.endX}getBucket(){return this.bucket}getValue(){return this.value}getRowNumber(){return this.rowNumber}setRowNumber(y){this.rowNumber=y}toString(){return this.rowNumber+"|"+this.value}}us.BARCODE_ROW_UNKNOWN=-1;class xr{static initialize(){for(let y=0;y<vt.SYMBOL_TABLE.length;y++){let E=vt.SYMBOL_TABLE[y],O=E&1;for(let $=0;$<vt.BARS_IN_MODULE;$++){let H=0;for(;(E&1)===O;)H+=1,E>>=1;O=E&1,xr.RATIOS_TABLE[y]||(xr.RATIOS_TABLE[y]=new Array(vt.BARS_IN_MODULE)),xr.RATIOS_TABLE[y][vt.BARS_IN_MODULE-$-1]=Math.fround(H/vt.MODULES_IN_CODEWORD)}}this.bSymbolTableReady=!0}static getDecodedValue(y){let E=xr.getDecodedCodewordValue(xr.sampleBitCounts(y));return E!==-1?E:xr.getClosestDecodedValue(y)}static sampleBitCounts(y){let E=kt.sum(y),O=new Int32Array(vt.BARS_IN_MODULE),$=0,H=0;for(let K=0;K<vt.MODULES_IN_CODEWORD;K++){let le=E/(2*vt.MODULES_IN_CODEWORD)+K*E/vt.MODULES_IN_CODEWORD;H+y[$]<=le&&(H+=y[$],$++),O[$]++}return O}static getDecodedCodewordValue(y){let E=xr.getBitValue(y);return vt.getCodeword(E)===-1?-1:E}static getBitValue(y){let E=0;for(let O=0;O<y.length;O++)for(let $=0;$<y[O];$++)E=E<<1|(O%2===0?1:0);return Math.trunc(E)}static getClosestDecodedValue(y){let E=kt.sum(y),O=new Array(vt.BARS_IN_MODULE);if(E>1)for(let K=0;K<O.length;K++)O[K]=Math.fround(y[K]/E);let $=tn.MAX_VALUE,H=-1;this.bSymbolTableReady||xr.initialize();for(let K=0;K<xr.RATIOS_TABLE.length;K++){let le=0,ve=xr.RATIOS_TABLE[K];for(let Te=0;Te<vt.BARS_IN_MODULE;Te++){let Ze=Math.fround(ve[Te]-O[Te]);if(le+=Math.fround(Ze*Ze),le>=$)break}le<$&&($=le,H=vt.SYMBOL_TABLE[K])}return H}}xr.bSymbolTableReady=!1,xr.RATIOS_TABLE=new Array(vt.SYMBOL_TABLE.length).map(ut=>new Array(vt.BARS_IN_MODULE));class vr{constructor(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}getSegmentIndex(){return this.segmentIndex}setSegmentIndex(y){this.segmentIndex=y}getFileId(){return this.fileId}setFileId(y){this.fileId=y}getOptionalData(){return this.optionalData}setOptionalData(y){this.optionalData=y}isLastSegment(){return this.lastSegment}setLastSegment(y){this.lastSegment=y}getSegmentCount(){return this.segmentCount}setSegmentCount(y){this.segmentCount=y}getSender(){return this.sender||null}setSender(y){this.sender=y}getAddressee(){return this.addressee||null}setAddressee(y){this.addressee=y}getFileName(){return this.fileName}setFileName(y){this.fileName=y}getFileSize(){return this.fileSize}setFileSize(y){this.fileSize=y}getChecksum(){return this.checksum}setChecksum(y){this.checksum=y}getTimestamp(){return this.timestamp}setTimestamp(y){this.timestamp=y}}class rs{static parseLong(y,E=void 0){return parseInt(y,E)}}class Zr extends u{}Zr.kind="NullPointerException";class gi{writeBytes(y){this.writeBytesOffset(y,0,y.length)}writeBytesOffset(y,E,O){if(y==null)throw new Zr;if(E<0||E>y.length||O<0||E+O>y.length||E+O<0)throw new C;if(O===0)return;for(let $=0;$<O;$++)this.write(y[E+$])}flush(){}close(){}}class oi extends u{}class la extends gi{constructor(y=32){if(super(),this.count=0,y<0)throw new f("Negative initial size: "+y);this.buf=new Uint8Array(y)}ensureCapacity(y){y-this.buf.length>0&&this.grow(y)}grow(y){let O=this.buf.length<<1;if(O-y<0&&(O=y),O<0){if(y<0)throw new oi;O=P.MAX_VALUE}this.buf=I.copyOfUint8Array(this.buf,O)}write(y){this.ensureCapacity(this.count+1),this.buf[this.count]=y,this.count+=1}writeBytesOffset(y,E,O){if(E<0||E>y.length||O<0||E+O-y.length>0)throw new C;this.ensureCapacity(this.count+O),w.arraycopy(y,E,this.buf,this.count,O),this.count+=O}writeTo(y){y.writeBytesOffset(this.buf,0,this.count)}reset(){this.count=0}toByteArray(){return I.copyOfUint8Array(this.buf,this.count)}size(){return this.count}toString(y){return y?typeof y=="string"?this.toString_string(y):this.toString_number(y):this.toString_void()}toString_void(){return new String(this.buf).toString()}toString_string(y){return new String(this.buf).toString()}toString_number(y){return new String(this.buf).toString()}close(){}}var jr;(function(ut){ut[ut.ALPHA=0]="ALPHA",ut[ut.LOWER=1]="LOWER",ut[ut.MIXED=2]="MIXED",ut[ut.PUNCT=3]="PUNCT",ut[ut.ALPHA_SHIFT=4]="ALPHA_SHIFT",ut[ut.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(jr||(jr={}));function Xt(){if(typeof window<"u")return window.BigInt||null;if(typeof ju<"u")return ju.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}let pe;function st(ut){if(typeof pe>"u"&&(pe=Xt()),pe===null)throw new Error("BigInt is not supported!");return pe(ut)}function Ft(){let ut=[];ut[0]=st(1);let y=st(900);ut[1]=y;for(let E=2;E<16;E++)ut[E]=ut[E-1]*y;return ut}class yt{static decode(y,E){let O=new re(""),$=X.ISO8859_1;O.enableDecoding($);let H=1,K=y[H++],le=new vr;for(;H<y[0];){switch(K){case yt.TEXT_COMPACTION_MODE_LATCH:H=yt.textCompaction(y,H,O);break;case yt.BYTE_COMPACTION_MODE_LATCH:case yt.BYTE_COMPACTION_MODE_LATCH_6:H=yt.byteCompaction(K,y,$,H,O);break;case yt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:O.append(y[H++]);break;case yt.NUMERIC_COMPACTION_MODE_LATCH:H=yt.numericCompaction(y,H,O);break;case yt.ECI_CHARSET:X.getCharacterSetECIByValue(y[H++]);break;case yt.ECI_GENERAL_PURPOSE:H+=2;break;case yt.ECI_USER_DEFINED:H++;break;case yt.BEGIN_MACRO_PDF417_CONTROL_BLOCK:H=yt.decodeMacroBlock(y,H,le);break;case yt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case yt.MACRO_PDF417_TERMINATOR:throw new L;default:H--,H=yt.textCompaction(y,H,O);break}if(H<y.length)K=y[H++];else throw L.getFormatInstance()}if(O.length()===0)throw L.getFormatInstance();let ve=new Ie(null,O.toString(),null,E);return ve.setOther(le),ve}static decodeMacroBlock(y,E,O){if(E+yt.NUMBER_OF_SEQUENCE_CODEWORDS>y[0])throw L.getFormatInstance();let $=new Int32Array(yt.NUMBER_OF_SEQUENCE_CODEWORDS);for(let le=0;le<yt.NUMBER_OF_SEQUENCE_CODEWORDS;le++,E++)$[le]=y[E];O.setSegmentIndex(P.parseInt(yt.decodeBase900toBase10($,yt.NUMBER_OF_SEQUENCE_CODEWORDS)));let H=new re;E=yt.textCompaction(y,E,H),O.setFileId(H.toString());let K=-1;for(y[E]===yt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(K=E+1);E<y[0];)switch(y[E]){case yt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(E++,y[E]){case yt.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:let le=new re;E=yt.textCompaction(y,E+1,le),O.setFileName(le.toString());break;case yt.MACRO_PDF417_OPTIONAL_FIELD_SENDER:let ve=new re;E=yt.textCompaction(y,E+1,ve),O.setSender(ve.toString());break;case yt.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:let Te=new re;E=yt.textCompaction(y,E+1,Te),O.setAddressee(Te.toString());break;case yt.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:let Ze=new re;E=yt.numericCompaction(y,E+1,Ze),O.setSegmentCount(P.parseInt(Ze.toString()));break;case yt.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:let ht=new re;E=yt.numericCompaction(y,E+1,ht),O.setTimestamp(rs.parseLong(ht.toString()));break;case yt.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:let _t=new re;E=yt.numericCompaction(y,E+1,_t),O.setChecksum(P.parseInt(_t.toString()));break;case yt.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:let rn=new re;E=yt.numericCompaction(y,E+1,rn),O.setFileSize(rs.parseLong(rn.toString()));break;default:throw L.getFormatInstance()}break;case yt.MACRO_PDF417_TERMINATOR:E++,O.setLastSegment(!0);break;default:throw L.getFormatInstance()}if(K!==-1){let le=E-K;O.isLastSegment()&&le--,O.setOptionalData(I.copyOfRange(y,K,K+le))}return E}static textCompaction(y,E,O){let $=new Int32Array((y[0]-E)*2),H=new Int32Array((y[0]-E)*2),K=0,le=!1;for(;E<y[0]&&!le;){let ve=y[E++];if(ve<yt.TEXT_COMPACTION_MODE_LATCH)$[K]=ve/30,$[K+1]=ve%30,K+=2;else switch(ve){case yt.TEXT_COMPACTION_MODE_LATCH:$[K++]=yt.TEXT_COMPACTION_MODE_LATCH;break;case yt.BYTE_COMPACTION_MODE_LATCH:case yt.BYTE_COMPACTION_MODE_LATCH_6:case yt.NUMERIC_COMPACTION_MODE_LATCH:case yt.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case yt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case yt.MACRO_PDF417_TERMINATOR:E--,le=!0;break;case yt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$[K]=yt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,ve=y[E++],H[K]=ve,K++;break}}return yt.decodeTextCompaction($,H,K,O),E}static decodeTextCompaction(y,E,O,$){let H=jr.ALPHA,K=jr.ALPHA,le=0;for(;le<O;){let ve=y[le],Te="";switch(H){case jr.ALPHA:if(ve<26)Te=String.fromCharCode(65+ve);else switch(ve){case 26:Te=" ";break;case yt.LL:H=jr.LOWER;break;case yt.ML:H=jr.MIXED;break;case yt.PS:K=H,H=jr.PUNCT_SHIFT;break;case yt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$.append(E[le]);break;case yt.TEXT_COMPACTION_MODE_LATCH:H=jr.ALPHA;break}break;case jr.LOWER:if(ve<26)Te=String.fromCharCode(97+ve);else switch(ve){case 26:Te=" ";break;case yt.AS:K=H,H=jr.ALPHA_SHIFT;break;case yt.ML:H=jr.MIXED;break;case yt.PS:K=H,H=jr.PUNCT_SHIFT;break;case yt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$.append(E[le]);break;case yt.TEXT_COMPACTION_MODE_LATCH:H=jr.ALPHA;break}break;case jr.MIXED:if(ve<yt.PL)Te=yt.MIXED_CHARS[ve];else switch(ve){case yt.PL:H=jr.PUNCT;break;case 26:Te=" ";break;case yt.LL:H=jr.LOWER;break;case yt.AL:H=jr.ALPHA;break;case yt.PS:K=H,H=jr.PUNCT_SHIFT;break;case yt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$.append(E[le]);break;case yt.TEXT_COMPACTION_MODE_LATCH:H=jr.ALPHA;break}break;case jr.PUNCT:if(ve<yt.PAL)Te=yt.PUNCT_CHARS[ve];else switch(ve){case yt.PAL:H=jr.ALPHA;break;case yt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$.append(E[le]);break;case yt.TEXT_COMPACTION_MODE_LATCH:H=jr.ALPHA;break}break;case jr.ALPHA_SHIFT:if(H=K,ve<26)Te=String.fromCharCode(65+ve);else switch(ve){case 26:Te=" ";break;case yt.TEXT_COMPACTION_MODE_LATCH:H=jr.ALPHA;break}break;case jr.PUNCT_SHIFT:if(H=K,ve<yt.PAL)Te=yt.PUNCT_CHARS[ve];else switch(ve){case yt.PAL:H=jr.ALPHA;break;case yt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:$.append(E[le]);break;case yt.TEXT_COMPACTION_MODE_LATCH:H=jr.ALPHA;break}break}Te!==""&&$.append(Te),le++}}static byteCompaction(y,E,O,$,H){let K=new la,le=0,ve=0,Te=!1;switch(y){case yt.BYTE_COMPACTION_MODE_LATCH:let Ze=new Int32Array(6),ht=E[$++];for(;$<E[0]&&!Te;)switch(Ze[le++]=ht,ve=900*ve+ht,ht=E[$++],ht){case yt.TEXT_COMPACTION_MODE_LATCH:case yt.BYTE_COMPACTION_MODE_LATCH:case yt.NUMERIC_COMPACTION_MODE_LATCH:case yt.BYTE_COMPACTION_MODE_LATCH_6:case yt.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case yt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case yt.MACRO_PDF417_TERMINATOR:$--,Te=!0;break;default:if(le%5===0&&le>0){for(let _t=0;_t<6;++_t)K.write(Number(st(ve)>>st(8*(5-_t))));ve=0,le=0}break}$===E[0]&&ht<yt.TEXT_COMPACTION_MODE_LATCH&&(Ze[le++]=ht);for(let _t=0;_t<le;_t++)K.write(Ze[_t]);break;case yt.BYTE_COMPACTION_MODE_LATCH_6:for(;$<E[0]&&!Te;){let _t=E[$++];if(_t<yt.TEXT_COMPACTION_MODE_LATCH)le++,ve=900*ve+_t;else switch(_t){case yt.TEXT_COMPACTION_MODE_LATCH:case yt.BYTE_COMPACTION_MODE_LATCH:case yt.NUMERIC_COMPACTION_MODE_LATCH:case yt.BYTE_COMPACTION_MODE_LATCH_6:case yt.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case yt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case yt.MACRO_PDF417_TERMINATOR:$--,Te=!0;break}if(le%5===0&&le>0){for(let rn=0;rn<6;++rn)K.write(Number(st(ve)>>st(8*(5-rn))));ve=0,le=0}}break}return H.append(J.decode(K.toByteArray(),O)),$}static numericCompaction(y,E,O){let $=0,H=!1,K=new Int32Array(yt.MAX_NUMERIC_CODEWORDS);for(;E<y[0]&&!H;){let le=y[E++];if(E===y[0]&&(H=!0),le<yt.TEXT_COMPACTION_MODE_LATCH)K[$]=le,$++;else switch(le){case yt.TEXT_COMPACTION_MODE_LATCH:case yt.BYTE_COMPACTION_MODE_LATCH:case yt.BYTE_COMPACTION_MODE_LATCH_6:case yt.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case yt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case yt.MACRO_PDF417_TERMINATOR:E--,H=!0;break}($%yt.MAX_NUMERIC_CODEWORDS===0||le===yt.NUMERIC_COMPACTION_MODE_LATCH||H)&&$>0&&(O.append(yt.decodeBase900toBase10(K,$)),$=0)}return E}static decodeBase900toBase10(y,E){let O=st(0);for(let H=0;H<E;H++)O+=yt.EXP900[E-H-1]*st(y[H]);let $=O.toString();if($.charAt(0)!=="1")throw new L;return $.substring(1)}}yt.TEXT_COMPACTION_MODE_LATCH=900,yt.BYTE_COMPACTION_MODE_LATCH=901,yt.NUMERIC_COMPACTION_MODE_LATCH=902,yt.BYTE_COMPACTION_MODE_LATCH_6=924,yt.ECI_USER_DEFINED=925,yt.ECI_GENERAL_PURPOSE=926,yt.ECI_CHARSET=927,yt.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,yt.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,yt.MACRO_PDF417_TERMINATOR=922,yt.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,yt.MAX_NUMERIC_CODEWORDS=15,yt.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,yt.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,yt.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,yt.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,yt.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,yt.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,yt.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,yt.PL=25,yt.LL=27,yt.AS=27,yt.ML=28,yt.AL=28,yt.PS=29,yt.PAL=29,yt.PUNCT_CHARS=`;<>@[\\]_\`~!\r	,:
-.$/"|*()?{}'`,yt.MIXED_CHARS="0123456789&\r	,:#-.$/+%*=^",yt.EXP900=Xt()?Ft():[],yt.NUMBER_OF_SEQUENCE_CODEWORDS=2;class pn{constructor(){}static decode(y,E,O,$,H,K,le){let ve=new nn(y,E,O,$,H),Te=null,Ze=null,ht;for(let bt=!0;;bt=!1){if(E!=null&&(Te=pn.getRowIndicatorColumn(y,ve,E,!0,K,le)),$!=null&&(Ze=pn.getRowIndicatorColumn(y,ve,$,!1,K,le)),ht=pn.merge(Te,Ze),ht==null)throw Y.getNotFoundInstance();let zt=ht.getBoundingBox();if(bt&&zt!=null&&(zt.getMinY()<ve.getMinY()||zt.getMaxY()>ve.getMaxY()))ve=zt;else break}ht.setBoundingBox(ve);let _t=ht.getBarcodeColumnCount()+1;ht.setDetectionResultColumn(0,Te),ht.setDetectionResultColumn(_t,Ze);let rn=Te!=null;for(let bt=1;bt<=_t;bt++){let zt=rn?bt:_t-bt;if(ht.getDetectionResultColumn(zt)!==void 0)continue;let qt;zt===0||zt===_t?qt=new dr(ve,zt===0):qt=new er(ve),ht.setDetectionResultColumn(zt,qt);let Tn=-1,ir=Tn;for(let Cr=ve.getMinY();Cr<=ve.getMaxY();Cr++){if(Tn=pn.getStartColumn(ht,zt,Cr,rn),Tn<0||Tn>ve.getMaxX()){if(ir===-1)continue;Tn=ir}let Ar=pn.detectCodeword(y,ve.getMinX(),ve.getMaxX(),rn,Tn,Cr,K,le);Ar!=null&&(qt.setCodeword(Cr,Ar),ir=Tn,K=Math.min(K,Ar.getWidth()),le=Math.max(le,Ar.getWidth()))}}return pn.createDecoderResult(ht)}static merge(y,E){if(y==null&&E==null)return null;let O=pn.getBarcodeMetadata(y,E);if(O==null)return null;let $=nn.merge(pn.adjustBoundingBox(y),pn.adjustBoundingBox(E));return new Fs(O,$)}static adjustBoundingBox(y){if(y==null)return null;let E=y.getRowHeights();if(E==null)return null;let O=pn.getMax(E),$=0;for(let le of E)if($+=O-le,le>0)break;let H=y.getCodewords();for(let le=0;$>0&&H[le]==null;le++)$--;let K=0;for(let le=E.length-1;le>=0&&(K+=O-E[le],!(E[le]>0));le--);for(let le=H.length-1;K>0&&H[le]==null;le--)K--;return y.getBoundingBox().addMissingRows($,K,y.isLeft())}static getMax(y){let E=-1;for(let O of y)E=Math.max(E,O);return E}static getBarcodeMetadata(y,E){let O;if(y==null||(O=y.getBarcodeMetadata())==null)return E==null?null:E.getBarcodeMetadata();let $;return E==null||($=E.getBarcodeMetadata())==null?O:O.getColumnCount()!==$.getColumnCount()&&O.getErrorCorrectionLevel()!==$.getErrorCorrectionLevel()&&O.getRowCount()!==$.getRowCount()?null:O}static getRowIndicatorColumn(y,E,O,$,H,K){let le=new dr(E,$);for(let ve=0;ve<2;ve++){let Te=ve===0?1:-1,Ze=Math.trunc(Math.trunc(O.getX()));for(let ht=Math.trunc(Math.trunc(O.getY()));ht<=E.getMaxY()&&ht>=E.getMinY();ht+=Te){let _t=pn.detectCodeword(y,0,y.getWidth(),$,Ze,ht,H,K);_t!=null&&(le.setCodeword(ht,_t),$?Ze=_t.getStartX():Ze=_t.getEndX())}}return le}static adjustCodewordCount(y,E){let O=E[0][1],$=O.getValue(),H=y.getBarcodeColumnCount()*y.getBarcodeRowCount()-pn.getNumberOfECCodeWords(y.getBarcodeECLevel());if($.length===0){if(H<1||H>vt.MAX_CODEWORDS_IN_BARCODE)throw Y.getNotFoundInstance();O.setValue(H)}else $[0]!==H&&O.setValue(H)}static createDecoderResult(y){let E=pn.createBarcodeMatrix(y);pn.adjustCodewordCount(y,E);let O=new Array,$=new Int32Array(y.getBarcodeRowCount()*y.getBarcodeColumnCount()),H=[],K=new Array;for(let ve=0;ve<y.getBarcodeRowCount();ve++)for(let Te=0;Te<y.getBarcodeColumnCount();Te++){let Ze=E[ve][Te+1].getValue(),ht=ve*y.getBarcodeColumnCount()+Te;Ze.length===0?O.push(ht):Ze.length===1?$[ht]=Ze[0]:(K.push(ht),H.push(Ze))}let le=new Array(H.length);for(let ve=0;ve<le.length;ve++)le[ve]=H[ve];return pn.createDecoderResultFromAmbiguousValues(y.getBarcodeECLevel(),$,vt.toIntArray(O),vt.toIntArray(K),le)}static createDecoderResultFromAmbiguousValues(y,E,O,$,H){let K=new Int32Array($.length),le=100;for(;le-- >0;){for(let ve=0;ve<K.length;ve++)E[$[ve]]=H[ve][K[ve]];try{return pn.decodeCodewords(E,y,O)}catch(ve){if(!(ve instanceof g))throw ve}if(K.length===0)throw g.getChecksumInstance();for(let ve=0;ve<K.length;ve++)if(K[ve]<H[ve].length-1){K[ve]++;break}else if(K[ve]=0,ve===K.length-1)throw g.getChecksumInstance()}throw g.getChecksumInstance()}static createBarcodeMatrix(y){let E=Array.from({length:y.getBarcodeRowCount()},()=>new Array(y.getBarcodeColumnCount()+2));for(let $=0;$<E.length;$++)for(let H=0;H<E[$].length;H++)E[$][H]=new gr;let O=0;for(let $ of y.getDetectionResultColumns()){if($!=null){for(let H of $.getCodewords())if(H!=null){let K=H.getRowNumber();if(K>=0){if(K>=E.length)continue;E[K][O].setValue(H.getValue())}}}O++}return E}static isValidBarcodeColumn(y,E){return E>=0&&E<=y.getBarcodeColumnCount()+1}static getStartColumn(y,E,O,$){let H=$?1:-1,K=null;if(pn.isValidBarcodeColumn(y,E-H)&&(K=y.getDetectionResultColumn(E-H).getCodeword(O)),K!=null)return $?K.getEndX():K.getStartX();if(K=y.getDetectionResultColumn(E).getCodewordNearby(O),K!=null)return $?K.getStartX():K.getEndX();if(pn.isValidBarcodeColumn(y,E-H)&&(K=y.getDetectionResultColumn(E-H).getCodewordNearby(O)),K!=null)return $?K.getEndX():K.getStartX();let le=0;for(;pn.isValidBarcodeColumn(y,E-H);){E-=H;for(let ve of y.getDetectionResultColumn(E).getCodewords())if(ve!=null)return($?ve.getEndX():ve.getStartX())+H*le*(ve.getEndX()-ve.getStartX());le++}return $?y.getBoundingBox().getMinX():y.getBoundingBox().getMaxX()}static detectCodeword(y,E,O,$,H,K,le,ve){H=pn.adjustCodewordStartColumn(y,E,O,$,H,K);let Te=pn.getModuleBitCount(y,E,O,$,H,K);if(Te==null)return null;let Ze,ht=kt.sum(Te);if($)Ze=H+ht;else{for(let bt=0;bt<Te.length/2;bt++){let zt=Te[bt];Te[bt]=Te[Te.length-1-bt],Te[Te.length-1-bt]=zt}Ze=H,H=Ze-ht}if(!pn.checkCodewordSkew(ht,le,ve))return null;let _t=xr.getDecodedValue(Te),rn=vt.getCodeword(_t);return rn===-1?null:new us(H,Ze,pn.getCodewordBucketNumber(_t),rn)}static getModuleBitCount(y,E,O,$,H,K){let le=H,ve=new Int32Array(8),Te=0,Ze=$?1:-1,ht=$;for(;($?le<O:le>=E)&&Te<ve.length;)y.get(le,K)===ht?(ve[Te]++,le+=Ze):(Te++,ht=!ht);return Te===ve.length||le===($?O:E)&&Te===ve.length-1?ve:null}static getNumberOfECCodeWords(y){return 2<<y}static adjustCodewordStartColumn(y,E,O,$,H,K){let le=H,ve=$?-1:1;for(let Te=0;Te<2;Te++){for(;($?le>=E:le<O)&&$===y.get(le,K);){if(Math.abs(H-le)>pn.CODEWORD_SKEW_SIZE)return H;le+=ve}ve=-ve,$=!$}return le}static checkCodewordSkew(y,E,O){return E-pn.CODEWORD_SKEW_SIZE<=y&&y<=O+pn.CODEWORD_SKEW_SIZE}static decodeCodewords(y,E,O){if(y.length===0)throw L.getFormatInstance();let $=1<<E+1,H=pn.correctErrors(y,O,$);pn.verifyCodewordCount(y,$);let K=yt.decode(y,""+E);return K.setErrorsCorrected(H),K.setErasures(O.length),K}static correctErrors(y,E,O){if(E!=null&&E.length>O/2+pn.MAX_ERRORS||O<0||O>pn.MAX_EC_CODEWORDS)throw g.getChecksumInstance();return pn.errorCorrection.decode(y,O,E)}static verifyCodewordCount(y,E){if(y.length<4)throw L.getFormatInstance();let O=y[0];if(O>y.length)throw L.getFormatInstance();if(O===0)if(E<y.length)y[0]=y.length-E;else throw L.getFormatInstance()}static getBitCountForCodeword(y){let E=new Int32Array(8),O=0,$=E.length-1;for(;!((y&1)!==O&&(O=y&1,$--,$<0));)E[$]++,y>>=1;return E}static getCodewordBucketNumber(y){return y instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(y):this.getCodewordBucketNumber_number(y)}static getCodewordBucketNumber_number(y){return pn.getCodewordBucketNumber(pn.getBitCountForCodeword(y))}static getCodewordBucketNumber_Int32Array(y){return(y[0]-y[2]+y[4]-y[6]+9)%9}static toString(y){let E=new lr;for(let O=0;O<y.length;O++){E.format("Row %2d: ",O);for(let $=0;$<y[O].length;$++){let H=y[O][$];H.getValue().length===0?E.format("        ",null):E.format("%4d(%2d)",H.getValue()[0],H.getConfidence(H.getValue()[0]))}E.format("%n")}return E.toString()}}pn.CODEWORD_SKEW_SIZE=2,pn.MAX_ERRORS=3,pn.MAX_EC_CODEWORDS=512,pn.errorCorrection=new $t;class An{decode(y,E=null){let O=An.decode(y,E,!1);if(O==null||O.length===0||O[0]==null)throw Y.getNotFoundInstance();return O[0]}decodeMultiple(y,E=null){try{return An.decode(y,E,!0)}catch(O){throw O instanceof L||O instanceof g?Y.getNotFoundInstance():O}}static decode(y,E,O){const $=new Array,H=wn.detectMultiple(y,E,O);for(const K of H.getPoints()){const le=pn.decode(H.getBits(),K[4],K[5],K[6],K[7],An.getMinCodewordWidth(K),An.getMaxCodewordWidth(K)),ve=new ce(le.getText(),le.getRawBytes(),void 0,K,Ne.PDF_417);ve.putMetadata(je.ERROR_CORRECTION_LEVEL,le.getECLevel());const Te=le.getOther();Te!=null&&ve.putMetadata(je.PDF417_EXTRA_METADATA,Te),$.push(ve)}return $.map(K=>K)}static getMaxWidth(y,E){return y==null||E==null?0:Math.trunc(Math.abs(y.getX()-E.getX()))}static getMinWidth(y,E){return y==null||E==null?P.MAX_VALUE:Math.trunc(Math.abs(y.getX()-E.getX()))}static getMaxCodewordWidth(y){return Math.floor(Math.max(Math.max(An.getMaxWidth(y[0],y[4]),An.getMaxWidth(y[6],y[2])*vt.MODULES_IN_CODEWORD/vt.MODULES_IN_STOP_PATTERN),Math.max(An.getMaxWidth(y[1],y[5]),An.getMaxWidth(y[7],y[3])*vt.MODULES_IN_CODEWORD/vt.MODULES_IN_STOP_PATTERN)))}static getMinCodewordWidth(y){return Math.floor(Math.min(Math.min(An.getMinWidth(y[0],y[4]),An.getMinWidth(y[6],y[2])*vt.MODULES_IN_CODEWORD/vt.MODULES_IN_STOP_PATTERN),Math.min(An.getMinWidth(y[1],y[5]),An.getMinWidth(y[7],y[3])*vt.MODULES_IN_CODEWORD/vt.MODULES_IN_STOP_PATTERN)))}reset(){}}class or extends u{}or.kind="ReaderException";class _r{constructor(y,E){this.verbose=y===!0,E&&this.setHints(E)}decode(y,E){return E&&this.setHints(E),this.decodeInternal(y)}decodeWithState(y){return(this.readers===null||this.readers===void 0)&&this.setHints(null),this.decodeInternal(y)}setHints(y){this.hints=y;const E=!r(y)&&y.get(U.TRY_HARDER)===!0,O=r(y)?null:y.get(U.POSSIBLE_FORMATS),$=new Array;if(!r(O)){const H=O.some(K=>K===Ne.UPC_A||K===Ne.UPC_E||K===Ne.EAN_13||K===Ne.EAN_8||K===Ne.CODABAR||K===Ne.CODE_39||K===Ne.CODE_93||K===Ne.CODE_128||K===Ne.ITF||K===Ne.RSS_14||K===Ne.RSS_EXPANDED);H&&!E&&$.push(new k(y,this.verbose)),O.includes(Ne.QR_CODE)&&$.push(new Zt),O.includes(Ne.DATA_MATRIX)&&$.push(new Fe),O.includes(Ne.AZTEC)&&$.push(new en),O.includes(Ne.PDF_417)&&$.push(new An),H&&E&&$.push(new k(y,this.verbose))}$.length===0&&(E||$.push(new k(y,this.verbose)),$.push(new Zt),$.push(new Fe),$.push(new en),$.push(new An),E&&$.push(new k(y,this.verbose))),this.readers=$}reset(){if(this.readers!==null)for(const y of this.readers)y.reset()}decodeInternal(y){if(this.readers===null)throw new or("No readers where selected, nothing can be read.");for(const E of this.readers)try{return E.decode(y,this.hints)}catch(O){if(O instanceof or)continue}throw new Y("No MultiFormat Readers were able to detect the code.")}}class wr extends Ae{constructor(y=null,E=500){const O=new _r;O.setHints(y),super(O,E)}decodeBitmap(y){return this.reader.decodeWithState(y)}}class pr extends Ae{constructor(y=500){super(new An,y)}}class es extends Ae{constructor(y=500){super(new Zt,y)}}var ts;(function(ut){ut[ut.ERROR_CORRECTION=0]="ERROR_CORRECTION",ut[ut.CHARACTER_SET=1]="CHARACTER_SET",ut[ut.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",ut[ut.MIN_SIZE=3]="MIN_SIZE",ut[ut.MAX_SIZE=4]="MAX_SIZE",ut[ut.MARGIN=5]="MARGIN",ut[ut.PDF417_COMPACT=6]="PDF417_COMPACT",ut[ut.PDF417_COMPACTION=7]="PDF417_COMPACTION",ut[ut.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",ut[ut.AZTEC_LAYERS=9]="AZTEC_LAYERS",ut[ut.QR_VERSION=10]="QR_VERSION"})(ts||(ts={}));var Lr=ts;class Qr{constructor(y){this.field=y,this.cachedGenerators=[],this.cachedGenerators.push(new Qe(y,Int32Array.from([1])))}buildGenerator(y){const E=this.cachedGenerators;if(y>=E.length){let O=E[E.length-1];const $=this.field;for(let H=E.length;H<=y;H++){const K=O.multiply(new Qe($,Int32Array.from([1,$.exp(H-1+$.getGeneratorBase())])));E.push(K),O=K}}return E[y]}encode(y,E){if(E===0)throw new f("No error correction bytes");const O=y.length-E;if(O<=0)throw new f("No data bytes provided");const $=this.buildGenerator(E),H=new Int32Array(O);w.arraycopy(y,0,H,0,O);let K=new Qe(this.field,H);K=K.multiplyByMonomial(E,1);const ve=K.divide($)[1].getCoefficients(),Te=E-ve.length;for(let Ze=0;Ze<Te;Ze++)y[O+Ze]=0;w.arraycopy(ve,0,y,O+Te,ve.length)}}class Ir{constructor(){}static applyMaskPenaltyRule1(y){return Ir.applyMaskPenaltyRule1Internal(y,!0)+Ir.applyMaskPenaltyRule1Internal(y,!1)}static applyMaskPenaltyRule2(y){let E=0;const O=y.getArray(),$=y.getWidth(),H=y.getHeight();for(let K=0;K<H-1;K++){const le=O[K];for(let ve=0;ve<$-1;ve++){const Te=le[ve];Te===le[ve+1]&&Te===O[K+1][ve]&&Te===O[K+1][ve+1]&&E++}}return Ir.N2*E}static applyMaskPenaltyRule3(y){let E=0;const O=y.getArray(),$=y.getWidth(),H=y.getHeight();for(let K=0;K<H;K++)for(let le=0;le<$;le++){const ve=O[K];le+6<$&&ve[le]===1&&ve[le+1]===0&&ve[le+2]===1&&ve[le+3]===1&&ve[le+4]===1&&ve[le+5]===0&&ve[le+6]===1&&(Ir.isWhiteHorizontal(ve,le-4,le)||Ir.isWhiteHorizontal(ve,le+7,le+11))&&E++,K+6<H&&O[K][le]===1&&O[K+1][le]===0&&O[K+2][le]===1&&O[K+3][le]===1&&O[K+4][le]===1&&O[K+5][le]===0&&O[K+6][le]===1&&(Ir.isWhiteVertical(O,le,K-4,K)||Ir.isWhiteVertical(O,le,K+7,K+11))&&E++}return E*Ir.N3}static isWhiteHorizontal(y,E,O){E=Math.max(E,0),O=Math.min(O,y.length);for(let $=E;$<O;$++)if(y[$]===1)return!1;return!0}static isWhiteVertical(y,E,O,$){O=Math.max(O,0),$=Math.min($,y.length);for(let H=O;H<$;H++)if(y[H][E]===1)return!1;return!0}static applyMaskPenaltyRule4(y){let E=0;const O=y.getArray(),$=y.getWidth(),H=y.getHeight();for(let ve=0;ve<H;ve++){const Te=O[ve];for(let Ze=0;Ze<$;Ze++)Te[Ze]===1&&E++}const K=y.getHeight()*y.getWidth();return Math.floor(Math.abs(E*2-K)*10/K)*Ir.N4}static getDataMaskBit(y,E,O){let $,H;switch(y){case 0:$=O+E&1;break;case 1:$=O&1;break;case 2:$=E%3;break;case 3:$=(O+E)%3;break;case 4:$=Math.floor(O/2)+Math.floor(E/3)&1;break;case 5:H=O*E,$=(H&1)+H%3;break;case 6:H=O*E,$=(H&1)+H%3&1;break;case 7:H=O*E,$=H%3+(O+E&1)&1;break;default:throw new f("Invalid mask pattern: "+y)}return $===0}static applyMaskPenaltyRule1Internal(y,E){let O=0;const $=E?y.getHeight():y.getWidth(),H=E?y.getWidth():y.getHeight(),K=y.getArray();for(let le=0;le<$;le++){let ve=0,Te=-1;for(let Ze=0;Ze<H;Ze++){const ht=E?K[le][Ze]:K[Ze][le];ht===Te?ve++:(ve>=5&&(O+=Ir.N1+(ve-5)),ve=1,Te=ht)}ve>=5&&(O+=Ir.N1+(ve-5))}return O}}Ir.N1=3,Ir.N2=3,Ir.N3=40,Ir.N4=10;class Ss{constructor(y,E){this.width=y,this.height=E;const O=new Array(E);for(let $=0;$!==E;$++)O[$]=new Uint8Array(y);this.bytes=O}getHeight(){return this.height}getWidth(){return this.width}get(y,E){return this.bytes[E][y]}getArray(){return this.bytes}setNumber(y,E,O){this.bytes[E][y]=O}setBoolean(y,E,O){this.bytes[E][y]=O?1:0}clear(y){for(const E of this.bytes)I.fill(E,y)}equals(y){if(!(y instanceof Ss))return!1;const E=y;if(this.width!==E.width||this.height!==E.height)return!1;for(let O=0,$=this.height;O<$;++O){const H=this.bytes[O],K=E.bytes[O];for(let le=0,ve=this.width;le<ve;++le)if(H[le]!==K[le])return!1}return!0}toString(){const y=new re;for(let E=0,O=this.height;E<O;++E){const $=this.bytes[E];for(let H=0,K=this.width;H<K;++H)switch($[H]){case 0:y.append(" 0");break;case 1:y.append(" 1");break;default:y.append("  ");break}y.append(`
`)}return y.toString()}}class hi{constructor(){this.maskPattern=-1}getMode(){return this.mode}getECLevel(){return this.ecLevel}getVersion(){return this.version}getMaskPattern(){return this.maskPattern}getMatrix(){return this.matrix}toString(){const y=new re;return y.append(`<<
`),y.append(" mode: "),y.append(this.mode?this.mode.toString():"null"),y.append(`
 ecLevel: `),y.append(this.ecLevel?this.ecLevel.toString():"null"),y.append(`
 version: `),y.append(this.version?this.version.toString():"null"),y.append(`
 maskPattern: `),y.append(this.maskPattern.toString()),this.matrix?(y.append(`
 matrix:
`),y.append(this.matrix.toString())):y.append(`
 matrix: null
`),y.append(`>>
`),y.toString()}setMode(y){this.mode=y}setECLevel(y){this.ecLevel=y}setVersion(y){this.version=y}setMaskPattern(y){this.maskPattern=y}setMatrix(y){this.matrix=y}static isValidMaskPattern(y){return y>=0&&y<hi.NUM_MASK_PATTERNS}}hi.NUM_MASK_PATTERNS=8;class li extends u{}li.kind="WriterException";class Pr{constructor(){}static clearMatrix(y){y.clear(255)}static buildMatrix(y,E,O,$,H){Pr.clearMatrix(H),Pr.embedBasicPatterns(O,H),Pr.embedTypeInfo(E,$,H),Pr.maybeEmbedVersionInfo(O,H),Pr.embedDataBits(y,$,H)}static embedBasicPatterns(y,E){Pr.embedPositionDetectionPatternsAndSeparators(E),Pr.embedDarkDotAtLeftBottomCorner(E),Pr.maybeEmbedPositionAdjustmentPatterns(y,E),Pr.embedTimingPatterns(E)}static embedTypeInfo(y,E,O){const $=new R;Pr.makeTypeInfoBits(y,E,$);for(let H=0,K=$.getSize();H<K;++H){const le=$.get($.getSize()-1-H),ve=Pr.TYPE_INFO_COORDINATES[H],Te=ve[0],Ze=ve[1];if(O.setBoolean(Te,Ze,le),H<8){const ht=O.getWidth()-H-1;O.setBoolean(ht,8,le)}else{const _t=O.getHeight()-7+(H-8);O.setBoolean(8,_t,le)}}}static maybeEmbedVersionInfo(y,E){if(y.getVersionNumber()<7)return;const O=new R;Pr.makeVersionInfoBits(y,O);let $=6*3-1;for(let H=0;H<6;++H)for(let K=0;K<3;++K){const le=O.get($);$--,E.setBoolean(H,E.getHeight()-11+K,le),E.setBoolean(E.getHeight()-11+K,H,le)}}static embedDataBits(y,E,O){let $=0,H=-1,K=O.getWidth()-1,le=O.getHeight()-1;for(;K>0;){for(K===6&&(K-=1);le>=0&&le<O.getHeight();){for(let ve=0;ve<2;++ve){const Te=K-ve;if(!Pr.isEmpty(O.get(Te,le)))continue;let Ze;$<y.getSize()?(Ze=y.get($),++$):Ze=!1,E!==255&&Ir.getDataMaskBit(E,Te,le)&&(Ze=!Ze),O.setBoolean(Te,le,Ze)}le+=H}H=-H,le+=H,K-=2}if($!==y.getSize())throw new li("Not all bits consumed: "+$+"/"+y.getSize())}static findMSBSet(y){return 32-P.numberOfLeadingZeros(y)}static calculateBCHCode(y,E){if(E===0)throw new f("0 polynomial");const O=Pr.findMSBSet(E);for(y<<=O-1;Pr.findMSBSet(y)>=O;)y^=E<<Pr.findMSBSet(y)-O;return y}static makeTypeInfoBits(y,E,O){if(!hi.isValidMaskPattern(E))throw new li("Invalid mask pattern");const $=y.getBits()<<3|E;O.appendBits($,5);const H=Pr.calculateBCHCode($,Pr.TYPE_INFO_POLY);O.appendBits(H,10);const K=new R;if(K.appendBits(Pr.TYPE_INFO_MASK_PATTERN,15),O.xor(K),O.getSize()!==15)throw new li("should not happen but we got: "+O.getSize())}static makeVersionInfoBits(y,E){E.appendBits(y.getVersionNumber(),6);const O=Pr.calculateBCHCode(y.getVersionNumber(),Pr.VERSION_INFO_POLY);if(E.appendBits(O,12),E.getSize()!==18)throw new li("should not happen but we got: "+E.getSize())}static isEmpty(y){return y===255}static embedTimingPatterns(y){for(let E=8;E<y.getWidth()-8;++E){const O=(E+1)%2;Pr.isEmpty(y.get(E,6))&&y.setNumber(E,6,O),Pr.isEmpty(y.get(6,E))&&y.setNumber(6,E,O)}}static embedDarkDotAtLeftBottomCorner(y){if(y.get(8,y.getHeight()-8)===0)throw new li;y.setNumber(8,y.getHeight()-8,1)}static embedHorizontalSeparationPattern(y,E,O){for(let $=0;$<8;++$){if(!Pr.isEmpty(O.get(y+$,E)))throw new li;O.setNumber(y+$,E,0)}}static embedVerticalSeparationPattern(y,E,O){for(let $=0;$<7;++$){if(!Pr.isEmpty(O.get(y,E+$)))throw new li;O.setNumber(y,E+$,0)}}static embedPositionAdjustmentPattern(y,E,O){for(let $=0;$<5;++$){const H=Pr.POSITION_ADJUSTMENT_PATTERN[$];for(let K=0;K<5;++K)O.setNumber(y+K,E+$,H[K])}}static embedPositionDetectionPattern(y,E,O){for(let $=0;$<7;++$){const H=Pr.POSITION_DETECTION_PATTERN[$];for(let K=0;K<7;++K)O.setNumber(y+K,E+$,H[K])}}static embedPositionDetectionPatternsAndSeparators(y){const E=Pr.POSITION_DETECTION_PATTERN[0].length;Pr.embedPositionDetectionPattern(0,0,y),Pr.embedPositionDetectionPattern(y.getWidth()-E,0,y),Pr.embedPositionDetectionPattern(0,y.getWidth()-E,y);const O=8;Pr.embedHorizontalSeparationPattern(0,O-1,y),Pr.embedHorizontalSeparationPattern(y.getWidth()-O,O-1,y),Pr.embedHorizontalSeparationPattern(0,y.getWidth()-O,y);const $=7;Pr.embedVerticalSeparationPattern($,0,y),Pr.embedVerticalSeparationPattern(y.getHeight()-$-1,0,y),Pr.embedVerticalSeparationPattern($,y.getHeight()-$,y)}static maybeEmbedPositionAdjustmentPatterns(y,E){if(y.getVersionNumber()<2)return;const O=y.getVersionNumber()-1,$=Pr.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[O];for(let H=0,K=$.length;H!==K;H++){const le=$[H];if(le>=0)for(let ve=0;ve!==K;ve++){const Te=$[ve];Te>=0&&Pr.isEmpty(E.get(Te,le))&&Pr.embedPositionAdjustmentPattern(Te-2,le-2,E)}}}}Pr.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),Pr.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),Pr.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),Pr.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),Pr.VERSION_INFO_POLY=7973,Pr.TYPE_INFO_POLY=1335,Pr.TYPE_INFO_MASK_PATTERN=21522;class En{constructor(y,E){this.dataBytes=y,this.errorCorrectionBytes=E}getDataBytes(){return this.dataBytes}getErrorCorrectionBytes(){return this.errorCorrectionBytes}}class Rn{constructor(){}static calculateMaskPenalty(y){return Ir.applyMaskPenaltyRule1(y)+Ir.applyMaskPenaltyRule2(y)+Ir.applyMaskPenaltyRule3(y)+Ir.applyMaskPenaltyRule4(y)}static encode(y,E,O=null){let $=Rn.DEFAULT_BYTE_MODE_ENCODING;const H=O!==null&&O.get(Lr.CHARACTER_SET)!==void 0;H&&($=O.get(Lr.CHARACTER_SET).toString());const K=this.chooseMode(y,$),le=new R;if(K===We.BYTE&&(H||Rn.DEFAULT_BYTE_MODE_ENCODING!==$)){const Cr=X.getCharacterSetECIByName($);Cr!==void 0&&this.appendECI(Cr,le)}this.appendModeInfo(K,le);const ve=new R;this.appendBytes(y,K,ve,$);let Te;if(O!==null&&O.get(Lr.QR_VERSION)!==void 0){const Cr=Number.parseInt(O.get(Lr.QR_VERSION).toString(),10);Te=nt.getVersionForNumber(Cr);const Ar=this.calculateBitsNeeded(K,le,ve,Te);if(!this.willFit(Ar,Te,E))throw new li("Data too big for requested version")}else Te=this.recommendVersion(E,K,le,ve);const Ze=new R;Ze.appendBitArray(le);const ht=K===We.BYTE?ve.getSizeInBytes():y.length;this.appendLengthInfo(ht,Te,K,Ze),Ze.appendBitArray(ve);const _t=Te.getECBlocksForLevel(E),rn=Te.getTotalCodewords()-_t.getTotalECCodewords();this.terminateBits(rn,Ze);const bt=this.interleaveWithECBytes(Ze,Te.getTotalCodewords(),rn,_t.getNumBlocks()),zt=new hi;zt.setECLevel(E),zt.setMode(K),zt.setVersion(Te);const qt=Te.getDimensionForVersion(),Tn=new Ss(qt,qt),ir=this.chooseMaskPattern(bt,E,Te,Tn);return zt.setMaskPattern(ir),Pr.buildMatrix(bt,E,Te,ir,Tn),zt.setMatrix(Tn),zt}static recommendVersion(y,E,O,$){const H=this.calculateBitsNeeded(E,O,$,nt.getVersionForNumber(1)),K=this.chooseVersion(H,y),le=this.calculateBitsNeeded(E,O,$,K);return this.chooseVersion(le,y)}static calculateBitsNeeded(y,E,O,$){return E.getSize()+y.getCharacterCountBits($)+O.getSize()}static getAlphanumericCode(y){return y<Rn.ALPHANUMERIC_TABLE.length?Rn.ALPHANUMERIC_TABLE[y]:-1}static chooseMode(y,E=null){if(X.SJIS.getName()===E&&this.isOnlyDoubleByteKanji(y))return We.KANJI;let O=!1,$=!1;for(let H=0,K=y.length;H<K;++H){const le=y.charAt(H);if(Rn.isDigit(le))O=!0;else if(this.getAlphanumericCode(le.charCodeAt(0))!==-1)$=!0;else return We.BYTE}return $?We.ALPHANUMERIC:O?We.NUMERIC:We.BYTE}static isOnlyDoubleByteKanji(y){let E;try{E=J.encode(y,X.SJIS)}catch{return!1}const O=E.length;if(O%2!==0)return!1;for(let $=0;$<O;$+=2){const H=E[$]&255;if((H<129||H>159)&&(H<224||H>235))return!1}return!0}static chooseMaskPattern(y,E,O,$){let H=Number.MAX_SAFE_INTEGER,K=-1;for(let le=0;le<hi.NUM_MASK_PATTERNS;le++){Pr.buildMatrix(y,E,O,le,$);let ve=this.calculateMaskPenalty($);ve<H&&(H=ve,K=le)}return K}static chooseVersion(y,E){for(let O=1;O<=40;O++){const $=nt.getVersionForNumber(O);if(Rn.willFit(y,$,E))return $}throw new li("Data too big")}static willFit(y,E,O){const $=E.getTotalCodewords(),K=E.getECBlocksForLevel(O).getTotalECCodewords(),le=$-K,ve=(y+7)/8;return le>=ve}static terminateBits(y,E){const O=y*8;if(E.getSize()>O)throw new li("data bits cannot fit in the QR Code"+E.getSize()+" > "+O);for(let K=0;K<4&&E.getSize()<O;++K)E.appendBit(!1);const $=E.getSize()&7;if($>0)for(let K=$;K<8;K++)E.appendBit(!1);const H=y-E.getSizeInBytes();for(let K=0;K<H;++K)E.appendBits(K&1?17:236,8);if(E.getSize()!==O)throw new li("Bits size does not equal capacity")}static getNumDataBytesAndNumECBytesForBlockID(y,E,O,$,H,K){if($>=O)throw new li("Block ID too large");const le=y%O,ve=O-le,Te=Math.floor(y/O),Ze=Te+1,ht=Math.floor(E/O),_t=ht+1,rn=Te-ht,bt=Ze-_t;if(rn!==bt)throw new li("EC bytes mismatch");if(O!==ve+le)throw new li("RS blocks mismatch");if(y!==(ht+rn)*ve+(_t+bt)*le)throw new li("Total bytes mismatch");$<ve?(H[0]=ht,K[0]=rn):(H[0]=_t,K[0]=bt)}static interleaveWithECBytes(y,E,O,$){if(y.getSizeInBytes()!==O)throw new li("Number of bits and data bytes does not match");let H=0,K=0,le=0;const ve=new Array;for(let Ze=0;Ze<$;++Ze){const ht=new Int32Array(1),_t=new Int32Array(1);Rn.getNumDataBytesAndNumECBytesForBlockID(E,O,$,Ze,ht,_t);const rn=ht[0],bt=new Uint8Array(rn);y.toBytes(8*H,bt,0,rn);const zt=Rn.generateECBytes(bt,_t[0]);ve.push(new En(bt,zt)),K=Math.max(K,rn),le=Math.max(le,zt.length),H+=ht[0]}if(O!==H)throw new li("Data bytes does not match offset");const Te=new R;for(let Ze=0;Ze<K;++Ze)for(const ht of ve){const _t=ht.getDataBytes();Ze<_t.length&&Te.appendBits(_t[Ze],8)}for(let Ze=0;Ze<le;++Ze)for(const ht of ve){const _t=ht.getErrorCorrectionBytes();Ze<_t.length&&Te.appendBits(_t[Ze],8)}if(E!==Te.getSizeInBytes())throw new li("Interleaving error: "+E+" and "+Te.getSizeInBytes()+" differ.");return Te}static generateECBytes(y,E){const O=y.length,$=new Int32Array(O+E);for(let K=0;K<O;K++)$[K]=y[K]&255;new Qr(it.QR_CODE_FIELD_256).encode($,E);const H=new Uint8Array(E);for(let K=0;K<E;K++)H[K]=$[O+K];return H}static appendModeInfo(y,E){E.appendBits(y.getBits(),4)}static appendLengthInfo(y,E,O,$){const H=O.getCharacterCountBits(E);if(y>=1<<H)throw new li(y+" is bigger than "+((1<<H)-1));$.appendBits(y,H)}static appendBytes(y,E,O,$){switch(E){case We.NUMERIC:Rn.appendNumericBytes(y,O);break;case We.ALPHANUMERIC:Rn.appendAlphanumericBytes(y,O);break;case We.BYTE:Rn.append8BitBytes(y,O,$);break;case We.KANJI:Rn.appendKanjiBytes(y,O);break;default:throw new li("Invalid mode: "+E)}}static getDigit(y){return y.charCodeAt(0)-48}static isDigit(y){const E=Rn.getDigit(y);return E>=0&&E<=9}static appendNumericBytes(y,E){const O=y.length;let $=0;for(;$<O;){const H=Rn.getDigit(y.charAt($));if($+2<O){const K=Rn.getDigit(y.charAt($+1)),le=Rn.getDigit(y.charAt($+2));E.appendBits(H*100+K*10+le,10),$+=3}else if($+1<O){const K=Rn.getDigit(y.charAt($+1));E.appendBits(H*10+K,7),$+=2}else E.appendBits(H,4),$++}}static appendAlphanumericBytes(y,E){const O=y.length;let $=0;for(;$<O;){const H=Rn.getAlphanumericCode(y.charCodeAt($));if(H===-1)throw new li;if($+1<O){const K=Rn.getAlphanumericCode(y.charCodeAt($+1));if(K===-1)throw new li;E.appendBits(H*45+K,11),$+=2}else E.appendBits(H,6),$++}}static append8BitBytes(y,E,O){let $;try{$=J.encode(y,O)}catch(H){throw new li(H)}for(let H=0,K=$.length;H!==K;H++){const le=$[H];E.appendBits(le,8)}}static appendKanjiBytes(y,E){let O;try{O=J.encode(y,X.SJIS)}catch(H){throw new li(H)}const $=O.length;for(let H=0;H<$;H+=2){const K=O[H]&255,le=O[H+1]&255,ve=K<<8&4294967295|le;let Te=-1;if(ve>=33088&&ve<=40956?Te=ve-33088:ve>=57408&&ve<=60351&&(Te=ve-49472),Te===-1)throw new li("Invalid byte sequence");const Ze=(Te>>8)*192+(Te&255);E.appendBits(Ze,13)}}static appendECI(y,E){E.appendBits(We.ECI.getBits(),4),E.appendBits(y.getValue(),8)}}Rn.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),Rn.DEFAULT_BYTE_MODE_ENCODING=X.UTF8.getName();class Dn{write(y,E,O,$=null){if(y.length===0)throw new f("Found empty contents");if(E<0||O<0)throw new f("Requested dimensions are too small: "+E+"x"+O);let H=Ce.L,K=Dn.QUIET_ZONE_SIZE;$!==null&&($.get(Lr.ERROR_CORRECTION)!==void 0&&(H=Ce.fromString($.get(Lr.ERROR_CORRECTION).toString())),$.get(Lr.MARGIN)!==void 0&&(K=Number.parseInt($.get(Lr.MARGIN).toString(),10)));const le=Rn.encode(y,H,$);return this.renderResult(le,E,O,K)}writeToDom(y,E,O,$,H=null){typeof y=="string"&&(y=document.querySelector(y));const K=this.write(E,O,$,H);y&&y.appendChild(K)}renderResult(y,E,O,$){const H=y.getMatrix();if(H===null)throw new at;const K=H.getWidth(),le=H.getHeight(),ve=K+$*2,Te=le+$*2,Ze=Math.max(E,ve),ht=Math.max(O,Te),_t=Math.min(Math.floor(Ze/ve),Math.floor(ht/Te)),rn=Math.floor((Ze-K*_t)/2),bt=Math.floor((ht-le*_t)/2),zt=this.createSVGElement(Ze,ht);for(let qt=0,Tn=bt;qt<le;qt++,Tn+=_t)for(let ir=0,Cr=rn;ir<K;ir++,Cr+=_t)if(H.get(ir,qt)===1){const Ar=this.createSvgRectElement(Cr,Tn,_t,_t);zt.appendChild(Ar)}return zt}createSVGElement(y,E){const O=document.createElementNS(Dn.SVG_NS,"svg");return O.setAttributeNS(null,"height",y.toString()),O.setAttributeNS(null,"width",E.toString()),O}createSvgRectElement(y,E,O,$){const H=document.createElementNS(Dn.SVG_NS,"rect");return H.setAttributeNS(null,"x",y.toString()),H.setAttributeNS(null,"y",E.toString()),H.setAttributeNS(null,"height",O.toString()),H.setAttributeNS(null,"width",$.toString()),H.setAttributeNS(null,"fill","#000000"),H}}Dn.QUIET_ZONE_SIZE=4,Dn.SVG_NS="http://www.w3.org/2000/svg";class Nr{encode(y,E,O,$,H){if(y.length===0)throw new f("Found empty contents");if(E!==Ne.QR_CODE)throw new f("Can only encode QR_CODE, but got "+E);if(O<0||$<0)throw new f(`Requested dimensions are too small: ${O}x${$}`);let K=Ce.L,le=Nr.QUIET_ZONE_SIZE;H!==null&&(H.get(Lr.ERROR_CORRECTION)!==void 0&&(K=Ce.fromString(H.get(Lr.ERROR_CORRECTION).toString())),H.get(Lr.MARGIN)!==void 0&&(le=Number.parseInt(H.get(Lr.MARGIN).toString(),10)));const ve=Rn.encode(y,K,H);return Nr.renderResult(ve,O,$,le)}static renderResult(y,E,O,$){const H=y.getMatrix();if(H===null)throw new at;const K=H.getWidth(),le=H.getHeight(),ve=K+$*2,Te=le+$*2,Ze=Math.max(E,ve),ht=Math.max(O,Te),_t=Math.min(Math.floor(Ze/ve),Math.floor(ht/Te)),rn=Math.floor((Ze-K*_t)/2),bt=Math.floor((ht-le*_t)/2),zt=new he(Ze,ht);for(let qt=0,Tn=bt;qt<le;qt++,Tn+=_t)for(let ir=0,Cr=rn;ir<K;ir++,Cr+=_t)H.get(ir,qt)===1&&zt.setRegion(Cr,Tn,_t,_t);return zt}}Nr.QUIET_ZONE_SIZE=4;class Mr{encode(y,E,O,$,H){let K;switch(E){case Ne.QR_CODE:K=new Nr;break;default:throw new f("No encoder available for format "+E)}return K.encode(y,E,O,$,H)}}class cr extends G{constructor(y,E,O,$,H,K,le,ve){if(super(K,le),this.yuvData=y,this.dataWidth=E,this.dataHeight=O,this.left=$,this.top=H,$+K>E||H+le>O)throw new f("Crop rectangle does not fit within image data.");ve&&this.reverseHorizontal(K,le)}getRow(y,E){if(y<0||y>=this.getHeight())throw new f("Requested row is outside the image: "+y);const O=this.getWidth();(E==null||E.length<O)&&(E=new Uint8ClampedArray(O));const $=(y+this.top)*this.dataWidth+this.left;return w.arraycopy(this.yuvData,$,E,0,O),E}getMatrix(){const y=this.getWidth(),E=this.getHeight();if(y===this.dataWidth&&E===this.dataHeight)return this.yuvData;const O=y*E,$=new Uint8ClampedArray(O);let H=this.top*this.dataWidth+this.left;if(y===this.dataWidth)return w.arraycopy(this.yuvData,H,$,0,O),$;for(let K=0;K<E;K++){const le=K*y;w.arraycopy(this.yuvData,H,$,le,y),H+=this.dataWidth}return $}isCropSupported(){return!0}crop(y,E,O,$){return new cr(this.yuvData,this.dataWidth,this.dataHeight,this.left+y,this.top+E,O,$,!1)}renderThumbnail(){const y=this.getWidth()/cr.THUMBNAIL_SCALE_FACTOR,E=this.getHeight()/cr.THUMBNAIL_SCALE_FACTOR,O=new Int32Array(y*E),$=this.yuvData;let H=this.top*this.dataWidth+this.left;for(let K=0;K<E;K++){const le=K*y;for(let ve=0;ve<y;ve++){const Te=$[H+ve*cr.THUMBNAIL_SCALE_FACTOR]&255;O[le+ve]=4278190080|Te*65793}H+=this.dataWidth*cr.THUMBNAIL_SCALE_FACTOR}return O}getThumbnailWidth(){return this.getWidth()/cr.THUMBNAIL_SCALE_FACTOR}getThumbnailHeight(){return this.getHeight()/cr.THUMBNAIL_SCALE_FACTOR}reverseHorizontal(y,E){const O=this.yuvData;for(let $=0,H=this.top*this.dataWidth+this.left;$<E;$++,H+=this.dataWidth){const K=H+y/2;for(let le=H,ve=H+y-1;le<K;le++,ve--){const Te=O[le];O[le]=O[ve],O[ve]=Te}}}invert(){return new V(this)}}cr.THUMBNAIL_SCALE_FACTOR=2;class bs extends G{constructor(y,E,O,$,H,K,le){if(super(E,O),this.dataWidth=$,this.dataHeight=H,this.left=K,this.top=le,y.BYTES_PER_ELEMENT===4){const ve=E*O,Te=new Uint8ClampedArray(ve);for(let Ze=0;Ze<ve;Ze++){const ht=y[Ze],_t=ht>>16&255,rn=ht>>7&510,bt=ht&255;Te[Ze]=(_t+rn+bt)/4&255}this.luminances=Te}else this.luminances=y;if($===void 0&&(this.dataWidth=E),H===void 0&&(this.dataHeight=O),K===void 0&&(this.left=0),le===void 0&&(this.top=0),this.left+E>this.dataWidth||this.top+O>this.dataHeight)throw new f("Crop rectangle does not fit within image data.")}getRow(y,E){if(y<0||y>=this.getHeight())throw new f("Requested row is outside the image: "+y);const O=this.getWidth();(E==null||E.length<O)&&(E=new Uint8ClampedArray(O));const $=(y+this.top)*this.dataWidth+this.left;return w.arraycopy(this.luminances,$,E,0,O),E}getMatrix(){const y=this.getWidth(),E=this.getHeight();if(y===this.dataWidth&&E===this.dataHeight)return this.luminances;const O=y*E,$=new Uint8ClampedArray(O);let H=this.top*this.dataWidth+this.left;if(y===this.dataWidth)return w.arraycopy(this.luminances,H,$,0,O),$;for(let K=0;K<E;K++){const le=K*y;w.arraycopy(this.luminances,H,$,le,y),H+=this.dataWidth}return $}isCropSupported(){return!0}crop(y,E,O,$){return new bs(this.luminances,O,$,this.dataWidth,this.dataHeight,this.left+y,this.top+E)}invert(){return new V(this)}}class Kr extends X{static forName(y){return this.getCharacterSetECIByName(y)}}class Ms{}Ms.ISO_8859_1=X.ISO8859_1;class ei{isCompact(){return this.compact}setCompact(y){this.compact=y}getSize(){return this.size}setSize(y){this.size=y}getLayers(){return this.layers}setLayers(y){this.layers=y}getCodeWords(){return this.codeWords}setCodeWords(y){this.codeWords=y}getMatrix(){return this.matrix}setMatrix(y){this.matrix=y}}class Tt{static singletonList(y){return[y]}static min(y,E){return y.sort(E)[0]}}class sr{constructor(y){this.previous=y}getPrevious(){return this.previous}}class mr extends sr{constructor(y,E,O){super(y),this.value=E,this.bitCount=O}appendTo(y,E){y.appendBits(this.value,this.bitCount)}add(y,E){return new mr(this,y,E)}addBinaryShift(y,E){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new mr(this,y,E)}toString(){let y=this.value&(1<<this.bitCount)-1;return y|=1<<this.bitCount,"<"+P.toBinaryString(y|1<<this.bitCount).substring(1)+">"}}class Vr extends mr{constructor(y,E,O){super(y,0,0),this.binaryShiftStart=E,this.binaryShiftByteCount=O}appendTo(y,E){for(let O=0;O<this.binaryShiftByteCount;O++)(O===0||O===31&&this.binaryShiftByteCount<=62)&&(y.appendBits(31,5),this.binaryShiftByteCount>62?y.appendBits(this.binaryShiftByteCount-31,16):O===0?y.appendBits(Math.min(this.binaryShiftByteCount,31),5):y.appendBits(this.binaryShiftByteCount-31,5)),y.appendBits(E[this.binaryShiftStart+O],8)}addBinaryShift(y,E){return new Vr(this,y,E)}toString(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}function as(ut,y,E){return new Vr(ut,y,E)}function ns(ut,y,E){return new mr(ut,y,E)}const ys=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],Ns=0,ca=1,Hs=2,vs=3,sc=4,j5=new mr(null,0,0),E1=[Int32Array.from([0,(5<<16)+28,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(9<<16)+480+14,0,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(4<<16)+14,(9<<16)+448+28,0,(9<<16)+448+29,932798]),Int32Array.from([(5<<16)+29,(5<<16)+28,656318,0,(5<<16)+30]),Int32Array.from([(5<<16)+31,656380,656382,656381,0])];function E5(ut){for(let y of ut)I.fill(y,-1);return ut[Ns][sc]=0,ut[ca][sc]=0,ut[ca][Ns]=28,ut[vs][sc]=0,ut[Hs][sc]=0,ut[Hs][Ns]=15,ut}const y2=E5(I.createInt32Array(6,6));class Bl{constructor(y,E,O,$){this.token=y,this.mode=E,this.binaryShiftByteCount=O,this.bitCount=$}getMode(){return this.mode}getToken(){return this.token}getBinaryShiftByteCount(){return this.binaryShiftByteCount}getBitCount(){return this.bitCount}latchAndAppend(y,E){let O=this.bitCount,$=this.token;if(y!==this.mode){let K=E1[this.mode][y];$=ns($,K&65535,K>>16),O+=K>>16}let H=y===Hs?4:5;return $=ns($,E,H),new Bl($,y,0,O+H)}shiftAndAppend(y,E){let O=this.token,$=this.mode===Hs?4:5;return O=ns(O,y2[this.mode][y],$),O=ns(O,E,5),new Bl(O,this.mode,0,this.bitCount+$+5)}addBinaryShiftChar(y){let E=this.token,O=this.mode,$=this.bitCount;if(this.mode===sc||this.mode===Hs){let le=E1[O][Ns];E=ns(E,le&65535,le>>16),$+=le>>16,O=Ns}let H=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,K=new Bl(E,O,this.binaryShiftByteCount+1,$+H);return K.binaryShiftByteCount===2078&&(K=K.endBinaryShift(y+1)),K}endBinaryShift(y){if(this.binaryShiftByteCount===0)return this;let E=this.token;return E=as(E,y-this.binaryShiftByteCount,this.binaryShiftByteCount),new Bl(E,this.mode,0,this.bitCount)}isBetterThanOrEqualTo(y){let E=this.bitCount+(E1[this.mode][y.mode]>>16);return this.binaryShiftByteCount<y.binaryShiftByteCount?E+=Bl.calculateBinaryShiftCost(y)-Bl.calculateBinaryShiftCost(this):this.binaryShiftByteCount>y.binaryShiftByteCount&&y.binaryShiftByteCount>0&&(E+=10),E<=y.bitCount}toBitArray(y){let E=[];for(let $=this.endBinaryShift(y.length).token;$!==null;$=$.getPrevious())E.unshift($);let O=new R;for(const $ of E)$.appendTo(O,y);return O}toString(){return Z.format("%s bits=%d bytes=%d",ys[this.mode],this.bitCount,this.binaryShiftByteCount)}static calculateBinaryShiftCost(y){return y.binaryShiftByteCount>62?21:y.binaryShiftByteCount>31?20:y.binaryShiftByteCount>0?10:0}}Bl.INITIAL_STATE=new Bl(j5,Ns,0,0);function vm(ut){const y=Z.getCharCode(" "),E=Z.getCharCode("."),O=Z.getCharCode(",");ut[Ns][y]=1;const $=Z.getCharCode("Z"),H=Z.getCharCode("A");for(let _t=H;_t<=$;_t++)ut[Ns][_t]=_t-H+2;ut[ca][y]=1;const K=Z.getCharCode("z"),le=Z.getCharCode("a");for(let _t=le;_t<=K;_t++)ut[ca][_t]=_t-le+2;ut[Hs][y]=1;const ve=Z.getCharCode("9"),Te=Z.getCharCode("0");for(let _t=Te;_t<=ve;_t++)ut[Hs][_t]=_t-Te+2;ut[Hs][O]=12,ut[Hs][E]=13;const Ze=["\0"," ","","","","","","","\x07","\b","	",`
`,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""];for(let _t=0;_t<Ze.length;_t++)ut[vs][Z.getCharCode(Ze[_t])]=_t;const ht=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(let _t=0;_t<ht.length;_t++)Z.getCharCode(ht[_t])>0&&(ut[sc][Z.getCharCode(ht[_t])]=_t);return ut}const v2=vm(I.createInt32Array(5,256));class cx{constructor(y){this.text=y}encode(){const y=Z.getCharCode(" "),E=Z.getCharCode(`
`);let O=Tt.singletonList(Bl.INITIAL_STATE);for(let H=0;H<this.text.length;H++){let K,le=H+1<this.text.length?this.text[H+1]:0;switch(this.text[H]){case Z.getCharCode("\r"):K=le===E?2:0;break;case Z.getCharCode("."):K=le===y?3:0;break;case Z.getCharCode(","):K=le===y?4:0;break;case Z.getCharCode(":"):K=le===y?5:0;break;default:K=0}K>0?(O=cx.updateStateListForPair(O,H,K),H++):O=this.updateStateListForChar(O,H)}return Tt.min(O,(H,K)=>H.getBitCount()-K.getBitCount()).toBitArray(this.text)}updateStateListForChar(y,E){const O=[];for(let $ of y)this.updateStateForChar($,E,O);return cx.simplifyStates(O)}updateStateForChar(y,E,O){let $=this.text[E]&255,H=v2[y.getMode()][$]>0,K=null;for(let le=0;le<=sc;le++){let ve=v2[le][$];if(ve>0){if(K==null&&(K=y.endBinaryShift(E)),!H||le===y.getMode()||le===Hs){const Te=K.latchAndAppend(le,ve);O.push(Te)}if(!H&&y2[y.getMode()][le]>=0){const Te=K.shiftAndAppend(le,ve);O.push(Te)}}}if(y.getBinaryShiftByteCount()>0||v2[y.getMode()][$]===0){let le=y.addBinaryShiftChar(E);O.push(le)}}static updateStateListForPair(y,E,O){const $=[];for(let H of y)this.updateStateForPair(H,E,O,$);return this.simplifyStates($)}static updateStateForPair(y,E,O,$){let H=y.endBinaryShift(E);if($.push(H.latchAndAppend(sc,O)),y.getMode()!==sc&&$.push(H.shiftAndAppend(sc,O)),O===3||O===4){let K=H.latchAndAppend(Hs,16-O).latchAndAppend(Hs,1);$.push(K)}if(y.getBinaryShiftByteCount()>0){let K=y.addBinaryShiftChar(E).addBinaryShiftChar(E+1);$.push(K)}}static simplifyStates(y){let E=[];for(const O of y){let $=!0;for(const H of E){if(H.isBetterThanOrEqualTo(O)){$=!1;break}O.isBetterThanOrEqualTo(H)&&(E=E.filter(K=>K!==H))}$&&E.push(O)}return E}}class Ii{constructor(){}static encodeBytes(y){return Ii.encode(y,Ii.DEFAULT_EC_PERCENT,Ii.DEFAULT_AZTEC_LAYERS)}static encode(y,E,O){let $=new cx(y).encode(),H=P.truncDivision($.getSize()*E,100)+11,K=$.getSize()+H,le,ve,Te,Ze,ht;if(O!==Ii.DEFAULT_AZTEC_LAYERS){if(le=O<0,ve=Math.abs(O),ve>(le?Ii.MAX_NB_BITS_COMPACT:Ii.MAX_NB_BITS))throw new f(Z.format("Illegal value %s for layers",O));Te=Ii.totalBitsInLayer(ve,le),Ze=Ii.WORD_SIZE[ve];let Ar=Te-Te%Ze;if(ht=Ii.stuffBits($,Ze),ht.getSize()+H>Ar)throw new f("Data to large for user specified layer");if(le&&ht.getSize()>Ze*64)throw new f("Data to large for user specified layer")}else{Ze=0,ht=null;for(let Ar=0;;Ar++){if(Ar>Ii.MAX_NB_BITS)throw new f("Data too large for an Aztec code");if(le=Ar<=3,ve=le?Ar+1:Ar,Te=Ii.totalBitsInLayer(ve,le),K>Te)continue;(ht==null||Ze!==Ii.WORD_SIZE[ve])&&(Ze=Ii.WORD_SIZE[ve],ht=Ii.stuffBits($,Ze));let ps=Te-Te%Ze;if(!(le&&ht.getSize()>Ze*64)&&ht.getSize()+H<=ps)break}}let _t=Ii.generateCheckWords(ht,Te,Ze),rn=ht.getSize()/Ze,bt=Ii.generateModeMessage(le,ve,rn),zt=(le?11:14)+ve*4,qt=new Int32Array(zt),Tn;if(le){Tn=zt;for(let Ar=0;Ar<qt.length;Ar++)qt[Ar]=Ar}else{Tn=zt+1+2*P.truncDivision(P.truncDivision(zt,2)-1,15);let Ar=P.truncDivision(zt,2),ps=P.truncDivision(Tn,2);for(let Ws=0;Ws<Ar;Ws++){let ic=Ws+P.truncDivision(Ws,15);qt[Ar-Ws-1]=ps-ic-1,qt[Ar+Ws]=ps+ic+1}}let ir=new he(Tn);for(let Ar=0,ps=0;Ar<ve;Ar++){let Ws=(ve-Ar)*4+(le?9:12);for(let ic=0;ic<Ws;ic++){let Ya=ic*2;for(let Xa=0;Xa<2;Xa++)_t.get(ps+Ya+Xa)&&ir.set(qt[Ar*2+Xa],qt[Ar*2+ic]),_t.get(ps+Ws*2+Ya+Xa)&&ir.set(qt[Ar*2+ic],qt[zt-1-Ar*2-Xa]),_t.get(ps+Ws*4+Ya+Xa)&&ir.set(qt[zt-1-Ar*2-Xa],qt[zt-1-Ar*2-ic]),_t.get(ps+Ws*6+Ya+Xa)&&ir.set(qt[zt-1-Ar*2-ic],qt[Ar*2+Xa])}ps+=Ws*8}if(Ii.drawModeMessage(ir,le,Tn,bt),le)Ii.drawBullsEye(ir,P.truncDivision(Tn,2),5);else{Ii.drawBullsEye(ir,P.truncDivision(Tn,2),7);for(let Ar=0,ps=0;Ar<P.truncDivision(zt,2)-1;Ar+=15,ps+=16)for(let Ws=P.truncDivision(Tn,2)&1;Ws<Tn;Ws+=2)ir.set(P.truncDivision(Tn,2)-ps,Ws),ir.set(P.truncDivision(Tn,2)+ps,Ws),ir.set(Ws,P.truncDivision(Tn,2)-ps),ir.set(Ws,P.truncDivision(Tn,2)+ps)}let Cr=new ei;return Cr.setCompact(le),Cr.setSize(Tn),Cr.setLayers(ve),Cr.setCodeWords(rn),Cr.setMatrix(ir),Cr}static drawBullsEye(y,E,O){for(let $=0;$<O;$+=2)for(let H=E-$;H<=E+$;H++)y.set(H,E-$),y.set(H,E+$),y.set(E-$,H),y.set(E+$,H);y.set(E-O,E-O),y.set(E-O+1,E-O),y.set(E-O,E-O+1),y.set(E+O,E-O),y.set(E+O,E-O+1),y.set(E+O,E+O-1)}static generateModeMessage(y,E,O){let $=new R;return y?($.appendBits(E-1,2),$.appendBits(O-1,6),$=Ii.generateCheckWords($,28,4)):($.appendBits(E-1,5),$.appendBits(O-1,11),$=Ii.generateCheckWords($,40,4)),$}static drawModeMessage(y,E,O,$){let H=P.truncDivision(O,2);if(E)for(let K=0;K<7;K++){let le=H-3+K;$.get(K)&&y.set(le,H-5),$.get(K+7)&&y.set(H+5,le),$.get(20-K)&&y.set(le,H+5),$.get(27-K)&&y.set(H-5,le)}else for(let K=0;K<10;K++){let le=H-5+K+P.truncDivision(K,5);$.get(K)&&y.set(le,H-7),$.get(K+10)&&y.set(H+7,le),$.get(29-K)&&y.set(le,H+7),$.get(39-K)&&y.set(H-7,le)}}static generateCheckWords(y,E,O){let $=y.getSize()/O,H=new Qr(Ii.getGF(O)),K=P.truncDivision(E,O),le=Ii.bitsToWords(y,O,K);H.encode(le,K-$);let ve=E%O,Te=new R;Te.appendBits(0,ve);for(const Ze of Array.from(le))Te.appendBits(Ze,O);return Te}static bitsToWords(y,E,O){let $=new Int32Array(O),H,K;for(H=0,K=y.getSize()/E;H<K;H++){let le=0;for(let ve=0;ve<E;ve++)le|=y.get(H*E+ve)?1<<E-ve-1:0;$[H]=le}return $}static getGF(y){switch(y){case 4:return it.AZTEC_PARAM;case 6:return it.AZTEC_DATA_6;case 8:return it.AZTEC_DATA_8;case 10:return it.AZTEC_DATA_10;case 12:return it.AZTEC_DATA_12;default:throw new f("Unsupported word size "+y)}}static stuffBits(y,E){let O=new R,$=y.getSize(),H=(1<<E)-2;for(let K=0;K<$;K+=E){let le=0;for(let ve=0;ve<E;ve++)(K+ve>=$||y.get(K+ve))&&(le|=1<<E-1-ve);(le&H)===H?(O.appendBits(le&H,E),K--):le&H?O.appendBits(le,E):(O.appendBits(le|1,E),K--)}return O}static totalBitsInLayer(y,E){return((E?88:112)+16*y)*y}}Ii.DEFAULT_EC_PERCENT=33,Ii.DEFAULT_AZTEC_LAYERS=0,Ii.MAX_NB_BITS=32,Ii.MAX_NB_BITS_COMPACT=4,Ii.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]);class wm{encode(y,E,O,$){return this.encodeWithHints(y,E,O,$,null)}encodeWithHints(y,E,O,$,H){let K=Ms.ISO_8859_1,le=Ii.DEFAULT_EC_PERCENT,ve=Ii.DEFAULT_AZTEC_LAYERS;return H!=null&&(H.has(Lr.CHARACTER_SET)&&(K=Kr.forName(H.get(Lr.CHARACTER_SET).toString())),H.has(Lr.ERROR_CORRECTION)&&(le=P.parseInt(H.get(Lr.ERROR_CORRECTION).toString())),H.has(Lr.AZTEC_LAYERS)&&(ve=P.parseInt(H.get(Lr.AZTEC_LAYERS).toString()))),wm.encodeLayers(y,E,O,$,K,le,ve)}static encodeLayers(y,E,O,$,H,K,le){if(E!==Ne.AZTEC)throw new f("Can only encode AZTEC, but got "+E);let ve=Ii.encode(Z.getBytes(y,H),K,le);return wm.renderResult(ve,O,$)}static renderResult(y,E,O){let $=y.getMatrix();if($==null)throw new at;let H=$.getWidth(),K=$.getHeight(),le=Math.max(E,H),ve=Math.max(O,K),Te=Math.min(le/H,ve/K),Ze=(le-H*Te)/2,ht=(ve-K*Te)/2,_t=new he(le,ve);for(let rn=0,bt=ht;rn<K;rn++,bt+=Te)for(let zt=0,qt=Ze;zt<H;zt++,qt+=Te)$.get(zt,rn)&&_t.setRegion(qt,bt,Te,Te);return _t}}n.AbstractExpandedDecoder=Cn,n.ArgumentException=d,n.ArithmeticException=Be,n.AztecCode=ei,n.AztecCodeReader=en,n.AztecCodeWriter=wm,n.AztecDecoder=Ut,n.AztecDetector=ft,n.AztecDetectorResult=cn,n.AztecEncoder=Ii,n.AztecHighLevelEncoder=cx,n.AztecPoint=Ke,n.BarcodeFormat=Ne,n.Binarizer=v,n.BinaryBitmap=x,n.BitArray=R,n.BitMatrix=he,n.BitSource=xe,n.BrowserAztecCodeReader=Dt,n.BrowserBarcodeReader=T,n.BrowserCodeReader=Ae,n.BrowserDatamatrixCodeReader=rt,n.BrowserMultiFormatReader=wr,n.BrowserPDF417Reader=pr,n.BrowserQRCodeReader=es,n.BrowserQRCodeSvgWriter=Dn,n.CharacterSetECI=X,n.ChecksumException=g,n.Code128Reader=Je,n.Code39Reader=He,n.DataMatrixDecodedBitStreamParser=ke,n.DataMatrixReader=Fe,n.DecodeHintType=U,n.DecoderResult=Ie,n.DefaultGridSampler=Yt,n.DetectorResult=un,n.EAN13Reader=xn,n.EncodeHintType=Lr,n.Exception=u,n.FormatException=L,n.GenericGF=it,n.GenericGFPoly=Qe,n.GlobalHistogramBinarizer=ie,n.GridSampler=Xe,n.GridSamplerInstance=Ve,n.HTMLCanvasElementLuminanceSource=ee,n.HybridBinarizer=oe,n.ITFReader=Rt,n.IllegalArgumentException=f,n.IllegalStateException=at,n.InvertedLuminanceSource=V,n.LuminanceSource=G,n.MathUtils=kt,n.MultiFormatOneDReader=k,n.MultiFormatReader=_r,n.MultiFormatWriter=Mr,n.NotFoundException=Y,n.OneDReader=At,n.PDF417DecodedBitStreamParser=yt,n.PDF417DecoderErrorCorrection=$t,n.PDF417Reader=An,n.PDF417ResultMetadata=vr,n.PerspectiveTransform=Vt,n.PlanarYUVLuminanceSource=cr,n.QRCodeByteMatrix=Ss,n.QRCodeDataMask=gt,n.QRCodeDecodedBitStreamParser=wt,n.QRCodeDecoderErrorCorrectionLevel=Ce,n.QRCodeDecoderFormatInformation=De,n.QRCodeEncoder=Rn,n.QRCodeEncoderQRCode=hi,n.QRCodeMaskUtil=Ir,n.QRCodeMatrixUtil=Pr,n.QRCodeMode=We,n.QRCodeReader=Zt,n.QRCodeVersion=nt,n.QRCodeWriter=Nr,n.RGBLuminanceSource=bs,n.RSS14Reader=_,n.RSSExpandedReader=h,n.ReaderException=or,n.ReedSolomonDecoder=dt,n.ReedSolomonEncoder=Qr,n.ReedSolomonException=tt,n.Result=ce,n.ResultMetadataType=je,n.ResultPoint=jt,n.StringUtils=Z,n.UnsupportedOperationException=ne,n.VideoInputDevice=ae,n.WhiteRectangleDetector=Pt,n.WriterException=li,n.ZXingArrays=I,n.ZXingCharset=Kr,n.ZXingInteger=P,n.ZXingStandardCharsets=Ms,n.ZXingStringBuilder=re,n.ZXingStringEncoding=J,n.ZXingSystem=w,n.createAbstractExpandedDecoder=Fn,Object.defineProperty(n,"__esModule",{value:!0})})}(Aj,Aj.exports)),Aj.exports}var uo=oLt();const lLt=ji(uo),cLt=INe({__proto__:null,default:lLt},[uo]);var Dbe=function(){function e(t,n,r){if(this.formatMap=new Map([[xs.QR_CODE,uo.BarcodeFormat.QR_CODE],[xs.AZTEC,uo.BarcodeFormat.AZTEC],[xs.CODABAR,uo.BarcodeFormat.CODABAR],[xs.CODE_39,uo.BarcodeFormat.CODE_39],[xs.CODE_93,uo.BarcodeFormat.CODE_93],[xs.CODE_128,uo.BarcodeFormat.CODE_128],[xs.DATA_MATRIX,uo.BarcodeFormat.DATA_MATRIX],[xs.MAXICODE,uo.BarcodeFormat.MAXICODE],[xs.ITF,uo.BarcodeFormat.ITF],[xs.EAN_13,uo.BarcodeFormat.EAN_13],[xs.EAN_8,uo.BarcodeFormat.EAN_8],[xs.PDF_417,uo.BarcodeFormat.PDF_417],[xs.RSS_14,uo.BarcodeFormat.RSS_14],[xs.RSS_EXPANDED,uo.BarcodeFormat.RSS_EXPANDED],[xs.UPC_A,uo.BarcodeFormat.UPC_A],[xs.UPC_E,uo.BarcodeFormat.UPC_E],[xs.UPC_EAN_EXTENSION,uo.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!cLt)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=n,this.logger=r;var s=this.createZXingFormats(t),a=new Map;a.set(uo.DecodeHintType.POSSIBLE_FORMATS,s),a.set(uo.DecodeHintType.TRY_HARDER,!1),this.hints=a}return e.prototype.decodeAsync=function(t){var n=this;return new Promise(function(r,s){try{r(n.decode(t))}catch(a){s(a)}})},e.prototype.decode=function(t){var n=new uo.MultiFormatReader(this.verbose,this.hints),r=new uo.HTMLCanvasElementLuminanceSource(t),s=new uo.BinaryBitmap(new uo.HybridBinarizer(r)),a=n.decode(s);return{text:a.text,format:vLe.create(this.toHtml5QrcodeSupportedFormats(a.format)),debugData:this.createDebugData()}},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,r,s){t.set(n,r)}),t},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},e.prototype.createZXingFormats=function(t){for(var n=[],r=0,s=t;r<s.length;r++){var a=s[r];this.formatMap.has(a)?n.push(this.formatMap.get(a)):this.logger.logError("".concat(a," is not supported by")+"ZXingHtml5QrcodeShim")}return n},e.prototype.createDebugData=function(){return{decoderName:"zxing-js"}},e}(),uLt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},dLt=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,s=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],s=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Bbe=function(){function e(t,n,r){if(this.formatMap=new Map([[xs.QR_CODE,"qr_code"],[xs.AZTEC,"aztec"],[xs.CODABAR,"codabar"],[xs.CODE_39,"code_39"],[xs.CODE_93,"code_93"],[xs.CODE_128,"code_128"],[xs.DATA_MATRIX,"data_matrix"],[xs.ITF,"itf"],[xs.EAN_13,"ean_13"],[xs.EAN_8,"ean_8"],[xs.PDF_417,"pdf417"],[xs.UPC_A,"upc_a"],[xs.UPC_E,"upc_e"]]),this.reverseFormatMap=this.createReverseFormatMap(),!e.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=n,this.logger=r;var s=this.createBarcodeDetectorFormats(t);if(this.detector=new BarcodeDetector(s),!this.detector)throw"BarcodeDetector detector not supported"}return e.isSupported=function(){if(!("BarcodeDetector"in window))return!1;var t=new BarcodeDetector({formats:["qr_code"]});return typeof t<"u"},e.prototype.decodeAsync=function(t){return uLt(this,void 0,void 0,function(){var n,r;return dLt(this,function(s){switch(s.label){case 0:return[4,this.detector.detect(t)];case 1:if(n=s.sent(),!n||n.length===0)throw"No barcode or QR code detected.";return r=this.selectLargestBarcode(n),[2,{text:r.rawValue,format:vLe.create(this.toHtml5QrcodeSupportedFormats(r.format)),debugData:this.createDebugData()}]}})})},e.prototype.selectLargestBarcode=function(t){for(var n=null,r=0,s=0,a=t;s<a.length;s++){var o=a[s],l=o.boundingBox.width*o.boundingBox.height;l>r&&(r=l,n=o)}if(!n)throw"No largest barcode found";return n},e.prototype.createBarcodeDetectorFormats=function(t){for(var n=[],r=0,s=t;r<s.length;r++){var a=s[r];this.formatMap.has(a)?n.push(this.formatMap.get(a)):this.logger.warn("".concat(a," is not supported by")+"BarcodeDetectorDelegate")}return{formats:n}},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,r,s){t.set(n,r)}),t},e.prototype.createDebugData=function(){return{decoderName:"BarcodeDetector"}},e}(),$be=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},Ube=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,s=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],s=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},fLt=function(){function e(t,n,r,s){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.wasPrimaryDecoderUsedInLastDecode=!1,this.verbose=r,n&&Bbe.isSupported()?(this.primaryDecoder=new Bbe(t,r,s),this.secondaryDecoder=new Dbe(t,r,s)):this.primaryDecoder=new Dbe(t,r,s)}return e.prototype.decodeAsync=function(t){return $be(this,void 0,void 0,function(){var n;return Ube(this,function(r){switch(r.label){case 0:n=performance.now(),r.label=1;case 1:return r.trys.push([1,,3,4]),[4,this.getDecoder().decodeAsync(t)];case 2:return[2,r.sent()];case 3:return this.possiblyLogPerformance(n),[7];case 4:return[2]}})})},e.prototype.decodeRobustlyAsync=function(t){return $be(this,void 0,void 0,function(){var n,r;return Ube(this,function(s){switch(s.label){case 0:n=performance.now(),s.label=1;case 1:return s.trys.push([1,3,4,5]),[4,this.primaryDecoder.decodeAsync(t)];case 2:return[2,s.sent()];case 3:if(r=s.sent(),this.secondaryDecoder)return[2,this.secondaryDecoder.decodeAsync(t)];throw r;case 4:return this.possiblyLogPerformance(n),[7];case 5:return[2]}})})},e.prototype.getDecoder=function(){return this.secondaryDecoder?this.wasPrimaryDecoderUsedInLastDecode===!1?(this.wasPrimaryDecoderUsedInLastDecode=!0,this.primaryDecoder):(this.wasPrimaryDecoderUsedInLastDecode=!1,this.secondaryDecoder):this.primaryDecoder},e.prototype.possiblyLogPerformance=function(t){if(this.verbose){var n=performance.now()-t;this.executionResults.push(n),this.executions++,this.possiblyFlushPerformanceReport()}},e.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var t=0,n=0,r=this.executionResults;n<r.length;n++){var s=r[n];t+=s}var a=t/this.executionResults.length;console.log("".concat(a," ms for ").concat(this.executionResults.length," last runs.")),this.executions=0,this.executionResults=[]}},e}(),mle=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(r[a]=s[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),DR=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},BR=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,s=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],s=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},CLe=function(){function e(t,n){this.name=t,this.track=n}return e.prototype.isSupported=function(){return this.track.getCapabilities?this.name in this.track.getCapabilities():!1},e.prototype.apply=function(t){var n={};n[this.name]=t;var r={advanced:[n]};return this.track.applyConstraints(r)},e.prototype.value=function(){var t=this.track.getSettings();if(this.name in t){var n=t[this.name];return n}return null},e}(),hLt=function(e){mle(t,e);function t(n,r){return e.call(this,n,r)||this}return t.prototype.min=function(){return this.getCapabilities().min},t.prototype.max=function(){return this.getCapabilities().max},t.prototype.step=function(){return this.getCapabilities().step},t.prototype.apply=function(n){var r={};r[this.name]=n;var s={advanced:[r]};return this.track.applyConstraints(s)},t.prototype.getCapabilities=function(){this.failIfNotSupported();var n=this.track.getCapabilities(),r=n[this.name];return{min:r.min,max:r.max,step:r.step}},t.prototype.failIfNotSupported=function(){if(!this.isSupported())throw new Error("".concat(this.name," capability not supported"))},t}(CLe),pLt=function(e){mle(t,e);function t(n){return e.call(this,"zoom",n)||this}return t}(hLt),mLt=function(e){mle(t,e);function t(n){return e.call(this,"torch",n)||this}return t}(CLe),xLt=function(){function e(t){this.track=t}return e.prototype.zoomFeature=function(){return new pLt(this.track)},e.prototype.torchFeature=function(){return new mLt(this.track)},e}(),gLt=function(){function e(t,n,r){this.isClosed=!1,this.parentElement=t,this.mediaStream=n,this.callbacks=r,this.surface=this.createVideoElement(this.parentElement.clientWidth),t.append(this.surface)}return e.prototype.createVideoElement=function(t){var n=document.createElement("video");return n.style.width="".concat(t,"px"),n.style.display="block",n.muted=!0,n.setAttribute("muted","true"),n.playsInline=!0,n},e.prototype.setupSurface=function(){var t=this;this.surface.onabort=function(){throw"RenderedCameraImpl video surface onabort() called"},this.surface.onerror=function(){throw"RenderedCameraImpl video surface onerror() called"};var n=function(){var r=t.surface.clientWidth,s=t.surface.clientHeight;t.callbacks.onRenderSurfaceReady(r,s),t.surface.removeEventListener("playing",n)};this.surface.addEventListener("playing",n),this.surface.srcObject=this.mediaStream,this.surface.play()},e.create=function(t,n,r,s){return DR(this,void 0,void 0,function(){var a,o;return BR(this,function(l){switch(l.label){case 0:return a=new e(t,n,s),r.aspectRatio?(o={aspectRatio:r.aspectRatio},[4,a.getFirstTrackOrFail().applyConstraints(o)]):[3,2];case 1:l.sent(),l.label=2;case 2:return a.setupSurface(),[2,a]}})})},e.prototype.failIfClosed=function(){if(this.isClosed)throw"The RenderedCamera has already been closed."},e.prototype.getFirstTrackOrFail=function(){if(this.failIfClosed(),this.mediaStream.getVideoTracks().length===0)throw"No video tracks found";return this.mediaStream.getVideoTracks()[0]},e.prototype.pause=function(){this.failIfClosed(),this.surface.pause()},e.prototype.resume=function(t){this.failIfClosed();var n=this,r=function(){setTimeout(t,200),n.surface.removeEventListener("playing",r)};this.surface.addEventListener("playing",r),this.surface.play()},e.prototype.isPaused=function(){return this.failIfClosed(),this.surface.paused},e.prototype.getSurface=function(){return this.failIfClosed(),this.surface},e.prototype.getRunningTrackCapabilities=function(){return this.getFirstTrackOrFail().getCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getFirstTrackOrFail().getSettings()},e.prototype.applyVideoConstraints=function(t){return DR(this,void 0,void 0,function(){return BR(this,function(n){if("aspectRatio"in t)throw"Changing 'aspectRatio' in run-time is not yet supported.";return[2,this.getFirstTrackOrFail().applyConstraints(t)]})})},e.prototype.close=function(){if(this.isClosed)return Promise.resolve();var t=this;return new Promise(function(n,r){var s=t.mediaStream.getVideoTracks(),a=s.length,o=0;t.mediaStream.getVideoTracks().forEach(function(l){t.mediaStream.removeTrack(l),l.stop(),++o,o>=a&&(t.isClosed=!0,t.parentElement.removeChild(t.surface),n())})})},e.prototype.getCapabilities=function(){return new xLt(this.getFirstTrackOrFail())},e}(),bLt=function(){function e(t){this.mediaStream=t}return e.prototype.render=function(t,n,r){return DR(this,void 0,void 0,function(){return BR(this,function(s){return[2,gLt.create(t,this.mediaStream,n,r)]})})},e.create=function(t){return DR(this,void 0,void 0,function(){var n,r;return BR(this,function(s){switch(s.label){case 0:if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return n={audio:!1,video:t},[4,navigator.mediaDevices.getUserMedia(n)];case 1:return r=s.sent(),[2,new e(r)]}})})},e}(),zbe=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},Hbe=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,s=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],s=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},yLt=function(){function e(){}return e.failIfNotSupported=function(){return zbe(this,void 0,void 0,function(){return Hbe(this,function(t){if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return[2,new e]})})},e.prototype.create=function(t){return zbe(this,void 0,void 0,function(){return Hbe(this,function(n){return[2,bLt.create(t)]})})},e}(),vLt=function(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})},wLt=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,s,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,s=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],s=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},CLt=function(){function e(){}return e.retrieve=function(){if(navigator.mediaDevices)return e.getCamerasFromMediaDevices();var t=MediaStreamTrack;return MediaStreamTrack&&t.getSources?e.getCamerasFromMediaStreamTrack():e.rejectWithError()},e.rejectWithError=function(){var t=RC.unableToQuerySupportedDevices();return e.isHttpsOrLocalhost()||(t=RC.insecureContextCameraQueryError()),Promise.reject(t)},e.isHttpsOrLocalhost=function(){if(location.protocol==="https:")return!0;var t=location.host.split(":")[0];return t==="127.0.0.1"||t==="localhost"},e.getCamerasFromMediaDevices=function(){return vLt(this,void 0,void 0,function(){var t,n,r,s,a,o,l;return wLt(this,function(c){switch(c.label){case 0:return t=function(u){for(var d=u.getVideoTracks(),f=0,x=d;f<x.length;f++){var g=x[f];g.enabled=!1,g.stop(),u.removeTrack(g)}},[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 1:return n=c.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:for(r=c.sent(),s=[],a=0,o=r;a<o.length;a++)l=o[a],l.kind==="videoinput"&&s.push({id:l.deviceId,label:l.label});return t(n),[2,s]}})})},e.getCamerasFromMediaStreamTrack=function(){return new Promise(function(t,n){var r=function(a){for(var o=[],l=0,c=a;l<c.length;l++){var u=c[l];u.kind==="video"&&o.push({id:u.id,label:u.label})}t(o)},s=MediaStreamTrack;s.getSources(r)})},e}(),Ko;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.NOT_STARTED=1]="NOT_STARTED",e[e.SCANNING=2]="SCANNING",e[e.PAUSED=3]="PAUSED"})(Ko||(Ko={}));var SLt=function(){function e(){this.state=Ko.NOT_STARTED,this.onGoingTransactionNewState=Ko.UNKNOWN}return e.prototype.directTransition=function(t){this.failIfTransitionOngoing(),this.validateTransition(t),this.state=t},e.prototype.startTransition=function(t){return this.failIfTransitionOngoing(),this.validateTransition(t),this.onGoingTransactionNewState=t,this},e.prototype.execute=function(){if(this.onGoingTransactionNewState===Ko.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var t=this.onGoingTransactionNewState;this.onGoingTransactionNewState=Ko.UNKNOWN,this.directTransition(t)},e.prototype.cancel=function(){if(this.onGoingTransactionNewState===Ko.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=Ko.UNKNOWN},e.prototype.getState=function(){return this.state},e.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==Ko.UNKNOWN)throw"Cannot transition to a new state, already under transition"},e.prototype.validateTransition=function(t){switch(this.state){case Ko.UNKNOWN:throw"Transition from unknown is not allowed";case Ko.NOT_STARTED:this.failIfNewStateIs(t,[Ko.PAUSED]);break;case Ko.SCANNING:break;case Ko.PAUSED:break}},e.prototype.failIfNewStateIs=function(t,n){for(var r=0,s=n;r<s.length;r++){var a=s[r];if(t===a)throw"Cannot transition from ".concat(this.state," to ").concat(t)}},e}(),NLt=function(){function e(t){this.stateManager=t}return e.prototype.startTransition=function(t){return this.stateManager.startTransition(t)},e.prototype.directTransition=function(t){this.stateManager.directTransition(t)},e.prototype.getState=function(){return this.stateManager.getState()},e.prototype.canScanFile=function(){return this.stateManager.getState()===Ko.NOT_STARTED},e.prototype.isScanning=function(){return this.stateManager.getState()!==Ko.NOT_STARTED},e.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===Ko.SCANNING},e.prototype.isPaused=function(){return this.stateManager.getState()===Ko.PAUSED},e}(),ALt=function(){function e(){}return e.create=function(){return new NLt(new SLt)},e}(),jLt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(r[a]=s[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),wf=function(e){jLt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.DEFAULT_WIDTH=300,t.DEFAULT_WIDTH_OFFSET=2,t.FILE_SCAN_MIN_HEIGHT=300,t.FILE_SCAN_HIDDEN_CANVAS_PADDING=100,t.MIN_QR_BOX_SIZE=50,t.SHADED_LEFT=1,t.SHADED_RIGHT=2,t.SHADED_TOP=3,t.SHADED_BOTTOM=4,t.SHADED_REGION_ELEMENT_ID="qr-shaded-region",t.VERBOSE=!1,t.BORDER_SHADER_DEFAULT_COLOR="#ffffff",t.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",t}(rLt),ELt=function(){function e(t,n){this.logger=n,this.fps=wf.SCAN_DEFAULT_FPS,t?(t.fps&&(this.fps=t.fps),this.disableFlip=t.disableFlip===!0,this.qrbox=t.qrbox,this.aspectRatio=t.aspectRatio,this.videoConstraints=t.videoConstraints):this.disableFlip=wf.DEFAULT_DISABLE_FLIP}return e.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?wLe.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},e.prototype.isShadedBoxEnabled=function(){return!tg(this.qrbox)},e.create=function(t,n){return new e(t,n)},e}(),Vbe=function(){function e(t,n){if(this.element=null,this.canvasElement=null,this.scannerPausedUiElement=null,this.hasBorderShaders=null,this.borderShaders=null,this.qrMatch=null,this.renderedCamera=null,this.qrRegion=null,this.context=null,this.lastScanImageFile=null,this.isScanning=!1,!document.getElementById(t))throw"HTML Element with id=".concat(t," not found");this.elementId=t,this.verbose=!1;var r;typeof n=="boolean"?this.verbose=n===!0:n&&(r=n,this.verbose=r.verbose===!0,r.experimentalFeatures),this.logger=new iLt(this.verbose),this.qrcode=new fLt(this.getSupportedFormats(n),this.getUseBarCodeDetectorIfSupported(r),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=ALt.create()}return e.prototype.start=function(t,n,r,s){var a=this;if(!t)throw"cameraIdOrConfig is required";if(!r||typeof r!="function")throw"qrCodeSuccessCallback is required and should be a function.";var o;s?o=s:o=this.verbose?this.logger.log:function(){};var l=ELt.create(n,this.logger);this.clearElement();var c=!1;l.videoConstraints&&(l.isMediaStreamConstraintsValid()?c=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var u=c,d=document.getElementById(this.elementId);d.clientWidth?d.clientWidth:wf.DEFAULT_WIDTH,d.style.position="relative",this.shouldScan=!0,this.element=d;var f=this,x=this.stateManagerProxy.startTransition(Ko.SCANNING);return new Promise(function(g,v){var w=u?l.videoConstraints:f.createVideoConstraints(t);if(!w){x.cancel(),v("videoConstraints should be defined");return}var C={};(!u||l.aspectRatio)&&(C.aspectRatio=l.aspectRatio);var N={onRenderSurfaceReady:function(I,P){f.setupUi(I,P,l),f.isScanning=!0,f.foreverScan(l,r,o)}};yLt.failIfNotSupported().then(function(I){I.create(w).then(function(P){return P.render(a.element,C,N).then(function(R){f.renderedCamera=R,x.execute(),g(null)}).catch(function(R){x.cancel(),v(R)})}).catch(function(P){x.cancel(),v(RC.errorGettingUserMedia(P))})}).catch(function(I){x.cancel(),v(RC.cameraStreamingNotSupported())})})},e.prototype.pause=function(t){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(Ko.PAUSED),this.showPausedState(),(tg(t)||t!==!0)&&(t=!1),t&&this.renderedCamera&&this.renderedCamera.pause()},e.prototype.resume=function(){if(!this.stateManagerProxy.isPaused())throw"Cannot result, scanner is not paused.";if(!this.renderedCamera)throw"renderedCamera doesn't exist while trying resume()";var t=this,n=function(){t.stateManagerProxy.directTransition(Ko.SCANNING),t.hidePausedState()};if(!this.renderedCamera.isPaused()){n();return}this.renderedCamera.resume(function(){n()})},e.prototype.getState=function(){return this.stateManagerProxy.getState()},e.prototype.stop=function(){var t=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var n=this.stateManagerProxy.startTransition(Ko.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var r=function(){if(t.element){var a=document.getElementById(wf.SHADED_REGION_ELEMENT_ID);a&&t.element.removeChild(a)}},s=this;return this.renderedCamera.close().then(function(){return s.renderedCamera=null,s.element&&(s.element.removeChild(s.canvasElement),s.canvasElement=null),r(),s.qrRegion&&(s.qrRegion=null),s.context&&(s.context=null),n.execute(),s.hidePausedState(),s.isScanning=!1,Promise.resolve()})},e.prototype.scanFile=function(t,n){return this.scanFileV2(t,n).then(function(r){return r.decodedText})},e.prototype.scanFileV2=function(t,n){var r=this;if(!t||!(t instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(tg(n)&&(n=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(s,a){r.possiblyCloseLastScanImageFile(),r.clearElement(),r.lastScanImageFile=URL.createObjectURL(t);var o=new Image;o.onload=function(){var l=o.width,c=o.height,u=document.getElementById(r.elementId),d=u.clientWidth?u.clientWidth:wf.DEFAULT_WIDTH,f=Math.max(u.clientHeight?u.clientHeight:c,wf.FILE_SCAN_MIN_HEIGHT),x=r.computeCanvasDrawConfig(l,c,d,f);if(n){var g=r.createCanvasElement(d,f,"qr-canvas-visible");g.style.display="inline-block",u.appendChild(g);var v=g.getContext("2d");if(!v)throw"Unable to get 2d context from canvas";v.canvas.width=d,v.canvas.height=f,v.drawImage(o,0,0,l,c,x.x,x.y,x.width,x.height)}var w=wf.FILE_SCAN_HIDDEN_CANVAS_PADDING,C=Math.max(o.width,x.width),N=Math.max(o.height,x.height),I=C+2*w,P=N+2*w,R=r.createCanvasElement(I,P);u.appendChild(R);var F=R.getContext("2d");if(!F)throw"Unable to get 2d context from canvas";F.canvas.width=I,F.canvas.height=P,F.drawImage(o,0,0,l,c,w,w,C,N);try{r.qrcode.decodeRobustlyAsync(R).then(function(U){s(Rbe.createFromQrcodeResult(U))}).catch(a)}catch(U){a("QR code parse error, error = ".concat(U))}},o.onerror=a,o.onabort=a,o.onstalled=a,o.onsuspend=a,o.src=URL.createObjectURL(t)})},e.prototype.clear=function(){this.clearElement()},e.getCameras=function(){return CLt.retrieve()},e.prototype.getRunningTrackCapabilities=function(){return this.getRenderedCameraOrFail().getRunningTrackCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getRenderedCameraOrFail().getRunningTrackSettings()},e.prototype.getRunningTrackCameraCapabilities=function(){return this.getRenderedCameraOrFail().getCapabilities()},e.prototype.applyVideoConstraints=function(t){if(t){if(!wLe.isMediaStreamConstraintsValid(t,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";return this.getRenderedCameraOrFail().applyVideoConstraints(t)},e.prototype.getRenderedCameraOrFail=function(){if(this.renderedCamera==null)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";return this.renderedCamera},e.prototype.getSupportedFormats=function(t){var n=[xs.QR_CODE,xs.AZTEC,xs.CODABAR,xs.CODE_39,xs.CODE_93,xs.CODE_128,xs.DATA_MATRIX,xs.MAXICODE,xs.ITF,xs.EAN_13,xs.EAN_8,xs.PDF_417,xs.RSS_14,xs.RSS_EXPANDED,xs.UPC_A,xs.UPC_E,xs.UPC_EAN_EXTENSION];if(!t||typeof t=="boolean"||!t.formatsToSupport)return n;if(!Array.isArray(t.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(t.formatsToSupport.length===0)throw"Atleast 1 formatsToSupport is needed.";for(var r=[],s=0,a=t.formatsToSupport;s<a.length;s++){var o=a[s];nLt(o)?r.push(o):this.logger.warn("Invalid format: ".concat(o," passed in config, ignoring."))}if(r.length===0)throw"None of formatsToSupport match supported values.";return r},e.prototype.getUseBarCodeDetectorIfSupported=function(t){if(tg(t))return!0;if(!tg(t.useBarCodeDetectorIfSupported))return t.useBarCodeDetectorIfSupported!==!1;if(tg(t.experimentalFeatures))return!0;var n=t.experimentalFeatures;return tg(n.useBarCodeDetectorIfSupported)?!0:n.useBarCodeDetectorIfSupported!==!1},e.prototype.validateQrboxSize=function(t,n,r){var s=this,a=r.qrbox;this.validateQrboxConfig(a);var o=this.toQrdimensions(t,n,a),l=function(u){if(u<wf.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat(wf.MIN_QR_BOX_SIZE,"px.")},c=function(u){return u>t&&(s.logger.warn("`qrbox.width` or `qrbox` is larger than the width of the root element. The width will be truncated to the width of root element."),u=t),u};l(o.width),l(o.height),o.width=c(o.width)},e.prototype.validateQrboxConfig=function(t){if(typeof t!="number"&&typeof t!="function"&&(t.width===void 0||t.height===void 0))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},e.prototype.toQrdimensions=function(t,n,r){if(typeof r=="number")return{width:r,height:r};if(typeof r=="function")try{return r(t,n)}catch(s){throw new Error("qrbox config was passed as a function but it failed with unknown error"+s)}return r},e.prototype.setupUi=function(t,n,r){r.isShadedBoxEnabled()&&this.validateQrboxSize(t,n,r);var s=tg(r.qrbox)?{width:t,height:n}:r.qrbox;this.validateQrboxConfig(s);var a=this.toQrdimensions(t,n,s);a.height>n&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var o=r.isShadedBoxEnabled()&&a.height<=n,l={x:0,y:0,width:t,height:n},c=o?this.getShadedRegionBounds(t,n,a):l,u=this.createCanvasElement(c.width,c.height),d={willReadFrequently:!0},f=u.getContext("2d",d);f.canvas.width=c.width,f.canvas.height=c.height,this.element.append(u),o&&this.possiblyInsertShadingElement(this.element,t,n,a),this.createScannerPausedUiElement(this.element),this.qrRegion=c,this.context=f,this.canvasElement=u},e.prototype.createScannerPausedUiElement=function(t){var n=document.createElement("div");n.innerText=RC.scannerPaused(),n.style.display="none",n.style.position="absolute",n.style.top="0px",n.style.zIndex="1",n.style.background="rgba(9, 9, 9, 0.46)",n.style.color="#FFECEC",n.style.textAlign="center",n.style.width="100%",t.appendChild(n),this.scannerPausedUiElement=n},e.prototype.scanContext=function(t,n){var r=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(s){return t(s.text,Rbe.createFromQrcodeResult(s)),r.possiblyUpdateShaders(!0),!0}).catch(function(s){r.possiblyUpdateShaders(!1);var a=RC.codeParseError(s);return n(a,sLt.createFrom(a)),!1})},e.prototype.foreverScan=function(t,n,r){var s=this;if(this.shouldScan&&this.renderedCamera){var a=this.renderedCamera.getSurface(),o=a.videoWidth/a.clientWidth,l=a.videoHeight/a.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var c=this.qrRegion.width*o,u=this.qrRegion.height*l,d=this.qrRegion.x*o,f=this.qrRegion.y*l;this.context.drawImage(a,d,f,c,u,0,0,this.qrRegion.width,this.qrRegion.height);var x=function(){s.foreverScanTimeout=setTimeout(function(){s.foreverScan(t,n,r)},s.getTimeoutFps(t.fps))};this.scanContext(n,r).then(function(g){!g&&t.disableFlip!==!0?(s.context.translate(s.context.canvas.width,0),s.context.scale(-1,1),s.scanContext(n,r).finally(function(){x()})):x()}).catch(function(g){s.logger.logError("Error happend while scanning context",g),x()})}},e.prototype.createVideoConstraints=function(t){if(typeof t=="string")return{deviceId:{exact:t}};if(typeof t=="object"){var n="facingMode",r="deviceId",s={user:!0,environment:!0},a="exact",o=function(v){if(v in s)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(v,"'")},l=Object.keys(t);if(l.length!==1)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(l.length," keys");var c=Object.keys(t)[0];if(c!==n&&c!==r)throw"Only '".concat(n,"' and '").concat(r,"' ")+" are supported for 'cameraIdOrConfig'";if(c===n){var u=t.facingMode;if(typeof u=="string"){if(o(u))return{facingMode:u}}else if(typeof u=="object")if(a in u){if(o(u["".concat(a)]))return{facingMode:{exact:u["".concat(a)]}}}else throw"'facingMode' should be string or object with"+" ".concat(a," as key.");else{var d=typeof u;throw"Invalid type of 'facingMode' = ".concat(d)}}else{var f=t.deviceId;if(typeof f=="string")return{deviceId:f};if(typeof f=="object"){if(a in f)return{deviceId:{exact:f["".concat(a)]}};throw"'deviceId' should be string or object with"+" ".concat(a," as key.")}else{var x=typeof f;throw"Invalid type of 'deviceId' = ".concat(x)}}}var g=typeof t;throw"Invalid type of 'cameraIdOrConfig' = ".concat(g)},e.prototype.computeCanvasDrawConfig=function(t,n,r,s){if(t<=r&&n<=s){var a=(r-t)/2,o=(s-n)/2;return{x:a,y:o,width:t,height:n}}else{var l=t,c=n;return t>r&&(n=r/t*n,t=r),n>s&&(t=s/n*t,n=s),this.logger.log("Image downsampled from "+"".concat(l,"X").concat(c)+" to ".concat(t,"X").concat(n,".")),this.computeCanvasDrawConfig(t,n,r,s)}},e.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var t=document.getElementById(this.elementId);t&&(t.innerHTML="")},e.prototype.possiblyUpdateShaders=function(t){this.qrMatch!==t&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(n){n.style.backgroundColor=t?wf.BORDER_SHADER_MATCH_COLOR:wf.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=t)},e.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},e.prototype.createCanvasElement=function(t,n,r){var s=t,a=n,o=document.createElement("canvas");return o.style.width="".concat(s,"px"),o.style.height="".concat(a,"px"),o.style.display="none",o.id=tg(r)?"qr-canvas":r,o},e.prototype.getShadedRegionBounds=function(t,n,r){if(r.width>t||r.height>n)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(t-r.width)/2,y:(n-r.height)/2,width:r.width,height:r.height}},e.prototype.possiblyInsertShadingElement=function(t,n,r,s){if(!(n-s.width<1||r-s.height<1)){var a=document.createElement("div");a.style.position="absolute";var o=(n-s.width)/2,l=(r-s.height)/2;if(a.style.borderLeft="".concat(o,"px solid rgba(0, 0, 0, 0.48)"),a.style.borderRight="".concat(o,"px solid rgba(0, 0, 0, 0.48)"),a.style.borderTop="".concat(l,"px solid rgba(0, 0, 0, 0.48)"),a.style.borderBottom="".concat(l,"px solid rgba(0, 0, 0, 0.48)"),a.style.boxSizing="border-box",a.style.top="0px",a.style.bottom="0px",a.style.left="0px",a.style.right="0px",a.id="".concat(wf.SHADED_REGION_ELEMENT_ID),n-s.width<11||r-s.height<11)this.hasBorderShaders=!1;else{var c=5,u=40;this.insertShaderBorders(a,u,c,-c,null,0,!0),this.insertShaderBorders(a,u,c,-c,null,0,!1),this.insertShaderBorders(a,u,c,null,-c,0,!0),this.insertShaderBorders(a,u,c,null,-c,0,!1),this.insertShaderBorders(a,c,u+c,-c,null,-c,!0),this.insertShaderBorders(a,c,u+c,null,-c,-c,!0),this.insertShaderBorders(a,c,u+c,-c,null,-c,!1),this.insertShaderBorders(a,c,u+c,null,-c,-c,!1),this.hasBorderShaders=!0}t.append(a)}},e.prototype.insertShaderBorders=function(t,n,r,s,a,o,l){var c=document.createElement("div");c.style.position="absolute",c.style.backgroundColor=wf.BORDER_SHADER_DEFAULT_COLOR,c.style.width="".concat(n,"px"),c.style.height="".concat(r,"px"),s!==null&&(c.style.top="".concat(s,"px")),a!==null&&(c.style.bottom="".concat(a,"px")),l?c.style.left="".concat(o,"px"):c.style.right="".concat(o,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(c),t.appendChild(c)},e.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},e.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},e.prototype.getTimeoutFps=function(t){return 1e3/t},e}(),Wbe;(function(e){e[e.STATUS_DEFAULT=0]="STATUS_DEFAULT",e[e.STATUS_SUCCESS=1]="STATUS_SUCCESS",e[e.STATUS_WARNING=2]="STATUS_WARNING",e[e.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"})(Wbe||(Wbe={}));function e_(){const[e,t]=m.useState(!1),[n,r]=m.useState([]),[s,a]=m.useState(null),[o,l]=m.useState(null),c=m.useRef(null);m.useEffect(()=>{l(localStorage.getItem("hyperAddress"))},[]),m.useEffect(()=>{e&&Vbe.getCameras().then(d=>{r(d||[]);const x=d.find(g=>/back|environment/i.test(g.label))||d[0];x&&a(x.id)})},[e]),m.useEffect(()=>{if(!e||!s)return;const d=new Vbe("reader"),f={deviceId:{exact:s}},x={fps:10,qrbox:250};return d.start(f,x,g=>window.location.href=g,console.error),()=>d.stop().then(()=>d.clear())},[e,s]);const u=()=>{l(null),window.localStorage.removeItem("hyperAddress"),window.localStorage.removeItem("hyperToken"),setHyperToken(""),setHyperAddress(""),window.location.reload()};return i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:o?u:()=>t(!0),className:"font-bold w-full",children:o?i.jsx("span",{className:"text-red-400",children:"Logout"}):i.jsx("span",{className:"text-white",children:"Connect"})}),e&&i.jsx("div",{className:"fixed inset-0 grid place-items-center bg-black/60",children:i.jsxs("div",{className:"bg-[#1b1b1b] p-4 rounded-xl space-y-4",children:[i.jsx("select",{value:s||"",onChange:d=>a(d.target.value),className:"w-full p-2 rounded text-sm bg-slate-950 font-manrope font-bold",children:n.map(d=>i.jsx("option",{value:d.id,children:d.label||d.id},d.id))}),i.jsx("div",{id:"reader",ref:c,className:"w-[300px]"}),i.jsx("button",{onClick:()=>t(!1),className:"w-full p-2 rounded text-sm bg-red-400 text-black font-bold font-manrope",children:"Close"})]})})]})}const _Lt=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState(!1),[s,a]=m.useState(!1),[o,l]=m.useState(!1),[c,u]=m.useState(!1),[d,f]=m.useState(!1),[x,g]=m.useState(!1),[v,w]=m.useState(!1),[C,N]=m.useState(!1),I=()=>{t(!e)};return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"bg-[#171717] w-full px-2 sm:px-6 flex justify-between items-center border-b border-[#2a2a2a] z-50 h-[60px]",children:[i.jsx(ul,{to:"/",className:"cursor-pointer",children:i.jsx("div",{className:"flex justify-start items-center gap-[8.09px] font-manrope",children:i.jsxs("div",{className:"flex justify-start items-center min-w-max",children:[i.jsx("img",{src:Hi,alt:"Dextrabot",className:"w-[30.91321px] h-8"}),i.jsx("span",{className:"text-white font-manrope text-sm ml-2 font-semibold",children:"Dextrabot"})]})})}),i.jsxs("div",{className:"w-[84px] h-6 p-2 bg-[#232323] rounded-[256px] justify-start items-center gap-2.5 hidden sm:inline-flex cursor-not-allowed",children:[i.jsxs("div",{className:"h-4 justify-start items-center gap-[5px] flex",children:[i.jsx("img",{src:ax,alt:"Dextrabot",className:"w-3.5 h-3.5"}),i.jsx("div",{className:"text-white text-[11px] font-extrabold font-manrope leading-none",children:"HYPE"})]}),i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx(zh,{className:"text-white w-3 h-3"})})]}),i.jsx("div",{onClick:I,className:"p-2 bg-[#171717] cursor-pointer",children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 fill-current text-white",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]}),e&&i.jsxs("div",{className:"fixed inset-0 w-screen h-screen bg-[#171717]/10 z-50 backdrop-blur-xl overflow-hidden",children:[i.jsx("div",{onClick:I,className:"absolute top-3 right-2 p-2 bg-transparent cursor-pointer",children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 fill-current text-white",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),i.jsx("div",{className:"w-full h-full px-4 pt-5 pb-16 overflow-y-auto",children:i.jsxs("div",{className:"flex flex-col gap-2 w-full text-xl font-manrope items-start text-left [&>a]:text-white [&>a]:font-bold",children:[i.jsx(e_,{}),i.jsx(ul,{to:"/terminal/BTC",onClick:()=>t(!1),children:"Terminal"}),i.jsx(ul,{to:"/discover-wallets",onClick:()=>t(!1),children:"Discover Wallets"}),i.jsx(ul,{to:"/hyperliquid-vaults",onClick:()=>t(!1),children:"Discover Vaults"}),i.jsx(ul,{to:"/copy-trade",onClick:()=>t(!1),children:"My Copy Trading"}),i.jsx(ul,{to:"/wallet-management",onClick:()=>t(!1),children:"Wallet Management"}),i.jsx(ul,{to:"/ticker",onClick:()=>t(!1),children:"Ticker"}),i.jsx(ul,{to:"/leaderboard",onClick:()=>t(!1),children:"Leaderboard"}),i.jsx(ul,{to:"/referral",onClick:()=>t(!1),children:"Referral"}),i.jsx(ul,{to:"/tracked-wallets",onClick:()=>t(!1),children:"Tracked Wallets"}),i.jsx(ul,{to:"/tracker",onClick:()=>t(!1),children:"My Activities"}),i.jsx(ul,{to:"/hyperliquid-whale-trades",onClick:()=>t(!1),children:"Whale trades"}),i.jsx(ul,{to:"/back-testing",onClick:()=>t(!1),children:"Backtest"}),i.jsx(ul,{to:"/hyperliquid-fee-calculator ",onClick:()=>t(!1),children:"HL Fee Calculator"}),i.jsxs(ul,{to:"/terminal/extended/BTC#gridbot",onClick:()=>t(!1),children:["Extended Grid Bot ",i.jsx(m0,{})]}),i.jsxs(ul,{to:"/dca-bot",onClick:()=>t(!1),children:["Extended DCA Bot ",i.jsx(m0,{})]}),i.jsxs("div",{onClick:()=>g(!0),className:"text-white font-bold cursor-pointer inline-flex items-center",children:["Extended Farming ",i.jsx(m0,{tone:"emerald",label:"SMART"})]}),i.jsxs(ul,{to:"/terminal/lighter/BTC#gridbot",onClick:()=>t(!1),children:["Lighter Grid Bot ",i.jsx(m0,{})]}),i.jsxs(ul,{to:"/terminal/hyperliquid/BTC#gridbot",onClick:()=>t(!1),children:["HL Grid Bot ",i.jsx(m0,{})]}),i.jsx(ul,{to:"/market-maker",onClick:()=>t(!1),children:"HL Market Maker"}),i.jsx("div",{onClick:()=>a(!0),className:"text-white font-bold cursor-pointer",children:"Aster Farming"}),i.jsx("div",{onClick:()=>r(!0),className:"text-white font-bold cursor-pointer",children:"BasedApp Farming"}),i.jsx("div",{onClick:()=>l(!0),className:"text-white font-bold cursor-pointer inline-flex items-center",children:"Lighter Farming"}),i.jsx("div",{onClick:()=>u(!0),className:"text-white font-bold cursor-pointer inline-flex items-center",children:"Apex Farming"}),i.jsx("div",{onClick:()=>f(!0),className:"text-white font-bold cursor-pointer inline-flex items-center",children:"Variational Farming"}),i.jsx("div",{onClick:()=>w(!0),className:"text-white font-bold cursor-pointer inline-flex items-center",children:"Paradex Farming"}),i.jsx("div",{onClick:()=>N(!0),className:"text-white font-bold cursor-pointer inline-flex items-center",children:"Pacifica Farming"})]})})]}),i.jsx($oe,{open:n,setOpen:r}),i.jsx(Uoe,{open:s,setOpen:a}),i.jsx(zoe,{open:o,setOpen:l}),i.jsx(Hoe,{open:c,setOpen:u}),i.jsx(Voe,{open:d,setOpen:f}),i.jsx(v$,{open:x,setOpen:g}),i.jsx(Woe,{open:v,setOpen:w}),i.jsx(qoe,{open:C,setOpen:N})]})},SLe=({className:e})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",className:e,children:[i.jsx("path",{d:"M1 9L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9 9L1 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),kLt=()=>{var he,Y,ie,oe,G,V;const e=m.useRef(null),[t,n]=m.useState(!1),[r,s]=m.useState([]),[a,o]=m.useState([]),[l,c]=m.useState(!1),[u,d]=m.useState(!1),[f,x]=m.useState(()=>{const ee=localStorage.getItem("isToasterMinimized");return ee===null?!1:ee==="true"});m.useEffect(()=>{localStorage.setItem("isToasterMinimized",f)},[f]);const[g,v]=m.useState([]),C=localStorage.getItem("isDateToasterFormat")||"date",[N,I]=m.useState(C);m.useEffect(()=>{localStorage.setItem("isDateToasterFormat",N)},[N]);const[P,R]=m.useState(0),F=m.useRef(null),[U,L]=m.useState(null),[z,X]=m.useState(0),ne=1e4;m.useEffect(()=>{if(l||r.length===0||t){clearInterval(F.current);return}const ee=Date.now();return L(ee),F.current=setTimeout(()=>{R(ae=>(ae+1)%r.length),X(0)},ne-z),()=>clearTimeout(F.current)},[l,r.length,t,P,z]),m.useEffect(()=>{P>=(r==null?void 0:r.length)&&R(0)},[r]);async function J(){try{d(!0);const ee=await fetch("https://dextrabothypev2.nftinit.io/api/hyper/analysis/getallmetrics/");if(!ee.ok)throw new Error(`Server responded with status ${ee.status}`);const ae=await ee.json();ae&&s(ae.refcodes)}catch(ee){return console.error("Error fetching metrics:",ee.message),null}finally{d(!1)}}m.useEffect(()=>{let ee;return f||(J(),ee=setInterval(()=>{J()},6e4)),()=>{ee&&clearInterval(ee)}},[f]),m.useEffect(()=>{var ee;if((r==null?void 0:r.length)>0)if((a==null?void 0:a.length)<(r==null?void 0:r.length)){const ae=[...a??[]],fe=Array.from({length:(r==null?void 0:r.length)-((a==null?void 0:a.length)??0)},(Ne,be)=>be+((a==null?void 0:a.length)??0)),Ae=fe==null?void 0:fe.sort(()=>Math.random()-.5),ce=[...ae,...Ae??[]];o(ce);const ye=ce==null?void 0:ce.map(Ne=>r==null?void 0:r[Ne]);v(ye)}else{const ae=(ee=a==null?void 0:a.map(fe=>r==null?void 0:r[fe]))==null?void 0:ee.filter(Boolean);v(ae)}},[r]);const[Z,re]=m.useState(!1);return i.jsxs("div",{className:"absolute right-6 bottom-[72px] sm:bottom-6 rounded-[20px] z-50",children:[f&&i.jsx("div",{onClick:()=>{x(ee=>{const ae=!ee;return localStorage.setItem("isToasterMinimized",ae?"true":"false"),ae})},className:"fixed bottom-10 right-4 z-50 cursor-pointer bg-[#2a2a2a]/60 hover:bg-[#2a2a2a] rounded-full w-12 h-12 flex items-center justify-center shadow-md group",children:i.jsx("img",{src:ske,alt:"Toggle",className:"w-8 h-8 opacity-90 group-hover:opacity-100"})}),(!f||Z)&&i.jsxs("div",{style:{background:"rgba(32, 32, 32, 0.86)",boxShadow:"0px 4px 16px 0px rgba(0, 0, 0, 0.32)",backdropFilter:"blur(16px)"},className:`${Z?"bounceShrink-Close-Toaster-Close":""} w-full h-full min-h-full relative rounded-[20px]`,children:[i.jsxs("div",{onClick:()=>{c(!l)},style:{backgroundColor:"rgba(40, 40, 42, 0.75)",backdropFilter:"blur(10px)"},className:`${(r==null?void 0:r.length)>0?"":"hidden"} cursor-pointer w-full h-[20px] rounded-t-full flex justify-center items-center relative`,children:[i.jsx("div",{className:"w-[36px] h-[4px] bg-[rgba(255,255,255,0.3)] rounded-[2px]"}),i.jsx("div",{onClick:ee=>{ee.stopPropagation(),re(!0),setTimeout(()=>{x(ae=>{const fe=!ae;return localStorage.setItem("isToasterMinimized",fe?"true":"false"),fe}),re(!1)},600)},className:"w-6 h-4 rounded-[2px] absolute group right-[14px]",children:i.jsx("span",{className:"flex items-center justify-center h-full",children:i.jsx(SLe,{className:"w-2 h-2 text-[#7A7A7A] group-hover:text-white"})})})]}),i.jsx("div",{className:`${l?"max-h-[70vh] lg:max-h-[75vh] min-h-[100px] overflow-y-scroll pl-2 py-2 pr-1 rounded-[20px]":"min-h-full h-full p-0 rounded-b-[20px]"} flex flex-col items-start gap-2 bg-transparent max-w-[356px] transition-all duration-300 overflow-hidden`,children:!l&&(r==null?void 0:r.length)>0?i.jsx("div",{style:{backgroundColor:" rgba(32, 32, 32, 0.86)",boxShadow:"0px 4px 16px 0px rgba(0, 0, 0, 0.64)",backdropFilter:"blur(16px)"},onMouseEnter:()=>{e.current&&(e.current.style.animationPlayState="paused"),n(!0),U&&X(ee=>ee+(Date.now()-U))},onMouseLeave:()=>{e.current&&(e.current.style.animationPlayState="running"),n(!1)},className:"relative h-full w-full overflow-hidden",children:i.jsx("div",{className:"w-full h-full flex flex-col justify-start items-start animate-fade-slide transition-all duration-500",children:i.jsx(qbe,{content:(he=g[P])==null?void 0:he.result,createdAt:(Y=g[P])==null?void 0:Y.created_at,category:(ie=g[P])==null?void 0:ie.category,metric:(oe=g[P])==null?void 0:oe.metric,metricId:(G=g[P])==null?void 0:G.metric_definition_id,isDeleted:(V=g[P])==null?void 0:V.is_deleted,isDateToasterFormat:N,setIsDateToasterFormat:I,isDropdownOpen:l,activeIndex:P,progressRef:e})},`toast-${P}`)}):g==null?void 0:g.map((ee,ae)=>i.jsx(qbe,{content:ee==null?void 0:ee.result,createdAt:ee==null?void 0:ee.created_at,category:ee==null?void 0:ee.category,metric:ee==null?void 0:ee.metric,metricId:ee==null?void 0:ee.metric_definition_id,isDeleted:ee==null?void 0:ee.is_deleted,isDateToasterFormat:N,setIsDateToasterFormat:I,isDropdownOpen:l,progressRef:e},ae))})]})]})},qbe=({content:e,createdAt:t,category:n,metric:r,metricId:s,isDeleted:a,isDateToasterFormat:o,setIsDateToasterFormat:l,isDropdownOpen:c,activeIndex:u,progressRef:d})=>{var I,P;function f({date:R}){const[F,U]=m.useState(To(R));return m.useEffect(()=>{const L=setInterval(()=>{U(To(R))},1e3);return()=>clearInterval(L)},[R]),i.jsxs("span",{className:"text-[#989898] text-[11px] font-normal font-inter leading-[13px] tracking-tight italic",children:["updated ",F==null?void 0:F.dateTime]})}const x=s===1||s===2||s===3,g=s===4||s===5||s===6,v=s===7||s===8||s===9,w=s===1||s===4||s===7,C=s===2||s===5||s===8,N=s===3||s===6||s===9;return i.jsxs("div",{onClick:R=>{R.preventDefault(),window.open(`/wallet-details/${(e==null?void 0:e.dextraaddress)||(e==null?void 0:e.sourceaddress)}`,"_blank")},style:x?{background:"rgba(32, 32, 32, 0.86)",boxShadow:"0px 4px 16px 0px rgba(0, 0, 0, 0.32)",backdropFilter:"blur(16px)"}:g?{background:"#FF42170A",boxShadow:"0px 4px 16px 0px rgba(0, 0, 0, 0.32)",backdropFilter:"blur(16px)"}:v?{background:"#00FF910A",boxShadow:"0px 4px 16px 0px rgba(0, 0, 0, 0.32)",backdropFilter:"blur(16px)"}:{},className:`${c?"rounded-[20px]":"rounded-b-[20px]"} ${x||v?"min-h-[107px]":g?"min-h-[123px]":""}
       w-full flex gap-2 items-start justify-start px-3 pt-3 pb-2 bg-[#2b2b2b] hover:bg-[#404040] relative overflow-hidden cursor-pointer`,children:[i.jsx("div",{className:"w-10 h-10  rounded-[256px] blur-xl absolute -z-10 top-2 left-2"}),i.jsx("div",{style:x?{backgroundColor:"#FFC526"}:g?{background:"linear-gradient(180deg, #FF7300 0%, #FF2525 100%)",backgroundBlendMode:"lighten, normal, normal",boxShadow:"0px 4px 24px 0px rgba(255, 96, 10, 0.32), 0px 1px 1px 0px rgba(255, 255, 255, 0.32) inset"}:v?{background:"linear-gradient(180deg, #00FF90 0%, #00FF4D 100%)",boxShadow:"0px 4px 24px 0px rgba(44, 255, 163, 0.32), 0px 1px 1px 0px rgba(255, 255, 255, 0.32) inset"}:{},className:`${c?"":"toaster-animation-shake-animate"} flex justify-center items-center overflow-hidden w-10 h-10 min-w-10 min-h-10 rounded-full`,children:i.jsx("img",{src:`${x?ske:g?nke:v?wyt:""}`,alt:"",className:`${x?"w-[40px] h-[40px] min-w-[40px] min-h-[40px]":"w-[24px] h-[24px] min-w-[24px] min-h-[24px]"}`,loading:"lazy",onError:R=>sm(R)})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-[3px] w-full",children:[i.jsxs("div",{className:"flex justify-between items-center gap-1",children:[i.jsxs("p",{className:"text-white text-[13px] font-semibold font-['Manrope'] leading-[16px]",children:[i.jsxs("span",{className:"inline-flex justify-start items-center gap-1 cursor-pointer min-w-max max-w-max h-[18px] p-1 mr-1 bg-white/[0.06] rounded-md",children:[i.jsx("span",{className:"text-white text-[13px] font-semibold font-manrope leading-none ",children:e!=null&&e.dextraaddress||e!=null&&e.sourceaddress?((I=(e==null?void 0:e.dextraaddress)||(e==null?void 0:e.sourceaddress))==null?void 0:I.slice(0,5))+".."+((P=(e==null?void 0:e.dextraaddress)||(e==null?void 0:e.sourceaddress))==null?void 0:P.slice(-4)):"--"}),i.jsx("img",{onClick:R=>{R.stopPropagation(),navigator.clipboard.writeText((e==null?void 0:e.dextraaddress)||(e==null?void 0:e.sourceaddress)),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:bo,alt:"",className:"cursor-pointer"})]}),x?`is one of ${w?"today's":C?"week's":N?"month's":""} most profitable Top Follower Wallets!`:g?`has generated $${e!=null&&e.earned_rpnl?Er(e==null?void 0:e.earned_rpnl):"-"} in profits for its followers ${w?"today":C?"this week":N?"this month":""} - a wallet you’ll want to watch!`:v?`is one of ${w?"today's":C?"this week's":N?"this month's":""} most copied wallets!`:""]}),i.jsx("div",{className:`${x?"-mt-[18px]":g?"-mt-[30px]":v?"-mt-[16px]":""} w-[18px] h-[18px] min-w-[18px] min-h-[18px] flex justify-center items-start rounded `,children:i.jsx("img",{src:nae,alt:""})})]}),i.jsxs("div",{className:"flex justify-start items-center gap-1 mt-2",children:[i.jsxs("div",{className:`${c?"":"toaster-animation-shake-new-profit-animate"} p-1.5 bg-[#67ffbd]/20 rounded-md inline-flex justify-center items-center gap-1 max-h-5`,children:[v&&i.jsx("img",{src:Cyt,alt:"",className:"w-[14px] h-[14px]"}),g&&i.jsx("img",{src:Syt,alt:"",className:"w-[14px] h-[10px]"}),i.jsx("div",{className:"justify-start text-[#67ffbd] text-[11px] font-semibold font-['Manrope'] leading-[8px]",children:x?`+$${e!=null&&e.rpnl?Er(e==null?void 0:e.rpnl):"-"}`:g?`+$${e!=null&&e.earned_rpnl?Er(e==null?void 0:e.earned_rpnl):"-"}`:v?Er(e==null?void 0:e.copier_count):""})]}),i.jsx("div",{className:`${x?"bg-white/20":g?"bg-[#FF670029]":v?"bg-[#67FFBD29]":""} p-1.5  rounded-md inline-flex justify-center items-center gap-1`,children:i.jsx("div",{className:`${x?"text-white":g?"text-[#FF6700]":v?"text-[#67FFBD]":""} justify-start  text-[11px] font-semibold font-['Manrope'] leading-[8px]`,children:x?"Top Follower Wallets":g?"Top Source Wallets":v?"Most Copied Wallets":""})}),i.jsx("div",{className:`${x?"bg-white/20":g?"bg-[#FF670029]":v?"bg-[#67FFBD29]":""} w-max p-1.5 rounded-md inline-flex justify-center items-center gap-1"
        `,children:i.jsx("div",{className:`${x?"text-white":g?"text-[#FF6700]":v?"text-[#67FFBD]":""} justify-start text-[11px] font-semibold font-['Manrope'] leading-[8px]`,children:w?"1D":C?"7D":N?"30D":""})})]}),i.jsxs("div",{className:`${c?"justify-start":"justify-between"} flex items-center w-full mt-1.5`,children:[i.jsx("div",{onClick:R=>{R.stopPropagation(),l(o=="date"?"time":"date")},className:"flex justify-end items-center text-[#989898] text-[11px] font-medium font-['Inter'] leading-[13px] tracking-tight cursor-pointer min-w-max w-max italic",children:o=="date"?i.jsx(f,{date:t}):eu(t)}),!c&&i.jsx("div",{className:"w-[26px] h-[3px] bg-[#3a3a3a]  rounded overflow-hidden",children:!c&&i.jsx("div",{ref:d,className:"h-full bg-white progress-bar-animate"},`progress-${u}`)})]})]})]})},TLt=()=>i.jsx("div",{onClick:()=>{window.open("https://x.com/dextrabot","_blank")},className:"flex justify-center items-center bg-transparent rounded-full cursor-pointer h-6 w-6 min-h-6",children:i.jsx("img",{src:yyt,alt:"",className:"w-[14px] h-[14px]"})}),ILt=()=>i.jsx("div",{onClick:()=>{window.open("https://discord.gg/dextrabot","_blank")},className:"flex justify-center items-center gap-2.5 bg-transparent rounded-2xl cursor-pointer h-6 w-6 min-h-6",children:i.jsx("img",{src:rke,alt:"",className:"w-[14px] h-[14px]"})}),PLt=()=>i.jsx("div",{onClick:()=>{window.open("https://t.me/Dextrabot_Official","_blank")},className:"flex justify-center items-center gap-2.5 bg-transparent rounded-2xl cursor-pointer h-6 w-6 min-h-6",children:i.jsx("img",{src:vyt,alt:"",className:"w-[14px] h-[14px]"})}),FLt=()=>i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/","_blank"),className:"h-6 w-max min-h-6 py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer",children:[i.jsx("img",{src:s5,className:"w-[14px] h-[14px]"}),i.jsx("div",{className:"min-w-max text-white text-xs font-medium font-manrope leading-none pointer-events-none",children:"Docs"})]}),OLt=({open:e,setOpen:t,favoriteName:n,setFavoriteName:r,likeError:s,like:a,setLikeError:o})=>i.jsxs(ga,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-[34px]",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),r(""),o("")},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Oa})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Gbt,alt:"",className:"w-[64px h-[64px]"})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-4",children:[i.jsx("div",{className:"w-80 text-center text-white text-2xl font-semibold font-manrope leading-7 pt-[3px]",children:"Track Wallet"}),i.jsx("div",{className:"w-[248px] text-center text-white/60 text-sm font-medium font-manrope leading-none tracking-tight -mt-[8px]",children:"Enter tag for your wallet"}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-full pt-[39px] pl-[20px]",children:[i.jsx("div",{className:"text-[#b7b7b7] text-[13px] font-semibold font-manrope leading-[8px]",children:"Tag"}),i.jsx("div",{className:"text-[#7b7b7b] text-sm font-medium font-inter leading-[8px]",children:"(ex:twain_wallet)"})]}),i.jsx("input",{type:"text",value:n,onChange:l=>r(l.target.value),placeholder:"Wallet Tag",className:"px-2.5 py-3 focus:outline-none focus:ring-0 outline-none w-[286px] min-w-[286px] h-8 bg-[#1b1b1b] rounded-[10px] border border-[#303030] text-white placeholder:text-[#7b7b7b] placeholder:text-sm placeholder:font-medium placeholder:font-inter placeholder:leading-[8px] -mt-[2px]"}),i.jsxs("div",{onClick:()=>{a(n)},className:"w-[285px] h-8 pl-2 pr-3.5 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer -mt-[2px]",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Track"})]}),i.jsx("div",{className:"text-[#ff6e67] text-xs font-semibold font-manrope absolute bottom-2.5 mx-auto w-full pl-[58px]",children:s&&s})]})]})})})})})]});function x5({walletAddress:e,children:t}){const{isConnected:n,address:r}=Yr(),{trackedWatchList:s,getTrackedWatchList:a,setSignModalOpen:o}=m.useContext(Gr),[l,c]=m.useState(""),[u,d]=m.useState(!1),[f,x]=m.useState(""),g=async C=>{try{const N=window.localStorage.getItem("hyperToken"),I="https://dextrabothypev2.nftinit.io/api/hyper/tracker/save/",P=window.localStorage.getItem("hyperAddress");if(N||o(!0),!C){x("Please enter a wallet label.");return}const R=await fetch(I,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:r?r.toLowerCase():P,token:N,track_address:e,tag:C})});R.ok;const F=await R.json();F.success?(a(),c(""),d(!1),x(""),on.success(i.jsxs(i.Fragment,{children:[i.jsx("span",{children:e.slice(0,5)+"..."+e.slice(-3)}),i.jsxs("span",{style:{color:"#67ffbd",paddingLeft:"5px"},children:[" ","added to tracked wallets"]})]}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.32)",width:"380px",minWidth:"380px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})):(console.log(F.error_message),on.error(F.error_message),x(F.error_message))}catch(N){console.error("Error in like function:",N),on.error(N.message||"Something went wrong!"),x(N.message)}},v=async()=>{try{const C=window.localStorage.getItem("hyperToken"),N=window.localStorage.getItem("hyperAddress"),I="https://dextrabothypev2.nftinit.io/api/hyper/tracker/unfollow/";C||o(!0);const P=await fetch(I,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:r?r.toLowerCase():N,token:C,track_address:e})});if(!P.ok)throw new Error(`Failed to unlike: ${P.status} ${P.statusText}`);const R=await P.json();R.success?(a(),on.success(i.jsxs(i.Fragment,{children:[i.jsx("span",{children:e.slice(0,5)+"..."+e.slice(-3)}),i.jsxs("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:[" ","removed from tracked wallets"]})]}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})):(console.error(R.error_message),on.error(R.error_message))}catch(C){console.error("Error in unlike function:",C),on.error(C.message||"Something went wrong!")}},w=()=>{window.localStorage.getItem("hyperToken")?d(!0):o(!0)};return i.jsxs(i.Fragment,{children:[i.jsx(OLt,{open:u,setOpen:d,like:g,favoriteName:l,setFavoriteName:c,likeError:f,setLikeError:x}),i.jsx("div",{className:"",onClick:()=>{s!=null&&s.some(C=>C.wallet_address===e)?v():w()},children:t})]})}function MLt({open:e,setOpen:t,copyTradeSave:n}){return i.jsxs(ga,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Oa})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Hi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-2",children:[i.jsx("div",{className:"w-80 text-center text-white text-2xl font-semibold font-manropeleading-7",children:"Are you sure?"}),i.jsx("div",{className:"w-[348px] text-center text-white/60 text-[16px] font-medium font-manrope leading-5",children:"You have not set a Stop Loss or Take Profit for this trade. In order to set a secondary security option for potential Hyperliquid data delays, server issues, or other technical disruptions, you may want to set up your own stop loss and take profit values."})]}),i.jsxs("div",{className:"flex  items-center justify-center gap-4",children:[i.jsx("div",{onClick:()=>{t(!1)},className:"h-8 px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Cancel"})}),i.jsx("div",{onClick:()=>{n()},className:"h-8 px-2.5 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Yes"})})]})]})})})})})]})}const ea=(e,t=null)=>{t&&e.target.src===t?e.target.src=Ua:t&&e.target.src!==t?e.target.src=t:e.target.src!==Ua&&(e.target.src=Ua)};function RLt({positions:e,loading:t}){const[n,r]=m.useState(!1),[s,a]=m.useState("upnl"),[o,l]=m.useState("desc"),c=d=>{s===d?l(o==="asc"?"desc":"asc"):(a(d),l("asc"))},u=m.useMemo(()=>{if(!e||e.length===0)return[];const d=[...e];return s&&d.sort((f,x)=>{var g,v;if(s==="coin"){const w=((g=f.asset)==null?void 0:g.toLowerCase())||"",C=((v=x.asset)==null?void 0:v.toLowerCase())||"";return w<C?o==="asc"?-1:1:w>C?o==="asc"?1:-1:0}if(s==="upnl"){const w=parseFloat(f.unrealizedPnl)||0,C=parseFloat(x.unrealizedPnl)||0;return w<C?o==="asc"?-1:1:w>C?o==="asc"?1:-1:0}return 0}),d},[e,s,o]);return m.useEffect(()=>{if(t)r(!1);else{r(!1);const d=setTimeout(()=>{r(!0)},500);return()=>clearTimeout(d)}},[t]),t||!n?i.jsx("div",{className:"flex w-full justify-center items-center text-center h-[36vh] max-h-[170px]",children:i.jsx(Ma,{})}):!u||u.length===0?i.jsx("div",{className:"flex w-full justify-center items-center text-center h-[36vh] max-h-[170px]",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ec,alt:""}),i.jsx("div",{className:"flex flex-col items-center h-max gap-3",children:i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No open positions are currently available"})})]})}):i.jsx("div",{className:"relative w-full",children:i.jsx("div",{className:"w-full overflow-y-auto max-h-[156px] h-full flex-grow mt-[1px] mb-3 pb-24",children:i.jsxs("table",{className:"w-full relative border-separate border-spacing-y-1",children:[i.jsx("thead",{className:"sticky top-0 z-[3] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] font-semibold leading-[13px] tracking-[0.26px] text-[#9b9b9b] bg-[#242424] text-[13px] font-manrope mr-3",children:[i.jsx("th",{scope:"col",className:"sticky left-0 h-10 pl-2 sm:pl-6 min-w-[80px] z-[8] cursor-pointer",onClick:()=>c("coin"),children:i.jsxs("div",{className:"flex items-center justify-start w-full gap-1 min-w-max max-w-max",children:["Coin",s==="coin"?o==="asc"?i.jsx(k3,{}):i.jsx(_3,{}):i.jsx(T3,{})]})}),i.jsx("th",{scope:"col",className:"px-1",children:i.jsx("div",{className:"flex items-center justify-start w-full gap-1 min-w-max max-w-max",children:"Type"})}),i.jsx("th",{scope:"col",className:"px-4 text-right cursor-pointer",onClick:()=>c("upnl"),children:i.jsxs("div",{className:"inline-flex items-center justify-end w-full gap-1",children:[i.jsx("span",{children:"uPnL"}),s==="upnl"?o==="asc"?i.jsx(k3,{}):i.jsx(_3,{}):i.jsx(T3,{})]})})]})}),i.jsx("tbody",{children:u.map((d,f)=>{const x=parseFloat(d.unrealizedPnl)>=0,g=d.type==="Long"?"text-[#67FFBD] rotate-180":"text-[#FF797C]";return i.jsxs("tr",{className:`relative group hover:bg-[#222222] text-white h-[32px] max-h-[32px] rounded-2xl ${f%2===0?"bg-[#202020]":"bg-[#2D2D2D]"}`,children:[i.jsx("td",{scope:"row",className:"sticky left-0 z-[2] rounded-l-xl",children:i.jsx("div",{onClick:()=>{window.open(`/terminal/${d==null?void 0:d.asset}`,"_blank")},className:"flex justify-start items-center gap-2 pl-2 sm:pl-6 h-8 max-h-14 cursor-pointer",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"w-5 h-5 rounded-full",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${d==null?void 0:d.asset}.svg`,alt:d==null?void 0:d.asset,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:v=>ea(v)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:d.asset})]})})}),i.jsx("td",{children:i.jsx("div",{className:"flex justify-start items-center gap-2 h-8 max-h-8",children:i.jsxs("div",{className:`${d.type==="Long"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex`,children:[i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx("div",{className:"w-3 h-3 relative",children:i.jsx(Es,{className:`${g} w-3 h-3`})})}),i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-wide uppercase",children:d.type})]})})}),i.jsx("td",{className:"rounded-r-xl text-right pr-2",children:i.jsx("div",{className:`${x?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-tight`,children:`$${Er(d.unrealizedPnl||0)}`})})]},f)})})]})})})}const{min:LLt,max:DLt}=Math,t3=(e,t=0,n=1)=>LLt(DLt(t,e),n),xle=e=>{e._clipped=!1,e._unclipped=e.slice(0);for(let t=0;t<=3;t++)t<3?((e[t]<0||e[t]>255)&&(e._clipped=!0),e[t]=t3(e[t],0,255)):t===3&&(e[t]=t3(e[t],0,1));return e},NLe={};for(let e of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])NLe[`[object ${e}]`]=e.toLowerCase();function $i(e){return NLe[Object.prototype.toString.call(e)]||"object"}const Ei=(e,t=null)=>e.length>=3?Array.prototype.slice.call(e):$i(e[0])=="object"&&t?t.split("").filter(n=>e[0][n]!==void 0).map(n=>e[0][n]):e[0].slice(0),zA=e=>{if(e.length<2)return null;const t=e.length-1;return $i(e[t])=="string"?e[t].toLowerCase():null},{PI:_$,min:ALe,max:jLe}=Math,Kh=e=>Math.round(e*100)/100,tte=e=>Math.round(e*100)/100,cg=_$*2,AW=_$/3,BLt=_$/180,$Lt=180/_$;function ELe(e){return[...e.slice(0,3).reverse(),...e.slice(3)]}const Ci={format:{},autodetect:[]};let qr=class{constructor(...t){const n=this;if($i(t[0])==="object"&&t[0].constructor&&t[0].constructor===this.constructor)return t[0];let r=zA(t),s=!1;if(!r){s=!0,Ci.sorted||(Ci.autodetect=Ci.autodetect.sort((a,o)=>o.p-a.p),Ci.sorted=!0);for(let a of Ci.autodetect)if(r=a.test(...t),r)break}if(Ci.format[r]){const a=Ci.format[r].apply(null,s?t:t.slice(0,-1));n._rgb=xle(a)}else throw new Error("unknown format: "+t);n._rgb.length===3&&n._rgb.push(1)}toString(){return $i(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}};const ULt="3.1.2",di=(...e)=>new qr(...e);di.version=ULt;const gN={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},zLt=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,HLt=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,_Le=e=>{if(e.match(zLt)){(e.length===4||e.length===7)&&(e=e.substr(1)),e.length===3&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e,16),n=t>>16,r=t>>8&255,s=t&255;return[n,r,s,1]}if(e.match(HLt)){(e.length===5||e.length===9)&&(e=e.substr(1)),e.length===4&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const t=parseInt(e,16),n=t>>24&255,r=t>>16&255,s=t>>8&255,a=Math.round((t&255)/255*100)/100;return[n,r,s,a]}throw new Error(`unknown hex color: ${e}`)},{round:yP}=Math,kLe=(...e)=>{let[t,n,r,s]=Ei(e,"rgba"),a=zA(e)||"auto";s===void 0&&(s=1),a==="auto"&&(a=s<1?"rgba":"rgb"),t=yP(t),n=yP(n),r=yP(r);let l="000000"+(t<<16|n<<8|r).toString(16);l=l.substr(l.length-6);let c="0"+yP(s*255).toString(16);switch(c=c.substr(c.length-2),a.toLowerCase()){case"rgba":return`#${l}${c}`;case"argb":return`#${c}${l}`;default:return`#${l}`}};qr.prototype.name=function(){const e=kLe(this._rgb,"rgb");for(let t of Object.keys(gN))if(gN[t]===e)return t.toLowerCase();return e};Ci.format.named=e=>{if(e=e.toLowerCase(),gN[e])return _Le(gN[e]);throw new Error("unknown color name: "+e)};Ci.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&$i(e)==="string"&&gN[e.toLowerCase()])return"named"}});qr.prototype.alpha=function(e,t=!1){return e!==void 0&&$i(e)==="number"?t?(this._rgb[3]=e,this):new qr([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]};qr.prototype.clipped=function(){return this._rgb._clipped||!1};const M0={Kn:18,labWhitePoint:"d65",Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},VLt=new Map([["a",[1.0985,.35585]],["b",[1.0985,.35585]],["c",[.98074,1.18232]],["d50",[.96422,.82521]],["d55",[.95682,.92149]],["d65",[.95047,1.08883]],["e",[1,1,1]],["f2",[.99186,.67393]],["f7",[.95041,1.08747]],["f11",[1.00962,.6435]],["icc",[.96422,.82521]]]);function Ig(e){const t=VLt.get(String(e).toLowerCase());if(!t)throw new Error("unknown Lab illuminant "+e);M0.labWhitePoint=e,M0.Xn=t[0],M0.Zn=t[1]}function t_(){return M0.labWhitePoint}const gle=(...e)=>{e=Ei(e,"lab");const[t,n,r]=e,[s,a,o]=WLt(t,n,r),[l,c,u]=TLe(s,a,o);return[l,c,u,e.length>3?e[3]:1]},WLt=(e,t,n)=>{const{kE:r,kK:s,kKE:a,Xn:o,Yn:l,Zn:c}=M0,u=(e+16)/116,d=.002*t+u,f=u-.005*n,x=d*d*d,g=f*f*f,v=x>r?x:(116*d-16)/s,w=e>a?Math.pow((e+16)/116,3):e/s,C=g>r?g:(116*f-16)/s,N=v*o,I=w*l,P=C*c;return[N,I,P]},jW=e=>{const t=Math.sign(e);return e=Math.abs(e),(e<=.0031308?e*12.92:1.055*Math.pow(e,1/2.4)-.055)*t},TLe=(e,t,n)=>{const{MtxAdaptMa:r,MtxAdaptMaI:s,MtxXYZ2RGB:a,RefWhiteRGB:o,Xn:l,Yn:c,Zn:u}=M0,d=l*r.m00+c*r.m10+u*r.m20,f=l*r.m01+c*r.m11+u*r.m21,x=l*r.m02+c*r.m12+u*r.m22,g=o.X*r.m00+o.Y*r.m10+o.Z*r.m20,v=o.X*r.m01+o.Y*r.m11+o.Z*r.m21,w=o.X*r.m02+o.Y*r.m12+o.Z*r.m22,C=(e*r.m00+t*r.m10+n*r.m20)*(g/d),N=(e*r.m01+t*r.m11+n*r.m21)*(v/f),I=(e*r.m02+t*r.m12+n*r.m22)*(w/x),P=C*s.m00+N*s.m10+I*s.m20,R=C*s.m01+N*s.m11+I*s.m21,F=C*s.m02+N*s.m12+I*s.m22,U=jW(P*a.m00+R*a.m10+F*a.m20),L=jW(P*a.m01+R*a.m11+F*a.m21),z=jW(P*a.m02+R*a.m12+F*a.m22);return[U*255,L*255,z*255]},ble=(...e)=>{const[t,n,r,...s]=Ei(e,"rgb"),[a,o,l]=ILe(t,n,r),[c,u,d]=qLt(a,o,l);return[c,u,d,...s.length>0&&s[0]<1?[s[0]]:[]]};function qLt(e,t,n){const{Xn:r,Yn:s,Zn:a,kE:o,kK:l}=M0,c=e/r,u=t/s,d=n/a,f=c>o?Math.pow(c,1/3):(l*c+16)/116,x=u>o?Math.pow(u,1/3):(l*u+16)/116,g=d>o?Math.pow(d,1/3):(l*d+16)/116;return[116*x-16,500*(f-x),200*(x-g)]}function EW(e){const t=Math.sign(e);return e=Math.abs(e),(e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4))*t}const ILe=(e,t,n)=>{e=EW(e/255),t=EW(t/255),n=EW(n/255);const{MtxRGB2XYZ:r,MtxAdaptMa:s,MtxAdaptMaI:a,Xn:o,Yn:l,Zn:c,As:u,Bs:d,Cs:f}=M0;let x=e*r.m00+t*r.m10+n*r.m20,g=e*r.m01+t*r.m11+n*r.m21,v=e*r.m02+t*r.m12+n*r.m22;const w=o*s.m00+l*s.m10+c*s.m20,C=o*s.m01+l*s.m11+c*s.m21,N=o*s.m02+l*s.m12+c*s.m22;let I=x*s.m00+g*s.m10+v*s.m20,P=x*s.m01+g*s.m11+v*s.m21,R=x*s.m02+g*s.m12+v*s.m22;return I*=w/u,P*=C/d,R*=N/f,x=I*a.m00+P*a.m10+R*a.m20,g=I*a.m01+P*a.m11+R*a.m21,v=I*a.m02+P*a.m12+R*a.m22,[x,g,v]};qr.prototype.lab=function(){return ble(this._rgb)};const GLt=(...e)=>new qr(...e,"lab");Object.assign(di,{lab:GLt,getLabWhitePoint:t_,setLabWhitePoint:Ig});Ci.format.lab=gle;Ci.autodetect.push({p:2,test:(...e)=>{if(e=Ei(e,"lab"),$i(e)==="array"&&e.length===3)return"lab"}});qr.prototype.darken=function(e=1){const t=this,n=t.lab();return n[0]-=M0.Kn*e,new qr(n,"lab").alpha(t.alpha(),!0)};qr.prototype.brighten=function(e=1){return this.darken(-e)};qr.prototype.darker=qr.prototype.darken;qr.prototype.brighter=qr.prototype.brighten;qr.prototype.get=function(e){const[t,n]=e.split("."),r=this[t]();if(n){const s=t.indexOf(n)-(t.substr(0,2)==="ok"?2:0);if(s>-1)return r[s];throw new Error(`unknown channel ${n} in mode ${t}`)}else return r};const{pow:KLt}=Math,YLt=1e-7,XLt=20;qr.prototype.luminance=function(e,t="rgb"){if(e!==void 0&&$i(e)==="number"){if(e===0)return new qr([0,0,0,this._rgb[3]],"rgb");if(e===1)return new qr([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),r=XLt;const s=(o,l)=>{const c=o.interpolate(l,.5,t),u=c.luminance();return Math.abs(e-u)<YLt||!r--?c:u>e?s(o,c):s(c,l)},a=(n>e?s(new qr([0,0,0]),this):s(this,new qr([255,255,255]))).rgb();return new qr([...a,this._rgb[3]])}return QLt(...this._rgb.slice(0,3))};const QLt=(e,t,n)=>(e=_W(e),t=_W(t),n=_W(n),.2126*e+.7152*t+.0722*n),_W=e=>(e/=255,e<=.03928?e/12.92:KLt((e+.055)/1.055,2.4)),ku={},bN=(e,t,n=.5,...r)=>{let s=r[0]||"lrgb";if(!ku[s]&&!r.length&&(s=Object.keys(ku)[0]),!ku[s])throw new Error(`interpolation mode ${s} is not defined`);return $i(e)!=="object"&&(e=new qr(e)),$i(t)!=="object"&&(t=new qr(t)),ku[s](e,t,n).alpha(e.alpha()+n*(t.alpha()-e.alpha()))};qr.prototype.mix=qr.prototype.interpolate=function(e,t=.5,...n){return bN(this,e,t,...n)};qr.prototype.premultiply=function(e=!1){const t=this._rgb,n=t[3];return e?(this._rgb=[t[0]*n,t[1]*n,t[2]*n,n],this):new qr([t[0]*n,t[1]*n,t[2]*n,n],"rgb")};const{sin:ZLt,cos:JLt}=Math,PLe=(...e)=>{let[t,n,r]=Ei(e,"lch");return isNaN(r)&&(r=0),r=r*BLt,[t,JLt(r)*n,ZLt(r)*n]},yle=(...e)=>{e=Ei(e,"lch");const[t,n,r]=e,[s,a,o]=PLe(t,n,r),[l,c,u]=gle(s,a,o);return[l,c,u,e.length>3?e[3]:1]},eDt=(...e)=>{const t=ELe(Ei(e,"hcl"));return yle(...t)},{sqrt:tDt,atan2:nDt,round:rDt}=Math,FLe=(...e)=>{const[t,n,r]=Ei(e,"lab"),s=tDt(n*n+r*r);let a=(nDt(r,n)*$Lt+360)%360;return rDt(s*1e4)===0&&(a=Number.NaN),[t,s,a]},vle=(...e)=>{const[t,n,r,...s]=Ei(e,"rgb"),[a,o,l]=ble(t,n,r),[c,u,d]=FLe(a,o,l);return[c,u,d,...s.length>0&&s[0]<1?[s[0]]:[]]};qr.prototype.lch=function(){return vle(this._rgb)};qr.prototype.hcl=function(){return ELe(vle(this._rgb))};const sDt=(...e)=>new qr(...e,"lch"),iDt=(...e)=>new qr(...e,"hcl");Object.assign(di,{lch:sDt,hcl:iDt});Ci.format.lch=yle;Ci.format.hcl=eDt;["lch","hcl"].forEach(e=>Ci.autodetect.push({p:2,test:(...t)=>{if(t=Ei(t,e),$i(t)==="array"&&t.length===3)return e}}));qr.prototype.saturate=function(e=1){const t=this,n=t.lch();return n[1]+=M0.Kn*e,n[1]<0&&(n[1]=0),new qr(n,"lch").alpha(t.alpha(),!0)};qr.prototype.desaturate=function(e=1){return this.saturate(-e)};qr.prototype.set=function(e,t,n=!1){const[r,s]=e.split("."),a=this[r]();if(s){const o=r.indexOf(s)-(r.substr(0,2)==="ok"?2:0);if(o>-1){if($i(t)=="string")switch(t.charAt(0)){case"+":a[o]+=+t;break;case"-":a[o]+=+t;break;case"*":a[o]*=+t.substr(1);break;case"/":a[o]/=+t.substr(1);break;default:a[o]=+t}else if($i(t)==="number")a[o]=t;else throw new Error("unsupported value for Color.set");const l=new qr(a,r);return n?(this._rgb=l._rgb,this):l}throw new Error(`unknown channel ${s} in mode ${r}`)}else return a};qr.prototype.tint=function(e=.5,...t){return bN(this,"white",e,...t)};qr.prototype.shade=function(e=.5,...t){return bN(this,"black",e,...t)};const aDt=(e,t,n)=>{const r=e._rgb,s=t._rgb;return new qr(r[0]+n*(s[0]-r[0]),r[1]+n*(s[1]-r[1]),r[2]+n*(s[2]-r[2]),"rgb")};ku.rgb=aDt;const{sqrt:kW,pow:Y6}=Math,oDt=(e,t,n)=>{const[r,s,a]=e._rgb,[o,l,c]=t._rgb;return new qr(kW(Y6(r,2)*(1-n)+Y6(o,2)*n),kW(Y6(s,2)*(1-n)+Y6(l,2)*n),kW(Y6(a,2)*(1-n)+Y6(c,2)*n),"rgb")};ku.lrgb=oDt;const lDt=(e,t,n)=>{const r=e.lab(),s=t.lab();return new qr(r[0]+n*(s[0]-r[0]),r[1]+n*(s[1]-r[1]),r[2]+n*(s[2]-r[2]),"lab")};ku.lab=lDt;const HA=(e,t,n,r)=>{let s,a;r==="hsl"?(s=e.hsl(),a=t.hsl()):r==="hsv"?(s=e.hsv(),a=t.hsv()):r==="hcg"?(s=e.hcg(),a=t.hcg()):r==="hsi"?(s=e.hsi(),a=t.hsi()):r==="lch"||r==="hcl"?(r="hcl",s=e.hcl(),a=t.hcl()):r==="oklch"&&(s=e.oklch().reverse(),a=t.oklch().reverse());let o,l,c,u,d,f;(r.substr(0,1)==="h"||r==="oklch")&&([o,c,d]=s,[l,u,f]=a);let x,g,v,w;return!isNaN(o)&&!isNaN(l)?(l>o&&l-o>180?w=l-(o+360):l<o&&o-l>180?w=l+360-o:w=l-o,g=o+n*w):isNaN(o)?isNaN(l)?g=Number.NaN:(g=l,(d==1||d==0)&&r!="hsv"&&(x=u)):(g=o,(f==1||f==0)&&r!="hsv"&&(x=c)),x===void 0&&(x=c+n*(u-c)),v=d+n*(f-d),r==="oklch"?new qr([v,x,g],r):new qr([g,x,v],r)},OLe=(e,t,n)=>HA(e,t,n,"lch");ku.lch=OLe;ku.hcl=OLe;const cDt=e=>{if($i(e)=="number"&&e>=0&&e<=16777215){const t=e>>16,n=e>>8&255,r=e&255;return[t,n,r,1]}throw new Error("unknown num color: "+e)},uDt=(...e)=>{const[t,n,r]=Ei(e,"rgb");return(t<<16)+(n<<8)+r};qr.prototype.num=function(){return uDt(this._rgb)};const dDt=(...e)=>new qr(...e,"num");Object.assign(di,{num:dDt});Ci.format.num=cDt;Ci.autodetect.push({p:5,test:(...e)=>{if(e.length===1&&$i(e[0])==="number"&&e[0]>=0&&e[0]<=16777215)return"num"}});const fDt=(e,t,n)=>{const r=e.num(),s=t.num();return new qr(r+n*(s-r),"num")};ku.num=fDt;const{floor:hDt}=Math,pDt=(...e)=>{e=Ei(e,"hcg");let[t,n,r]=e,s,a,o;r=r*255;const l=n*255;if(n===0)s=a=o=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;const c=hDt(t),u=t-c,d=r*(1-n),f=d+l*(1-u),x=d+l*u,g=d+l;switch(c){case 0:[s,a,o]=[g,x,d];break;case 1:[s,a,o]=[f,g,d];break;case 2:[s,a,o]=[d,g,x];break;case 3:[s,a,o]=[d,f,g];break;case 4:[s,a,o]=[x,d,g];break;case 5:[s,a,o]=[g,d,f];break}}return[s,a,o,e.length>3?e[3]:1]},mDt=(...e)=>{const[t,n,r]=Ei(e,"rgb"),s=ALe(t,n,r),a=jLe(t,n,r),o=a-s,l=o*100/255,c=s/(255-o)*100;let u;return o===0?u=Number.NaN:(t===a&&(u=(n-r)/o),n===a&&(u=2+(r-t)/o),r===a&&(u=4+(t-n)/o),u*=60,u<0&&(u+=360)),[u,l,c]};qr.prototype.hcg=function(){return mDt(this._rgb)};const xDt=(...e)=>new qr(...e,"hcg");di.hcg=xDt;Ci.format.hcg=pDt;Ci.autodetect.push({p:1,test:(...e)=>{if(e=Ei(e,"hcg"),$i(e)==="array"&&e.length===3)return"hcg"}});const gDt=(e,t,n)=>HA(e,t,n,"hcg");ku.hcg=gDt;const{cos:X6}=Math,bDt=(...e)=>{e=Ei(e,"hsi");let[t,n,r]=e,s,a,o;return isNaN(t)&&(t=0),isNaN(n)&&(n=0),t>360&&(t-=360),t<0&&(t+=360),t/=360,t<1/3?(o=(1-n)/3,s=(1+n*X6(cg*t)/X6(AW-cg*t))/3,a=1-(o+s)):t<2/3?(t-=1/3,s=(1-n)/3,a=(1+n*X6(cg*t)/X6(AW-cg*t))/3,o=1-(s+a)):(t-=2/3,a=(1-n)/3,o=(1+n*X6(cg*t)/X6(AW-cg*t))/3,s=1-(a+o)),s=t3(r*s*3),a=t3(r*a*3),o=t3(r*o*3),[s*255,a*255,o*255,e.length>3?e[3]:1]},{min:yDt,sqrt:vDt,acos:wDt}=Math,CDt=(...e)=>{let[t,n,r]=Ei(e,"rgb");t/=255,n/=255,r/=255;let s;const a=yDt(t,n,r),o=(t+n+r)/3,l=o>0?1-a/o:0;return l===0?s=NaN:(s=(t-n+(t-r))/2,s/=vDt((t-n)*(t-n)+(t-r)*(n-r)),s=wDt(s),r>n&&(s=cg-s),s/=cg),[s*360,l,o]};qr.prototype.hsi=function(){return CDt(this._rgb)};const SDt=(...e)=>new qr(...e,"hsi");di.hsi=SDt;Ci.format.hsi=bDt;Ci.autodetect.push({p:2,test:(...e)=>{if(e=Ei(e,"hsi"),$i(e)==="array"&&e.length===3)return"hsi"}});const NDt=(e,t,n)=>HA(e,t,n,"hsi");ku.hsi=NDt;const nte=(...e)=>{e=Ei(e,"hsl");const[t,n,r]=e;let s,a,o;if(n===0)s=a=o=r*255;else{const l=[0,0,0],c=[0,0,0],u=r<.5?r*(1+n):r+n-r*n,d=2*r-u,f=t/360;l[0]=f+1/3,l[1]=f,l[2]=f-1/3;for(let x=0;x<3;x++)l[x]<0&&(l[x]+=1),l[x]>1&&(l[x]-=1),6*l[x]<1?c[x]=d+(u-d)*6*l[x]:2*l[x]<1?c[x]=u:3*l[x]<2?c[x]=d+(u-d)*(2/3-l[x])*6:c[x]=d;[s,a,o]=[c[0]*255,c[1]*255,c[2]*255]}return e.length>3?[s,a,o,e[3]]:[s,a,o,1]},MLe=(...e)=>{e=Ei(e,"rgba");let[t,n,r]=e;t/=255,n/=255,r/=255;const s=ALe(t,n,r),a=jLe(t,n,r),o=(a+s)/2;let l,c;return a===s?(l=0,c=Number.NaN):l=o<.5?(a-s)/(a+s):(a-s)/(2-a-s),t==a?c=(n-r)/(a-s):n==a?c=2+(r-t)/(a-s):r==a&&(c=4+(t-n)/(a-s)),c*=60,c<0&&(c+=360),e.length>3&&e[3]!==void 0?[c,l,o,e[3]]:[c,l,o]};qr.prototype.hsl=function(){return MLe(this._rgb)};const ADt=(...e)=>new qr(...e,"hsl");di.hsl=ADt;Ci.format.hsl=nte;Ci.autodetect.push({p:2,test:(...e)=>{if(e=Ei(e,"hsl"),$i(e)==="array"&&e.length===3)return"hsl"}});const jDt=(e,t,n)=>HA(e,t,n,"hsl");ku.hsl=jDt;const{floor:EDt}=Math,_Dt=(...e)=>{e=Ei(e,"hsv");let[t,n,r]=e,s,a,o;if(r*=255,n===0)s=a=o=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;const l=EDt(t),c=t-l,u=r*(1-n),d=r*(1-n*c),f=r*(1-n*(1-c));switch(l){case 0:[s,a,o]=[r,f,u];break;case 1:[s,a,o]=[d,r,u];break;case 2:[s,a,o]=[u,r,f];break;case 3:[s,a,o]=[u,d,r];break;case 4:[s,a,o]=[f,u,r];break;case 5:[s,a,o]=[r,u,d];break}}return[s,a,o,e.length>3?e[3]:1]},{min:kDt,max:TDt}=Math,IDt=(...e)=>{e=Ei(e,"rgb");let[t,n,r]=e;const s=kDt(t,n,r),a=TDt(t,n,r),o=a-s;let l,c,u;return u=a/255,a===0?(l=Number.NaN,c=0):(c=o/a,t===a&&(l=(n-r)/o),n===a&&(l=2+(r-t)/o),r===a&&(l=4+(t-n)/o),l*=60,l<0&&(l+=360)),[l,c,u]};qr.prototype.hsv=function(){return IDt(this._rgb)};const PDt=(...e)=>new qr(...e,"hsv");di.hsv=PDt;Ci.format.hsv=_Dt;Ci.autodetect.push({p:2,test:(...e)=>{if(e=Ei(e,"hsv"),$i(e)==="array"&&e.length===3)return"hsv"}});const FDt=(e,t,n)=>HA(e,t,n,"hsv");ku.hsv=FDt;function $R(e,t){let n=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(t[0])||(t=t.map(o=>[o]));let r=t[0].length,s=t[0].map((o,l)=>t.map(c=>c[l])),a=e.map(o=>s.map(l=>Array.isArray(o)?o.reduce((c,u,d)=>c+u*(l[d]||0),0):l.reduce((c,u)=>c+u*o,0)));return n===1&&(a=a[0]),r===1?a.map(o=>o[0]):a}const wle=(...e)=>{e=Ei(e,"lab");const[t,n,r,...s]=e,[a,o,l]=ODt([t,n,r]),[c,u,d]=TLe(a,o,l);return[c,u,d,...s.length>0&&s[0]<1?[s[0]]:[]]};function ODt(e){var t=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],n=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],r=$R(n,e);return $R(t,r.map(s=>s**3))}const Cle=(...e)=>{const[t,n,r,...s]=Ei(e,"rgb"),a=ILe(t,n,r);return[...MDt(a),...s.length>0&&s[0]<1?[s[0]]:[]]};function MDt(e){const t=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],n=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],r=$R(t,e);return $R(n,r.map(s=>Math.cbrt(s)))}qr.prototype.oklab=function(){return Cle(this._rgb)};const RDt=(...e)=>new qr(...e,"oklab");Object.assign(di,{oklab:RDt});Ci.format.oklab=wle;Ci.autodetect.push({p:2,test:(...e)=>{if(e=Ei(e,"oklab"),$i(e)==="array"&&e.length===3)return"oklab"}});const LDt=(e,t,n)=>{const r=e.oklab(),s=t.oklab();return new qr(r[0]+n*(s[0]-r[0]),r[1]+n*(s[1]-r[1]),r[2]+n*(s[2]-r[2]),"oklab")};ku.oklab=LDt;const DDt=(e,t,n)=>HA(e,t,n,"oklch");ku.oklch=DDt;const{pow:TW,sqrt:IW,PI:PW,cos:Gbe,sin:Kbe,atan2:BDt}=Math,$Dt=(e,t="lrgb",n=null)=>{const r=e.length;n||(n=Array.from(new Array(r)).map(()=>1));const s=r/n.reduce(function(f,x){return f+x});if(n.forEach((f,x)=>{n[x]*=s}),e=e.map(f=>new qr(f)),t==="lrgb")return UDt(e,n);const a=e.shift(),o=a.get(t),l=[];let c=0,u=0;for(let f=0;f<o.length;f++)if(o[f]=(o[f]||0)*n[0],l.push(isNaN(o[f])?0:n[0]),t.charAt(f)==="h"&&!isNaN(o[f])){const x=o[f]/180*PW;c+=Gbe(x)*n[0],u+=Kbe(x)*n[0]}let d=a.alpha()*n[0];e.forEach((f,x)=>{const g=f.get(t);d+=f.alpha()*n[x+1];for(let v=0;v<o.length;v++)if(!isNaN(g[v]))if(l[v]+=n[x+1],t.charAt(v)==="h"){const w=g[v]/180*PW;c+=Gbe(w)*n[x+1],u+=Kbe(w)*n[x+1]}else o[v]+=g[v]*n[x+1]});for(let f=0;f<o.length;f++)if(t.charAt(f)==="h"){let x=BDt(u/l[f],c/l[f])/PW*180;for(;x<0;)x+=360;for(;x>=360;)x-=360;o[f]=x}else o[f]=o[f]/l[f];return d/=r,new qr(o,t).alpha(d>.99999?1:d,!0)},UDt=(e,t)=>{const n=e.length,r=[0,0,0,0];for(let s=0;s<e.length;s++){const a=e[s],o=t[s]/n,l=a._rgb;r[0]+=TW(l[0],2)*o,r[1]+=TW(l[1],2)*o,r[2]+=TW(l[2],2)*o,r[3]+=l[3]*o}return r[0]=IW(r[0]),r[1]=IW(r[1]),r[2]=IW(r[2]),r[3]>.9999999&&(r[3]=1),new qr(xle(r))},{pow:zDt}=Math;function UR(e){let t="rgb",n=di("#ccc"),r=0,s=[0,1],a=[],o=[0,0],l=!1,c=[],u=!1,d=0,f=1,x=!1,g={},v=!0,w=1;const C=function(L){if(L=L||["#fff","#000"],L&&$i(L)==="string"&&di.brewer&&di.brewer[L.toLowerCase()]&&(L=di.brewer[L.toLowerCase()]),$i(L)==="array"){L.length===1&&(L=[L[0],L[0]]),L=L.slice(0);for(let z=0;z<L.length;z++)L[z]=di(L[z]);a.length=0;for(let z=0;z<L.length;z++)a.push(z/(L.length-1))}return F(),c=L},N=function(L){if(l!=null){const z=l.length-1;let X=0;for(;X<z&&L>=l[X];)X++;return X-1}return 0};let I=L=>L,P=L=>L;const R=function(L,z){let X,ne;if(z==null&&(z=!1),isNaN(L)||L===null)return n;z?ne=L:l&&l.length>2?ne=N(L)/(l.length-2):f!==d?ne=(L-d)/(f-d):ne=1,ne=P(ne),z||(ne=I(ne)),w!==1&&(ne=zDt(ne,w)),ne=o[0]+ne*(1-o[0]-o[1]),ne=t3(ne,0,1);const J=Math.floor(ne*1e4);if(v&&g[J])X=g[J];else{if($i(c)==="array")for(let Z=0;Z<a.length;Z++){const re=a[Z];if(ne<=re){X=c[Z];break}if(ne>=re&&Z===a.length-1){X=c[Z];break}if(ne>re&&ne<a[Z+1]){ne=(ne-re)/(a[Z+1]-re),X=di.interpolate(c[Z],c[Z+1],ne,t);break}}else $i(c)==="function"&&(X=c(ne));v&&(g[J]=X)}return X};var F=()=>g={};C(e);const U=function(L){const z=di(R(L));return u&&z[u]?z[u]():z};return U.classes=function(L){if(L!=null){if($i(L)==="array")l=L,s=[L[0],L[L.length-1]];else{const z=di.analyze(s);L===0?l=[z.min,z.max]:l=di.limits(z,"e",L)}return U}return l},U.domain=function(L){if(!arguments.length)return s;d=L[0],f=L[L.length-1],a=[];const z=c.length;if(L.length===z&&d!==f)for(let X of Array.from(L))a.push((X-d)/(f-d));else{for(let X=0;X<z;X++)a.push(X/(z-1));if(L.length>2){const X=L.map((J,Z)=>Z/(L.length-1)),ne=L.map(J=>(J-d)/(f-d));ne.every((J,Z)=>X[Z]===J)||(P=J=>{if(J<=0||J>=1)return J;let Z=0;for(;J>=ne[Z+1];)Z++;const re=(J-ne[Z])/(ne[Z+1]-ne[Z]);return X[Z]+re*(X[Z+1]-X[Z])})}}return s=[d,f],U},U.mode=function(L){return arguments.length?(t=L,F(),U):t},U.range=function(L,z){return C(L),U},U.out=function(L){return u=L,U},U.spread=function(L){return arguments.length?(r=L,U):r},U.correctLightness=function(L){return L==null&&(L=!0),x=L,F(),x?I=function(z){const X=R(0,!0).lab()[0],ne=R(1,!0).lab()[0],J=X>ne;let Z=R(z,!0).lab()[0];const re=X+(ne-X)*z;let he=Z-re,Y=0,ie=1,oe=20;for(;Math.abs(he)>.01&&oe-- >0;)(function(){return J&&(he*=-1),he<0?(Y=z,z+=(ie-z)*.5):(ie=z,z+=(Y-z)*.5),Z=R(z,!0).lab()[0],he=Z-re})();return z}:I=z=>z,U},U.padding=function(L){return L!=null?($i(L)==="number"&&(L=[L,L]),o=L,U):o},U.colors=function(L,z){arguments.length<2&&(z="hex");let X=[];if(arguments.length===0)X=c.slice(0);else if(L===1)X=[U(.5)];else if(L>1){const ne=s[0],J=s[1]-ne;X=HDt(0,L).map(Z=>U(ne+Z/(L-1)*J))}else{e=[];let ne=[];if(l&&l.length>2)for(let J=1,Z=l.length,re=1<=Z;re?J<Z:J>Z;re?J++:J--)ne.push((l[J-1]+l[J])*.5);else ne=s;X=ne.map(J=>U(J))}return di[z]&&(X=X.map(ne=>ne[z]())),X},U.cache=function(L){return L!=null?(v=L,U):v},U.gamma=function(L){return L!=null?(w=L,U):w},U.nodata=function(L){return L!=null?(n=di(L),U):n},U}function HDt(e,t,n){let r=[],s=e<t,a=t;for(let o=e;s?o<a:o>a;s?o++:o--)r.push(o);return r}const VDt=function(e){let t=[1,1];for(let n=1;n<e;n++){let r=[1];for(let s=1;s<=t.length;s++)r[s]=(t[s]||0)+t[s-1];t=r}return t},WDt=function(e){let t,n,r,s;if(e=e.map(a=>new qr(a)),e.length===2)[n,r]=e.map(a=>a.lab()),t=function(a){const o=[0,1,2].map(l=>n[l]+a*(r[l]-n[l]));return new qr(o,"lab")};else if(e.length===3)[n,r,s]=e.map(a=>a.lab()),t=function(a){const o=[0,1,2].map(l=>(1-a)*(1-a)*n[l]+2*(1-a)*a*r[l]+a*a*s[l]);return new qr(o,"lab")};else if(e.length===4){let a;[n,r,s,a]=e.map(o=>o.lab()),t=function(o){const l=[0,1,2].map(c=>(1-o)*(1-o)*(1-o)*n[c]+3*(1-o)*(1-o)*o*r[c]+3*(1-o)*o*o*s[c]+o*o*o*a[c]);return new qr(l,"lab")}}else if(e.length>=5){let a,o,l;a=e.map(c=>c.lab()),l=e.length-1,o=VDt(l),t=function(c){const u=1-c,d=[0,1,2].map(f=>a.reduce((x,g,v)=>x+o[v]*u**(l-v)*c**v*g[f],0));return new qr(d,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return t},qDt=e=>{const t=WDt(e);return t.scale=()=>UR(t),t},{round:RLe}=Math;qr.prototype.rgb=function(e=!0){return e===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(RLe)};qr.prototype.rgba=function(e=!0){return this._rgb.slice(0,4).map((t,n)=>n<3?e===!1?t:RLe(t):t)};const GDt=(...e)=>new qr(...e,"rgb");Object.assign(di,{rgb:GDt});Ci.format.rgb=(...e)=>{const t=Ei(e,"rgba");return t[3]===void 0&&(t[3]=1),t};Ci.autodetect.push({p:3,test:(...e)=>{if(e=Ei(e,"rgba"),$i(e)==="array"&&(e.length===3||e.length===4&&$i(e[3])=="number"&&e[3]>=0&&e[3]<=1))return"rgb"}});const hm=(e,t,n)=>{if(!hm[n])throw new Error("unknown blend mode "+n);return hm[n](e,t)},l2=e=>(t,n)=>{const r=di(n).rgb(),s=di(t).rgb();return di.rgb(e(r,s))},c2=e=>(t,n)=>{const r=[];return r[0]=e(t[0],n[0]),r[1]=e(t[1],n[1]),r[2]=e(t[2],n[2]),r},KDt=e=>e,YDt=(e,t)=>e*t/255,XDt=(e,t)=>e>t?t:e,QDt=(e,t)=>e>t?e:t,ZDt=(e,t)=>255*(1-(1-e/255)*(1-t/255)),JDt=(e,t)=>t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255)),eBt=(e,t)=>255*(1-(1-t/255)/(e/255)),tBt=(e,t)=>e===255?255:(e=255*(t/255)/(1-e/255),e>255?255:e);hm.normal=l2(c2(KDt));hm.multiply=l2(c2(YDt));hm.screen=l2(c2(ZDt));hm.overlay=l2(c2(JDt));hm.darken=l2(c2(XDt));hm.lighten=l2(c2(QDt));hm.dodge=l2(c2(tBt));hm.burn=l2(c2(eBt));const{pow:nBt,sin:rBt,cos:sBt}=Math;function iBt(e=300,t=-1.5,n=1,r=1,s=[0,1]){let a=0,o;$i(s)==="array"?o=s[1]-s[0]:(o=0,s=[s,s]);const l=function(c){const u=cg*((e+120)/360+t*c),d=nBt(s[0]+o*c,r),x=(a!==0?n[0]+c*a:n)*d*(1-d)/2,g=sBt(u),v=rBt(u),w=d+x*(-.14861*g+1.78277*v),C=d+x*(-.29227*g-.90649*v),N=d+x*(1.97294*g);return di(xle([w*255,C*255,N*255,1]))};return l.start=function(c){return c==null?e:(e=c,l)},l.rotations=function(c){return c==null?t:(t=c,l)},l.gamma=function(c){return c==null?r:(r=c,l)},l.hue=function(c){return c==null?n:(n=c,$i(n)==="array"?(a=n[1]-n[0],a===0&&(n=n[1])):a=0,l)},l.lightness=function(c){return c==null?s:($i(c)==="array"?(s=c,o=c[1]-c[0]):(s=[c,c],o=0),l)},l.scale=()=>di.scale(l),l.hue(n),l}const aBt="0123456789abcdef",{floor:oBt,random:lBt}=Math,cBt=()=>{let e="#";for(let t=0;t<6;t++)e+=aBt.charAt(oBt(lBt()*16));return new qr(e,"hex")},{log:Ybe,pow:uBt,floor:dBt,abs:fBt}=Math;function LLe(e,t=null){const n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return $i(e)==="object"&&(e=Object.values(e)),e.forEach(r=>{t&&$i(r)==="object"&&(r=r[t]),r!=null&&!isNaN(r)&&(n.values.push(r),n.sum+=r,r<n.min&&(n.min=r),r>n.max&&(n.max=r),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(r,s)=>DLe(n,r,s),n}function DLe(e,t="equal",n=7){$i(e)=="array"&&(e=LLe(e));const{min:r,max:s}=e,a=e.values.sort((l,c)=>l-c);if(n===1)return[r,s];const o=[];if(t.substr(0,1)==="c"&&(o.push(r),o.push(s)),t.substr(0,1)==="e"){o.push(r);for(let l=1;l<n;l++)o.push(r+l/n*(s-r));o.push(s)}else if(t.substr(0,1)==="l"){if(r<=0)throw new Error("Logarithmic scales are only possible for values > 0");const l=Math.LOG10E*Ybe(r),c=Math.LOG10E*Ybe(s);o.push(r);for(let u=1;u<n;u++)o.push(uBt(10,l+u/n*(c-l)));o.push(s)}else if(t.substr(0,1)==="q"){o.push(r);for(let l=1;l<n;l++){const c=(a.length-1)*l/n,u=dBt(c);if(u===c)o.push(a[u]);else{const d=c-u;o.push(a[u]*(1-d)+a[u+1]*d)}}o.push(s)}else if(t.substr(0,1)==="k"){let l;const c=a.length,u=new Array(c),d=new Array(n);let f=!0,x=0,g=null;g=[],g.push(r);for(let C=1;C<n;C++)g.push(r+C/n*(s-r));for(g.push(s);f;){for(let N=0;N<n;N++)d[N]=0;for(let N=0;N<c;N++){const I=a[N];let P=Number.MAX_VALUE,R;for(let F=0;F<n;F++){const U=fBt(g[F]-I);U<P&&(P=U,R=F),d[R]++,u[N]=R}}const C=new Array(n);for(let N=0;N<n;N++)C[N]=null;for(let N=0;N<c;N++)l=u[N],C[l]===null?C[l]=a[N]:C[l]+=a[N];for(let N=0;N<n;N++)C[N]*=1/d[N];f=!1;for(let N=0;N<n;N++)if(C[N]!==g[N]){f=!0;break}g=C,x++,x>200&&(f=!1)}const v={};for(let C=0;C<n;C++)v[C]=[];for(let C=0;C<c;C++)l=u[C],v[l].push(a[C]);let w=[];for(let C=0;C<n;C++)w.push(v[C][0]),w.push(v[C][v[C].length-1]);w=w.sort((C,N)=>C-N),o.push(w[0]);for(let C=1;C<w.length;C+=2){const N=w[C];!isNaN(N)&&o.indexOf(N)===-1&&o.push(N)}}return o}const hBt=(e,t)=>{e=new qr(e),t=new qr(t);const n=e.luminance(),r=t.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)};/**
 * @license
 *
 * The APCA contrast prediction algorithm is based of the formulas published
 * in the APCA-1.0.98G specification by Myndex. The specification is available at:
 * https://raw.githubusercontent.com/Myndex/apca-w3/master/images/APCAw3_0.1.17_APCA0.0.98G.svg
 *
 * Note that the APCA implementation is still beta, so please update to
 * future versions of chroma.js when they become available.
 *
 * You can read more about the APCA Readability Criterion at
 * https://readtech.org/ARC/
 */const Xbe=.027,pBt=5e-4,mBt=.1,Qbe=1.14,vP=.022,Zbe=1.414,xBt=(e,t)=>{e=new qr(e),t=new qr(t),e.alpha()<1&&(e=bN(t,e,e.alpha(),"rgb"));const n=Jbe(...e.rgb()),r=Jbe(...t.rgb()),s=n>=vP?n:n+Math.pow(vP-n,Zbe),a=r>=vP?r:r+Math.pow(vP-r,Zbe),o=Math.pow(a,.56)-Math.pow(s,.57),l=Math.pow(a,.65)-Math.pow(s,.62),c=Math.abs(a-s)<pBt?0:s<a?o*Qbe:l*Qbe;return(Math.abs(c)<mBt?0:c>0?c-Xbe:c+Xbe)*100};function Jbe(e,t,n){return .2126729*Math.pow(e/255,2.4)+.7151522*Math.pow(t/255,2.4)+.072175*Math.pow(n/255,2.4)}const{sqrt:Ux,pow:Al,min:gBt,max:bBt,atan2:eye,abs:tye,cos:wP,sin:nye,exp:yBt,PI:rye}=Math;function vBt(e,t,n=1,r=1,s=1){var a=function(Ae){return 360*Ae/(2*rye)},o=function(Ae){return 2*rye*Ae/360};e=new qr(e),t=new qr(t);const[l,c,u]=Array.from(e.lab()),[d,f,x]=Array.from(t.lab()),g=(l+d)/2,v=Ux(Al(c,2)+Al(u,2)),w=Ux(Al(f,2)+Al(x,2)),C=(v+w)/2,N=.5*(1-Ux(Al(C,7)/(Al(C,7)+Al(25,7)))),I=c*(1+N),P=f*(1+N),R=Ux(Al(I,2)+Al(u,2)),F=Ux(Al(P,2)+Al(x,2)),U=(R+F)/2,L=a(eye(u,I)),z=a(eye(x,P)),X=L>=0?L:L+360,ne=z>=0?z:z+360,J=tye(X-ne)>180?(X+ne+360)/2:(X+ne)/2,Z=1-.17*wP(o(J-30))+.24*wP(o(2*J))+.32*wP(o(3*J+6))-.2*wP(o(4*J-63));let re=ne-X;re=tye(re)<=180?re:ne<=X?re+360:re-360,re=2*Ux(R*F)*nye(o(re)/2);const he=d-l,Y=F-R,ie=1+.015*Al(g-50,2)/Ux(20+Al(g-50,2)),oe=1+.045*U,G=1+.015*U*Z,V=30*yBt(-Al((J-275)/25,2)),ae=-(2*Ux(Al(U,7)/(Al(U,7)+Al(25,7))))*nye(2*o(V)),fe=Ux(Al(he/(n*ie),2)+Al(Y/(r*oe),2)+Al(re/(s*G),2)+ae*(Y/(r*oe))*(re/(s*G)));return bBt(0,gBt(100,fe))}function wBt(e,t,n="lab"){e=new qr(e),t=new qr(t);const r=e.get(n),s=t.get(n);let a=0;for(let o in r){const l=(r[o]||0)-(s[o]||0);a+=l*l}return Math.sqrt(a)}const CBt=(...e)=>{try{return new qr(...e),!0}catch{return!1}},SBt={cool(){return UR([di.hsl(180,1,.9),di.hsl(250,.7,.4)])},hot(){return UR(["#000","#f00","#ff0","#fff"]).mode("rgb")}},rte={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},BLe=Object.keys(rte),sye=new Map(BLe.map(e=>[e.toLowerCase(),e])),NBt=typeof Proxy=="function"?new Proxy(rte,{get(e,t){const n=t.toLowerCase();if(sye.has(n))return e[sye.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(BLe)}}):rte,ABt=(...e)=>{e=Ei(e,"cmyk");const[t,n,r,s]=e,a=e.length>4?e[4]:1;return s===1?[0,0,0,a]:[t>=1?0:255*(1-t)*(1-s),n>=1?0:255*(1-n)*(1-s),r>=1?0:255*(1-r)*(1-s),a]},{max:iye}=Math,jBt=(...e)=>{let[t,n,r]=Ei(e,"rgb");t=t/255,n=n/255,r=r/255;const s=1-iye(t,iye(n,r)),a=s<1?1/(1-s):0,o=(1-t-s)*a,l=(1-n-s)*a,c=(1-r-s)*a;return[o,l,c,s]};qr.prototype.cmyk=function(){return jBt(this._rgb)};const EBt=(...e)=>new qr(...e,"cmyk");Object.assign(di,{cmyk:EBt});Ci.format.cmyk=ABt;Ci.autodetect.push({p:2,test:(...e)=>{if(e=Ei(e,"cmyk"),$i(e)==="array"&&e.length===4)return"cmyk"}});const _Bt=(...e)=>{const t=Ei(e,"hsla");let n=zA(e)||"lsa";return t[0]=Kh(t[0]||0)+"deg",t[1]=Kh(t[1]*100)+"%",t[2]=Kh(t[2]*100)+"%",n==="hsla"||t.length>3&&t[3]<1?(t[3]="/ "+(t.length>3?t[3]:1),n="hsla"):t.length=3,`${n.substr(0,3)}(${t.join(" ")})`},kBt=(...e)=>{const t=Ei(e,"lab");let n=zA(e)||"lab";return t[0]=Kh(t[0])+"%",t[1]=Kh(t[1]),t[2]=Kh(t[2]),n==="laba"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(" ")})`},TBt=(...e)=>{const t=Ei(e,"lch");let n=zA(e)||"lab";return t[0]=Kh(t[0])+"%",t[1]=Kh(t[1]),t[2]=isNaN(t[2])?"none":Kh(t[2])+"deg",n==="lcha"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lch(${t.join(" ")})`},IBt=(...e)=>{const t=Ei(e,"lab");return t[0]=Kh(t[0]*100)+"%",t[1]=tte(t[1]),t[2]=tte(t[2]),t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(" ")})`},$Le=(...e)=>{const[t,n,r,...s]=Ei(e,"rgb"),[a,o,l]=Cle(t,n,r),[c,u,d]=FLe(a,o,l);return[c,u,d,...s.length>0&&s[0]<1?[s[0]]:[]]},PBt=(...e)=>{const t=Ei(e,"lch");return t[0]=Kh(t[0]*100)+"%",t[1]=tte(t[1]),t[2]=isNaN(t[2])?"none":Kh(t[2])+"deg",t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(" ")})`},{round:FW}=Math,FBt=(...e)=>{const t=Ei(e,"rgba");let n=zA(e)||"rgb";if(n.substr(0,3)==="hsl")return _Bt(MLe(t),n);if(n.substr(0,3)==="lab"){const r=t_();Ig("d50");const s=kBt(ble(t),n);return Ig(r),s}if(n.substr(0,3)==="lch"){const r=t_();Ig("d50");const s=TBt(vle(t),n);return Ig(r),s}return n.substr(0,5)==="oklab"?IBt(Cle(t)):n.substr(0,5)==="oklch"?PBt($Le(t)):(t[0]=FW(t[0]),t[1]=FW(t[1]),t[2]=FW(t[2]),(n==="rgba"||t.length>3&&t[3]<1)&&(t[3]="/ "+(t.length>3?t[3]:1),n="rgba"),`${n.substr(0,3)}(${t.slice(0,n==="rgb"?3:4).join(" ")})`)},ULe=(...e)=>{e=Ei(e,"lch");const[t,n,r,...s]=e,[a,o,l]=PLe(t,n,r),[c,u,d]=wle(a,o,l);return[c,u,d,...s.length>0&&s[0]<1?[s[0]]:[]]},Hg=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,im=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,zR=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,sp=/\s*/.source,VA=/\s+/.source,Sle=/\s*,\s*/.source,k$=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,WA=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,zLe=new RegExp("^rgba?\\("+sp+[Hg,Hg,Hg].join(VA)+WA+"\\)$"),HLe=new RegExp("^rgb\\("+sp+[Hg,Hg,Hg].join(Sle)+sp+"\\)$"),VLe=new RegExp("^rgba\\("+sp+[Hg,Hg,Hg,im].join(Sle)+sp+"\\)$"),WLe=new RegExp("^hsla?\\("+sp+[k$,zR,zR].join(VA)+WA+"\\)$"),qLe=new RegExp("^hsl?\\("+sp+[k$,zR,zR].join(Sle)+sp+"\\)$"),GLe=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,KLe=new RegExp("^lab\\("+sp+[im,im,im].join(VA)+WA+"\\)$"),YLe=new RegExp("^lch\\("+sp+[im,im,k$].join(VA)+WA+"\\)$"),XLe=new RegExp("^oklab\\("+sp+[im,im,im].join(VA)+WA+"\\)$"),QLe=new RegExp("^oklch\\("+sp+[im,im,k$].join(VA)+WA+"\\)$"),{round:ZLe}=Math,Q6=e=>e.map((t,n)=>n<=2?t3(ZLe(t),0,255):t),jl=(e,t=0,n=100,r=!1)=>(typeof e=="string"&&e.endsWith("%")&&(e=parseFloat(e.substring(0,e.length-1))/100,r?e=t+(e+1)*.5*(n-t):e=t+e*(n-t)),+e),Uu=(e,t)=>e==="none"?t:e,Nle=e=>{if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let t;if(Ci.format.named)try{return Ci.format.named(e)}catch{}if((t=e.match(zLe))||(t=e.match(HLe))){let n=t.slice(1,4);for(let s=0;s<3;s++)n[s]=+jl(Uu(n[s],0),0,255);n=Q6(n);const r=t[4]!==void 0?+jl(t[4],0,1):1;return n[3]=r,n}if(t=e.match(VLe)){const n=t.slice(1,5);for(let r=0;r<4;r++)n[r]=+jl(n[r],0,255);return n}if((t=e.match(WLe))||(t=e.match(qLe))){const n=t.slice(1,4);n[0]=+Uu(n[0].replace("deg",""),0),n[1]=+jl(Uu(n[1],0),0,100)*.01,n[2]=+jl(Uu(n[2],0),0,100)*.01;const r=Q6(nte(n)),s=t[4]!==void 0?+jl(t[4],0,1):1;return r[3]=s,r}if(t=e.match(GLe)){const n=t.slice(1,4);n[1]*=.01,n[2]*=.01;const r=nte(n);for(let s=0;s<3;s++)r[s]=ZLe(r[s]);return r[3]=+t[4],r}if(t=e.match(KLe)){const n=t.slice(1,4);n[0]=jl(Uu(n[0],0),0,100),n[1]=jl(Uu(n[1],0),-125,125,!0),n[2]=jl(Uu(n[2],0),-125,125,!0);const r=t_();Ig("d50");const s=Q6(gle(n));Ig(r);const a=t[4]!==void 0?+jl(t[4],0,1):1;return s[3]=a,s}if(t=e.match(YLe)){const n=t.slice(1,4);n[0]=jl(n[0],0,100),n[1]=jl(Uu(n[1],0),0,150,!1),n[2]=+Uu(n[2].replace("deg",""),0);const r=t_();Ig("d50");const s=Q6(yle(n));Ig(r);const a=t[4]!==void 0?+jl(t[4],0,1):1;return s[3]=a,s}if(t=e.match(XLe)){const n=t.slice(1,4);n[0]=jl(Uu(n[0],0),0,1),n[1]=jl(Uu(n[1],0),-.4,.4,!0),n[2]=jl(Uu(n[2],0),-.4,.4,!0);const r=Q6(wle(n)),s=t[4]!==void 0?+jl(t[4],0,1):1;return r[3]=s,r}if(t=e.match(QLe)){const n=t.slice(1,4);n[0]=jl(Uu(n[0],0),0,1),n[1]=jl(Uu(n[1],0),0,.4,!1),n[2]=+Uu(n[2].replace("deg",""),0);const r=Q6(ULe(n)),s=t[4]!==void 0?+jl(t[4],0,1):1;return r[3]=s,r}};Nle.test=e=>zLe.test(e)||WLe.test(e)||KLe.test(e)||YLe.test(e)||XLe.test(e)||QLe.test(e)||HLe.test(e)||VLe.test(e)||qLe.test(e)||GLe.test(e)||e==="transparent";qr.prototype.css=function(e){return FBt(this._rgb,e)};const OBt=(...e)=>new qr(...e,"css");di.css=OBt;Ci.format.css=Nle;Ci.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&$i(e)==="string"&&Nle.test(e))return"css"}});Ci.format.gl=(...e)=>{const t=Ei(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t};const MBt=(...e)=>new qr(...e,"gl");di.gl=MBt;qr.prototype.gl=function(){const e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]};qr.prototype.hex=function(e){return kLe(this._rgb,e)};const RBt=(...e)=>new qr(...e,"hex");di.hex=RBt;Ci.format.hex=_Le;Ci.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&$i(e)==="string"&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});const{log:CP}=Math,JLe=e=>{const t=e/100;let n,r,s;return t<66?(n=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*CP(r),s=t<20?0:-254.76935184120902+.8274096064007395*(s=t-10)+115.67994401066147*CP(s)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*CP(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*CP(r),s=255),[n,r,s,1]},{round:LBt}=Math,DBt=(...e)=>{const t=Ei(e,"rgb"),n=t[0],r=t[2];let s=1e3,a=4e4;const o=.4;let l;for(;a-s>o;){l=(a+s)*.5;const c=JLe(l);c[2]/c[0]>=r/n?a=l:s=l}return LBt(l)};qr.prototype.temp=qr.prototype.kelvin=qr.prototype.temperature=function(){return DBt(this._rgb)};const OW=(...e)=>new qr(...e,"temp");Object.assign(di,{temp:OW,kelvin:OW,temperature:OW});Ci.format.temp=Ci.format.kelvin=Ci.format.temperature=JLe;qr.prototype.oklch=function(){return $Le(this._rgb)};const BBt=(...e)=>new qr(...e,"oklch");Object.assign(di,{oklch:BBt});Ci.format.oklch=ULe;Ci.autodetect.push({p:2,test:(...e)=>{if(e=Ei(e,"oklch"),$i(e)==="array"&&e.length===3)return"oklch"}});Object.assign(di,{analyze:LLe,average:$Dt,bezier:qDt,blend:hm,brewer:NBt,Color:qr,colors:gN,contrast:hBt,contrastAPCA:xBt,cubehelix:iBt,deltaE:vBt,distance:wBt,input:Ci,interpolate:bN,limits:DLe,mix:bN,random:cBt,scale:UR,scales:SBt,valid:CBt});const $Bt=({className:e})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",className:e,children:i.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.875 3.67C7.875 3.025 7.315 2.5 6.625 2.5C5.935 2.5 5.375 3.025 5.375 3.67C5.375 4.316 5.935 4.84 6.625 4.84C7.315 4.84 7.875 4.316 7.875 3.67ZM7.875 12.33C7.875 11.684 7.315 11.16 6.625 11.16C5.935 11.16 5.375 11.684 5.375 12.33C5.375 12.975 5.935 13.5 6.625 13.5C7.315 13.5 7.875 12.975 7.875 12.33ZM6.625 6.83C7.315 6.83 7.875 7.355 7.875 8C7.875 8.645 7.315 9.17 6.625 9.17C5.935 9.17 5.375 8.645 5.375 8C5.375 7.355 5.935 6.83 6.625 6.83ZM11.625 3.67C11.625 3.025 11.065 2.5 10.375 2.5C9.685 2.5 9.125 3.025 9.125 3.67C9.125 4.316 9.685 4.84 10.375 4.84C11.065 4.84 11.625 4.316 11.625 3.67ZM10.375 11.16C11.065 11.16 11.625 11.684 11.625 12.33C11.625 12.975 11.065 13.5 10.375 13.5C9.685 13.5 9.125 12.975 9.125 12.33C9.125 11.684 9.685 11.16 10.375 11.16ZM11.625 8C11.625 7.355 11.065 6.83 10.375 6.83C9.685 6.83 9.125 7.355 9.125 8C9.125 8.645 9.685 9.17 10.375 9.17C11.065 9.17 11.625 8.645 11.625 8Z",fill:"currentColor"})}),Jv=({className:e})=>i.jsxs("svg",{width:"7",height:"8",viewBox:"0 0 7 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[i.jsx("path",{d:"M0.660034 6.83L6.32003 1.17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M6.32003 6.83L0.660034 1.17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]}),MW=({dataCoin:e,coinInclude:t,coinExclude:n,setCoinInclude:r,setCoinExclude:s,isLoadingCoin:a})=>{const[o,l]=m.useState(!1),[c,u]=m.useState(""),d=()=>{l(C=>!C)};m.useEffect(()=>{const C=e.filter(N=>!(n!=null&&n.includes(N.value))).map(N=>N.value);r(C)},[e,n]);const f=C=>{t!=null&&t.includes(C)?(r(t.filter(N=>N!==C)),s([...n,C])):(s(n.filter(N=>N!==C)),r([...t,C]))},x=()=>{const C=e.map(N=>N.value);r(C),s([])},g=()=>{const C=e.map(N=>N.value);s(C),r([])},v=e==null?void 0:e.filter(C=>{var N;return(N=C.label.toLowerCase())==null?void 0:N.includes(c.toLowerCase())}),w=()=>{u("")};return i.jsxs("div",{className:"col-span-1 flex flex-col gap-[4px] justify-start w-full max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Asset Management"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(eo,{content:"Choose which assets to include or exclude from copy trading. You can customize which coins you want to trade.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[180px] min-w-[180px] leading-[16px] mt-6"})})]})]}),i.jsxs("div",{className:"relative w-full max-w-full",children:[i.jsxs("div",{className:" flex justify-between items-center bg-[#353535] text-white rounded-md py-3 px-2.5 cursor-pointer select-none h-8",onClick:d,children:[i.jsx("div",{className:"flex justify-start items-center text-[#7c7c7c] text-sm font-semibold font-manrope leading-[8px]",children:i.jsxs("div",{className:"flex justify-start items-center gap-[3px]",children:[i.jsx("div",{className:"w-1.5 h-1.5 bg-[#67ffbd] rounded-full"}),i.jsxs("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px]",children:["Include"," ",i.jsx("span",{className:`${(t==null?void 0:t.length)>0?"text-[#67ffbd]":"text-white"} text-[11px] font-semibold font-manrope leading-[8px]`,children:`(${t==null?void 0:t.length})`})]}),i.jsx("div",{className:"w-1.5 h-1.5 bg-[#ff787b] rounded-full ml-[6px]"}),i.jsxs("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px]",children:["Exclude"," ",i.jsx("span",{className:`${(n==null?void 0:n.length)>0?"text-[#ff787b]":"text-white"} text-[11px] font-semibold font-manrope leading-[8px]`,children:`(${n==null?void 0:n.length})`})]})]})}),i.jsx(zh,{className:`w-3.5 h-3.5 transition ${o?"rotate-180":""}`})]}),o&&i.jsxs("div",{className:"w-full bg-[#353535] rounded-md mt-[2px] p-1 transition-all duration-200",children:[i.jsxs("div",{className:"flex justify-between items-center space-x-4 mb-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{onClick:x,className:"h-4 p-1.5 rounded-md outline outline-1 outline-[#67ffbd] inline-flex justify-start items-center gap-2 cursor-pointer",children:i.jsx("div",{className:"justify-start text-[#67ffbd] text-[11px] font-semibold font-manrope leading-[8px]",children:"Select All Include"})}),i.jsx("div",{onClick:g,className:"h-4 p-1.5 rounded-md outline outline-1 outline-[#ff787b] inline-flex justify-start items-center gap-2 cursor-pointer",children:i.jsx("div",{className:"justify-start text-[#ff787b] text-[11px] font-semibold font-manrope leading-[8px]",children:"Select All Exclude"})})]}),i.jsxs("div",{className:"flex items-center relative",children:[i.jsx("input",{type:"text",placeholder:"Search Coin",value:c,onChange:C=>u(C.target.value),className:`${c?"border border-[#7F7F7F]":""} py-[4px] bg-[#1B1B1B] border border-[#303030] rounded-md block text-white text-sm font-medium font-inter leading-[8px] w-full sm:w-[153px] lg:w-full pl-[30px] pr-6 focus:outline-none placeholder:text-[#7F7F7F] placeholder:font-inter placeholder:text-sm placeholder:font-medium placeholder:leading-[8px] h-[32px]`}),i.jsx(Ny,{className:"text-[#646464] absolute left-1.5"}),c&&i.jsx("span",{onClick:w,className:"flex justify-center items-center cursor-pointer absolute right-2 w-[10px] h-[10px]",children:i.jsx(Jv,{className:"hover:text-[#cdcdcd] text-[#7C7C7C] w-[10px] h-[10px]"})})]})]}),i.jsx("div",{className:"max-h-[230px] overflow-y-auto scrollbar-custom-scrollbar-dark",children:a?i.jsx("span",{className:"flex justify-center items-center w-full text-[#7e7e7e] text-sm font-medium font-inter leading-[8px] my-2",children:"Loading..."}):!v||v.length===0?i.jsx("span",{className:"flex justify-center items-center w-full text-[#7e7e7e] text-sm font-medium font-inter leading-[8px] my-4",children:c?"No coins match your search":"No data available at the moment. Please try again later."}):v==null?void 0:v.map((C,N)=>i.jsxs("div",{className:`${t!=null&&t.includes(C.value)?"bg-[#67ffbd]/20 hover:bg-[#67ffbd]/30":"bg-[#ff797c]/20 hover:bg-[#ff797c]/30"} flex justify-between items-center h-8 p-2 text-xs text-white rounded-md mb-[2px]`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-[26px]",children:[i.jsx($Bt,{className:`${t!=null&&t.includes(C.value)?"text-[#67FFBD]":"text-[#FF797C]"} w-4 h-4`}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("img",{src:C==null?void 0:C.icon,alt:C==null?void 0:C.icon,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:I=>sm(I)}),i.jsx("span",{className:`${t!=null&&t.includes(C.value)?"text-[#67FFBD]":"text-[#FF797C]"} justify-start text-[11px] font-semibold font-manrope leading-[13px] tracking-tight`,children:C.label})]})]}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsx("div",{onClick:()=>f(C.value),className:`${t!=null&&t.includes(C.value)?"bg-green-500 border-[#67ffbd]":"border-[#cdcdcd]"} h-4 p-1.5 rounded-md border inline-flex justify-start items-center gap-2 text-white cursor-pointer`,children:i.jsx("div",{className:"justify-start text-[11px] font-semibold font-manrope leading-[8px]",children:"Include"})}),i.jsx("div",{onClick:()=>f(C.value),className:`${t!=null&&t.includes(C.value)?"border-[#cdcdcd]":"bg-[#ff787b] border-[#ff787b]"} h-4 p-1.5 rounded-md border inline-flex justify-start items-center gap-2 text-white cursor-pointer`,children:i.jsx("div",{className:"justify-start text-[11px] font-semibold font-manrope leading-[8px]",children:"Exclude"})})]})]},N))})]})]})]})},RW=new Map,UBt=e=>{if(!e)return Math.floor(Math.random()*1240);const t=e.toLowerCase().replace(/^0x/,"");return parseInt(t.slice(0,8),16)%1240};function eDe({wallet:e,className:t=""}){const[n,r]=m.useState(()=>RW.get(e)||null),[s,a]=m.useState(!1);return m.useEffect(()=>{if(RW.has(e))return;const o=UBt(e);ls.get(`https://apiv7.nftinit.io/api/f5WNdSBmQ/${o}`).then(({data:l})=>{let c=l==null?void 0:l.image;c!=null&&c.startsWith("ipfs://")&&(c=`https://ipfs.io/ipfs/${c.slice(7)}`),RW.set(e,c),r(c)}).catch(console.error)},[e]),n?i.jsx("img",{src:n,alt:"NFT avatar",className:`${t} ${s?"":"invisible"}`,onLoad:()=>a(!0),onError:()=>a(!0)}):i.jsx("div",{className:`${t} bg-gray-800 rounded-full animate-pulse`})}const zBt=({open:e,setOpen:t,setCopyTradeModal:n,onClose:r,setIsUnderstand:s})=>i.jsxs(ga,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full justify-center p-4 text-center items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[320px] sm:w-[480px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Hi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-4",children:[i.jsx("div",{className:"w-80 sm:w-96 text-center text-white font-manrope text-[16px] sm:text-[20px] font-semibold leading-[8px]",children:"Potential Bot Wallet Detected"}),i.jsx("div",{className:"w-[270px] sm:w-[398px] text-center text-white/60 text-[13px] sm:text-[16px] font-medium font-manrope leading-5",children:"The wallet you're trying to copy trade appears to be likely operated by a bot. Following bot wallets may result in significant financial losses as they often use automated strategies that may not be profitable."})]}),i.jsxs("div",{className:"flex  items-center justify-center gap-4",children:[i.jsx("div",{onClick:()=>{t(!1),r()},className:"h-8 px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Cancel"})}),i.jsx("div",{onClick:()=>{t(!1),s(!0)},className:"h-8 px-2.5 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"I Understand, Continue"})})]})]})})})})})]}),HBt=({open:e,setOpen:t,setCopyTradeModal:n,onClose:r,setIsLighterUnderstand:s})=>i.jsxs(ga,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full justify-center p-4 text-center items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[320px] sm:w-[480px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Hi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-4",children:[i.jsx("div",{className:"w-80 sm:w-96 text-center text-white font-manrope text-[16px] sm:text-[20px] font-semibold leading-[8px]",children:"Rate Limit Warning"}),i.jsx("div",{className:"w-[270px] sm:w-[410px] text-center text-white/60 text-[13px] sm:text-[16px] font-medium font-manrope leading-5",children:"The wallet you’re trying to follow may execute frequent transactions. To ensure reliable copy-trading without rate-limit interruptions, please switch your account type to Premium before proceeding. Otherwise, trades may fail to execute due to API rate restrictions."}),i.jsxs("div",{onClick:()=>window.open("https://docs.lighter.xyz/perpetual-futures/account-types","_blank"),className:"flex justify-center items-center w-max gap-1.5 rounded-[10px] cursor-pointer",children:[i.jsx("div",{className:"text-white text-sm font-medium font-manrope leading-[18px] tracking-tight w-full sm:max-w-[500px] mb-2",children:"Learn more about Lighter account types here"}),i.jsx("img",{src:cm,alt:"routing",className:"w-3 h-3 mb-2"})]})]}),i.jsxs("div",{className:"flex  items-center justify-center gap-4",children:[i.jsx("div",{onClick:()=>{t(!1),r()},className:"h-8 px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Cancel"})}),i.jsx("div",{onClick:()=>{t(!1),s(!0)},className:"h-8 px-2.5 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"I Understand, Continue"})})]})]})})})})})]}),VBt=({checkAccountCopy:e,setIsLighterSub:t,setLighterSubError:n,setSlotCount:r,setSlotSubsCount:s,setSlotUsingCount:a,setSlotTotalCount:o,setSlotCountWallets:l})=>{const{setSignModalOpen:c,setTelegramChatId:u,setSubscriberRole:d,setSubsExpireDay:f,setMushboomerETH:x,setMushboomerSOL:g,setIsReferralCode:v,setIsReferralCodeName:w,setIsWhitelist:C,setHyperToken:N,setHyperAddress:I}=m.useContext(Gr),{address:P}=Yr(),[R,F]=m.useState(!1),[U,L]=m.useState(!1),[z,X]=m.useState(""),[ne,J]=m.useState(""),[Z,re]=m.useState(""),[he,Y]=m.useState(!1),ie=async()=>{var fe,Ae,ce,ye,Ne,be;const ee=window.localStorage.getItem("hyperToken"),ae=window.localStorage.getItem("hyperAddress");if(!(!ee||!ae))try{Y(!0);const je=await Si(ae.toLowerCase(),ee);je!=null&&je.success?(u(je==null?void 0:je.telegram_chat_id),d(je==null?void 0:je.subscriber_role),f(je==null?void 0:je.subs_expire_day),x((fe=je==null?void 0:je.mushboomer_counts)==null?void 0:fe.eth),g((Ae=je==null?void 0:je.mushboomer_counts)==null?void 0:Ae.sol),v(je==null?void 0:je.referral_code),w(je==null?void 0:je.refcode),C(je==null?void 0:je.whitelist),N(ee),I(ae),re(je==null?void 0:je.farming_tools),t(je==null?void 0:je.farming_tools),Y(!1),je!=null&&je.farming_tools&&n(!1),r((ce=je==null?void 0:je.copy_trade_slots_info)==null?void 0:ce.extra_slot_count),s((ye=je==null?void 0:je.copy_trade_slots_info)==null?void 0:ye.subs_slot_count),a((Ne=je==null?void 0:je.copy_trade_slots_info)==null?void 0:Ne.using_slot_count),o((be=je==null?void 0:je.copy_trade_slots_info)==null?void 0:be.total_slot_count),l(je==null?void 0:je.copy_trade_slots_wallets)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),N(""),I(""),Y(!1))}catch(je){console.error("Token verification error:",je),console.error(je.message||"An unknown error occurred."),Y(!1)}},oe=async()=>new yl(window.ethereum).eth.getAccounts(ae=>ae),G=async(ee="farming",ae=24,fe=5e3)=>{ae<=0||(await new Promise(Ae=>setTimeout(Ae,fe)),await ie(),ee==="farming"&&!Z?G(ee,ae-1,fe):e())},V=async()=>{J("");const ee=window.localStorage.getItem("hyperToken"),ae=window.localStorage.getItem("hyperAddress");if(!ee||!P){c(!0);return}L(!0),F(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(ce){console.error("Failed to switch network",ce),F(!1);return}const fe=new yl(window.ethereum);var Ae=await oe();if(Ae.length>0?Ae=Ae[0]:Ae=void 0,Ae){const ye={from:Ae,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:"120000000000000000"};await fe.eth.sendTransaction(ye).then(Ne=>{console.log("txHash :>> ",Ne),F(!1),X(Ne.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:P?P.toLowerCase():ae,token:ee,payment_tx:Ne.transactionHash,payment_role:"farming_tools"})}),ie(),G("farming")}).catch(Ne=>{console.log(Ne),Ne.code===-32003||Ne.message.includes("insufficient funds")?J("Insufficient funds."):Ne.message==="MetaMask Tx Signature: User denied transaction signature."&&L(!1)})}else await fe.eth.requestAccounts()};return i.jsxs(i.Fragment,{children:[i.jsx(fd,{open:U,setOpen:L,transactionHash:z,transactionLoading:R,paymentPresaleRole:Z,errorFunds:ne,activeMethod:2}),i.jsx("div",{children:i.jsx("div",{onClick:()=>{V()},className:"flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer min-w-max font-semibold",children:"Subscribe / 0.12 ETH"})})]})},Ale=({open:e=!1,setOpen:t=()=>{},oldSlotCount:n,checkAccountTrade:r,tradeMarket:s})=>{const{address:a}=Yr(),{setSignModalOpen:o,setTelegramChatId:l,setSubscriberRole:c,setSubsExpireDay:u,setMushboomerETH:d,setMushboomerSOL:f,setIsReferralCode:x,setIsReferralCodeName:g,setIsWhitelist:v,setHyperToken:w,setHyperAddress:C}=m.useContext(Gr),[N,I]=m.useState(1),[P,R]=m.useState(!1),[F,U]=m.useState(!1),[L,z]=m.useState(""),[X,ne]=m.useState(""),[J,Z]=m.useState(""),re=ae=>/^\d*$/.test(ae),he=ae=>{["e","E","+","-"].includes(ae.key)&&ae.preventDefault()};m.useEffect(()=>{e||I(1)},[e]);const Y=m.useRef(J);m.useEffect(()=>{Y.current=J},[J]);const ie=m.useMemo(()=>{if(N==="")return!1;const ae=Number(N);return Number.isInteger(ae)&&ae>=1},[N]),oe=async()=>{var Ae,ce,ye;const ae=window.localStorage.getItem("hyperToken"),fe=window.localStorage.getItem("hyperAddress");if(!(!ae||!fe))try{const Ne=await Si(fe.toLowerCase(),ae);Ne!=null&&Ne.success?(l(Ne==null?void 0:Ne.telegram_chat_id),c(Ne==null?void 0:Ne.subscriber_role),u(Ne==null?void 0:Ne.subs_expire_day),d((Ae=Ne==null?void 0:Ne.mushboomer_counts)==null?void 0:Ae.eth),f((ce=Ne==null?void 0:Ne.mushboomer_counts)==null?void 0:ce.sol),x(Ne==null?void 0:Ne.referral_code),g(Ne==null?void 0:Ne.refcode),v(Ne==null?void 0:Ne.whitelist),w(ae),C(fe),Z((ye=Ne==null?void 0:Ne.copy_trade_slots_info)==null?void 0:ye.extra_slot_count)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),w(""),C(""))}catch(Ne){console.error("Token verification error:",Ne),console.error(Ne.message||"An unknown error occurred.")}},G=async()=>new yl(window.ethereum).eth.getAccounts(fe=>fe),V=async(ae="slot",fe=24,Ae=5e3)=>{fe<=0||(await new Promise(ce=>setTimeout(ce,Ae)),await oe(),ae==="slot"&&Y.current<=n?V(ae,fe-1,Ae):r())},ee=async ae=>{ne("");const fe=window.localStorage.getItem("hyperToken"),Ae=window.localStorage.getItem("hyperAddress");if(!fe||!a){o(!0);return}U(!0),R(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(Ne){console.error("Failed to switch network",Ne),R(!1);return}const ce=new yl(window.ethereum);var ye=await G();if(ye.length>0?ye=ye[0]:ye=void 0,ye){const be=ae*.012,je=ce.utils.toWei(be.toString(),"ether"),Ie={from:ye,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:je};await ce.eth.sendTransaction(Ie).then(Re=>{console.log("txHash :>> ",Re),R(!1),z(Re.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/slots_payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:a?a.toLowerCase():Ae,token:fe,payment_tx:Re.transactionHash,slot_role:"lighter_copy_trade",slot_qty:Number(N)})}),oe(),V("slot")}).catch(Re=>{console.log(Re),Re.code===-32003||Re.message.includes("insufficient funds")?ne("Insufficient funds."):Re.message==="MetaMask Tx Signature: User denied transaction signature."&&U(!1)})}else await ce.eth.requestAccounts()};return e?i.jsxs(i.Fragment,{children:[i.jsx(fd,{open:F,setOpen:U,transactionHash:L,transactionLoading:P,paymentPresaleRole:!(J<=n),errorFunds:X,activeMethod:2}),i.jsxs("div",{className:"fixed inset-0 z-[51] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>t(!1)}),i.jsx("div",{className:"relative w-[380px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#404040] max-h-[97dvh] overflow-y-auto p-5",children:i.jsxs("div",{className:"flex flex-col w-full gap-4",children:[i.jsx("div",{className:"text-white/90 font-manrope text-[18px] font-semibold leading-4 mx-auto",children:"Get more slots"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-semibold",children:"Slot Count"}),i.jsxs("div",{className:"flex items-center justify-center gap-2",children:[i.jsx("button",{onClick:()=>I(ae=>{const fe=Number(ae||0);return fe>1?String(fe-1):"1"}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"–"}),i.jsx("input",{value:N,onChange:ae=>{const fe=ae.target.value.trim();if(fe==="")return I("");re(fe)&&I(fe)},onKeyDown:he,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10",className:"w-full h-8 text-center rounded-md bg-[#242424] border border-[#353535] text-white text-[13px] outline-none placeholder:text-[#7F7F7F]"}),i.jsx("button",{onClick:()=>I(ae=>{const fe=Number(ae||0);return String(fe+1)}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"+"})]}),N!==""&&!ie&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer that is at least 1."})]}),i.jsxs("div",{className:"text-[13px] text-[#7C7C7C] font-semibold flex items-center gap-1",children:["Total Price:",i.jsxs("span",{className:"bg-[#1E1E1E] text-[#F8D4AB] font-bold px-2 py-[2px] rounded-md border border-[#3A3A3A]",children:[(N*.012).toFixed(3)," ETH"]})]}),i.jsx("div",{onClick:ae=>{ae.preventDefault(),ie&&ee(N)},className:`flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] min-w-max font-semibold ${ie?"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer":"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed"}`,children:"Buy"})]})})]})]}):null},WBt=({normalizedCopyTradeList:e,selectedWmIndex:t,setSelectedWmIndex:n,getSettingList:r,setIsNewSetting:s})=>i.jsxs("div",{children:[i.jsx("span",{className:"text-[#9B9B9B] font-manrope text-[10px] font-semibold leading-[13px] tracking-[0.8px]",children:"ACTIVE BOTS"}),(e==null?void 0:e.length)>0?i.jsxs("div",{className:"flex flex-col gap-2.5 p-2.5 mt-1.5 border border-white/5 rounded-xl bg-gradient-to-b from-[#1a1a1a] to-[#141414] shadow-lg",children:[i.jsxs("button",{onClick:r,className:`${t===null?"bg-[#2d4a3e] border border-[#3a6b5a] text-white shadow-[0_0_0_1px_rgba(116,70,255,0.3)]":"bg-[#181818] border border-[#7446FF40] text-white hover:bg-[#5834C320] hover:border-[#5834C370]"} px-3 py-2 rounded-lg text-left text-[12px] font-semibold transition-all duration-200 flex items-center justify-start gap-2 relative group`,children:[i.jsx("div",{className:`${t===null?"bg-[#3a6b5a] group-hover:bg-[#2d4a3e]":"bg-[#7446FF30] group-hover:bg-[#5834C350]"} flex items-center justify-center w-4 h-4 rounded   transition-colors`,children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:`${t===null?"text-[#fff]":"text-[#7446FF]"} w-3 h-3 `,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})})}),i.jsx("span",{children:"Copy with Another Wallet"}),i.jsx("span",{className:`${t===null?"text-white bg-[#3a6b5a]":"text-white bg-[#7446FF]"} ml-auto px-1.5 py-0.5 rounded text-[9px] font-bold `,children:"NEW"})]}),i.jsx("div",{className:"w-full h-px bg-white/5"}),i.jsx("div",{className:"flex flex-col gap-2 max-h-[21vh] overflow-y-scroll scrollbar-custom-scrollbar-dark",children:e==null?void 0:e.map((a,o)=>{var l,c,u,d;return i.jsxs("button",{onClick:()=>{n(o),s(!1)},className:`px-3 py-2 rounded-lg text-left text-[12px] font-medium transition-all duration-200
                ${t===o?"bg-[#2d4a3e] border border-[#3a6b5a] text-white shadow-[0_0_0_1px_rgba(58,107,90,0.3)]":"bg-[#181818] border border-[#2a2a2a] text-white hover:bg-[#1f1f1f] hover:border-[#353535]"} flex justify-between items-center gap-2`,children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"flex justify-start items-center gap-2",children:(a==null?void 0:a.target_platform)==="hyper"?i.jsx(i.Fragment,{children:i.jsx("img",{src:"https://app.hyperliquid.xyz/coins/HYPE.svg",className:"w-4 h-4"})}):i.jsx(i.Fragment,{children:i.jsx(oy,{className:"w-4 h-4 text-white"})})}),i.jsx("span",{className:`min-w-max ${t===o?"text-white":"text-[#d3d3d3]"}`,children:((l=a==null?void 0:a.wm_name)==null?void 0:l.length)>15?`${(c=a==null?void 0:a.wm_name)==null?void 0:c.slice(0,15)}...`:a==null?void 0:a.wm_name}),i.jsx("span",{className:"text-[#9b9b9b]",children:"-"}),i.jsx("span",{className:t===o?"text-white":"text-[#d3d3d3]",children:((u=a==null?void 0:a.tag)==null?void 0:u.length)>18?`${(d=a==null?void 0:a.tag)==null?void 0:d.slice(0,18)}...`:a==null?void 0:a.tag})]}),i.jsx(fi,{content:`${a!=null&&a.copy_trait_mode?"Run: ON":"Run: OFF"}`,children:i.jsx("div",{className:"flex justify-start items-center has-tooltip relative",children:i.jsx("span",{className:"flex items-center gap-2",children:i.jsx("span",{className:`w-2.5 h-2.5 rounded-full ${a!=null&&a.copy_trait_mode?"bg-green-500":"bg-red-500"}`})})})})]},o)})})]}):i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ec,alt:""}),i.jsx("div",{className:"flex flex-col items-center h-max gap-3",children:i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No trades have been made with this wallet."})})]})]});function g5({open:e,setOpen:t,copyTradeData:n,copyTradeWallet:r,setCopyTradeWallet:s,isScalper:a,setCopyTradeData:o,sourcePage:l="default"}){var cr,bs,Kr,Ms,ei;const{getCopyTradeWatchList:c,copyTradeWatchList:u,mushboomerETH:d,mushboomerSOL:f,trackedWatchList:x,isWhitelist:g,setTelegramChatId:v,setSubscriberRole:w,setSubsExpireDay:C,setMushboomerETH:N,setMushboomerSOL:I,setIsReferralCode:P,setIsReferralCodeName:R,setIsWhitelist:F,setHyperToken:U,setHyperAddress:L}=m.useContext(Gr),{address:z}=Yr(),[X,ne]=m.useState(!1),[J,Z]=m.useState(!1),[re,he]=m.useState("method_two"),[Y,ie]=m.useState("All"),[oe,G]=m.useState([]),[V,ee]=m.useState(!1),[ae,fe]=m.useState(null),[Ae,ce]=m.useState(!1),[ye,Ne]=m.useState(!1),[be,je]=m.useState(!1),[Ie,Re]=m.useState(!1),[Qe,Be]=m.useState(!1),[it,tt]=m.useState(!1),[at,dt]=m.useState(!1),[ct,Ut]=m.useState(!1),[kt,tn]=m.useState(""),[jt,un]=m.useState(""),[cn,Pt]=m.useState(""),[Xe,Vt]=m.useState(""),[Yt,Ve]=m.useState(""),[Ke,ft]=m.useState(""),[en,Dt]=m.useState(""),[At,Je]=m.useState(""),[He,Rt]=m.useState(100),[qe,lt]=m.useState(!0),[xt,Nt]=m.useState(!0),[It,xn]=m.useState(!1),[dn,Mn]=m.useState(!0),[_n,kn]=m.useState(!0),[vn,Qn]=m.useState(null),[Hn,$n]=m.useState(null),[Jn,Nn]=m.useState(""),[ln,Oe]=m.useState(""),[sn,fn]=m.useState({inputValue:"",selectValue:"%"}),[Et,Kn]=m.useState({inputValue:"",selectValue:"%"}),[Cn,Bt]=m.useState([]),[an,Pn]=m.useState(!0),[qn,nr]=m.useState([]),[tr,Qt]=m.useState([]);m.useState(!1),m.useState(!1);const[zn,Yn]=m.useState(!1),[Lt,Fn]=m.useState(null),[Ee,p]=m.useState(null),[h,S]=m.useState(null),[_,k]=m.useState(null),[T,B]=m.useState(!1),[q,te]=m.useState(!1),[ue,de]=m.useState(!1),[xe,we]=m.useState(!1),[ke,Me]=m.useState(!1),Ye=m.useRef(null),[Fe,rt]=m.useState(null),[se,Ce]=m.useState(!1),De=m.useRef(null),[Le,_e]=m.useState(!1),[nt,ot]=m.useState(!1),[gt,Jt]=m.useState(!1),[Ge,et]=m.useState([]),[We,wt]=m.useState([]),[St,Kt]=m.useState(!1),[gn,yn]=m.useState(!1),[hn,br]=m.useState(!1),[pt,Wt]=m.useState(0),[Zt,vt]=m.useState(0),[Ot,wn]=m.useState(0),[Gn,fr]=m.useState(0),[ur,$t]=m.useState(null),[nn,Vn]=m.useState(!1),[lr,er]=m.useState(!1),[gr,dr]=m.useState([]),[Fs,us]=m.useState(null),[xr,vr]=m.useState(!1),rs=async Tt=>{var as,ns,ys,Ns,ca,Hs;if(!e)return;const sr=Tt||Fe,mr=window.localStorage.getItem("hyperToken"),Vr=window.localStorage.getItem("hyperAddress");if(!(!mr||!Vr))try{br(!0);const vs=await Si(Vr.toLowerCase(),mr);vs!=null&&vs.success?(v(vs==null?void 0:vs.telegram_chat_id),w(vs==null?void 0:vs.subscriber_role),C(vs==null?void 0:vs.subs_expire_day),N((as=vs==null?void 0:vs.mushboomer_counts)==null?void 0:as.eth),I((ns=vs==null?void 0:vs.mushboomer_counts)==null?void 0:ns.sol),P(vs==null?void 0:vs.referral_code),R(vs==null?void 0:vs.refcode),F(vs==null?void 0:vs.whitelist),U(mr),L(Vr),Wt((ys=vs==null?void 0:vs.copy_trade_slots_info)==null?void 0:ys.extra_slot_count),vt((Ns=vs==null?void 0:vs.copy_trade_slots_info)==null?void 0:Ns.subs_slot_count),wn((ca=vs==null?void 0:vs.copy_trade_slots_info)==null?void 0:ca.using_slot_count),fr((Hs=vs==null?void 0:vs.copy_trade_slots_info)==null?void 0:Hs.total_slot_count),dr(vs==null?void 0:vs.copy_trade_slots_wallets),Kt(vs==null?void 0:vs.farming_tools),sr==="lighter"?vs!=null&&vs.farming_tools?yn(!1):yn(!0):yn(!1),br(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),U(""),L(""),br(!1))}catch(vs){console.error("Token verification error:",vs),console.error(vs.message||"An unknown error occurred."),br(!1)}};m.useEffect(()=>{if(e)if(St&&Gn==0&&Fe==="lighter"&&vn){const Tt=gr==null?void 0:gr.includes(vn);er(!Tt)}else er(!1)},[vn,Fe,Gn,St,e]);const Zr=m.useMemo(()=>n?Array.isArray(n)?n:[]:[],[n]);m.useEffect(()=>{if(l==="default"||!l||!Zr.length)return;const Tt=Zr.findIndex(sr=>(sr==null?void 0:sr.wallet_id)===l);Tt!==-1&&us(Tt)},[l,Zr]),m.useEffect(()=>{l!=="default"||!Zr.length||Fs===null&&us(0)},[Zr,l]);const gi=Zr[Fs]||null,oi=m.useMemo(()=>!xr||!vn?!1:Zr.some(Tt=>(Tt==null?void 0:Tt.wallet_id)===vn),[xr,vn,Zr,Fe]);function la(Tt){return String(Tt).trim().toUpperCase()}const jr=Tt=>{Tt&&(tn(Tt==null?void 0:Tt.margin_used_rate),un(Tt==null?void 0:Tt.min_usd_per_order),Pt(Tt==null?void 0:Tt.max_usd_per_order),Vt(Tt==null?void 0:Tt.max_usd_per_positions),Ve(Tt==null?void 0:Tt.initial_order_max_usd),ft(Tt==null?void 0:Tt.margin_used_amount),Dt(Tt==null?void 0:Tt.increase_limit),Je(Tt==null?void 0:Tt.copy_current_percentage),Rt((Tt==null?void 0:Tt.scaling)==null?100:Tt==null?void 0:Tt.scaling),ie((Tt==null?void 0:Tt.position_type)===0?"All":(Tt==null?void 0:Tt.position_type)===1?"LONG":(Tt==null?void 0:Tt.position_type)===2?"SHORT":"All"),rt(Tt!=null&&Tt.target_platform?(Tt==null?void 0:Tt.target_platform)==="hyper"?"hyper":Tt==null?void 0:Tt.target_platform:"hyper"),he((Tt==null?void 0:Tt.method_type)===1?"method_one":(Tt==null?void 0:Tt.method_type)===2?"method_two":(Tt==null?void 0:Tt.method_type)===2e3?"method_twothousand":"method_two"),lt((Tt==null?void 0:Tt.copy_trait_mode)==null?!0:Tt==null?void 0:Tt.copy_trait_mode),Nt((Tt==null?void 0:Tt.open_with_increase)!==null?Tt==null?void 0:Tt.open_with_increase:!0),xn((Tt==null?void 0:Tt.included_twaps)!==null?Tt==null?void 0:Tt.included_twaps:!1),Mn((Tt==null?void 0:Tt.future_listed_tokens)!==null?Tt==null?void 0:Tt.future_listed_tokens:!0),kn((Tt==null?void 0:Tt.copy_current)!==null?Tt==null?void 0:Tt.copy_current:!0),Qn(Tt==null?void 0:Tt.wallet_id),$n(Tt==null?void 0:Tt.wallet_id),Nn(Tt==null?void 0:Tt.tag),Oe(Tt==null?void 0:Tt.comments),fn({inputValue:Tt==null?void 0:Tt.stop_loss_amount,selectValue:(Tt==null?void 0:Tt.stop_loss_type)??"%"}),Kn({inputValue:Tt==null?void 0:Tt.target_price_amount,selectValue:Tt==null?void 0:Tt.target_price_type}),nr((Tt==null?void 0:Tt.include_coins)||[]),Qt((Tt==null?void 0:Tt.exclude_coins)||[]),Ss(Tt!=null&&Tt.target_platform?(Tt==null?void 0:Tt.target_platform)==="hyper"?"hyper":Tt==null?void 0:Tt.target_platform:"hyper"))};m.useEffect(()=>{gi===null&&n!==null?xr||jr(Array.isArray(n)?n[0]:n):jr(gi)},[gi,n]),m.useEffect(()=>{e&&n===null&&(async()=>{try{const Tt=window.localStorage.getItem("hyperToken"),sr=window.localStorage.getItem("hyperAddress");if(!Tt)return;const[mr,Vr]=await Promise.all([fetch("https://dextrabothypev2.nftinit.io/api/wallet/confirmed-list",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():sr,token:Tt})}),fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():sr,token:Tt})})]),[as,ns]=await Promise.all([mr.json(),Vr.json()]),ys=as!=null&&as.success?as.data:[],Ns=ns!=null&&ns.success?ns.data:[];ys.length>0?rt("hyper"):Ns.length>0?rt("lighter"):rt("hyper")}catch(Tt){console.error("Wallet auto-select error:",Tt)}})()},[e,n]);const Xt=u==null?void 0:u.some(Tt=>(Tt==null?void 0:Tt.wallet_address)===r),pe=async()=>{try{const Tt=window.localStorage.getItem("hyperToken"),sr=window.localStorage.getItem("hyperAddress");if(!Tt){setSignModalOpen(!0);return}const mr="https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",Vr={address:z?z.toLowerCase():sr,token:Tt},as=await fetch(mr,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(Vr)});if(!as.ok)throw new Error(`Server responded with status ${as.status}`);const ns=await as.json();if(ns.success){vr(!0);const ys=ns==null?void 0:ns.data;jr(ys),us(null)}else console.log(ns.error_message),on.error(ns.error_message)}catch(Tt){console.error("Error in like function:",Tt),on.error(Tt.message||"Something went wrong!")}},st=Tt=>{let sr=Tt.target.value;if(sr===""){fn(mr=>({...mr,inputValue:""}));return}/^\d*\.?\d{0,2}$/.test(sr)&&fn(mr=>({...mr,inputValue:sr}))},Ft=Tt=>{let sr=Tt.target.value;if(sr===""){Kn(mr=>({...mr,inputValue:""}));return}/^\d*\.?\d{0,2}$/.test(sr)&&Kn(mr=>({...mr,inputValue:sr}))},yt=Tt=>{let sr=Tt.target.value.trim();if(sr===""){tn(null);return}/^\d*\.?\d{0,2}$/.test(sr)&&tn(sr)},pn=Tt=>{let sr=Tt.target.value.trim();if(sr===""){un(null);return}if(/^\d*\.?\d{0,2}$/.test(sr)){un(sr);const mr=parseFloat(sr),Vr=re==="method_twothousand"&&(cn!=null&&!isNaN(cn)&&cn&&mr>Number(cn)||Xe!=null&&!isNaN(Xe)&&Xe&&mr>Number(Xe));tt(Vr);const as=re==="method_twothousand"&&cn!=null&&!isNaN(cn)&&cn&&mr!=null&&!isNaN(mr)&&mr&&mr>Number(cn);Be(as);const ns=re==="method_twothousand"&&Xe!=null&&!isNaN(Xe)&&Xe&&mr>Number(Xe);Ut(ns)}},An=Tt=>{let sr=Tt.target.value.trim();if(sr===""){Pt(null);return}if(/^\d*\.?\d{0,2}$/.test(sr)){Pt(sr);const mr=parseFloat(sr),Vr=re==="method_twothousand"&&(mr==null||isNaN(mr)||!mr||jt!=null&&!isNaN(jt)&&jt&&mr<Number(jt)||mr!=null&&!isNaN(mr)&&mr&&Xe!=null&&!isNaN(Xe)&&Xe&&mr>Number(Xe));Be(Vr);const as=re==="method_twothousand"&&jt!=null&&!isNaN(jt)&&jt&&mr<Number(jt);tt(as);const ns=re==="method_twothousand"&&mr!=null&&!isNaN(mr)&&mr&&Xe!=null&&!isNaN(Xe)&&Xe&&mr>Number(Xe);Ut(ns)}},or=Tt=>{let sr=Tt.target.value.trim();if(sr===""){Ve(null);return}if(/^\d*\.?\d{0,2}$/.test(sr)){Ve(sr);const mr=parseFloat(sr),Vr=re==="method_twothousand"&&Xe!=null&&!isNaN(Xe)&&Xe&&mr&&mr>Number(Xe);dt(Vr),Ut(Vr)}},_r=Tt=>{let sr=Tt.target.value.trim();if(sr===""){Vt(null);return}if(/^\d*\.?\d{0,2}$/.test(sr)){Vt(sr);const mr=parseFloat(sr),Vr=re==="method_twothousand"&&(cn!=null&&!isNaN(cn)&&cn&&mr<Number(cn)||jt!=null&&!isNaN(jt)&&jt&&mr<Number(jt)||Yt!=null&&!isNaN(Yt)&&Yt&&mr<Number(Yt));Ut(Vr);const as=re==="method_twothousand"&&cn!=null&&!isNaN(cn)&&cn&&mr!=null&&!isNaN(mr)&&mr&&mr<Number(cn);Be(as);const ns=re==="method_twothousand"&&jt!=null&&!isNaN(jt)&&jt&&mr<Number(jt);tt(ns);const ys=re==="method_twothousand"&&Yt!=null&&!isNaN(Yt)&&Yt&&mr<Number(Yt);dt(ys)}},wr=Tt=>{Nn(Tt.target.value),je(!1)},pr=Tt=>{let sr=Tt.target.value;if(sr===""){ft("");return}/^\d*\.?\d{0,2}$/.test(sr)&&ft(sr),Ne(!1)},es=Tt=>{let sr=Tt.target.value;if(sr===""){Dt("");return}/^\d*\.?\d{0,2}$/.test(sr)&&Dt(sr)},ts=Tt=>{let sr=Tt.target.value;if(sr===""){Rt("");return}/^\d*\.?\d{0,2}$/.test(sr)&&Rt(sr)},Lr=Tt=>{["-","+","e"].includes(Tt.key)&&Tt.preventDefault()};async function Qr(){try{Z(!0);const Tt=vn,sr=window.localStorage.getItem("hyperToken"),mr="https://dextrabothypev2.nftinit.io/",Vr=window.localStorage.getItem("hyperAddress");if(!sr||!r)throw new Error("Authentication token is missing. Please log in again.");const ns=await(await fetch(mr+"api/test_app/following/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():Vr,token:sr,follow_address:r.toLowerCase(),copy_trait_mode:qe??!1,open_with_increase:xt??!1,included_twaps:It??!1,future_listed_tokens:dn??!1,copy_current:_n??!1,margin_used_rate:kt??null,min_usd_per_order:jt??null,max_usd_per_order:cn??null,max_usd_per_positions:Xe??null,initial_order_max_usd:Yt||null,margin_used_amount:Ke||null,increase_limit:en||null,copy_current_percentage:At||null,scaling:He||null,method_type:re=="method_two"?2:re=="method_twothousand"?2e3:re=="method_one"?1:null,position_type:Y=="All"?0:Y=="LONG"?1:Y=="SHORT"?2:null,tag:Jn??null,comments:ln??null,stop_loss_amount:sn.inputValue?sn.inputValue:null,stop_loss_type:sn.selectValue??"%",target_price_amount:Et.inputValue?Et.inputValue:null,target_price_type:Et.selectValue??"%",wallet_id:vn??null,include_coins:Array.isArray(qn)&&(qn==null?void 0:qn.length)>0?qn:null,exclude_coins:Array.isArray(tr)&&(tr==null?void 0:tr.length)>0?tr:null,target_platform:Fe??"hyper"})})).json();if(ns.success){Z(!1),c();const ys=Array.isArray(ns.data)?ns.data.filter(Hs=>{var vs;return((vs=Hs==null?void 0:Hs.wallet_address)==null?void 0:vs.toLowerCase())===(r==null?void 0:r.toLowerCase())}):[],Ns=ys==null?void 0:ys.sort((Hs,vs)=>new Date(vs.created_at)-new Date(Hs.created_at));o(Ns);const ca=Ns==null?void 0:Ns.findIndex(Hs=>(Hs==null?void 0:Hs.wallet_id)===Tt);us(ca!==-1?ca:0),rs(Fe),Yn(!1),on.success(`${(r==null?void 0:r.slice(0,5))+"..."+(r==null?void 0:r.slice(-3))} ${Xt?"Copy Trade settings saved":"Successfully added to Copy Trade"}`,{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px",width:"440px",minWidth:"440px",whiteSpace:"nowrap"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}}),vr(!1)}else Z(!1),on.error(ns.error_message||"Registration failed.")}catch(Tt){console.error("Error in copyTradeSave:",Tt),on.error(Tt.message||"An unexpected error occurred."),Z(!1)}}const Ir=async()=>{try{ne(!0);const Tt=window.localStorage.getItem("hyperToken"),sr="https://dextrabothypev2.nftinit.io/api/test_app/following/unfollow/",mr=window.localStorage.getItem("hyperAddress");if(!Tt||!r)throw new Error("Required information is missing. Please log in or connect your wallet.");const Vr=await fetch(sr,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():mr,token:Tt,follow_address:r,target_platform:Fe??"hyper",wallet_id:vn??null})});if(!Vr.ok)throw new Error(`Failed to unlike: ${Vr.status} ${Vr.statusText}`);const as=await Vr.json();if(as.success){ne(!1),c();const ns=Array.isArray(as.data)?as.data.filter(Ns=>{var ca;return((ca=Ns==null?void 0:Ns.wallet_address)==null?void 0:ca.toLowerCase())===(r==null?void 0:r.toLowerCase())}):[],ys=Array.isArray(ns)?[...ns].sort((Ns,ca)=>new Date(ca.created_at)-new Date(Ns.created_at)):[];o(ys),ys.length>0?us(0):us(null),rs(Fe),ns&&ns.length===0&&pe(),on.success(`${r.slice(0,5)+"..."+r.slice(-3)}  Successfully removed from Copy Trade`,{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px",width:"480px",minWidth:"480px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})}else console.error(as.error_message),on.error(as.error_message),ne(!1)}catch(Tt){console.error("Error in unlike function:",Tt),on.error(Tt.message||"Something went wrong!"),ne(!1)}},Ss=async Tt=>{if(!e)return;const sr=Tt||Fe;try{ee(!0);const mr=window.localStorage.getItem("hyperToken"),Vr=window.localStorage.getItem("hyperAddress"),as=sr==="hyper"?"https://dextrabothypev2.nftinit.io/api/wallet/confirmed-list":"https://dextrabothypev2.nftinit.io/api/wallet/list-lighter";if(!mr)return;const ys=await(await fetch(as,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():Vr,token:mr})})).json();ys.success?(G(ys==null?void 0:ys.data),ee(!1)):(console.log(ys.error_message),ee(!1),fe(ys.error_message))}catch(mr){console.error("Error generate wallet list:",mr),ee(!1),fe(mr.message)}},hi=async()=>{try{const Tt=window.localStorage.getItem("hyperToken"),sr=window.localStorage.getItem("hyperAddress");if(!Tt)return;const[mr,Vr]=await Promise.all([fetch("https://dextrabothypev2.nftinit.io/api/wallet/confirmed-list",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():sr,token:Tt})}),fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:z?z.toLowerCase():sr,token:Tt})})]),[as,ns]=await Promise.all([mr.json(),Vr.json()]);as.success&&et(as.data),ns!=null&&ns.success&&wt(ns.data)}catch(Tt){console.error("Error fetching wallet lists:",Tt)}},li=Tt=>Tt!=null&&Tt.assetPositions?Tt.assetPositions.filter(sr=>{if(!sr.position||!sr.position.szi)return!1;const mr=parseFloat(sr.position.szi);return!isNaN(mr)&&mr!==0}).map(sr=>{const mr=sr.position,Vr=parseFloat(mr.szi),as=parseFloat(mr.entryPx),ns=parseFloat(mr.positionValue),ys=parseFloat(mr.unrealizedPnl),Ns=parseFloat(mr.returnOnEquity)*100,ca=parseFloat(mr.marginUsed),Hs=mr.leverage.value,vs=parseFloat(mr.cumFunding.sinceOpen),sc=Vr>0?"Long":"Short";return{asset:mr.coin,type:sc,size:Math.abs(Vr),entryPrice:as.toFixed(2),currentPrice:(ns/Math.abs(Vr)).toFixed(2),leverage:Hs,positionValue:ns.toFixed(2),marginUsed:ca.toFixed(2),unrealizedPnl:ys.toFixed(2),roe:Ns.toFixed(2),funding:vs.toFixed(4),liquidationPrice:mr.liquidationPx?parseFloat(mr.liquidationPx).toFixed(2):"N/A"}}):[];m.useEffect(()=>{const Tt=async()=>{const Vr=await ls.post("https://api-ui.hyperliquid.xyz/info",{type:"clearinghouseState",user:r});if(Vr.data){Fn(Vr.data);const as=li(Vr.data);p(as)}},sr=async()=>{var as,ns,ys;const Vr=await ls.post("https://api-ui.hyperliquid.xyz/info",{type:"portfolio",user:r});if(Vr.data){const Ns=((ns=(as=Vr.data.find(Hs=>Hs[0]==="perpMonth"))==null?void 0:as[1])==null?void 0:ns.pnlHistory)||[],ca=((ys=Ns[Ns.length-1])==null?void 0:ys[1])??0;S(ca)}},mr=async()=>{var ns;const as=await(await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=30&order=-perp_pnl&offset=0&limit=50&user_token=${r}`)).json();k(((ns=as==null?void 0:as.results[0])==null?void 0:ns.win_complated_rate)||"-")};r&&(Tt(),sr(),mr())},[r]),m.useEffect(()=>{if(!e)return;let Tt=!1;async function sr(){var mr,Vr;try{Pn(!0);const ns=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_coins/")).json(),ys=()=>di.random().hex(),Ns={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},ca=(Vr=(mr=ns.coins)==null?void 0:mr.filter(Hs=>!Hs.startsWith("@")&&!Hs.endsWith("/USDC")))==null?void 0:Vr.map(Hs=>({value:Hs,label:Hs.endsWith("/USDC")?Hs+" (Spot)":Hs,color:ys(),icon:`https://app.hyperliquid.xyz/coins/${Ns[Hs]||Hs.split("/")[0]}.svg`}));Tt||(Bt(ca),Pn(!1))}catch(as){Tt||(console.error("Data retrieval error:",as),Pn(!1))}}return sr(),()=>{Tt=!0}},[e]),m.useEffect(()=>{e&&(Ss(Fe),rs(Fe))},[Fe,e]),m.useEffect(()=>{e&&hi()},[e]),m.useEffect(()=>{if(!e||!Xt||!gi||!Array.isArray(Cn)||Cn.length===0)return;const Tt=Cn.map(ys=>typeof ys=="string"?ys:ys.value).filter(Boolean),sr=new Map(Tt.map(ys=>[la(ys),ys])),mr=Tt.map(la),Vr=new Set([...(gi.include_coins||[]).map(la),...(gi.exclude_coins||[]).map(la)]),as=mr.filter(ys=>!Vr.has(ys));if(as.length===0)return;const ns=as.map(ys=>sr.get(ys)||ys);gi.future_listed_tokens?nr(ys=>Array.from(new Set([...ys||[],...ns]))):Qt(ys=>Array.from(new Set([...ys||[],...ns])))},[e,Xt,Cn,gi]),m.useEffect(()=>{e||(t(!1),tn(null),un(null),Pt(null),Vt(null),Ve(null),ft(null),Dt(null),Je(null),Rt(100),he("method_two"),rt(null),ie("All"),lt(!0),Nt(!0),xn(!1),Mn(!0),kn(!0),Qn(null),$n(null),Nn(null),Oe(null),fn({inputValue:null,selectValue:"%"}),Kn({inputValue:null,selectValue:"%"}),nr(null),Qt(null),ce(!1),Ne(!1),Be(!1),tt(!1),dt(!1),Ut(!1),je(!1),Re(!1),de(!1),Jt(!1),Me(!1),Ce(!1),Kt(!1),yn(!1),er(!1),vr(!1),G([]),o(null),us(null))},[e]),m.useEffect(()=>{const Tt=oe.find(sr=>(sr==null?void 0:sr.wallet_id)===(n==null?void 0:n.wallet_id));Tt&&Qn(Tt==null?void 0:Tt.wallet_id)},[oe,n]),m.useEffect(()=>{Fe==="lighter"?(He!==""&&Number(He)>100?Re(!0):Re(!1),yn(!St)):(Re(!1),yn(!1))},[He,Fe]);const Pr=Tt=>{Qn(Tt??null),ce(!1),Me(!1)},En=Tt=>{rt(Tt),Ce(!1),kn(!1),Tt==="lighter"&&(re=="method_twothousand"||re=="method_one")&&he("method_two"),Qn(null)},Rn=()=>{Ss(Fe)};m.useEffect(()=>{const Tt=sr=>{Ye.current&&!Ye.current.contains(sr.target)&&Me(!1),De.current&&!De.current.contains(sr.target)&&Ce(!1)};return document.addEventListener("mousedown",Tt),()=>{document.removeEventListener("mousedown",Tt)}},[]);const Dn=[Ae,ye,Qe,it,at,ct,be,gn,lr].filter(Boolean).length;m.useEffect(()=>{e&&a&&!q&&(u!=null&&u.some(Tt=>(Tt==null?void 0:Tt.wallet_address)===r)||B(!0),te(!0)),e||te(!1)},[e,a]),m.useEffect(()=>{e&&a&&!nt&&Fe!==null&&!T&&(u!=null&&u.some(Tt=>(Tt==null?void 0:Tt.wallet_address)===r)||Fe==="lighter"&&_e(!0),ot(!0)),e||ot(!1)},[e,a,Fe,T]);const Nr=()=>{_e(!1),B(!1),t(!1)},Mr=[{id:1,label:"Hyperliquid",value:"hyper"},{id:2,label:"Lighter",value:"lighter"}];return i.jsxs(i.Fragment,{children:[i.jsx(MLt,{open:zn,setOpen:Yn,copyTradeSave:Qr}),i.jsx(zBt,{open:T,setOpen:B,setCopyTradeModal:t,onClose:Nr,setIsUnderstand:de}),i.jsx(FA,{open:xe,setOpen:we,handleListRequest:Ss,handlePageChange:()=>{}}),i.jsx(HBt,{open:Le,setOpen:_e,setCopyTradeModal:t,onClose:Nr,setIsLighterUnderstand:Jt}),nn&&Ia.createPortal(i.jsx(Ale,{open:nn,setOpen:Vn,oldSlotCount:ur,checkAccountTrade:rs,tradeMarket:"copyTrade"}),document.body),i.jsxs(ga,{open:e,onClose:Nr,className:"relative z-50",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative transform overflow-hidden bg-[#1B1B1B] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl w-full lg:w-[70%]",children:i.jsx("div",{className:`${a&&!ue&&T&&!(u!=null&&u.some(Tt=>(Tt==null?void 0:Tt.wallet_address)===r))?"blur-3xl":""} flex flex-col justify-start items-center gap-8 w-full h-max relative bg-[#1B1B1B] rounded-3xl py-2 text-white font-manrope px-2`,children:i.jsx(i.Fragment,{children:V?i.jsx("div",{role:"status",className:"flex justify-center items-center w-full my-[30px]",children:i.jsx(Ma,{})}):g||d>0||f>0?(oe==null?void 0:oe.length)>0||(Ge==null?void 0:Ge.length)>0||(We==null?void 0:We.length)>0?i.jsxs("div",{className:"flex flex-col lg:flex-row w-full",children:[i.jsxs("div",{className:"w-full lg:w-2/5 min-h-full bg-[#242424] rounded-2xl",children:[i.jsx("div",{className:"absolute right-5 top-5 z-50 bg-black/70 backdrop-blur-md rounded-full w-6 h-6 flex lg:hidden justify-center items-center font-bold font-manrope text-xs",onClick:()=>t(!1),children:i.jsx(DIe,{})}),i.jsx("div",{style:{backgroundImage:`url(${Zbt})`,backgroundSize:"cover",backgroundPosition:"center"},className:"h-24 p-4 rounded-t-xl relative",children:i.jsx("div",{className:"absolute top-16 w-[64px] h-[64px] rounded-full bg-[#53BAA1] border-4 border-[#242424] flex items-center justify-center",children:i.jsx(eDe,{wallet:r,className:"w-full h-full rounded-full object-cover"})})}),i.jsxs("div",{className:"p-4 mt-6 ml-1",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("a",{className:"text-white font-manrope text-[16px] font-semibold leading-[13px] tracking-[0.32px] cursor-pointer hover:text-white",href:`/wallet-details/${r}`,target:"_blank",rel:"noreferrer",children:r?r.slice(0,6)+"..."+r.slice(-4):"-"}),i.jsx("span",{children:i.jsx("img",{onClick:Tt=>{Tt.stopPropagation(),navigator.clipboard.writeText(r),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:bo,alt:"",className:"cursor-pointer"})}),i.jsx("span",{className:"ml-auto cursor-pointer",children:i.jsx(x5,{walletAddress:r,children:i.jsx("div",{className:"w-[18px] h-[18px] justify-center items-center flex cursor-pointer",children:x.some(Tt=>Tt.wallet_address===r)?i.jsx("img",{src:r5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:SA,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})})})]}),i.jsxs("div",{className:"w-full mt-0.5",children:[i.jsxs("div",{className:"w-full border-b border-[#353535] flex relative",children:[i.jsxs("div",{className:"w-1/2 relative py-3 after:content-[''] after:absolute after:top-1/2 after:-translate-y-1/2 after:right-0 after:h-2/4 after:w-[1px] after:bg-[#353535]",children:[i.jsx("div",{className:"text-[#9B9B9B] font-manrope text-[10px] font-semibold leading-[13px] tracking-[0.8px] mb-[8px]",children:"PERP EQUITY"}),i.jsxs("div",{className:"text-[#67FFBD] font-manrope text-[16px] font-semibold leading-[13px] tracking-[0.32px]",children:["$",Lt?Er(Lt==null?void 0:Lt.marginSummary.accountValue):"-"]})]}),i.jsxs("div",{className:"w-1/2 flex flex-col justify-center items-end py-3",children:[i.jsx("div",{className:"text-[#9B9B9B] font-manrope text-[10px] font-semibold leading-[13px] tracking-[0.8px] mb-[8px]",children:"uPnL"}),i.jsxs("div",{className:`${Lt&&Ee&&Ee.reduce((Tt,sr)=>Tt+parseFloat(sr.unrealizedPnl),0)>=0?"text-[#67FFBD]":"text-[#FF7173]"} font-manrope text-[16px] font-semibold leading-[13px] tracking-[0.32px]`,children:["$",Lt&&Ee?Er(Math.abs(Ee.reduce((Tt,sr)=>Tt+parseFloat(sr.unrealizedPnl||0),0))):"-"]})]})]}),i.jsxs("div",{className:"w-full border-b border-[#353535] flex relative",children:[i.jsxs("div",{className:"w-1/2 relative py-3 after:content-[''] after:absolute after:top-1/2 after:-translate-y-1/2 after:right-0 after:h-2/4 after:w-[1px] after:bg-[#353535]",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"text-[#9B9B9B] font-manrope text-[10px] font-semibold leading-[13px] tracking-[0.8px] mb-[8px]",children:"WIN RATE"}),i.jsx("div",{className:"text-[#67FFBD] bg-[rgba(103,255,189,0.16)] h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer relative -top-1",children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"30D"})})]}),i.jsxs("div",{className:"text-white font-manrope text-[16px] font-semibold leading-[13px] tracking-[0.32px]",children:[_,"%"]})]}),i.jsxs("div",{className:"w-1/2 flex flex-col justify-center items-end py-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"text-[#9B9B9B] font-manrope text-[10px] font-semibold leading-[13px] tracking-[0.8px] mb-[8px]",children:"PnL"}),i.jsx("div",{className:"text-[#67FFBD] bg-[rgba(103,255,189,0.16)] h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer relative -top-1",children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"30D"})})]}),i.jsxs("div",{className:`${h&&h>=0?"text-[#67FFBD]":"text-[#FF7173]"} font-manrope text-[16px] font-semibold leading-[13px] tracking-[0.32px]`,children:["$",h?Er(Math.abs(h)):"-"]})]})]}),i.jsxs("div",{className:"mt-3",children:[i.jsx("div",{className:"text-[#9B9B9B] font-manrope text-[10px] font-semibold leading-[13px] tracking-[0.8px]",children:"OPEN POSITIONS"}),i.jsx(RLt,{positions:Ee})]}),i.jsx("div",{className:"w-full h-px bg-[#353535] mb-1"}),i.jsx("div",{className:"mt-2",children:i.jsx(WBt,{normalizedCopyTradeList:Zr,selectedWmIndex:Fs,setSelectedWmIndex:us,getSettingList:pe,setIsNewSetting:vr})})]})]})]}),i.jsxs("div",{className:"flex w-full lg:w-3/5 flex-col justify-start items-center gap-2 p-4 rounded-2xl bg-[#242424] ml-0 lg:ml-4 mt-4 lg:mt-0 relative",children:[i.jsx("div",{role:"status",className:`${J||X?"block":"hidden"} flex justify-center items-center w-full h-full absolute bg-[#101010]/80 z-50 -mt-[64px] rounded-3xl`,children:i.jsx(Ma,{})}),i.jsxs("div",{className:"flex-col justify-between items-center gap-4 w-full border-b border-[#353535] pb-3",children:[Dn>0&&i.jsxs("div",{className:"absolute right-4 flex sm:hidden rounded-[8px] bg-[rgba(255,121,124,0.16)] backdrop-blur-[16px] w-12 h-10 justify-center items-center text-[#FF797C] font-manrope text-[12px] font-semibold leading-[12px] tracking-[0.22px] gap-2",children:[i.jsx("img",{src:vc,alt:"Dextrabot"}),Dn]}),i.jsxs("div",{className:"flex flex-col items-baseline justify-start sm:flex-row sm:justify-between  sm:items-start lg:flex-col lg:items-baseline lg:justify-start xl:flex-row xl:items-start xl:justify-between gap-3 sm:gap-1 lg:gap-3 xl:gap-1 space-y-3",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start space-y-2",children:[i.jsxs("span",{className:"text-[#7C7C7C] font-manrope text-[13px] font-semibold leading-[8px] min-w-max max-h-[12px] flex items-center gap-1",children:[i.jsxs("div",{className:"flex items-center gap-1",children:["Select target platform",i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-3.5 min-w-3.5 min-h-3.5 h-3.5"}),i.jsx("span",{children:i.jsx(eo,{content:i.jsxs("div",{className:"text-[9px] flex flex-col gap-1 text-white",children:[i.jsx("span",{className:"uppercase",children:"Hyperliquid"}),i.jsxs("ul",{className:"list-disc pl-4",children:[i.jsx("li",{children:"Method II"}),i.jsx("li",{children:"Method III"})]}),i.jsx("span",{className:"text-[#fff] uppercase mt-2",children:"Lighter"}),i.jsx("ul",{className:"list-disc pl-4",children:i.jsx("li",{children:"Method III"})})]}),positionTop:!1,alignRight:!0,tooltipCss:"max-w-[100px] min-w-[100px] mt-10 leading-[16px]"})})]})]}),i.jsx(m0,{})]}),i.jsxs("div",{ref:De,className:"relative w-full max-w-[250px]",children:[i.jsxs("div",{className:`${Xt&&!xr?"cursor-not-allowed":"cursor-pointer"} rounded-md bg-[#353535] text-white px-2 h-8 flex items-center justify-between`,onClick:Tt=>{Tt.preventDefault(),(!Xt&&xr||Xt&&xr||!Xt&&!xr)&&Ce(!se)},children:[i.jsxs("span",{className:"text-white font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px] flex items-center gap-2",children:[Fe==="hyper"?i.jsx("img",{src:"https://app.hyperliquid.xyz/coins/HYPE.svg",className:"w-4 h-4"}):i.jsx(oy,{className:"w-4 h-4 text-white"}),Fe==="hyper"?"Hyperliquid":"Lighter"]}),i.jsx("svg",{className:`w-4 h-4 ml-2 transform transition ${se?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),se&&i.jsx("div",{className:"absolute z-10 mt-1 w-full bg-[#353535] rounded-md shadow-lg overflow-hidden p-1",children:i.jsx("div",{className:"flex flex-col gap-[2px] max-h-[170px] overflow-y-auto",children:Mr==null?void 0:Mr.map(Tt=>i.jsxs("div",{onClick:sr=>{sr.preventDefault(),(!Xt&&xr||Xt&&xr||!Xt&&!xr)&&(En(Tt.value),Tt.value==="lighter"&&!gt&&a&&_e(!0))},className:`py-2 px-2 h-8 min-h-8 flex justify-between items-center rounded-md font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px] ${Tt.value===Fe?"bg-[#2c2c2c]":"hover:bg-[#2c2c2c]"} text-white ${Xt&&!xr?"cursor-not-allowed":"cursor-pointer"}`,children:[i.jsxs("span",{className:"text-white flex items-center gap-2",children:[Tt.label==="Hyperliquid"?i.jsx("img",{src:"https://app.hyperliquid.xyz/coins/HYPE.svg",className:"w-4 h-4"}):i.jsx(oy,{className:"w-4 h-4 text-white"}),Tt.label]}),Tt.value===Fe&&i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-[#1de674]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})]},Tt.id))})})]})]}),i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{onClick:()=>{Rn()},className:"hidden sm:flex lg:hidden xl:flex justify-center items-center cursor-pointer",children:i.jsx(ybe,{className:"w-4 h-4 text-[#929292] hover:text-white"})}),i.jsxs("div",{className:"flex flex-col items-start justify-start space-y-2",children:[i.jsx("span",{className:"text-[#7C7C7C] font-manrope text-[13px] font-semibold leading-[8px] -mt-2",children:"Select your wallet"}),i.jsxs("div",{ref:Ye,className:"relative w-full min-w-[240px] max-w-[260px]",children:[i.jsxs("div",{className:"rounded-md bg-[#353535] text-white px-2 h-8 flex items-center justify-between cursor-pointer min-w-max sm:min-w-[260px]",onClick:()=>Me(!ke),children:[i.jsx("span",{className:"text-white font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px]",children:vn?((cr=oe==null?void 0:oe.find(Tt=>(Tt==null?void 0:Tt.wallet_id)===vn))==null?void 0:cr.wallet_name)==="Dextrabot"&&((bs=oe==null?void 0:oe.find(Tt=>(Tt==null?void 0:Tt.wallet_id)===vn))==null?void 0:bs.version)===3?((Kr=oe==null?void 0:oe.find(Tt=>(Tt==null?void 0:Tt.wallet_id)===vn))==null?void 0:Kr.wallet_name)+" (API-AGENT) Wallet":(Ms=oe==null?void 0:oe.find(Tt=>(Tt==null?void 0:Tt.wallet_id)===vn))==null?void 0:Ms.wallet_name:"Select"}),i.jsx("svg",{className:`w-4 h-4 ml-2 transform transition ${ke?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),ke&&i.jsxs("div",{className:"absolute z-10 mt-1 w-full bg-[#353535] rounded-md shadow-lg overflow-hidden px-2.5 py-1.5",children:[i.jsxs("div",{onClick:()=>{const Tt=Fe==="hyper"?"hyperliquid":"lighter";window.open(`/wallet-management#${Tt}#add-account#${Tt}`,"_blank"),Me(!1)},className:"px-3 py-2 text-[#1de674] font-semibold text-sm cursor-pointer flex justify-start items-center gap-1.5 border border-[#8860ff] rounded-md my-1 bg-[#7445ff]",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Add Account"})]}),i.jsx("div",{className:"flex flex-col gap-[2px] max-h-[170px] overflow-y-auto",children:oe&&((ei=[...oe].sort((Tt,sr)=>{var as,ns;const mr=(as=Tt==null?void 0:Tt.wallet_name)==null?void 0:as.includes("Dextrabot"),Vr=(ns=sr==null?void 0:sr.wallet_name)==null?void 0:ns.includes("Dextrabot");return mr&&!Vr?-1:!mr&&Vr?1:0}))==null?void 0:ei.map((Tt,sr)=>i.jsxs("div",{onClick:mr=>{mr.preventDefault(),(!Xt&&xr||Xt&&xr||!Xt&&!xr)&&Pr(Tt==null?void 0:Tt.wallet_id)},className:`py-2 px-2 h-8 min-h-8 flex justify-between items-center rounded-md  font-inter text-[14px] font-medium leading-[8px] tracking-[-0.28px] ${Xt&&!xr?"cursor-not-allowed":"cursor-pointer"} ${(Tt==null?void 0:Tt.wallet_id)===vn?"bg-[#2c2c2c]":"hover:bg-[#2c2c2c]"} text-white`,children:[i.jsx("span",{className:"text-white",children:(Tt==null?void 0:Tt.wallet_name)==="Dextrabot"&&(Tt==null?void 0:Tt.version)===3?(Tt==null?void 0:Tt.wallet_name)+" (API-AGENT) Wallet":Tt==null?void 0:Tt.wallet_name}),(Tt==null?void 0:Tt.wallet_id)===vn&&i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-[#1de674]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})]},(Tt==null?void 0:Tt.wallet_id)??sr)))})]}),Ae&&i.jsx("div",{className:"absolute top-8 left-0 px-3 py-1 bg-[#3b2626] rounded-md h-7",children:i.jsx("div",{className:"text-[#ff787b] text-xs font-semibold font-manrope",children:"You need to choose a wallet"})})]})]}),i.jsx("div",{onClick:()=>{Rn()},className:"flex sm:hidden lg:flex xl:hidden justify-center items-center cursor-pointer",children:i.jsx(ybe,{className:"w-4 h-4 text-[#929292] hover:text-white"})})]})]})]}),i.jsxs("div",{className:"flex flex-row items-center justify-between rounded-md w-full",children:[i.jsxs("div",{className:"flex flex-col items-start justify-between rounded-md",children:[i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx("div",{className:"w-8 lg:w-12 h-8 lg:h-12 flex items-center justify-center rounded-full bg-[rgba(255,217,121,0.16)]",children:i.jsx("span",{className:"text-[#F2C94C] text-xl",children:i.jsx("img",{src:Jbt,alt:"Dextrabot",className:"w-[18px] h-[18px]"})})}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("span",{className:"text-white font-manrope text-[14px] font-semibold leading-[8px]",children:"Trade Settings"}),i.jsx("div",{className:"text-[#979797] font-manrope text-[12px] font-normal leading-[8px] tracking-[0.24px]",children:"Make your settings for this Trader"})]})]}),i.jsx("div",{className:`${gn||Fe==="hyper"?"hidden":""} flex justify-center items-center space-x-4 mt-1 ml-10 lg:ml-[60px]`,children:i.jsxs("a",{href:"https://docs.dextrabot.com/copy-trade/methodology",target:"_blank",rel:"noopener noreferrer",className:"flex items-center bg-[#4A4A4A] rounded-lg text-[#CECECE] font-manrope text-[11px] font-semibold leading-[8px] px-3 py-2 hover:text-white",children:[i.jsx("img",{src:Vme,alt:"Dextrabot",className:"w-4 h-4 mr-2"}),"Methodology"]})})]}),gn||Fe==="hyper"?i.jsx("div",{className:"flex justify-center items-center space-x-4 mt-2 ml-10 lg:ml-[60px]",children:i.jsxs("a",{href:"https://docs.dextrabot.com/copy-trade/methodology",target:"_blank",rel:"noopener noreferrer",className:"flex items-center bg-[#4A4A4A] rounded-lg text-[#CECECE] font-manrope text-[11px] font-semibold leading-[8px] px-3 py-2 hover:text-white",children:[i.jsx("img",{src:Vme,alt:"Dextrabot",className:"w-4 h-4 mr-2"}),"Methodology"]})}):Fe==="lighter"&&i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-[13px] text-[#7C7C7C] font-semibold w-full",children:[i.jsx("span",{className:"pl-[2px]",children:"Slot"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(iA,{className:"w-3 h-3 text-[#67FFBD] fill-[#67FFBD]"}),i.jsxs("span",{className:"text-[#67FFBD] font-medium",children:[Ot||0,"/",Gn+Ot||0]})]})]}),i.jsx("div",{onClick:()=>{$t(pt),Vn(!0)},className:"flex items-center justify-center h-8 px-2 sm:px-6 rounded-[10px] text-[11px] sm:text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer min-w-max font-semibold",children:"Get more slots"})]})]}),i.jsx("div",{className:`${gn?"mt-2":""} flex flex-col justify-start items-start w-full`,children:i.jsxs("div",{className:"flex justify-stretch w-full gap-[5px] xl:gap-[14px] pt-[2px] border-b border-[#353535]",children:[i.jsxs("div",{onClick:()=>{(re!=="method_two"&&re!=="method_twothousand"&&Fe==="hyper"||(re=="method_two"||re=="method_twothousand")&&(!Xt||Xt&&xr)&&Fe==="hyper")&&he("method_one")},className:`relative ${re==="method_one"?"bg-[rgba(103,255,189,0.16)] text-[#67FFBD]":"text-[#7C7C7C]"} flex-1 h-[37px] px-2 py-1.5 justify-center items-center gap-2 inline-flex text-[14px] font-medium leading-[8px] tracking-[-0.28px]  rounded-tl-lg rounded-tr-lg ${(re==="method_two"||re==="method_twothousand")&&Xt&&!xr||Fe!=="hyper"?"cursor-not-allowed":"cursor-pointer"} min-w-max`,children:[i.jsxs("span",{className:"relative",children:["Method I"," ",i.jsx("div",{className:"text-[#ff787b] bg-[#ff797c]/20 text-[9px] font-semibold font-manrope leading-[8px] rounded-md p-1 absolute -top-4 left-[45px] lg:hidden animate-bounce",children:"LEGACY"})]}),i.jsx("div",{className:"text-[#ff787b] bg-[#ff797c]/20 text-[11px] font-semibold font-manrope leading-[8px] rounded-md p-2 hidden lg:flex",children:"LEGACY"}),re==="method_one"&&i.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[1px] bg-[#67FFBD]"})]}),i.jsxs("div",{onClick:()=>{(re!=="method_one"&&re!=="method_two"&&Fe==="hyper"||(re=="method_one"||re=="method_two")&&(!Xt||Xt&&xr)&&Fe==="hyper")&&he("method_twothousand")},className:`relative ${re==="method_twothousand"?"bg-[rgba(103,255,189,0.16)] text-[#67FFBD]":"text-[#7C7C7C]"} flex-1 h-[37px] px-2 py-1.5 justify-center items-center gap-2 inline-flex text-[14px] font-medium leading-[8px] tracking-[-0.28px] ${(re==="method_one"||re==="method_two")&&Xt&&!xr||Fe!=="hyper"?"cursor-not-allowed":"cursor-pointer"} rounded-tl-lg rounded-tr-lg min-w-max`,children:["Method II",re==="method_twothousand"&&i.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[1px] bg-[#67FFBD]"})]}),i.jsxs("div",{onClick:()=>{(re!=="method_one"&&re!=="method_twothousand"||(re=="method_one"||re=="method_twothousand")&&(!Xt||Xt&&xr))&&he("method_two")},className:`relative ${re==="method_two"?"bg-[rgba(103,255,189,0.16)] text-[#67FFBD]":"text-[#7C7C7C]"} flex-1 h-[37px] px-2 py-1.5 justify-center items-center gap-x-2 inline-flex text-[14px] font-medium leading-[8px] tracking-[-0.28px] rounded-tl-lg rounded-tr-lg ${(re==="method_one"||re==="method_twothousand")&&Xt&&!xr?"cursor-not-allowed":"cursor-pointer"}`,children:[i.jsxs("div",{className:"flex justify-center flex-grow whitespace-nowrap text-center gap-2",children:["Method III"," ",i.jsx("span",{className:"hidden lg:block",children:"(Mirror)"})]}),i.jsx("div",{className:"bg-[rgba(103,255,189,0.16)] text-[#67FFBD] text-[11px] font-semibold font-manrope leading-[8px] rounded-md p-2 hidden lg:flex",children:"Preferred"}),re==="method_two"&&i.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[1px] bg-[#67FFBD]"})]})]})}),re==="method_one"&&i.jsxs("div",{className:"w-full space-y-4 mt-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] hidden lg:block",children:"Use % of Trader margin per position"}),i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] block lg:hidden",children:"Use % of Trader Margin"}),i.jsx("div",{className:"flex mt-2 relative",children:i.jsxs("div",{className:"relative w-full",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{value:kt||"",onChange:yt,type:"text",name:"marginUsedRate",onKeyDown:Lr,autoComplete:"off",min:"0",placeholder:"Used Rate",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
                                          leading-none rounded-md w-full h-8 pl-6 pr-2
                                          ${kt?"border border-[#C5C5C5]":""}
                                          outline-[#404040] placeholder:text-[#7F7F7F]`})]})})]}),i.jsxs("div",{className:"flex flex-col justify-start relative",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Initial Margin Cap"}),i.jsxs("div",{className:"flex mt-2 relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"$"}),i.jsx("input",{value:Ke||"",onChange:pr,type:"text",name:"marginUsedAmount",onKeyDown:Lr,autoComplete:"off",min:"0",placeholder:"Amount",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
                                          leading-none rounded-md w-full h-8 pl-6 pr-7
                                          ${ye?"border border-[#FF797C]":Ke?"border border-[#C5C5C5]":""}
                                          outline-[#404040] placeholder:text-[#7F7F7F]`})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Margin Increase Limit"}),i.jsxs("div",{className:"flex mt-2 relative w-full",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"$"}),i.jsx("input",{value:en||"",onChange:es,type:"text",name:"marginIncreaseLimit",onKeyDown:Lr,autoComplete:"off",min:"0",placeholder:"Increase Limit",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
                                          leading-none rounded-md w-full h-8 pl-6 pr-7
                                          ${en?"border border-[#C5C5C5]":""}
                                          outline-[#404040] placeholder:text-[#7F7F7F]`})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] hidden lg:block",children:"Copy Increase as Open Position"}),i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] block lg:hidden",children:"Copy Inc. as Open Pos."}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:xt?"On":"Off"}),i.jsx(Oo,{checked:xt,onChange:Nt,className:`${xt?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
                                        transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
                                          rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
                                          group-data-[checked]:translate-x-3`})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start my-1 sm:my-1.5",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Stop Loss"}),i.jsxs("div",{className:"flex mt-2 relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{type:"text",value:sn.inputValue||"",onChange:st,onKeyDown:Lr,autoComplete:"off",min:"0",placeholder:"Stop Loss",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
                                          leading-none rounded-md w-full h-8 pl-6 pr-14
                                          ${sn.inputValue?"border border-[#C5C5C5]":""}
                                          outline-[#404040] placeholder:text-[#7F7F7F]`})]})]}),i.jsxs("div",{className:"flex flex-col justify-start my-1 sm:my-1.5",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Take Profit"}),i.jsxs("div",{className:"flex mt-2 relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{type:"text",value:Et.inputValue||"",onChange:Ft,onKeyDown:Lr,autoComplete:"off",min:"0",placeholder:"Take Profit",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
                                          leading-none rounded-md w-full h-8 pl-6 pr-14
                                          ${Et.inputValue?"border border-[#C5C5C5]":""}
                                          outline-[#404040] placeholder:text-[#7F7F7F]`})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Include TWAP Orders"}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:It?"On":"Off"}),i.jsx(Oo,{checked:It,onChange:xn,className:`${It?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
                                        transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
                                          rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
                                          group-data-[checked]:translate-x-3`})})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Direction Filter"}),i.jsxs("div",{className:"hidden items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(eo,{content:"When enabled, automatically copy trades for new tokens when they get listed on the exchange.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[120px] min-w-[120px] leading-[16px] mt-8"})})]})]}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(zx,{title:"All",set_click:()=>ie("All"),isPositionType:Y}),i.jsx(zx,{title:"LONG",set_click:()=>ie("LONG"),isPositionType:Y}),i.jsx(zx,{title:"SHORT",set_click:()=>ie("SHORT"),isPositionType:Y})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Copy Current"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(eo,{content:Xt?"This option can only be set when starting copy trading. It cannot be changed later.":"If enabled, your wallet will immediately copy all currently open positions from the Source Wallet.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[300px] min-w-[120px] mt-8 leading-[16px]"})})]})]}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:_n?"On":"Off"}),i.jsx(Oo,{checked:_n,onChange:Tt=>{(!Xt||Xt&&xr)&&qe&&kn(Tt)},className:`${_n?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9
                                          ${Xt&&!xr||!qe?"cursor-not-allowed opacity-50":"cursor-pointer"}
                                          rounded-full p-1 transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
                                            rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
                                            ${_n?"translate-x-3":""}`})})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Future Listed Tokens"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(eo,{content:"When enabled, automatically copy trades for new tokens when they get listed on the exchange.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[120px] min-w-[120px] leading-[16px] mt-8"})})]})]}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:dn?"On":"Off"}),i.jsx(Oo,{checked:dn,onChange:Mn,className:`${dn?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
                                        transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
                                          rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
                                          group-data-[checked]:translate-x-3`})})]})]})]}),i.jsx("div",{className:"grid grid-cols-1 gap-4",children:i.jsx("div",{className:"flex flex-col items-start justify-start",children:i.jsx("div",{className:"flex relative w-full",children:i.jsx(MW,{dataCoin:Cn,coinInclude:qn,coinExclude:tr,setCoinInclude:nr,setCoinExclude:Qt,isLoadingCoin:an})})})}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"relative flex flex-col justify-start",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Tag"}),i.jsx("div",{className:"flex mt-2 relative",children:i.jsx("input",{type:"text",value:Jn||"",onChange:wr,placeholder:"Tag",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
                                          leading-none rounded-md w-full h-8 pl-2 pr-7
                                          ${be?"border border-[#FF797C]":""}
                                          outline-[#404040] placeholder:text-[#7F7F7F]`})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Run"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(eo,{content:"When ON, copy trading will start immediately after saving. When OFF, settings will be saved but trading remains paused.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[180px] min-w-[180px] leading-[16px] mt-6"})})]})]}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:qe?"On":"Off"}),i.jsx(Oo,{checked:qe,onChange:Tt=>{lt(Tt),Tt||kn(!1)},className:`${qe?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
                                        transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px]
                                          translate-x-0 rounded-full bg-white ring-0 shadow-lg
                                          transition duration-200 ease-in-out group-data-[checked]:translate-x-3`})})]})]})]})]}),re==="method_twothousand"&&i.jsxs("div",{className:"w-full space-y-4 mt-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start",children:[i.jsxs("div",{className:`${ct?"-mt-1":""} flex items-center gap-2`,children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Max. Margin per Positions (Optional)"}),i.jsxs("div",{className:`${ct?"flex":"hidden"} items-center has-tooltip relative`,children:[i.jsx("img",{src:vc,alt:"Dextrabot",className:"w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(eo,{content:"Must be greater than or equal to Min Margin per Order, greater than or equal to Max Margin per Order, and greater than or equal to Initial Margin Cap.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[300px] min-w-[120px] mt-8 leading-[16px]"})})]})]}),i.jsxs("div",{className:`${ct?"mt-1":"mt-2"} flex w-full relative`,children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"$"}),i.jsx("input",{value:Xe||"",onChange:_r,type:"text",name:"maxUsdPerpPositions",onKeyDown:Lr,autoComplete:"off",min:"0",placeholder:"Amount",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
                                          leading-none rounded-md w-full h-8 pl-6 pr-2
                                          ${ct?"border border-[#FF797C] focus:outline-none focus:ring-0":Xe?"border border-[#C5C5C5] focus:outline-none focus:ring-0":"outline-[#404040]"}
                                           placeholder:text-[#7F7F7F]`})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-1",children:[i.jsxs("div",{className:`${at?"-mt-1":""} flex items-center gap-2`,children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Initial Margin Cap (Optional)"}),i.jsxs("div",{className:`${at?"flex":"hidden"} items-center has-tooltip relative`,children:[i.jsx("img",{src:vc,alt:"Dextrabot",className:"w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(eo,{content:"Must be less than or equal to Max Margin per Position.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[300px] min-w-[120px] mt-8 leading-[16px]"})})]})]}),i.jsxs("div",{className:`${at?"":"mt-1"} flex w-full relative`,children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"$"}),i.jsx("input",{value:Yt||"",onChange:or,type:"text",name:"initialOrderMaxUsd",onKeyDown:Lr,autoComplete:"off",min:"0",placeholder:"Amount",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope leading-none rounded-md w-full h-8 pl-6 pr-7
                                        
                                        ${at?"border border-[#FF797C] focus:outline-none focus:ring-0":Yt?"border border-[#C5C5C5] focus:outline-none focus:ring-0":"outline-[#404040]"}  placeholder:text-[#7F7F7F]`})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start",children:[i.jsxs("div",{className:`${it?"-mt-1":""} flex items-center gap-2`,children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Min. Margin per Order (Optional)"}),i.jsxs("div",{className:`${it?"flex":"hidden"} items-center has-tooltip relative`,children:[i.jsx("img",{src:vc,alt:"Dextrabot",className:"w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(eo,{content:"Must be less than or equal to Max Margin per Order and less than or equal to Max Margin per Position.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[300px] min-w-[120px] mt-8 leading-[16px]"})})]})]}),i.jsxs("div",{className:`${it?"mt-1":"mt-2"} flex w-full relative`,children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"$"}),i.jsx("input",{value:jt||"",onChange:pn,type:"text",name:"minUsdPerOrder",onKeyDown:Lr,autoComplete:"off",min:"0",placeholder:"Amount",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
                                          leading-none rounded-md w-full h-8 pl-6 pr-2
                                          
                                          ${it?"border border-[#FF797C] focus:outline-none focus:ring-0":jt?"border border-[#C5C5C5] focus:outline-none focus:ring-0":"outline-[#404040]"}
                                           placeholder:text-[#7F7F7F]`})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-1",children:[i.jsxs("div",{className:`${Qe&&(Xe||jt)?"-mt-1":""} flex items-center gap-2`,children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Max. Margin per Order"}),i.jsxs("div",{className:`${Qe&&(Xe||jt)?"flex":"hidden"} items-center has-tooltip relative`,children:[i.jsx("img",{src:vc,alt:"Dextrabot",className:"w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(eo,{content:"Must be greater than or equal to Min Margin per Order and less than or equal to Max Margin per Position.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[300px] min-w-[120px] mt-8 leading-[16px]"})})]})]}),i.jsxs("div",{className:`${Qe&&(Xe||jt)?"":"mt-1"} flex w-full relative`,children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"$"}),i.jsx("input",{value:cn||"",onChange:An,type:"text",name:"maxUsdPerOrder",onKeyDown:Lr,autoComplete:"off",min:"0",placeholder:"Amount",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
                                          leading-none rounded-md w-full h-8 pl-6 pr-2
                                          ${Qe?"border border-[#FF797C] focus:outline-none focus:ring-0":cn?"border border-[#C5C5C5] focus:outline-none focus:ring-0":"outline-[#404040]"}
                                            placeholder:text-[#7F7F7F]`})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Copy Current"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(eo,{content:Xt?"This option can only be set when starting copy trading. It cannot be changed later.":"If enabled, your wallet will immediately copy all currently open positions from the Source Wallet.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[300px] min-w-[120px] mt-8 leading-[16px]"})})]})]}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:_n?"On":"Off"}),i.jsx(Oo,{checked:_n,onChange:Tt=>{(!Xt||Xt&&xr)&&qe&&kn(Tt)},className:`${_n?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9
                                          ${Xt&&!xr||!qe?"cursor-not-allowed opacity-50":"cursor-pointer"}
                                          rounded-full p-1 transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
                                            rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
                                            ${_n?"translate-x-3":""}`})})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] hidden lg:block",children:"Copy Increase as Open Position"}),i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] block lg:hidden",children:"Copy Inc. as Open Pos."}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:xt?"On":"Off"}),i.jsx(Oo,{checked:xt,onChange:Nt,className:`${xt?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
                                        transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
                                          rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
                                          group-data-[checked]:translate-x-3`})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex items-center justify-start gap-1",children:[i.jsxs("div",{className:"flex flex-col justify-start my-1 sm:my-1.5",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Stop Loss"}),i.jsxs("div",{className:"flex mt-2 relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{type:"text",value:sn.inputValue||"",onChange:st,onKeyDown:Lr,autoComplete:"off",min:"0",placeholder:"Stop Loss",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
                                            leading-none rounded-md w-full h-8 pl-6 pr-2
                                            ${sn.inputValue?"border border-[#C5C5C5]":""}
                                            outline-[#404040] placeholder:text-[#7F7F7F]`})]})]}),i.jsxs("div",{className:"flex flex-col justify-start my-1 sm:my-1.5",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Take Profit"}),i.jsxs("div",{className:"flex mt-2 relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{type:"text",value:Et.inputValue||"",onChange:Ft,onKeyDown:Lr,autoComplete:"off",min:"0",placeholder:"Take Profit",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
                                            leading-none rounded-md w-full h-8 pl-6 pr-2
                                            ${Et.inputValue?"border border-[#C5C5C5]":""}
                                            outline-[#404040] placeholder:text-[#7F7F7F]`})]})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-2 mt-[6px]",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Direction Filter"}),i.jsxs("div",{className:"hidden items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(eo,{content:"When enabled, automatically copy trades for new tokens when they get listed on the exchange.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[120px] min-w-[120px] leading-[16px] mt-8"})})]})]}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(zx,{title:"All",set_click:()=>ie("All"),isPositionType:Y}),i.jsx(zx,{title:"LONG",set_click:()=>ie("LONG"),isPositionType:Y}),i.jsx(zx,{title:"SHORT",set_click:()=>ie("SHORT"),isPositionType:Y})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Include TWAP Orders"}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:It?"On":"Off"}),i.jsx(Oo,{checked:It,onChange:xn,className:`${It?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
                                        transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
                                          rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
                                          group-data-[checked]:translate-x-3`})})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Future Listed Tokens"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(eo,{content:"When enabled, automatically copy trades for new tokens when they get listed on the exchange.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[120px] min-w-[120px] leading-[16px] mt-8"})})]})]}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:dn?"On":"Off"}),i.jsx(Oo,{checked:dn,onChange:Mn,className:`${dn?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
                                        transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
                                          rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
                                          group-data-[checked]:translate-x-3`})})]})]})]}),i.jsx("div",{className:"grid grid-cols-1 gap-4",children:i.jsx("div",{className:"flex flex-col items-start justify-start",children:i.jsx("div",{className:"flex relative w-full",children:i.jsx(MW,{dataCoin:Cn,coinInclude:qn,coinExclude:tr,setCoinInclude:nr,setCoinExclude:Qt,isLoadingCoin:an})})})}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"relative flex flex-col justify-start",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Tag"}),i.jsx("div",{className:"flex mt-2 relative",children:i.jsx("input",{type:"text",value:Jn||"",onChange:wr,placeholder:"Tag",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
                                          leading-none rounded-md w-full h-8 pl-2 pr-7
                                          ${be?"border border-[#FF797C]":""}
                                          outline-[#404040] placeholder:text-[#7F7F7F]`})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Run"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(eo,{content:"When ON, copy trading will start immediately after saving. When OFF, settings will be saved but trading remains paused.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[180px] min-w-[180px] leading-[16px] mt-6"})})]})]}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:qe?"On":"Off"}),i.jsx(Oo,{checked:qe,onChange:Tt=>{lt(Tt),Tt||kn(!1)},className:`${qe?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
                                        transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px]
                                          translate-x-0 rounded-full bg-white ring-0 shadow-lg
                                          transition duration-200 ease-in-out group-data-[checked]:translate-x-3`})})]})]})]})]}),re==="method_two"&&i.jsxs("div",{className:"w-full space-y-4 mt-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Scaling"}),i.jsxs("div",{className:"flex mt-2 w-full relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{value:He||"",onChange:ts,type:"text",name:"scalingPercentage",onKeyDown:Lr,autoComplete:"off",min:"0",placeholder:"Scaling",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
                                        leading-none rounded-md w-full h-8 pl-6 pr-7 ${He?Ie?"border border-[#D97706]":"border border-[#C5C5C5]":""}
                                        outline-[#404040] placeholder:text-[#7F7F7F]`}),Ie&&i.jsxs("span",{className:"absolute left-0 top-11 -translate-y-1/2 text-[#F59E0B] font-semibold text-[9px] leading-2 flex",children:[i.jsx(TM,{className:"w-4 h-4 text-[#F59E0B]"}),i.jsx("span",{className:"text-[9px] leading-[10px] ml-1",children:"If scaling produces sizes above your available margin, orders will fail."})]})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] hidden lg:block",children:"Copy Increase as Open Position"}),i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px] block lg:hidden",children:"Copy Inc. as Open Pos."}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:xt?"On":"Off"}),i.jsx(Oo,{checked:xt,onChange:Nt,className:`${xt?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
                                        transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
                                          rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
                                          group-data-[checked]:translate-x-3`})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start my-1 sm:my-1.5",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Stop Loss"}),i.jsxs("div",{className:"flex mt-2 relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{type:"text",value:sn.inputValue||"",onChange:st,onKeyDown:Lr,autoComplete:"off",min:"0",placeholder:"Stop Loss",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
                                          leading-none rounded-md w-full h-8 pl-6 pr-14
                                          ${sn.inputValue?"border border-[#C5C5C5]":""}
                                          outline-[#404040] placeholder:text-[#7F7F7F]`})]})]}),i.jsxs("div",{className:"flex flex-col justify-start my-1 sm:my-1.5",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Take Profit"}),i.jsxs("div",{className:"flex mt-2 relative",children:[i.jsx("span",{className:"absolute left-1 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold mr-2",children:"%"}),i.jsx("input",{type:"text",value:Et.inputValue||"",onChange:Ft,onKeyDown:Lr,autoComplete:"off",min:"0",placeholder:"Take Profit",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
                                          leading-none rounded-md w-full h-8 pl-6 pr-14
                                          ${Et.inputValue?"border border-[#C5C5C5]":""}
                                          outline-[#404040] placeholder:text-[#7F7F7F]`})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Include TWAP Orders"}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:It?"On":"Off"}),i.jsx(Oo,{checked:It,onChange:xn,className:`${It?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
                                        transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
                                          rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
                                          group-data-[checked]:translate-x-3`})})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Direction Filter"}),i.jsxs("div",{className:"hidden items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(eo,{content:"When enabled, automatically copy trades for new tokens when they get listed on the exchange.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[120px] min-w-[120px] leading-[16px] mt-8"})})]})]}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(zx,{title:"All",set_click:()=>ie("All"),isPositionType:Y}),i.jsx(zx,{title:"LONG",set_click:()=>ie("LONG"),isPositionType:Y}),i.jsx(zx,{title:"SHORT",set_click:()=>ie("SHORT"),isPositionType:Y})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Copy Current"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(eo,{content:Fe==="lighter"?"Coming Soon":Xt?"This option can only be set when starting copy trading. It cannot be changed later.":"If enabled, your wallet will immediately copy all currently open positions from the Source Wallet.",positionTop:!1,alignRight:!0,tooltipCss:`${Fe==="lighter"?"max-w-[120px]":"mt-8 max-w-[300px]"}  min-w-[120px] leading-[16px]`})})]})]}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:_n?"On":"Off"}),i.jsx(Oo,{checked:_n,onChange:Tt=>{(!Xt||Xt&&xr)&&qe&&Fe==="hyper"&&kn(Tt)},className:`${_n?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9
                                          ${Xt&&!xr||!qe||Fe==="lighter"?"cursor-not-allowed opacity-50":"cursor-pointer"}
                                          rounded-full p-1 transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
                                            rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
                                            ${_n?"translate-x-3":""}`})})]})]}),i.jsxs("div",{className:"flex flex-col justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Future Listed Tokens"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(eo,{content:"When enabled, automatically copy trades for new tokens when they get listed on the exchange.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[120px] min-w-[120px] leading-[16px] mt-8"})})]})]}),i.jsxs("span",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:dn?"On":"Off"}),i.jsx(Oo,{checked:dn,onChange:Mn,className:`${dn?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
                                        transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px] translate-x-0
                                          rounded-full bg-white ring-0 shadow-lg transition duration-200 ease-in-out
                                          group-data-[checked]:translate-x-3`})})]})]})]}),i.jsx("div",{className:"grid grid-cols-1 gap-4",children:i.jsx("div",{className:"flex flex-col items-start justify-start",children:i.jsx("div",{className:"flex relative w-full",children:i.jsx(MW,{dataCoin:Cn,coinInclude:qn,coinExclude:tr,setCoinInclude:nr,setCoinExclude:Qt,isLoadingCoin:an})})})}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"relative flex flex-col justify-start",children:[i.jsx("p",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Tag"}),i.jsx("div",{className:"flex mt-2 relative",children:i.jsx("input",{type:"text",value:Jn||"",onChange:wr,placeholder:"Tag",className:`shadow-sm py-0.5 bg-[#303030] block text-xs sm:text-sm font-semibold font-manrope
                                          leading-none rounded-md w-full h-8 pl-2 pr-7
                                          ${be?"border border-[#FF797C]":""}
                                          outline-[#404040] placeholder:text-[#7F7F7F]`})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 -mt-1",children:[i.jsx("span",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Run"}),i.jsxs("div",{className:"flex items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 relative"}),i.jsx("span",{children:i.jsx(eo,{content:"When ON, copy trading will start immediately after saving. When OFF, settings will be saved but trading remains paused.",positionTop:!1,alignRight:!0,tooltipCss:"max-w-[180px] min-w-[180px] leading-[16px] mt-6"})})]})]}),i.jsxs("div",{className:"flex justify-between w-full items-center gap-2 bg-[#353535] p-1 rounded-md px-2 h-8",children:[i.jsx("span",{className:"text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px]",children:qe?"On":"Off"}),i.jsx(Oo,{checked:qe,onChange:Tt=>{lt(Tt),Tt||kn(!1)},className:`${qe?"bg-[#1DE674]":"bg-white/10"} group relative flex h-5 w-9 cursor-pointer rounded-full p-1
                                        transition-colors duration-200 ease-in-out focus:outline-none`,children:i.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block size-4 -mt-[3px]
                                          translate-x-0 rounded-full bg-white ring-0 shadow-lg
                                          transition duration-200 ease-in-out group-data-[checked]:translate-x-3`})})]})]})]}),Fe==="lighter"?gn?i.jsx("div",{className:"text-[#FF797C] font-semibold text-[10px] leading-4 border border-[#ff797c]/30 rounded-md px-3 py-1",children:"Copy Trading on Lighter requires an active Dextrabot subscription. Get access to copy this trader and more."}):lr?i.jsx("div",{className:"text-[#FF797C] font-semibold text-[10px] leading-4 border border-[#ff797c]/30 rounded-md px-3 py-1",children:"Your current slot count is not sufficient for this action. To proceed, please purchase additional slots using the ‘Get more slots’ button."}):oi?i.jsx("div",{className:"text-[#FF797C] font-semibold text-[10px] leading-4 border border-[#ff797c]/30 rounded-md px-3 py-1",children:"This wallet already has an active Copy Trade. Please select a different wallet to create a new Copy Trade."}):i.jsx("div",{className:"text-[#F59E0B] font-semibold text-[10px] leading-4 border border-[#D97706] rounded-md px-3 py-1",children:"All positions opened via Lighter Copy Trade are executed in Cross Margin Mode."}):oi&&i.jsx("div",{className:"text-[#FF797C] font-semibold text-[10px] leading-4 border border-[#ff797c]/30 rounded-md px-3 py-1",children:"This wallet already has an active Copy Trade. Please select a different wallet to create a new Copy Trade."})]}),i.jsxs("div",{className:"flex items-center w-full mt-auto h-16 border-t border-t-[#353535] bg-[rgba(27,27,27,0.32)] backdrop-blur-[16px] p-2 rounded-b-2xl",children:[Dn>0&&!gn&&i.jsxs("div",{className:"hidden sm:flex rounded-[8px] bg-[rgba(255,121,124,0.16)] backdrop-blur-[16px] w-12 h-10 justify-center items-center text-[#FF797C] font-manrope text-[12px] font-semibold leading-[12px] tracking-[0.22px] gap-2",children:[i.jsx("img",{src:vc,alt:"Dextrabot"}),Dn]}),i.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[i.jsx("button",{onClick:()=>t(!1),className:"rounded-[12px] border bg-black/5 border-[#353535] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] hover:border-white px-[24px] py-[12px] font-inter font-[13px] mr-2 h-[32px] flex items-center justify-center text-medium  leading-[8px] tracking-[-0.26px]",children:"Cancel"}),i.jsx("button",{onClick:Tt=>{vn!=null&&!isNaN(vn)&&(re!=="method_one"||Ke!=null&&!isNaN(Ke)&&Ke)&&(re!=="method_twothousand"||cn!=null&&!isNaN(cn)&&cn&&(!(Xe!=null&&!isNaN(Xe)&&Xe)||Number(Xe)>=Number(cn)&&(!(jt!=null&&!isNaN(jt)&&jt)||Number(Xe)>=Number(jt))&&(!(Yt!=null&&!isNaN(Yt)&&Yt)||Number(Xe)>=Number(Yt)))&&(!(jt!=null&&!isNaN(jt)&&jt)||Number(cn)>=Number(jt)))&&Jn&&(Fe!=="lighter"||St)&&(Fe!=="lighter"||!lr)?!sn.inputValue||!Et.inputValue?Yn(!0):Qr():(ce(vn==null||isNaN(vn)),Ne(re==="method_one"&&(Ke==null||isNaN(Ke)||!Ke)),Be(re==="method_twothousand"&&(cn==null||isNaN(cn)||!cn||cn!=null&&!isNaN(cn)&&cn&&jt!=null&&!isNaN(jt)&&jt&&Number(jt)>Number(cn)||cn!=null&&!isNaN(cn)&&cn&&Xe!=null&&!isNaN(Xe)&&Xe&&Number(cn)>Number(Xe))),tt(re==="method_twothousand"&&(cn!=null&&!isNaN(cn)&&cn&&jt!=null&&!isNaN(jt)&&jt&&Number(jt)>Number(cn)||Xe!=null&&!isNaN(Xe)&&Xe&&jt!=null&&!isNaN(jt)&&jt&&Number(jt)>Number(Xe))),dt(re==="method_twothousand"&&Xe!=null&&!isNaN(Xe)&&Xe&&Yt!=null&&!isNaN(Yt)&&Yt&&Number(Yt)>Number(Xe)),Ut(re==="method_twothousand"&&Xe!=null&&!isNaN(Xe)&&Xe&&(cn!=null&&!isNaN(cn)&&cn&&Number(cn)>Number(Xe)||jt!=null&&!isNaN(jt)&&jt&&Number(jt)>Number(Xe)||Yt!=null&&!isNaN(Yt)&&Yt&&Number(Yt)>Number(Xe))),je(!Jn||Jn===""),Re(Fe==="lighter"&&He&&He>100),yn(Fe==="lighter"&&!St))},type:"button",className:`${re==="method_one"||Fe==="lighter"&&gn||Fe==="lighter"&&lr||oi?"hidden":""} rounded-[10px] border border-[#8861FF] bg-[#7446FF] hover:bg-[#5834C3] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] font-inter px-[24px] py-[12px] font-[13px] h-[32px] flex items-center justify-center text-medium mr-2 leading-[8px] tracking-[-0.26px]`,children:"Apply"}),Dn>0&&Fe==="lighter"&&gn&&i.jsx(VBt,{checkAccountCopy:rs,setIsLighterSub:Kt,setLighterSubError:yn,setSlotCount:Wt,setSlotSubsCount:vt,setSlotUsingCount:wn,setSlotTotalCount:fr,setSlotCountWallets:dr}),Dn>0&&!gn&&lr&&Fe==="lighter"&&i.jsx("div",{onClick:()=>{$t(pt),Vn(!0)},className:"flex items-center justify-center h-8 px-2 sm:px-6 rounded-[10px] text-[11px] sm:text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer min-w-max font-semibold",children:"Get more slots"}),i.jsx("button",{onClick:Tt=>{Tt.preventDefault(),u!=null&&u.some(sr=>sr.wallet_address===r)&&Ir()},type:"button",className:`rounded-[12px] border border-[#353535] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] hover:border-[#FF797C] font-inter px-[24px] py-[12px] font-[13px] h-[32px] text-medium  leading-[8px] tracking-[-0.26px] flex !text-[#FF797C] items-center justify-center bg-[rgba(27,27,27,0.32)]" ${u!=null&&u.some(Tt=>Tt.wallet_address===r)&&!xr?"":"hidden"}`,children:"Delete"})]})]})]})]}):i.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 my-16 px-4",children:[i.jsx("div",{className:"py-4",children:i.jsx("img",{src:Hi,alt:"",className:"w-[86px h-[86px]"})}),i.jsx("span",{className:"text-center mb-5 font-bold mt-3 text-[21px]",children:"Wallet Required!"}),i.jsx("span",{className:"text-center mb-5 font-medium px-10 -mt-6",children:"You need to create and fund at least one wallet before starting copy trading."}),i.jsx("div",{onClick:()=>{window.location.href="/wallet-management"},className:"w-[284px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer ",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Go to Wallet Management"})})]}):i.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 mt-16 mb-8 px-4 text-white",children:[i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Hi,alt:"",className:"w-[86px h-[86px]"})}),i.jsx("span",{className:"text-center mb-5 font-bold mt-10 text-[21px]",children:"Closed Beta Has Started! 🚀"}),i.jsx("span",{className:"text-center mb-5 font-medium px-10 -mt-6",children:"Follow our Discord to stay updated and be ready for the full launch!"}),i.jsx("span",{className:"text-center mb-5 font-medium px-10 -mt-6",children:"Early access requirements:"}),i.jsx("div",{onClick:()=>{window.open("https://www.tensor.trade/trade/mushboomers","_blank")},className:"w-[184px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Mushboomers Sol"})}),i.jsx("div",{onClick:()=>{window.open("https://blur.io/collection/mushboomers","_blank")},className:"w-[184px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Mushboomers Eth"})}),i.jsx("div",{onClick:()=>{window.open("https://discord.gg/dextrabot","_blank")},className:"w-[184px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Join Our Discord"})})]})})})})})})]})]})}const zx=({title:e,set_click:t,isPositionType:n})=>i.jsx("div",{onClick:t,className:`${n==e?n=="LONG"?"bg-[#67ffbd]/20 text-[#67FFBD]":n=="SHORT"?"bg-[#ff797c]/20 text-[#FF797C]":(n=="All","bg-[#3d3d3d] text-white"):"bg-transparent text-[#9b9b9b]"}  text-[13px] font-medium font-manrope leading-[8px] cursor-pointer flex justify-center items-center min-w-max rounded-md px-[6px] sm:px-[10px] h-[22px]`,children:e});function tDe(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=tDe(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ta(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=tDe(e))&&(r&&(r+=" "),r+=t);return r}var LW,aye;function rf(){if(aye)return LW;aye=1;var e=Array.isArray;return LW=e,LW}var DW,oye;function nDe(){if(oye)return DW;oye=1;var e=typeof ju=="object"&&ju&&ju.Object===Object&&ju;return DW=e,DW}var BW,lye;function lx(){if(lye)return BW;lye=1;var e=nDe(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return BW=n,BW}var $W,cye;function oT(){if(cye)return $W;cye=1;var e=lx(),t=e.Symbol;return $W=t,$W}var UW,uye;function qBt(){if(uye)return UW;uye=1;var e=oT(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,s=e?e.toStringTag:void 0;function a(o){var l=n.call(o,s),c=o[s];try{o[s]=void 0;var u=!0}catch{}var d=r.call(o);return u&&(l?o[s]=c:delete o[s]),d}return UW=a,UW}var zW,dye;function GBt(){if(dye)return zW;dye=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return zW=n,zW}var HW,fye;function S1(){if(fye)return HW;fye=1;var e=oT(),t=qBt(),n=GBt(),r="[object Null]",s="[object Undefined]",a=e?e.toStringTag:void 0;function o(l){return l==null?l===void 0?s:r:a&&a in Object(l)?t(l):n(l)}return HW=o,HW}var VW,hye;function N1(){if(hye)return VW;hye=1;function e(t){return t!=null&&typeof t=="object"}return VW=e,VW}var WW,pye;function qA(){if(pye)return WW;pye=1;var e=S1(),t=N1(),n="[object Symbol]";function r(s){return typeof s=="symbol"||t(s)&&e(s)==n}return WW=r,WW}var qW,mye;function jle(){if(mye)return qW;mye=1;var e=rf(),t=qA(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function s(a,o){if(e(a))return!1;var l=typeof a;return l=="number"||l=="symbol"||l=="boolean"||a==null||t(a)?!0:r.test(a)||!n.test(a)||o!=null&&a in Object(o)}return qW=s,qW}var GW,xye;function u2(){if(xye)return GW;xye=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return GW=e,GW}var KW,gye;function Ele(){if(gye)return KW;gye=1;var e=S1(),t=u2(),n="[object AsyncFunction]",r="[object Function]",s="[object GeneratorFunction]",a="[object Proxy]";function o(l){if(!t(l))return!1;var c=e(l);return c==r||c==s||c==n||c==a}return KW=o,KW}var YW,bye;function KBt(){if(bye)return YW;bye=1;var e=lx(),t=e["__core-js_shared__"];return YW=t,YW}var XW,yye;function YBt(){if(yye)return XW;yye=1;var e=KBt(),t=function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function n(r){return!!t&&t in r}return XW=n,XW}var QW,vye;function rDe(){if(vye)return QW;vye=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return QW=n,QW}var ZW,wye;function XBt(){if(wye)return ZW;wye=1;var e=Ele(),t=YBt(),n=u2(),r=rDe(),s=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,l=Object.prototype,c=o.toString,u=l.hasOwnProperty,d=RegExp("^"+c.call(u).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(x){if(!n(x)||t(x))return!1;var g=e(x)?d:a;return g.test(r(x))}return ZW=f,ZW}var JW,Cye;function QBt(){if(Cye)return JW;Cye=1;function e(t,n){return t==null?void 0:t[n]}return JW=e,JW}var eq,Sye;function b5(){if(Sye)return eq;Sye=1;var e=XBt(),t=QBt();function n(r,s){var a=t(r,s);return e(a)?a:void 0}return eq=n,eq}var tq,Nye;function T$(){if(Nye)return tq;Nye=1;var e=b5(),t=e(Object,"create");return tq=t,tq}var nq,Aye;function ZBt(){if(Aye)return nq;Aye=1;var e=T$();function t(){this.__data__=e?e(null):{},this.size=0}return nq=t,nq}var rq,jye;function JBt(){if(jye)return rq;jye=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return rq=e,rq}var sq,Eye;function e$t(){if(Eye)return sq;Eye=1;var e=T$(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function s(a){var o=this.__data__;if(e){var l=o[a];return l===t?void 0:l}return r.call(o,a)?o[a]:void 0}return sq=s,sq}var iq,_ye;function t$t(){if(_ye)return iq;_ye=1;var e=T$(),t=Object.prototype,n=t.hasOwnProperty;function r(s){var a=this.__data__;return e?a[s]!==void 0:n.call(a,s)}return iq=r,iq}var aq,kye;function n$t(){if(kye)return aq;kye=1;var e=T$(),t="__lodash_hash_undefined__";function n(r,s){var a=this.__data__;return this.size+=this.has(r)?0:1,a[r]=e&&s===void 0?t:s,this}return aq=n,aq}var oq,Tye;function r$t(){if(Tye)return oq;Tye=1;var e=ZBt(),t=JBt(),n=e$t(),r=t$t(),s=n$t();function a(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var u=o[l];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=s,oq=a,oq}var lq,Iye;function s$t(){if(Iye)return lq;Iye=1;function e(){this.__data__=[],this.size=0}return lq=e,lq}var cq,Pye;function _le(){if(Pye)return cq;Pye=1;function e(t,n){return t===n||t!==t&&n!==n}return cq=e,cq}var uq,Fye;function I$(){if(Fye)return uq;Fye=1;var e=_le();function t(n,r){for(var s=n.length;s--;)if(e(n[s][0],r))return s;return-1}return uq=t,uq}var dq,Oye;function i$t(){if(Oye)return dq;Oye=1;var e=I$(),t=Array.prototype,n=t.splice;function r(s){var a=this.__data__,o=e(a,s);if(o<0)return!1;var l=a.length-1;return o==l?a.pop():n.call(a,o,1),--this.size,!0}return dq=r,dq}var fq,Mye;function a$t(){if(Mye)return fq;Mye=1;var e=I$();function t(n){var r=this.__data__,s=e(r,n);return s<0?void 0:r[s][1]}return fq=t,fq}var hq,Rye;function o$t(){if(Rye)return hq;Rye=1;var e=I$();function t(n){return e(this.__data__,n)>-1}return hq=t,hq}var pq,Lye;function l$t(){if(Lye)return pq;Lye=1;var e=I$();function t(n,r){var s=this.__data__,a=e(s,n);return a<0?(++this.size,s.push([n,r])):s[a][1]=r,this}return pq=t,pq}var mq,Dye;function P$(){if(Dye)return mq;Dye=1;var e=s$t(),t=i$t(),n=a$t(),r=o$t(),s=l$t();function a(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var u=o[l];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=s,mq=a,mq}var xq,Bye;function kle(){if(Bye)return xq;Bye=1;var e=b5(),t=lx(),n=e(t,"Map");return xq=n,xq}var gq,$ye;function c$t(){if($ye)return gq;$ye=1;var e=r$t(),t=P$(),n=kle();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return gq=r,gq}var bq,Uye;function u$t(){if(Uye)return bq;Uye=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return bq=e,bq}var yq,zye;function F$(){if(zye)return yq;zye=1;var e=u$t();function t(n,r){var s=n.__data__;return e(r)?s[typeof r=="string"?"string":"hash"]:s.map}return yq=t,yq}var vq,Hye;function d$t(){if(Hye)return vq;Hye=1;var e=F$();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return vq=t,vq}var wq,Vye;function f$t(){if(Vye)return wq;Vye=1;var e=F$();function t(n){return e(this,n).get(n)}return wq=t,wq}var Cq,Wye;function h$t(){if(Wye)return Cq;Wye=1;var e=F$();function t(n){return e(this,n).has(n)}return Cq=t,Cq}var Sq,qye;function p$t(){if(qye)return Sq;qye=1;var e=F$();function t(n,r){var s=e(this,n),a=s.size;return s.set(n,r),this.size+=s.size==a?0:1,this}return Sq=t,Sq}var Nq,Gye;function Tle(){if(Gye)return Nq;Gye=1;var e=c$t(),t=d$t(),n=f$t(),r=h$t(),s=p$t();function a(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var u=o[l];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=s,Nq=a,Nq}var Aq,Kye;function sDe(){if(Kye)return Aq;Kye=1;var e=Tle(),t="Expected a function";function n(r,s){if(typeof r!="function"||s!=null&&typeof s!="function")throw new TypeError(t);var a=function(){var o=arguments,l=s?s.apply(this,o):o[0],c=a.cache;if(c.has(l))return c.get(l);var u=r.apply(this,o);return a.cache=c.set(l,u)||c,u};return a.cache=new(n.Cache||e),a}return n.Cache=e,Aq=n,Aq}var jq,Yye;function m$t(){if(Yye)return jq;Yye=1;var e=sDe(),t=500;function n(r){var s=e(r,function(o){return a.size===t&&a.clear(),o}),a=s.cache;return s}return jq=n,jq}var Eq,Xye;function x$t(){if(Xye)return Eq;Xye=1;var e=m$t(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(s){var a=[];return s.charCodeAt(0)===46&&a.push(""),s.replace(t,function(o,l,c,u){a.push(c?u.replace(n,"$1"):l||o)}),a});return Eq=r,Eq}var _q,Qye;function Ile(){if(Qye)return _q;Qye=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,a=Array(s);++r<s;)a[r]=n(t[r],r,t);return a}return _q=e,_q}var kq,Zye;function g$t(){if(Zye)return kq;Zye=1;var e=oT(),t=Ile(),n=rf(),r=qA(),s=e?e.prototype:void 0,a=s?s.toString:void 0;function o(l){if(typeof l=="string")return l;if(n(l))return t(l,o)+"";if(r(l))return a?a.call(l):"";var c=l+"";return c=="0"&&1/l==-1/0?"-0":c}return kq=o,kq}var Tq,Jye;function iDe(){if(Jye)return Tq;Jye=1;var e=g$t();function t(n){return n==null?"":e(n)}return Tq=t,Tq}var Iq,e2e;function aDe(){if(e2e)return Iq;e2e=1;var e=rf(),t=jle(),n=x$t(),r=iDe();function s(a,o){return e(a)?a:t(a,o)?[a]:n(r(a))}return Iq=s,Iq}var Pq,t2e;function O$(){if(t2e)return Pq;t2e=1;var e=qA();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Pq=t,Pq}var Fq,n2e;function Ple(){if(n2e)return Fq;n2e=1;var e=aDe(),t=O$();function n(r,s){s=e(s,r);for(var a=0,o=s.length;r!=null&&a<o;)r=r[t(s[a++])];return a&&a==o?r:void 0}return Fq=n,Fq}var Oq,r2e;function oDe(){if(r2e)return Oq;r2e=1;var e=Ple();function t(n,r,s){var a=n==null?void 0:e(n,r);return a===void 0?s:a}return Oq=t,Oq}var b$t=oDe();const Yh=ji(b$t);var Mq,s2e;function y$t(){if(s2e)return Mq;s2e=1;function e(t){return t==null}return Mq=e,Mq}var v$t=y$t();const xi=ji(v$t);var Rq,i2e;function w$t(){if(i2e)return Rq;i2e=1;var e=S1(),t=rf(),n=N1(),r="[object String]";function s(a){return typeof a=="string"||!t(a)&&n(a)&&e(a)==r}return Rq=s,Rq}var C$t=w$t();const H3=ji(C$t);var S$t=Ele();const wi=ji(S$t);var N$t=u2();const GA=ji(N$t);var Lq={exports:{}},ja={};/**
 * @license React
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var a2e;function A$t(){if(a2e)return ja;a2e=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),v;v=Symbol.for("react.module.reference");function w(C){if(typeof C=="object"&&C!==null){var N=C.$$typeof;switch(N){case e:switch(C=C.type,C){case n:case s:case r:case u:case d:return C;default:switch(C=C&&C.$$typeof,C){case l:case o:case c:case x:case f:case a:return C;default:return N}}case t:return N}}}return ja.ContextConsumer=o,ja.ContextProvider=a,ja.Element=e,ja.ForwardRef=c,ja.Fragment=n,ja.Lazy=x,ja.Memo=f,ja.Portal=t,ja.Profiler=s,ja.StrictMode=r,ja.Suspense=u,ja.SuspenseList=d,ja.isAsyncMode=function(){return!1},ja.isConcurrentMode=function(){return!1},ja.isContextConsumer=function(C){return w(C)===o},ja.isContextProvider=function(C){return w(C)===a},ja.isElement=function(C){return typeof C=="object"&&C!==null&&C.$$typeof===e},ja.isForwardRef=function(C){return w(C)===c},ja.isFragment=function(C){return w(C)===n},ja.isLazy=function(C){return w(C)===x},ja.isMemo=function(C){return w(C)===f},ja.isPortal=function(C){return w(C)===t},ja.isProfiler=function(C){return w(C)===s},ja.isStrictMode=function(C){return w(C)===r},ja.isSuspense=function(C){return w(C)===u},ja.isSuspenseList=function(C){return w(C)===d},ja.isValidElementType=function(C){return typeof C=="string"||typeof C=="function"||C===n||C===s||C===r||C===u||C===d||C===g||typeof C=="object"&&C!==null&&(C.$$typeof===x||C.$$typeof===f||C.$$typeof===a||C.$$typeof===o||C.$$typeof===c||C.$$typeof===v||C.getModuleId!==void 0)},ja.typeOf=w,ja}var o2e;function j$t(){return o2e||(o2e=1,Lq.exports=A$t()),Lq.exports}var E$t=j$t(),Dq,l2e;function lDe(){if(l2e)return Dq;l2e=1;var e=S1(),t=N1(),n="[object Number]";function r(s){return typeof s=="number"||t(s)&&e(s)==n}return Dq=r,Dq}var Bq,c2e;function _$t(){if(c2e)return Bq;c2e=1;var e=lDe();function t(n){return e(n)&&n!=+n}return Bq=t,Bq}var k$t=_$t();const KA=ji(k$t);var T$t=lDe();const I$t=ji(T$t);var em=function(t){return t===0?0:t>0?1:-1},ew=function(t){return H3(t)&&t.indexOf("%")===t.length-1},Xr=function(t){return I$t(t)&&!KA(t)},Xl=function(t){return Xr(t)||H3(t)},P$t=0,y5=function(t){var n=++P$t;return"".concat(t||"").concat(n)},V3=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Xr(t)&&!H3(t))return r;var a;if(ew(t)){var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return KA(a)&&(a=r),s&&a>n&&(a=n),a},Tb=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},F$t=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},s=0;s<n;s++)if(!r[t[s]])r[t[s]]=!0;else return!0;return!1},bl=function(t,n){return Xr(t)&&Xr(n)?function(r){return t+r*(n-t)}:function(){return n}};function HR(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):Yh(r,t))===n})}var O$t=function(t){if(!t||!t.length)return null;for(var n=t.length,r=0,s=0,a=0,o=0,l=1/0,c=-1/0,u=0,d=0,f=0;f<n;f++)u=t[f].cx||0,d=t[f].cy||0,r+=u,s+=d,a+=u*d,o+=u*u,l=Math.min(l,u),c=Math.max(c,u);var x=n*o!==r*r?(n*a-r*s)/(n*o-r*r):0;return{xmin:l,xmax:c,a:x,b:(s-x*r)/n}},M$t=function(t,n){return Xr(t)&&Xr(n)?t-n:H3(t)&&H3(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function d4(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function ste(e){"@babel/helpers - typeof";return ste=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ste(e)}var R$t=["viewBox","children"],L$t=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],u2e=["points","pathLength"],$q={svg:R$t,polygon:u2e,polyline:u2e},Fle=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],VR=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(m.isValidElement(t)&&(r=t.props),!GA(r))return null;var s={};return Object.keys(r).forEach(function(a){Fle.includes(a)&&(s[a]=n||function(o){return r[a](r,o)})}),s},D$t=function(t,n,r){return function(s){return t(n,r,s),null}},n_=function(t,n,r){if(!GA(t)||ste(t)!=="object")return null;var s=null;return Object.keys(t).forEach(function(a){var o=t[a];Fle.includes(a)&&typeof o=="function"&&(s||(s={}),s[a]=D$t(o,n,r))}),s},B$t=["children"],$$t=["children"];function d2e(e,t){if(e==null)return{};var n=U$t(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function U$t(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ite(e){"@babel/helpers - typeof";return ite=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ite(e)}var f2e={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Vg=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},h2e=null,Uq=null,Ole=function e(t){if(t===h2e&&Array.isArray(Uq))return Uq;var n=[];return m.Children.forEach(t,function(r){xi(r)||(E$t.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Uq=n,h2e=t,n};function Qd(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(s){return Vg(s)}):r=[Vg(t)],Ole(e).forEach(function(s){var a=Yh(s,"type.displayName")||Yh(s,"type.name");r.indexOf(a)!==-1&&n.push(s)}),n}function _f(e,t){var n=Qd(e,t);return n[0]}var p2e=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,s=n.height;return!(!Xr(r)||r<=0||!Xr(s)||s<=0)},z$t=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],H$t=function(t){return t&&t.type&&H3(t.type)&&z$t.indexOf(t.type)>=0},cDe=function(t){return t&&ite(t)==="object"&&"clipDot"in t},V$t=function(t,n,r,s){var a,o=(a=$q==null?void 0:$q[s])!==null&&a!==void 0?a:[];return n.startsWith("data-")||!wi(t)&&(s&&o.includes(n)||L$t.includes(n))||r&&Fle.includes(n)},mi=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var s=t;if(m.isValidElement(t)&&(s=t.props),!GA(s))return null;var a={};return Object.keys(s).forEach(function(o){var l;V$t((l=s)===null||l===void 0?void 0:l[o],o,n,r)&&(a[o]=s[o])}),a},ate=function e(t,n){if(t===n)return!0;var r=m.Children.count(t);if(r!==m.Children.count(n))return!1;if(r===0)return!0;if(r===1)return m2e(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var s=0;s<r;s++){var a=t[s],o=n[s];if(Array.isArray(a)||Array.isArray(o)){if(!e(a,o))return!1}else if(!m2e(a,o))return!1}return!0},m2e=function(t,n){if(xi(t)&&xi(n))return!0;if(!xi(t)&&!xi(n)){var r=t.props||{},s=r.children,a=d2e(r,B$t),o=n.props||{},l=o.children,c=d2e(o,$$t);return s&&l?d4(a,c)&&ate(s,l):!s&&!l?d4(a,c):!1}return!1},x2e=function(t,n){var r=[],s={};return Ole(t).forEach(function(a,o){if(H$t(a))r.push(a);else if(a){var l=Vg(a.type),c=n[l]||{},u=c.handler,d=c.once;if(u&&(!d||!s[l])){var f=u(a,l,o);r.push(f),s[l]=!0}}}),r},W$t=function(t){var n=t&&t.type;return n&&f2e[n]?f2e[n]:null},q$t=function(t,n){return Ole(n).indexOf(t)},G$t=["children","width","height","viewBox","className","style","title","desc"];function ote(){return ote=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ote.apply(this,arguments)}function K$t(e,t){if(e==null)return{};var n=Y$t(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Y$t(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function lte(e){var t=e.children,n=e.width,r=e.height,s=e.viewBox,a=e.className,o=e.style,l=e.title,c=e.desc,u=K$t(e,G$t),d=s||{width:n,height:r,x:0,y:0},f=ta("recharts-surface",a);return Se.createElement("svg",ote({},mi(u,!0,"svg"),{className:f,width:n,height:r,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),Se.createElement("title",null,l),Se.createElement("desc",null,c),t)}var X$t=["children","className"];function cte(){return cte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cte.apply(this,arguments)}function Q$t(e,t){if(e==null)return{};var n=Z$t(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Z$t(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var wa=Se.forwardRef(function(e,t){var n=e.children,r=e.className,s=Q$t(e,X$t),a=ta("recharts-layer",r);return Se.createElement("g",cte({className:a},mi(s,!0),{ref:t}),n)}),Wg=function(t,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),a=2;a<r;a++)s[a-2]=arguments[a]},zq,g2e;function J$t(){if(g2e)return zq;g2e=1;function e(t,n,r){var s=-1,a=t.length;n<0&&(n=-n>a?0:a+n),r=r>a?a:r,r<0&&(r+=a),a=n>r?0:r-n>>>0,n>>>=0;for(var o=Array(a);++s<a;)o[s]=t[s+n];return o}return zq=e,zq}var Hq,b2e;function eUt(){if(b2e)return Hq;b2e=1;var e=J$t();function t(n,r,s){var a=n.length;return s=s===void 0?a:s,!r&&s>=a?n:e(n,r,s)}return Hq=t,Hq}var Vq,y2e;function uDe(){if(y2e)return Vq;y2e=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,a="\\ufe0e\\ufe0f",o="\\u200d",l=RegExp("["+o+e+s+a+"]");function c(u){return l.test(u)}return Vq=c,Vq}var Wq,v2e;function tUt(){if(v2e)return Wq;v2e=1;function e(t){return t.split("")}return Wq=e,Wq}var qq,w2e;function nUt(){if(w2e)return qq;w2e=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",s=t+n+r,a="\\ufe0e\\ufe0f",o="["+e+"]",l="["+s+"]",c="\\ud83c[\\udffb-\\udfff]",u="(?:"+l+"|"+c+")",d="[^"+e+"]",f="(?:\\ud83c[\\udde6-\\uddff]){2}",x="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",v=u+"?",w="["+a+"]?",C="(?:"+g+"(?:"+[d,f,x].join("|")+")"+w+v+")*",N=w+v+C,I="(?:"+[d+l+"?",l,f,x,o].join("|")+")",P=RegExp(c+"(?="+c+")|"+I+N,"g");function R(F){return F.match(P)||[]}return qq=R,qq}var Gq,C2e;function rUt(){if(C2e)return Gq;C2e=1;var e=tUt(),t=uDe(),n=nUt();function r(s){return t(s)?n(s):e(s)}return Gq=r,Gq}var Kq,S2e;function sUt(){if(S2e)return Kq;S2e=1;var e=eUt(),t=uDe(),n=rUt(),r=iDe();function s(a){return function(o){o=r(o);var l=t(o)?n(o):void 0,c=l?l[0]:o.charAt(0),u=l?e(l,1).join(""):o.slice(1);return c[a]()+u}}return Kq=s,Kq}var Yq,N2e;function iUt(){if(N2e)return Yq;N2e=1;var e=sUt(),t=e("toUpperCase");return Yq=t,Yq}var aUt=iUt();const M$=ji(aUt);function no(e){return function(){return e}}const dDe=Math.cos,WR=Math.sin,ym=Math.sqrt,qR=Math.PI,R$=2*qR,ute=Math.PI,dte=2*ute,jv=1e-6,oUt=dte-jv;function fDe(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function lUt(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return fDe;const n=10**t;return function(r){this._+=r[0];for(let s=1,a=r.length;s<a;++s)this._+=Math.round(arguments[s]*n)/n+r[s]}}class cUt{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?fDe:lUt(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,s){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+s}`}bezierCurveTo(t,n,r,s,a,o){this._append`C${+t},${+n},${+r},${+s},${this._x1=+a},${this._y1=+o}`}arcTo(t,n,r,s,a){if(t=+t,n=+n,r=+r,s=+s,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,l=this._y1,c=r-t,u=s-n,d=o-t,f=l-n,x=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(x>jv)if(!(Math.abs(f*c-u*d)>jv)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-o,v=s-l,w=c*c+u*u,C=g*g+v*v,N=Math.sqrt(w),I=Math.sqrt(x),P=a*Math.tan((ute-Math.acos((w+x-C)/(2*N*I)))/2),R=P/I,F=P/N;Math.abs(R-1)>jv&&this._append`L${t+R*d},${n+R*f}`,this._append`A${a},${a},0,0,${+(f*g>d*v)},${this._x1=t+F*c},${this._y1=n+F*u}`}}arc(t,n,r,s,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(s),c=r*Math.sin(s),u=t+l,d=n+c,f=1^o,x=o?s-a:a-s;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>jv||Math.abs(this._y1-d)>jv)&&this._append`L${u},${d}`,r&&(x<0&&(x=x%dte+dte),x>oUt?this._append`A${r},${r},0,1,${f},${t-l},${n-c}A${r},${r},0,1,${f},${this._x1=u},${this._y1=d}`:x>jv&&this._append`A${r},${r},0,${+(x>=ute)},${f},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+s}h${-r}Z`}toString(){return this._}}function Mle(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new cUt(t)}function Rle(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function hDe(e){this._context=e}hDe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function L$(e){return new hDe(e)}function pDe(e){return e[0]}function mDe(e){return e[1]}function xDe(e,t){var n=no(!0),r=null,s=L$,a=null,o=Mle(l);e=typeof e=="function"?e:e===void 0?pDe:no(e),t=typeof t=="function"?t:t===void 0?mDe:no(t);function l(c){var u,d=(c=Rle(c)).length,f,x=!1,g;for(r==null&&(a=s(g=o())),u=0;u<=d;++u)!(u<d&&n(f=c[u],u,c))===x&&((x=!x)?a.lineStart():a.lineEnd()),x&&a.point(+e(f,u,c),+t(f,u,c));if(g)return a=null,g+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:no(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:no(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:no(!!c),l):n},l.curve=function(c){return arguments.length?(s=c,r!=null&&(a=s(r)),l):s},l.context=function(c){return arguments.length?(c==null?r=a=null:a=s(r=c),l):r},l}function SP(e,t,n){var r=null,s=no(!0),a=null,o=L$,l=null,c=Mle(u);e=typeof e=="function"?e:e===void 0?pDe:no(+e),t=typeof t=="function"?t:no(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?mDe:no(+n);function u(f){var x,g,v,w=(f=Rle(f)).length,C,N=!1,I,P=new Array(w),R=new Array(w);for(a==null&&(l=o(I=c())),x=0;x<=w;++x){if(!(x<w&&s(C=f[x],x,f))===N)if(N=!N)g=x,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),v=x-1;v>=g;--v)l.point(P[v],R[v]);l.lineEnd(),l.areaEnd()}N&&(P[x]=+e(C,x,f),R[x]=+t(C,x,f),l.point(r?+r(C,x,f):P[x],n?+n(C,x,f):R[x]))}if(I)return l=null,I+""||null}function d(){return xDe().defined(s).curve(o).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:no(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:no(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:no(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:no(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:no(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:no(+f),u):n},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(n)},u.lineX1=function(){return d().x(r).y(t)},u.defined=function(f){return arguments.length?(s=typeof f=="function"?f:no(!!f),u):s},u.curve=function(f){return arguments.length?(o=f,a!=null&&(l=o(a)),u):o},u.context=function(f){return arguments.length?(f==null?a=l=null:l=o(a=f),u):a},u}class gDe{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function uUt(e){return new gDe(e,!0)}function dUt(e){return new gDe(e,!1)}const Lle={draw(e,t){const n=ym(t/qR);e.moveTo(n,0),e.arc(0,0,n,0,R$)}},fUt={draw(e,t){const n=ym(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},bDe=ym(1/3),hUt=bDe*2,pUt={draw(e,t){const n=ym(t/hUt),r=n*bDe;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},mUt={draw(e,t){const n=ym(t),r=-n/2;e.rect(r,r,n,n)}},xUt=.8908130915292852,yDe=WR(qR/10)/WR(7*qR/10),gUt=WR(R$/10)*yDe,bUt=-dDe(R$/10)*yDe,yUt={draw(e,t){const n=ym(t*xUt),r=gUt*n,s=bUt*n;e.moveTo(0,-n),e.lineTo(r,s);for(let a=1;a<5;++a){const o=R$*a/5,l=dDe(o),c=WR(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*s,c*r+l*s)}e.closePath()}},Xq=ym(3),vUt={draw(e,t){const n=-ym(t/(Xq*3));e.moveTo(0,n*2),e.lineTo(-Xq*n,-n),e.lineTo(Xq*n,-n),e.closePath()}},ph=-.5,mh=ym(3)/2,fte=1/ym(12),wUt=(fte/2+1)*3,CUt={draw(e,t){const n=ym(t/wUt),r=n/2,s=n*fte,a=r,o=n*fte+n,l=-a,c=o;e.moveTo(r,s),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(ph*r-mh*s,mh*r+ph*s),e.lineTo(ph*a-mh*o,mh*a+ph*o),e.lineTo(ph*l-mh*c,mh*l+ph*c),e.lineTo(ph*r+mh*s,ph*s-mh*r),e.lineTo(ph*a+mh*o,ph*o-mh*a),e.lineTo(ph*l+mh*c,ph*c-mh*l),e.closePath()}};function SUt(e,t){let n=null,r=Mle(s);e=typeof e=="function"?e:no(e||Lle),t=typeof t=="function"?t:no(t===void 0?64:+t);function s(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return s.type=function(a){return arguments.length?(e=typeof a=="function"?a:no(a),s):e},s.size=function(a){return arguments.length?(t=typeof a=="function"?a:no(+a),s):t},s.context=function(a){return arguments.length?(n=a??null,s):n},s}function GR(){}function KR(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function vDe(e){this._context=e}vDe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:KR(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:KR(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function NUt(e){return new vDe(e)}function wDe(e){this._context=e}wDe.prototype={areaStart:GR,areaEnd:GR,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:KR(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function AUt(e){return new wDe(e)}function CDe(e){this._context=e}CDe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:KR(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function jUt(e){return new CDe(e)}function SDe(e){this._context=e}SDe.prototype={areaStart:GR,areaEnd:GR,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function EUt(e){return new SDe(e)}function A2e(e){return e<0?-1:1}function j2e(e,t,n){var r=e._x1-e._x0,s=t-e._x1,a=(e._y1-e._y0)/(r||s<0&&-0),o=(n-e._y1)/(s||r<0&&-0),l=(a*s+o*r)/(r+s);return(A2e(a)+A2e(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function E2e(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Qq(e,t,n){var r=e._x0,s=e._y0,a=e._x1,o=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,s+l*t,a-l,o-l*n,a,o)}function YR(e){this._context=e}YR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Qq(this,this._t0,E2e(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Qq(this,E2e(this,n=j2e(this,e,t)),n);break;default:Qq(this,this._t0,n=j2e(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function NDe(e){this._context=new ADe(e)}(NDe.prototype=Object.create(YR.prototype)).point=function(e,t){YR.prototype.point.call(this,t,e)};function ADe(e){this._context=e}ADe.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,s,a){this._context.bezierCurveTo(t,e,r,n,a,s)}};function _Ut(e){return new YR(e)}function kUt(e){return new NDe(e)}function jDe(e){this._context=e}jDe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=_2e(e),s=_2e(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],s[0][a],r[1][a],s[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function _2e(e){var t,n=e.length-1,r,s=new Array(n),a=new Array(n),o=new Array(n);for(s[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)s[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(s[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=s[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(s[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)s[t]=(o[t]-s[t+1])/a[t];for(a[n-1]=(e[n]+s[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-s[t+1];return[s,a]}function TUt(e){return new jDe(e)}function D$(e,t){this._context=e,this._t=t}D$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function IUt(e){return new D$(e,.5)}function PUt(e){return new D$(e,0)}function FUt(e){return new D$(e,1)}function yN(e,t){if((o=e.length)>1)for(var n=1,r,s,a=e[t[0]],o,l=a.length;n<o;++n)for(s=a,a=e[t[n]],r=0;r<l;++r)a[r][1]+=a[r][0]=isNaN(s[r][1])?s[r][0]:s[r][1]}function hte(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function OUt(e,t){return e[t]}function MUt(e){const t=[];return t.key=e,t}function RUt(){var e=no([]),t=hte,n=yN,r=OUt;function s(a){var o=Array.from(e.apply(this,arguments),MUt),l,c=o.length,u=-1,d;for(const f of a)for(l=0,++u;l<c;++l)(o[l][u]=[0,+r(f,o[l].key,u,a)]).data=f;for(l=0,d=Rle(t(o));l<c;++l)o[d[l]].index=l;return n(o,d),o}return s.keys=function(a){return arguments.length?(e=typeof a=="function"?a:no(Array.from(a)),s):e},s.value=function(a){return arguments.length?(r=typeof a=="function"?a:no(+a),s):r},s.order=function(a){return arguments.length?(t=a==null?hte:typeof a=="function"?a:no(Array.from(a)),s):t},s.offset=function(a){return arguments.length?(n=a??yN,s):n},s}function LUt(e,t){if((r=e.length)>0){for(var n,r,s=0,a=e[0].length,o;s<a;++s){for(o=n=0;n<r;++n)o+=e[n][s][1]||0;if(o)for(n=0;n<r;++n)e[n][s][1]/=o}yN(e,t)}}function DUt(e,t){if((s=e.length)>0){for(var n=0,r=e[t[0]],s,a=r.length;n<a;++n){for(var o=0,l=0;o<s;++o)l+=e[o][n][1]||0;r[n][1]+=r[n][0]=-l/2}yN(e,t)}}function BUt(e,t){if(!(!((o=e.length)>0)||!((a=(s=e[t[0]]).length)>0))){for(var n=0,r=1,s,a,o;r<a;++r){for(var l=0,c=0,u=0;l<o;++l){for(var d=e[t[l]],f=d[r][1]||0,x=d[r-1][1]||0,g=(f-x)/2,v=0;v<l;++v){var w=e[t[v]],C=w[r][1]||0,N=w[r-1][1]||0;g+=C-N}c+=f,u+=g*f}s[r-1][1]+=s[r-1][0]=n,c&&(n-=u/c)}s[r-1][1]+=s[r-1][0]=n,yN(e,t)}}function r_(e){"@babel/helpers - typeof";return r_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r_(e)}var $Ut=["type","size","sizeType"];function pte(){return pte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pte.apply(this,arguments)}function k2e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function T2e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k2e(Object(n),!0).forEach(function(r){UUt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k2e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function UUt(e,t,n){return t=zUt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zUt(e){var t=HUt(e,"string");return r_(t)=="symbol"?t:t+""}function HUt(e,t){if(r_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(r_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function VUt(e,t){if(e==null)return{};var n=WUt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function WUt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var EDe={symbolCircle:Lle,symbolCross:fUt,symbolDiamond:pUt,symbolSquare:mUt,symbolStar:yUt,symbolTriangle:vUt,symbolWye:CUt},qUt=Math.PI/180,GUt=function(t){var n="symbol".concat(M$(t));return EDe[n]||Lle},KUt=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var s=18*qUt;return 1.25*t*t*(Math.tan(s)-Math.tan(s*2)*Math.pow(Math.tan(s),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},YUt=function(t,n){EDe["symbol".concat(M$(t))]=n},B$=function(t){var n=t.type,r=n===void 0?"circle":n,s=t.size,a=s===void 0?64:s,o=t.sizeType,l=o===void 0?"area":o,c=VUt(t,$Ut),u=T2e(T2e({},c),{},{type:r,size:a,sizeType:l}),d=function(){var C=GUt(r),N=SUt().type(C).size(KUt(a,l,r));return N()},f=u.className,x=u.cx,g=u.cy,v=mi(u,!0);return x===+x&&g===+g&&a===+a?Se.createElement("path",pte({},v,{className:ta("recharts-symbols",f),transform:"translate(".concat(x,", ").concat(g,")"),d:d()})):null};B$.registerSymbol=YUt;function vN(e){"@babel/helpers - typeof";return vN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vN(e)}function mte(){return mte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mte.apply(this,arguments)}function I2e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function XUt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?I2e(Object(n),!0).forEach(function(r){s_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I2e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QUt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZUt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,kDe(r.key),r)}}function JUt(e,t,n){return ZUt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ezt(e,t,n){return t=XR(t),tzt(e,_De()?Reflect.construct(t,n||[],XR(e).constructor):t.apply(e,n))}function tzt(e,t){if(t&&(vN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nzt(e)}function nzt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _De(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_De=function(){return!!e})()}function XR(e){return XR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},XR(e)}function rzt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xte(e,t)}function xte(e,t){return xte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},xte(e,t)}function s_(e,t,n){return t=kDe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kDe(e){var t=szt(e,"string");return vN(t)=="symbol"?t:t+""}function szt(e,t){if(vN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(vN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Np=32,Dle=function(e){function t(){return QUt(this,t),ezt(this,t,arguments)}return rzt(t,e),JUt(t,[{key:"renderIcon",value:function(r){var s=this.props.inactiveColor,a=Np/2,o=Np/6,l=Np/3,c=r.inactive?s:r.color;if(r.type==="plainline")return Se.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:a,x2:Np,y2:a,className:"recharts-legend-icon"});if(r.type==="line")return Se.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(a,"h").concat(l,`
            A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(a,`
            H`).concat(Np,"M").concat(2*l,",").concat(a,`
            A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(a),className:"recharts-legend-icon"});if(r.type==="rect")return Se.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Np/8,"h").concat(Np,"v").concat(Np*3/4,"h").concat(-32,"z"),className:"recharts-legend-icon"});if(Se.isValidElement(r.legendIcon)){var u=XUt({},r);return delete u.legendIcon,Se.cloneElement(r.legendIcon,u)}return Se.createElement(B$,{fill:c,cx:a,cy:a,size:Np,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,s=this.props,a=s.payload,o=s.iconSize,l=s.layout,c=s.formatter,u=s.inactiveColor,d={x:0,y:0,width:Np,height:Np},f={display:l==="horizontal"?"inline-block":"block",marginRight:10},x={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(g,v){var w=g.formatter||c,C=ta(s_(s_({"recharts-legend-item":!0},"legend-item-".concat(v),!0),"inactive",g.inactive));if(g.type==="none")return null;var N=wi(g.value)?null:g.value;Wg(!wi(g.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var I=g.inactive?u:g.color;return Se.createElement("li",mte({className:C,style:f,key:"legend-item-".concat(v)},n_(r.props,g,v)),Se.createElement(lte,{width:o,height:o,viewBox:d,style:x},r.renderIcon(g)),Se.createElement("span",{className:"recharts-legend-item-text",style:{color:I}},w?w(N,g,v):N))})}},{key:"render",value:function(){var r=this.props,s=r.payload,a=r.layout,o=r.align;if(!s||!s.length)return null;var l={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return Se.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(m.PureComponent);s_(Dle,"displayName","Legend");s_(Dle,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Zq,P2e;function izt(){if(P2e)return Zq;P2e=1;var e=P$();function t(){this.__data__=new e,this.size=0}return Zq=t,Zq}var Jq,F2e;function azt(){if(F2e)return Jq;F2e=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return Jq=e,Jq}var eG,O2e;function ozt(){if(O2e)return eG;O2e=1;function e(t){return this.__data__.get(t)}return eG=e,eG}var tG,M2e;function lzt(){if(M2e)return tG;M2e=1;function e(t){return this.__data__.has(t)}return tG=e,tG}var nG,R2e;function czt(){if(R2e)return nG;R2e=1;var e=P$(),t=kle(),n=Tle(),r=200;function s(a,o){var l=this.__data__;if(l instanceof e){var c=l.__data__;if(!t||c.length<r-1)return c.push([a,o]),this.size=++l.size,this;l=this.__data__=new n(c)}return l.set(a,o),this.size=l.size,this}return nG=s,nG}var rG,L2e;function TDe(){if(L2e)return rG;L2e=1;var e=P$(),t=izt(),n=azt(),r=ozt(),s=lzt(),a=czt();function o(l){var c=this.__data__=new e(l);this.size=c.size}return o.prototype.clear=t,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=s,o.prototype.set=a,rG=o,rG}var sG,D2e;function uzt(){if(D2e)return sG;D2e=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return sG=t,sG}var iG,B2e;function dzt(){if(B2e)return iG;B2e=1;function e(t){return this.__data__.has(t)}return iG=e,iG}var aG,$2e;function IDe(){if($2e)return aG;$2e=1;var e=Tle(),t=uzt(),n=dzt();function r(s){var a=-1,o=s==null?0:s.length;for(this.__data__=new e;++a<o;)this.add(s[a])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,aG=r,aG}var oG,U2e;function PDe(){if(U2e)return oG;U2e=1;function e(t,n){for(var r=-1,s=t==null?0:t.length;++r<s;)if(n(t[r],r,t))return!0;return!1}return oG=e,oG}var lG,z2e;function FDe(){if(z2e)return lG;z2e=1;function e(t,n){return t.has(n)}return lG=e,lG}var cG,H2e;function ODe(){if(H2e)return cG;H2e=1;var e=IDe(),t=PDe(),n=FDe(),r=1,s=2;function a(o,l,c,u,d,f){var x=c&r,g=o.length,v=l.length;if(g!=v&&!(x&&v>g))return!1;var w=f.get(o),C=f.get(l);if(w&&C)return w==l&&C==o;var N=-1,I=!0,P=c&s?new e:void 0;for(f.set(o,l),f.set(l,o);++N<g;){var R=o[N],F=l[N];if(u)var U=x?u(F,R,N,l,o,f):u(R,F,N,o,l,f);if(U!==void 0){if(U)continue;I=!1;break}if(P){if(!t(l,function(L,z){if(!n(P,z)&&(R===L||d(R,L,c,u,f)))return P.push(z)})){I=!1;break}}else if(!(R===F||d(R,F,c,u,f))){I=!1;break}}return f.delete(o),f.delete(l),I}return cG=a,cG}var uG,V2e;function fzt(){if(V2e)return uG;V2e=1;var e=lx(),t=e.Uint8Array;return uG=t,uG}var dG,W2e;function hzt(){if(W2e)return dG;W2e=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s,a){r[++n]=[a,s]}),r}return dG=e,dG}var fG,q2e;function Ble(){if(q2e)return fG;q2e=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(s){r[++n]=s}),r}return fG=e,fG}var hG,G2e;function pzt(){if(G2e)return hG;G2e=1;var e=oT(),t=fzt(),n=_le(),r=ODe(),s=hzt(),a=Ble(),o=1,l=2,c="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Map]",x="[object Number]",g="[object RegExp]",v="[object Set]",w="[object String]",C="[object Symbol]",N="[object ArrayBuffer]",I="[object DataView]",P=e?e.prototype:void 0,R=P?P.valueOf:void 0;function F(U,L,z,X,ne,J,Z){switch(z){case I:if(U.byteLength!=L.byteLength||U.byteOffset!=L.byteOffset)return!1;U=U.buffer,L=L.buffer;case N:return!(U.byteLength!=L.byteLength||!J(new t(U),new t(L)));case c:case u:case x:return n(+U,+L);case d:return U.name==L.name&&U.message==L.message;case g:case w:return U==L+"";case f:var re=s;case v:var he=X&o;if(re||(re=a),U.size!=L.size&&!he)return!1;var Y=Z.get(U);if(Y)return Y==L;X|=l,Z.set(U,L);var ie=r(re(U),re(L),X,ne,J,Z);return Z.delete(U),ie;case C:if(R)return R.call(U)==R.call(L)}return!1}return hG=F,hG}var pG,K2e;function MDe(){if(K2e)return pG;K2e=1;function e(t,n){for(var r=-1,s=n.length,a=t.length;++r<s;)t[a+r]=n[r];return t}return pG=e,pG}var mG,Y2e;function mzt(){if(Y2e)return mG;Y2e=1;var e=MDe(),t=rf();function n(r,s,a){var o=s(r);return t(r)?o:e(o,a(r))}return mG=n,mG}var xG,X2e;function xzt(){if(X2e)return xG;X2e=1;function e(t,n){for(var r=-1,s=t==null?0:t.length,a=0,o=[];++r<s;){var l=t[r];n(l,r,t)&&(o[a++]=l)}return o}return xG=e,xG}var gG,Q2e;function gzt(){if(Q2e)return gG;Q2e=1;function e(){return[]}return gG=e,gG}var bG,Z2e;function bzt(){if(Z2e)return bG;Z2e=1;var e=xzt(),t=gzt(),n=Object.prototype,r=n.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(o){return o==null?[]:(o=Object(o),e(s(o),function(l){return r.call(o,l)}))}:t;return bG=a,bG}var yG,J2e;function yzt(){if(J2e)return yG;J2e=1;function e(t,n){for(var r=-1,s=Array(t);++r<t;)s[r]=n(r);return s}return yG=e,yG}var vG,eve;function vzt(){if(eve)return vG;eve=1;var e=S1(),t=N1(),n="[object Arguments]";function r(s){return t(s)&&e(s)==n}return vG=r,vG}var wG,tve;function $le(){if(tve)return wG;tve=1;var e=vzt(),t=N1(),n=Object.prototype,r=n.hasOwnProperty,s=n.propertyIsEnumerable,a=e(function(){return arguments}())?e:function(o){return t(o)&&r.call(o,"callee")&&!s.call(o,"callee")};return wG=a,wG}var jj={exports:{}},CG,nve;function wzt(){if(nve)return CG;nve=1;function e(){return!1}return CG=e,CG}jj.exports;var rve;function RDe(){return rve||(rve=1,function(e,t){var n=lx(),r=wzt(),s=t&&!t.nodeType&&t,a=s&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===s,l=o?n.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||r;e.exports=u}(jj,jj.exports)),jj.exports}var SG,sve;function Ule(){if(sve)return SG;sve=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,s){var a=typeof r;return s=s??e,!!s&&(a=="number"||a!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<s}return SG=n,SG}var NG,ive;function zle(){if(ive)return NG;ive=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return NG=t,NG}var AG,ave;function Czt(){if(ave)return AG;ave=1;var e=S1(),t=zle(),n=N1(),r="[object Arguments]",s="[object Array]",a="[object Boolean]",o="[object Date]",l="[object Error]",c="[object Function]",u="[object Map]",d="[object Number]",f="[object Object]",x="[object RegExp]",g="[object Set]",v="[object String]",w="[object WeakMap]",C="[object ArrayBuffer]",N="[object DataView]",I="[object Float32Array]",P="[object Float64Array]",R="[object Int8Array]",F="[object Int16Array]",U="[object Int32Array]",L="[object Uint8Array]",z="[object Uint8ClampedArray]",X="[object Uint16Array]",ne="[object Uint32Array]",J={};J[I]=J[P]=J[R]=J[F]=J[U]=J[L]=J[z]=J[X]=J[ne]=!0,J[r]=J[s]=J[C]=J[a]=J[N]=J[o]=J[l]=J[c]=J[u]=J[d]=J[f]=J[x]=J[g]=J[v]=J[w]=!1;function Z(re){return n(re)&&t(re.length)&&!!J[e(re)]}return AG=Z,AG}var jG,ove;function LDe(){if(ove)return jG;ove=1;function e(t){return function(n){return t(n)}}return jG=e,jG}var Ej={exports:{}};Ej.exports;var lve;function Szt(){return lve||(lve=1,function(e,t){var n=nDe(),r=t&&!t.nodeType&&t,s=r&&!0&&e&&!e.nodeType&&e,a=s&&s.exports===r,o=a&&n.process,l=function(){try{var c=s&&s.require&&s.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l}(Ej,Ej.exports)),Ej.exports}var EG,cve;function DDe(){if(cve)return EG;cve=1;var e=Czt(),t=LDe(),n=Szt(),r=n&&n.isTypedArray,s=r?t(r):e;return EG=s,EG}var _G,uve;function Nzt(){if(uve)return _G;uve=1;var e=yzt(),t=$le(),n=rf(),r=RDe(),s=Ule(),a=DDe(),o=Object.prototype,l=o.hasOwnProperty;function c(u,d){var f=n(u),x=!f&&t(u),g=!f&&!x&&r(u),v=!f&&!x&&!g&&a(u),w=f||x||g||v,C=w?e(u.length,String):[],N=C.length;for(var I in u)(d||l.call(u,I))&&!(w&&(I=="length"||g&&(I=="offset"||I=="parent")||v&&(I=="buffer"||I=="byteLength"||I=="byteOffset")||s(I,N)))&&C.push(I);return C}return _G=c,_G}var kG,dve;function Azt(){if(dve)return kG;dve=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,s=typeof r=="function"&&r.prototype||e;return n===s}return kG=t,kG}var TG,fve;function BDe(){if(fve)return TG;fve=1;function e(t,n){return function(r){return t(n(r))}}return TG=e,TG}var IG,hve;function jzt(){if(hve)return IG;hve=1;var e=BDe(),t=e(Object.keys,Object);return IG=t,IG}var PG,pve;function Ezt(){if(pve)return PG;pve=1;var e=Azt(),t=jzt(),n=Object.prototype,r=n.hasOwnProperty;function s(a){if(!e(a))return t(a);var o=[];for(var l in Object(a))r.call(a,l)&&l!="constructor"&&o.push(l);return o}return PG=s,PG}var FG,mve;function lT(){if(mve)return FG;mve=1;var e=Ele(),t=zle();function n(r){return r!=null&&t(r.length)&&!e(r)}return FG=n,FG}var OG,xve;function $$(){if(xve)return OG;xve=1;var e=Nzt(),t=Ezt(),n=lT();function r(s){return n(s)?e(s):t(s)}return OG=r,OG}var MG,gve;function _zt(){if(gve)return MG;gve=1;var e=mzt(),t=bzt(),n=$$();function r(s){return e(s,n,t)}return MG=r,MG}var RG,bve;function kzt(){if(bve)return RG;bve=1;var e=_zt(),t=1,n=Object.prototype,r=n.hasOwnProperty;function s(a,o,l,c,u,d){var f=l&t,x=e(a),g=x.length,v=e(o),w=v.length;if(g!=w&&!f)return!1;for(var C=g;C--;){var N=x[C];if(!(f?N in o:r.call(o,N)))return!1}var I=d.get(a),P=d.get(o);if(I&&P)return I==o&&P==a;var R=!0;d.set(a,o),d.set(o,a);for(var F=f;++C<g;){N=x[C];var U=a[N],L=o[N];if(c)var z=f?c(L,U,N,o,a,d):c(U,L,N,a,o,d);if(!(z===void 0?U===L||u(U,L,l,c,d):z)){R=!1;break}F||(F=N=="constructor")}if(R&&!F){var X=a.constructor,ne=o.constructor;X!=ne&&"constructor"in a&&"constructor"in o&&!(typeof X=="function"&&X instanceof X&&typeof ne=="function"&&ne instanceof ne)&&(R=!1)}return d.delete(a),d.delete(o),R}return RG=s,RG}var LG,yve;function Tzt(){if(yve)return LG;yve=1;var e=b5(),t=lx(),n=e(t,"DataView");return LG=n,LG}var DG,vve;function Izt(){if(vve)return DG;vve=1;var e=b5(),t=lx(),n=e(t,"Promise");return DG=n,DG}var BG,wve;function $De(){if(wve)return BG;wve=1;var e=b5(),t=lx(),n=e(t,"Set");return BG=n,BG}var $G,Cve;function Pzt(){if(Cve)return $G;Cve=1;var e=b5(),t=lx(),n=e(t,"WeakMap");return $G=n,$G}var UG,Sve;function Fzt(){if(Sve)return UG;Sve=1;var e=Tzt(),t=kle(),n=Izt(),r=$De(),s=Pzt(),a=S1(),o=rDe(),l="[object Map]",c="[object Object]",u="[object Promise]",d="[object Set]",f="[object WeakMap]",x="[object DataView]",g=o(e),v=o(t),w=o(n),C=o(r),N=o(s),I=a;return(e&&I(new e(new ArrayBuffer(1)))!=x||t&&I(new t)!=l||n&&I(n.resolve())!=u||r&&I(new r)!=d||s&&I(new s)!=f)&&(I=function(P){var R=a(P),F=R==c?P.constructor:void 0,U=F?o(F):"";if(U)switch(U){case g:return x;case v:return l;case w:return u;case C:return d;case N:return f}return R}),UG=I,UG}var zG,Nve;function Ozt(){if(Nve)return zG;Nve=1;var e=TDe(),t=ODe(),n=pzt(),r=kzt(),s=Fzt(),a=rf(),o=RDe(),l=DDe(),c=1,u="[object Arguments]",d="[object Array]",f="[object Object]",x=Object.prototype,g=x.hasOwnProperty;function v(w,C,N,I,P,R){var F=a(w),U=a(C),L=F?d:s(w),z=U?d:s(C);L=L==u?f:L,z=z==u?f:z;var X=L==f,ne=z==f,J=L==z;if(J&&o(w)){if(!o(C))return!1;F=!0,X=!1}if(J&&!X)return R||(R=new e),F||l(w)?t(w,C,N,I,P,R):n(w,C,L,N,I,P,R);if(!(N&c)){var Z=X&&g.call(w,"__wrapped__"),re=ne&&g.call(C,"__wrapped__");if(Z||re){var he=Z?w.value():w,Y=re?C.value():C;return R||(R=new e),P(he,Y,N,I,R)}}return J?(R||(R=new e),r(w,C,N,I,P,R)):!1}return zG=v,zG}var HG,Ave;function Hle(){if(Ave)return HG;Ave=1;var e=Ozt(),t=N1();function n(r,s,a,o,l){return r===s?!0:r==null||s==null||!t(r)&&!t(s)?r!==r&&s!==s:e(r,s,a,o,n,l)}return HG=n,HG}var VG,jve;function Mzt(){if(jve)return VG;jve=1;var e=TDe(),t=Hle(),n=1,r=2;function s(a,o,l,c){var u=l.length,d=u,f=!c;if(a==null)return!d;for(a=Object(a);u--;){var x=l[u];if(f&&x[2]?x[1]!==a[x[0]]:!(x[0]in a))return!1}for(;++u<d;){x=l[u];var g=x[0],v=a[g],w=x[1];if(f&&x[2]){if(v===void 0&&!(g in a))return!1}else{var C=new e;if(c)var N=c(v,w,g,a,o,C);if(!(N===void 0?t(w,v,n|r,c,C):N))return!1}}return!0}return VG=s,VG}var WG,Eve;function UDe(){if(Eve)return WG;Eve=1;var e=u2();function t(n){return n===n&&!e(n)}return WG=t,WG}var qG,_ve;function Rzt(){if(_ve)return qG;_ve=1;var e=UDe(),t=$$();function n(r){for(var s=t(r),a=s.length;a--;){var o=s[a],l=r[o];s[a]=[o,l,e(l)]}return s}return qG=n,qG}var GG,kve;function zDe(){if(kve)return GG;kve=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return GG=e,GG}var KG,Tve;function Lzt(){if(Tve)return KG;Tve=1;var e=Mzt(),t=Rzt(),n=zDe();function r(s){var a=t(s);return a.length==1&&a[0][2]?n(a[0][0],a[0][1]):function(o){return o===s||e(o,s,a)}}return KG=r,KG}var YG,Ive;function Dzt(){if(Ive)return YG;Ive=1;function e(t,n){return t!=null&&n in Object(t)}return YG=e,YG}var XG,Pve;function Bzt(){if(Pve)return XG;Pve=1;var e=aDe(),t=$le(),n=rf(),r=Ule(),s=zle(),a=O$();function o(l,c,u){c=e(c,l);for(var d=-1,f=c.length,x=!1;++d<f;){var g=a(c[d]);if(!(x=l!=null&&u(l,g)))break;l=l[g]}return x||++d!=f?x:(f=l==null?0:l.length,!!f&&s(f)&&r(g,f)&&(n(l)||t(l)))}return XG=o,XG}var QG,Fve;function $zt(){if(Fve)return QG;Fve=1;var e=Dzt(),t=Bzt();function n(r,s){return r!=null&&t(r,s,e)}return QG=n,QG}var ZG,Ove;function Uzt(){if(Ove)return ZG;Ove=1;var e=Hle(),t=oDe(),n=$zt(),r=jle(),s=UDe(),a=zDe(),o=O$(),l=1,c=2;function u(d,f){return r(d)&&s(f)?a(o(d),f):function(x){var g=t(x,d);return g===void 0&&g===f?n(x,d):e(f,g,l|c)}}return ZG=u,ZG}var JG,Mve;function YA(){if(Mve)return JG;Mve=1;function e(t){return t}return JG=e,JG}var eK,Rve;function zzt(){if(Rve)return eK;Rve=1;function e(t){return function(n){return n==null?void 0:n[t]}}return eK=e,eK}var tK,Lve;function Hzt(){if(Lve)return tK;Lve=1;var e=Ple();function t(n){return function(r){return e(r,n)}}return tK=t,tK}var nK,Dve;function Vzt(){if(Dve)return nK;Dve=1;var e=zzt(),t=Hzt(),n=jle(),r=O$();function s(a){return n(a)?e(r(a)):t(a)}return nK=s,nK}var rK,Bve;function d2(){if(Bve)return rK;Bve=1;var e=Lzt(),t=Uzt(),n=YA(),r=rf(),s=Vzt();function a(o){return typeof o=="function"?o:o==null?n:typeof o=="object"?r(o)?t(o[0],o[1]):e(o):s(o)}return rK=a,rK}var sK,$ve;function HDe(){if($ve)return sK;$ve=1;function e(t,n,r,s){for(var a=t.length,o=r+(s?1:-1);s?o--:++o<a;)if(n(t[o],o,t))return o;return-1}return sK=e,sK}var iK,Uve;function Wzt(){if(Uve)return iK;Uve=1;function e(t){return t!==t}return iK=e,iK}var aK,zve;function qzt(){if(zve)return aK;zve=1;function e(t,n,r){for(var s=r-1,a=t.length;++s<a;)if(t[s]===n)return s;return-1}return aK=e,aK}var oK,Hve;function Gzt(){if(Hve)return oK;Hve=1;var e=HDe(),t=Wzt(),n=qzt();function r(s,a,o){return a===a?n(s,a,o):e(s,t,o)}return oK=r,oK}var lK,Vve;function Kzt(){if(Vve)return lK;Vve=1;var e=Gzt();function t(n,r){var s=n==null?0:n.length;return!!s&&e(n,r,0)>-1}return lK=t,lK}var cK,Wve;function Yzt(){if(Wve)return cK;Wve=1;function e(t,n,r){for(var s=-1,a=t==null?0:t.length;++s<a;)if(r(n,t[s]))return!0;return!1}return cK=e,cK}var uK,qve;function Xzt(){if(qve)return uK;qve=1;function e(){}return uK=e,uK}var dK,Gve;function Qzt(){if(Gve)return dK;Gve=1;var e=$De(),t=Xzt(),n=Ble(),r=1/0,s=e&&1/n(new e([,-0]))[1]==r?function(a){return new e(a)}:t;return dK=s,dK}var fK,Kve;function Zzt(){if(Kve)return fK;Kve=1;var e=IDe(),t=Kzt(),n=Yzt(),r=FDe(),s=Qzt(),a=Ble(),o=200;function l(c,u,d){var f=-1,x=t,g=c.length,v=!0,w=[],C=w;if(d)v=!1,x=n;else if(g>=o){var N=u?null:s(c);if(N)return a(N);v=!1,x=r,C=new e}else C=u?[]:w;e:for(;++f<g;){var I=c[f],P=u?u(I):I;if(I=d||I!==0?I:0,v&&P===P){for(var R=C.length;R--;)if(C[R]===P)continue e;u&&C.push(P),w.push(I)}else x(C,P,d)||(C!==w&&C.push(P),w.push(I))}return w}return fK=l,fK}var hK,Yve;function Jzt(){if(Yve)return hK;Yve=1;var e=d2(),t=Zzt();function n(r,s){return r&&r.length?t(r,e(s,2)):[]}return hK=n,hK}var eHt=Jzt();const Xve=ji(eHt);function VDe(e,t,n){return t===!0?Xve(e,n):wi(t)?Xve(e,t):e}function wN(e){"@babel/helpers - typeof";return wN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wN(e)}var tHt=["ref"];function Qve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Hx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Qve(Object(n),!0).forEach(function(r){U$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qve(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nHt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zve(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qDe(r.key),r)}}function rHt(e,t,n){return Zve(e.prototype,t),Zve(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function sHt(e,t,n){return t=QR(t),iHt(e,WDe()?Reflect.construct(t,n,QR(e).constructor):t.apply(e,n))}function iHt(e,t){if(t&&(wN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return aHt(e)}function aHt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WDe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(WDe=function(){return!!e})()}function QR(e){return QR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},QR(e)}function oHt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gte(e,t)}function gte(e,t){return gte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},gte(e,t)}function U$(e,t,n){return t=qDe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qDe(e){var t=lHt(e,"string");return wN(t)=="symbol"?t:t+""}function lHt(e,t){if(wN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(wN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cHt(e,t){if(e==null)return{};var n=uHt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function uHt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function dHt(e){return e.value}function fHt(e,t){if(Se.isValidElement(e))return Se.cloneElement(e,t);if(typeof e=="function")return Se.createElement(e,t);t.ref;var n=cHt(t,tHt);return Se.createElement(Dle,n)}var Jve=1,n3=function(e){function t(){var n;nHt(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=sHt(this,t,[].concat(s)),U$(n,"lastBoundingBox",{width:-1,height:-1}),n}return oHt(t,e),rHt(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,s=this.getBBox();s?(Math.abs(s.width-this.lastBoundingBox.width)>Jve||Math.abs(s.height-this.lastBoundingBox.height)>Jve)&&(this.lastBoundingBox.width=s.width,this.lastBoundingBox.height=s.height,r&&r(s)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Hx({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var s=this.props,a=s.layout,o=s.align,l=s.verticalAlign,c=s.margin,u=s.chartWidth,d=s.chartHeight,f,x;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&a==="vertical"){var g=this.getBBoxSnapshot();f={left:((u||0)-g.width)/2}}else f=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(l==="middle"){var v=this.getBBoxSnapshot();x={top:((d||0)-v.height)/2}}else x=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Hx(Hx({},f),x)}},{key:"render",value:function(){var r=this,s=this.props,a=s.content,o=s.width,l=s.height,c=s.wrapperStyle,u=s.payloadUniqBy,d=s.payload,f=Hx(Hx({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return Se.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(g){r.wrapperNode=g}},fHt(a,Hx(Hx({},this.props),{},{payload:VDe(d,u,dHt)})))}}],[{key:"getWithHeight",value:function(r,s){var a=Hx(Hx({},this.defaultProps),r.props),o=a.layout;return o==="vertical"&&Xr(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||s}:null}}])}(m.PureComponent);U$(n3,"displayName","Legend");U$(n3,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var pK,ewe;function hHt(){if(ewe)return pK;ewe=1;var e=oT(),t=$le(),n=rf(),r=e?e.isConcatSpreadable:void 0;function s(a){return n(a)||t(a)||!!(r&&a&&a[r])}return pK=s,pK}var mK,twe;function GDe(){if(twe)return mK;twe=1;var e=MDe(),t=hHt();function n(r,s,a,o,l){var c=-1,u=r.length;for(a||(a=t),l||(l=[]);++c<u;){var d=r[c];s>0&&a(d)?s>1?n(d,s-1,a,o,l):e(l,d):o||(l[l.length]=d)}return l}return mK=n,mK}var xK,nwe;function pHt(){if(nwe)return xK;nwe=1;function e(t){return function(n,r,s){for(var a=-1,o=Object(n),l=s(n),c=l.length;c--;){var u=l[t?c:++a];if(r(o[u],u,o)===!1)break}return n}}return xK=e,xK}var gK,rwe;function mHt(){if(rwe)return gK;rwe=1;var e=pHt(),t=e();return gK=t,gK}var bK,swe;function KDe(){if(swe)return bK;swe=1;var e=mHt(),t=$$();function n(r,s){return r&&e(r,s,t)}return bK=n,bK}var yK,iwe;function xHt(){if(iwe)return yK;iwe=1;var e=lT();function t(n,r){return function(s,a){if(s==null)return s;if(!e(s))return n(s,a);for(var o=s.length,l=r?o:-1,c=Object(s);(r?l--:++l<o)&&a(c[l],l,c)!==!1;);return s}}return yK=t,yK}var vK,awe;function Vle(){if(awe)return vK;awe=1;var e=KDe(),t=xHt(),n=t(e);return vK=n,vK}var wK,owe;function YDe(){if(owe)return wK;owe=1;var e=Vle(),t=lT();function n(r,s){var a=-1,o=t(r)?Array(r.length):[];return e(r,function(l,c,u){o[++a]=s(l,c,u)}),o}return wK=n,wK}var CK,lwe;function gHt(){if(lwe)return CK;lwe=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return CK=e,CK}var SK,cwe;function bHt(){if(cwe)return SK;cwe=1;var e=qA();function t(n,r){if(n!==r){var s=n!==void 0,a=n===null,o=n===n,l=e(n),c=r!==void 0,u=r===null,d=r===r,f=e(r);if(!u&&!f&&!l&&n>r||l&&c&&d&&!u&&!f||a&&c&&d||!s&&d||!o)return 1;if(!a&&!l&&!f&&n<r||f&&s&&o&&!a&&!l||u&&s&&o||!c&&o||!d)return-1}return 0}return SK=t,SK}var NK,uwe;function yHt(){if(uwe)return NK;uwe=1;var e=bHt();function t(n,r,s){for(var a=-1,o=n.criteria,l=r.criteria,c=o.length,u=s.length;++a<c;){var d=e(o[a],l[a]);if(d){if(a>=u)return d;var f=s[a];return d*(f=="desc"?-1:1)}}return n.index-r.index}return NK=t,NK}var AK,dwe;function vHt(){if(dwe)return AK;dwe=1;var e=Ile(),t=Ple(),n=d2(),r=YDe(),s=gHt(),a=LDe(),o=yHt(),l=YA(),c=rf();function u(d,f,x){f.length?f=e(f,function(w){return c(w)?function(C){return t(C,w.length===1?w[0]:w)}:w}):f=[l];var g=-1;f=e(f,a(n));var v=r(d,function(w,C,N){var I=e(f,function(P){return P(w)});return{criteria:I,index:++g,value:w}});return s(v,function(w,C){return o(w,C,x)})}return AK=u,AK}var jK,fwe;function wHt(){if(fwe)return jK;fwe=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return jK=e,jK}var EK,hwe;function CHt(){if(hwe)return EK;hwe=1;var e=wHt(),t=Math.max;function n(r,s,a){return s=t(s===void 0?r.length-1:s,0),function(){for(var o=arguments,l=-1,c=t(o.length-s,0),u=Array(c);++l<c;)u[l]=o[s+l];l=-1;for(var d=Array(s+1);++l<s;)d[l]=o[l];return d[s]=a(u),e(r,this,d)}}return EK=n,EK}var _K,pwe;function SHt(){if(pwe)return _K;pwe=1;function e(t){return function(){return t}}return _K=e,_K}var kK,mwe;function XDe(){if(mwe)return kK;mwe=1;var e=b5(),t=function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}}();return kK=t,kK}var TK,xwe;function NHt(){if(xwe)return TK;xwe=1;var e=SHt(),t=XDe(),n=YA(),r=t?function(s,a){return t(s,"toString",{configurable:!0,enumerable:!1,value:e(a),writable:!0})}:n;return TK=r,TK}var IK,gwe;function AHt(){if(gwe)return IK;gwe=1;var e=800,t=16,n=Date.now;function r(s){var a=0,o=0;return function(){var l=n(),c=t-(l-o);if(o=l,c>0){if(++a>=e)return arguments[0]}else a=0;return s.apply(void 0,arguments)}}return IK=r,IK}var PK,bwe;function jHt(){if(bwe)return PK;bwe=1;var e=NHt(),t=AHt(),n=t(e);return PK=n,PK}var FK,ywe;function EHt(){if(ywe)return FK;ywe=1;var e=YA(),t=CHt(),n=jHt();function r(s,a){return n(t(s,a,e),s+"")}return FK=r,FK}var OK,vwe;function z$(){if(vwe)return OK;vwe=1;var e=_le(),t=lT(),n=Ule(),r=u2();function s(a,o,l){if(!r(l))return!1;var c=typeof o;return(c=="number"?t(l)&&n(o,l.length):c=="string"&&o in l)?e(l[o],a):!1}return OK=s,OK}var MK,wwe;function _Ht(){if(wwe)return MK;wwe=1;var e=GDe(),t=vHt(),n=EHt(),r=z$(),s=n(function(a,o){if(a==null)return[];var l=o.length;return l>1&&r(a,o[0],o[1])?o=[]:l>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),t(a,e(o,1),[])});return MK=s,MK}var kHt=_Ht();const Wle=ji(kHt);function i_(e){"@babel/helpers - typeof";return i_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i_(e)}function bte(){return bte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bte.apply(this,arguments)}function THt(e,t){return OHt(e)||FHt(e,t)||PHt(e,t)||IHt()}function IHt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PHt(e,t){if(e){if(typeof e=="string")return Cwe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cwe(e,t)}}function Cwe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function FHt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function OHt(e){if(Array.isArray(e))return e}function Swe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function RK(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Swe(Object(n),!0).forEach(function(r){MHt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Swe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MHt(e,t,n){return t=RHt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RHt(e){var t=LHt(e,"string");return i_(t)=="symbol"?t:t+""}function LHt(e,t){if(i_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(i_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DHt(e){return Array.isArray(e)&&Xl(e[0])&&Xl(e[1])?e.join(" ~ "):e}var BHt=function(t){var n=t.separator,r=n===void 0?" : ":n,s=t.contentStyle,a=s===void 0?{}:s,o=t.itemStyle,l=o===void 0?{}:o,c=t.labelStyle,u=c===void 0?{}:c,d=t.payload,f=t.formatter,x=t.itemSorter,g=t.wrapperClassName,v=t.labelClassName,w=t.label,C=t.labelFormatter,N=t.accessibilityLayer,I=N===void 0?!1:N,P=function(){if(d&&d.length){var Z={padding:0,margin:0},re=(x?Wle(d,x):d).map(function(he,Y){if(he.type==="none")return null;var ie=RK({display:"block",paddingTop:4,paddingBottom:4,color:he.color||"#000"},l),oe=he.formatter||f||DHt,G=he.value,V=he.name,ee=G,ae=V;if(ee!=null&&ae!=null){var fe=oe(G,V,he,Y,d);if(Array.isArray(fe)){var Ae=THt(fe,2);ee=Ae[0],ae=Ae[1]}else ee=fe}return Se.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(Y),style:ie},Xl(ae)?Se.createElement("span",{className:"recharts-tooltip-item-name"},ae):null,Xl(ae)?Se.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,Se.createElement("span",{className:"recharts-tooltip-item-value"},ee),Se.createElement("span",{className:"recharts-tooltip-item-unit"},he.unit||""))});return Se.createElement("ul",{className:"recharts-tooltip-item-list",style:Z},re)}return null},R=RK({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),F=RK({margin:0},u),U=!xi(w),L=U?w:"",z=ta("recharts-default-tooltip",g),X=ta("recharts-tooltip-label",v);U&&C&&d!==void 0&&d!==null&&(L=C(w,d));var ne=I?{role:"status","aria-live":"assertive"}:{};return Se.createElement("div",bte({className:z,style:R},ne),Se.createElement("p",{className:X,style:F},Se.isValidElement(L)?L:"".concat(L)),P())};function a_(e){"@babel/helpers - typeof";return a_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a_(e)}function NP(e,t,n){return t=$Ht(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $Ht(e){var t=UHt(e,"string");return a_(t)=="symbol"?t:t+""}function UHt(e,t){if(a_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(a_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var F7="recharts-tooltip-wrapper",zHt={visibility:"hidden"};function HHt(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return ta(F7,NP(NP(NP(NP({},"".concat(F7,"-right"),Xr(n)&&t&&Xr(t.x)&&n>=t.x),"".concat(F7,"-left"),Xr(n)&&t&&Xr(t.x)&&n<t.x),"".concat(F7,"-bottom"),Xr(r)&&t&&Xr(t.y)&&r>=t.y),"".concat(F7,"-top"),Xr(r)&&t&&Xr(t.y)&&r<t.y))}function Nwe(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,s=e.offsetTopLeft,a=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(a&&Xr(a[r]))return a[r];var d=n[r]-l-s,f=n[r]+s;if(t[r])return o[r]?d:f;if(o[r]){var x=d,g=c[r];return x<g?Math.max(f,c[r]):Math.max(d,c[r])}var v=f+l,w=c[r]+u;return v>w?Math.max(d,c[r]):Math.max(f,c[r])}function VHt(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function WHt(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,s=e.position,a=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,f;return o.height>0&&o.width>0&&n?(d=Nwe({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:s,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=Nwe({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:s,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=VHt({translateX:d,translateY:f,useTranslate3d:l})):u=zHt,{cssProperties:u,cssClasses:HHt({translateX:d,translateY:f,coordinate:n})}}function CN(e){"@babel/helpers - typeof";return CN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},CN(e)}function Awe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function jwe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Awe(Object(n),!0).forEach(function(r){vte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Awe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qHt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function GHt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ZDe(r.key),r)}}function KHt(e,t,n){return GHt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function YHt(e,t,n){return t=ZR(t),XHt(e,QDe()?Reflect.construct(t,n,ZR(e).constructor):t.apply(e,n))}function XHt(e,t){if(t&&(CN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return QHt(e)}function QHt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function QDe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(QDe=function(){return!!e})()}function ZR(e){return ZR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ZR(e)}function ZHt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yte(e,t)}function yte(e,t){return yte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},yte(e,t)}function vte(e,t,n){return t=ZDe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZDe(e){var t=JHt(e,"string");return CN(t)=="symbol"?t:t+""}function JHt(e,t){if(CN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(CN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ewe=1,eVt=function(e){function t(){var n;qHt(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=YHt(this,t,[].concat(s)),vte(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),vte(n,"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,u,d;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=n.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(d=n.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),n}return ZHt(t,e),KHt(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>Ewe||Math.abs(r.height-this.state.lastBoundingBox.height)>Ewe)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,s;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((s=this.props.coordinate)===null||s===void 0?void 0:s.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,s=this.props,a=s.active,o=s.allowEscapeViewBox,l=s.animationDuration,c=s.animationEasing,u=s.children,d=s.coordinate,f=s.hasPayload,x=s.isAnimationActive,g=s.offset,v=s.position,w=s.reverseDirection,C=s.useTranslate3d,N=s.viewBox,I=s.wrapperStyle,P=WHt({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:g,position:v,reverseDirection:w,tooltipBox:this.state.lastBoundingBox,useTranslate3d:C,viewBox:N}),R=P.cssClasses,F=P.cssProperties,U=jwe(jwe({transition:x&&a?"transform ".concat(l,"ms ").concat(c):void 0},F),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},I);return Se.createElement("div",{tabIndex:-1,className:R,style:U,ref:function(z){r.wrapperNode=z}},u)}}])}(m.PureComponent),tVt=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},am={isSsr:tVt(),get:function(t){return am[t]},set:function(t,n){if(typeof t=="string")am[t]=n;else{var r=Object.keys(t);r&&r.length&&r.forEach(function(s){am[s]=t[s]})}}};function SN(e){"@babel/helpers - typeof";return SN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},SN(e)}function _we(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function kwe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_we(Object(n),!0).forEach(function(r){qle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_we(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nVt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rVt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eBe(r.key),r)}}function sVt(e,t,n){return rVt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function iVt(e,t,n){return t=JR(t),aVt(e,JDe()?Reflect.construct(t,n||[],JR(e).constructor):t.apply(e,n))}function aVt(e,t){if(t&&(SN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oVt(e)}function oVt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function JDe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(JDe=function(){return!!e})()}function JR(e){return JR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},JR(e)}function lVt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wte(e,t)}function wte(e,t){return wte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},wte(e,t)}function qle(e,t,n){return t=eBe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eBe(e){var t=cVt(e,"string");return SN(t)=="symbol"?t:t+""}function cVt(e,t){if(SN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(SN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uVt(e){return e.dataKey}function dVt(e,t){return Se.isValidElement(e)?Se.cloneElement(e,t):typeof e=="function"?Se.createElement(e,t):Se.createElement(BHt,t)}var zp=function(e){function t(){return nVt(this,t),iVt(this,t,arguments)}return lVt(t,e),sVt(t,[{key:"render",value:function(){var r=this,s=this.props,a=s.active,o=s.allowEscapeViewBox,l=s.animationDuration,c=s.animationEasing,u=s.content,d=s.coordinate,f=s.filterNull,x=s.isAnimationActive,g=s.offset,v=s.payload,w=s.payloadUniqBy,C=s.position,N=s.reverseDirection,I=s.useTranslate3d,P=s.viewBox,R=s.wrapperStyle,F=v??[];f&&F.length&&(F=VDe(v.filter(function(L){return L.value!=null&&(L.hide!==!0||r.props.includeHidden)}),w,uVt));var U=F.length>0;return Se.createElement(eVt,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:x,active:a,coordinate:d,hasPayload:U,offset:g,position:C,reverseDirection:N,useTranslate3d:I,viewBox:P,wrapperStyle:R},dVt(u,kwe(kwe({},this.props),{},{payload:F})))}}])}(m.PureComponent);qle(zp,"displayName","Tooltip");qle(zp,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!am.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var LK,Twe;function fVt(){if(Twe)return LK;Twe=1;var e=lx(),t=function(){return e.Date.now()};return LK=t,LK}var DK,Iwe;function hVt(){if(Iwe)return DK;Iwe=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return DK=t,DK}var BK,Pwe;function pVt(){if(Pwe)return BK;Pwe=1;var e=hVt(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return BK=n,BK}var $K,Fwe;function tBe(){if(Fwe)return $K;Fwe=1;var e=pVt(),t=u2(),n=qA(),r=NaN,s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,l=parseInt;function c(u){if(typeof u=="number")return u;if(n(u))return r;if(t(u)){var d=typeof u.valueOf=="function"?u.valueOf():u;u=t(d)?d+"":d}if(typeof u!="string")return u===0?u:+u;u=e(u);var f=a.test(u);return f||o.test(u)?l(u.slice(2),f?2:8):s.test(u)?r:+u}return $K=c,$K}var UK,Owe;function nBe(){if(Owe)return UK;Owe=1;var e=u2(),t=fVt(),n=tBe(),r="Expected a function",s=Math.max,a=Math.min;function o(l,c,u){var d,f,x,g,v,w,C=0,N=!1,I=!1,P=!0;if(typeof l!="function")throw new TypeError(r);c=n(c)||0,e(u)&&(N=!!u.leading,I="maxWait"in u,x=I?s(n(u.maxWait)||0,c):x,P="trailing"in u?!!u.trailing:P);function R(re){var he=d,Y=f;return d=f=void 0,C=re,g=l.apply(Y,he),g}function F(re){return C=re,v=setTimeout(z,c),N?R(re):g}function U(re){var he=re-w,Y=re-C,ie=c-he;return I?a(ie,x-Y):ie}function L(re){var he=re-w,Y=re-C;return w===void 0||he>=c||he<0||I&&Y>=x}function z(){var re=t();if(L(re))return X(re);v=setTimeout(z,U(re))}function X(re){return v=void 0,P&&d?R(re):(d=f=void 0,g)}function ne(){v!==void 0&&clearTimeout(v),C=0,d=w=f=v=void 0}function J(){return v===void 0?g:X(t())}function Z(){var re=t(),he=L(re);if(d=arguments,f=this,w=re,he){if(v===void 0)return F(w);if(I)return clearTimeout(v),v=setTimeout(z,c),R(w)}return v===void 0&&(v=setTimeout(z,c)),g}return Z.cancel=ne,Z.flush=J,Z}return UK=o,UK}var zK,Mwe;function mVt(){if(Mwe)return zK;Mwe=1;var e=nBe(),t=u2(),n="Expected a function";function r(s,a,o){var l=!0,c=!0;if(typeof s!="function")throw new TypeError(n);return t(o)&&(l="leading"in o?!!o.leading:l,c="trailing"in o?!!o.trailing:c),e(s,a,{leading:l,maxWait:a,trailing:c})}return zK=r,zK}var xVt=mVt();const rBe=ji(xVt);function o_(e){"@babel/helpers - typeof";return o_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o_(e)}function Rwe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function AP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Rwe(Object(n),!0).forEach(function(r){gVt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rwe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gVt(e,t,n){return t=bVt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bVt(e){var t=yVt(e,"string");return o_(t)=="symbol"?t:t+""}function yVt(e,t){if(o_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(o_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vVt(e,t){return NVt(e)||SVt(e,t)||CVt(e,t)||wVt()}function wVt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CVt(e,t){if(e){if(typeof e=="string")return Lwe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lwe(e,t)}}function Lwe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function SVt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function NVt(e){if(Array.isArray(e))return e}var sBe=m.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,s=r===void 0?{width:-1,height:-1}:r,a=e.width,o=a===void 0?"100%":a,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,d=u===void 0?0:u,f=e.minHeight,x=e.maxHeight,g=e.children,v=e.debounce,w=v===void 0?0:v,C=e.id,N=e.className,I=e.onResize,P=e.style,R=P===void 0?{}:P,F=m.useRef(null),U=m.useRef();U.current=I,m.useImperativeHandle(t,function(){return Object.defineProperty(F.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),F.current},configurable:!0})});var L=m.useState({containerWidth:s.width,containerHeight:s.height}),z=vVt(L,2),X=z[0],ne=z[1],J=m.useCallback(function(re,he){ne(function(Y){var ie=Math.round(re),oe=Math.round(he);return Y.containerWidth===ie&&Y.containerHeight===oe?Y:{containerWidth:ie,containerHeight:oe}})},[]);m.useEffect(function(){var re=function(V){var ee,ae=V[0].contentRect,fe=ae.width,Ae=ae.height;J(fe,Ae),(ee=U.current)===null||ee===void 0||ee.call(U,fe,Ae)};w>0&&(re=rBe(re,w,{trailing:!0,leading:!1}));var he=new ResizeObserver(re),Y=F.current.getBoundingClientRect(),ie=Y.width,oe=Y.height;return J(ie,oe),he.observe(F.current),function(){he.disconnect()}},[J,w]);var Z=m.useMemo(function(){var re=X.containerWidth,he=X.containerHeight;if(re<0||he<0)return null;Wg(ew(o)||ew(c),`The width(%s) and height(%s) are both fixed numbers,
       maybe you don't need to use a ResponsiveContainer.`,o,c),Wg(!n||n>0,"The aspect(%s) must be greater than zero.",n);var Y=ew(o)?re:o,ie=ew(c)?he:c;n&&n>0&&(Y?ie=Y/n:ie&&(Y=ie*n),x&&ie>x&&(ie=x)),Wg(Y>0||ie>0,`The width(%s) and height(%s) of chart should be greater than 0,
       please check the style of container, or the props width(%s) and height(%s),
       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
       height and width.`,Y,ie,o,c,d,f,n);var oe=!Array.isArray(g)&&Vg(g.type).endsWith("Chart");return Se.Children.map(g,function(G){return Se.isValidElement(G)?m.cloneElement(G,AP({width:Y,height:ie},oe?{style:AP({height:"100%",width:"100%",maxHeight:ie,maxWidth:Y},G.props.style)}:{})):G})},[n,g,c,x,f,d,X,o]);return Se.createElement("div",{id:C?"".concat(C):void 0,className:ta("recharts-responsive-container",N),style:AP(AP({},R),{},{width:o,height:c,minWidth:d,minHeight:f,maxHeight:x}),ref:F},Z)}),Gle=function(t){return null};Gle.displayName="Cell";function l_(e){"@babel/helpers - typeof";return l_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l_(e)}function Dwe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Cte(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dwe(Object(n),!0).forEach(function(r){AVt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dwe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AVt(e,t,n){return t=jVt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jVt(e){var t=EVt(e,"string");return l_(t)=="symbol"?t:t+""}function EVt(e,t){if(l_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(l_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Z6={widthCache:{},cacheCount:0},_Vt=2e3,kVt={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Bwe="recharts_measurement_span";function TVt(e){var t=Cte({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var r9=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||am.isSsr)return{width:0,height:0};var r=TVt(n),s=JSON.stringify({text:t,copyStyle:r});if(Z6.widthCache[s])return Z6.widthCache[s];try{var a=document.getElementById(Bwe);a||(a=document.createElement("span"),a.setAttribute("id",Bwe),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=Cte(Cte({},kVt),r);Object.assign(a.style,o),a.textContent="".concat(t);var l=a.getBoundingClientRect(),c={width:l.width,height:l.height};return Z6.widthCache[s]=c,++Z6.cacheCount>_Vt&&(Z6.cacheCount=0,Z6.widthCache={}),c}catch{return{width:0,height:0}}},IVt=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function c_(e){"@babel/helpers - typeof";return c_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c_(e)}function eL(e,t){return MVt(e)||OVt(e,t)||FVt(e,t)||PVt()}function PVt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FVt(e,t){if(e){if(typeof e=="string")return $we(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $we(e,t)}}function $we(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function OVt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function MVt(e){if(Array.isArray(e))return e}function RVt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Uwe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,DVt(r.key),r)}}function LVt(e,t,n){return Uwe(e.prototype,t),Uwe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function DVt(e){var t=BVt(e,"string");return c_(t)=="symbol"?t:t+""}function BVt(e,t){if(c_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(c_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var zwe=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Hwe=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,$Vt=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,UVt=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,iBe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},zVt=Object.keys(iBe),LC="NaN";function HVt(e,t){return e*iBe[t]}var jP=function(){function e(t,n){RVt(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!$Vt.test(n)&&(this.num=NaN,this.unit=""),zVt.includes(n)&&(this.num=HVt(t,n),this.unit="px")}return LVt(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,s=(r=UVt.exec(n))!==null&&r!==void 0?r:[],a=eL(s,3),o=a[1],l=a[2];return new e(parseFloat(o),l??"")}}])}();function aBe(e){if(e.includes(LC))return LC;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=zwe.exec(t))!==null&&n!==void 0?n:[],s=eL(r,4),a=s[1],o=s[2],l=s[3],c=jP.parse(a??""),u=jP.parse(l??""),d=o==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return LC;t=t.replace(zwe,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,x=(f=Hwe.exec(t))!==null&&f!==void 0?f:[],g=eL(x,4),v=g[1],w=g[2],C=g[3],N=jP.parse(v??""),I=jP.parse(C??""),P=w==="+"?N.add(I):N.subtract(I);if(P.isNaN())return LC;t=t.replace(Hwe,P.toString())}return t}var Vwe=/\(([^()]*)\)/;function VVt(e){for(var t=e;t.includes("(");){var n=Vwe.exec(t),r=eL(n,2),s=r[1];t=t.replace(Vwe,aBe(s))}return t}function WVt(e){var t=e.replace(/\s+/g,"");return t=VVt(t),t=aBe(t),t}function qVt(e){try{return WVt(e)}catch{return LC}}function HK(e){var t=qVt(e.slice(5,-1));return t===LC?"":t}var GVt=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],KVt=["dx","dy","angle","className","breakAll"];function Ste(){return Ste=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ste.apply(this,arguments)}function Wwe(e,t){if(e==null)return{};var n=YVt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function YVt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function qwe(e,t){return JVt(e)||ZVt(e,t)||QVt(e,t)||XVt()}function XVt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QVt(e,t){if(e){if(typeof e=="string")return Gwe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gwe(e,t)}}function Gwe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ZVt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function JVt(e){if(Array.isArray(e))return e}var oBe=/[ \f\n\r\t\v\u2028\u2029]+/,lBe=function(t){var n=t.children,r=t.breakAll,s=t.style;try{var a=[];xi(n)||(r?a=n.toString().split(""):a=n.toString().split(oBe));var o=a.map(function(c){return{word:c,width:r9(c,s).width}}),l=r?0:r9(" ",s).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},eWt=function(t,n,r,s,a){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=Xr(o),f=l,x=function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Y.reduce(function(ie,oe){var G=oe.word,V=oe.width,ee=ie[ie.length-1];if(ee&&(s==null||a||ee.width+V+r<Number(s)))ee.words.push(G),ee.width+=V+r;else{var ae={words:[G],width:V};ie.push(ae)}return ie},[])},g=x(n),v=function(Y){return Y.reduce(function(ie,oe){return ie.width>oe.width?ie:oe})};if(!d)return g;for(var w="…",C=function(Y){var ie=f.slice(0,Y),oe=lBe({breakAll:u,style:c,children:ie+w}).wordsWithComputedWidth,G=x(oe),V=G.length>o||v(G).width>Number(s);return[V,G]},N=0,I=f.length-1,P=0,R;N<=I&&P<=f.length-1;){var F=Math.floor((N+I)/2),U=F-1,L=C(U),z=qwe(L,2),X=z[0],ne=z[1],J=C(F),Z=qwe(J,1),re=Z[0];if(!X&&!re&&(N=F+1),X&&re&&(I=F-1),!X&&re){R=ne;break}P++}return R||g},Kwe=function(t){var n=xi(t)?[]:t.toString().split(oBe);return[{words:n}]},tWt=function(t){var n=t.width,r=t.scaleToFit,s=t.children,a=t.style,o=t.breakAll,l=t.maxLines;if((n||r)&&!am.isSsr){var c,u,d=lBe({breakAll:o,children:s,style:a});if(d){var f=d.wordsWithComputedWidth,x=d.spaceWidth;c=f,u=x}else return Kwe(s);return eWt({breakAll:o,children:s,maxLines:l,style:a},c,u,n,r)}return Kwe(s)},Ywe="#808080",tL=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,a=s===void 0?0:s,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,f=d===void 0?!1:d,x=t.textAnchor,g=x===void 0?"start":x,v=t.verticalAnchor,w=v===void 0?"end":v,C=t.fill,N=C===void 0?Ywe:C,I=Wwe(t,GVt),P=m.useMemo(function(){return tWt({breakAll:I.breakAll,children:I.children,maxLines:I.maxLines,scaleToFit:f,style:I.style,width:I.width})},[I.breakAll,I.children,I.maxLines,f,I.style,I.width]),R=I.dx,F=I.dy,U=I.angle,L=I.className,z=I.breakAll,X=Wwe(I,KVt);if(!Xl(r)||!Xl(a))return null;var ne=r+(Xr(R)?R:0),J=a+(Xr(F)?F:0),Z;switch(w){case"start":Z=HK("calc(".concat(u,")"));break;case"middle":Z=HK("calc(".concat((P.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:Z=HK("calc(".concat(P.length-1," * -").concat(l,")"));break}var re=[];if(f){var he=P[0].width,Y=I.width;re.push("scale(".concat((Xr(Y)?Y/he:1)/he,")"))}return U&&re.push("rotate(".concat(U,", ").concat(ne,", ").concat(J,")")),re.length&&(X.transform=re.join(" ")),Se.createElement("text",Ste({},mi(X,!0),{x:ne,y:J,className:ta("recharts-text",L),textAnchor:g,fill:N.includes("url")?Ywe:N}),P.map(function(ie,oe){var G=ie.words.join(z?"":" ");return Se.createElement("tspan",{x:ne,dy:oe===0?Z:l,key:"".concat(G,"-").concat(oe)},G)}))};function Ay(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function nWt(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Kle(e){let t,n,r;e.length!==2?(t=Ay,n=(l,c)=>Ay(e(l),c),r=(l,c)=>e(l)-c):(t=e===Ay||e===nWt?e:rWt,n=e,r=e);function s(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(l[f],c)<0?u=f+1:d=f}while(u<d)}return u}function a(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function o(l,c,u=0,d=l.length){const f=s(l,c,u,d-1);return f>u&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:s,center:o,right:a}}function rWt(){return 0}function cBe(e){return e===null?NaN:+e}function*sWt(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const iWt=Kle(Ay),cT=iWt.right;Kle(cBe).center;class Xwe extends Map{constructor(t,n=lWt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,s]of t)this.set(r,s)}get(t){return super.get(Qwe(this,t))}has(t){return super.has(Qwe(this,t))}set(t,n){return super.set(aWt(this,t),n)}delete(t){return super.delete(oWt(this,t))}}function Qwe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function aWt({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function oWt({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function lWt(e){return e!==null&&typeof e=="object"?e.valueOf():e}function cWt(e=Ay){if(e===Ay)return uBe;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function uBe(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const uWt=Math.sqrt(50),dWt=Math.sqrt(10),fWt=Math.sqrt(2);function nL(e,t,n){const r=(t-e)/Math.max(0,n),s=Math.floor(Math.log10(r)),a=r/Math.pow(10,s),o=a>=uWt?10:a>=dWt?5:a>=fWt?2:1;let l,c,u;return s<0?(u=Math.pow(10,-s)/o,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,s)*o,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=n&&n<2?nL(e,t,n*2):[l,c,u]}function Nte(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[s,a,o]=r?nL(t,e,n):nL(e,t,n);if(!(a>=s))return[];const l=a-s+1,c=new Array(l);if(r)if(o<0)for(let u=0;u<l;++u)c[u]=(a-u)/-o;else for(let u=0;u<l;++u)c[u]=(a-u)*o;else if(o<0)for(let u=0;u<l;++u)c[u]=(s+u)/-o;else for(let u=0;u<l;++u)c[u]=(s+u)*o;return c}function Ate(e,t,n){return t=+t,e=+e,n=+n,nL(e,t,n)[2]}function jte(e,t,n){t=+t,e=+e,n=+n;const r=t<e,s=r?Ate(t,e,n):Ate(e,t,n);return(r?-1:1)*(s<0?1/-s:s)}function Zwe(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function Jwe(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function dBe(e,t,n=0,r=1/0,s){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(s=s===void 0?uBe:cWt(s);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,d=Math.log(c),f=.5*Math.exp(2*d/3),x=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),g=Math.max(n,Math.floor(t-u*f/c+x)),v=Math.min(r,Math.floor(t+(c-u)*f/c+x));dBe(e,t,g,v,s)}const a=e[t];let o=n,l=r;for(O7(e,n,t),s(e[r],a)>0&&O7(e,n,r);o<l;){for(O7(e,o,l),++o,--l;s(e[o],a)<0;)++o;for(;s(e[l],a)>0;)--l}s(e[n],a)===0?O7(e,n,l):(++l,O7(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function O7(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function hWt(e,t,n){if(e=Float64Array.from(sWt(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Jwe(e);if(t>=1)return Zwe(e);var r,s=(r-1)*t,a=Math.floor(s),o=Zwe(dBe(e,a).subarray(0,a+1)),l=Jwe(e.subarray(a+1));return o+(l-o)*(s-a)}}function pWt(e,t,n=cBe){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,s=(r-1)*t,a=Math.floor(s),o=+n(e[a],a,e),l=+n(e[a+1],a+1,e);return o+(l-o)*(s-a)}}function mWt(e,t,n){e=+e,t=+t,n=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+n;for(var r=-1,s=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(s);++r<s;)a[r]=e+r*n;return a}function op(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function A1(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const Ete=Symbol("implicit");function Yle(){var e=new Xwe,t=[],n=[],r=Ete;function s(a){let o=e.get(a);if(o===void 0){if(r!==Ete)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return s.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new Xwe;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return s},s.range=function(a){return arguments.length?(n=Array.from(a),s):n.slice()},s.unknown=function(a){return arguments.length?(r=a,s):r},s.copy=function(){return Yle(t,n).unknown(r)},op.apply(s,arguments),s}function u_(){var e=Yle().unknown(void 0),t=e.domain,n=e.range,r=0,s=1,a,o,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var x=t().length,g=s<r,v=g?s:r,w=g?r:s;a=(w-v)/Math.max(1,x-c+u*2),l&&(a=Math.floor(a)),v+=(w-v-a*(x-c))*d,o=a*(1-c),l&&(v=Math.round(v),o=Math.round(o));var C=mWt(x).map(function(N){return v+a*N});return n(g?C.reverse():C)}return e.domain=function(x){return arguments.length?(t(x),f()):t()},e.range=function(x){return arguments.length?([r,s]=x,r=+r,s=+s,f()):[r,s]},e.rangeRound=function(x){return[r,s]=x,r=+r,s=+s,l=!0,f()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(x){return arguments.length?(l=!!x,f()):l},e.padding=function(x){return arguments.length?(c=Math.min(1,u=+x),f()):c},e.paddingInner=function(x){return arguments.length?(c=Math.min(1,x),f()):c},e.paddingOuter=function(x){return arguments.length?(u=+x,f()):u},e.align=function(x){return arguments.length?(d=Math.max(0,Math.min(1,x)),f()):d},e.copy=function(){return u_(t(),[r,s]).round(l).paddingInner(c).paddingOuter(u).align(d)},op.apply(f(),arguments)}function fBe(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return fBe(t())},e}function s9(){return fBe(u_.apply(null,arguments).paddingInner(1))}function Xle(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function hBe(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function uT(){}var d_=.7,rL=1/d_,f4="\\s*([+-]?\\d+)\\s*",f_="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",R0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",xWt=/^#([0-9a-f]{3,8})$/,gWt=new RegExp(`^rgb\\(${f4},${f4},${f4}\\)$`),bWt=new RegExp(`^rgb\\(${R0},${R0},${R0}\\)$`),yWt=new RegExp(`^rgba\\(${f4},${f4},${f4},${f_}\\)$`),vWt=new RegExp(`^rgba\\(${R0},${R0},${R0},${f_}\\)$`),wWt=new RegExp(`^hsl\\(${f_},${R0},${R0}\\)$`),CWt=new RegExp(`^hsla\\(${f_},${R0},${R0},${f_}\\)$`),e3e={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Xle(uT,h_,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:t3e,formatHex:t3e,formatHex8:SWt,formatHsl:NWt,formatRgb:n3e,toString:n3e});function t3e(){return this.rgb().formatHex()}function SWt(){return this.rgb().formatHex8()}function NWt(){return pBe(this).formatHsl()}function n3e(){return this.rgb().formatRgb()}function h_(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=xWt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?r3e(t):n===3?new Wd(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?EP(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?EP(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=gWt.exec(e))?new Wd(t[1],t[2],t[3],1):(t=bWt.exec(e))?new Wd(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=yWt.exec(e))?EP(t[1],t[2],t[3],t[4]):(t=vWt.exec(e))?EP(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=wWt.exec(e))?a3e(t[1],t[2]/100,t[3]/100,1):(t=CWt.exec(e))?a3e(t[1],t[2]/100,t[3]/100,t[4]):e3e.hasOwnProperty(e)?r3e(e3e[e]):e==="transparent"?new Wd(NaN,NaN,NaN,0):null}function r3e(e){return new Wd(e>>16&255,e>>8&255,e&255,1)}function EP(e,t,n,r){return r<=0&&(e=t=n=NaN),new Wd(e,t,n,r)}function AWt(e){return e instanceof uT||(e=h_(e)),e?(e=e.rgb(),new Wd(e.r,e.g,e.b,e.opacity)):new Wd}function _te(e,t,n,r){return arguments.length===1?AWt(e):new Wd(e,t,n,r??1)}function Wd(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Xle(Wd,_te,hBe(uT,{brighter(e){return e=e==null?rL:Math.pow(rL,e),new Wd(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?d_:Math.pow(d_,e),new Wd(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Wd(r3(this.r),r3(this.g),r3(this.b),sL(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:s3e,formatHex:s3e,formatHex8:jWt,formatRgb:i3e,toString:i3e}));function s3e(){return`#${tw(this.r)}${tw(this.g)}${tw(this.b)}`}function jWt(){return`#${tw(this.r)}${tw(this.g)}${tw(this.b)}${tw((isNaN(this.opacity)?1:this.opacity)*255)}`}function i3e(){const e=sL(this.opacity);return`${e===1?"rgb(":"rgba("}${r3(this.r)}, ${r3(this.g)}, ${r3(this.b)}${e===1?")":`, ${e})`}`}function sL(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function r3(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function tw(e){return e=r3(e),(e<16?"0":"")+e.toString(16)}function a3e(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Xp(e,t,n,r)}function pBe(e){if(e instanceof Xp)return new Xp(e.h,e.s,e.l,e.opacity);if(e instanceof uT||(e=h_(e)),!e)return new Xp;if(e instanceof Xp)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,l=a-s,c=(a+s)/2;return l?(t===a?o=(n-r)/l+(n<r)*6:n===a?o=(r-t)/l+2:o=(t-n)/l+4,l/=c<.5?a+s:2-a-s,o*=60):l=c>0&&c<1?0:o,new Xp(o,l,c,e.opacity)}function EWt(e,t,n,r){return arguments.length===1?pBe(e):new Xp(e,t,n,r??1)}function Xp(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Xle(Xp,EWt,hBe(uT,{brighter(e){return e=e==null?rL:Math.pow(rL,e),new Xp(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?d_:Math.pow(d_,e),new Xp(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new Wd(VK(e>=240?e-240:e+120,s,r),VK(e,s,r),VK(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Xp(o3e(this.h),_P(this.s),_P(this.l),sL(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=sL(this.opacity);return`${e===1?"hsl(":"hsla("}${o3e(this.h)}, ${_P(this.s)*100}%, ${_P(this.l)*100}%${e===1?")":`, ${e})`}`}}));function o3e(e){return e=(e||0)%360,e<0?e+360:e}function _P(e){return Math.max(0,Math.min(1,e||0))}function VK(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Qle=e=>()=>e;function _Wt(e,t){return function(n){return e+n*t}}function kWt(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function TWt(e){return(e=+e)==1?mBe:function(t,n){return n-t?kWt(t,n,e):Qle(isNaN(t)?n:t)}}function mBe(e,t){var n=t-e;return n?_Wt(e,n):Qle(isNaN(e)?t:e)}const l3e=function e(t){var n=TWt(t);function r(s,a){var o=n((s=_te(s)).r,(a=_te(a)).r),l=n(s.g,a.g),c=n(s.b,a.b),u=mBe(s.opacity,a.opacity);return function(d){return s.r=o(d),s.g=l(d),s.b=c(d),s.opacity=u(d),s+""}}return r.gamma=e,r}(1);function IWt(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(a){for(s=0;s<n;++s)r[s]=e[s]*(1-a)+t[s]*a;return r}}function PWt(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function FWt(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)s[o]=XA(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(l){for(o=0;o<r;++o)a[o]=s[o](l);return a}}function OWt(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function iL(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function MWt(e,t){var n={},r={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=XA(e[s],t[s]):r[s]=t[s];return function(a){for(s in n)r[s]=n[s](a);return r}}var kte=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,WK=new RegExp(kte.source,"g");function RWt(e){return function(){return e}}function LWt(e){return function(t){return e(t)+""}}function DWt(e,t){var n=kte.lastIndex=WK.lastIndex=0,r,s,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=kte.exec(e))&&(s=WK.exec(t));)(a=s.index)>n&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(s=s[0])?l[o]?l[o]+=s:l[++o]=s:(l[++o]=null,c.push({i:o,x:iL(r,s)})),n=WK.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?LWt(c[0].x):RWt(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)l[(f=c[d]).i]=f.x(u);return l.join("")})}function XA(e,t){var n=typeof t,r;return t==null||n==="boolean"?Qle(t):(n==="number"?iL:n==="string"?(r=h_(t))?(t=r,l3e):DWt:t instanceof h_?l3e:t instanceof Date?OWt:PWt(t)?IWt:Array.isArray(t)?FWt:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?MWt:iL)(e,t)}function Zle(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function BWt(e,t){t===void 0&&(t=e,e=XA);for(var n=0,r=t.length-1,s=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(s,s=t[++n]);return function(o){var l=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[l](o-l)}}function $Wt(e){return function(){return e}}function aL(e){return+e}var c3e=[0,1];function nd(e){return e}function Tte(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:$Wt(isNaN(t)?NaN:.5)}function UWt(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function zWt(e,t,n){var r=e[0],s=e[1],a=t[0],o=t[1];return s<r?(r=Tte(s,r),a=n(o,a)):(r=Tte(r,s),a=n(a,o)),function(l){return a(r(l))}}function HWt(e,t,n){var r=Math.min(e.length,t.length)-1,s=new Array(r),a=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)s[o]=Tte(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(l){var c=cT(e,l,1,r)-1;return a[c](s[c](l))}}function dT(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function H$(){var e=c3e,t=c3e,n=XA,r,s,a,o=nd,l,c,u;function d(){var x=Math.min(e.length,t.length);return o!==nd&&(o=UWt(e[0],e[x-1])),l=x>2?HWt:zWt,c=u=null,f}function f(x){return x==null||isNaN(x=+x)?a:(c||(c=l(e.map(r),t,n)))(r(o(x)))}return f.invert=function(x){return o(s((u||(u=l(t,e.map(r),iL)))(x)))},f.domain=function(x){return arguments.length?(e=Array.from(x,aL),d()):e.slice()},f.range=function(x){return arguments.length?(t=Array.from(x),d()):t.slice()},f.rangeRound=function(x){return t=Array.from(x),n=Zle,d()},f.clamp=function(x){return arguments.length?(o=x?!0:nd,d()):o!==nd},f.interpolate=function(x){return arguments.length?(n=x,d()):n},f.unknown=function(x){return arguments.length?(a=x,f):a},function(x,g){return r=x,s=g,d()}}function Jle(){return H$()(nd,nd)}function VWt(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function oL(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function NN(e){return e=oL(Math.abs(e)),e?e[1]:NaN}function WWt(e,t){return function(n,r){for(var s=n.length,a=[],o=0,l=e[0],c=0;s>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),a.push(n.substring(s-=l,s+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return a.reverse().join(t)}}function qWt(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var GWt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function p_(e){if(!(t=GWt.exec(e)))throw new Error("invalid format: "+e);var t;return new ece({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}p_.prototype=ece.prototype;function ece(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}ece.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function KWt(e){e:for(var t=e.length,n=1,r=-1,s;n<t;++n)switch(e[n]){case".":r=s=n;break;case"0":r===0&&(r=n),s=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(s+1):e}var xBe;function YWt(e,t){var n=oL(e,t);if(!n)return e+"";var r=n[0],s=n[1],a=s-(xBe=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+oL(e,Math.max(0,t+a-1))[0]}function u3e(e,t){var n=oL(e,t);if(!n)return e+"";var r=n[0],s=n[1];return s<0?"0."+new Array(-s).join("0")+r:r.length>s+1?r.slice(0,s+1)+"."+r.slice(s+1):r+new Array(s-r.length+2).join("0")}const d3e={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:VWt,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>u3e(e*100,t),r:u3e,s:YWt,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function f3e(e){return e}var h3e=Array.prototype.map,p3e=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function XWt(e){var t=e.grouping===void 0||e.thousands===void 0?f3e:WWt(h3e.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?f3e:qWt(h3e.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f){f=p_(f);var x=f.fill,g=f.align,v=f.sign,w=f.symbol,C=f.zero,N=f.width,I=f.comma,P=f.precision,R=f.trim,F=f.type;F==="n"?(I=!0,F="g"):d3e[F]||(P===void 0&&(P=12),R=!0,F="g"),(C||x==="0"&&g==="=")&&(C=!0,x="0",g="=");var U=w==="$"?n:w==="#"&&/[boxX]/.test(F)?"0"+F.toLowerCase():"",L=w==="$"?r:/[%p]/.test(F)?o:"",z=d3e[F],X=/[defgprs%]/.test(F);P=P===void 0?6:/[gprs]/.test(F)?Math.max(1,Math.min(21,P)):Math.max(0,Math.min(20,P));function ne(J){var Z=U,re=L,he,Y,ie;if(F==="c")re=z(J)+re,J="";else{J=+J;var oe=J<0||1/J<0;if(J=isNaN(J)?c:z(Math.abs(J),P),R&&(J=KWt(J)),oe&&+J==0&&v!=="+"&&(oe=!1),Z=(oe?v==="("?v:l:v==="-"||v==="("?"":v)+Z,re=(F==="s"?p3e[8+xBe/3]:"")+re+(oe&&v==="("?")":""),X){for(he=-1,Y=J.length;++he<Y;)if(ie=J.charCodeAt(he),48>ie||ie>57){re=(ie===46?s+J.slice(he+1):J.slice(he))+re,J=J.slice(0,he);break}}}I&&!C&&(J=t(J,1/0));var G=Z.length+J.length+re.length,V=G<N?new Array(N-G+1).join(x):"";switch(I&&C&&(J=t(V+J,V.length?N-re.length:1/0),V=""),g){case"<":J=Z+J+re+V;break;case"=":J=Z+V+J+re;break;case"^":J=V.slice(0,G=V.length>>1)+Z+J+re+V.slice(G);break;default:J=V+Z+J+re;break}return a(J)}return ne.toString=function(){return f+""},ne}function d(f,x){var g=u((f=p_(f),f.type="f",f)),v=Math.max(-8,Math.min(8,Math.floor(NN(x)/3)))*3,w=Math.pow(10,-v),C=p3e[8+v/3];return function(N){return g(w*N)+C}}return{format:u,formatPrefix:d}}var kP,tce,gBe;QWt({thousands:",",grouping:[3],currency:["$",""]});function QWt(e){return kP=XWt(e),tce=kP.format,gBe=kP.formatPrefix,kP}function ZWt(e){return Math.max(0,-NN(Math.abs(e)))}function JWt(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(NN(t)/3)))*3-NN(Math.abs(e)))}function eqt(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,NN(t)-NN(e))+1}function bBe(e,t,n,r){var s=jte(e,t,n),a;switch(r=p_(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=JWt(s,o))&&(r.precision=a),gBe(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=eqt(s,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=ZWt(s))&&(r.precision=a-(r.type==="%")*2);break}}return tce(r)}function f2(e){var t=e.domain;return e.ticks=function(n){var r=t();return Nte(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var s=t();return bBe(s[0],s[s.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),s=0,a=r.length-1,o=r[s],l=r[a],c,u,d=10;for(l<o&&(u=o,o=l,l=u,u=s,s=a,a=u);d-- >0;){if(u=Ate(o,l,n),u===c)return r[s]=o,r[a]=l,t(r);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function lL(){var e=Jle();return e.copy=function(){return dT(e,lL())},op.apply(e,arguments),f2(e)}function yBe(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,aL),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return yBe(e).unknown(t)},e=arguments.length?Array.from(e,aL):[0,1],f2(n)}function vBe(e,t){e=e.slice();var n=0,r=e.length-1,s=e[n],a=e[r],o;return a<s&&(o=n,n=r,r=o,o=s,s=a,a=o),e[n]=t.floor(s),e[r]=t.ceil(a),e}function m3e(e){return Math.log(e)}function x3e(e){return Math.exp(e)}function tqt(e){return-Math.log(-e)}function nqt(e){return-Math.exp(-e)}function rqt(e){return isFinite(e)?+("1e"+e):e<0?0:e}function sqt(e){return e===10?rqt:e===Math.E?Math.exp:t=>Math.pow(e,t)}function iqt(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function g3e(e){return(t,n)=>-e(-t,n)}function nce(e){const t=e(m3e,x3e),n=t.domain;let r=10,s,a;function o(){return s=iqt(r),a=sqt(r),n()[0]<0?(s=g3e(s),a=g3e(a),e(tqt,nqt)):e(m3e,x3e),t}return t.base=function(l){return arguments.length?(r=+l,o()):r},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const c=n();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let x=s(u),g=s(d),v,w;const C=l==null?10:+l;let N=[];if(!(r%1)&&g-x<C){if(x=Math.floor(x),g=Math.ceil(g),u>0){for(;x<=g;++x)for(v=1;v<r;++v)if(w=x<0?v/a(-x):v*a(x),!(w<u)){if(w>d)break;N.push(w)}}else for(;x<=g;++x)for(v=r-1;v>=1;--v)if(w=x>0?v/a(-x):v*a(x),!(w<u)){if(w>d)break;N.push(w)}N.length*2<C&&(N=Nte(u,d,C))}else N=Nte(x,g,Math.min(g-x,C)).map(a);return f?N.reverse():N},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=p_(c)).precision==null&&(c.trim=!0),c=tce(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return d=>{let f=d/a(Math.round(s(d)));return f*r<r-.5&&(f*=r),f<=u?c(d):""}},t.nice=()=>n(vBe(n(),{floor:l=>a(Math.floor(s(l))),ceil:l=>a(Math.ceil(s(l)))})),t}function wBe(){const e=nce(H$()).domain([1,10]);return e.copy=()=>dT(e,wBe()).base(e.base()),op.apply(e,arguments),e}function b3e(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function y3e(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function rce(e){var t=1,n=e(b3e(t),y3e(t));return n.constant=function(r){return arguments.length?e(b3e(t=+r),y3e(t)):t},f2(n)}function CBe(){var e=rce(H$());return e.copy=function(){return dT(e,CBe()).constant(e.constant())},op.apply(e,arguments)}function v3e(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function aqt(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function oqt(e){return e<0?-e*e:e*e}function sce(e){var t=e(nd,nd),n=1;function r(){return n===1?e(nd,nd):n===.5?e(aqt,oqt):e(v3e(n),v3e(1/n))}return t.exponent=function(s){return arguments.length?(n=+s,r()):n},f2(t)}function ice(){var e=sce(H$());return e.copy=function(){return dT(e,ice()).exponent(e.exponent())},op.apply(e,arguments),e}function lqt(){return ice.apply(null,arguments).exponent(.5)}function w3e(e){return Math.sign(e)*e*e}function cqt(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function SBe(){var e=Jle(),t=[0,1],n=!1,r;function s(a){var o=cqt(e(a));return isNaN(o)?r:n?Math.round(o):o}return s.invert=function(a){return e.invert(w3e(a))},s.domain=function(a){return arguments.length?(e.domain(a),s):e.domain()},s.range=function(a){return arguments.length?(e.range((t=Array.from(a,aL)).map(w3e)),s):t.slice()},s.rangeRound=function(a){return s.range(a).round(!0)},s.round=function(a){return arguments.length?(n=!!a,s):n},s.clamp=function(a){return arguments.length?(e.clamp(a),s):e.clamp()},s.unknown=function(a){return arguments.length?(r=a,s):r},s.copy=function(){return SBe(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},op.apply(s,arguments),f2(s)}function NBe(){var e=[],t=[],n=[],r;function s(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o<l;)n[o-1]=pWt(e,o/l);return a}function a(o){return o==null||isNaN(o=+o)?r:t[cT(n,o)]}return a.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Ay),s()},a.range=function(o){return arguments.length?(t=Array.from(o),s()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return NBe().domain(e).range(t).unknown(r)},op.apply(a,arguments)}function ABe(){var e=0,t=1,n=1,r=[.5],s=[0,1],a;function o(c){return c!=null&&c<=c?s[cT(r,c,0,n)]:a}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(n=(s=Array.from(c)).length-1,l()):s.slice()},o.invertExtent=function(c){var u=s.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return ABe().domain([e,t]).range(s).unknown(a)},op.apply(f2(o),arguments)}function jBe(){var e=[.5],t=[0,1],n,r=1;function s(a){return a!=null&&a<=a?t[cT(e,a,0,r)]:n}return s.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},s.unknown=function(a){return arguments.length?(n=a,s):n},s.copy=function(){return jBe().domain(e).range(t).unknown(n)},op.apply(s,arguments)}const qK=new Date,GK=new Date;function rc(e,t,n,r){function s(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return s.floor=a=>(e(a=new Date(+a)),a),s.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),s.round=a=>{const o=s(a),l=s.ceil(a);return a-o<l-a?o:l},s.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),s.range=(a,o,l)=>{const c=[];if(a=s.ceil(a),l=l==null?1:Math.floor(l),!(a<o)||!(l>0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(u<a&&a<o);return c},s.filter=a=>rc(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!a(o););else for(;--l>=0;)for(;t(o,1),!a(o););}),n&&(s.count=(a,o)=>(qK.setTime(+a),GK.setTime(+o),e(qK),e(GK),Math.floor(n(qK,GK))),s.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?s.filter(r?o=>r(o)%a===0:o=>s.count(0,o)%a===0):s)),s}const cL=rc(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);cL.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?rc(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):cL);cL.range;const Pg=1e3,Wh=Pg*60,Fg=Wh*60,u1=Fg*24,ace=u1*7,C3e=u1*30,KK=u1*365,nw=rc(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Pg)},(e,t)=>(t-e)/Pg,e=>e.getUTCSeconds());nw.range;const oce=rc(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Pg)},(e,t)=>{e.setTime(+e+t*Wh)},(e,t)=>(t-e)/Wh,e=>e.getMinutes());oce.range;const lce=rc(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Wh)},(e,t)=>(t-e)/Wh,e=>e.getUTCMinutes());lce.range;const cce=rc(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Pg-e.getMinutes()*Wh)},(e,t)=>{e.setTime(+e+t*Fg)},(e,t)=>(t-e)/Fg,e=>e.getHours());cce.range;const uce=rc(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Fg)},(e,t)=>(t-e)/Fg,e=>e.getUTCHours());uce.range;const fT=rc(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Wh)/u1,e=>e.getDate()-1);fT.range;const V$=rc(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/u1,e=>e.getUTCDate()-1);V$.range;const EBe=rc(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/u1,e=>Math.floor(e/u1));EBe.range;function v5(e){return rc(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Wh)/ace)}const W$=v5(0),uL=v5(1),uqt=v5(2),dqt=v5(3),AN=v5(4),fqt=v5(5),hqt=v5(6);W$.range;uL.range;uqt.range;dqt.range;AN.range;fqt.range;hqt.range;function w5(e){return rc(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/ace)}const q$=w5(0),dL=w5(1),pqt=w5(2),mqt=w5(3),jN=w5(4),xqt=w5(5),gqt=w5(6);q$.range;dL.range;pqt.range;mqt.range;jN.range;xqt.range;gqt.range;const dce=rc(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());dce.range;const fce=rc(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());fce.range;const d1=rc(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());d1.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:rc(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});d1.range;const f1=rc(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());f1.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:rc(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});f1.range;function _Be(e,t,n,r,s,a){const o=[[nw,1,Pg],[nw,5,5*Pg],[nw,15,15*Pg],[nw,30,30*Pg],[a,1,Wh],[a,5,5*Wh],[a,15,15*Wh],[a,30,30*Wh],[s,1,Fg],[s,3,3*Fg],[s,6,6*Fg],[s,12,12*Fg],[r,1,u1],[r,2,2*u1],[n,1,ace],[t,1,C3e],[t,3,3*C3e],[e,1,KK]];function l(u,d,f){const x=d<u;x&&([u,d]=[d,u]);const g=f&&typeof f.range=="function"?f:c(u,d,f),v=g?g.range(u,+d+1):[];return x?v.reverse():v}function c(u,d,f){const x=Math.abs(d-u)/f,g=Kle(([,,C])=>C).right(o,x);if(g===o.length)return e.every(jte(u/KK,d/KK,f));if(g===0)return cL.every(Math.max(jte(u,d,f),1));const[v,w]=o[x/o[g-1][2]<o[g][2]/x?g-1:g];return v.every(w)}return[l,c]}const[bqt,yqt]=_Be(f1,fce,q$,EBe,uce,lce),[vqt,wqt]=_Be(d1,dce,W$,fT,cce,oce);function YK(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function XK(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function M7(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Cqt(e){var t=e.dateTime,n=e.date,r=e.time,s=e.periods,a=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,u=R7(s),d=L7(s),f=R7(a),x=L7(a),g=R7(o),v=L7(o),w=R7(l),C=L7(l),N=R7(c),I=L7(c),P={a:oe,A:G,b:V,B:ee,c:null,d:_3e,e:_3e,f:Wqt,g:tGt,G:rGt,H:zqt,I:Hqt,j:Vqt,L:kBe,m:qqt,M:Gqt,p:ae,q:fe,Q:I3e,s:P3e,S:Kqt,u:Yqt,U:Xqt,V:Qqt,w:Zqt,W:Jqt,x:null,X:null,y:eGt,Y:nGt,Z:sGt,"%":T3e},R={a:Ae,A:ce,b:ye,B:Ne,c:null,d:k3e,e:k3e,f:lGt,g:bGt,G:vGt,H:iGt,I:aGt,j:oGt,L:IBe,m:cGt,M:uGt,p:be,q:je,Q:I3e,s:P3e,S:dGt,u:fGt,U:hGt,V:pGt,w:mGt,W:xGt,x:null,X:null,y:gGt,Y:yGt,Z:wGt,"%":T3e},F={a:ne,A:J,b:Z,B:re,c:he,d:j3e,e:j3e,f:Dqt,g:A3e,G:N3e,H:E3e,I:E3e,j:Oqt,L:Lqt,m:Fqt,M:Mqt,p:X,q:Pqt,Q:$qt,s:Uqt,S:Rqt,u:Eqt,U:_qt,V:kqt,w:jqt,W:Tqt,x:Y,X:ie,y:A3e,Y:N3e,Z:Iqt,"%":Bqt};P.x=U(n,P),P.X=U(r,P),P.c=U(t,P),R.x=U(n,R),R.X=U(r,R),R.c=U(t,R);function U(Ie,Re){return function(Qe){var Be=[],it=-1,tt=0,at=Ie.length,dt,ct,Ut;for(Qe instanceof Date||(Qe=new Date(+Qe));++it<at;)Ie.charCodeAt(it)===37&&(Be.push(Ie.slice(tt,it)),(ct=S3e[dt=Ie.charAt(++it)])!=null?dt=Ie.charAt(++it):ct=dt==="e"?" ":"0",(Ut=Re[dt])&&(dt=Ut(Qe,ct)),Be.push(dt),tt=it+1);return Be.push(Ie.slice(tt,it)),Be.join("")}}function L(Ie,Re){return function(Qe){var Be=M7(1900,void 0,1),it=z(Be,Ie,Qe+="",0),tt,at;if(it!=Qe.length)return null;if("Q"in Be)return new Date(Be.Q);if("s"in Be)return new Date(Be.s*1e3+("L"in Be?Be.L:0));if(Re&&!("Z"in Be)&&(Be.Z=0),"p"in Be&&(Be.H=Be.H%12+Be.p*12),Be.m===void 0&&(Be.m="q"in Be?Be.q:0),"V"in Be){if(Be.V<1||Be.V>53)return null;"w"in Be||(Be.w=1),"Z"in Be?(tt=XK(M7(Be.y,0,1)),at=tt.getUTCDay(),tt=at>4||at===0?dL.ceil(tt):dL(tt),tt=V$.offset(tt,(Be.V-1)*7),Be.y=tt.getUTCFullYear(),Be.m=tt.getUTCMonth(),Be.d=tt.getUTCDate()+(Be.w+6)%7):(tt=YK(M7(Be.y,0,1)),at=tt.getDay(),tt=at>4||at===0?uL.ceil(tt):uL(tt),tt=fT.offset(tt,(Be.V-1)*7),Be.y=tt.getFullYear(),Be.m=tt.getMonth(),Be.d=tt.getDate()+(Be.w+6)%7)}else("W"in Be||"U"in Be)&&("w"in Be||(Be.w="u"in Be?Be.u%7:"W"in Be?1:0),at="Z"in Be?XK(M7(Be.y,0,1)).getUTCDay():YK(M7(Be.y,0,1)).getDay(),Be.m=0,Be.d="W"in Be?(Be.w+6)%7+Be.W*7-(at+5)%7:Be.w+Be.U*7-(at+6)%7);return"Z"in Be?(Be.H+=Be.Z/100|0,Be.M+=Be.Z%100,XK(Be)):YK(Be)}}function z(Ie,Re,Qe,Be){for(var it=0,tt=Re.length,at=Qe.length,dt,ct;it<tt;){if(Be>=at)return-1;if(dt=Re.charCodeAt(it++),dt===37){if(dt=Re.charAt(it++),ct=F[dt in S3e?Re.charAt(it++):dt],!ct||(Be=ct(Ie,Qe,Be))<0)return-1}else if(dt!=Qe.charCodeAt(Be++))return-1}return Be}function X(Ie,Re,Qe){var Be=u.exec(Re.slice(Qe));return Be?(Ie.p=d.get(Be[0].toLowerCase()),Qe+Be[0].length):-1}function ne(Ie,Re,Qe){var Be=g.exec(Re.slice(Qe));return Be?(Ie.w=v.get(Be[0].toLowerCase()),Qe+Be[0].length):-1}function J(Ie,Re,Qe){var Be=f.exec(Re.slice(Qe));return Be?(Ie.w=x.get(Be[0].toLowerCase()),Qe+Be[0].length):-1}function Z(Ie,Re,Qe){var Be=N.exec(Re.slice(Qe));return Be?(Ie.m=I.get(Be[0].toLowerCase()),Qe+Be[0].length):-1}function re(Ie,Re,Qe){var Be=w.exec(Re.slice(Qe));return Be?(Ie.m=C.get(Be[0].toLowerCase()),Qe+Be[0].length):-1}function he(Ie,Re,Qe){return z(Ie,t,Re,Qe)}function Y(Ie,Re,Qe){return z(Ie,n,Re,Qe)}function ie(Ie,Re,Qe){return z(Ie,r,Re,Qe)}function oe(Ie){return o[Ie.getDay()]}function G(Ie){return a[Ie.getDay()]}function V(Ie){return c[Ie.getMonth()]}function ee(Ie){return l[Ie.getMonth()]}function ae(Ie){return s[+(Ie.getHours()>=12)]}function fe(Ie){return 1+~~(Ie.getMonth()/3)}function Ae(Ie){return o[Ie.getUTCDay()]}function ce(Ie){return a[Ie.getUTCDay()]}function ye(Ie){return c[Ie.getUTCMonth()]}function Ne(Ie){return l[Ie.getUTCMonth()]}function be(Ie){return s[+(Ie.getUTCHours()>=12)]}function je(Ie){return 1+~~(Ie.getUTCMonth()/3)}return{format:function(Ie){var Re=U(Ie+="",P);return Re.toString=function(){return Ie},Re},parse:function(Ie){var Re=L(Ie+="",!1);return Re.toString=function(){return Ie},Re},utcFormat:function(Ie){var Re=U(Ie+="",R);return Re.toString=function(){return Ie},Re},utcParse:function(Ie){var Re=L(Ie+="",!0);return Re.toString=function(){return Ie},Re}}}var S3e={"-":"",_:" ",0:"0"},Pc=/^\s*\d+/,Sqt=/^%/,Nqt=/[\\^$*+?|[\]().{}]/g;function ma(e,t,n){var r=e<0?"-":"",s=(r?-e:e)+"",a=s.length;return r+(a<n?new Array(n-a+1).join(t)+s:s)}function Aqt(e){return e.replace(Nqt,"\\$&")}function R7(e){return new RegExp("^(?:"+e.map(Aqt).join("|")+")","i")}function L7(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function jqt(e,t,n){var r=Pc.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Eqt(e,t,n){var r=Pc.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function _qt(e,t,n){var r=Pc.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function kqt(e,t,n){var r=Pc.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Tqt(e,t,n){var r=Pc.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function N3e(e,t,n){var r=Pc.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function A3e(e,t,n){var r=Pc.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Iqt(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pqt(e,t,n){var r=Pc.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Fqt(e,t,n){var r=Pc.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function j3e(e,t,n){var r=Pc.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Oqt(e,t,n){var r=Pc.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function E3e(e,t,n){var r=Pc.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Mqt(e,t,n){var r=Pc.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Rqt(e,t,n){var r=Pc.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Lqt(e,t,n){var r=Pc.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Dqt(e,t,n){var r=Pc.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Bqt(e,t,n){var r=Sqt.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function $qt(e,t,n){var r=Pc.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Uqt(e,t,n){var r=Pc.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function _3e(e,t){return ma(e.getDate(),t,2)}function zqt(e,t){return ma(e.getHours(),t,2)}function Hqt(e,t){return ma(e.getHours()%12||12,t,2)}function Vqt(e,t){return ma(1+fT.count(d1(e),e),t,3)}function kBe(e,t){return ma(e.getMilliseconds(),t,3)}function Wqt(e,t){return kBe(e,t)+"000"}function qqt(e,t){return ma(e.getMonth()+1,t,2)}function Gqt(e,t){return ma(e.getMinutes(),t,2)}function Kqt(e,t){return ma(e.getSeconds(),t,2)}function Yqt(e){var t=e.getDay();return t===0?7:t}function Xqt(e,t){return ma(W$.count(d1(e)-1,e),t,2)}function TBe(e){var t=e.getDay();return t>=4||t===0?AN(e):AN.ceil(e)}function Qqt(e,t){return e=TBe(e),ma(AN.count(d1(e),e)+(d1(e).getDay()===4),t,2)}function Zqt(e){return e.getDay()}function Jqt(e,t){return ma(uL.count(d1(e)-1,e),t,2)}function eGt(e,t){return ma(e.getFullYear()%100,t,2)}function tGt(e,t){return e=TBe(e),ma(e.getFullYear()%100,t,2)}function nGt(e,t){return ma(e.getFullYear()%1e4,t,4)}function rGt(e,t){var n=e.getDay();return e=n>=4||n===0?AN(e):AN.ceil(e),ma(e.getFullYear()%1e4,t,4)}function sGt(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ma(t/60|0,"0",2)+ma(t%60,"0",2)}function k3e(e,t){return ma(e.getUTCDate(),t,2)}function iGt(e,t){return ma(e.getUTCHours(),t,2)}function aGt(e,t){return ma(e.getUTCHours()%12||12,t,2)}function oGt(e,t){return ma(1+V$.count(f1(e),e),t,3)}function IBe(e,t){return ma(e.getUTCMilliseconds(),t,3)}function lGt(e,t){return IBe(e,t)+"000"}function cGt(e,t){return ma(e.getUTCMonth()+1,t,2)}function uGt(e,t){return ma(e.getUTCMinutes(),t,2)}function dGt(e,t){return ma(e.getUTCSeconds(),t,2)}function fGt(e){var t=e.getUTCDay();return t===0?7:t}function hGt(e,t){return ma(q$.count(f1(e)-1,e),t,2)}function PBe(e){var t=e.getUTCDay();return t>=4||t===0?jN(e):jN.ceil(e)}function pGt(e,t){return e=PBe(e),ma(jN.count(f1(e),e)+(f1(e).getUTCDay()===4),t,2)}function mGt(e){return e.getUTCDay()}function xGt(e,t){return ma(dL.count(f1(e)-1,e),t,2)}function gGt(e,t){return ma(e.getUTCFullYear()%100,t,2)}function bGt(e,t){return e=PBe(e),ma(e.getUTCFullYear()%100,t,2)}function yGt(e,t){return ma(e.getUTCFullYear()%1e4,t,4)}function vGt(e,t){var n=e.getUTCDay();return e=n>=4||n===0?jN(e):jN.ceil(e),ma(e.getUTCFullYear()%1e4,t,4)}function wGt(){return"+0000"}function T3e(){return"%"}function I3e(e){return+e}function P3e(e){return Math.floor(+e/1e3)}var J6,FBe,OBe;CGt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function CGt(e){return J6=Cqt(e),FBe=J6.format,J6.parse,OBe=J6.utcFormat,J6.utcParse,J6}function SGt(e){return new Date(e)}function NGt(e){return e instanceof Date?+e:+new Date(+e)}function hce(e,t,n,r,s,a,o,l,c,u){var d=Jle(),f=d.invert,x=d.domain,g=u(".%L"),v=u(":%S"),w=u("%I:%M"),C=u("%I %p"),N=u("%a %d"),I=u("%b %d"),P=u("%B"),R=u("%Y");function F(U){return(c(U)<U?g:l(U)<U?v:o(U)<U?w:a(U)<U?C:r(U)<U?s(U)<U?N:I:n(U)<U?P:R)(U)}return d.invert=function(U){return new Date(f(U))},d.domain=function(U){return arguments.length?x(Array.from(U,NGt)):x().map(SGt)},d.ticks=function(U){var L=x();return e(L[0],L[L.length-1],U??10)},d.tickFormat=function(U,L){return L==null?F:u(L)},d.nice=function(U){var L=x();return(!U||typeof U.range!="function")&&(U=t(L[0],L[L.length-1],U??10)),U?x(vBe(L,U)):d},d.copy=function(){return dT(d,hce(e,t,n,r,s,a,o,l,c,u))},d}function AGt(){return op.apply(hce(vqt,wqt,d1,dce,W$,fT,cce,oce,nw,FBe).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function jGt(){return op.apply(hce(bqt,yqt,f1,fce,q$,V$,uce,lce,nw,OBe).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function G$(){var e=0,t=1,n,r,s,a,o=nd,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:o(s===0?.5:(f=(a(f)-n)*s,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,n=a(e=+e),r=a(t=+t),s=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(f){return arguments.length?(l=!!f,u):l},u.interpolator=function(f){return arguments.length?(o=f,u):o};function d(f){return function(x){var g,v;return arguments.length?([g,v]=x,o=f(g,v),u):[o(0),o(1)]}}return u.range=d(XA),u.rangeRound=d(Zle),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return a=f,n=f(e),r=f(t),s=n===r?0:1/(r-n),u}}function h2(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function MBe(){var e=f2(G$()(nd));return e.copy=function(){return h2(e,MBe())},A1.apply(e,arguments)}function RBe(){var e=nce(G$()).domain([1,10]);return e.copy=function(){return h2(e,RBe()).base(e.base())},A1.apply(e,arguments)}function LBe(){var e=rce(G$());return e.copy=function(){return h2(e,LBe()).constant(e.constant())},A1.apply(e,arguments)}function pce(){var e=sce(G$());return e.copy=function(){return h2(e,pce()).exponent(e.exponent())},A1.apply(e,arguments)}function EGt(){return pce.apply(null,arguments).exponent(.5)}function DBe(){var e=[],t=nd;function n(r){if(r!=null&&!isNaN(r=+r))return t((cT(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let s of r)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Ay),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,s)=>t(s/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(s,a)=>hWt(e,a/r))},n.copy=function(){return DBe(t).domain(e)},A1.apply(n,arguments)}function K$(){var e=0,t=.5,n=1,r=1,s,a,o,l,c,u=nd,d,f=!1,x;function g(w){return isNaN(w=+w)?x:(w=.5+((w=+d(w))-a)*(r*w<r*a?l:c),u(f?Math.max(0,Math.min(1,w)):w))}g.domain=function(w){return arguments.length?([e,t,n]=w,s=d(e=+e),a=d(t=+t),o=d(n=+n),l=s===a?0:.5/(a-s),c=a===o?0:.5/(o-a),r=a<s?-1:1,g):[e,t,n]},g.clamp=function(w){return arguments.length?(f=!!w,g):f},g.interpolator=function(w){return arguments.length?(u=w,g):u};function v(w){return function(C){var N,I,P;return arguments.length?([N,I,P]=C,u=BWt(w,[N,I,P]),g):[u(0),u(.5),u(1)]}}return g.range=v(XA),g.rangeRound=v(Zle),g.unknown=function(w){return arguments.length?(x=w,g):x},function(w){return d=w,s=w(e),a=w(t),o=w(n),l=s===a?0:.5/(a-s),c=a===o?0:.5/(o-a),r=a<s?-1:1,g}}function BBe(){var e=f2(K$()(nd));return e.copy=function(){return h2(e,BBe())},A1.apply(e,arguments)}function $Be(){var e=nce(K$()).domain([.1,1,10]);return e.copy=function(){return h2(e,$Be()).base(e.base())},A1.apply(e,arguments)}function UBe(){var e=rce(K$());return e.copy=function(){return h2(e,UBe()).constant(e.constant())},A1.apply(e,arguments)}function mce(){var e=sce(K$());return e.copy=function(){return h2(e,mce()).exponent(e.exponent())},A1.apply(e,arguments)}function _Gt(){return mce.apply(null,arguments).exponent(.5)}const F3e=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:u_,scaleDiverging:BBe,scaleDivergingLog:$Be,scaleDivergingPow:mce,scaleDivergingSqrt:_Gt,scaleDivergingSymlog:UBe,scaleIdentity:yBe,scaleImplicit:Ete,scaleLinear:lL,scaleLog:wBe,scaleOrdinal:Yle,scalePoint:s9,scalePow:ice,scaleQuantile:NBe,scaleQuantize:ABe,scaleRadial:SBe,scaleSequential:MBe,scaleSequentialLog:RBe,scaleSequentialPow:pce,scaleSequentialQuantile:DBe,scaleSequentialSqrt:EGt,scaleSequentialSymlog:LBe,scaleSqrt:lqt,scaleSymlog:CBe,scaleThreshold:jBe,scaleTime:AGt,scaleUtc:jGt,tickFormat:bBe},Symbol.toStringTag,{value:"Module"}));var QK,O3e;function zBe(){if(O3e)return QK;O3e=1;var e=qA();function t(n,r,s){for(var a=-1,o=n.length;++a<o;){var l=n[a],c=r(l);if(c!=null&&(u===void 0?c===c&&!e(c):s(c,u)))var u=c,d=l}return d}return QK=t,QK}var ZK,M3e;function kGt(){if(M3e)return ZK;M3e=1;function e(t,n){return t>n}return ZK=e,ZK}var JK,R3e;function TGt(){if(R3e)return JK;R3e=1;var e=zBe(),t=kGt(),n=YA();function r(s){return s&&s.length?e(s,n,t):void 0}return JK=r,JK}var IGt=TGt();const hy=ji(IGt);var eY,L3e;function PGt(){if(L3e)return eY;L3e=1;function e(t,n){return t<n}return eY=e,eY}var tY,D3e;function FGt(){if(D3e)return tY;D3e=1;var e=zBe(),t=PGt(),n=YA();function r(s){return s&&s.length?e(s,n,t):void 0}return tY=r,tY}var OGt=FGt();const Y$=ji(OGt);var nY,B3e;function MGt(){if(B3e)return nY;B3e=1;var e=Ile(),t=d2(),n=YDe(),r=rf();function s(a,o){var l=r(a)?e:n;return l(a,t(o,3))}return nY=s,nY}var rY,$3e;function RGt(){if($3e)return rY;$3e=1;var e=GDe(),t=MGt();function n(r,s){return e(t(r,s),1)}return rY=n,rY}var LGt=RGt();const DGt=ji(LGt);var sY,U3e;function BGt(){if(U3e)return sY;U3e=1;var e=Hle();function t(n,r){return e(n,r)}return sY=t,sY}var $Gt=BGt();const W3=ji($Gt);var QA=1e9,UGt={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},gce,_o=!0,ip="[DecimalError] ",s3=ip+"Invalid argument: ",xce=ip+"Exponent out of range: ",ZA=Math.floor,Ev=Math.pow,zGt=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,If,bc=1e7,xo=7,HBe=9007199254740991,fL=ZA(HBe/xo),Cs={};Cs.absoluteValue=Cs.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Cs.comparedTo=Cs.cmp=function(e){var t,n,r,s,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,s=e.d.length,t=0,n=r<s?r:s;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===s?0:r>s^a.s<0?1:-1};Cs.decimalPlaces=Cs.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*xo;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Cs.dividedBy=Cs.div=function(e){return qg(this,new this.constructor(e))};Cs.dividedToIntegerBy=Cs.idiv=function(e){var t=this,n=t.constructor;return qa(qg(t,new n(e),0,1),n.precision)};Cs.equals=Cs.eq=function(e){return!this.cmp(e)};Cs.exponent=function(){return Ll(this)};Cs.greaterThan=Cs.gt=function(e){return this.cmp(e)>0};Cs.greaterThanOrEqualTo=Cs.gte=function(e){return this.cmp(e)>=0};Cs.isInteger=Cs.isint=function(){return this.e>this.d.length-2};Cs.isNegative=Cs.isneg=function(){return this.s<0};Cs.isPositive=Cs.ispos=function(){return this.s>0};Cs.isZero=function(){return this.s===0};Cs.lessThan=Cs.lt=function(e){return this.cmp(e)<0};Cs.lessThanOrEqualTo=Cs.lte=function(e){return this.cmp(e)<1};Cs.logarithm=Cs.log=function(e){var t,n=this,r=n.constructor,s=r.precision,a=s+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(If))throw Error(ip+"NaN");if(n.s<1)throw Error(ip+(n.s?"NaN":"-Infinity"));return n.eq(If)?new r(0):(_o=!1,t=qg(m_(n,a),m_(e,a),a),_o=!0,qa(t,s))};Cs.minus=Cs.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?qBe(t,e):VBe(t,(e.s=-e.s,e))};Cs.modulo=Cs.mod=function(e){var t,n=this,r=n.constructor,s=r.precision;if(e=new r(e),!e.s)throw Error(ip+"NaN");return n.s?(_o=!1,t=qg(n,e,0,1).times(e),_o=!0,n.minus(t)):qa(new r(n),s)};Cs.naturalExponential=Cs.exp=function(){return WBe(this)};Cs.naturalLogarithm=Cs.ln=function(){return m_(this)};Cs.negated=Cs.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Cs.plus=Cs.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?VBe(t,e):qBe(t,(e.s=-e.s,e))};Cs.precision=Cs.sd=function(e){var t,n,r,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(s3+e);if(t=Ll(s)+1,r=s.d.length-1,n=r*xo+1,r=s.d[r],r){for(;r%10==0;r/=10)n--;for(r=s.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Cs.squareRoot=Cs.sqrt=function(){var e,t,n,r,s,a,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(ip+"NaN")}for(e=Ll(l),_o=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=N0(l.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=ZA((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(s.toString()),n=c.precision,s=o=n+3;;)if(a=r,r=a.plus(qg(l,a,o+2)).times(.5),N0(a.d).slice(0,o)===(t=N0(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),s==o&&t=="4999"){if(qa(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return _o=!0,qa(r,n)};Cs.times=Cs.mul=function(e){var t,n,r,s,a,o,l,c,u,d=this,f=d.constructor,x=d.d,g=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,n=d.e+e.e,c=x.length,u=g.length,c<u&&(a=x,x=g,g=a,o=c,c=u,u=o),a=[],o=c+u,r=o;r--;)a.push(0);for(r=u;--r>=0;){for(t=0,s=c+r;s>r;)l=a[s]+g[r]*x[s-r-1]+t,a[s--]=l%bc|0,t=l/bc|0;a[s]=(a[s]+t)%bc|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,_o?qa(e,f.precision):e};Cs.toDecimalPlaces=Cs.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(ex(e,0,QA),t===void 0?t=r.rounding:ex(t,0,8),qa(n,e+Ll(n)+1,t))};Cs.toExponential=function(e,t){var n,r=this,s=r.constructor;return e===void 0?n=q3(r,!0):(ex(e,0,QA),t===void 0?t=s.rounding:ex(t,0,8),r=qa(new s(r),e+1,t),n=q3(r,!0,e+1)),n};Cs.toFixed=function(e,t){var n,r,s=this,a=s.constructor;return e===void 0?q3(s):(ex(e,0,QA),t===void 0?t=a.rounding:ex(t,0,8),r=qa(new a(s),e+Ll(s)+1,t),n=q3(r.abs(),!1,e+Ll(r)+1),s.isneg()&&!s.isZero()?"-"+n:n)};Cs.toInteger=Cs.toint=function(){var e=this,t=e.constructor;return qa(new t(e),Ll(e)+1,t.rounding)};Cs.toNumber=function(){return+this};Cs.toPower=Cs.pow=function(e){var t,n,r,s,a,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(If);if(l=new c(l),!l.s){if(e.s<1)throw Error(ip+"Infinity");return l}if(l.eq(If))return l;if(r=c.precision,e.eq(If))return qa(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=d<0?-d:d)<=HBe){for(s=new c(If),t=Math.ceil(r/xo+4),_o=!1;n%2&&(s=s.times(l),H3e(s.d,t)),n=ZA(n/2),n!==0;)l=l.times(l),H3e(l.d,t);return _o=!0,e.s<0?new c(If).div(s):qa(s,r)}}else if(a<0)throw Error(ip+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,_o=!1,s=e.times(m_(l,r+u)),_o=!0,s=WBe(s),s.s=a,s};Cs.toPrecision=function(e,t){var n,r,s=this,a=s.constructor;return e===void 0?(n=Ll(s),r=q3(s,n<=a.toExpNeg||n>=a.toExpPos)):(ex(e,1,QA),t===void 0?t=a.rounding:ex(t,0,8),s=qa(new a(s),e,t),n=Ll(s),r=q3(s,e<=n||n<=a.toExpNeg,e)),r};Cs.toSignificantDigits=Cs.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(ex(e,1,QA),t===void 0?t=r.rounding:ex(t,0,8)),qa(new r(n),e,t)};Cs.toString=Cs.valueOf=Cs.val=Cs.toJSON=Cs[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Ll(e),n=e.constructor;return q3(e,t<=n.toExpNeg||t>=n.toExpPos)};function VBe(e,t){var n,r,s,a,o,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),_o?qa(t,f):t;if(c=e.d,u=t.d,o=e.e,s=t.e,c=c.slice(),a=o-s,a){for(a<0?(r=c,a=-a,l=u.length):(r=u,s=o,l=c.length),o=Math.ceil(f/xo),l=o>l?o+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/bc|0,c[a]%=bc;for(n&&(c.unshift(n),++s),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=s,_o?qa(t,f):t}function ex(e,t,n){if(e!==~~e||e<t||e>n)throw Error(s3+e)}function N0(e){var t,n,r,s=e.length-1,a="",o=e[0];if(s>0){for(a+=o,t=1;t<s;t++)r=e[t]+"",n=xo-r.length,n&&(a+=jb(n)),a+=r;o=e[t],r=o+"",n=xo-r.length,n&&(a+=jb(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var qg=function(){function e(r,s){var a,o=0,l=r.length;for(r=r.slice();l--;)a=r[l]*s+o,r[l]=a%bc|0,o=a/bc|0;return o&&r.unshift(o),r}function t(r,s,a,o){var l,c;if(a!=o)c=a>o?1:-1;else for(l=c=0;l<a;l++)if(r[l]!=s[l]){c=r[l]>s[l]?1:-1;break}return c}function n(r,s,a){for(var o=0;a--;)r[a]-=o,o=r[a]<s[a]?1:0,r[a]=o*bc+r[a]-s[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,s,a,o){var l,c,u,d,f,x,g,v,w,C,N,I,P,R,F,U,L,z,X=r.constructor,ne=r.s==s.s?1:-1,J=r.d,Z=s.d;if(!r.s)return new X(r);if(!s.s)throw Error(ip+"Division by zero");for(c=r.e-s.e,L=Z.length,F=J.length,g=new X(ne),v=g.d=[],u=0;Z[u]==(J[u]||0);)++u;if(Z[u]>(J[u]||0)&&--c,a==null?I=a=X.precision:o?I=a+(Ll(r)-Ll(s))+1:I=a,I<0)return new X(0);if(I=I/xo+2|0,u=0,L==1)for(d=0,Z=Z[0],I++;(u<F||d)&&I--;u++)P=d*bc+(J[u]||0),v[u]=P/Z|0,d=P%Z|0;else{for(d=bc/(Z[0]+1)|0,d>1&&(Z=e(Z,d),J=e(J,d),L=Z.length,F=J.length),R=L,w=J.slice(0,L),C=w.length;C<L;)w[C++]=0;z=Z.slice(),z.unshift(0),U=Z[0],Z[1]>=bc/2&&++U;do d=0,l=t(Z,w,L,C),l<0?(N=w[0],L!=C&&(N=N*bc+(w[1]||0)),d=N/U|0,d>1?(d>=bc&&(d=bc-1),f=e(Z,d),x=f.length,C=w.length,l=t(f,w,x,C),l==1&&(d--,n(f,L<x?z:Z,x))):(d==0&&(l=d=1),f=Z.slice()),x=f.length,x<C&&f.unshift(0),n(w,f,C),l==-1&&(C=w.length,l=t(Z,w,L,C),l<1&&(d++,n(w,L<C?z:Z,C))),C=w.length):l===0&&(d++,w=[0]),v[u++]=d,l&&w[0]?w[C++]=J[R]||0:(w=[J[R]],C=1);while((R++<F||w[0]!==void 0)&&I--)}return v[0]||v.shift(),g.e=c,qa(g,o?a+Ll(g)+1:a)}}();function WBe(e,t){var n,r,s,a,o,l,c=0,u=0,d=e.constructor,f=d.precision;if(Ll(e)>16)throw Error(xce+Ll(e));if(!e.s)return new d(If);for(t==null?(_o=!1,l=f):l=t,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(Ev(2,u))/Math.LN10*2+5|0,l+=r,n=s=a=new d(If),d.precision=l;;){if(s=qa(s.times(e),l),n=n.times(++c),o=a.plus(qg(s,n,l)),N0(o.d).slice(0,l)===N0(a.d).slice(0,l)){for(;u--;)a=qa(a.times(a),l);return d.precision=f,t==null?(_o=!0,qa(a,f)):a}a=o}}function Ll(e){for(var t=e.e*xo,n=e.d[0];n>=10;n/=10)t++;return t}function iY(e,t,n){if(t>e.LN10.sd())throw _o=!0,n&&(e.precision=n),Error(ip+"LN10 precision limit exceeded");return qa(new e(e.LN10),t)}function jb(e){for(var t="";e--;)t+="0";return t}function m_(e,t){var n,r,s,a,o,l,c,u,d,f=1,x=10,g=e,v=g.d,w=g.constructor,C=w.precision;if(g.s<1)throw Error(ip+(g.s?"NaN":"-Infinity"));if(g.eq(If))return new w(0);if(t==null?(_o=!1,u=C):u=t,g.eq(10))return t==null&&(_o=!0),iY(w,u);if(u+=x,w.precision=u,n=N0(v),r=n.charAt(0),a=Ll(g),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=N0(g.d),r=n.charAt(0),f++;a=Ll(g),r>1?(g=new w("0."+n),a++):g=new w(r+"."+n.slice(1))}else return c=iY(w,u+2,C).times(a+""),g=m_(new w(r+"."+n.slice(1)),u-x).plus(c),w.precision=C,t==null?(_o=!0,qa(g,C)):g;for(l=o=g=qg(g.minus(If),g.plus(If),u),d=qa(g.times(g),u),s=3;;){if(o=qa(o.times(d),u),c=l.plus(qg(o,new w(s),u)),N0(c.d).slice(0,u)===N0(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(iY(w,u+2,C).times(a+""))),l=qg(l,new w(f),u),w.precision=C,t==null?(_o=!0,qa(l,C)):l;l=c,s+=2}}function z3e(e,t){var n,r,s;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(r,s),t){if(s-=r,n=n-r-1,e.e=ZA(n/xo),e.d=[],r=(n+1)%xo,n<0&&(r+=xo),r<s){for(r&&e.d.push(+t.slice(0,r)),s-=xo;r<s;)e.d.push(+t.slice(r,r+=xo));t=t.slice(r),r=xo-t.length}else r-=s;for(;r--;)t+="0";if(e.d.push(+t),_o&&(e.e>fL||e.e<-fL))throw Error(xce+n)}else e.s=0,e.e=0,e.d=[0];return e}function qa(e,t,n){var r,s,a,o,l,c,u,d,f=e.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=xo,s=t,u=f[d=0];else{if(d=Math.ceil((r+1)/xo),a=f.length,d>=a)return e;for(u=a=f[d],o=1;a>=10;a/=10)o++;r%=xo,s=r-xo+o}if(n!==void 0&&(a=Ev(10,o-s-1),l=u/a%10|0,c=t<0||f[d+1]!==void 0||u%a,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?s>0?u/Ev(10,o-s):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(a=Ll(e),f.length=1,t=t-a-1,f[0]=Ev(10,(xo-t%xo)%xo),e.e=ZA(-t/xo)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=d,a=1,d--):(f.length=d+1,a=Ev(10,xo-r),f[d]=s>0?(u/Ev(10,o-s)%Ev(10,s)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==bc&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=bc)break;f[d--]=0,a=1}for(r=f.length;f[--r]===0;)f.pop();if(_o&&(e.e>fL||e.e<-fL))throw Error(xce+Ll(e));return e}function qBe(e,t){var n,r,s,a,o,l,c,u,d,f,x=e.constructor,g=x.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new x(e),_o?qa(t,g):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),o=u-r,o){for(d=o<0,d?(n=c,o=-o,l=f.length):(n=f,r=u,l=c.length),s=Math.max(Math.ceil(g/xo),l)+2,o>s&&(o=s,n.length=1),n.reverse(),s=o;s--;)n.push(0);n.reverse()}else{for(s=c.length,l=f.length,d=s<l,d&&(l=s),s=0;s<l;s++)if(c[s]!=f[s]){d=c[s]<f[s];break}o=0}for(d&&(n=c,c=f,f=n,t.s=-t.s),l=c.length,s=f.length-l;s>0;--s)c[l++]=0;for(s=f.length;s>o;){if(c[--s]<f[s]){for(a=s;a&&c[--a]===0;)c[a]=bc-1;--c[a],c[s]+=bc}c[s]-=f[s]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,_o?qa(t,g):t):new x(0)}function q3(e,t,n){var r,s=Ll(e),a=N0(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+jb(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(s<0?"e":"e+")+s):s<0?(a="0."+jb(-s-1)+a,n&&(r=n-o)>0&&(a+=jb(r))):s>=o?(a+=jb(s+1-o),n&&(r=n-s-1)>0&&(a=a+"."+jb(r))):((r=s+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(s+1===o&&(a+="."),a+=jb(r))),e.s<0?"-"+a:a}function H3e(e,t){if(e.length>t)return e.length=t,!0}function GBe(e){var t,n,r;function s(a){var o=this;if(!(o instanceof s))return new s(a);if(o.constructor=s,a instanceof s){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(s3+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return z3e(o,a.toString())}else if(typeof a!="string")throw Error(s3+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,zGt.test(a))z3e(o,a);else throw Error(s3+a)}if(s.prototype=Cs,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=GBe,s.config=s.set=HGt,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return s.config(e),s}function HGt(e){if(!e||typeof e!="object")throw Error(ip+"Object expected");var t,n,r,s=["precision",1,QA,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((r=e[n=s[t]])!==void 0)if(ZA(r)===r&&r>=s[t+1]&&r<=s[t+2])this[n]=r;else throw Error(s3+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(s3+n+": "+r);return this}var gce=GBe(UGt);If=new gce(1);const Da=gce;function VGt(e){return KGt(e)||GGt(e)||qGt(e)||WGt()}function WGt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qGt(e,t){if(e){if(typeof e=="string")return Ite(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ite(e,t)}}function GGt(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function KGt(e){if(Array.isArray(e))return Ite(e)}function Ite(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var YGt=function(t){return t},KBe={"@@functional/placeholder":!0},YBe=function(t){return t===KBe},V3e=function(t){return function n(){return arguments.length===0||arguments.length===1&&YBe(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},XGt=function e(t,n){return t===1?n:V3e(function(){for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];var o=s.filter(function(l){return l!==KBe}).length;return o>=t?n.apply(void 0,s):e(t-o,V3e(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=s.map(function(f){return YBe(f)?c.shift():f});return n.apply(void 0,VGt(d).concat(c))}))})},X$=function(t){return XGt(t.length,t)},Pte=function(t,n){for(var r=[],s=t;s<n;++s)r[s-t]=s;return r},QGt=X$(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),ZGt=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return YGt;var s=n.reverse(),a=s[0],o=s.slice(1);return function(){return o.reduce(function(l,c){return c(l)},a.apply(void 0,arguments))}},Fte=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},XBe=function(t){var n=null,r=null;return function(){for(var s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];return n&&a.every(function(l,c){return l===n[c]})||(n=a,r=t.apply(void 0,a)),r}};function JGt(e){var t;return e===0?t=1:t=Math.floor(new Da(e).abs().log(10).toNumber())+1,t}function eKt(e,t,n){for(var r=new Da(e),s=0,a=[];r.lt(t)&&s<1e5;)a.push(r.toNumber()),r=r.add(n),s++;return a}var tKt=X$(function(e,t,n){var r=+e,s=+t;return r+n*(s-r)}),nKt=X$(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),rKt=X$(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const Q$={rangeStep:eKt,getDigitCount:JGt,interpolateNumber:tKt,uninterpolateNumber:nKt,uninterpolateTruncation:rKt};function Ote(e){return aKt(e)||iKt(e)||QBe(e)||sKt()}function sKt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iKt(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function aKt(e){if(Array.isArray(e))return Mte(e)}function x_(e,t){return cKt(e)||lKt(e,t)||QBe(e,t)||oKt()}function oKt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QBe(e,t){if(e){if(typeof e=="string")return Mte(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mte(e,t)}}function Mte(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function lKt(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,s=!1,a=void 0;try{for(var o=e[Symbol.iterator](),l;!(r=(l=o.next()).done)&&(n.push(l.value),!(t&&n.length===t));r=!0);}catch(c){s=!0,a=c}finally{try{!r&&o.return!=null&&o.return()}finally{if(s)throw a}}return n}}function cKt(e){if(Array.isArray(e))return e}function ZBe(e){var t=x_(e,2),n=t[0],r=t[1],s=n,a=r;return n>r&&(s=r,a=n),[s,a]}function JBe(e,t,n){if(e.lte(0))return new Da(0);var r=Q$.getDigitCount(e.toNumber()),s=new Da(10).pow(r),a=e.div(s),o=r!==1?.05:.1,l=new Da(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=l.mul(s);return t?c:new Da(Math.ceil(c))}function uKt(e,t,n){var r=1,s=new Da(e);if(!s.isint()&&n){var a=Math.abs(e);a<1?(r=new Da(10).pow(Q$.getDigitCount(e)-1),s=new Da(Math.floor(s.div(r).toNumber())).mul(r)):a>1&&(s=new Da(Math.floor(e)))}else e===0?s=new Da(Math.floor((t-1)/2)):n||(s=new Da(Math.floor(e)));var o=Math.floor((t-1)/2),l=ZGt(QGt(function(c){return s.add(new Da(c-o).mul(r)).toNumber()}),Pte);return l(0,t)}function e$e(e,t,n,r){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Da(0),tickMin:new Da(0),tickMax:new Da(0)};var a=JBe(new Da(t).sub(e).div(n-1),r,s),o;e<=0&&t>=0?o=new Da(0):(o=new Da(e).add(t).div(2),o=o.sub(new Da(o).mod(a)));var l=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new Da(t).sub(o).div(a).toNumber()),u=l+c+1;return u>n?e$e(e,t,n,r,s+1):(u<n&&(c=t>0?c+(n-u):c,l=t>0?l:l+(n-u)),{step:a,tickMin:o.sub(new Da(l).mul(a)),tickMax:o.add(new Da(c).mul(a))})}function dKt(e){var t=x_(e,2),n=t[0],r=t[1],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(s,2),l=ZBe([n,r]),c=x_(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(Ote(Pte(0,s-1).map(function(){return 1/0}))):[].concat(Ote(Pte(0,s-1).map(function(){return-1/0})),[d]);return n>r?Fte(f):f}if(u===d)return uKt(u,s,a);var x=e$e(u,d,o,a),g=x.step,v=x.tickMin,w=x.tickMax,C=Q$.rangeStep(v,w.add(new Da(.1).mul(g)),g);return n>r?Fte(C):C}function fKt(e,t){var n=x_(e,2),r=n[0],s=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=ZBe([r,s]),l=x_(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[r,s];if(c===u)return[c];var d=Math.max(t,2),f=JBe(new Da(u).sub(c).div(d-1),a,0),x=[].concat(Ote(Q$.rangeStep(new Da(c),new Da(u).sub(new Da(.99).mul(f)),f)),[u]);return r>s?Fte(x):x}var hKt=XBe(dKt),pKt=XBe(fKt),mKt="Invariant failed";function G3(e,t){throw new Error(mKt)}var xKt=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function EN(e){"@babel/helpers - typeof";return EN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},EN(e)}function hL(){return hL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hL.apply(this,arguments)}function gKt(e,t){return wKt(e)||vKt(e,t)||yKt(e,t)||bKt()}function bKt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yKt(e,t){if(e){if(typeof e=="string")return W3e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return W3e(e,t)}}function W3e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vKt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function wKt(e){if(Array.isArray(e))return e}function CKt(e,t){if(e==null)return{};var n=SKt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function SKt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function NKt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AKt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r$e(r.key),r)}}function jKt(e,t,n){return AKt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function EKt(e,t,n){return t=pL(t),_Kt(e,t$e()?Reflect.construct(t,n||[],pL(e).constructor):t.apply(e,n))}function _Kt(e,t){if(t&&(EN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kKt(e)}function kKt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(t$e=function(){return!!e})()}function pL(e){return pL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},pL(e)}function TKt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rte(e,t)}function Rte(e,t){return Rte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},Rte(e,t)}function n$e(e,t,n){return t=r$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r$e(e){var t=IKt(e,"string");return EN(t)=="symbol"?t:t+""}function IKt(e,t){if(EN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(EN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var JA=function(e){function t(){return NKt(this,t),EKt(this,t,arguments)}return TKt(t,e),jKt(t,[{key:"render",value:function(){var r=this.props,s=r.offset,a=r.layout,o=r.width,l=r.dataKey,c=r.data,u=r.dataPointFormatter,d=r.xAxis,f=r.yAxis,x=CKt(r,xKt),g=mi(x,!1);this.props.direction==="x"&&d.type!=="number"&&G3();var v=c.map(function(w){var C=u(w,l),N=C.x,I=C.y,P=C.value,R=C.errorVal;if(!R)return null;var F=[],U,L;if(Array.isArray(R)){var z=gKt(R,2);U=z[0],L=z[1]}else U=L=R;if(a==="vertical"){var X=d.scale,ne=I+s,J=ne+o,Z=ne-o,re=X(P-U),he=X(P+L);F.push({x1:he,y1:J,x2:he,y2:Z}),F.push({x1:re,y1:ne,x2:he,y2:ne}),F.push({x1:re,y1:J,x2:re,y2:Z})}else if(a==="horizontal"){var Y=f.scale,ie=N+s,oe=ie-o,G=ie+o,V=Y(P-U),ee=Y(P+L);F.push({x1:oe,y1:ee,x2:G,y2:ee}),F.push({x1:ie,y1:V,x2:ie,y2:ee}),F.push({x1:oe,y1:V,x2:G,y2:V})}return Se.createElement(wa,hL({className:"recharts-errorBar",key:"bar-".concat(F.map(function(ae){return"".concat(ae.x1,"-").concat(ae.x2,"-").concat(ae.y1,"-").concat(ae.y2)}))},g),F.map(function(ae){return Se.createElement("line",hL({},ae,{key:"line-".concat(ae.x1,"-").concat(ae.x2,"-").concat(ae.y1,"-").concat(ae.y2)}))}))});return Se.createElement(wa,{className:"recharts-errorBars"},v)}}])}(Se.Component);n$e(JA,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});n$e(JA,"displayName","ErrorBar");function g_(e){"@babel/helpers - typeof";return g_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g_(e)}function q3e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function lv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q3e(Object(n),!0).forEach(function(r){PKt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q3e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PKt(e,t,n){return t=FKt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FKt(e){var t=OKt(e,"string");return g_(t)=="symbol"?t:t+""}function OKt(e,t){if(g_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(g_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var s$e=function(t){var n=t.children,r=t.formattedGraphicalItems,s=t.legendWidth,a=t.legendContent,o=_f(n,n3);if(!o)return null;var l=n3.defaultProps,c=l!==void 0?lv(lv({},l),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:a==="children"?u=(r||[]).reduce(function(d,f){var x=f.item,g=f.props,v=g.sectors||g.data||[];return d.concat(v.map(function(w){return{type:o.props.iconType||x.props.legendType,value:w.name,color:w.fill,payload:w}}))},[]):u=(r||[]).map(function(d){var f=d.item,x=f.type.defaultProps,g=x!==void 0?lv(lv({},x),f.props):{},v=g.dataKey,w=g.name,C=g.legendType,N=g.hide;return{inactive:N,dataKey:v,type:c.iconType||C||"square",color:bce(f),value:w||v,payload:g}}),lv(lv(lv({},c),n3.getWithHeight(o,s)),{},{payload:u,item:o})};function b_(e){"@babel/helpers - typeof";return b_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b_(e)}function G3e(e){return DKt(e)||LKt(e)||RKt(e)||MKt()}function MKt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RKt(e,t){if(e){if(typeof e=="string")return Lte(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lte(e,t)}}function LKt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function DKt(e){if(Array.isArray(e))return Lte(e)}function Lte(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function K3e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Qo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?K3e(Object(n),!0).forEach(function(r){h4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K3e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function h4(e,t,n){return t=BKt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BKt(e){var t=$Kt(e,"string");return b_(t)=="symbol"?t:t+""}function $Kt(e,t){if(b_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(b_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ql(e,t,n){return xi(e)||xi(t)?n:Xl(t)?Yh(e,t,n):wi(t)?t(e):n}function i9(e,t,n,r){var s=DGt(e,function(l){return Ql(l,t)});if(n==="number"){var a=s.filter(function(l){return Xr(l)||parseFloat(l)});return a.length?[Y$(a),hy(a)]:[1/0,-1/0]}var o=r?s.filter(function(l){return!xi(l)}):s;return o.map(function(l){return Xl(l)||l instanceof Date?l:""})}var UKt=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,l=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(l<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,u=0;u<l;u++){var d=u>0?s[u-1].coordinate:s[l-1].coordinate,f=s[u].coordinate,x=u>=l-1?s[0].coordinate:s[u+1].coordinate,g=void 0;if(em(f-d)!==em(x-f)){var v=[];if(em(x-f)===em(c[1]-c[0])){g=x;var w=f+c[1]-c[0];v[0]=Math.min(w,(w+d)/2),v[1]=Math.max(w,(w+d)/2)}else{g=d;var C=x+c[1]-c[0];v[0]=Math.min(f,(C+f)/2),v[1]=Math.max(f,(C+f)/2)}var N=[Math.min(f,(g+f)/2),Math.max(f,(g+f)/2)];if(t>N[0]&&t<=N[1]||t>=v[0]&&t<=v[1]){o=s[u].index;break}}else{var I=Math.min(d,x),P=Math.max(d,x);if(t>(I+f)/2&&t<=(P+f)/2){o=s[u].index;break}}}else for(var R=0;R<l;R++)if(R===0&&t<=(r[R].coordinate+r[R+1].coordinate)/2||R>0&&R<l-1&&t>(r[R].coordinate+r[R-1].coordinate)/2&&t<=(r[R].coordinate+r[R+1].coordinate)/2||R===l-1&&t>(r[R].coordinate+r[R-1].coordinate)/2){o=r[R].index;break}return o},bce=function(t){var n,r=t,s=r.type.displayName,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Qo(Qo({},t.type.defaultProps),t.props):t.props,o=a.stroke,l=a.fill,c;switch(s){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},zKt=function(t){var n=t.barSize,r=t.totalSize,s=t.stackGroups,a=s===void 0?{}:s;if(!a)return{};for(var o={},l=Object.keys(a),c=0,u=l.length;c<u;c++)for(var d=a[l[c]].stackGroups,f=Object.keys(d),x=0,g=f.length;x<g;x++){var v=d[f[x]],w=v.items,C=v.cateAxisId,N=w.filter(function(L){return Vg(L.type).indexOf("Bar")>=0});if(N&&N.length){var I=N[0].type.defaultProps,P=I!==void 0?Qo(Qo({},I),N[0].props):N[0].props,R=P.barSize,F=P[C];o[F]||(o[F]=[]);var U=xi(R)?n:R;o[F].push({item:N[0],stackList:N.slice(1),barSize:xi(U)?void 0:V3(U,r,0)})}}return o},HKt=function(t){var n=t.barGap,r=t.barCategoryGap,s=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=V3(n,s,0,!0),d,f=[];if(o[0].barSize===+o[0].barSize){var x=!1,g=s/c,v=o.reduce(function(R,F){return R+F.barSize||0},0);v+=(c-1)*u,v>=s&&(v-=(c-1)*u,u=0),v>=s&&g>0&&(x=!0,g*=.9,v=c*g);var w=(s-v)/2>>0,C={offset:w-u,size:0};d=o.reduce(function(R,F){var U={item:F.item,position:{offset:C.offset+C.size+u,size:x?g:F.barSize}},L=[].concat(G3e(R),[U]);return C=L[L.length-1].position,F.stackList&&F.stackList.length&&F.stackList.forEach(function(z){L.push({item:z,position:C})}),L},f)}else{var N=V3(r,s,0,!0);s-2*N-(c-1)*u<=0&&(u=0);var I=(s-2*N-(c-1)*u)/c;I>1&&(I>>=0);var P=l===+l?Math.min(I,l):I;d=o.reduce(function(R,F,U){var L=[].concat(G3e(R),[{item:F.item,position:{offset:N+(I+u)*U+(I-P)/2,size:P}}]);return F.stackList&&F.stackList.length&&F.stackList.forEach(function(z){L.push({item:z,position:L[L.length-1].position})}),L},f)}return d},VKt=function(t,n,r,s){var a=r.children,o=r.width,l=r.margin,c=o-(l.left||0)-(l.right||0),u=s$e({children:a,legendWidth:c});if(u){var d=s||{},f=d.width,x=d.height,g=u.align,v=u.verticalAlign,w=u.layout;if((w==="vertical"||w==="horizontal"&&v==="middle")&&g!=="center"&&Xr(t[g]))return Qo(Qo({},t),{},h4({},g,t[g]+(f||0)));if((w==="horizontal"||w==="vertical"&&g==="center")&&v!=="middle"&&Xr(t[v]))return Qo(Qo({},t),{},h4({},v,t[v]+(x||0)))}return t},WKt=function(t,n,r){return xi(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},i$e=function(t,n,r,s,a){var o=n.props.children,l=Qd(o,JA).filter(function(u){return WKt(s,a,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var f=Ql(d,r);if(xi(f))return u;var x=Array.isArray(f)?[Y$(f),hy(f)]:[f,f],g=c.reduce(function(v,w){var C=Ql(d,w,0),N=x[0]-Math.abs(Array.isArray(C)?C[0]:C),I=x[1]+Math.abs(Array.isArray(C)?C[1]:C);return[Math.min(N,v[0]),Math.max(I,v[1])]},[1/0,-1/0]);return[Math.min(g[0],u[0]),Math.max(g[1],u[1])]},[1/0,-1/0])}return null},qKt=function(t,n,r,s,a){var o=n.map(function(l){return i$e(t,l,r,a,s)}).filter(function(l){return!xi(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},a$e=function(t,n,r,s,a){var o=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&i$e(t,c,u,s)||i9(t,u,r,a)});if(r==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var d=0,f=u.length;d<f;d++)l[u[d]]||(l[u[d]]=!0,c.push(u[d]));return c},[])},o$e=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},l$e=function(t,n,r,s){if(s)return t.map(function(c){return c.coordinate});var a,o,l=t.map(function(c){return c.coordinate===n&&(a=!0),c.coordinate===r&&(o=!0),c.coordinate});return a||l.push(n),o||l.push(r),l},Og=function(t,n,r){if(!t)return null;var s=t.scale,a=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?s.bandwidth()/2:2,u=(n||r)&&o==="category"&&s.bandwidth?s.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?em(l[0]-l[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var x=a?a.indexOf(f):f;return{coordinate:s(x)+u,value:f,offset:u}});return d.filter(function(f){return!KA(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,x){return{coordinate:s(f)+u,value:f,index:x,offset:u}}):s.ticks&&!r?s.ticks(t.tickCount).map(function(f){return{coordinate:s(f)+u,value:f,offset:u}}):s.domain().map(function(f,x){return{coordinate:s(f)+u,value:a?a[f]:f,index:x,offset:u}})},aY=new WeakMap,TP=function(t,n){if(typeof n!="function")return t;aY.has(t)||aY.set(t,new WeakMap);var r=aY.get(t);if(r.has(n))return r.get(n);var s=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,s),s},GKt=function(t,n,r){var s=t.scale,a=t.type,o=t.layout,l=t.axisType;if(s==="auto")return o==="radial"&&l==="radiusAxis"?{scale:u_(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:lL(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:s9(),realScaleType:"point"}:a==="category"?{scale:u_(),realScaleType:"band"}:{scale:lL(),realScaleType:"linear"};if(H3(s)){var c="scale".concat(M$(s));return{scale:(F3e[c]||s9)(),realScaleType:F3e[c]?c:"point"}}return wi(s)?{scale:s}:{scale:s9(),realScaleType:"point"}},Y3e=1e-4,KKt=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,s=t.range(),a=Math.min(s[0],s[1])-Y3e,o=Math.max(s[0],s[1])+Y3e,l=t(n[0]),c=t(n[r-1]);(l<a||l>o||c<a||c>o)&&t.domain([n[0],n[r-1]])}},YKt=function(t,n){if(!t)return null;for(var r=0,s=t.length;r<s;r++)if(t[r].item===n)return t[r].position;return null},XKt=function(t,n){if(!n||n.length!==2||!Xr(n[0])||!Xr(n[1]))return t;var r=Math.min(n[0],n[1]),s=Math.max(n[0],n[1]),a=[t[0],t[1]];return(!Xr(t[0])||t[0]<r)&&(a[0]=r),(!Xr(t[1])||t[1]>s)&&(a[1]=s),a[0]>s&&(a[0]=s),a[1]<r&&(a[1]=r),a},QKt=function(t){var n=t.length;if(!(n<=0))for(var r=0,s=t[0].length;r<s;++r)for(var a=0,o=0,l=0;l<n;++l){var c=KA(t[l][r][1])?t[l][r][0]:t[l][r][1];c>=0?(t[l][r][0]=a,t[l][r][1]=a+c,a=t[l][r][1]):(t[l][r][0]=o,t[l][r][1]=o+c,o=t[l][r][1])}},ZKt=function(t){var n=t.length;if(!(n<=0))for(var r=0,s=t[0].length;r<s;++r)for(var a=0,o=0;o<n;++o){var l=KA(t[o][r][1])?t[o][r][0]:t[o][r][1];l>=0?(t[o][r][0]=a,t[o][r][1]=a+l,a=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},JKt={sign:QKt,expand:LUt,none:yN,silhouette:DUt,wiggle:BUt,positive:ZKt},eYt=function(t,n,r){var s=n.map(function(l){return l.props.dataKey}),a=JKt[r],o=RUt().keys(s).value(function(l,c){return+Ql(l,c,0)}).order(hte).offset(a);return o(t)},tYt=function(t,n,r,s,a,o){if(!t)return null;var l=o?n.reverse():n,c={},u=l.reduce(function(f,x){var g,v=(g=x.type)!==null&&g!==void 0&&g.defaultProps?Qo(Qo({},x.type.defaultProps),x.props):x.props,w=v.stackId,C=v.hide;if(C)return f;var N=v[r],I=f[N]||{hasStack:!1,stackGroups:{}};if(Xl(w)){var P=I.stackGroups[w]||{numericAxisId:r,cateAxisId:s,items:[]};P.items.push(x),I.hasStack=!0,I.stackGroups[w]=P}else I.stackGroups[y5("_stackId_")]={numericAxisId:r,cateAxisId:s,items:[x]};return Qo(Qo({},f),{},h4({},N,I))},c),d={};return Object.keys(u).reduce(function(f,x){var g=u[x];if(g.hasStack){var v={};g.stackGroups=Object.keys(g.stackGroups).reduce(function(w,C){var N=g.stackGroups[C];return Qo(Qo({},w),{},h4({},C,{numericAxisId:r,cateAxisId:s,items:N.items,stackedData:eYt(t,N.items,a)}))},v)}return Qo(Qo({},f),{},h4({},x,g))},d)},nYt=function(t,n){var r=n.realScaleType,s=n.type,a=n.tickCount,o=n.originalDomain,l=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&s==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=hKt(u,a,l);return t.domain([Y$(d),hy(d)]),{niceTicks:d}}if(a&&s==="number"){var f=t.domain(),x=pKt(f,a,l);return{niceTicks:x}}return null};function _N(e){var t=e.axis,n=e.ticks,r=e.bandSize,s=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!xi(s[t.dataKey])){var l=HR(n,"value",s[t.dataKey]);if(l)return l.coordinate+r/2}return n[a]?n[a].coordinate+r/2:null}var c=Ql(s,xi(o)?t.dataKey:o);return xi(c)?null:t.scale(c)}var X3e=function(t){var n=t.axis,r=t.ticks,s=t.offset,a=t.bandSize,o=t.entry,l=t.index;if(n.type==="category")return r[l]?r[l].coordinate+s:null;var c=Ql(o,n.dataKey,n.domain[l]);return xi(c)?null:n.scale(c)-a/2+s},rYt=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var s=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return s<=0&&a>=0?0:a<0?a:s}return r[0]},sYt=function(t,n){var r,s=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Qo(Qo({},t.type.defaultProps),t.props):t.props,a=s.stackId;if(Xl(a)){var o=n[a];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},iYt=function(t){return t.reduce(function(n,r){return[Y$(r.concat([n[0]]).filter(Xr)),hy(r.concat([n[1]]).filter(Xr))]},[1/0,-1/0])},c$e=function(t,n,r){return Object.keys(t).reduce(function(s,a){var o=t[a],l=o.stackedData,c=l.reduce(function(u,d){var f=iYt(d.slice(n,r+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],s[0]),Math.max(c[1],s[1])]},[1/0,-1/0]).map(function(s){return s===1/0||s===-1/0?0:s})},Q3e=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Z3e=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Dte=function(t,n,r){if(wi(t))return t(n,r);if(!Array.isArray(t))return n;var s=[];if(Xr(t[0]))s[0]=r?t[0]:Math.min(t[0],n[0]);else if(Q3e.test(t[0])){var a=+Q3e.exec(t[0])[1];s[0]=n[0]-a}else wi(t[0])?s[0]=t[0](n[0]):s[0]=n[0];if(Xr(t[1]))s[1]=r?t[1]:Math.max(t[1],n[1]);else if(Z3e.test(t[1])){var o=+Z3e.exec(t[1])[1];s[1]=n[1]+o}else wi(t[1])?s[1]=t[1](n[1]):s[1]=n[1];return s},mL=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var s=t.scale.bandwidth();if(!r||s>0)return s}if(t&&n&&n.length>=2){for(var a=Wle(n,function(f){return f.coordinate}),o=1/0,l=1,c=a.length;l<c;l++){var u=a[l],d=a[l-1];o=Math.min((u.coordinate||0)-(d.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},J3e=function(t,n,r){return!t||!t.length||W3(t,Yh(r,"type.defaultProps.domain"))?n:t},u$e=function(t,n){var r=t.type.defaultProps?Qo(Qo({},t.type.defaultProps),t.props):t.props,s=r.dataKey,a=r.name,o=r.unit,l=r.formatter,c=r.tooltipType,u=r.chartType,d=r.hide;return Qo(Qo({},mi(t,!1)),{},{dataKey:s,unit:o,formatter:l,name:a||s,color:bce(t),value:Ql(n,s),type:c,payload:n,chartType:u,hide:d})};function y_(e){"@babel/helpers - typeof";return y_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y_(e)}function e5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function t5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e5e(Object(n),!0).forEach(function(r){aYt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aYt(e,t,n){return t=oYt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oYt(e){var t=lYt(e,"string");return y_(t)=="symbol"?t:t+""}function lYt(e,t){if(y_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(y_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var xL=Math.PI/180,cYt=function(t){return t*180/Math.PI},Qc=function(t,n,r,s){return{x:t+Math.cos(-xL*s)*r,y:n+Math.sin(-xL*s)*r}},uYt=function(t,n){var r=t.x,s=t.y,a=n.x,o=n.y;return Math.sqrt(Math.pow(r-a,2)+Math.pow(s-o,2))},dYt=function(t,n){var r=t.x,s=t.y,a=n.cx,o=n.cy,l=uYt({x:r,y:s},{x:a,y:o});if(l<=0)return{radius:l};var c=(r-a)/l,u=Math.acos(c);return s>o&&(u=2*Math.PI-u),{radius:l,angle:cYt(u),angleInRadian:u}},fYt=function(t){var n=t.startAngle,r=t.endAngle,s=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(s,a);return{startAngle:n-o*360,endAngle:r-o*360}},hYt=function(t,n){var r=n.startAngle,s=n.endAngle,a=Math.floor(r/360),o=Math.floor(s/360),l=Math.min(a,o);return t+l*360},n5e=function(t,n){var r=t.x,s=t.y,a=dYt({x:r,y:s},n),o=a.radius,l=a.angle,c=n.innerRadius,u=n.outerRadius;if(o<c||o>u)return!1;if(o===0)return!0;var d=fYt(n),f=d.startAngle,x=d.endAngle,g=l,v;if(f<=x){for(;g>x;)g-=360;for(;g<f;)g+=360;v=g>=f&&g<=x}else{for(;g>f;)g-=360;for(;g<x;)g+=360;v=g>=x&&g<=f}return v?t5e(t5e({},n),{},{radius:o,angle:hYt(g,n)}):null};function v_(e){"@babel/helpers - typeof";return v_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v_(e)}var pYt=["offset"];function mYt(e){return yYt(e)||bYt(e)||gYt(e)||xYt()}function xYt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gYt(e,t){if(e){if(typeof e=="string")return Bte(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bte(e,t)}}function bYt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function yYt(e){if(Array.isArray(e))return Bte(e)}function Bte(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vYt(e,t){if(e==null)return{};var n=wYt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wYt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function r5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Wl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?r5e(Object(n),!0).forEach(function(r){CYt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CYt(e,t,n){return t=SYt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SYt(e){var t=NYt(e,"string");return v_(t)=="symbol"?t:t+""}function NYt(e,t){if(v_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(v_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function w_(){return w_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w_.apply(this,arguments)}var AYt=function(t){var n=t.value,r=t.formatter,s=xi(t.children)?n:t.children;return wi(r)?r(s):s},jYt=function(t,n){var r=em(n-t),s=Math.min(Math.abs(n-t),360);return r*s},EYt=function(t,n,r){var s=t.position,a=t.viewBox,o=t.offset,l=t.className,c=a,u=c.cx,d=c.cy,f=c.innerRadius,x=c.outerRadius,g=c.startAngle,v=c.endAngle,w=c.clockWise,C=(f+x)/2,N=jYt(g,v),I=N>=0?1:-1,P,R;s==="insideStart"?(P=g+I*o,R=w):s==="insideEnd"?(P=v-I*o,R=!w):s==="end"&&(P=v+I*o,R=w),R=N<=0?R:!R;var F=Qc(u,d,C,P),U=Qc(u,d,C,P+(R?1:-1)*359),L="M".concat(F.x,",").concat(F.y,`
    A`).concat(C,",").concat(C,",0,1,").concat(R?0:1,`,
    `).concat(U.x,",").concat(U.y),z=xi(t.id)?y5("recharts-radial-line-"):t.id;return Se.createElement("text",w_({},r,{dominantBaseline:"central",className:ta("recharts-radial-bar-label",l)}),Se.createElement("defs",null,Se.createElement("path",{id:z,d:L})),Se.createElement("textPath",{xlinkHref:"#".concat(z)},n))},_Yt=function(t){var n=t.viewBox,r=t.offset,s=t.position,a=n,o=a.cx,l=a.cy,c=a.innerRadius,u=a.outerRadius,d=a.startAngle,f=a.endAngle,x=(d+f)/2;if(s==="outside"){var g=Qc(o,l,u+r,x),v=g.x,w=g.y;return{x:v,y:w,textAnchor:v>=o?"start":"end",verticalAnchor:"middle"}}if(s==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(s==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(s==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var C=(c+u)/2,N=Qc(o,l,C,x),I=N.x,P=N.y;return{x:I,y:P,textAnchor:"middle",verticalAnchor:"middle"}},kYt=function(t){var n=t.viewBox,r=t.parentViewBox,s=t.offset,a=t.position,o=n,l=o.x,c=o.y,u=o.width,d=o.height,f=d>=0?1:-1,x=f*s,g=f>0?"end":"start",v=f>0?"start":"end",w=u>=0?1:-1,C=w*s,N=w>0?"end":"start",I=w>0?"start":"end";if(a==="top"){var P={x:l+u/2,y:c-f*s,textAnchor:"middle",verticalAnchor:g};return Wl(Wl({},P),r?{height:Math.max(c-r.y,0),width:u}:{})}if(a==="bottom"){var R={x:l+u/2,y:c+d+x,textAnchor:"middle",verticalAnchor:v};return Wl(Wl({},R),r?{height:Math.max(r.y+r.height-(c+d),0),width:u}:{})}if(a==="left"){var F={x:l-C,y:c+d/2,textAnchor:N,verticalAnchor:"middle"};return Wl(Wl({},F),r?{width:Math.max(F.x-r.x,0),height:d}:{})}if(a==="right"){var U={x:l+u+C,y:c+d/2,textAnchor:I,verticalAnchor:"middle"};return Wl(Wl({},U),r?{width:Math.max(r.x+r.width-U.x,0),height:d}:{})}var L=r?{width:u,height:d}:{};return a==="insideLeft"?Wl({x:l+C,y:c+d/2,textAnchor:I,verticalAnchor:"middle"},L):a==="insideRight"?Wl({x:l+u-C,y:c+d/2,textAnchor:N,verticalAnchor:"middle"},L):a==="insideTop"?Wl({x:l+u/2,y:c+x,textAnchor:"middle",verticalAnchor:v},L):a==="insideBottom"?Wl({x:l+u/2,y:c+d-x,textAnchor:"middle",verticalAnchor:g},L):a==="insideTopLeft"?Wl({x:l+C,y:c+x,textAnchor:I,verticalAnchor:v},L):a==="insideTopRight"?Wl({x:l+u-C,y:c+x,textAnchor:N,verticalAnchor:v},L):a==="insideBottomLeft"?Wl({x:l+C,y:c+d-x,textAnchor:I,verticalAnchor:g},L):a==="insideBottomRight"?Wl({x:l+u-C,y:c+d-x,textAnchor:N,verticalAnchor:g},L):GA(a)&&(Xr(a.x)||ew(a.x))&&(Xr(a.y)||ew(a.y))?Wl({x:l+V3(a.x,u),y:c+V3(a.y,d),textAnchor:"end",verticalAnchor:"end"},L):Wl({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},L)},TYt=function(t){return"cx"in t&&Xr(t.cx)};function Cu(e){var t=e.offset,n=t===void 0?5:t,r=vYt(e,pYt),s=Wl({offset:n},r),a=s.viewBox,o=s.position,l=s.value,c=s.children,u=s.content,d=s.className,f=d===void 0?"":d,x=s.textBreakAll;if(!a||xi(l)&&xi(c)&&!m.isValidElement(u)&&!wi(u))return null;if(m.isValidElement(u))return m.cloneElement(u,s);var g;if(wi(u)){if(g=m.createElement(u,s),m.isValidElement(g))return g}else g=AYt(s);var v=TYt(a),w=mi(s,!0);if(v&&(o==="insideStart"||o==="insideEnd"||o==="end"))return EYt(s,g,w);var C=v?_Yt(s):kYt(s);return Se.createElement(tL,w_({className:ta("recharts-label",f)},w,C,{breakAll:x}),g)}Cu.displayName="Label";var d$e=function(t){var n=t.cx,r=t.cy,s=t.angle,a=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,f=t.x,x=t.y,g=t.top,v=t.left,w=t.width,C=t.height,N=t.clockWise,I=t.labelViewBox;if(I)return I;if(Xr(w)&&Xr(C)){if(Xr(f)&&Xr(x))return{x:f,y:x,width:w,height:C};if(Xr(g)&&Xr(v))return{x:g,y:v,width:w,height:C}}return Xr(f)&&Xr(x)?{x:f,y:x,width:0,height:0}:Xr(n)&&Xr(r)?{cx:n,cy:r,startAngle:a||s||0,endAngle:o||s||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:N}:t.viewBox?t.viewBox:{}},IYt=function(t,n){return t?t===!0?Se.createElement(Cu,{key:"label-implicit",viewBox:n}):Xl(t)?Se.createElement(Cu,{key:"label-implicit",viewBox:n,value:t}):m.isValidElement(t)?t.type===Cu?m.cloneElement(t,{key:"label-implicit",viewBox:n}):Se.createElement(Cu,{key:"label-implicit",content:t,viewBox:n}):wi(t)?Se.createElement(Cu,{key:"label-implicit",content:t,viewBox:n}):GA(t)?Se.createElement(Cu,w_({viewBox:n},t,{key:"label-implicit"})):null:null},PYt=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var s=t.children,a=d$e(t),o=Qd(s,Cu).map(function(c,u){return m.cloneElement(c,{viewBox:n||a,key:"label-".concat(u)})});if(!r)return o;var l=IYt(t.label,n||a);return[l].concat(mYt(o))};Cu.parseViewBox=d$e;Cu.renderCallByParent=PYt;var oY,s5e;function FYt(){if(s5e)return oY;s5e=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return oY=e,oY}var OYt=FYt();const MYt=ji(OYt);function C_(e){"@babel/helpers - typeof";return C_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C_(e)}var RYt=["valueAccessor"],LYt=["data","dataKey","clockWise","id","textBreakAll"];function DYt(e){return zYt(e)||UYt(e)||$Yt(e)||BYt()}function BYt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $Yt(e,t){if(e){if(typeof e=="string")return $te(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $te(e,t)}}function UYt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zYt(e){if(Array.isArray(e))return $te(e)}function $te(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gL(){return gL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gL.apply(this,arguments)}function i5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function a5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?i5e(Object(n),!0).forEach(function(r){HYt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HYt(e,t,n){return t=VYt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VYt(e){var t=WYt(e,"string");return C_(t)=="symbol"?t:t+""}function WYt(e,t){if(C_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(C_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function o5e(e,t){if(e==null)return{};var n=qYt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qYt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var GYt=function(t){return Array.isArray(t.value)?MYt(t.value):t.value};function L0(e){var t=e.valueAccessor,n=t===void 0?GYt:t,r=o5e(e,RYt),s=r.data,a=r.dataKey,o=r.clockWise,l=r.id,c=r.textBreakAll,u=o5e(r,LYt);return!s||!s.length?null:Se.createElement(wa,{className:"recharts-label-list"},s.map(function(d,f){var x=xi(a)?n(d,f):Ql(d&&d.payload,a),g=xi(l)?{}:{id:"".concat(l,"-").concat(f)};return Se.createElement(Cu,gL({},mi(d,!0),u,g,{parentViewBox:d.parentViewBox,value:x,textBreakAll:c,viewBox:Cu.parseViewBox(xi(o)?d:a5e(a5e({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}L0.displayName="LabelList";function KYt(e,t){return e?e===!0?Se.createElement(L0,{key:"labelList-implicit",data:t}):Se.isValidElement(e)||wi(e)?Se.createElement(L0,{key:"labelList-implicit",data:t,content:e}):GA(e)?Se.createElement(L0,gL({data:t},e,{key:"labelList-implicit"})):null:null}function YYt(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,s=Qd(r,L0).map(function(o,l){return m.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return s;var a=KYt(e.label,t);return[a].concat(DYt(s))}L0.renderCallByParent=YYt;function S_(e){"@babel/helpers - typeof";return S_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S_(e)}function Ute(){return Ute=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ute.apply(this,arguments)}function l5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function c5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?l5e(Object(n),!0).forEach(function(r){XYt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function XYt(e,t,n){return t=QYt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QYt(e){var t=ZYt(e,"string");return S_(t)=="symbol"?t:t+""}function ZYt(e,t){if(S_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(S_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var JYt=function(t,n){var r=em(n-t),s=Math.min(Math.abs(n-t),359.999);return r*s},IP=function(t){var n=t.cx,r=t.cy,s=t.radius,a=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(l?1:-1)+s,f=Math.asin(c/d)/xL,x=u?a:a+o*f,g=Qc(n,r,d,x),v=Qc(n,r,s,x),w=u?a-o*f:a,C=Qc(n,r,d*Math.cos(f*xL),w);return{center:g,circleTangency:v,lineTangency:C,theta:f}},f$e=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,a=t.outerRadius,o=t.startAngle,l=t.endAngle,c=JYt(o,l),u=o+c,d=Qc(n,r,a,o),f=Qc(n,r,a,u),x="M ".concat(d.x,",").concat(d.y,`
    A `).concat(a,",").concat(a,`,0,
    `).concat(+(Math.abs(c)>180),",").concat(+(o>u),`,
    `).concat(f.x,",").concat(f.y,`
  `);if(s>0){var g=Qc(n,r,s,o),v=Qc(n,r,s,u);x+="L ".concat(v.x,",").concat(v.y,`
            A `).concat(s,",").concat(s,`,0,
            `).concat(+(Math.abs(c)>180),",").concat(+(o<=u),`,
            `).concat(g.x,",").concat(g.y," Z")}else x+="L ".concat(n,",").concat(r," Z");return x},eXt=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=em(d-u),x=IP({cx:n,cy:r,radius:a,angle:u,sign:f,cornerRadius:o,cornerIsExternal:c}),g=x.circleTangency,v=x.lineTangency,w=x.theta,C=IP({cx:n,cy:r,radius:a,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:c}),N=C.circleTangency,I=C.lineTangency,P=C.theta,R=c?Math.abs(u-d):Math.abs(u-d)-w-P;if(R<0)return l?"M ".concat(v.x,",").concat(v.y,`
        a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
        a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
      `):f$e({cx:n,cy:r,innerRadius:s,outerRadius:a,startAngle:u,endAngle:d});var F="M ".concat(v.x,",").concat(v.y,`
    A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(g.x,",").concat(g.y,`
    A`).concat(a,",").concat(a,",0,").concat(+(R>180),",").concat(+(f<0),",").concat(N.x,",").concat(N.y,`
    A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(I.x,",").concat(I.y,`
  `);if(s>0){var U=IP({cx:n,cy:r,radius:s,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),L=U.circleTangency,z=U.lineTangency,X=U.theta,ne=IP({cx:n,cy:r,radius:s,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),J=ne.circleTangency,Z=ne.lineTangency,re=ne.theta,he=c?Math.abs(u-d):Math.abs(u-d)-X-re;if(he<0&&o===0)return"".concat(F,"L").concat(n,",").concat(r,"Z");F+="L".concat(Z.x,",").concat(Z.y,`
      A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(J.x,",").concat(J.y,`
      A`).concat(s,",").concat(s,",0,").concat(+(he>180),",").concat(+(f>0),",").concat(L.x,",").concat(L.y,`
      A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(z.x,",").concat(z.y,"Z")}else F+="L".concat(n,",").concat(r,"Z");return F},tXt={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},h$e=function(t){var n=c5e(c5e({},tXt),t),r=n.cx,s=n.cy,a=n.innerRadius,o=n.outerRadius,l=n.cornerRadius,c=n.forceCornerRadius,u=n.cornerIsExternal,d=n.startAngle,f=n.endAngle,x=n.className;if(o<a||d===f)return null;var g=ta("recharts-sector",x),v=o-a,w=V3(l,v,0,!0),C;return w>0&&Math.abs(d-f)<360?C=eXt({cx:r,cy:s,innerRadius:a,outerRadius:o,cornerRadius:Math.min(w,v/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):C=f$e({cx:r,cy:s,innerRadius:a,outerRadius:o,startAngle:d,endAngle:f}),Se.createElement("path",Ute({},mi(n,!0),{className:g,d:C,role:"img"}))};function N_(e){"@babel/helpers - typeof";return N_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},N_(e)}function zte(){return zte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zte.apply(this,arguments)}function u5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function d5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?u5e(Object(n),!0).forEach(function(r){nXt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nXt(e,t,n){return t=rXt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rXt(e){var t=sXt(e,"string");return N_(t)=="symbol"?t:t+""}function sXt(e,t){if(N_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(N_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var f5e={curveBasisClosed:AUt,curveBasisOpen:jUt,curveBasis:NUt,curveBumpX:uUt,curveBumpY:dUt,curveLinearClosed:EUt,curveLinear:L$,curveMonotoneX:_Ut,curveMonotoneY:kUt,curveNatural:TUt,curveStep:IUt,curveStepAfter:FUt,curveStepBefore:PUt},PP=function(t){return t.x===+t.x&&t.y===+t.y},D7=function(t){return t.x},B7=function(t){return t.y},iXt=function(t,n){if(wi(t))return t;var r="curve".concat(M$(t));return(r==="curveMonotone"||r==="curveBump")&&n?f5e["".concat(r).concat(n==="vertical"?"Y":"X")]:f5e[r]||L$},aXt=function(t){var n=t.type,r=n===void 0?"linear":n,s=t.points,a=s===void 0?[]:s,o=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=iXt(r,l),f=u?a.filter(function(w){return PP(w)}):a,x;if(Array.isArray(o)){var g=u?o.filter(function(w){return PP(w)}):o,v=f.map(function(w,C){return d5e(d5e({},w),{},{base:g[C]})});return l==="vertical"?x=SP().y(B7).x1(D7).x0(function(w){return w.base.x}):x=SP().x(D7).y1(B7).y0(function(w){return w.base.y}),x.defined(PP).curve(d),x(v)}return l==="vertical"&&Xr(o)?x=SP().y(B7).x1(D7).x0(o):Xr(o)?x=SP().x(D7).y1(B7).y0(o):x=xDe().x(D7).y(B7),x.defined(PP).curve(d),x(f)},i3=function(t){var n=t.className,r=t.points,s=t.path,a=t.pathRef;if((!r||!r.length)&&!s)return null;var o=r&&r.length?aXt(t):s;return Se.createElement("path",zte({},mi(t,!1),VR(t),{className:ta("recharts-curve",n),d:o,ref:a}))},oXt=E$();const Ea=ji(oXt);var lXt=Object.getOwnPropertyNames,cXt=Object.getOwnPropertySymbols,uXt=Object.prototype.hasOwnProperty;function h5e(e,t){return function(r,s,a){return e(r,s,a)&&t(r,s,a)}}function FP(e){return function(n,r,s){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,s);var a=s.cache,o=a.get(n),l=a.get(r);if(o&&l)return o===r&&l===n;a.set(n,r),a.set(r,n);var c=e(n,r,s);return a.delete(n),a.delete(r),c}}function p5e(e){return lXt(e).concat(cXt(e))}var dXt=Object.hasOwn||function(e,t){return uXt.call(e,t)};function C5(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var fXt="__v",hXt="__o",pXt="_owner",m5e=Object.getOwnPropertyDescriptor,x5e=Object.keys;function mXt(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function xXt(e,t){return C5(e.getTime(),t.getTime())}function gXt(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function bXt(e,t){return e===t}function g5e(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var s=new Array(r),a=e.entries(),o,l,c=0;(o=a.next())&&!o.done;){for(var u=t.entries(),d=!1,f=0;(l=u.next())&&!l.done;){if(s[f]){f++;continue}var x=o.value,g=l.value;if(n.equals(x[0],g[0],c,f,e,t,n)&&n.equals(x[1],g[1],x[0],g[0],e,t,n)){d=s[f]=!0;break}f++}if(!d)return!1;c++}return!0}var yXt=C5;function vXt(e,t,n){var r=x5e(e),s=r.length;if(x5e(t).length!==s)return!1;for(;s-- >0;)if(!p$e(e,t,n,r[s]))return!1;return!0}function $7(e,t,n){var r=p5e(e),s=r.length;if(p5e(t).length!==s)return!1;for(var a,o,l;s-- >0;)if(a=r[s],!p$e(e,t,n,a)||(o=m5e(e,a),l=m5e(t,a),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function wXt(e,t){return C5(e.valueOf(),t.valueOf())}function CXt(e,t){return e.source===t.source&&e.flags===t.flags}function b5e(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var s=new Array(r),a=e.values(),o,l;(o=a.next())&&!o.done;){for(var c=t.values(),u=!1,d=0;(l=c.next())&&!l.done;){if(!s[d]&&n.equals(o.value,l.value,o.value,l.value,e,t,n)){u=s[d]=!0;break}d++}if(!u)return!1}return!0}function SXt(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function NXt(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function p$e(e,t,n,r){return(r===pXt||r===hXt||r===fXt)&&(e.$$typeof||t.$$typeof)?!0:dXt(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var AXt="[object Arguments]",jXt="[object Boolean]",EXt="[object Date]",_Xt="[object Error]",kXt="[object Map]",TXt="[object Number]",IXt="[object Object]",PXt="[object RegExp]",FXt="[object Set]",OXt="[object String]",MXt="[object URL]",RXt=Array.isArray,y5e=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,v5e=Object.assign,LXt=Object.prototype.toString.call.bind(Object.prototype.toString);function DXt(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areErrorsEqual,s=e.areFunctionsEqual,a=e.areMapsEqual,o=e.areNumbersEqual,l=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,d=e.areSetsEqual,f=e.areTypedArraysEqual,x=e.areUrlsEqual;return function(v,w,C){if(v===w)return!0;if(v==null||w==null)return!1;var N=typeof v;if(N!==typeof w)return!1;if(N!=="object")return N==="number"?o(v,w,C):N==="function"?s(v,w,C):!1;var I=v.constructor;if(I!==w.constructor)return!1;if(I===Object)return l(v,w,C);if(RXt(v))return t(v,w,C);if(y5e!=null&&y5e(v))return f(v,w,C);if(I===Date)return n(v,w,C);if(I===RegExp)return u(v,w,C);if(I===Map)return a(v,w,C);if(I===Set)return d(v,w,C);var P=LXt(v);return P===EXt?n(v,w,C):P===PXt?u(v,w,C):P===kXt?a(v,w,C):P===FXt?d(v,w,C):P===IXt?typeof v.then!="function"&&typeof w.then!="function"&&l(v,w,C):P===MXt?x(v,w,C):P===_Xt?r(v,w,C):P===AXt?l(v,w,C):P===jXt||P===TXt||P===OXt?c(v,w,C):!1}}function BXt(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,s={areArraysEqual:r?$7:mXt,areDatesEqual:xXt,areErrorsEqual:gXt,areFunctionsEqual:bXt,areMapsEqual:r?h5e(g5e,$7):g5e,areNumbersEqual:yXt,areObjectsEqual:r?$7:vXt,arePrimitiveWrappersEqual:wXt,areRegExpsEqual:CXt,areSetsEqual:r?h5e(b5e,$7):b5e,areTypedArraysEqual:r?$7:SXt,areUrlsEqual:NXt};if(n&&(s=v5e({},s,n(s))),t){var a=FP(s.areArraysEqual),o=FP(s.areMapsEqual),l=FP(s.areObjectsEqual),c=FP(s.areSetsEqual);s=v5e({},s,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:c})}return s}function $Xt(e){return function(t,n,r,s,a,o,l){return e(t,n,l)}}function UXt(e){var t=e.circular,n=e.comparator,r=e.createState,s=e.equals,a=e.strict;if(r)return function(c,u){var d=r(),f=d.cache,x=f===void 0?t?new WeakMap:void 0:f,g=d.meta;return n(c,u,{cache:x,equals:s,meta:g,strict:a})};if(t)return function(c,u){return n(c,u,{cache:new WeakMap,equals:s,meta:void 0,strict:a})};var o={cache:void 0,equals:s,meta:void 0,strict:a};return function(c,u){return n(c,u,o)}}var zXt=p2();p2({strict:!0});p2({circular:!0});p2({circular:!0,strict:!0});p2({createInternalComparator:function(){return C5}});p2({strict:!0,createInternalComparator:function(){return C5}});p2({circular:!0,createInternalComparator:function(){return C5}});p2({circular:!0,createInternalComparator:function(){return C5},strict:!0});function p2(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,s=e.createState,a=e.strict,o=a===void 0?!1:a,l=BXt(e),c=DXt(l),u=r?r(c):$Xt(c);return UXt({circular:n,comparator:c,createState:s,equals:u,strict:o})}function HXt(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function w5e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function s(a){n<0&&(n=a),a-n>t?(e(a),n=-1):HXt(s)};requestAnimationFrame(r)}function Hte(e){"@babel/helpers - typeof";return Hte=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hte(e)}function VXt(e){return KXt(e)||GXt(e)||qXt(e)||WXt()}function WXt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qXt(e,t){if(e){if(typeof e=="string")return C5e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return C5e(e,t)}}function C5e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function GXt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function KXt(e){if(Array.isArray(e))return e}function YXt(){var e={},t=function(){return null},n=!1,r=function s(a){if(!n){if(Array.isArray(a)){if(!a.length)return;var o=a,l=VXt(o),c=l[0],u=l.slice(1);if(typeof c=="number"){w5e(s.bind(null,u),c);return}s(c),w5e(s.bind(null,u));return}Hte(a)==="object"&&(e=a,t(e)),typeof a=="function"&&a()}};return{stop:function(){n=!0},start:function(a){n=!1,r(a)},subscribe:function(a){return t=a,function(){t=function(){return null}}}}}function A_(e){"@babel/helpers - typeof";return A_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A_(e)}function S5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function N5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?S5e(Object(n),!0).forEach(function(r){m$e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function m$e(e,t,n){return t=XXt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XXt(e){var t=QXt(e,"string");return A_(t)==="symbol"?t:String(t)}function QXt(e,t){if(A_(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(A_(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ZXt=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,s){return r.filter(function(a){return s.includes(a)})})},JXt=function(t){return t},eQt=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},a9=function(t,n){return Object.keys(n).reduce(function(r,s){return N5e(N5e({},r),{},m$e({},s,t(s,n[s])))},{})},A5e=function(t,n,r){return t.map(function(s){return"".concat(eQt(s)," ").concat(n,"ms ").concat(r)}).join(",")};function tQt(e,t){return sQt(e)||rQt(e,t)||x$e(e,t)||nQt()}function nQt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rQt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function sQt(e){if(Array.isArray(e))return e}function iQt(e){return lQt(e)||oQt(e)||x$e(e)||aQt()}function aQt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x$e(e,t){if(e){if(typeof e=="string")return Vte(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vte(e,t)}}function oQt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lQt(e){if(Array.isArray(e))return Vte(e)}function Vte(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var bL=1e-4,g$e=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},b$e=function(t,n){return t.map(function(r,s){return r*Math.pow(n,s)}).reduce(function(r,s){return r+s})},j5e=function(t,n){return function(r){var s=g$e(t,n);return b$e(s,r)}},cQt=function(t,n){return function(r){var s=g$e(t,n),a=[].concat(iQt(s.map(function(o,l){return o*l}).slice(1)),[0]);return b$e(a,r)}},E5e=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var s=n[0],a=n[1],o=n[2],l=n[3];if(n.length===1)switch(n[0]){case"linear":s=0,a=0,o=1,l=1;break;case"ease":s=.25,a=.1,o=.25,l=1;break;case"ease-in":s=.42,a=0,o=1,l=1;break;case"ease-out":s=.42,a=0,o=.58,l=1;break;case"ease-in-out":s=0,a=0,o=.58,l=1;break;default:{var c=n[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(C){return parseFloat(C)}),d=tQt(u,4);s=d[0],a=d[1],o=d[2],l=d[3]}}}var f=j5e(s,o),x=j5e(a,l),g=cQt(s,o),v=function(N){return N>1?1:N<0?0:N},w=function(N){for(var I=N>1?1:N,P=I,R=0;R<8;++R){var F=f(P)-I,U=g(P);if(Math.abs(F-I)<bL||U<bL)return x(P);P=v(P-F/U)}return x(P)};return w.isStepper=!1,w},uQt=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,s=t.damping,a=s===void 0?8:s,o=t.dt,l=o===void 0?17:o,c=function(d,f,x){var g=-(d-f)*r,v=x*a,w=x+(g-v)*l/1e3,C=x*l/1e3+d;return Math.abs(C-f)<bL&&Math.abs(w)<bL?[f,0]:[C,w]};return c.isStepper=!0,c.dt=l,c},dQt=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var s=n[0];if(typeof s=="string")switch(s){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return E5e(s);case"spring":return uQt();default:if(s.split("(")[0]==="cubic-bezier")return E5e(s)}return typeof s=="function"?s:null};function j_(e){"@babel/helpers - typeof";return j_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j_(e)}function _5e(e){return pQt(e)||hQt(e)||y$e(e)||fQt()}function fQt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hQt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pQt(e){if(Array.isArray(e))return qte(e)}function k5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function zc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k5e(Object(n),!0).forEach(function(r){Wte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wte(e,t,n){return t=mQt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mQt(e){var t=xQt(e,"string");return j_(t)==="symbol"?t:String(t)}function xQt(e,t){if(j_(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(j_(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gQt(e,t){return vQt(e)||yQt(e,t)||y$e(e,t)||bQt()}function bQt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y$e(e,t){if(e){if(typeof e=="string")return qte(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qte(e,t)}}function qte(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yQt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function vQt(e){if(Array.isArray(e))return e}var yL=function(t,n,r){return t+(n-t)*r},Gte=function(t){var n=t.from,r=t.to;return n!==r},wQt=function e(t,n,r){var s=a9(function(a,o){if(Gte(o)){var l=t(o.from,o.to,o.velocity),c=gQt(l,2),u=c[0],d=c[1];return zc(zc({},o),{},{from:u,velocity:d})}return o},n);return r<1?a9(function(a,o){return Gte(o)?zc(zc({},o),{},{velocity:yL(o.velocity,s[a].velocity,r),from:yL(o.from,s[a].from,r)}):o},n):e(t,s,r-1)};const CQt=function(e,t,n,r,s){var a=ZXt(e,t),o=a.reduce(function(C,N){return zc(zc({},C),{},Wte({},N,[e[N],t[N]]))},{}),l=a.reduce(function(C,N){return zc(zc({},C),{},Wte({},N,{from:e[N],velocity:0,to:t[N]}))},{}),c=-1,u,d,f=function(){return null},x=function(){return a9(function(N,I){return I.from},l)},g=function(){return!Object.values(l).filter(Gte).length},v=function(N){u||(u=N);var I=N-u,P=I/n.dt;l=wQt(n,l,P),s(zc(zc(zc({},e),t),x())),u=N,g()||(c=requestAnimationFrame(f))},w=function(N){d||(d=N);var I=(N-d)/r,P=a9(function(F,U){return yL.apply(void 0,_5e(U).concat([n(I)]))},o);if(s(zc(zc(zc({},e),t),P)),I<1)c=requestAnimationFrame(f);else{var R=a9(function(F,U){return yL.apply(void 0,_5e(U).concat([n(1)]))},o);s(zc(zc(zc({},e),t),R))}};return f=n.isStepper?v:w,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};function kN(e){"@babel/helpers - typeof";return kN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kN(e)}var SQt=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function NQt(e,t){if(e==null)return{};var n=AQt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function AQt(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function lY(e){return kQt(e)||_Qt(e)||EQt(e)||jQt()}function jQt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function EQt(e,t){if(e){if(typeof e=="string")return Kte(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kte(e,t)}}function _Qt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kQt(e){if(Array.isArray(e))return Kte(e)}function Kte(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function T5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ap(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?T5e(Object(n),!0).forEach(function(r){_j(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _j(e,t,n){return t=v$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TQt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IQt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,v$e(r.key),r)}}function PQt(e,t,n){return IQt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function v$e(e){var t=FQt(e,"string");return kN(t)==="symbol"?t:String(t)}function FQt(e,t){if(kN(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(kN(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function OQt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yte(e,t)}function Yte(e,t){return Yte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},Yte(e,t)}function MQt(e){var t=RQt();return function(){var r=vL(e),s;if(t){var a=vL(this).constructor;s=Reflect.construct(r,arguments,a)}else s=r.apply(this,arguments);return Xte(this,s)}}function Xte(e,t){if(t&&(kN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qte(e)}function Qte(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function RQt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function vL(e){return vL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},vL(e)}var pm=function(e){OQt(n,e);var t=MQt(n);function n(r,s){var a;TQt(this,n),a=t.call(this,r,s);var o=a.props,l=o.isActive,c=o.attributeName,u=o.from,d=o.to,f=o.steps,x=o.children,g=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(Qte(a)),a.changeStyle=a.changeStyle.bind(Qte(a)),!l||g<=0)return a.state={style:{}},typeof x=="function"&&(a.state={style:d}),Xte(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof x=="function")return a.state={style:u},Xte(a);a.state={style:c?_j({},c,u):u}}else a.state={style:{}};return a}return PQt(n,[{key:"componentDidMount",value:function(){var s=this.props,a=s.isActive,o=s.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(s){var a=this.props,o=a.isActive,l=a.canBegin,c=a.attributeName,u=a.shouldReAnimate,d=a.to,f=a.from,x=this.state.style;if(l){if(!o){var g={style:c?_j({},c,d):d};this.state&&x&&(c&&x[c]!==d||!c&&x!==d)&&this.setState(g);return}if(!(zXt(s.to,d)&&s.canBegin&&s.isActive)){var v=!s.canBegin||!s.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var w=v||u?f:s.to;if(this.state&&x){var C={style:c?_j({},c,w):w};(c&&x[c]!==w||!c&&x!==w)&&this.setState(C)}this.runAnimation(Ap(Ap({},this.props),{},{from:w,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var s=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),s&&s()}},{key:"handleStyleChange",value:function(s){this.changeStyle(s)}},{key:"changeStyle",value:function(s){this.mounted&&this.setState({style:s})}},{key:"runJSAnimation",value:function(s){var a=this,o=s.from,l=s.to,c=s.duration,u=s.easing,d=s.begin,f=s.onAnimationEnd,x=s.onAnimationStart,g=CQt(o,l,dQt(u),c,this.changeStyle),v=function(){a.stopJSAnimation=g()};this.manager.start([x,d,v,c,f])}},{key:"runStepAnimation",value:function(s){var a=this,o=s.steps,l=s.begin,c=s.onAnimationStart,u=o[0],d=u.style,f=u.duration,x=f===void 0?0:f,g=function(w,C,N){if(N===0)return w;var I=C.duration,P=C.easing,R=P===void 0?"ease":P,F=C.style,U=C.properties,L=C.onAnimationEnd,z=N>0?o[N-1]:C,X=U||Object.keys(F);if(typeof R=="function"||R==="spring")return[].concat(lY(w),[a.runJSAnimation.bind(a,{from:z.style,to:F,duration:I,easing:R}),I]);var ne=A5e(X,I,R),J=Ap(Ap(Ap({},z.style),F),{},{transition:ne});return[].concat(lY(w),[J,I,L]).filter(JXt)};return this.manager.start([c].concat(lY(o.reduce(g,[d,Math.max(x,l)])),[s.onAnimationEnd]))}},{key:"runAnimation",value:function(s){this.manager||(this.manager=YXt());var a=s.begin,o=s.duration,l=s.attributeName,c=s.to,u=s.easing,d=s.onAnimationStart,f=s.onAnimationEnd,x=s.steps,g=s.children,v=this.manager;if(this.unSubscribe=v.subscribe(this.handleStyleChange),typeof u=="function"||typeof g=="function"||u==="spring"){this.runJSAnimation(s);return}if(x.length>1){this.runStepAnimation(s);return}var w=l?_j({},l,c):c,C=A5e(Object.keys(w),o,u);v.start([d,a,Ap(Ap({},w),{},{transition:C}),o,f])}},{key:"render",value:function(){var s=this.props,a=s.children;s.begin;var o=s.duration;s.attributeName,s.easing;var l=s.isActive;s.steps,s.from,s.to,s.canBegin,s.onAnimationEnd,s.shouldReAnimate,s.onAnimationReStart;var c=NQt(s,SQt),u=m.Children.count(a),d=this.state.style;if(typeof a=="function")return a(d);if(!l||u===0||o<=0)return a;var f=function(g){var v=g.props,w=v.style,C=w===void 0?{}:w,N=v.className,I=m.cloneElement(g,Ap(Ap({},c),{},{style:Ap(Ap({},C),d),className:N}));return I};return u===1?f(m.Children.only(a)):Se.createElement("div",null,m.Children.map(a,function(x){return f(x)}))}}]),n}(m.PureComponent);pm.displayName="Animate";pm.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};pm.propTypes={from:Ea.oneOfType([Ea.object,Ea.string]),to:Ea.oneOfType([Ea.object,Ea.string]),attributeName:Ea.string,duration:Ea.number,begin:Ea.number,easing:Ea.oneOfType([Ea.string,Ea.func]),steps:Ea.arrayOf(Ea.shape({duration:Ea.number.isRequired,style:Ea.object.isRequired,easing:Ea.oneOfType([Ea.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Ea.func]),properties:Ea.arrayOf("string"),onAnimationEnd:Ea.func})),children:Ea.oneOfType([Ea.node,Ea.func]),isActive:Ea.bool,canBegin:Ea.bool,onAnimationEnd:Ea.func,shouldReAnimate:Ea.bool,onAnimationStart:Ea.func,onAnimationReStart:Ea.func};function E_(e){"@babel/helpers - typeof";return E_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E_(e)}function wL(){return wL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wL.apply(this,arguments)}function LQt(e,t){return UQt(e)||$Qt(e,t)||BQt(e,t)||DQt()}function DQt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BQt(e,t){if(e){if(typeof e=="string")return I5e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return I5e(e,t)}}function I5e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $Qt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function UQt(e){if(Array.isArray(e))return e}function P5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function F5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P5e(Object(n),!0).forEach(function(r){zQt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zQt(e,t,n){return t=HQt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HQt(e){var t=VQt(e,"string");return E_(t)=="symbol"?t:t+""}function VQt(e,t){if(E_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(E_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var O5e=function(t,n,r,s,a){var o=Math.min(Math.abs(r)/2,Math.abs(s)/2),l=s>=0?1:-1,c=r>=0?1:-1,u=s>=0&&r>=0||s<0&&r<0?1:0,d;if(o>0&&a instanceof Array){for(var f=[0,0,0,0],x=0,g=4;x<g;x++)f[x]=a[x]>o?o:a[x];d="M".concat(t,",").concat(n+l*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+c*f[0],",").concat(n)),d+="L ".concat(t+r-c*f[1],",").concat(n),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
        `).concat(t+r,",").concat(n+l*f[1])),d+="L ".concat(t+r,",").concat(n+s-l*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
        `).concat(t+r-c*f[2],",").concat(n+s)),d+="L ".concat(t+c*f[3],",").concat(n+s),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
        `).concat(t,",").concat(n+s-l*f[3])),d+="Z"}else if(o>0&&a===+a&&a>0){var v=Math.min(o,a);d="M ".concat(t,",").concat(n+l*v,`
            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+c*v,",").concat(n,`
            L `).concat(t+r-c*v,",").concat(n,`
            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+r,",").concat(n+l*v,`
            L `).concat(t+r,",").concat(n+s-l*v,`
            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+r-c*v,",").concat(n+s,`
            L `).concat(t+c*v,",").concat(n+s,`
            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t,",").concat(n+s-l*v," Z")}else d="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(s," h ").concat(-r," Z");return d},WQt=function(t,n){if(!t||!n)return!1;var r=t.x,s=t.y,a=n.x,o=n.y,l=n.width,c=n.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(a,a+l),d=Math.max(a,a+l),f=Math.min(o,o+c),x=Math.max(o,o+c);return r>=u&&r<=d&&s>=f&&s<=x}return!1},qQt={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},yce=function(t){var n=F5e(F5e({},qQt),t),r=m.useRef(),s=m.useState(-1),a=LQt(s,2),o=a[0],l=a[1];m.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var R=r.current.getTotalLength();R&&l(R)}catch{}},[]);var c=n.x,u=n.y,d=n.width,f=n.height,x=n.radius,g=n.className,v=n.animationEasing,w=n.animationDuration,C=n.animationBegin,N=n.isAnimationActive,I=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var P=ta("recharts-rectangle",g);return I?Se.createElement(pm,{canBegin:o>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:w,animationEasing:v,isActive:I},function(R){var F=R.width,U=R.height,L=R.x,z=R.y;return Se.createElement(pm,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:C,duration:w,isActive:N,easing:v},Se.createElement("path",wL({},mi(n,!0),{className:P,d:O5e(L,z,F,U,x),ref:r})))}):Se.createElement("path",wL({},mi(n,!0),{className:P,d:O5e(c,u,d,f,x)}))};function Zte(){return Zte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zte.apply(this,arguments)}var Z$=function(t){var n=t.cx,r=t.cy,s=t.r,a=t.className,o=ta("recharts-dot",a);return n===+n&&r===+r&&s===+s?Se.createElement("circle",Zte({},mi(t,!1),VR(t),{className:o,cx:n,cy:r,r:s})):null};function __(e){"@babel/helpers - typeof";return __=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},__(e)}var GQt=["x","y","top","left","width","height","className"];function Jte(){return Jte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jte.apply(this,arguments)}function M5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function KQt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M5e(Object(n),!0).forEach(function(r){YQt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YQt(e,t,n){return t=XQt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XQt(e){var t=QQt(e,"string");return __(t)=="symbol"?t:t+""}function QQt(e,t){if(__(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(__(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ZQt(e,t){if(e==null)return{};var n=JQt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function JQt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var eZt=function(t,n,r,s,a,o){return"M".concat(t,",").concat(a,"v").concat(s,"M").concat(o,",").concat(n,"h").concat(r)},tZt=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,a=s===void 0?0:s,o=t.top,l=o===void 0?0:o,c=t.left,u=c===void 0?0:c,d=t.width,f=d===void 0?0:d,x=t.height,g=x===void 0?0:x,v=t.className,w=ZQt(t,GQt),C=KQt({x:r,y:a,top:l,left:u,width:f,height:g},w);return!Xr(r)||!Xr(a)||!Xr(f)||!Xr(g)||!Xr(l)||!Xr(u)?null:Se.createElement("path",Jte({},mi(C,!0),{className:ta("recharts-cross",v),d:eZt(r,a,f,g,l,u)}))},cY,R5e;function nZt(){if(R5e)return cY;R5e=1;var e=BDe(),t=e(Object.getPrototypeOf,Object);return cY=t,cY}var uY,L5e;function rZt(){if(L5e)return uY;L5e=1;var e=S1(),t=nZt(),n=N1(),r="[object Object]",s=Function.prototype,a=Object.prototype,o=s.toString,l=a.hasOwnProperty,c=o.call(Object);function u(d){if(!n(d)||e(d)!=r)return!1;var f=t(d);if(f===null)return!0;var x=l.call(f,"constructor")&&f.constructor;return typeof x=="function"&&x instanceof x&&o.call(x)==c}return uY=u,uY}var sZt=rZt();const iZt=ji(sZt);var dY,D5e;function aZt(){if(D5e)return dY;D5e=1;var e=S1(),t=N1(),n="[object Boolean]";function r(s){return s===!0||s===!1||t(s)&&e(s)==n}return dY=r,dY}var oZt=aZt();const lZt=ji(oZt);function k_(e){"@babel/helpers - typeof";return k_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k_(e)}function CL(){return CL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},CL.apply(this,arguments)}function cZt(e,t){return hZt(e)||fZt(e,t)||dZt(e,t)||uZt()}function uZt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dZt(e,t){if(e){if(typeof e=="string")return B5e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return B5e(e,t)}}function B5e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fZt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function hZt(e){if(Array.isArray(e))return e}function $5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function U5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$5e(Object(n),!0).forEach(function(r){pZt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pZt(e,t,n){return t=mZt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mZt(e){var t=xZt(e,"string");return k_(t)=="symbol"?t:t+""}function xZt(e,t){if(k_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(k_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var z5e=function(t,n,r,s,a){var o=r-s,l;return l="M ".concat(t,",").concat(n),l+="L ".concat(t+r,",").concat(n),l+="L ".concat(t+r-o/2,",").concat(n+a),l+="L ".concat(t+r-o/2-s,",").concat(n+a),l+="L ".concat(t,",").concat(n," Z"),l},gZt={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},bZt=function(t){var n=U5e(U5e({},gZt),t),r=m.useRef(),s=m.useState(-1),a=cZt(s,2),o=a[0],l=a[1];m.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var P=r.current.getTotalLength();P&&l(P)}catch{}},[]);var c=n.x,u=n.y,d=n.upperWidth,f=n.lowerWidth,x=n.height,g=n.className,v=n.animationEasing,w=n.animationDuration,C=n.animationBegin,N=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||x!==+x||d===0&&f===0||x===0)return null;var I=ta("recharts-trapezoid",g);return N?Se.createElement(pm,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:x,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:x,x:c,y:u},duration:w,animationEasing:v,isActive:N},function(P){var R=P.upperWidth,F=P.lowerWidth,U=P.height,L=P.x,z=P.y;return Se.createElement(pm,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:C,duration:w,easing:v},Se.createElement("path",CL({},mi(n,!0),{className:I,d:z5e(L,z,R,F,U),ref:r})))}):Se.createElement("g",null,Se.createElement("path",CL({},mi(n,!0),{className:I,d:z5e(c,u,d,f,x)})))},yZt=["option","shapeType","propTransformer","activeClassName","isActive"];function T_(e){"@babel/helpers - typeof";return T_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T_(e)}function vZt(e,t){if(e==null)return{};var n=wZt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wZt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function H5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function SL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?H5e(Object(n),!0).forEach(function(r){CZt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CZt(e,t,n){return t=SZt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SZt(e){var t=NZt(e,"string");return T_(t)=="symbol"?t:t+""}function NZt(e,t){if(T_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(T_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function AZt(e,t){return SL(SL({},t),e)}function jZt(e,t){return e==="symbols"}function V5e(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return Se.createElement(yce,n);case"trapezoid":return Se.createElement(bZt,n);case"sector":return Se.createElement(h$e,n);case"symbols":if(jZt(t))return Se.createElement(B$,n);break;default:return null}}function EZt(e){return m.isValidElement(e)?e.props:e}function ene(e){var t=e.option,n=e.shapeType,r=e.propTransformer,s=r===void 0?AZt:r,a=e.activeClassName,o=a===void 0?"recharts-active-shape":a,l=e.isActive,c=vZt(e,yZt),u;if(m.isValidElement(t))u=m.cloneElement(t,SL(SL({},c),EZt(t)));else if(wi(t))u=t(c);else if(iZt(t)&&!lZt(t)){var d=s(t,c);u=Se.createElement(V5e,{shapeType:n,elementProps:d})}else{var f=c;u=Se.createElement(V5e,{shapeType:n,elementProps:f})}return l?Se.createElement(wa,{className:o},u):u}function J$(e,t){return t!=null&&"trapezoids"in e.props}function eU(e,t){return t!=null&&"sectors"in e.props}function I_(e,t){return t!=null&&"points"in e.props}function _Zt(e,t){var n,r,s=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,a=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return s&&a}function kZt(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function TZt(e,t){var n=e.x===t.x,r=e.y===t.y,s=e.z===t.z;return n&&r&&s}function IZt(e,t){var n;return J$(e,t)?n=_Zt:eU(e,t)?n=kZt:I_(e,t)&&(n=TZt),n}function PZt(e,t){var n;return J$(e,t)?n="trapezoids":eU(e,t)?n="sectors":I_(e,t)&&(n="points"),n}function FZt(e,t){if(J$(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(eU(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return I_(e,t)?t.payload:{}}function OZt(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,s=PZt(n,t),a=FZt(n,t),o=r.filter(function(c,u){var d=W3(a,c),f=n.props[s].filter(function(v){var w=IZt(n,t);return w(v,t)}),x=n.props[s].indexOf(f[f.length-1]),g=u===x;return d&&g}),l=r.indexOf(o[o.length-1]);return l}var fY,W5e;function MZt(){if(W5e)return fY;W5e=1;var e=Math.ceil,t=Math.max;function n(r,s,a,o){for(var l=-1,c=t(e((s-r)/(a||1)),0),u=Array(c);c--;)u[o?c:++l]=r,r+=a;return u}return fY=n,fY}var hY,q5e;function w$e(){if(q5e)return hY;q5e=1;var e=tBe(),t=1/0,n=17976931348623157e292;function r(s){if(!s)return s===0?s:0;if(s=e(s),s===t||s===-1/0){var a=s<0?-1:1;return a*n}return s===s?s:0}return hY=r,hY}var pY,G5e;function RZt(){if(G5e)return pY;G5e=1;var e=MZt(),t=z$(),n=w$e();function r(s){return function(a,o,l){return l&&typeof l!="number"&&t(a,o,l)&&(o=l=void 0),a=n(a),o===void 0?(o=a,a=0):o=n(o),l=l===void 0?a<o?1:-1:n(l),e(a,o,l,s)}}return pY=r,pY}var mY,K5e;function LZt(){if(K5e)return mY;K5e=1;var e=RZt(),t=e();return mY=t,mY}var DZt=LZt();const NL=ji(DZt);function P_(e){"@babel/helpers - typeof";return P_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P_(e)}function Y5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function X5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Y5e(Object(n),!0).forEach(function(r){C$e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function C$e(e,t,n){return t=BZt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BZt(e){var t=$Zt(e,"string");return P_(t)=="symbol"?t:t+""}function $Zt(e,t){if(P_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(P_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var UZt=["Webkit","Moz","O","ms"],zZt=function(t,n){var r=t.replace(/(\w)/,function(a){return a.toUpperCase()}),s=UZt.reduce(function(a,o){return X5e(X5e({},a),{},C$e({},o+r,n))},{});return s[t]=n,s};function TN(e){"@babel/helpers - typeof";return TN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},TN(e)}function AL(){return AL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},AL.apply(this,arguments)}function Q5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function xY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Q5e(Object(n),!0).forEach(function(r){Sf(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q5e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HZt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Z5e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,N$e(r.key),r)}}function VZt(e,t,n){return Z5e(e.prototype,t),Z5e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function WZt(e,t,n){return t=jL(t),qZt(e,S$e()?Reflect.construct(t,n,jL(e).constructor):t.apply(e,n))}function qZt(e,t){if(t&&(TN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return GZt(e)}function GZt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(S$e=function(){return!!e})()}function jL(e){return jL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},jL(e)}function KZt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tne(e,t)}function tne(e,t){return tne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},tne(e,t)}function Sf(e,t,n){return t=N$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N$e(e){var t=YZt(e,"string");return TN(t)=="symbol"?t:t+""}function YZt(e,t){if(TN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(TN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var XZt=function(t){var n=t.data,r=t.startIndex,s=t.endIndex,a=t.x,o=t.width,l=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,u=s9().domain(NL(0,c)).range([a,a+o-l]),d=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(r),endX:u(s),scale:u,scaleValues:d}},J5e=function(t){return t.changedTouches&&!!t.changedTouches.length},IN=function(e){function t(n){var r;return HZt(this,t),r=WZt(this,t,[n]),Sf(r,"handleDrag",function(s){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(s):r.state.isSlideMoving&&r.handleSlideDrag(s)}),Sf(r,"handleTouchMove",function(s){s.changedTouches!=null&&s.changedTouches.length>0&&r.handleDrag(s.changedTouches[0])}),Sf(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var s=r.props,a=s.endIndex,o=s.onDragEnd,l=s.startIndex;o==null||o({endIndex:a,startIndex:l})}),r.detachDragEndListener()}),Sf(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Sf(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Sf(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Sf(r,"handleSlideDragStart",function(s){var a=J5e(s)?s.changedTouches[0]:s;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return KZt(t,e),VZt(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var s=r.startX,a=r.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,f=Math.min(s,a),x=Math.max(s,a),g=t.getIndexInRange(o,f),v=t.getIndexInRange(o,x);return{startIndex:g-g%c,endIndex:v===d?d:v-v%c}}},{key:"getTextOfTick",value:function(r){var s=this.props,a=s.data,o=s.tickFormatter,l=s.dataKey,c=Ql(a[r],l,r);return wi(o)?o(c,r):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var s=this.state,a=s.slideMoveStartX,o=s.startX,l=s.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,x=c.startIndex,g=c.endIndex,v=c.onChange,w=r.pageX-a;w>0?w=Math.min(w,u+d-f-l,u+d-f-o):w<0&&(w=Math.max(w,u-o,u-l));var C=this.getIndex({startX:o+w,endX:l+w});(C.startIndex!==x||C.endIndex!==g)&&v&&v(C),this.setState({startX:o+w,endX:l+w,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,s){var a=J5e(s)?s.changedTouches[0]:s;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var s=this.state,a=s.brushMoveStartX,o=s.movingTravellerId,l=s.endX,c=s.startX,u=this.state[o],d=this.props,f=d.x,x=d.width,g=d.travellerWidth,v=d.onChange,w=d.gap,C=d.data,N={startX:this.state.startX,endX:this.state.endX},I=r.pageX-a;I>0?I=Math.min(I,f+x-g-u):I<0&&(I=Math.max(I,f-u)),N[o]=u+I;var P=this.getIndex(N),R=P.startIndex,F=P.endIndex,U=function(){var z=C.length-1;return o==="startX"&&(l>c?R%w===0:F%w===0)||l<c&&F===z||o==="endX"&&(l>c?F%w===0:R%w===0)||l>c&&F===z};this.setState(Sf(Sf({},o,u+I),"brushMoveStartX",r.pageX),function(){v&&U()&&v(P)})}},{key:"handleTravellerMoveKeyboard",value:function(r,s){var a=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,d=this.state[s],f=l.indexOf(d);if(f!==-1){var x=f+r;if(!(x===-1||x>=l.length)){var g=l[x];s==="startX"&&g>=u||s==="endX"&&g<=c||this.setState(Sf({},s,g),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,s=r.x,a=r.y,o=r.width,l=r.height,c=r.fill,u=r.stroke;return Se.createElement("rect",{stroke:u,fill:c,x:s,y:a,width:o,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,s=r.x,a=r.y,o=r.width,l=r.height,c=r.data,u=r.children,d=r.padding,f=m.Children.only(u);return f?Se.cloneElement(f,{x:s,y:a,width:o,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,s){var a,o,l=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,x=c.traveller,g=c.ariaLabel,v=c.data,w=c.startIndex,C=c.endIndex,N=Math.max(r,this.props.x),I=xY(xY({},mi(this.props,!1)),{},{x:N,y:u,width:d,height:f}),P=g||"Min value: ".concat((a=v[w])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=v[C])===null||o===void 0?void 0:o.name);return Se.createElement(wa,{tabIndex:0,role:"slider","aria-label":P,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[s],onTouchStart:this.travellerDragStartHandlers[s],onKeyDown:function(F){["ArrowLeft","ArrowRight"].includes(F.key)&&(F.preventDefault(),F.stopPropagation(),l.handleTravellerMoveKeyboard(F.key==="ArrowRight"?1:-1,s))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(x,I))}},{key:"renderSlide",value:function(r,s){var a=this.props,o=a.y,l=a.height,c=a.stroke,u=a.travellerWidth,d=Math.min(r,s)+u,f=Math.max(Math.abs(s-r)-u,0);return Se.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:o,width:f,height:l})}},{key:"renderText",value:function(){var r=this.props,s=r.startIndex,a=r.endIndex,o=r.y,l=r.height,c=r.travellerWidth,u=r.stroke,d=this.state,f=d.startX,x=d.endX,g=5,v={pointerEvents:"none",fill:u};return Se.createElement(wa,{className:"recharts-brush-texts"},Se.createElement(tL,AL({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,x)-g,y:o+l/2},v),this.getTextOfTick(s)),Se.createElement(tL,AL({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,x)+c+g,y:o+l/2},v),this.getTextOfTick(a)))}},{key:"render",value:function(){var r=this.props,s=r.data,a=r.className,o=r.children,l=r.x,c=r.y,u=r.width,d=r.height,f=r.alwaysShowText,x=this.state,g=x.startX,v=x.endX,w=x.isTextActive,C=x.isSlideMoving,N=x.isTravellerMoving,I=x.isTravellerFocused;if(!s||!s.length||!Xr(l)||!Xr(c)||!Xr(u)||!Xr(d)||u<=0||d<=0)return null;var P=ta("recharts-brush",a),R=Se.Children.count(o)===1,F=zZt("userSelect","none");return Se.createElement(wa,{className:P,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:F},this.renderBackground(),R&&this.renderPanorama(),this.renderSlide(g,v),this.renderTravellerLayer(g,"startX"),this.renderTravellerLayer(v,"endX"),(w||C||N||I||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var s=r.x,a=r.y,o=r.width,l=r.height,c=r.stroke,u=Math.floor(a+l/2)-1;return Se.createElement(Se.Fragment,null,Se.createElement("rect",{x:s,y:a,width:o,height:l,fill:c,stroke:"none"}),Se.createElement("line",{x1:s+1,y1:u,x2:s+o-1,y2:u,fill:"none",stroke:"#fff"}),Se.createElement("line",{x1:s+1,y1:u+2,x2:s+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,s){var a;return Se.isValidElement(r)?a=Se.cloneElement(r,s):wi(r)?a=r(s):a=t.renderDefaultTraveller(s),a}},{key:"getDerivedStateFromProps",value:function(r,s){var a=r.data,o=r.width,l=r.x,c=r.travellerWidth,u=r.updateId,d=r.startIndex,f=r.endIndex;if(a!==s.prevData||u!==s.prevUpdateId)return xY({prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},a&&a.length?XZt({data:a,width:o,x:l,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(s.scale&&(o!==s.prevWidth||l!==s.prevX||c!==s.prevTravellerWidth)){s.scale.range([l,l+o-c]);var x=s.scale.domain().map(function(g){return s.scale(g)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:s.scale(r.startIndex),endX:s.scale(r.endIndex),scaleValues:x}}return null}},{key:"getIndexInRange",value:function(r,s){for(var a=r.length,o=0,l=a-1;l-o>1;){var c=Math.floor((o+l)/2);r[c]>s?l=c:o=c}return s>=r[l]?l:o}}])}(m.PureComponent);Sf(IN,"displayName","Brush");Sf(IN,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var gY,e6e;function QZt(){if(e6e)return gY;e6e=1;var e=Vle();function t(n,r){var s;return e(n,function(a,o,l){return s=r(a,o,l),!s}),!!s}return gY=t,gY}var bY,t6e;function ZZt(){if(t6e)return bY;t6e=1;var e=PDe(),t=d2(),n=QZt(),r=rf(),s=z$();function a(o,l,c){var u=r(o)?e:n;return c&&s(o,l,c)&&(l=void 0),u(o,t(l,3))}return bY=a,bY}var JZt=ZZt();const eJt=ji(JZt);var D0=function(t,n){var r=t.alwaysShow,s=t.ifOverflow;return r&&(s="extendDomain"),s===n},yY,n6e;function tJt(){if(n6e)return yY;n6e=1;var e=XDe();function t(n,r,s){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:s,writable:!0}):n[r]=s}return yY=t,yY}var vY,r6e;function nJt(){if(r6e)return vY;r6e=1;var e=tJt(),t=KDe(),n=d2();function r(s,a){var o={};return a=n(a,3),t(s,function(l,c,u){e(o,c,a(l,c,u))}),o}return vY=r,vY}var rJt=nJt();const sJt=ji(rJt);var wY,s6e;function iJt(){if(s6e)return wY;s6e=1;function e(t,n){for(var r=-1,s=t==null?0:t.length;++r<s;)if(!n(t[r],r,t))return!1;return!0}return wY=e,wY}var CY,i6e;function aJt(){if(i6e)return CY;i6e=1;var e=Vle();function t(n,r){var s=!0;return e(n,function(a,o,l){return s=!!r(a,o,l),s}),s}return CY=t,CY}var SY,a6e;function oJt(){if(a6e)return SY;a6e=1;var e=iJt(),t=aJt(),n=d2(),r=rf(),s=z$();function a(o,l,c){var u=r(o)?e:t;return c&&s(o,l,c)&&(l=void 0),u(o,n(l,3))}return SY=a,SY}var lJt=oJt();const A$e=ji(lJt);var cJt=["x","y"];function F_(e){"@babel/helpers - typeof";return F_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},F_(e)}function nne(){return nne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nne.apply(this,arguments)}function o6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function U7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o6e(Object(n),!0).forEach(function(r){uJt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uJt(e,t,n){return t=dJt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dJt(e){var t=fJt(e,"string");return F_(t)=="symbol"?t:t+""}function fJt(e,t){if(F_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(F_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hJt(e,t){if(e==null)return{};var n=pJt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function pJt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function mJt(e,t){var n=e.x,r=e.y,s=hJt(e,cJt),a="".concat(n),o=parseInt(a,10),l="".concat(r),c=parseInt(l,10),u="".concat(t.height||s.height),d=parseInt(u,10),f="".concat(t.width||s.width),x=parseInt(f,10);return U7(U7(U7(U7(U7({},t),s),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:x,name:t.name,radius:t.radius})}function l6e(e){return Se.createElement(ene,nne({shapeType:"rectangle",propTransformer:mJt,activeClassName:"recharts-active-bar"},e))}var xJt=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,s){if(typeof t=="number")return t;var a=typeof r=="number";return a?t(r,s):(a||G3(),n)}},gJt=["value","background"],j$e;function PN(e){"@babel/helpers - typeof";return PN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},PN(e)}function bJt(e,t){if(e==null)return{};var n=yJt(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function yJt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function EL(){return EL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},EL.apply(this,arguments)}function c6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function _l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?c6e(Object(n),!0).forEach(function(r){py(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vJt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_$e(r.key),r)}}function wJt(e,t,n){return u6e(e.prototype,t),u6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function CJt(e,t,n){return t=_L(t),SJt(e,E$e()?Reflect.construct(t,n,_L(e).constructor):t.apply(e,n))}function SJt(e,t){if(t&&(PN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return NJt(e)}function NJt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(E$e=function(){return!!e})()}function _L(e){return _L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_L(e)}function AJt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rne(e,t)}function rne(e,t){return rne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},rne(e,t)}function py(e,t,n){return t=_$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _$e(e){var t=jJt(e,"string");return PN(t)=="symbol"?t:t+""}function jJt(e,t){if(PN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(PN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var e8=function(e){function t(){var n;vJt(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=CJt(this,t,[].concat(s)),py(n,"state",{isAnimationFinished:!1}),py(n,"id",y5("recharts-bar-")),py(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),py(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return AJt(t,e),wJt(t,[{key:"renderRectanglesStatically",value:function(r){var s=this,a=this.props,o=a.shape,l=a.dataKey,c=a.activeIndex,u=a.activeBar,d=mi(this.props,!1);return r&&r.map(function(f,x){var g=x===c,v=g?u:o,w=_l(_l(_l({},d),f),{},{isActive:g,option:v,index:x,dataKey:l,onAnimationStart:s.handleAnimationStart,onAnimationEnd:s.handleAnimationEnd});return Se.createElement(wa,EL({className:"recharts-bar-rectangle"},n_(s.props,f,x),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(x)}),Se.createElement(l6e,w))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,s=this.props,a=s.data,o=s.layout,l=s.isAnimationActive,c=s.animationBegin,u=s.animationDuration,d=s.animationEasing,f=s.animationId,x=this.state.prevData;return Se.createElement(pm,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(g){var v=g.t,w=a.map(function(C,N){var I=x&&x[N];if(I){var P=bl(I.x,C.x),R=bl(I.y,C.y),F=bl(I.width,C.width),U=bl(I.height,C.height);return _l(_l({},C),{},{x:P(v),y:R(v),width:F(v),height:U(v)})}if(o==="horizontal"){var L=bl(0,C.height),z=L(v);return _l(_l({},C),{},{y:C.y+C.height-z,height:z})}var X=bl(0,C.width),ne=X(v);return _l(_l({},C),{},{width:ne})});return Se.createElement(wa,null,r.renderRectanglesStatically(w))})}},{key:"renderRectangles",value:function(){var r=this.props,s=r.data,a=r.isAnimationActive,o=this.state.prevData;return a&&s&&s.length&&(!o||!W3(o,s))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(s)}},{key:"renderBackground",value:function(){var r=this,s=this.props,a=s.data,o=s.dataKey,l=s.activeIndex,c=mi(this.props.background,!1);return a.map(function(u,d){u.value;var f=u.background,x=bJt(u,gJt);if(!f)return null;var g=_l(_l(_l(_l(_l({},x),{},{fill:"#eee"},f),c),n_(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:d,className:"recharts-bar-background-rectangle"});return Se.createElement(l6e,EL({key:"background-bar-".concat(d),option:r.props.background,isActive:d===l},g))})}},{key:"renderErrorBar",value:function(r,s){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.data,l=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,f=Qd(d,JA);if(!f)return null;var x=u==="vertical"?o[0].height/2:o[0].width/2,g=function(C,N){var I=Array.isArray(C.value)?C.value[1]:C.value;return{x:C.x,y:C.y,value:I,errorVal:Ql(C,N)}},v={clipPath:r?"url(#clipPath-".concat(s,")"):null};return Se.createElement(wa,v,f.map(function(w){return Se.cloneElement(w,{key:"error-bar-".concat(s,"-").concat(w.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:x,dataPointFormatter:g})}))}},{key:"render",value:function(){var r=this.props,s=r.hide,a=r.data,o=r.className,l=r.xAxis,c=r.yAxis,u=r.left,d=r.top,f=r.width,x=r.height,g=r.isAnimationActive,v=r.background,w=r.id;if(s||!a||!a.length)return null;var C=this.state.isAnimationFinished,N=ta("recharts-bar",o),I=l&&l.allowDataOverflow,P=c&&c.allowDataOverflow,R=I||P,F=xi(w)?this.id:w;return Se.createElement(wa,{className:N},I||P?Se.createElement("defs",null,Se.createElement("clipPath",{id:"clipPath-".concat(F)},Se.createElement("rect",{x:I?u:u-f/2,y:P?d:d-x/2,width:I?f:f*2,height:P?x:x*2}))):null,Se.createElement(wa,{className:"recharts-bar-rectangles",clipPath:R?"url(#clipPath-".concat(F,")"):null},v?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(R,F),(!g||C)&&L0.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:s.curData}:r.data!==s.curData?{curData:r.data}:null}}])}(m.PureComponent);j$e=e8;py(e8,"displayName","Bar");py(e8,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!am.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});py(e8,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,s=e.bandSize,a=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,x=e.offset,g=YKt(r,n);if(!g)return null;var v=t.layout,w=n.type.defaultProps,C=w!==void 0?_l(_l({},w),n.props):n.props,N=C.dataKey,I=C.children,P=C.minPointSize,R=v==="horizontal"?o:a,F=u?R.scale.domain():null,U=rYt({numericAxis:R}),L=Qd(I,Gle),z=f.map(function(X,ne){var J,Z,re,he,Y,ie;u?J=XKt(u[d+ne],F):(J=Ql(X,N),Array.isArray(J)||(J=[U,J]));var oe=xJt(P,j$e.defaultProps.minPointSize)(J[1],ne);if(v==="horizontal"){var G,V=[o.scale(J[0]),o.scale(J[1])],ee=V[0],ae=V[1];Z=X3e({axis:a,ticks:l,bandSize:s,offset:g.offset,entry:X,index:ne}),re=(G=ae??ee)!==null&&G!==void 0?G:void 0,he=g.size;var fe=ee-ae;if(Y=Number.isNaN(fe)?0:fe,ie={x:Z,y:o.y,width:he,height:o.height},Math.abs(oe)>0&&Math.abs(Y)<Math.abs(oe)){var Ae=em(Y||oe)*(Math.abs(oe)-Math.abs(Y));re-=Ae,Y+=Ae}}else{var ce=[a.scale(J[0]),a.scale(J[1])],ye=ce[0],Ne=ce[1];if(Z=ye,re=X3e({axis:o,ticks:c,bandSize:s,offset:g.offset,entry:X,index:ne}),he=Ne-ye,Y=g.size,ie={x:a.x,y:re,width:a.width,height:Y},Math.abs(oe)>0&&Math.abs(he)<Math.abs(oe)){var be=em(he||oe)*(Math.abs(oe)-Math.abs(he));he+=be}}return _l(_l(_l({},X),{},{x:Z,y:re,width:he,height:Y,value:u?J:J[1],payload:X,background:ie},L[ne]&&L[ne].props),{},{tooltipPayload:[u$e(n,X)],tooltipPosition:{x:Z+he/2,y:re+Y/2}})});return _l({data:z,layout:v},x)});function O_(e){"@babel/helpers - typeof";return O_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O_(e)}function EJt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,k$e(r.key),r)}}function _Jt(e,t,n){return d6e(e.prototype,t),d6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function f6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Hp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f6e(Object(n),!0).forEach(function(r){tU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tU(e,t,n){return t=k$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k$e(e){var t=kJt(e,"string");return O_(t)=="symbol"?t:t+""}function kJt(e,t){if(O_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(O_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var T$e=function(t,n,r,s,a){var o=t.width,l=t.height,c=t.layout,u=t.children,d=Object.keys(n),f={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:l-r.bottom,bottomMirror:l-r.bottom},x=!!_f(u,e8);return d.reduce(function(g,v){var w=n[v],C=w.orientation,N=w.domain,I=w.padding,P=I===void 0?{}:I,R=w.mirror,F=w.reversed,U="".concat(C).concat(R?"Mirror":""),L,z,X,ne,J;if(w.type==="number"&&(w.padding==="gap"||w.padding==="no-gap")){var Z=N[1]-N[0],re=1/0,he=w.categoricalDomain.sort(M$t);if(he.forEach(function(ce,ye){ye>0&&(re=Math.min((ce||0)-(he[ye-1]||0),re))}),Number.isFinite(re)){var Y=re/Z,ie=w.layout==="vertical"?r.height:r.width;if(w.padding==="gap"&&(L=Y*ie/2),w.padding==="no-gap"){var oe=V3(t.barCategoryGap,Y*ie),G=Y*ie/2;L=G-oe-(G-oe)/ie*oe}}}s==="xAxis"?z=[r.left+(P.left||0)+(L||0),r.left+r.width-(P.right||0)-(L||0)]:s==="yAxis"?z=c==="horizontal"?[r.top+r.height-(P.bottom||0),r.top+(P.top||0)]:[r.top+(P.top||0)+(L||0),r.top+r.height-(P.bottom||0)-(L||0)]:z=w.range,F&&(z=[z[1],z[0]]);var V=GKt(w,a,x),ee=V.scale,ae=V.realScaleType;ee.domain(N).range(z),KKt(ee);var fe=nYt(ee,Hp(Hp({},w),{},{realScaleType:ae}));s==="xAxis"?(J=C==="top"&&!R||C==="bottom"&&R,X=r.left,ne=f[U]-J*w.height):s==="yAxis"&&(J=C==="left"&&!R||C==="right"&&R,X=f[U]-J*w.width,ne=r.top);var Ae=Hp(Hp(Hp({},w),fe),{},{realScaleType:ae,x:X,y:ne,scale:ee,width:s==="xAxis"?r.width:w.width,height:s==="yAxis"?r.height:w.height});return Ae.bandSize=mL(Ae,fe),!w.hide&&s==="xAxis"?f[U]+=(J?-1:1)*Ae.height:w.hide||(f[U]+=(J?-1:1)*Ae.width),Hp(Hp({},g),{},tU({},v,Ae))},{})},I$e=function(t,n){var r=t.x,s=t.y,a=n.x,o=n.y;return{x:Math.min(r,a),y:Math.min(s,o),width:Math.abs(a-r),height:Math.abs(o-s)}},TJt=function(t){var n=t.x1,r=t.y1,s=t.x2,a=t.y2;return I$e({x:n,y:r},{x:s,y:a})},P$e=function(){function e(t){EJt(this,e),this.scale=t}return _Jt(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.bandAware,a=r.position;if(n!==void 0){if(a)switch(a){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(s){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),s=r[0],a=r[r.length-1];return s<=a?n>=s&&n<=a:n>=a&&n<=s}}],[{key:"create",value:function(n){return new e(n)}}])}();tU(P$e,"EPS",1e-4);var vce=function(t){var n=Object.keys(t).reduce(function(r,s){return Hp(Hp({},r),{},tU({},s,P$e.create(t[s])))},{});return Hp(Hp({},n),{},{apply:function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,l=a.position;return sJt(s,function(c,u){return n[u].apply(c,{bandAware:o,position:l})})},isInRange:function(s){return A$e(s,function(a,o){return n[o].isInRange(a)})}})};function IJt(e){return(e%180+180)%180}var PJt=function(t){var n=t.width,r=t.height,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=IJt(s),o=a*Math.PI/180,l=Math.atan(r/n),c=o>l&&o<Math.PI-l?r/Math.sin(o):n/Math.cos(o);return Math.abs(c)},NY,h6e;function FJt(){if(h6e)return NY;h6e=1;var e=d2(),t=lT(),n=$$();function r(s){return function(a,o,l){var c=Object(a);if(!t(a)){var u=e(o,3);a=n(a),o=function(f){return u(c[f],f,c)}}var d=s(a,o,l);return d>-1?c[u?a[d]:d]:void 0}}return NY=r,NY}var AY,p6e;function OJt(){if(p6e)return AY;p6e=1;var e=w$e();function t(n){var r=e(n),s=r%1;return r===r?s?r-s:r:0}return AY=t,AY}var jY,m6e;function MJt(){if(m6e)return jY;m6e=1;var e=HDe(),t=d2(),n=OJt(),r=Math.max;function s(a,o,l){var c=a==null?0:a.length;if(!c)return-1;var u=l==null?0:n(l);return u<0&&(u=r(c+u,0)),e(a,t(o,3),u)}return jY=s,jY}var EY,x6e;function RJt(){if(x6e)return EY;x6e=1;var e=FJt(),t=MJt(),n=e(t);return EY=n,EY}var LJt=RJt();const DJt=ji(LJt);var BJt=sDe();const $Jt=ji(BJt);var UJt=$Jt(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),wce=m.createContext(void 0),Cce=m.createContext(void 0),F$e=m.createContext(void 0),O$e=m.createContext({}),M$e=m.createContext(void 0),R$e=m.createContext(0),L$e=m.createContext(0),g6e=function(t){var n=t.state,r=n.xAxisMap,s=n.yAxisMap,a=n.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,d=UJt(a);return Se.createElement(wce.Provider,{value:r},Se.createElement(Cce.Provider,{value:s},Se.createElement(O$e.Provider,{value:a},Se.createElement(F$e.Provider,{value:d},Se.createElement(M$e.Provider,{value:o},Se.createElement(R$e.Provider,{value:u},Se.createElement(L$e.Provider,{value:c},l)))))))},zJt=function(){return m.useContext(M$e)},D$e=function(t){var n=m.useContext(wce);n==null&&G3();var r=n[t];return r==null&&G3(),r},HJt=function(){var t=m.useContext(wce);return Tb(t)},VJt=function(){var t=m.useContext(Cce),n=DJt(t,function(r){return A$e(r.domain,Number.isFinite)});return n||Tb(t)},B$e=function(t){var n=m.useContext(Cce);n==null&&G3();var r=n[t];return r==null&&G3(),r},WJt=function(){var t=m.useContext(F$e);return t},qJt=function(){return m.useContext(O$e)},Sce=function(){return m.useContext(L$e)},Nce=function(){return m.useContext(R$e)};function FN(e){"@babel/helpers - typeof";return FN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},FN(e)}function GJt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KJt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,U$e(r.key),r)}}function YJt(e,t,n){return KJt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function XJt(e,t,n){return t=kL(t),QJt(e,$$e()?Reflect.construct(t,n||[],kL(e).constructor):t.apply(e,n))}function QJt(e,t){if(t&&(FN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ZJt(e)}function ZJt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($$e=function(){return!!e})()}function kL(e){return kL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},kL(e)}function JJt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sne(e,t)}function sne(e,t){return sne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},sne(e,t)}function b6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function y6e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?b6e(Object(n),!0).forEach(function(r){Ace(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ace(e,t,n){return t=U$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U$e(e){var t=een(e,"string");return FN(t)=="symbol"?t:t+""}function een(e,t){if(FN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(FN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ten(e,t){return ien(e)||sen(e,t)||ren(e,t)||nen()}function nen(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ren(e,t){if(e){if(typeof e=="string")return v6e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v6e(e,t)}}function v6e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function sen(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function ien(e){if(Array.isArray(e))return e}function ine(){return ine=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ine.apply(this,arguments)}var aen=function(t,n){var r;return Se.isValidElement(t)?r=Se.cloneElement(t,n):wi(t)?r=t(n):r=Se.createElement("line",ine({},n,{className:"recharts-reference-line-line"})),r},oen=function(t,n,r,s,a,o,l,c,u){var d=a.x,f=a.y,x=a.width,g=a.height;if(r){var v=u.y,w=t.y.apply(v,{position:o});if(D0(u,"discard")&&!t.y.isInRange(w))return null;var C=[{x:d+x,y:w},{x:d,y:w}];return c==="left"?C.reverse():C}if(n){var N=u.x,I=t.x.apply(N,{position:o});if(D0(u,"discard")&&!t.x.isInRange(I))return null;var P=[{x:I,y:f+g},{x:I,y:f}];return l==="top"?P.reverse():P}if(s){var R=u.segment,F=R.map(function(U){return t.apply(U,{position:o})});return D0(u,"discard")&&eJt(F,function(U){return!t.isInRange(U)})?null:F}return null};function len(e){var t=e.x,n=e.y,r=e.segment,s=e.xAxisId,a=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,u=zJt(),d=D$e(s),f=B$e(a),x=WJt();if(!u||!x)return null;Wg(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var g=vce({x:d.scale,y:f.scale}),v=Xl(t),w=Xl(n),C=r&&r.length===2,N=oen(g,v,w,C,x,e.position,d.orientation,f.orientation,e);if(!N)return null;var I=ten(N,2),P=I[0],R=P.x,F=P.y,U=I[1],L=U.x,z=U.y,X=D0(e,"hidden")?"url(#".concat(u,")"):void 0,ne=y6e(y6e({clipPath:X},mi(e,!0)),{},{x1:R,y1:F,x2:L,y2:z});return Se.createElement(wa,{className:ta("recharts-reference-line",l)},aen(o,ne),Cu.renderCallByParent(e,TJt({x1:R,y1:F,x2:L,y2:z})))}var jce=function(e){function t(){return GJt(this,t),XJt(this,t,arguments)}return JJt(t,e),YJt(t,[{key:"render",value:function(){return Se.createElement(len,this.props)}}])}(Se.Component);Ace(jce,"displayName","ReferenceLine");Ace(jce,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function ane(){return ane=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ane.apply(this,arguments)}function ON(e){"@babel/helpers - typeof";return ON=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ON(e)}function w6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function C6e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?w6e(Object(n),!0).forEach(function(r){nU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cen(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uen(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,H$e(r.key),r)}}function den(e,t,n){return uen(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function fen(e,t,n){return t=TL(t),hen(e,z$e()?Reflect.construct(t,n||[],TL(e).constructor):t.apply(e,n))}function hen(e,t){if(t&&(ON(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pen(e)}function pen(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function z$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(z$e=function(){return!!e})()}function TL(e){return TL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},TL(e)}function men(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&one(e,t)}function one(e,t){return one=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},one(e,t)}function nU(e,t,n){return t=H$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H$e(e){var t=xen(e,"string");return ON(t)=="symbol"?t:t+""}function xen(e,t){if(ON(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ON(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gen=function(t){var n=t.x,r=t.y,s=t.xAxis,a=t.yAxis,o=vce({x:s.scale,y:a.scale}),l=o.apply({x:n,y:r},{bandAware:!0});return D0(t,"discard")&&!o.isInRange(l)?null:l},rU=function(e){function t(){return cen(this,t),fen(this,t,arguments)}return men(t,e),den(t,[{key:"render",value:function(){var r=this.props,s=r.x,a=r.y,o=r.r,l=r.alwaysShow,c=r.clipPathId,u=Xl(s),d=Xl(a);if(Wg(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=gen(this.props);if(!f)return null;var x=f.x,g=f.y,v=this.props,w=v.shape,C=v.className,N=D0(this.props,"hidden")?"url(#".concat(c,")"):void 0,I=C6e(C6e({clipPath:N},mi(this.props,!0)),{},{cx:x,cy:g});return Se.createElement(wa,{className:ta("recharts-reference-dot",C)},t.renderDot(w,I),Cu.renderCallByParent(this.props,{x:x-o,y:g-o,width:2*o,height:2*o}))}}])}(Se.Component);nU(rU,"displayName","ReferenceDot");nU(rU,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});nU(rU,"renderDot",function(e,t){var n;return Se.isValidElement(e)?n=Se.cloneElement(e,t):wi(e)?n=e(t):n=Se.createElement(Z$,ane({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function lne(){return lne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lne.apply(this,arguments)}function MN(e){"@babel/helpers - typeof";return MN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},MN(e)}function S6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function N6e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?S6e(Object(n),!0).forEach(function(r){sU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ben(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yen(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,W$e(r.key),r)}}function ven(e,t,n){return yen(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function wen(e,t,n){return t=IL(t),Cen(e,V$e()?Reflect.construct(t,n||[],IL(e).constructor):t.apply(e,n))}function Cen(e,t){if(t&&(MN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sen(e)}function Sen(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(V$e=function(){return!!e})()}function IL(e){return IL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},IL(e)}function Nen(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cne(e,t)}function cne(e,t){return cne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},cne(e,t)}function sU(e,t,n){return t=W$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W$e(e){var t=Aen(e,"string");return MN(t)=="symbol"?t:t+""}function Aen(e,t){if(MN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(MN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jen=function(t,n,r,s,a){var o=a.x1,l=a.x2,c=a.y1,u=a.y2,d=a.xAxis,f=a.yAxis;if(!d||!f)return null;var x=vce({x:d.scale,y:f.scale}),g={x:t?x.x.apply(o,{position:"start"}):x.x.rangeMin,y:r?x.y.apply(c,{position:"start"}):x.y.rangeMin},v={x:n?x.x.apply(l,{position:"end"}):x.x.rangeMax,y:s?x.y.apply(u,{position:"end"}):x.y.rangeMax};return D0(a,"discard")&&(!x.isInRange(g)||!x.isInRange(v))?null:I$e(g,v)},iU=function(e){function t(){return ben(this,t),wen(this,t,arguments)}return Nen(t,e),ven(t,[{key:"render",value:function(){var r=this.props,s=r.x1,a=r.x2,o=r.y1,l=r.y2,c=r.className,u=r.alwaysShow,d=r.clipPathId;Wg(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Xl(s),x=Xl(a),g=Xl(o),v=Xl(l),w=this.props.shape;if(!f&&!x&&!g&&!v&&!w)return null;var C=jen(f,x,g,v,this.props);if(!C&&!w)return null;var N=D0(this.props,"hidden")?"url(#".concat(d,")"):void 0;return Se.createElement(wa,{className:ta("recharts-reference-area",c)},t.renderRect(w,N6e(N6e({clipPath:N},mi(this.props,!0)),C)),Cu.renderCallByParent(this.props,C))}}])}(Se.Component);sU(iU,"displayName","ReferenceArea");sU(iU,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});sU(iU,"renderRect",function(e,t){var n;return Se.isValidElement(e)?n=Se.cloneElement(e,t):wi(e)?n=e(t):n=Se.createElement(yce,lne({},t,{className:"recharts-reference-area-rect"})),n});function q$e(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],s=0;s<e.length;s+=t)r.push(e[s]);return r}function Een(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return PJt(r,n)}function _en(e,t,n){var r=n==="width",s=e.x,a=e.y,o=e.width,l=e.height;return t===1?{start:r?s:a,end:r?s+o:a+l}:{start:r?s+o:a+l,end:r?s:a}}function PL(e,t,n,r,s){if(e*t<e*r||e*t>e*s)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-s)<=0}function ken(e,t){return q$e(e,t+1)}function Ten(e,t,n,r,s){for(var a=(r||[]).slice(),o=t.start,l=t.end,c=0,u=1,d=o,f=function(){var v=r==null?void 0:r[c];if(v===void 0)return{v:q$e(r,u)};var w=c,C,N=function(){return C===void 0&&(C=n(v,w)),C},I=v.coordinate,P=c===0||PL(e,I,N,d,l);P||(c=0,d=o,u+=1),P&&(d=I+e*(N()/2+s),c+=u)},x;u<=a.length;)if(x=f(),x)return x.v;return[]}function M_(e){"@babel/helpers - typeof";return M_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M_(e)}function A6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function bu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?A6e(Object(n),!0).forEach(function(r){Ien(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ien(e,t,n){return t=Pen(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pen(e){var t=Fen(e,"string");return M_(t)=="symbol"?t:t+""}function Fen(e,t){if(M_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(M_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Oen(e,t,n,r,s){for(var a=(r||[]).slice(),o=a.length,l=t.start,c=t.end,u=function(x){var g=a[x],v,w=function(){return v===void 0&&(v=n(g,x)),v};if(x===o-1){var C=e*(g.coordinate+e*w()/2-c);a[x]=g=bu(bu({},g),{},{tickCoord:C>0?g.coordinate-C*e:g.coordinate})}else a[x]=g=bu(bu({},g),{},{tickCoord:g.coordinate});var N=PL(e,g.tickCoord,w,l,c);N&&(c=g.tickCoord-e*(w()/2+s),a[x]=bu(bu({},g),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return a}function Men(e,t,n,r,s,a){var o=(r||[]).slice(),l=o.length,c=t.start,u=t.end;if(a){var d=r[l-1],f=n(d,l-1),x=e*(d.coordinate+e*f/2-u);o[l-1]=d=bu(bu({},d),{},{tickCoord:x>0?d.coordinate-x*e:d.coordinate});var g=PL(e,d.tickCoord,function(){return f},c,u);g&&(u=d.tickCoord-e*(f/2+s),o[l-1]=bu(bu({},d),{},{isShow:!0}))}for(var v=a?l-1:l,w=function(I){var P=o[I],R,F=function(){return R===void 0&&(R=n(P,I)),R};if(I===0){var U=e*(P.coordinate-e*F()/2-c);o[I]=P=bu(bu({},P),{},{tickCoord:U<0?P.coordinate-U*e:P.coordinate})}else o[I]=P=bu(bu({},P),{},{tickCoord:P.coordinate});var L=PL(e,P.tickCoord,F,c,u);L&&(c=P.tickCoord+e*(F()/2+s),o[I]=bu(bu({},P),{},{isShow:!0}))},C=0;C<v;C++)w(C);return o}function Ece(e,t,n){var r=e.tick,s=e.ticks,a=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,f=e.angle;if(!s||!s.length||!r)return[];if(Xr(c)||am.isSsr)return ken(s,typeof c=="number"&&Xr(c)?c:0);var x=[],g=l==="top"||l==="bottom"?"width":"height",v=d&&g==="width"?r9(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},w=function(P,R){var F=wi(u)?u(P.value,R):P.value;return g==="width"?Een(r9(F,{fontSize:t,letterSpacing:n}),v,f):r9(F,{fontSize:t,letterSpacing:n})[g]},C=s.length>=2?em(s[1].coordinate-s[0].coordinate):1,N=_en(a,C,g);return c==="equidistantPreserveStart"?Ten(C,N,w,s,o):(c==="preserveStart"||c==="preserveStartEnd"?x=Men(C,N,w,s,o,c==="preserveStartEnd"):x=Oen(C,N,w,s,o),x.filter(function(I){return I.isShow}))}var Ren=["viewBox"],Len=["viewBox"],Den=["ticks"];function RN(e){"@babel/helpers - typeof";return RN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},RN(e)}function DC(){return DC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},DC.apply(this,arguments)}function j6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function zu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j6e(Object(n),!0).forEach(function(r){_ce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _Y(e,t){if(e==null)return{};var n=Ben(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ben(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function $en(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,K$e(r.key),r)}}function Uen(e,t,n){return E6e(e.prototype,t),E6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function zen(e,t,n){return t=FL(t),Hen(e,G$e()?Reflect.construct(t,n,FL(e).constructor):t.apply(e,n))}function Hen(e,t){if(t&&(RN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ven(e)}function Ven(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(G$e=function(){return!!e})()}function FL(e){return FL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},FL(e)}function Wen(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&une(e,t)}function une(e,t){return une=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},une(e,t)}function _ce(e,t,n){return t=K$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function K$e(e){var t=qen(e,"string");return RN(t)=="symbol"?t:t+""}function qen(e,t){if(RN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(RN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var t8=function(e){function t(n){var r;return $en(this,t),r=zen(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Wen(t,e),Uen(t,[{key:"shouldComponentUpdate",value:function(r,s){var a=r.viewBox,o=_Y(r,Ren),l=this.props,c=l.viewBox,u=_Y(l,Len);return!d4(a,c)||!d4(o,u)||!d4(s,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var s=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];s&&this.setState({fontSize:window.getComputedStyle(s).fontSize,letterSpacing:window.getComputedStyle(s).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var s=this.props,a=s.x,o=s.y,l=s.width,c=s.height,u=s.orientation,d=s.tickSize,f=s.mirror,x=s.tickMargin,g,v,w,C,N,I,P=f?-1:1,R=r.tickSize||d,F=Xr(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":g=v=r.coordinate,C=o+ +!f*c,w=C-P*R,I=w-P*x,N=F;break;case"left":w=C=r.coordinate,v=a+ +!f*l,g=v-P*R,N=g-P*x,I=F;break;case"right":w=C=r.coordinate,v=a+ +f*l,g=v+P*R,N=g+P*x,I=F;break;default:g=v=r.coordinate,C=o+ +f*c,w=C+P*R,I=w+P*x,N=F;break}return{line:{x1:g,y1:w,x2:v,y2:C},tick:{x:N,y:I}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,s=r.orientation,a=r.mirror,o;switch(s){case"left":o=a?"start":"end";break;case"right":o=a?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,s=r.orientation,a=r.mirror,o="end";switch(s){case"left":case"right":o="middle";break;case"top":o=a?"start":"end";break;default:o=a?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,s=r.x,a=r.y,o=r.width,l=r.height,c=r.orientation,u=r.mirror,d=r.axisLine,f=zu(zu(zu({},mi(this.props,!1)),mi(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var x=+(c==="top"&&!u||c==="bottom"&&u);f=zu(zu({},f),{},{x1:s,y1:a+x*l,x2:s+o,y2:a+x*l})}else{var g=+(c==="left"&&!u||c==="right"&&u);f=zu(zu({},f),{},{x1:s+g*o,y1:a,x2:s+g*o,y2:a+l})}return Se.createElement("line",DC({},f,{className:ta("recharts-cartesian-axis-line",Yh(d,"className"))}))}},{key:"renderTicks",value:function(r,s,a){var o=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,f=l.tickFormatter,x=l.unit,g=Ece(zu(zu({},this.props),{},{ticks:r}),s,a),v=this.getTickTextAnchor(),w=this.getTickVerticalAnchor(),C=mi(this.props,!1),N=mi(d,!1),I=zu(zu({},C),{},{fill:"none"},mi(c,!1)),P=g.map(function(R,F){var U=o.getTickLineCoord(R),L=U.line,z=U.tick,X=zu(zu(zu(zu({textAnchor:v,verticalAnchor:w},C),{},{stroke:"none",fill:u},N),z),{},{index:F,payload:R,visibleTicksCount:g.length,tickFormatter:f});return Se.createElement(wa,DC({className:"recharts-cartesian-axis-tick",key:"tick-".concat(R.value,"-").concat(R.coordinate,"-").concat(R.tickCoord)},n_(o.props,R,F)),c&&Se.createElement("line",DC({},I,L,{className:ta("recharts-cartesian-axis-tick-line",Yh(c,"className"))})),d&&t.renderTickItem(d,X,"".concat(wi(f)?f(R.value,F):R.value).concat(x||"")))});return Se.createElement("g",{className:"recharts-cartesian-axis-ticks"},P)}},{key:"render",value:function(){var r=this,s=this.props,a=s.axisLine,o=s.width,l=s.height,c=s.ticksGenerator,u=s.className,d=s.hide;if(d)return null;var f=this.props,x=f.ticks,g=_Y(f,Den),v=x;return wi(c)&&(v=x&&x.length>0?c(this.props):c(g)),o<=0||l<=0||!v||!v.length?null:Se.createElement(wa,{className:ta("recharts-cartesian-axis",u),ref:function(C){r.layerReference=C}},a&&this.renderAxisLine(),this.renderTicks(v,this.state.fontSize,this.state.letterSpacing),Cu.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,s,a){var o;return Se.isValidElement(r)?o=Se.cloneElement(r,s):wi(r)?o=r(s):o=Se.createElement(tL,DC({},s,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(m.Component);_ce(t8,"displayName","CartesianAxis");_ce(t8,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Gen=["x1","y1","x2","y2","key"],Ken=["offset"];function K3(e){"@babel/helpers - typeof";return K3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},K3(e)}function _6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Su(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_6e(Object(n),!0).forEach(function(r){Yen(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yen(e,t,n){return t=Xen(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xen(e){var t=Qen(e,"string");return K3(t)=="symbol"?t:t+""}function Qen(e,t){if(K3(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(K3(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rw(){return rw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rw.apply(this,arguments)}function k6e(e,t){if(e==null)return{};var n=Zen(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Zen(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Jen=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,s=t.x,a=t.y,o=t.width,l=t.height,c=t.ry;return Se.createElement("rect",{x:s,y:a,ry:c,width:o,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Y$e(e,t){var n;if(Se.isValidElement(e))n=Se.cloneElement(e,t);else if(wi(e))n=e(t);else{var r=t.x1,s=t.y1,a=t.x2,o=t.y2,l=t.key,c=k6e(t,Gen),u=mi(c,!1);u.offset;var d=k6e(u,Ken);n=Se.createElement("line",rw({},d,{x1:r,y1:s,x2:a,y2:o,fill:"none",key:l}))}return n}function etn(e){var t=e.x,n=e.width,r=e.horizontal,s=r===void 0?!0:r,a=e.horizontalPoints;if(!s||!a||!a.length)return null;var o=a.map(function(l,c){var u=Su(Su({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return Y$e(s,u)});return Se.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function ttn(e){var t=e.y,n=e.height,r=e.vertical,s=r===void 0?!0:r,a=e.verticalPoints;if(!s||!a||!a.length)return null;var o=a.map(function(l,c){var u=Su(Su({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return Y$e(s,u)});return Se.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function ntn(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,s=e.y,a=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=l.map(function(x){return Math.round(x+s-s)}).sort(function(x,g){return x-g});s!==d[0]&&d.unshift(0);var f=d.map(function(x,g){var v=!d[g+1],w=v?s+o-x:d[g+1]-x;if(w<=0)return null;var C=g%t.length;return Se.createElement("rect",{key:"react-".concat(g),y:x,x:r,height:w,width:a,stroke:"none",fill:t[C],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return Se.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function rtn(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,s=e.fillOpacity,a=e.x,o=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var d=u.map(function(x){return Math.round(x+a-a)}).sort(function(x,g){return x-g});a!==d[0]&&d.unshift(0);var f=d.map(function(x,g){var v=!d[g+1],w=v?a+l-x:d[g+1]-x;if(w<=0)return null;var C=g%r.length;return Se.createElement("rect",{key:"react-".concat(g),x,y:o,width:w,height:c,stroke:"none",fill:r[C],fillOpacity:s,className:"recharts-cartesian-grid-bg"})});return Se.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var stn=function(t,n){var r=t.xAxis,s=t.width,a=t.height,o=t.offset;return l$e(Ece(Su(Su(Su({},t8.defaultProps),r),{},{ticks:Og(r,!0),viewBox:{x:0,y:0,width:s,height:a}})),o.left,o.left+o.width,n)},itn=function(t,n){var r=t.yAxis,s=t.width,a=t.height,o=t.offset;return l$e(Ece(Su(Su(Su({},t8.defaultProps),r),{},{ticks:Og(r,!0),viewBox:{x:0,y:0,width:s,height:a}})),o.top,o.top+o.height,n)},eC={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function X$e(e){var t,n,r,s,a,o,l=Sce(),c=Nce(),u=qJt(),d=Su(Su({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:eC.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:eC.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:eC.horizontal,horizontalFill:(s=e.horizontalFill)!==null&&s!==void 0?s:eC.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:eC.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:eC.verticalFill,x:Xr(e.x)?e.x:u.left,y:Xr(e.y)?e.y:u.top,width:Xr(e.width)?e.width:u.width,height:Xr(e.height)?e.height:u.height}),f=d.x,x=d.y,g=d.width,v=d.height,w=d.syncWithTicks,C=d.horizontalValues,N=d.verticalValues,I=HJt(),P=VJt();if(!Xr(g)||g<=0||!Xr(v)||v<=0||!Xr(f)||f!==+f||!Xr(x)||x!==+x)return null;var R=d.verticalCoordinatesGenerator||stn,F=d.horizontalCoordinatesGenerator||itn,U=d.horizontalPoints,L=d.verticalPoints;if((!U||!U.length)&&wi(F)){var z=C&&C.length,X=F({yAxis:P?Su(Su({},P),{},{ticks:z?C:P.ticks}):void 0,width:l,height:c,offset:u},z?!0:w);Wg(Array.isArray(X),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(K3(X),"]")),Array.isArray(X)&&(U=X)}if((!L||!L.length)&&wi(R)){var ne=N&&N.length,J=R({xAxis:I?Su(Su({},I),{},{ticks:ne?N:I.ticks}):void 0,width:l,height:c,offset:u},ne?!0:w);Wg(Array.isArray(J),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(K3(J),"]")),Array.isArray(J)&&(L=J)}return Se.createElement("g",{className:"recharts-cartesian-grid"},Se.createElement(Jen,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),Se.createElement(etn,rw({},d,{offset:u,horizontalPoints:U,xAxis:I,yAxis:P})),Se.createElement(ttn,rw({},d,{offset:u,verticalPoints:L,xAxis:I,yAxis:P})),Se.createElement(ntn,rw({},d,{horizontalPoints:U})),Se.createElement(rtn,rw({},d,{verticalPoints:L})))}X$e.displayName="CartesianGrid";var atn=["type","layout","connectNulls","ref"],otn=["key"];function LN(e){"@babel/helpers - typeof";return LN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},LN(e)}function T6e(e,t){if(e==null)return{};var n=ltn(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ltn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function o9(){return o9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o9.apply(this,arguments)}function I6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function vf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?I6e(Object(n),!0).forEach(function(r){Vp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tC(e){return ftn(e)||dtn(e)||utn(e)||ctn()}function ctn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function utn(e,t){if(e){if(typeof e=="string")return dne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dne(e,t)}}function dtn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ftn(e){if(Array.isArray(e))return dne(e)}function dne(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function htn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function P6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Z$e(r.key),r)}}function ptn(e,t,n){return P6e(e.prototype,t),P6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function mtn(e,t,n){return t=OL(t),xtn(e,Q$e()?Reflect.construct(t,n,OL(e).constructor):t.apply(e,n))}function xtn(e,t){if(t&&(LN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gtn(e)}function gtn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Q$e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Q$e=function(){return!!e})()}function OL(e){return OL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},OL(e)}function btn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fne(e,t)}function fne(e,t){return fne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},fne(e,t)}function Vp(e,t,n){return t=Z$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z$e(e){var t=ytn(e,"string");return LN(t)=="symbol"?t:t+""}function ytn(e,t){if(LN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(LN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var A0=function(e){function t(){var n;htn(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=mtn(this,t,[].concat(s)),Vp(n,"state",{isAnimationFinished:!0,totalLength:0}),Vp(n,"generateSimpleStrokeDasharray",function(o,l){return"".concat(l,"px ").concat(o-l,"px")}),Vp(n,"getStrokeDasharray",function(o,l,c){var u=c.reduce(function(N,I){return N+I});if(!u)return n.generateSimpleStrokeDasharray(l,o);for(var d=Math.floor(o/u),f=o%u,x=l-o,g=[],v=0,w=0;v<c.length;w+=c[v],++v)if(w+c[v]>f){g=[].concat(tC(c.slice(0,v)),[f-w]);break}var C=g.length%2===0?[0,x]:[x];return[].concat(tC(t.repeat(c,d)),tC(g),C).map(function(N){return"".concat(N,"px")}).join(", ")}),Vp(n,"id",y5("recharts-line-")),Vp(n,"pathRef",function(o){n.mainCurve=o}),Vp(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Vp(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return btn(t,e),ptn(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,s){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,l=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,f=Qd(d,JA);if(!f)return null;var x=function(w,C){return{x:w.x,y:w.y,value:w.value,errorVal:Ql(w.payload,C)}},g={clipPath:r?"url(#clipPath-".concat(s,")"):null};return Se.createElement(wa,g,f.map(function(v){return Se.cloneElement(v,{key:"bar-".concat(v.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,dataPointFormatter:x})}))}},{key:"renderDots",value:function(r,s,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,u=l.points,d=l.dataKey,f=mi(this.props,!1),x=mi(c,!0),g=u.map(function(w,C){var N=vf(vf(vf({key:"dot-".concat(C),r:3},f),x),{},{index:C,cx:w.x,cy:w.y,value:w.value,dataKey:d,payload:w.payload,points:u});return t.renderDotItem(c,N)}),v={clipPath:r?"url(#clipPath-".concat(s?"":"dots-").concat(a,")"):null};return Se.createElement(wa,o9({className:"recharts-line-dots",key:"dots"},v),g)}},{key:"renderCurveStatically",value:function(r,s,a,o){var l=this.props,c=l.type,u=l.layout,d=l.connectNulls;l.ref;var f=T6e(l,atn),x=vf(vf(vf({},mi(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:s?"url(#clipPath-".concat(a,")"):null,points:r},o),{},{type:c,layout:u,connectNulls:d});return Se.createElement(i3,o9({},x,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,s){var a=this,o=this.props,l=o.points,c=o.strokeDasharray,u=o.isAnimationActive,d=o.animationBegin,f=o.animationDuration,x=o.animationEasing,g=o.animationId,v=o.animateNewValues,w=o.width,C=o.height,N=this.state,I=N.prevPoints,P=N.totalLength;return Se.createElement(pm,{begin:d,duration:f,isActive:u,easing:x,from:{t:0},to:{t:1},key:"line-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(R){var F=R.t;if(I){var U=I.length/l.length,L=l.map(function(Z,re){var he=Math.floor(re*U);if(I[he]){var Y=I[he],ie=bl(Y.x,Z.x),oe=bl(Y.y,Z.y);return vf(vf({},Z),{},{x:ie(F),y:oe(F)})}if(v){var G=bl(w*2,Z.x),V=bl(C/2,Z.y);return vf(vf({},Z),{},{x:G(F),y:V(F)})}return vf(vf({},Z),{},{x:Z.x,y:Z.y})});return a.renderCurveStatically(L,r,s)}var z=bl(0,P),X=z(F),ne;if(c){var J="".concat(c).split(/[,\s]+/gim).map(function(Z){return parseFloat(Z)});ne=a.getStrokeDasharray(X,P,J)}else ne=a.generateSimpleStrokeDasharray(P,X);return a.renderCurveStatically(l,r,s,{strokeDasharray:ne})})}},{key:"renderCurve",value:function(r,s){var a=this.props,o=a.points,l=a.isAnimationActive,c=this.state,u=c.prevPoints,d=c.totalLength;return l&&o&&o.length&&(!u&&d>0||!W3(u,o))?this.renderCurveWithAnimation(r,s):this.renderCurveStatically(o,r,s)}},{key:"render",value:function(){var r,s=this.props,a=s.hide,o=s.dot,l=s.points,c=s.className,u=s.xAxis,d=s.yAxis,f=s.top,x=s.left,g=s.width,v=s.height,w=s.isAnimationActive,C=s.id;if(a||!l||!l.length)return null;var N=this.state.isAnimationFinished,I=l.length===1,P=ta("recharts-line",c),R=u&&u.allowDataOverflow,F=d&&d.allowDataOverflow,U=R||F,L=xi(C)?this.id:C,z=(r=mi(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},X=z.r,ne=X===void 0?3:X,J=z.strokeWidth,Z=J===void 0?2:J,re=cDe(o)?o:{},he=re.clipDot,Y=he===void 0?!0:he,ie=ne*2+Z;return Se.createElement(wa,{className:P},R||F?Se.createElement("defs",null,Se.createElement("clipPath",{id:"clipPath-".concat(L)},Se.createElement("rect",{x:R?x:x-g/2,y:F?f:f-v/2,width:R?g:g*2,height:F?v:v*2})),!Y&&Se.createElement("clipPath",{id:"clipPath-dots-".concat(L)},Se.createElement("rect",{x:x-ie/2,y:f-ie/2,width:g+ie,height:v+ie}))):null,!I&&this.renderCurve(U,L),this.renderErrorBar(U,L),(I||o)&&this.renderDots(U,Y,L),(!w||N)&&L0.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:s.curPoints}:r.points!==s.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,s){for(var a=r.length%2!==0?[].concat(tC(r),[0]):r,o=[],l=0;l<s;++l)o=[].concat(tC(o),tC(a));return o}},{key:"renderDotItem",value:function(r,s){var a;if(Se.isValidElement(r))a=Se.cloneElement(r,s);else if(wi(r))a=r(s);else{var o=s.key,l=T6e(s,otn),c=ta("recharts-line-dot",typeof r!="boolean"?r.className:"");a=Se.createElement(Z$,o9({key:o},l,{className:c}))}return a}}])}(m.PureComponent);Vp(A0,"displayName","Line");Vp(A0,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!am.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Vp(A0,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,s=e.xAxisTicks,a=e.yAxisTicks,o=e.dataKey,l=e.bandSize,c=e.displayedData,u=e.offset,d=t.layout,f=c.map(function(x,g){var v=Ql(x,o);return d==="horizontal"?{x:_N({axis:n,ticks:s,bandSize:l,entry:x,index:g}),y:xi(v)?null:r.scale(v),value:v,payload:x}:{x:xi(v)?null:n.scale(v),y:_N({axis:r,ticks:a,bandSize:l,entry:x,index:g}),value:v,payload:x}});return vf({points:f,layout:d},u)});var vtn=["layout","type","stroke","connectNulls","isRange","ref"],wtn=["key"],J$e;function DN(e){"@babel/helpers - typeof";return DN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},DN(e)}function eUe(e,t){if(e==null)return{};var n=Ctn(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ctn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function sw(){return sw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sw.apply(this,arguments)}function F6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function wb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?F6e(Object(n),!0).forEach(function(r){j0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Stn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,nUe(r.key),r)}}function Ntn(e,t,n){return O6e(e.prototype,t),O6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Atn(e,t,n){return t=ML(t),jtn(e,tUe()?Reflect.construct(t,n,ML(e).constructor):t.apply(e,n))}function jtn(e,t){if(t&&(DN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Etn(e)}function Etn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tUe=function(){return!!e})()}function ML(e){return ML=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ML(e)}function _tn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hne(e,t)}function hne(e,t){return hne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},hne(e,t)}function j0(e,t,n){return t=nUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nUe(e){var t=ktn(e,"string");return DN(t)=="symbol"?t:t+""}function ktn(e,t){if(DN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(DN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var S5=function(e){function t(){var n;Stn(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=Atn(this,t,[].concat(s)),j0(n,"state",{isAnimationFinished:!0}),j0(n,"id",y5("recharts-area-")),j0(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),wi(o)&&o()}),j0(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),wi(o)&&o()}),n}return _tn(t,e),Ntn(t,[{key:"renderDots",value:function(r,s,a){var o=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(o&&!l)return null;var c=this.props,u=c.dot,d=c.points,f=c.dataKey,x=mi(this.props,!1),g=mi(u,!0),v=d.map(function(C,N){var I=wb(wb(wb({key:"dot-".concat(N),r:3},x),g),{},{index:N,cx:C.x,cy:C.y,dataKey:f,value:C.value,payload:C.payload,points:d});return t.renderDotItem(u,I)}),w={clipPath:r?"url(#clipPath-".concat(s?"":"dots-").concat(a,")"):null};return Se.createElement(wa,sw({className:"recharts-area-dots"},w),v)}},{key:"renderHorizontalRect",value:function(r){var s=this.props,a=s.baseLine,o=s.points,l=s.strokeWidth,c=o[0].x,u=o[o.length-1].x,d=r*Math.abs(c-u),f=hy(o.map(function(x){return x.y||0}));return Xr(a)&&typeof a=="number"?f=Math.max(a,f):a&&Array.isArray(a)&&a.length&&(f=Math.max(hy(a.map(function(x){return x.y||0})),f)),Xr(f)?Se.createElement("rect",{x:c<u?c:c-d,y:0,width:d,height:Math.floor(f+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(r){var s=this.props,a=s.baseLine,o=s.points,l=s.strokeWidth,c=o[0].y,u=o[o.length-1].y,d=r*Math.abs(c-u),f=hy(o.map(function(x){return x.x||0}));return Xr(a)&&typeof a=="number"?f=Math.max(a,f):a&&Array.isArray(a)&&a.length&&(f=Math.max(hy(a.map(function(x){return x.x||0})),f)),Xr(f)?Se.createElement("rect",{x:0,y:c<u?c:c-d,width:f+(l?parseInt("".concat(l),10):1),height:Math.floor(d)}):null}},{key:"renderClipRect",value:function(r){var s=this.props.layout;return s==="vertical"?this.renderVerticalRect(r):this.renderHorizontalRect(r)}},{key:"renderAreaStatically",value:function(r,s,a,o){var l=this.props,c=l.layout,u=l.type,d=l.stroke,f=l.connectNulls,x=l.isRange;l.ref;var g=eUe(l,vtn);return Se.createElement(wa,{clipPath:a?"url(#clipPath-".concat(o,")"):null},Se.createElement(i3,sw({},mi(g,!0),{points:r,connectNulls:f,type:u,baseLine:s,layout:c,stroke:"none",className:"recharts-area-area"})),d!=="none"&&Se.createElement(i3,sw({},mi(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:r})),d!=="none"&&x&&Se.createElement(i3,sw({},mi(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:s})))}},{key:"renderAreaWithAnimation",value:function(r,s){var a=this,o=this.props,l=o.points,c=o.baseLine,u=o.isAnimationActive,d=o.animationBegin,f=o.animationDuration,x=o.animationEasing,g=o.animationId,v=this.state,w=v.prevPoints,C=v.prevBaseLine;return Se.createElement(pm,{begin:d,duration:f,isActive:u,easing:x,from:{t:0},to:{t:1},key:"area-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(N){var I=N.t;if(w){var P=w.length/l.length,R=l.map(function(z,X){var ne=Math.floor(X*P);if(w[ne]){var J=w[ne],Z=bl(J.x,z.x),re=bl(J.y,z.y);return wb(wb({},z),{},{x:Z(I),y:re(I)})}return z}),F;if(Xr(c)&&typeof c=="number"){var U=bl(C,c);F=U(I)}else if(xi(c)||KA(c)){var L=bl(C,0);F=L(I)}else F=c.map(function(z,X){var ne=Math.floor(X*P);if(C[ne]){var J=C[ne],Z=bl(J.x,z.x),re=bl(J.y,z.y);return wb(wb({},z),{},{x:Z(I),y:re(I)})}return z});return a.renderAreaStatically(R,F,r,s)}return Se.createElement(wa,null,Se.createElement("defs",null,Se.createElement("clipPath",{id:"animationClipPath-".concat(s)},a.renderClipRect(I))),Se.createElement(wa,{clipPath:"url(#animationClipPath-".concat(s,")")},a.renderAreaStatically(l,c,r,s)))})}},{key:"renderArea",value:function(r,s){var a=this.props,o=a.points,l=a.baseLine,c=a.isAnimationActive,u=this.state,d=u.prevPoints,f=u.prevBaseLine,x=u.totalLength;return c&&o&&o.length&&(!d&&x>0||!W3(d,o)||!W3(f,l))?this.renderAreaWithAnimation(r,s):this.renderAreaStatically(o,l,r,s)}},{key:"render",value:function(){var r,s=this.props,a=s.hide,o=s.dot,l=s.points,c=s.className,u=s.top,d=s.left,f=s.xAxis,x=s.yAxis,g=s.width,v=s.height,w=s.isAnimationActive,C=s.id;if(a||!l||!l.length)return null;var N=this.state.isAnimationFinished,I=l.length===1,P=ta("recharts-area",c),R=f&&f.allowDataOverflow,F=x&&x.allowDataOverflow,U=R||F,L=xi(C)?this.id:C,z=(r=mi(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},X=z.r,ne=X===void 0?3:X,J=z.strokeWidth,Z=J===void 0?2:J,re=cDe(o)?o:{},he=re.clipDot,Y=he===void 0?!0:he,ie=ne*2+Z;return Se.createElement(wa,{className:P},R||F?Se.createElement("defs",null,Se.createElement("clipPath",{id:"clipPath-".concat(L)},Se.createElement("rect",{x:R?d:d-g/2,y:F?u:u-v/2,width:R?g:g*2,height:F?v:v*2})),!Y&&Se.createElement("clipPath",{id:"clipPath-dots-".concat(L)},Se.createElement("rect",{x:d-ie/2,y:u-ie/2,width:g+ie,height:v+ie}))):null,I?null:this.renderArea(U,L),(o||I)&&this.renderDots(U,Y,L),(!w||N)&&L0.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:s.curPoints,prevBaseLine:s.curBaseLine}:r.points!==s.curPoints||r.baseLine!==s.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])}(m.PureComponent);J$e=S5;j0(S5,"displayName","Area");j0(S5,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!am.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});j0(S5,"getBaseValue",function(e,t,n,r){var s=e.layout,a=e.baseValue,o=t.props.baseValue,l=o??a;if(Xr(l)&&typeof l=="number")return l;var c=s==="horizontal"?r:n,u=c.scale.domain();if(c.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return l==="dataMin"?f:l==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return l==="dataMin"?u[0]:l==="dataMax"?u[1]:u[0]});j0(S5,"getComposedData",function(e){var t=e.props,n=e.item,r=e.xAxis,s=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,l=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,x=e.offset,g=t.layout,v=u&&u.length,w=J$e.getBaseValue(t,n,r,s),C=g==="horizontal",N=!1,I=f.map(function(R,F){var U;v?U=u[d+F]:(U=Ql(R,c),Array.isArray(U)?N=!0:U=[w,U]);var L=U[1]==null||v&&Ql(R,c)==null;return C?{x:_N({axis:r,ticks:a,bandSize:l,entry:R,index:F}),y:L?null:s.scale(U[1]),value:U,payload:R}:{x:L?null:r.scale(U[1]),y:_N({axis:s,ticks:o,bandSize:l,entry:R,index:F}),value:U,payload:R}}),P;return v||N?P=I.map(function(R){var F=Array.isArray(R.value)?R.value[0]:null;return C?{x:R.x,y:F!=null&&R.y!=null?s.scale(F):null}:{x:F!=null?r.scale(F):null,y:R.y}}):P=C?s.scale(w):r.scale(w),wb({points:I,baseLine:P,layout:g,isRange:N},x)});j0(S5,"renderDotItem",function(e,t){var n;if(Se.isValidElement(e))n=Se.cloneElement(e,t);else if(wi(e))n=e(t);else{var r=ta("recharts-area-dot",typeof e!="boolean"?e.className:""),s=t.key,a=eUe(t,wtn);n=Se.createElement(Z$,sw({},a,{key:s,className:r}))}return n});function BN(e){"@babel/helpers - typeof";return BN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},BN(e)}function Ttn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Itn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,iUe(r.key),r)}}function Ptn(e,t,n){return Itn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ftn(e,t,n){return t=RL(t),Otn(e,rUe()?Reflect.construct(t,n||[],RL(e).constructor):t.apply(e,n))}function Otn(e,t){if(t&&(BN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mtn(e)}function Mtn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rUe=function(){return!!e})()}function RL(e){return RL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},RL(e)}function Rtn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pne(e,t)}function pne(e,t){return pne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},pne(e,t)}function sUe(e,t,n){return t=iUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iUe(e){var t=Ltn(e,"string");return BN(t)=="symbol"?t:t+""}function Ltn(e,t){if(BN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(BN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var aU=function(e){function t(){return Ttn(this,t),Ftn(this,t,arguments)}return Rtn(t,e),Ptn(t,[{key:"render",value:function(){return null}}])}(Se.Component);sUe(aU,"displayName","ZAxis");sUe(aU,"defaultProps",{zAxisId:0,range:[64,64],scale:"auto",type:"number"});var Dtn=["option","isActive"];function l9(){return l9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l9.apply(this,arguments)}function Btn(e,t){if(e==null)return{};var n=$tn(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $tn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Utn(e){var t=e.option,n=e.isActive,r=Btn(e,Dtn);return typeof t=="string"?Se.createElement(ene,l9({option:Se.createElement(B$,l9({type:t},r)),isActive:n,shapeType:"symbols"},r)):Se.createElement(ene,l9({option:t,isActive:n,shapeType:"symbols"},r))}function $N(e){"@babel/helpers - typeof";return $N=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$N(e)}function c9(){return c9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c9.apply(this,arguments)}function M6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Eh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M6e(Object(n),!0).forEach(function(r){my(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ztn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,oUe(r.key),r)}}function Htn(e,t,n){return R6e(e.prototype,t),R6e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Vtn(e,t,n){return t=LL(t),Wtn(e,aUe()?Reflect.construct(t,n,LL(e).constructor):t.apply(e,n))}function Wtn(e,t){if(t&&($N(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qtn(e)}function qtn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(aUe=function(){return!!e})()}function LL(e){return LL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},LL(e)}function Gtn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mne(e,t)}function mne(e,t){return mne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},mne(e,t)}function my(e,t,n){return t=oUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oUe(e){var t=Ktn(e,"string");return $N(t)=="symbol"?t:t+""}function Ktn(e,t){if($N(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if($N(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oU=function(e){function t(){var n;ztn(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=Vtn(this,t,[].concat(s)),my(n,"state",{isAnimationFinished:!1}),my(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0})}),my(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1})}),my(n,"id",y5("recharts-scatter-")),n}return Gtn(t,e),Htn(t,[{key:"renderSymbolsStatically",value:function(r){var s=this,a=this.props,o=a.shape,l=a.activeShape,c=a.activeIndex,u=mi(this.props,!1);return r.map(function(d,f){var x=c===f,g=x?l:o,v=Eh(Eh({},u),d);return Se.createElement(wa,c9({className:"recharts-scatter-symbol",key:"symbol-".concat(d==null?void 0:d.cx,"-").concat(d==null?void 0:d.cy,"-").concat(d==null?void 0:d.size,"-").concat(f)},n_(s.props,d,f),{role:"img"}),Se.createElement(Utn,c9({option:g,isActive:x,key:"symbol-".concat(f)},v)))})}},{key:"renderSymbolsWithAnimation",value:function(){var r=this,s=this.props,a=s.points,o=s.isAnimationActive,l=s.animationBegin,c=s.animationDuration,u=s.animationEasing,d=s.animationId,f=this.state.prevPoints;return Se.createElement(pm,{begin:l,duration:c,isActive:o,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(x){var g=x.t,v=a.map(function(w,C){var N=f&&f[C];if(N){var I=bl(N.cx,w.cx),P=bl(N.cy,w.cy),R=bl(N.size,w.size);return Eh(Eh({},w),{},{cx:I(g),cy:P(g),size:R(g)})}var F=bl(0,w.size);return Eh(Eh({},w),{},{size:F(g)})});return Se.createElement(wa,null,r.renderSymbolsStatically(v))})}},{key:"renderSymbols",value:function(){var r=this.props,s=r.points,a=r.isAnimationActive,o=this.state.prevPoints;return a&&s&&s.length&&(!o||!W3(o,s))?this.renderSymbolsWithAnimation():this.renderSymbolsStatically(s)}},{key:"renderErrorBar",value:function(){var r=this.props.isAnimationActive;if(r&&!this.state.isAnimationFinished)return null;var s=this.props,a=s.points,o=s.xAxis,l=s.yAxis,c=s.children,u=Qd(c,JA);return u?u.map(function(d,f){var x=d.props,g=x.direction,v=x.dataKey;return Se.cloneElement(d,{key:"".concat(g,"-").concat(v,"-").concat(a[f]),data:a,xAxis:o,yAxis:l,layout:g==="x"?"vertical":"horizontal",dataPointFormatter:function(C,N){return{x:C.cx,y:C.cy,value:g==="x"?+C.node.x:+C.node.y,errorVal:Ql(C,N)}}})}):null}},{key:"renderLine",value:function(){var r=this.props,s=r.points,a=r.line,o=r.lineType,l=r.lineJointType,c=mi(this.props,!1),u=mi(a,!1),d,f;if(o==="joint")d=s.map(function(P){return{x:P.cx,y:P.cy}});else if(o==="fitting"){var x=O$t(s),g=x.xmin,v=x.xmax,w=x.a,C=x.b,N=function(R){return w*R+C};d=[{x:g,y:N(g)},{x:v,y:N(v)}]}var I=Eh(Eh(Eh({},c),{},{fill:"none",stroke:c&&c.fill},u),{},{points:d});return Se.isValidElement(a)?f=Se.cloneElement(a,I):wi(a)?f=a(I):f=Se.createElement(i3,c9({},I,{type:l})),Se.createElement(wa,{className:"recharts-scatter-line",key:"recharts-scatter-line"},f)}},{key:"render",value:function(){var r=this.props,s=r.hide,a=r.points,o=r.line,l=r.className,c=r.xAxis,u=r.yAxis,d=r.left,f=r.top,x=r.width,g=r.height,v=r.id,w=r.isAnimationActive;if(s||!a||!a.length)return null;var C=this.state.isAnimationFinished,N=ta("recharts-scatter",l),I=c&&c.allowDataOverflow,P=u&&u.allowDataOverflow,R=I||P,F=xi(v)?this.id:v;return Se.createElement(wa,{className:N,clipPath:R?"url(#clipPath-".concat(F,")"):null},I||P?Se.createElement("defs",null,Se.createElement("clipPath",{id:"clipPath-".concat(F)},Se.createElement("rect",{x:I?d:d-x/2,y:P?f:f-g/2,width:I?x:x*2,height:P?g:g*2}))):null,o&&this.renderLine(),this.renderErrorBar(),Se.createElement(wa,{key:"recharts-scatter-symbols"},this.renderSymbols()),(!w||C)&&L0.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:s.curPoints}:r.points!==s.curPoints?{curPoints:r.points}:null}}])}(m.PureComponent);my(oU,"displayName","Scatter");my(oU,"defaultProps",{xAxisId:0,yAxisId:0,zAxisId:0,legendType:"circle",lineType:"joint",lineJointType:"linear",data:[],shape:"circle",hide:!1,isAnimationActive:!am.isSsr,animationBegin:0,animationDuration:400,animationEasing:"linear"});my(oU,"getComposedData",function(e){var t=e.xAxis,n=e.yAxis,r=e.zAxis,s=e.item,a=e.displayedData,o=e.xAxisTicks,l=e.yAxisTicks,c=e.offset,u=s.props.tooltipType,d=Qd(s.props.children,Gle),f=xi(t.dataKey)?s.props.dataKey:t.dataKey,x=xi(n.dataKey)?s.props.dataKey:n.dataKey,g=r&&r.dataKey,v=r?r.range:aU.defaultProps.range,w=v&&v[0],C=t.scale.bandwidth?t.scale.bandwidth():0,N=n.scale.bandwidth?n.scale.bandwidth():0,I=a.map(function(P,R){var F=Ql(P,f),U=Ql(P,x),L=!xi(g)&&Ql(P,g)||"-",z=[{name:xi(t.dataKey)?s.props.name:t.name||t.dataKey,unit:t.unit||"",value:F,payload:P,dataKey:f,type:u},{name:xi(n.dataKey)?s.props.name:n.name||n.dataKey,unit:n.unit||"",value:U,payload:P,dataKey:x,type:u}];L!=="-"&&z.push({name:r.name||r.dataKey,unit:r.unit||"",value:L,payload:P,dataKey:g,type:u});var X=_N({axis:t,ticks:o,bandSize:C,entry:P,index:R,dataKey:f}),ne=_N({axis:n,ticks:l,bandSize:N,entry:P,index:R,dataKey:x}),J=L!=="-"?r.scale(L):w,Z=Math.sqrt(Math.max(J,0)/Math.PI);return Eh(Eh({},P),{},{cx:X,cy:ne,x:X-Z,y:ne-Z,xAxis:t,yAxis:n,zAxis:r,width:2*Z,height:2*Z,size:J,node:{x:F,y:U,z:L},tooltipPayload:z,tooltipPosition:{x:X,y:ne},payload:P},d[R]&&d[R].props)});return Eh({points:I},c)});function UN(e){"@babel/helpers - typeof";return UN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},UN(e)}function Ytn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xtn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,uUe(r.key),r)}}function Qtn(e,t,n){return Xtn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ztn(e,t,n){return t=DL(t),Jtn(e,lUe()?Reflect.construct(t,n||[],DL(e).constructor):t.apply(e,n))}function Jtn(e,t){if(t&&(UN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return enn(e)}function enn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lUe=function(){return!!e})()}function DL(e){return DL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},DL(e)}function tnn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xne(e,t)}function xne(e,t){return xne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},xne(e,t)}function cUe(e,t,n){return t=uUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uUe(e){var t=nnn(e,"string");return UN(t)=="symbol"?t:t+""}function nnn(e,t){if(UN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(UN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gne(){return gne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gne.apply(this,arguments)}function rnn(e){var t=e.xAxisId,n=Sce(),r=Nce(),s=D$e(t);return s==null?null:Se.createElement(t8,gne({},s,{className:ta("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return Og(o,!0)}}))}var n8=function(e){function t(){return Ytn(this,t),Ztn(this,t,arguments)}return tnn(t,e),Qtn(t,[{key:"render",value:function(){return Se.createElement(rnn,this.props)}}])}(Se.Component);cUe(n8,"displayName","XAxis");cUe(n8,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function zN(e){"@babel/helpers - typeof";return zN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zN(e)}function snn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function inn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hUe(r.key),r)}}function ann(e,t,n){return inn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function onn(e,t,n){return t=BL(t),lnn(e,dUe()?Reflect.construct(t,n||[],BL(e).constructor):t.apply(e,n))}function lnn(e,t){if(t&&(zN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cnn(e)}function cnn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dUe=function(){return!!e})()}function BL(e){return BL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},BL(e)}function unn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bne(e,t)}function bne(e,t){return bne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},bne(e,t)}function fUe(e,t,n){return t=hUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hUe(e){var t=dnn(e,"string");return zN(t)=="symbol"?t:t+""}function dnn(e,t){if(zN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(zN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yne(){return yne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yne.apply(this,arguments)}var fnn=function(t){var n=t.yAxisId,r=Sce(),s=Nce(),a=B$e(n);return a==null?null:Se.createElement(t8,yne({},a,{className:ta("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:s},ticksGenerator:function(l){return Og(l,!0)}}))},r8=function(e){function t(){return snn(this,t),onn(this,t,arguments)}return unn(t,e),ann(t,[{key:"render",value:function(){return Se.createElement(fnn,this.props)}}])}(Se.Component);fUe(r8,"displayName","YAxis");fUe(r8,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function L6e(e){return xnn(e)||mnn(e)||pnn(e)||hnn()}function hnn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pnn(e,t){if(e){if(typeof e=="string")return vne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vne(e,t)}}function mnn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xnn(e){if(Array.isArray(e))return vne(e)}function vne(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var wne=function(t,n,r,s,a){var o=Qd(t,jce),l=Qd(t,rU),c=[].concat(L6e(o),L6e(l)),u=Qd(t,iU),d="".concat(s,"Id"),f=s[0],x=n;if(c.length&&(x=c.reduce(function(w,C){if(C.props[d]===r&&D0(C.props,"extendDomain")&&Xr(C.props[f])){var N=C.props[f];return[Math.min(w[0],N),Math.max(w[1],N)]}return w},x)),u.length){var g="".concat(f,"1"),v="".concat(f,"2");x=u.reduce(function(w,C){if(C.props[d]===r&&D0(C.props,"extendDomain")&&Xr(C.props[g])&&Xr(C.props[v])){var N=C.props[g],I=C.props[v];return[Math.min(w[0],N,I),Math.max(w[1],N,I)]}return w},x)}return a&&a.length&&(x=a.reduce(function(w,C){return Xr(C)?[Math.min(w[0],C),Math.max(w[1],C)]:w},x)),x},kY={exports:{}},D6e;function gnn(){return D6e||(D6e=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function s(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,f,x){if(typeof d!="function")throw new TypeError("The listener must be a function");var g=new s(d,f||c,x),v=n?n+u:u;return c._events[v]?c._events[v].fn?c._events[v]=[c._events[v],g]:c._events[v].push(g):(c._events[v]=g,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=n?n+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var x=0,g=f.length,v=new Array(g);x<g;x++)v[x]=f[x].fn;return v},l.prototype.listenerCount=function(u){var d=n?n+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,x,g,v){var w=n?n+u:u;if(!this._events[w])return!1;var C=this._events[w],N=arguments.length,I,P;if(C.fn){switch(C.once&&this.removeListener(u,C.fn,void 0,!0),N){case 1:return C.fn.call(C.context),!0;case 2:return C.fn.call(C.context,d),!0;case 3:return C.fn.call(C.context,d,f),!0;case 4:return C.fn.call(C.context,d,f,x),!0;case 5:return C.fn.call(C.context,d,f,x,g),!0;case 6:return C.fn.call(C.context,d,f,x,g,v),!0}for(P=1,I=new Array(N-1);P<N;P++)I[P-1]=arguments[P];C.fn.apply(C.context,I)}else{var R=C.length,F;for(P=0;P<R;P++)switch(C[P].once&&this.removeListener(u,C[P].fn,void 0,!0),N){case 1:C[P].fn.call(C[P].context);break;case 2:C[P].fn.call(C[P].context,d);break;case 3:C[P].fn.call(C[P].context,d,f);break;case 4:C[P].fn.call(C[P].context,d,f,x);break;default:if(!I)for(F=1,I=new Array(N-1);F<N;F++)I[F-1]=arguments[F];C[P].fn.apply(C[P].context,I)}}return!0},l.prototype.on=function(u,d,f){return a(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return a(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,x){var g=n?n+u:u;if(!this._events[g])return this;if(!d)return o(this,g),this;var v=this._events[g];if(v.fn)v.fn===d&&(!x||v.once)&&(!f||v.context===f)&&o(this,g);else{for(var w=0,C=[],N=v.length;w<N;w++)(v[w].fn!==d||x&&!v[w].once||f&&v[w].context!==f)&&C.push(v[w]);C.length?this._events[g]=C.length===1?C[0]:C:o(this,g)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&o(this,d)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l}(kY)),kY.exports}var bnn=gnn();const ynn=ji(bnn);var TY=new ynn,IY="recharts.syncMouseEvents";function R_(e){"@babel/helpers - typeof";return R_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R_(e)}function vnn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wnn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,pUe(r.key),r)}}function Cnn(e,t,n){return wnn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function PY(e,t,n){return t=pUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pUe(e){var t=Snn(e,"string");return R_(t)=="symbol"?t:t+""}function Snn(e,t){if(R_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(R_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Nnn=function(){function e(){vnn(this,e),PY(this,"activeIndex",0),PY(this,"coordinateList",[]),PY(this,"layout","horizontal")}return Cnn(e,[{key:"setDetails",value:function(n){var r,s=n.coordinateList,a=s===void 0?null:s,o=n.container,l=o===void 0?null:o,c=n.layout,u=c===void 0?null:c,d=n.offset,f=d===void 0?null:d,x=n.mouseHandlerCallback,g=x===void 0?null:x;this.coordinateList=(r=a??this.coordinateList)!==null&&r!==void 0?r:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=g??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var s=this.container.getBoundingClientRect(),a=s.x,o=s.y,l=s.height,c=this.coordinateList[this.activeIndex].coordinate,u=((n=window)===null||n===void 0?void 0:n.scrollX)||0,d=((r=window)===null||r===void 0?void 0:r.scrollY)||0,f=a+c+u,x=o+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:f,pageY:x})}}}])}();function Ann(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],s=e==null?void 0:e[1];if(r&&s&&Xr(r)&&Xr(s))return!0}return!1}function jnn(e,t,n,r){var s=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-s:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-s,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function mUe(e){var t=e.cx,n=e.cy,r=e.radius,s=e.startAngle,a=e.endAngle,o=Qc(t,n,r,s),l=Qc(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:s,endAngle:a}}function Enn(e,t,n){var r,s,a,o;if(e==="horizontal")r=t.x,a=r,s=n.top,o=n.top+n.height;else if(e==="vertical")s=t.y,o=s,r=n.left,a=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,d=t.outerRadius,f=t.angle,x=Qc(l,c,u,f),g=Qc(l,c,d,f);r=x.x,s=x.y,a=g.x,o=g.y}else return mUe(t);return[{x:r,y:s},{x:a,y:o}]}function L_(e){"@babel/helpers - typeof";return L_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L_(e)}function B6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function OP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?B6e(Object(n),!0).forEach(function(r){_nn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _nn(e,t,n){return t=knn(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function knn(e){var t=Tnn(e,"string");return L_(t)=="symbol"?t:t+""}function Tnn(e,t){if(L_(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(L_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Inn(e){var t,n,r=e.element,s=e.tooltipEventType,a=e.isActive,o=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,x=e.chartName,g=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!g||!a||!o||x!=="ScatterChart"&&s!=="axis")return null;var v,w=i3;if(x==="ScatterChart")v=o,w=tZt;else if(x==="BarChart")v=jnn(f,o,c,d),w=yce;else if(f==="radial"){var C=mUe(o),N=C.cx,I=C.cy,P=C.radius,R=C.startAngle,F=C.endAngle;v={cx:N,cy:I,startAngle:R,endAngle:F,innerRadius:P,outerRadius:P},w=h$e}else v={points:Enn(f,o,c)},w=i3;var U=OP(OP(OP(OP({stroke:"#ccc",pointerEvents:"none"},c),v),mi(g,!1)),{},{payload:l,payloadIndex:u,className:ta("recharts-tooltip-cursor",g.className)});return m.isValidElement(g)?m.cloneElement(g,U):m.createElement(w,U)}var Pnn=["item"],Fnn=["children","className","width","height","style","compact","title","desc"];function HN(e){"@babel/helpers - typeof";return HN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},HN(e)}function BC(){return BC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},BC.apply(this,arguments)}function $6e(e,t){return Rnn(e)||Mnn(e,t)||gUe(e,t)||Onn()}function Onn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mnn(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function Rnn(e){if(Array.isArray(e))return e}function U6e(e,t){if(e==null)return{};var n=Lnn(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Lnn(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Dnn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bnn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,bUe(r.key),r)}}function $nn(e,t,n){return Bnn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Unn(e,t,n){return t=$L(t),znn(e,xUe()?Reflect.construct(t,n,$L(e).constructor):t.apply(e,n))}function znn(e,t){if(t&&(HN(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Hnn(e)}function Hnn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xUe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xUe=function(){return!!e})()}function $L(e){return $L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$L(e)}function Vnn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cne(e,t)}function Cne(e,t){return Cne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},Cne(e,t)}function VN(e){return Gnn(e)||qnn(e)||gUe(e)||Wnn()}function Wnn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gUe(e,t){if(e){if(typeof e=="string")return Sne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sne(e,t)}}function qnn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Gnn(e){if(Array.isArray(e))return Sne(e)}function Sne(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function z6e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Sr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?z6e(Object(n),!0).forEach(function(r){Ks(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z6e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ks(e,t,n){return t=bUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bUe(e){var t=Knn(e,"string");return HN(t)=="symbol"?t:t+""}function Knn(e,t){if(HN(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(HN(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ynn={xAxis:["bottom","top"],yAxis:["left","right"]},Xnn={width:"100%",height:"100%"},yUe={x:0,y:0};function MP(e){return e}var Qnn=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Znn=function(t,n,r,s){var a=n.find(function(d){return d&&d.index===r});if(a){if(t==="horizontal")return{x:a.coordinate,y:s.y};if(t==="vertical")return{x:s.x,y:a.coordinate};if(t==="centric"){var o=a.coordinate,l=s.radius;return Sr(Sr(Sr({},s),Qc(s.cx,s.cy,l,o)),{},{angle:o,radius:l})}var c=a.coordinate,u=s.angle;return Sr(Sr(Sr({},s),Qc(s.cx,s.cy,c,u)),{},{angle:u,radius:c})}return yUe},lU=function(t,n){var r=n.graphicalItems,s=n.dataStartIndex,a=n.dataEndIndex,o=(r??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(VN(l),VN(u)):l},[]);return o.length>0?o:t&&t.length&&Xr(s)&&Xr(a)?t.slice(s,a+1):[]};function vUe(e){return e==="number"?[0,"auto"]:void 0}var Nne=function(t,n,r,s){var a=t.graphicalItems,o=t.tooltipAxis,l=lU(n,t);return r<0||!a||!a.length||r>=l.length?null:a.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var x;if(o.dataKey&&!o.allowDuplicatedCategory){var g=f===void 0?l:f;x=HR(g,o.dataKey,s)}else x=f&&f[r]||l[r];return x?[].concat(VN(c),[u$e(u,x)]):c},[])},H6e=function(t,n,r,s){var a=s||{x:t.chartX,y:t.chartY},o=Qnn(a,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=UKt(o,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,x=Nne(t,n,d,f),g=Znn(r,l,d,a);return{activeTooltipIndex:d,activeLabel:f,activePayload:x,activeCoordinate:g}}return null},Jnn=function(t,n){var r=n.axes,s=n.graphicalItems,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,x=t.stackOffset,g=o$e(d,a);return r.reduce(function(v,w){var C,N=w.type.defaultProps!==void 0?Sr(Sr({},w.type.defaultProps),w.props):w.props,I=N.type,P=N.dataKey,R=N.allowDataOverflow,F=N.allowDuplicatedCategory,U=N.scale,L=N.ticks,z=N.includeHidden,X=N[o];if(v[X])return v;var ne=lU(t.data,{graphicalItems:s.filter(function(fe){var Ae,ce=o in fe.props?fe.props[o]:(Ae=fe.type.defaultProps)===null||Ae===void 0?void 0:Ae[o];return ce===X}),dataStartIndex:c,dataEndIndex:u}),J=ne.length,Z,re,he;Ann(N.domain,R,I)&&(Z=Dte(N.domain,null,R),g&&(I==="number"||U!=="auto")&&(he=i9(ne,P,"category")));var Y=vUe(I);if(!Z||Z.length===0){var ie,oe=(ie=N.domain)!==null&&ie!==void 0?ie:Y;if(P){if(Z=i9(ne,P,I),I==="category"&&g){var G=F$t(Z);F&&G?(re=Z,Z=NL(0,J)):F||(Z=J3e(oe,Z,w).reduce(function(fe,Ae){return fe.indexOf(Ae)>=0?fe:[].concat(VN(fe),[Ae])},[]))}else if(I==="category")F?Z=Z.filter(function(fe){return fe!==""&&!xi(fe)}):Z=J3e(oe,Z,w).reduce(function(fe,Ae){return fe.indexOf(Ae)>=0||Ae===""||xi(Ae)?fe:[].concat(VN(fe),[Ae])},[]);else if(I==="number"){var V=qKt(ne,s.filter(function(fe){var Ae,ce,ye=o in fe.props?fe.props[o]:(Ae=fe.type.defaultProps)===null||Ae===void 0?void 0:Ae[o],Ne="hide"in fe.props?fe.props.hide:(ce=fe.type.defaultProps)===null||ce===void 0?void 0:ce.hide;return ye===X&&(z||!Ne)}),P,a,d);V&&(Z=V)}g&&(I==="number"||U!=="auto")&&(he=i9(ne,P,"category"))}else g?Z=NL(0,J):l&&l[X]&&l[X].hasStack&&I==="number"?Z=x==="expand"?[0,1]:c$e(l[X].stackGroups,c,u):Z=a$e(ne,s.filter(function(fe){var Ae=o in fe.props?fe.props[o]:fe.type.defaultProps[o],ce="hide"in fe.props?fe.props.hide:fe.type.defaultProps.hide;return Ae===X&&(z||!ce)}),I,d,!0);if(I==="number")Z=wne(f,Z,X,a,L),oe&&(Z=Dte(oe,Z,R));else if(I==="category"&&oe){var ee=oe,ae=Z.every(function(fe){return ee.indexOf(fe)>=0});ae&&(Z=ee)}}return Sr(Sr({},v),{},Ks({},X,Sr(Sr({},N),{},{axisType:a,domain:Z,categoricalDomain:he,duplicateDomain:re,originalDomain:(C=N.domain)!==null&&C!==void 0?C:Y,isCategorical:g,layout:d})))},{})},ern=function(t,n){var r=n.graphicalItems,s=n.Axis,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,x=lU(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),g=x.length,v=o$e(d,a),w=-1;return r.reduce(function(C,N){var I=N.type.defaultProps!==void 0?Sr(Sr({},N.type.defaultProps),N.props):N.props,P=I[o],R=vUe("number");if(!C[P]){w++;var F;return v?F=NL(0,g):l&&l[P]&&l[P].hasStack?(F=c$e(l[P].stackGroups,c,u),F=wne(f,F,P,a)):(F=Dte(R,a$e(x,r.filter(function(U){var L,z,X=o in U.props?U.props[o]:(L=U.type.defaultProps)===null||L===void 0?void 0:L[o],ne="hide"in U.props?U.props.hide:(z=U.type.defaultProps)===null||z===void 0?void 0:z.hide;return X===P&&!ne}),"number",d),s.defaultProps.allowDataOverflow),F=wne(f,F,P,a)),Sr(Sr({},C),{},Ks({},P,Sr(Sr({axisType:a},s.defaultProps),{},{hide:!0,orientation:Yh(Ynn,"".concat(a,".").concat(w%2),null),domain:F,originalDomain:R,isCategorical:v,layout:d})))}return C},{})},trn=function(t,n){var r=n.axisType,s=r===void 0?"xAxis":r,a=n.AxisComp,o=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.children,f="".concat(s,"Id"),x=Qd(d,a),g={};return x.length?g=Jnn(t,{axes:x,graphicalItems:o,axisType:s,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(g=ern(t,{Axis:a,graphicalItems:o,axisType:s,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),g},nrn=function(t){var n=Tb(t),r=Og(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:Wle(r,function(s){return s.coordinate}),tooltipAxis:n,tooltipAxisBandSize:mL(n,r)}},V6e=function(t){var n=t.children,r=t.defaultShowTooltip,s=_f(n,IN),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),s&&s.props&&(s.props.startIndex>=0&&(a=s.props.startIndex),s.props.endIndex>=0&&(o=s.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},rrn=function(t){return!t||!t.length?!1:t.some(function(n){var r=Vg(n&&n.type);return r&&r.indexOf("Bar")>=0})},W6e=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},srn=function(t,n){var r=t.props,s=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,l=t.yAxisMap,c=l===void 0?{}:l,u=r.width,d=r.height,f=r.children,x=r.margin||{},g=_f(f,IN),v=_f(f,n3),w=Object.keys(c).reduce(function(F,U){var L=c[U],z=L.orientation;return!L.mirror&&!L.hide?Sr(Sr({},F),{},Ks({},z,F[z]+L.width)):F},{left:x.left||0,right:x.right||0}),C=Object.keys(o).reduce(function(F,U){var L=o[U],z=L.orientation;return!L.mirror&&!L.hide?Sr(Sr({},F),{},Ks({},z,Yh(F,"".concat(z))+L.height)):F},{top:x.top||0,bottom:x.bottom||0}),N=Sr(Sr({},C),w),I=N.bottom;g&&(N.bottom+=g.props.height||IN.defaultProps.height),v&&n&&(N=VKt(N,s,r,n));var P=u-N.left-N.right,R=d-N.top-N.bottom;return Sr(Sr({brushBottom:I},N),{},{width:Math.max(P,0),height:Math.max(R,0)})},irn=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},wUe=function(t){var n=t.chartName,r=t.GraphicalChild,s=t.defaultTooltipEventType,a=s===void 0?"axis":s,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,x=function(N,I){var P=I.graphicalItems,R=I.stackGroups,F=I.offset,U=I.updateId,L=I.dataStartIndex,z=I.dataEndIndex,X=N.barSize,ne=N.layout,J=N.barGap,Z=N.barCategoryGap,re=N.maxBarSize,he=W6e(ne),Y=he.numericAxisName,ie=he.cateAxisName,oe=rrn(P),G=[];return P.forEach(function(V,ee){var ae=lU(N.data,{graphicalItems:[V],dataStartIndex:L,dataEndIndex:z}),fe=V.type.defaultProps!==void 0?Sr(Sr({},V.type.defaultProps),V.props):V.props,Ae=fe.dataKey,ce=fe.maxBarSize,ye=fe["".concat(Y,"Id")],Ne=fe["".concat(ie,"Id")],be={},je=c.reduce(function(jt,un){var cn=I["".concat(un.axisType,"Map")],Pt=fe["".concat(un.axisType,"Id")];cn&&cn[Pt]||un.axisType==="zAxis"||G3();var Xe=cn[Pt];return Sr(Sr({},jt),{},Ks(Ks({},un.axisType,Xe),"".concat(un.axisType,"Ticks"),Og(Xe)))},be),Ie=je[ie],Re=je["".concat(ie,"Ticks")],Qe=R&&R[ye]&&R[ye].hasStack&&sYt(V,R[ye].stackGroups),Be=Vg(V.type).indexOf("Bar")>=0,it=mL(Ie,Re),tt=[],at=oe&&zKt({barSize:X,stackGroups:R,totalSize:irn(je,ie)});if(Be){var dt,ct,Ut=xi(ce)?re:ce,kt=(dt=(ct=mL(Ie,Re,!0))!==null&&ct!==void 0?ct:Ut)!==null&&dt!==void 0?dt:0;tt=HKt({barGap:J,barCategoryGap:Z,bandSize:kt!==it?kt:it,sizeList:at[Ne],maxBarSize:Ut}),kt!==it&&(tt=tt.map(function(jt){return Sr(Sr({},jt),{},{position:Sr(Sr({},jt.position),{},{offset:jt.position.offset-kt/2})})}))}var tn=V&&V.type&&V.type.getComposedData;tn&&G.push({props:Sr(Sr({},tn(Sr(Sr({},je),{},{displayedData:ae,props:N,dataKey:Ae,item:V,bandSize:it,barPosition:tt,offset:F,stackedData:Qe,layout:ne,dataStartIndex:L,dataEndIndex:z}))),{},Ks(Ks(Ks({key:V.key||"item-".concat(ee)},Y,je[Y]),ie,je[ie]),"animationId",U)),childIndex:q$t(V,N.children),item:V})}),G},g=function(N,I){var P=N.props,R=N.dataStartIndex,F=N.dataEndIndex,U=N.updateId;if(!p2e({props:P}))return null;var L=P.children,z=P.layout,X=P.stackOffset,ne=P.data,J=P.reverseStackOrder,Z=W6e(z),re=Z.numericAxisName,he=Z.cateAxisName,Y=Qd(L,r),ie=tYt(ne,Y,"".concat(re,"Id"),"".concat(he,"Id"),X,J),oe=c.reduce(function(fe,Ae){var ce="".concat(Ae.axisType,"Map");return Sr(Sr({},fe),{},Ks({},ce,trn(P,Sr(Sr({},Ae),{},{graphicalItems:Y,stackGroups:Ae.axisType===re&&ie,dataStartIndex:R,dataEndIndex:F}))))},{}),G=srn(Sr(Sr({},oe),{},{props:P,graphicalItems:Y}),I==null?void 0:I.legendBBox);Object.keys(oe).forEach(function(fe){oe[fe]=d(P,oe[fe],G,fe.replace("Map",""),n)});var V=oe["".concat(he,"Map")],ee=nrn(V),ae=x(P,Sr(Sr({},oe),{},{dataStartIndex:R,dataEndIndex:F,updateId:U,graphicalItems:Y,stackGroups:ie,offset:G}));return Sr(Sr({formattedGraphicalItems:ae,graphicalItems:Y,offset:G,stackGroups:ie},ee),oe)},v=function(C){function N(I){var P,R,F;return Dnn(this,N),F=Unn(this,N,[I]),Ks(F,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ks(F,"accessibilityManager",new Nnn),Ks(F,"handleLegendBBoxUpdate",function(U){if(U){var L=F.state,z=L.dataStartIndex,X=L.dataEndIndex,ne=L.updateId;F.setState(Sr({legendBBox:U},g({props:F.props,dataStartIndex:z,dataEndIndex:X,updateId:ne},Sr(Sr({},F.state),{},{legendBBox:U}))))}}),Ks(F,"handleReceiveSyncEvent",function(U,L,z){if(F.props.syncId===U){if(z===F.eventEmitterSymbol&&typeof F.props.syncMethod!="function")return;F.applySyncEvent(L)}}),Ks(F,"handleBrushChange",function(U){var L=U.startIndex,z=U.endIndex;if(L!==F.state.dataStartIndex||z!==F.state.dataEndIndex){var X=F.state.updateId;F.setState(function(){return Sr({dataStartIndex:L,dataEndIndex:z},g({props:F.props,dataStartIndex:L,dataEndIndex:z,updateId:X},F.state))}),F.triggerSyncEvent({dataStartIndex:L,dataEndIndex:z})}}),Ks(F,"handleMouseEnter",function(U){var L=F.getMouseInfo(U);if(L){var z=Sr(Sr({},L),{},{isTooltipActive:!0});F.setState(z),F.triggerSyncEvent(z);var X=F.props.onMouseEnter;wi(X)&&X(z,U)}}),Ks(F,"triggeredAfterMouseMove",function(U){var L=F.getMouseInfo(U),z=L?Sr(Sr({},L),{},{isTooltipActive:!0}):{isTooltipActive:!1};F.setState(z),F.triggerSyncEvent(z);var X=F.props.onMouseMove;wi(X)&&X(z,U)}),Ks(F,"handleItemMouseEnter",function(U){F.setState(function(){return{isTooltipActive:!0,activeItem:U,activePayload:U.tooltipPayload,activeCoordinate:U.tooltipPosition||{x:U.cx,y:U.cy}}})}),Ks(F,"handleItemMouseLeave",function(){F.setState(function(){return{isTooltipActive:!1}})}),Ks(F,"handleMouseMove",function(U){U.persist(),F.throttleTriggeredAfterMouseMove(U)}),Ks(F,"handleMouseLeave",function(U){F.throttleTriggeredAfterMouseMove.cancel();var L={isTooltipActive:!1};F.setState(L),F.triggerSyncEvent(L);var z=F.props.onMouseLeave;wi(z)&&z(L,U)}),Ks(F,"handleOuterEvent",function(U){var L=W$t(U),z=Yh(F.props,"".concat(L));if(L&&wi(z)){var X,ne;/.*touch.*/i.test(L)?ne=F.getMouseInfo(U.changedTouches[0]):ne=F.getMouseInfo(U),z((X=ne)!==null&&X!==void 0?X:{},U)}}),Ks(F,"handleClick",function(U){var L=F.getMouseInfo(U);if(L){var z=Sr(Sr({},L),{},{isTooltipActive:!0});F.setState(z),F.triggerSyncEvent(z);var X=F.props.onClick;wi(X)&&X(z,U)}}),Ks(F,"handleMouseDown",function(U){var L=F.props.onMouseDown;if(wi(L)){var z=F.getMouseInfo(U);L(z,U)}}),Ks(F,"handleMouseUp",function(U){var L=F.props.onMouseUp;if(wi(L)){var z=F.getMouseInfo(U);L(z,U)}}),Ks(F,"handleTouchMove",function(U){U.changedTouches!=null&&U.changedTouches.length>0&&F.throttleTriggeredAfterMouseMove(U.changedTouches[0])}),Ks(F,"handleTouchStart",function(U){U.changedTouches!=null&&U.changedTouches.length>0&&F.handleMouseDown(U.changedTouches[0])}),Ks(F,"handleTouchEnd",function(U){U.changedTouches!=null&&U.changedTouches.length>0&&F.handleMouseUp(U.changedTouches[0])}),Ks(F,"handleDoubleClick",function(U){var L=F.props.onDoubleClick;if(wi(L)){var z=F.getMouseInfo(U);L(z,U)}}),Ks(F,"handleContextMenu",function(U){var L=F.props.onContextMenu;if(wi(L)){var z=F.getMouseInfo(U);L(z,U)}}),Ks(F,"triggerSyncEvent",function(U){F.props.syncId!==void 0&&TY.emit(IY,F.props.syncId,U,F.eventEmitterSymbol)}),Ks(F,"applySyncEvent",function(U){var L=F.props,z=L.layout,X=L.syncMethod,ne=F.state.updateId,J=U.dataStartIndex,Z=U.dataEndIndex;if(U.dataStartIndex!==void 0||U.dataEndIndex!==void 0)F.setState(Sr({dataStartIndex:J,dataEndIndex:Z},g({props:F.props,dataStartIndex:J,dataEndIndex:Z,updateId:ne},F.state)));else if(U.activeTooltipIndex!==void 0){var re=U.chartX,he=U.chartY,Y=U.activeTooltipIndex,ie=F.state,oe=ie.offset,G=ie.tooltipTicks;if(!oe)return;if(typeof X=="function")Y=X(G,U);else if(X==="value"){Y=-1;for(var V=0;V<G.length;V++)if(G[V].value===U.activeLabel){Y=V;break}}var ee=Sr(Sr({},oe),{},{x:oe.left,y:oe.top}),ae=Math.min(re,ee.x+ee.width),fe=Math.min(he,ee.y+ee.height),Ae=G[Y]&&G[Y].value,ce=Nne(F.state,F.props.data,Y),ye=G[Y]?{x:z==="horizontal"?G[Y].coordinate:ae,y:z==="horizontal"?fe:G[Y].coordinate}:yUe;F.setState(Sr(Sr({},U),{},{activeLabel:Ae,activeCoordinate:ye,activePayload:ce,activeTooltipIndex:Y}))}else F.setState(U)}),Ks(F,"renderCursor",function(U){var L,z=F.state,X=z.isTooltipActive,ne=z.activeCoordinate,J=z.activePayload,Z=z.offset,re=z.activeTooltipIndex,he=z.tooltipAxisBandSize,Y=F.getTooltipEventType(),ie=(L=U.props.active)!==null&&L!==void 0?L:X,oe=F.props.layout,G=U.key||"_recharts-cursor";return Se.createElement(Inn,{key:G,activeCoordinate:ne,activePayload:J,activeTooltipIndex:re,chartName:n,element:U,isActive:ie,layout:oe,offset:Z,tooltipAxisBandSize:he,tooltipEventType:Y})}),Ks(F,"renderPolarAxis",function(U,L,z){var X=Yh(U,"type.axisType"),ne=Yh(F.state,"".concat(X,"Map")),J=U.type.defaultProps,Z=J!==void 0?Sr(Sr({},J),U.props):U.props,re=ne&&ne[Z["".concat(X,"Id")]];return m.cloneElement(U,Sr(Sr({},re),{},{className:ta(X,re.className),key:U.key||"".concat(L,"-").concat(z),ticks:Og(re,!0)}))}),Ks(F,"renderPolarGrid",function(U){var L=U.props,z=L.radialLines,X=L.polarAngles,ne=L.polarRadius,J=F.state,Z=J.radiusAxisMap,re=J.angleAxisMap,he=Tb(Z),Y=Tb(re),ie=Y.cx,oe=Y.cy,G=Y.innerRadius,V=Y.outerRadius;return m.cloneElement(U,{polarAngles:Array.isArray(X)?X:Og(Y,!0).map(function(ee){return ee.coordinate}),polarRadius:Array.isArray(ne)?ne:Og(he,!0).map(function(ee){return ee.coordinate}),cx:ie,cy:oe,innerRadius:G,outerRadius:V,key:U.key||"polar-grid",radialLines:z})}),Ks(F,"renderLegend",function(){var U=F.state.formattedGraphicalItems,L=F.props,z=L.children,X=L.width,ne=L.height,J=F.props.margin||{},Z=X-(J.left||0)-(J.right||0),re=s$e({children:z,formattedGraphicalItems:U,legendWidth:Z,legendContent:u});if(!re)return null;var he=re.item,Y=U6e(re,Pnn);return m.cloneElement(he,Sr(Sr({},Y),{},{chartWidth:X,chartHeight:ne,margin:J,onBBoxUpdate:F.handleLegendBBoxUpdate}))}),Ks(F,"renderTooltip",function(){var U,L=F.props,z=L.children,X=L.accessibilityLayer,ne=_f(z,zp);if(!ne)return null;var J=F.state,Z=J.isTooltipActive,re=J.activeCoordinate,he=J.activePayload,Y=J.activeLabel,ie=J.offset,oe=(U=ne.props.active)!==null&&U!==void 0?U:Z;return m.cloneElement(ne,{viewBox:Sr(Sr({},ie),{},{x:ie.left,y:ie.top}),active:oe,label:Y,payload:oe?he:[],coordinate:re,accessibilityLayer:X})}),Ks(F,"renderBrush",function(U){var L=F.props,z=L.margin,X=L.data,ne=F.state,J=ne.offset,Z=ne.dataStartIndex,re=ne.dataEndIndex,he=ne.updateId;return m.cloneElement(U,{key:U.key||"_recharts-brush",onChange:TP(F.handleBrushChange,U.props.onChange),data:X,x:Xr(U.props.x)?U.props.x:J.left,y:Xr(U.props.y)?U.props.y:J.top+J.height+J.brushBottom-(z.bottom||0),width:Xr(U.props.width)?U.props.width:J.width,startIndex:Z,endIndex:re,updateId:"brush-".concat(he)})}),Ks(F,"renderReferenceElement",function(U,L,z){if(!U)return null;var X=F,ne=X.clipPathId,J=F.state,Z=J.xAxisMap,re=J.yAxisMap,he=J.offset,Y=U.type.defaultProps||{},ie=U.props,oe=ie.xAxisId,G=oe===void 0?Y.xAxisId:oe,V=ie.yAxisId,ee=V===void 0?Y.yAxisId:V;return m.cloneElement(U,{key:U.key||"".concat(L,"-").concat(z),xAxis:Z[G],yAxis:re[ee],viewBox:{x:he.left,y:he.top,width:he.width,height:he.height},clipPathId:ne})}),Ks(F,"renderActivePoints",function(U){var L=U.item,z=U.activePoint,X=U.basePoint,ne=U.childIndex,J=U.isRange,Z=[],re=L.props.key,he=L.item.type.defaultProps!==void 0?Sr(Sr({},L.item.type.defaultProps),L.item.props):L.item.props,Y=he.activeDot,ie=he.dataKey,oe=Sr(Sr({index:ne,dataKey:ie,cx:z.x,cy:z.y,r:4,fill:bce(L.item),strokeWidth:2,stroke:"#fff",payload:z.payload,value:z.value},mi(Y,!1)),VR(Y));return Z.push(N.renderActiveDot(Y,oe,"".concat(re,"-activePoint-").concat(ne))),X?Z.push(N.renderActiveDot(Y,Sr(Sr({},oe),{},{cx:X.x,cy:X.y}),"".concat(re,"-basePoint-").concat(ne))):J&&Z.push(null),Z}),Ks(F,"renderGraphicChild",function(U,L,z){var X=F.filterFormatItem(U,L,z);if(!X)return null;var ne=F.getTooltipEventType(),J=F.state,Z=J.isTooltipActive,re=J.tooltipAxis,he=J.activeTooltipIndex,Y=J.activeLabel,ie=F.props.children,oe=_f(ie,zp),G=X.props,V=G.points,ee=G.isRange,ae=G.baseLine,fe=X.item.type.defaultProps!==void 0?Sr(Sr({},X.item.type.defaultProps),X.item.props):X.item.props,Ae=fe.activeDot,ce=fe.hide,ye=fe.activeBar,Ne=fe.activeShape,be=!!(!ce&&Z&&oe&&(Ae||ye||Ne)),je={};ne!=="axis"&&oe&&oe.props.trigger==="click"?je={onClick:TP(F.handleItemMouseEnter,U.props.onClick)}:ne!=="axis"&&(je={onMouseLeave:TP(F.handleItemMouseLeave,U.props.onMouseLeave),onMouseEnter:TP(F.handleItemMouseEnter,U.props.onMouseEnter)});var Ie=m.cloneElement(U,Sr(Sr({},X.props),je));function Re(un){return typeof re.dataKey=="function"?re.dataKey(un.payload):null}if(be)if(he>=0){var Qe,Be;if(re.dataKey&&!re.allowDuplicatedCategory){var it=typeof re.dataKey=="function"?Re:"payload.".concat(re.dataKey.toString());Qe=HR(V,it,Y),Be=ee&&ae&&HR(ae,it,Y)}else Qe=V==null?void 0:V[he],Be=ee&&ae&&ae[he];if(Ne||ye){var tt=U.props.activeIndex!==void 0?U.props.activeIndex:he;return[m.cloneElement(U,Sr(Sr(Sr({},X.props),je),{},{activeIndex:tt})),null,null]}if(!xi(Qe))return[Ie].concat(VN(F.renderActivePoints({item:X,activePoint:Qe,basePoint:Be,childIndex:he,isRange:ee})))}else{var at,dt=(at=F.getItemByXY(F.state.activeCoordinate))!==null&&at!==void 0?at:{graphicalItem:Ie},ct=dt.graphicalItem,Ut=ct.item,kt=Ut===void 0?U:Ut,tn=ct.childIndex,jt=Sr(Sr(Sr({},X.props),je),{},{activeIndex:tn});return[m.cloneElement(kt,jt),null,null]}return ee?[Ie,null,null]:[Ie,null]}),Ks(F,"renderCustomized",function(U,L,z){return m.cloneElement(U,Sr(Sr({key:"recharts-customized-".concat(z)},F.props),F.state))}),Ks(F,"renderMap",{CartesianGrid:{handler:MP,once:!0},ReferenceArea:{handler:F.renderReferenceElement},ReferenceLine:{handler:MP},ReferenceDot:{handler:F.renderReferenceElement},XAxis:{handler:MP},YAxis:{handler:MP},Brush:{handler:F.renderBrush,once:!0},Bar:{handler:F.renderGraphicChild},Line:{handler:F.renderGraphicChild},Area:{handler:F.renderGraphicChild},Radar:{handler:F.renderGraphicChild},RadialBar:{handler:F.renderGraphicChild},Scatter:{handler:F.renderGraphicChild},Pie:{handler:F.renderGraphicChild},Funnel:{handler:F.renderGraphicChild},Tooltip:{handler:F.renderCursor,once:!0},PolarGrid:{handler:F.renderPolarGrid,once:!0},PolarAngleAxis:{handler:F.renderPolarAxis},PolarRadiusAxis:{handler:F.renderPolarAxis},Customized:{handler:F.renderCustomized}}),F.clipPathId="".concat((P=I.id)!==null&&P!==void 0?P:y5("recharts"),"-clip"),F.throttleTriggeredAfterMouseMove=rBe(F.triggeredAfterMouseMove,(R=I.throttleDelay)!==null&&R!==void 0?R:1e3/60),F.state={},F}return Vnn(N,C),$nn(N,[{key:"componentDidMount",value:function(){var P,R;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(P=this.props.margin.left)!==null&&P!==void 0?P:0,top:(R=this.props.margin.top)!==null&&R!==void 0?R:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var P=this.props,R=P.children,F=P.data,U=P.height,L=P.layout,z=_f(R,zp);if(z){var X=z.props.defaultIndex;if(!(typeof X!="number"||X<0||X>this.state.tooltipTicks.length-1)){var ne=this.state.tooltipTicks[X]&&this.state.tooltipTicks[X].value,J=Nne(this.state,F,X,ne),Z=this.state.tooltipTicks[X].coordinate,re=(this.state.offset.top+U)/2,he=L==="horizontal",Y=he?{x:Z,y:re}:{y:Z,x:re},ie=this.state.formattedGraphicalItems.find(function(G){var V=G.item;return V.type.name==="Scatter"});ie&&(Y=Sr(Sr({},Y),ie.props.points[X].tooltipPosition),J=ie.props.points[X].tooltipPayload);var oe={activeTooltipIndex:X,isTooltipActive:!0,activeLabel:ne,activePayload:J,activeCoordinate:Y};this.setState(oe),this.renderCursor(z),this.accessibilityManager.setIndex(X)}}}},{key:"getSnapshotBeforeUpdate",value:function(P,R){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==R.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==P.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==P.margin){var F,U;this.accessibilityManager.setDetails({offset:{left:(F=this.props.margin.left)!==null&&F!==void 0?F:0,top:(U=this.props.margin.top)!==null&&U!==void 0?U:0}})}return null}},{key:"componentDidUpdate",value:function(P){ate([_f(P.children,zp)],[_f(this.props.children,zp)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var P=_f(this.props.children,zp);if(P&&typeof P.props.shared=="boolean"){var R=P.props.shared?"axis":"item";return l.indexOf(R)>=0?R:a}return a}},{key:"getMouseInfo",value:function(P){if(!this.container)return null;var R=this.container,F=R.getBoundingClientRect(),U=IVt(F),L={chartX:Math.round(P.pageX-U.left),chartY:Math.round(P.pageY-U.top)},z=F.width/R.offsetWidth||1,X=this.inRange(L.chartX,L.chartY,z);if(!X)return null;var ne=this.state,J=ne.xAxisMap,Z=ne.yAxisMap,re=this.getTooltipEventType(),he=H6e(this.state,this.props.data,this.props.layout,X);if(re!=="axis"&&J&&Z){var Y=Tb(J).scale,ie=Tb(Z).scale,oe=Y&&Y.invert?Y.invert(L.chartX):null,G=ie&&ie.invert?ie.invert(L.chartY):null;return Sr(Sr({},L),{},{xValue:oe,yValue:G},he)}return he?Sr(Sr({},L),he):null}},{key:"inRange",value:function(P,R){var F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,U=this.props.layout,L=P/F,z=R/F;if(U==="horizontal"||U==="vertical"){var X=this.state.offset,ne=L>=X.left&&L<=X.left+X.width&&z>=X.top&&z<=X.top+X.height;return ne?{x:L,y:z}:null}var J=this.state,Z=J.angleAxisMap,re=J.radiusAxisMap;if(Z&&re){var he=Tb(Z);return n5e({x:L,y:z},he)}return null}},{key:"parseEventsOfWrapper",value:function(){var P=this.props.children,R=this.getTooltipEventType(),F=_f(P,zp),U={};F&&R==="axis"&&(F.props.trigger==="click"?U={onClick:this.handleClick}:U={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var L=VR(this.props,this.handleOuterEvent);return Sr(Sr({},L),U)}},{key:"addListener",value:function(){TY.on(IY,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){TY.removeListener(IY,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(P,R,F){for(var U=this.state.formattedGraphicalItems,L=0,z=U.length;L<z;L++){var X=U[L];if(X.item===P||X.props.key===P.key||R===Vg(X.item.type)&&F===X.childIndex)return X}return null}},{key:"renderClipPath",value:function(){var P=this.clipPathId,R=this.state.offset,F=R.left,U=R.top,L=R.height,z=R.width;return Se.createElement("defs",null,Se.createElement("clipPath",{id:P},Se.createElement("rect",{x:F,y:U,height:L,width:z})))}},{key:"getXScales",value:function(){var P=this.state.xAxisMap;return P?Object.entries(P).reduce(function(R,F){var U=$6e(F,2),L=U[0],z=U[1];return Sr(Sr({},R),{},Ks({},L,z.scale))},{}):null}},{key:"getYScales",value:function(){var P=this.state.yAxisMap;return P?Object.entries(P).reduce(function(R,F){var U=$6e(F,2),L=U[0],z=U[1];return Sr(Sr({},R),{},Ks({},L,z.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(P){var R;return(R=this.state.xAxisMap)===null||R===void 0||(R=R[P])===null||R===void 0?void 0:R.scale}},{key:"getYScaleByAxisId",value:function(P){var R;return(R=this.state.yAxisMap)===null||R===void 0||(R=R[P])===null||R===void 0?void 0:R.scale}},{key:"getItemByXY",value:function(P){var R=this.state,F=R.formattedGraphicalItems,U=R.activeItem;if(F&&F.length)for(var L=0,z=F.length;L<z;L++){var X=F[L],ne=X.props,J=X.item,Z=J.type.defaultProps!==void 0?Sr(Sr({},J.type.defaultProps),J.props):J.props,re=Vg(J.type);if(re==="Bar"){var he=(ne.data||[]).find(function(G){return WQt(P,G)});if(he)return{graphicalItem:X,payload:he}}else if(re==="RadialBar"){var Y=(ne.data||[]).find(function(G){return n5e(P,G)});if(Y)return{graphicalItem:X,payload:Y}}else if(J$(X,U)||eU(X,U)||I_(X,U)){var ie=OZt({graphicalItem:X,activeTooltipItem:U,itemData:Z.data}),oe=Z.activeIndex===void 0?ie:Z.activeIndex;return{graphicalItem:Sr(Sr({},X),{},{childIndex:oe}),payload:I_(X,U)?Z.data[ie]:X.props.data[ie]}}}return null}},{key:"render",value:function(){var P=this;if(!p2e(this))return null;var R=this.props,F=R.children,U=R.className,L=R.width,z=R.height,X=R.style,ne=R.compact,J=R.title,Z=R.desc,re=U6e(R,Fnn),he=mi(re,!1);if(ne)return Se.createElement(g6e,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Se.createElement(lte,BC({},he,{width:L,height:z,title:J,desc:Z}),this.renderClipPath(),x2e(F,this.renderMap)));if(this.props.accessibilityLayer){var Y,ie;he.tabIndex=(Y=this.props.tabIndex)!==null&&Y!==void 0?Y:0,he.role=(ie=this.props.role)!==null&&ie!==void 0?ie:"application",he.onKeyDown=function(G){P.accessibilityManager.keyboardEvent(G)},he.onFocus=function(){P.accessibilityManager.focus()}}var oe=this.parseEventsOfWrapper();return Se.createElement(g6e,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Se.createElement("div",BC({className:ta("recharts-wrapper",U),style:Sr({position:"relative",cursor:"default",width:L,height:z},X)},oe,{ref:function(V){P.container=V}}),Se.createElement(lte,BC({},he,{width:L,height:z,title:J,desc:Z,style:Xnn}),this.renderClipPath(),x2e(F,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(m.Component);Ks(v,"displayName",n),Ks(v,"defaultProps",Sr({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Ks(v,"getDerivedStateFromProps",function(C,N){var I=C.dataKey,P=C.data,R=C.children,F=C.width,U=C.height,L=C.layout,z=C.stackOffset,X=C.margin,ne=N.dataStartIndex,J=N.dataEndIndex;if(N.updateId===void 0){var Z=V6e(C);return Sr(Sr(Sr({},Z),{},{updateId:0},g(Sr(Sr({props:C},Z),{},{updateId:0}),N)),{},{prevDataKey:I,prevData:P,prevWidth:F,prevHeight:U,prevLayout:L,prevStackOffset:z,prevMargin:X,prevChildren:R})}if(I!==N.prevDataKey||P!==N.prevData||F!==N.prevWidth||U!==N.prevHeight||L!==N.prevLayout||z!==N.prevStackOffset||!d4(X,N.prevMargin)){var re=V6e(C),he={chartX:N.chartX,chartY:N.chartY,isTooltipActive:N.isTooltipActive},Y=Sr(Sr({},H6e(N,P,L)),{},{updateId:N.updateId+1}),ie=Sr(Sr(Sr({},re),he),Y);return Sr(Sr(Sr({},ie),g(Sr({props:C},ie),N)),{},{prevDataKey:I,prevData:P,prevWidth:F,prevHeight:U,prevLayout:L,prevStackOffset:z,prevMargin:X,prevChildren:R})}if(!ate(R,N.prevChildren)){var oe,G,V,ee,ae=_f(R,IN),fe=ae&&(oe=(G=ae.props)===null||G===void 0?void 0:G.startIndex)!==null&&oe!==void 0?oe:ne,Ae=ae&&(V=(ee=ae.props)===null||ee===void 0?void 0:ee.endIndex)!==null&&V!==void 0?V:J,ce=fe!==ne||Ae!==J,ye=!xi(P),Ne=ye&&!ce?N.updateId:N.updateId+1;return Sr(Sr({updateId:Ne},g(Sr(Sr({props:C},N),{},{updateId:Ne,dataStartIndex:fe,dataEndIndex:Ae}),N)),{},{prevChildren:R,dataStartIndex:fe,dataEndIndex:Ae})}return null}),Ks(v,"renderActiveDot",function(C,N,I){var P;return m.isValidElement(C)?P=m.cloneElement(C,N):wi(C)?P=C(N):P=Se.createElement(Z$,N),Se.createElement(wa,{className:"recharts-active-dot",key:I},P)});var w=m.forwardRef(function(N,I){return Se.createElement(v,BC({},N,{ref:I}))});return w.displayName=v.displayName,w},arn=wUe({chartName:"LineChart",GraphicalChild:A0,axisComponents:[{axisType:"xAxis",AxisComp:n8},{axisType:"yAxis",AxisComp:r8}],formatAxisMap:T$e}),orn=wUe({chartName:"ComposedChart",GraphicalChild:[A0,S5,e8,oU],axisComponents:[{axisType:"xAxis",AxisComp:n8},{axisType:"yAxis",AxisComp:r8},{axisType:"zAxis",AxisComp:aU}],formatAxisMap:T$e});const lrn=({wallet:e})=>{const[t,n]=m.useState([]),[r]=m.useState("allTime"),[s]=m.useState("pnlHistory"),[a,o]=m.useState(!1),l=m.useRef(null),c=e||"";return m.useEffect(()=>{let u=new AbortController;const d=async()=>{var x,g,v;const f=`perp${r.charAt(0).toUpperCase()+r.slice(1)}`;o(!0);try{const I=(((g=(x=(await ls.post("https://api-ui.hyperliquid.xyz/info",{type:"portfolio",user:c},{headers:{Accept:"*/*","Content-Type":"application/json"},signal:u.signal})).data.find(P=>P[0]===f))==null?void 0:x[1])==null?void 0:g[s])||[]).map(([P,R])=>({time:new Date(P).getTime(),value:parseFloat(R)}));n(I)}catch(w){((v=w.response)==null?void 0:v.status)===429?(console.warn("Error 429..."),l.current=setTimeout(d,15e3)):w.name!=="CanceledError"&&(console.error("Error fetching chart data:",w),l.current=setTimeout(d,15e3))}finally{o(!1)}};return d(),()=>{u.abort(),l.current&&clearTimeout(l.current)}},[r,s,c]),i.jsx("div",{className:"bg-transparent rounded-2xl w-full",style:{minHeight:"40px"},children:a?i.jsx("div",{className:"w-full h-full flex justify-center items-center",children:i.jsx(KNe,{className:"w-5 h-5 -mb-[41px]"})}):t.length===0?i.jsx("div",{className:"w-full h-full flex justify-center items-center",children:i.jsx("span",{className:"text-gray-600 text-xs -mb-[41px]",children:"No chart data"})}):i.jsx(sBe,{width:"100%",height:40,children:i.jsxs(arn,{data:t,children:[i.jsx(n8,{dataKey:"time",hide:!0}),i.jsx(r8,{hide:!0}),i.jsx(zp,{cursor:{stroke:"#555",strokeWidth:1},content:({active:u,payload:d})=>{if(u&&d&&d.length){const f=d[0].payload,x=new Date(f.time),g=x.toLocaleDateString("en-GB",{month:"short",day:"2-digit"}).toUpperCase(),v=x.toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit"});return i.jsxs("div",{style:{background:"#1B1B1B",padding:"6px 10px",borderRadius:"12px",fontSize:"12px",color:"#fff",border:"1px solid #353535"},children:[i.jsxs("div",{className:"text-[12px] font-medium text-[#909090]",children:[g," ",v]}),i.jsxs("div",{className:"text-[14px] font-semibold flex items-center",children:[i.jsx("span",{className:"inline-block w-[8px] h-[8px] bg-[#67FFBD] rounded-full mr-1"}),i.jsx("span",{className:"text-[#67FFBD] mr-2",children:"PnL"}),i.jsxs("span",{children:["$",Er(f.value)]})]})]})}return null},wrapperStyle:{marginLeft:"-40px",marginTop:"-50px"}}),i.jsx(A0,{type:"monotone",dataKey:"value",stroke:"#67FFBD",strokeWidth:2,dot:!1,isAnimationActive:!1})]})})})},crn="https://dextradata.nftinit.io/api/hyper/analytics/wallet_backtest_summary/?format=json&limit=48&offset=0&order_by=three_month_pnl&order_dir=desc",urn=({handleAddedTime:e})=>{const{trackedWatchList:t,copyTradeWatchList:n,setSignModalOpen:r}=m.useContext(Gr),{address:s}=Yr(),[a,o]=m.useState([]),[l,c]=m.useState(!0),[u,d]=m.useState(null),[f,x]=m.useState(1),g=typeof window<"u"&&window.innerWidth>640?4:2,[v,w]=m.useState(!1),[C,N]=m.useState(null),[I,P]=m.useState(null),[R,F]=m.useState("");m.useEffect(()=>{(async()=>{try{c(!0),d(null);const J=await fetch(crn);if(!J.ok)throw new Error(`HTTP error! status: ${J.status}`);const Z=await J.json();o((Z==null?void 0:Z.data)||[])}catch{d("Failed to fetch wallets.")}finally{c(!1)}})()},[]);const U=async({walletAddress:ne,isFollow:J,isScalper:Z})=>{try{F(ne);const re=window.localStorage.getItem("hyperToken"),he=window.localStorage.getItem("hyperAddress");if(!re){r(!0);return}const Y=J?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",ie=J?{address:s?s.toLowerCase():he,token:re,follow_address:ne.toLowerCase()}:{address:s?s.toLowerCase():he,token:re},oe=await fetch(Y,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(ie)});if(!oe.ok)throw new Error(`Server responded with status ${oe.status}`);const G=await oe.json();G.success?(N(Array.isArray(G==null?void 0:G.data)?[...G.data].sort((V,ee)=>new Date(ee.created_at||0)-new Date(V.created_at||0)):G==null?void 0:G.data),P(Z),w(!0)):on.error(G.error_message)}catch(re){on.error(re.message||"Something went wrong!")}},L=Math.ceil(a.length/g),z=(f-1)*g,X=a.slice(z,z+g);return i.jsxs(i.Fragment,{children:[i.jsx(g5,{open:v,setOpen:w,copyTradeData:C,copyTradeWallet:R,setCopyTradeWallet:F,isScalper:I,setCopyTradeData:N}),i.jsx("div",{className:"grid grid-cols-2 gap-4 w-full",children:l?i.jsx("div",{className:"flex justify-center items-center w-full h-[300px] col-span-2",children:i.jsx(Ma,{})}):i.jsxs(i.Fragment,{children:[X==null?void 0:X.map((ne,J)=>{var he,Y,ie,oe,G,V,ee,ae,fe;const Z=t==null?void 0:t.some(Ae=>Ae.wallet_address===(ne==null?void 0:ne.user_token)),re=n==null?void 0:n.some(Ae=>Ae.wallet_address===(ne==null?void 0:ne.user_token));return i.jsx(Qp.div,{initial:{opacity:0,y:16,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{duration:.5,delay:J*.06,ease:[.22,1,.36,1]},whileHover:{y:-4,scale:1.01},whileTap:{scale:.99},className:"col-span-2 md:col-span-1 w-full relative rounded-[18px] p-[1px] bg-gradient-to-br from-[#67ffbd33] via-[#67ffbd66] to-[#67ffbd99]",children:i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4 w-full min-h-max sm:min-h-[220px] rounded-[18px] border border-[#2a2a2a] p-4 bg-[#0a0a0a]",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1.5 sm:gap-2 w-full",children:[i.jsx("img",{src:Hi,alt:"",className:"w-7 h-7 sm:w-8 sm:h-8 rounded-md"}),i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${ne==null?void 0:ne.user_token}`,"_blank"),e()},className:"text-white text-[12px] sm:text-base font-semibold font-manrope leading-none tracking-wide cursor-pointer",children:(ne==null?void 0:ne.user_token)&&(ne==null?void 0:ne.user_token.slice(0,6))+"..."+(ne==null?void 0:ne.user_token.slice(-4))}),i.jsx(x5,{walletAddress:ne==null?void 0:ne.user_token,children:i.jsx("div",{className:"w-[18px] h-[18px] justify-center items-center flex cursor-pointer",children:Z?i.jsx("img",{src:r5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:SA,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})}),i.jsx(lrn,{wallet:ne==null?void 0:ne.user_token})]}),i.jsxs("div",{className:"flex flex-col items-start gap-4 w-full",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start sm:flex-row sm:justify-between sm:items-center gap-2 md:gap-6 lg:gap-10 min-w-full h-[120px] sm:h-auto overflow-y-auto sm:overflow-hidden pr-2 sm:pr-0",children:[i.jsx(FY,{title:"PNL",data:[{label:"7D:",value:(he=ne==null?void 0:ne.source_data)==null?void 0:he.portfolio_perp_week_pnl,format:_s},{label:"30D:",value:(Y=ne==null?void 0:ne.source_data)==null?void 0:Y.portfolio_perp_month_pnl,format:_s},{label:"90D:",value:(ie=ne==null?void 0:ne.source_data)==null?void 0:ie.portfolio_perp_3month_pnl,format:_s}]}),i.jsx(FY,{title:"Growth Rate",data:[{label:"7D:",value:(oe=ne==null?void 0:ne.source_data)==null?void 0:oe.portfolio_perp_week_growth_rate},{label:"30D:",value:(G=ne==null?void 0:ne.source_data)==null?void 0:G.portfolio_perp_month_growth_rate},{label:"90D:",value:(V=ne==null?void 0:ne.source_data)==null?void 0:V.portfolio_perp_3month_growth_rate}]}),i.jsx(FY,{title:"Drawdown",data:[{label:"7D:",value:(ee=ne==null?void 0:ne.source_data)==null?void 0:ee.portfolio_perp_week_dd,format:_s},{label:"30D:",value:(ae=ne==null?void 0:ne.source_data)==null?void 0:ae.portfolio_perp_month_dd,format:_s},{label:"90D:",value:(fe=ne==null?void 0:ne.source_data)==null?void 0:fe.portfolio_perp_3month_dd,format:_s}]})]}),i.jsxs(Qp.button,{onClick:Ae=>{Ae.preventDefault(),U({walletAddress:ne==null?void 0:ne.user_token,isFollow:re,isScalper:ne==null?void 0:ne.is_scalper})},whileHover:{scale:1.02},whileTap:{scale:.98},className:`relative overflow-hidden w-full h-9 rounded-xl px-4 inline-flex items-center justify-center font-semibold cursor-pointer ${re?"bg-[#67ffbd] text-[#161616]":"text-[#161616]"}`,children:[i.jsx("span",{className:"relative z-10",children:re?"Adjust Copy":"Copy Trade"}),!re&&i.jsxs(i.Fragment,{children:[i.jsx(Qp.span,{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 rounded-xl",style:{background:"linear-gradient(90deg, #67FFCD 0%, #67FFBD 50%, #67FFFD 100%)",backgroundSize:"300% 100%"},initial:{backgroundPosition:"0% 50%",opacity:1},animate:{backgroundPosition:["0% 50%","100% 50%","0% 50%"]},transition:{duration:3.2,repeat:1/0,ease:"linear"}}),i.jsx(Qp.span,{"aria-hidden":!0,className:"pointer-events-none absolute -inset-1 rounded-xl blur-lg",style:{background:"radial-gradient(60% 60% at 50% 50%, rgba(117,53,254,0.55), transparent 60%)"},initial:{opacity:.6},animate:{opacity:[.55,.95,.55],scale:[1,1.03,1]},transition:{duration:1.6,repeat:1/0,ease:"easeInOut"}})]})]})]})]})},`${z+J}-${ne==null?void 0:ne.user_token}`)}),i.jsxs("div",{className:"flex justify-center items-center gap-4 w-full col-span-2",children:[i.jsx("button",{className:"px-3 py-1 rounded bg-[#333] text-white disabled:opacity-50 focus:outline-none focus:ring-0 border-none",onClick:()=>x(ne=>ne-1),disabled:f===1,children:"Prev"}),i.jsxs("span",{className:"text-white text-sm",children:["Page ",f," of ",L]}),i.jsx("button",{className:"px-3 py-1 rounded bg-[#333] text-white disabled:opacity-50 focus:outline-none focus:ring-0 border-none",onClick:()=>x(ne=>ne+1),disabled:f===L,children:"Next"})]})]})})]})},FY=({title:e,data:t})=>i.jsxs("div",{className:"flex flex-col justify-start items-start gap-4 w-full",children:[i.jsxs("div",{className:"flex flex-col items-start gap-2 w-full",children:[i.jsx("div",{className:"text-[#fff] text-xs font-normal font-manrope leading-[13px] tracking-wide min-w-max",children:e}),t.map((n,r)=>i.jsxs("div",{className:"flex justify-between sm:justify-start items-center gap-2 w-full",children:[i.jsx("span",{className:"flex justify-start items-center text-[#9b9b9b] text-xs font-medium min-w-[30px]",children:n.label}),i.jsxs("span",{className:`${n.value==null||isNaN(parseFloat(n.value))||n.value==0?"text-white":n.value>0?"text-[#1DE6A3]":"text-[#FF7173]"} text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px]`,children:[e==="Growth Rate"||e==="Drawdown"?"":"$",n.format?n.format(Math.abs(n.value)):_s(n.value),e==="Growth Rate"||e==="Drawdown"?"%":""]})]},r))]}),(e==="Growth Rate"||e==="PNL")&&i.jsx("div",{className:"h-px w-full min-w-full sm:hidden bg-[#404040]"})]}),drn=({open:e,setOpen:t,sevenSelectShow:n})=>{const[r,s]=m.useState(!1),a=()=>{if(n)if(r){const l=Date.now()+6048e5;localStorage.setItem("dailyPicksBlockedUntil",l.toString())}else localStorage.setItem("dailyPicksDismissedAt",Date.now().toString());t(!1)},o=()=>{if(n)if(r){const l=Date.now()+6048e5;localStorage.setItem("dailyPicksBlockedUntil",l.toString())}else localStorage.setItem("dailyPicksDismissedAt",Date.now().toString())};return i.jsxs(ga,{open:e,onClose:a,className:"relative z-50",children:[i.jsx(xa,{as:Qp.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 backdrop-blur-md",style:{background:"radial-gradient(120% 120% at 10% 10%, rgba(117,53,254,0.26), transparent 60%), radial-gradient(120% 120% at 90% 10%, rgba(103,255,189,0.20), transparent 60%), rgba(0,0,0,0.55)"}}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-center justify-center p-4 text-center sm:p-0",children:i.jsx(da,{as:Qp.div,initial:{opacity:0,y:22,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",bounce:.22,duration:.5},className:"relative transform overflow-hidden rounded-3xl w-full xl:w-[70%] 2xl:w-[60%] p-[1px] bg-gradient-to-br from-black/90 via-black/70 to-black/50",children:i.jsxs("div",{className:"relative flex flex-col justify-start items-center gap-6 w-full min-h-[420px] p-4 sm:p-8 rounded-3xl",children:[i.jsxs("div",{className:"absolute inset-0 -z-10 overflow-hidden rounded-3xl",children:[i.jsx(Qp.div,{className:"absolute -inset-28 opacity-60",style:{background:"radial-gradient(60% 60% at 20% 20%, rgba(103,255,189,0.18) 0%, transparent 60%), radial-gradient(60% 60% at 80% 30%, rgba(117,53,254,0.18) 0%, transparent 60%), radial-gradient(70% 70% at 50% 90%, rgba(255,121,124,0.18) 0%, transparent 60%)"},animate:{rotate:[0,360]},transition:{duration:60,repeat:1/0,ease:"linear"}}),i.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_top,rgba(255,255,255,0.06),transparent_60%)]"}),i.jsx("div",{className:"absolute inset-0 bg-[linear-gradient(rgba(255,255,255,0.06)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.06)_1px,transparent_1px)] bg-[size:18px_18px] opacity-10"})]}),i.jsx("button",{onClick:a,className:"cursor-pointer flex w-9 h-9 absolute right-3 top-3 rounded-full p-1 justify-center items-center hover:bg-[#7535FE]/70",children:i.jsx("img",{className:"p-1",src:Oa,alt:"close"})}),i.jsx("div",{className:"flex justify-start items-center w-full",children:i.jsxs("div",{className:"flex flex-col items-start w-full gap-3 sm:gap-5",children:[i.jsx("div",{className:"text-white font-manrope text-[20px] sm:text-[22px] font-extrabold leading-none -ml-[3px] tracking-[-0.2px]",children:"🔥 Daily Picks"}),i.jsx("div",{className:"text-[13px] sm:text-[14px] text-start text-white/90 font-manrope font-semibold leading-[18px] max-w-[70ch]",children:"Our algorithm highlights traders with proven skills, strong profits, and low drawdowns — ready for you to copy."})]})}),i.jsx("div",{className:"flex justify-start items-center w-full",children:i.jsx(urn,{handleAddedTime:o})}),n&&i.jsxs("div",{className:"flex justify-start items-center gap-2 w-full",children:[i.jsx("input",{type:"checkbox",checked:r,onChange:l=>s(l.target.checked),className:"w-4 h-4 accent-[#7535FE]"}),i.jsx("label",{className:"text-[12px] sm:text-[13px] text-white/90 font-manrope font-semibold leading-[16px]",children:"Don’t show this popup again for the next 7 days"})]})]})})})})]})},frn=()=>{const[e,t]=m.useState(!1);return i.jsxs(i.Fragment,{children:[i.jsx(drn,{open:e,setOpen:t,sevenSelectShow:!1}),i.jsxs("div",{onClick:()=>t(!0),className:"flex justify-start items-center gap-1.5 rounded-2xl text-white  bg-transparent px-2 py-0.5 cursor-pointer w-max",children:[i.jsxs("svg",{className:"bn-svg !text-[16px] w-3.5 h-3.5 -mt-[1.5px]",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M3.3 20.7h17.4V6.3H3.3v14.4zm19.2.3l-.008.153a1.5 1.5 0 01-1.339 1.34L21 22.5H3l-.153-.008a1.5 1.5 0 01-1.34-1.339L1.5 21V6a1.5 1.5 0 011.347-1.492L3 4.5h18l.153.008A1.5 1.5 0 0122.5 6v15z",fill:"currentColor"}),i.jsx("path",{d:"M6.1 5V2.5a.9.9 0 011.8 0V5a.9.9 0 01-1.8 0zM16.1 5V2.5a.9.9 0 011.8 0V5a.9.9 0 01-1.8 0zM21 9.1l.092.004a.9.9 0 010 1.792L21 10.9H2.5a.9.9 0 010-1.8H21zM11.1 12.5v4.517l-1.507-1.32a.9.9 0 00-1.186 1.356l3 2.625.066.052a.9.9 0 001.12-.052l3-2.625.066-.065a.9.9 0 00-1.18-1.347l-.072.056-1.507 1.32V12.5a.9.9 0 00-1.8 0z",fill:"currentColor"})]}),i.jsx("span",{className:"text-white text-[11px] font-semibold font-manrope",children:"Daily Picks"})]})]})};function hrn(){return i.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-[60] h-[30px] bg-[#0B0B0B]/70 backdrop-blur",children:i.jsxs("div",{className:"flex justify-between items-center h-full w-full gap-2 sm:gap-4 pl-2 sm:pl-4 pr-5",children:[i.jsx("div",{className:"flex justify-start items-center",children:i.jsx(frn,{})}),i.jsxs("div",{className:"h-full w-full flex items-center justify-end gap-2",children:[i.jsx(TLt,{}),i.jsx(ILt,{}),i.jsx(PLt,{}),i.jsx(FLt,{})]})]})})}const prn=()=>{const e=Ic();return i.jsxs("div",{className:"flex flex-col items-stretch justify-start w-screen h-[100dvh] overflow-hidden p-0 m-0 realtive",children:[(e.pathname==="/discover-wallets"||e.pathname==="/hyperliquid-whale-trades")&&i.jsx(kLt,{}),i.jsx("div",{className:"hidden sm:block",children:i.jsx(tLt,{})}),i.jsx("div",{className:"block sm:hidden",children:i.jsx(_Lt,{})}),i.jsx("div",{style:{height:"calc(100vh - 4.875rem)"},className:"flex flex-col items-stretch justify-start flex-grow h-full w-[100vw] overflow-auto",children:i.jsx("main",{children:i.jsx($Ke,{})})}),i.jsx(hrn,{})]})},ra=({info1:e,info2:t,padding:n,icon:r,info1_Color:s,info2_Color:a,rowTwo:o,info3:l})=>i.jsxs("div",{className:`${n||"pl-1 pr-2"} flex flex-col gap-2 font-manrope`,children:[i.jsxs("div",{className:`${s} ${o?"-mt-3.5":""} text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px]`,children:[i.jsx("img",{src:r,alt:"",className:""}),l?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-[#1DE6A3]",children:e})," /"," ",i.jsx("span",{className:"text-[#FF7173]",children:l})]}):e]}),t&&i.jsx("div",{className:`${a} text-xs font-normal not-italic font-inter flex items-center justify-end leading-3 min-w-max text-[#979797]`,children:t})]}),Ga=({className:e})=>i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("path",{d:"M11.9467 5.45312H7.79341H4.05341C3.41341 5.45312 3.09341 6.22646 3.54674 6.67979L7.00008 10.1331C7.55341 10.6865 8.45341 10.6865 9.00674 10.1331L10.3201 8.81979L12.4601 6.67979C12.9067 6.22646 12.5867 5.45312 11.9467 5.45312Z",fill:"currentColor"})}),cU=({sortKey:e,state:t,className:n})=>"-"+e===t?i.jsx(Ga,{className:"text-white hover:text-[#D8D3D3] group-hover:text-[#D8D3D3] rotate-180 "+n}):e===t?i.jsx(Ga,{className:"text-white hover:text-[#D8D3D3] group-hover:text-[#D8D3D3] "+n}):i.jsx(Ga,{className:"text-[#9B9B9B] hover:text-[#D8D3D3] group-hover:text-[#D8D3D3] "+n}),Wo=({title:e,sortKey:t,sortOption:n,setSortOption:r,isFilterIcon:s,isFilter:a})=>{const o=()=>{r(n===`-${t}`?t:`-${t}`)};return i.jsx(i.Fragment,{children:i.jsxs("div",{onClick:()=>o(),className:`${e==="Wallet"?"sm:sticky left-0 h-8":s?"justify-end":"justify-start"} flex items-center gap-1 min-w-max font-manrope cursor-pointer`,children:[i.jsx("div",{className:`${n===t||n===`-${t}`?"text-white":""} cursor-pointer flex items-center justify-end group`,children:e}),i.jsx(cU,{sortKey:t,state:n,className:""})]})})};function El(e){const[t,n]=m.useState(e.minFilterType||""),[r,s]=m.useState(e.maxFilterType||"");m.useEffect(()=>{n(e.minFilterType||"")},[e.minFilterType]),m.useEffect(()=>{s(e.maxFilterType||"")},[e.maxFilterType]);const a=()=>{e.handleChange({target:{name:e.minInputName,value:t}})},o=()=>{e.handleChange({target:{name:e.maxInputName,value:r}})},l=f=>f.preventDefault(),c=f=>f.target.addEventListener("wheel",l,{passive:!1}),u=f=>f.target.removeEventListener("wheel",l),d=f=>{["-","+","e"].includes(f.key)&&f.preventDefault()};return i.jsxs("div",{className:"col-span-1 flex flex-col justify-start max-w-full z-3 font-manrope gap-[13px]",children:[i.jsxs("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px] flex justify-start items-center gap-1",children:[e.name,e.isTooltip&&i.jsxs("span",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#c9c9c9] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(_a,{content:"Snapshot data per hour",positionTop:!1,alignRight:!0})})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{value:t,onChange:f=>n(f.target.value),onBlur:a,onFocus:c,onBlurCapture:u,type:"number",name:e.minInputName,onKeyDown:["Win Count","Loss Count","Trades Count","Tx Count","Perp Equity","Margin %","Margin Used","Avg. Lvg.","Drawdown PnL"].includes(e.name)?d:void 0,placeholder:"Min",className:`py-0.5 bg-[#1b1b1b] rounded-md border border-[#303030] h-8 block text-white text-sm font-medium font-inter leading-[8px] w-1/2 px-2 ${t!==""?"border border-[#8d67ff]":""} focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#535353] placeholder:text-sm placeholder:font-medium placeholder:font-inter placeholder:leading-[8px]`}),i.jsx("input",{value:r,onChange:f=>s(f.target.value),onBlur:o,onFocus:c,onBlurCapture:u,type:"number",name:e.maxInputName,onKeyDown:["Win Count","Loss Count","Trades Count","Tx Count","Perp Equity","Margin %","Margin Used","Avg. Lvg.","Drawdown PnL"].includes(e.name)?d:void 0,placeholder:"Max",className:`bg-[#1b1b1b] rounded-md border border-[#303030] py-0.5 h-8 block sm:text-sm font-semibold font-manrope leading-none w-1/2 px-2 ${r!==""?"border border-[#8d67ff]":""} focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#535353] placeholder:text-sm placeholder:font-medium placeholder:font-inter placeholder:leading-[8px]`})]})]})}function q6e(e){m.useEffect(()=>{const s=e.minFilterType,a=e.maxFilterType;s&&e.setMinValue(t(s)),a&&e.setMaxValue(t(a))},[e.minInputName,e.maxInputName]);const t=s=>{const a=new Date(Number(s));if(isNaN(a.getTime()))return"";const o=a.getFullYear(),l=String(a.getMonth()+1).padStart(2,"0"),c=String(a.getDate()).padStart(2,"0");return String(a.getHours()).padStart(2,"0"),String(a.getMinutes()).padStart(2,"0"),`${o}-${l}-${c}`},n=s=>{const{name:a,value:o}=s.target;if(!o){e.setAdvancedFilters(c=>({...c,[a]:""})),a===e.minInputName?e.setMinValue(""):a===e.maxInputName&&e.setMaxValue("");return}const l=new Date(o).getTime();e.setAdvancedFilters(c=>({...c,[a]:l})),a===e.minInputName?e.setMinValue(o):a===e.maxInputName&&e.setMaxValue(o)},r=async()=>{const s={...e.advancedFilters,[e.minInputName]:"",[e.maxInputName]:""};e.setMinValue(""),e.setMaxValue(""),e.setAdvancedFilters(s)};return i.jsxs("div",{className:"col-span-1 flex flex-col justify-start gap-[7px] min-w-max xl:w-full z-3 font-manrope",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:e.name}),i.jsx("div",{onClick:()=>{r()},className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("input",{value:e.minValue||"",onChange:n,type:"date",name:e.minInputName,placeholder:"Min",className:`${e.minValue!==void 0&&e.minValue!==null&&e.minValue!==""?"border border-[#8d67ff] input-data-time-local-white-full":"input-data-time-local-dark-empty"} shadow-sm py-0.5 bg-[#1b1b1b] h-8 border border-[#303030] block sm:text-sm font-semibold font-manrope leading-none rounded-md w-full px-2 focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#535353]`}),i.jsx("input",{value:e.maxValue||"",onChange:n,type:"date",name:e.maxInputName,placeholder:"Max",className:`${e.maxValue!==void 0&&e.maxValue!==null&&e.maxValue!==""?"border border-[#8d67ff] input-data-time-local-white-full":"input-data-time-local-dark-empty"} shadow-sm py-0.5 bg-[#1b1b1b] h-8 border border-[#303030] block sm:text-sm font-semibold font-manrope leading-none rounded-md w-full px-2 focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#535353]`})]})]})}const mrn=({className:e})=>i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("path",{d:"M11.62 5.22084L7.81667 9.02417C7.3675 9.47334 6.6325 9.47334 6.18334 9.02417L2.38 5.22084",stroke:"#7C7C7C",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})}),OY=({title:e,titleInfo:t,icon:n,children:r})=>{const[s,a]=m.useState(!1),o=()=>{a(!s)};return i.jsxs("div",{className:"overflow-hidden w-full border-t border-t-[#353535]",children:[i.jsxs("div",{className:"w-full flex items-center justify-between pt-3 cursor-pointer",onClick:o,children:[i.jsxs("div",{className:"flex items-center",children:[n&&i.jsx("span",{className:"w-[18px] h-[18px] mr-[8px]",children:n}),i.jsx("span",{className:"text-white font-manrope text-[13px] font-semibold leading-[8px]",children:e}),i.jsx("span",{className:`${t>0?"bg-[#67ffbd]/40 text-[#7bf4bf] shadow-2xl shadow-green-500 text-[10px] font-bold flex justify-center items-center rounded-md px-1.5 py-1 tracking-wide ml-1":"text-white text-[13px] font-semibold"} font-['Manrope'] leading-[8px] `,children:t>0?t:"(0)"})]}),i.jsx("span",{className:`transform transition-transform duration-300 ${s?"rotate-180":"rotate-0"}`,children:i.jsx(mrn,{})})]}),i.jsx("div",{className:`flex flex-col transition-[opacity,padding] duration-300 ease-in-out ${s?"opacity-100 pt-4 pb-4 space-y-4 m-1":"opacity-0 h-0 p-0"}`,children:s&&r})]})},xrn=({className:e})=>i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[i.jsx("path",{d:"M11.1375 2.96251V5.81251H10.0125V2.96251C10.0125 2.76001 9.8325 2.66251 9.7125 2.66251C9.675 2.66251 9.6375 2.67001 9.6 2.68501L3.6525 4.92751C3.255 5.07751 3 5.45251 3 5.88001V6.38251C2.3175 6.89251 1.875 7.71001 1.875 8.63251V5.88001C1.875 4.98751 2.4225 4.19251 3.255 3.87751L9.21 1.62751C9.375 1.56751 9.5475 1.53751 9.7125 1.53751C10.4625 1.53751 11.1375 2.14501 11.1375 2.96251Z",fill:"currentColor"}),i.jsx("path",{d:"M16.125 10.875V11.625C16.125 11.8275 15.9675 11.9925 15.7575 12H14.6625C14.265 12 13.905 11.7075 13.875 11.3175C13.8525 11.085 13.9425 10.8675 14.0925 10.7175C14.2275 10.575 14.415 10.5 14.6175 10.5H15.75C15.9675 10.5075 16.125 10.6725 16.125 10.875Z",fill:"currentColor"}),i.jsx("path",{d:"M14.61 9.7125H15.375C15.7875 9.7125 16.125 9.375 16.125 8.9625V8.6325C16.125 7.08 14.8575 5.8125 13.305 5.8125H4.695C4.0575 5.8125 3.4725 6.0225 3 6.3825C2.3175 6.8925 1.875 7.71 1.875 8.6325V13.68C1.875 15.2325 3.1425 16.5 4.695 16.5H13.305C14.8575 16.5 16.125 15.2325 16.125 13.68V13.5375C16.125 13.125 15.7875 12.7875 15.375 12.7875H14.7225C14.0025 12.7875 13.3125 12.345 13.125 11.6475C12.9675 11.0775 13.155 10.53 13.53 10.1625C13.8075 9.8775 14.19 9.7125 14.61 9.7125ZM10.5 9.5625H5.25C4.9425 9.5625 4.6875 9.3075 4.6875 9C4.6875 8.6925 4.9425 8.4375 5.25 8.4375H10.5C10.8075 8.4375 11.0625 8.6925 11.0625 9C11.0625 9.3075 10.8075 9.5625 10.5 9.5625Z",fill:"currentColor"})]}),grn=({className:e})=>i.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("path",{d:"M12.1425 1.5H5.8575C3.1275 1.5 1.5 3.1275 1.5 5.8575V12.135C1.5 14.8725 3.1275 16.5 5.8575 16.5H12.135C14.865 16.5 16.4925 14.8725 16.4925 12.1425V5.8575C16.5 3.1275 14.8725 1.5 12.1425 1.5ZM12.945 7.47L11.2125 9.705C10.995 9.9825 10.6875 10.1625 10.335 10.2C9.9825 10.245 9.6375 10.1475 9.36 9.93L7.9875 8.85C7.935 8.805 7.875 8.805 7.845 8.8125C7.815 8.8125 7.7625 8.8275 7.7175 8.8875L5.9325 11.205C5.82 11.3475 5.655 11.4225 5.49 11.4225C5.37 11.4225 5.25 11.385 5.145 11.3025C4.8975 11.115 4.8525 10.7625 5.04 10.515L6.825 8.1975C7.0425 7.92 7.35 7.74 7.7025 7.695C8.0475 7.65 8.4 7.7475 8.6775 7.965L10.05 9.045C10.1025 9.09 10.155 9.09 10.1925 9.0825C10.2225 9.0825 10.275 9.0675 10.32 9.0075L12.0525 6.7725C12.24 6.525 12.6 6.48 12.84 6.675C13.0875 6.8775 13.1325 7.23 12.945 7.47Z",fill:"white"})}),brn=({className:e})=>i.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("path",{d:"M12.1425 1.5H5.8575C3.1275 1.5 1.5 3.1275 1.5 5.8575V12.135C1.5 14.8725 3.1275 16.5 5.8575 16.5H12.135C14.865 16.5 16.4925 14.8725 16.4925 12.1425V5.8575C16.5 3.1275 14.8725 1.5 12.1425 1.5ZM7.5975 10.875C7.815 11.0925 7.815 11.4525 7.5975 11.67C7.485 11.7825 7.3425 11.835 7.2 11.835C7.0575 11.835 6.915 11.7825 6.8025 11.67L4.935 9.8025C4.4925 9.36 4.4925 8.6475 4.935 8.205L6.8025 6.3375C7.02 6.12 7.38 6.12 7.5975 6.3375C7.815 6.555 7.815 6.915 7.5975 7.1325L5.73 9L7.5975 10.875ZM13.065 9.795L11.1975 11.6625C11.085 11.775 10.9425 11.8275 10.8 11.8275C10.6575 11.8275 10.515 11.775 10.4025 11.6625C10.185 11.445 10.185 11.085 10.4025 10.8675L12.27 9L10.4025 7.125C10.185 6.9075 10.185 6.5475 10.4025 6.33C10.62 6.1125 10.98 6.1125 11.1975 6.33L13.065 8.1975C13.5075 8.64 13.5075 9.36 13.065 9.795Z",fill:"white"})});nBe();function yrn(e){var X,ne,J,Z,re,he,Y,ie,oe,G;const[t,n]=m.useState(!1),r=m.useRef(null),[s,a]=m.useState(!1),o=m.useRef(null);m.useEffect(()=>{var ee;const V=(ee=e.advancedFilters)==null?void 0:ee.coin;if(e.dataCoin.length>0){const fe=V.split(",").map(Ae=>e.dataCoin.find(ce=>ce.value===Ae)).filter(Boolean);e.setSelectedCoins(fe)}},[e.dataCoin]),m.useEffect(()=>{var ee;const V=(ee=e.advancedFilters)==null?void 0:ee.refcode;if(V&&e.dataReferral.length>0){const fe=V.split(",").map(Ae=>e.dataReferral.find(ce=>ce.value===Ae)).filter(Boolean);e.setSelectedReferrals(fe)}},[e.dataReferral]);const l=V=>{if(!V)return;const ae=Array.isArray(V)?V:[V],fe=e.selectedCoins||[],Ae=[...fe,...ae.filter(Ne=>!fe.some(be=>be.value===Ne.value))],ye=Ae.map(Ne=>Ne.value).join(",");e.setSelectedCoins(Ae),e.setAdvancedFilters(Ne=>({...Ne,coin:ye}))},c=V=>{if(!V)return;const ae=Array.isArray(V)?V:[V],fe=e.selectedReferrals||[],Ae=[...fe,...ae.filter(ye=>!fe.some(Ne=>Ne.value===ye.value))],ce=Ae.map(ye=>ye.value);ce.join(","),e.setSelectedReferrals(Ae),e.setAdvancedFilters(ye=>({...ye,refcode:ce}))},u=V=>{const{name:ee,value:ae}=V.target;e.setAdvancedFilters(fe=>({...fe,[ee]:ae}))},d={control:(V,{isFocused:ee})=>{var ae,fe,Ae,ce,ye,Ne,be,je;return{...V,display:"flex",alignItems:"center",paddingLeft:"21px",backgroundColor:"#353535",minHeight:"32px",maxHeight:"32px",border:Array.isArray((ae=e.advancedFilters)==null?void 0:ae.coin)&&((fe=e.advancedFilters)==null?void 0:fe.coin.length)>0||typeof((Ae=e.advancedFilters)==null?void 0:Ae.coin)=="string"&&((ce=e.advancedFilters)==null?void 0:ce.coin.trim())!==""?"1px solid #8d67ff":"none",boxShadow:"none",borderRadius:"6px",":hover":{border:Array.isArray((ye=e.advancedFilters)==null?void 0:ye.coin)&&((Ne=e.advancedFilters)==null?void 0:Ne.coin.length)>0||typeof((be=e.advancedFilters)==null?void 0:be.coin)=="string"&&((je=e.advancedFilters)==null?void 0:je.coin.trim())!==""?"1px solid #8d67ff":"none"}}},menu:V=>({...V,backgroundColor:"#353535",maxWidth:"248px"}),menuList:V=>({...V,backgroundColor:"#353535",maxHeight:"180px",zIndex:50}),clearIndicator:V=>({...V,color:"#b3b3b3",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",padding:"0px",paddingRight:"5px",":hover":{color:"white"}}),dropdownIndicator:V=>({...V,color:"#b3b3b3",cursor:"pointer",alignItems:"center",justifyContent:"center",width:"25px",height:"25px",minWidth:"25px",minHeight:"25px",padding:"0px",paddingRight:"5px",paddingLeft:"5px",display:"none",":hover":{color:"white"}}),indicatorSeparator:()=>({display:"none"}),option:(V,{data:ee,isDisabled:ae,isFocused:fe,isSelected:Ae})=>{const ce=di(ee.color);return{...V,fontSize:"14px",fontWeight:"600",backgroundColor:ae?void 0:Ae?ee.color:fe?ce.alpha(.1).css():void 0,color:"white",cursor:ae?"not-allowed":"pointer",":active":{...V[":active"],backgroundColor:ae?void 0:Ae?ee.color:ce.alpha(.9).css()}}},multiValue:(V,{data:ee})=>{const ae=di(ee.color);return{...V,backgroundColor:ae.alpha(.4).css()}},multiValueLabel:(V,{data:ee})=>({...V,color:"white"}),multiValueRemove:(V,{data:ee})=>({...V,color:"white",":hover":{backgroundColor:"rgba(255, 255, 255, 0.3)",color:"white"}}),input:V=>({...V,color:"white"}),valueContainer:V=>({...V,paddingTop:"0px",fontSize:"14px",fontWeight:"600"})},f={control:(V,{isFocused:ee})=>{var ae,fe,Ae,ce,ye,Ne,be,je;return{...V,display:"flex",alignItems:"center",paddingLeft:"21px",backgroundColor:"#353535",minHeight:"32px",maxHeight:"32px",border:Array.isArray((ae=e.advancedFilters)==null?void 0:ae.refcode)&&((fe=e.advancedFilters)==null?void 0:fe.refcode.length)>0||typeof((Ae=e.advancedFilters)==null?void 0:Ae.refcode)=="string"&&((ce=e.advancedFilters)==null?void 0:ce.refcode.trim())!==""?"1px solid #8d67ff":"none",boxShadow:"none",borderRadius:"6px",":hover":{border:Array.isArray((ye=e.advancedFilters)==null?void 0:ye.refcode)&&((Ne=e.advancedFilters)==null?void 0:Ne.refcode.length)>0||typeof((be=e.advancedFilters)==null?void 0:be.refcode)=="string"&&((je=e.advancedFilters)==null?void 0:je.refcode.trim())!==""?"1px solid #8d67ff":"none"}}},menu:V=>({...V,backgroundColor:"#353535",maxWidth:"248px"}),menuList:V=>({...V,backgroundColor:"#353535",maxHeight:"180px",zIndex:4}),clearIndicator:V=>({...V,color:"#b3b3b3",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",padding:"0px",paddingRight:"5px",":hover":{color:"white"}}),dropdownIndicator:V=>({...V,color:"#b3b3b3",cursor:"pointer",alignItems:"center",justifyContent:"center",width:"25px",height:"25px",minWidth:"25px",minHeight:"25px",padding:"0px",paddingRight:"5px",paddingLeft:"5px",display:"none",":hover":{color:"white"}}),indicatorSeparator:()=>({display:"none"}),option:(V,{data:ee,isDisabled:ae,isFocused:fe,isSelected:Ae})=>{const ce=di(ee.color);return{...V,fontSize:"14px",fontWeight:"600",backgroundColor:ae?void 0:Ae?ee.color:fe?ce.alpha(.1).css():void 0,color:"white",cursor:ae?"not-allowed":"pointer",":active":{...V[":active"],backgroundColor:ae?void 0:Ae?ee.color:ce.alpha(.9).css()}}},multiValue:(V,{data:ee})=>{const ae=di(ee.color);return{...V,backgroundColor:ae.alpha(.4).css()}},multiValueLabel:(V,{data:ee})=>({...V,color:"white"}),multiValueRemove:(V,{data:ee})=>({...V,color:"white",":hover":{backgroundColor:"rgba(255, 255, 255, 0.3)",color:"white"}}),input:V=>({...V,color:"white"}),valueContainer:V=>({...V,paddingTop:"0px",fontSize:"14px",fontWeight:"600"})},x=(V,ee)=>{var fe;const ae=(fe=ee.selectedCoins)==null?void 0:fe.filter(Ae=>Ae.value!==V.value);ee.setSelectedCoins(ae),ee.setAdvancedFilters(Ae=>({...Ae,coin:ae==null?void 0:ae.map(ye=>ye.value)}))},g=(V,ee)=>{var fe;const ae=(fe=ee.selectedReferrals)==null?void 0:fe.filter(Ae=>Ae.value!==V.value);ee.setSelectedReferrals(ae),ee.setAdvancedFilters(Ae=>({...Ae,refcode:ae==null?void 0:ae.map(ye=>ye.value)}))};m.useEffect(()=>{const V=ee=>{r.current&&!r.current.contains(ee.target)&&n(!1)};return document.addEventListener("mousedown",V),()=>{document.removeEventListener("mousedown",V)}},[]),m.useEffect(()=>{const V=ee=>{o.current&&!o.current.contains(ee.target)&&a(!1)};return document.addEventListener("mousedown",V),()=>{document.removeEventListener("mousedown",V)}},[]);const v=async()=>{e.setAdvancedFilters(V=>({...V,user_token:""}))},w=({src:V,alt:ee})=>{const[ae,fe]=Se.useState(!1);return ae?i.jsx("div",{className:"rounded-full w-5 h-5 min-w-5 min-h-5 mr-1 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}):i.jsx("img",{src:V,alt:ee,className:"rounded-full w-5 h-5 min-w-5 min-h-5 mr-1",loading:"lazy",onError:()=>fe(!0)})},C=V=>{const{data:ee,innerRef:ae,innerProps:fe,selectProps:Ae}=V,ce=Ae.styles.option({},V);return i.jsxs("div",{ref:ae,...fe,style:ce,className:"flex items-center p-2",children:[i.jsx(w,{src:ee.icon,alt:ee.label}),ee.label]})},N=(V,ee)=>ee.reduce((ae,fe)=>{const Ae=V[fe];return Ae!==void 0&&Ae!==""&&Ae!==null&&ae++,ae},0),I=()=>{const V=e.advancedFilters.is_favorite_wallet?"":!0;e.setAdvancedFilters(ee=>({...ee,is_favorite_wallet:V}))},P=["min_pnl","max_pnl","min_win_complated_rate","max_win_complated_rate","min_complated_trades_count","max_complated_trades_count","min_complated_win_count","max_complated_win_count","min_complated_loss_count","max_complated_loss_count","min_long_kar","max_long_kar","min_short_kar","max_short_kar","min_long_win_rate","max_long_win_rate","min_short_win_rate","max_short_win_rate","min_rTx_count","max_rTx_count"],R=["min_pnl","max_pnl"],F=["min_uPnl","max_uPnl","max_sharpe","min_sharpe","max_growth_rate","min_growth_rate","max_perp_dd","min_perp_dd","max_perp_dd_pnl","min_perp_dd_pnl","min_perp_equity","max_perp_equity","min_margin_roi","max_margin_roi","min_margin_used_percentage","max_margin_used_percentage","min_margin_used","max_margin_used","min_avg_uLeverage_value","max_avg_uLeverage_value","min_funding","max_funding","min_rToken_count","max_rToken_count","min_uToken_count","max_uToken_count"],U=["min_uPnl","max_uPnl","max_perp_dd_pnl","min_perp_dd_pnl","min_perp_equity","max_perp_equity","min_margin_roi","max_margin_roi","min_margin_used_percentage","max_margin_used_percentage","min_margin_used","max_margin_used","min_avg_uLeverage_value","max_avg_uLeverage_value","min_funding","max_funding","min_uToken_count","max_uToken_count"],L=["min_uPnl","max_uPnl","max_perp_dd_pnl","min_perp_dd_pnl","min_perp_equity","max_perp_equity","min_margin_roi","max_margin_roi","min_margin_used_percentage","max_margin_used_percentage","min_margin_used","max_margin_used","min_avg_uLeverage_value","max_avg_uLeverage_value","min_funding","max_funding","min_rToken_count","max_rToken_count","min_uToken_count","max_uToken_count"],z=["min_first_time","max_first_time","min_end_time","max_end_time"];return i.jsxs("div",{className:"text-white flex flex-wrap justify-start sm:justify-center font-manrope gap-4 pt-2",children:[i.jsxs("div",{className:"col-span-1 flex flex-col justify-start gap-[7px] w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Search Wallet"}),i.jsx("div",{onClick:()=>{v()},className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"flex items-center relative",children:[i.jsx("input",{value:(X=e.advancedFilters)==null?void 0:X.user_token,onChange:u,type:"text",name:"user_token",placeholder:"Search Wallet",className:`${(ne=e.advancedFilters)!=null&&ne.user_token?"border border-[#8d67ff]":""} py-[4px] bg-[#353535] rounded-md block text-white text-sm font-medium font-inter leading-[8px] w-full sm:w-full pl-[30px] pr-2 focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#7F7F7F] placeholder:font-inter placeholder:text-sm placeholder:font-medium placeholder:leading-[8px] h-[32px]`}),i.jsx(Ny,{className:"text-[#646464] absolute left-1.5"})]})]}),e.period!=999&&i.jsxs("div",{className:"col-span-1 flex flex-col gap-[7px] justify-start w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("div",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Search Coin"}),i.jsx("div",{onClick:()=>{e.setSelectedCoins([]),e.setAdvancedFilters(V=>({...V,coin:[]}))},className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear Coins"})})]}),i.jsx("div",{className:"float-left w-full",ref:r,children:i.jsxs("div",{className:"min-w-full relative",children:[i.jsx(Ny,{className:"text-[#646464] absolute left-[6px] top-[7px] z-10"}),i.jsx(Zl,{closeMenuOnSelect:!1,value:[],isMulti:!0,options:e.dataCoin.filter(V=>Array.isArray(e.selectedCoins)&&!e.selectedCoins.some(ee=>ee.value===V.value)),components:{Option:C},styles:d,onChange:l,menuIsOpen:t,onMenuOpen:()=>n(!0),placeholder:e.isLoadingCoin?i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Loading..."}):i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Search Coin"}),noOptionsMessage:()=>e.isLoadingCoin?i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Loading..."}):i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"No data available"})}),i.jsx("div",{className:`absolute top-[220px] z-[4] left-0 w-full max-w-[248px] bg-[#303030] flex flex-wrap gap-1 p-2 border border-[#3a3a3a] mt-1 ${t?"block":"hidden"} ${t&&((J=e.selectedCoins)==null?void 0:J.length)>0?"block":"hidden"}`,children:e.selectedCoins&&((Z=e.selectedCoins)==null?void 0:Z.map(V=>i.jsxs("div",{className:"h-6 pl-1 rounded-md border border-[#3a3a3a] justify-start items-center gap-0.5 flex",children:[i.jsx(w,{src:V==null?void 0:V.icon,alt:V==null?void 0:V.value}),i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] py-1 min-w-max",children:V.label}),i.jsx("div",{onClick:ee=>{ee.stopPropagation(),x(V,e)},className:"cursor-pointer group w-full h-full flex justify-center items-center pr-1.5 py-1",children:i.jsx(Jv,{className:"group-hover:text-[#cdcdcd] text-[#7C7C7C] w-[5.66px] h-[5.66px] min-w-[5.66px] min-h-[5.66px]"})})]},V.value)))}),i.jsx("div",{className:`${((re=e.selectedCoins)==null?void 0:re.length)>0?"mt-2.5":""} flex flex-wrap gap-1 max-w-[248px]`,children:e.selectedCoins&&((he=e.selectedCoins)==null?void 0:he.map(V=>i.jsxs("div",{className:"h-6 pl-1.5 rounded-md border border-[#3a3a3a] justify-start items-center gap-1.5 flex",children:[i.jsx(w,{src:V==null?void 0:V.icon,alt:V==null?void 0:V.value}),i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] py-1 min-w-max",children:V.label}),i.jsx("div",{onClick:()=>x(V,e),className:"cursor-pointer group  w-full h-full flex justify-center items-center pr-1.5 py-1",children:i.jsx(Jv,{className:"group-hover:text-[#cdcdcd] text-[#7C7C7C] w-[5.66px] h-[5.66px] min-w-[5.66px] min-h-[5.66px]"})})]},V.value)))})]})})]}),i.jsxs("div",{className:"flex justify-between items-center gap-1 w-full h-8 bg-[#353535] rounded-xl px-2.5",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1 w-max",children:[i.jsx("div",{style:{boxShadow:"0px 4px 24px 0px #FF600A, 0px 1px 1px 0px rgba(255, 255, 255, 0.32) inset"},className:"w-[18px] h-[18px] px-2 py-1.5 bg-gradient-to-b from-[#ff7200] to-[#ff2525] rounded-[5px] flex justify-center items-center",children:i.jsx("img",{src:nke,alt:"",className:"w-[9.67px] h-[12px] min-w-[9.67px] min-h-[12px]"})}),i.jsx("span",{className:"text-white text-[13px] font-semibold font-['Manrope'] leading-[8px] ml-1",children:"Show Popular Wallets"})]}),i.jsx("div",{onClick:I,style:{boxShadow:"0px 1px 1px 0px rgba(255, 255, 255, 0.32) inset"},className:`w-[17px] h-[17px] rounded-md flex items-center justify-center transition-all
      ${e.advancedFilters.is_favorite_wallet?"bg-[#3ec78c] border-[#3ec78c]":"bg-transparent border border-[#12d782]"}
      cursor-pointer
    `,children:e.advancedFilters.is_favorite_wallet&&i.jsx("svg",{className:"w-[12px] h-[12px] text-[#0c623d]",fill:"none",stroke:"currentColor",strokeWidth:"3",viewBox:"0 0 24 24",children:i.jsx("polyline",{points:"20 6 9 17 4 12"})})}),i.jsx("input",{type:"checkbox",checked:e.advancedFilters.is_favorite_wallet===!0,onChange:I,className:"hidden"})]}),i.jsxs("div",{className:"col-span-1 flex flex-col gap-[7px] justify-start w-full z-3 bg-[#353535] rounded-xl pt-3 pb-1 px-1",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("div",{style:{boxShadow:"0px 4px 24px 0px #9137FF, 0px 1px 1px 0px rgba(255, 255, 255, 0.32) inset"},className:"flex justify-center items-center w-[18px] h-[18px] px-2 py-1.5 bg-[#8b2cff] rounded-[5px] ml-[5px]",children:i.jsx("img",{src:byt,alt:"",className:"w-[16px] h-[16px] min-w-[16px] min-h-[16px]"})}),i.jsx("div",{className:"flex justify-start text-white text-[13px] font-semibold font-['Manrope'] leading-[8px] ml-[5px]",children:"Filter by Referrer"})]}),i.jsxs("div",{className:"flex flex-col gap-[7px] bg-[#1f1f1f] rounded-xl p-2.5",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx("div",{className:"text-[#c9c9c9] text-[13px] font-semibold font-['Manrope'] leading-[8px]",children:"Filter by Referrer"})}),i.jsx("div",{onClick:()=>{e.setSelectedReferrals([]),e.setAdvancedFilters(V=>({...V,refcode:[]}))},className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsx("div",{className:"float-left w-full",ref:o,children:i.jsxs("div",{className:"min-w-full relative",children:[i.jsx(Ny,{className:`${t?"-z-10":"z-10"} text-[#646464] absolute left-[6px] top-[7px]`}),i.jsx(Zl,{closeMenuOnSelect:!1,value:[],isMulti:!0,options:e.dataReferral.filter(V=>Array.isArray(e.selectedReferrals)&&!e.selectedReferrals.some(ee=>ee.value===V.value)),styles:f,onChange:c,menuIsOpen:s,onMenuOpen:()=>a(!0),placeholder:e.isLoadingReferral?i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Loading..."}):i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Search Referrer"}),noOptionsMessage:()=>e.isLoadingReferral?i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Loading..."}):i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"No data available"})}),i.jsx("div",{className:`absolute top-[220px] z-[4] left-0 w-full max-w-[248px] bg-[#303030] flex flex-wrap gap-1 p-2 border border-[#3a3a3a] mt-1 ${s?"block":"hidden"} ${s&&((Y=e.selectedReferrals)==null?void 0:Y.length)>0?"block":"hidden"}`,children:e.selectedReferrals&&((ie=e.selectedReferrals)==null?void 0:ie.map(V=>i.jsxs("div",{className:"h-6 pl-1 rounded-md border border-[#3a3a3a] justify-start items-center gap-0.5 flex",children:[i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] py-1 min-w-max",children:V.label}),i.jsx("div",{onClick:ee=>{ee.stopPropagation(),g(V,e)},className:"cursor-pointer group w-full h-full flex justify-center items-center pr-1.5 py-1",children:i.jsx(Jv,{className:"group-hover:text-[#cdcdcd] text-[#7C7C7C] w-[5.66px] h-[5.66px] min-w-[5.66px] min-h-[5.66px]"})})]},V.value)))}),i.jsx("div",{className:`${((oe=e.selectedReferrals)==null?void 0:oe.length)>0?"mt-2.5":""} flex flex-wrap gap-1 max-w-[248px]`,children:e.selectedReferrals&&((G=e.selectedReferrals)==null?void 0:G.map(V=>i.jsxs("div",{className:"h-6 pl-1.5 rounded-md border border-[#3a3a3a] justify-start items-center gap-1.5 flex",children:[i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] py-1 min-w-max",children:V.label}),i.jsx("div",{onClick:()=>g(V,e),className:"cursor-pointer group  w-full h-full flex justify-center items-center pr-1.5 py-1",children:i.jsx(Jv,{className:"group-hover:text-[#cdcdcd] text-[#7C7C7C] w-[5.66px] h-[5.66px] min-w-[5.66px] min-h-[5.66px]"})})]},V.value)))})]})})]})]}),i.jsxs(OY,{title:"Wallet Filters",titleInfo:N(e.advancedFilters,e.period!=999?P:R),icon:i.jsx(xrn,{className:"text-white"}),children:[i.jsx(El,{minFilterType:e.advancedFilters.min_pnl,maxFilterType:e.advancedFilters.max_pnl,handleChange:u,minInputName:"min_pnl",maxInputName:"max_pnl",name:"PnL",isTooltip:!1}),e.period!=999&&i.jsx(El,{minFilterType:e.advancedFilters.min_win_complated_rate,maxFilterType:e.advancedFilters.max_win_complated_rate,handleChange:u,minInputName:"min_win_complated_rate",maxInputName:"max_win_complated_rate",name:"Win Rate",isTooltip:!1}),e.period!=999&&i.jsx(El,{minFilterType:e.advancedFilters.min_complated_trades_count,maxFilterType:e.advancedFilters.max_complated_trades_count,handleChange:u,minInputName:"min_complated_trades_count",maxInputName:"max_complated_trades_count",name:"Trades Count",isTooltip:!1}),e.period!=999&&i.jsx(El,{minFilterType:e.advancedFilters.min_complated_win_count,maxFilterType:e.advancedFilters.max_complated_win_count,handleChange:u,minInputName:"min_complated_win_count",maxInputName:"max_complated_win_count",name:"Win Count",isTooltip:!1}),e.period!=999&&i.jsx(El,{minFilterType:e.advancedFilters.min_complated_loss_count,maxFilterType:e.advancedFilters.max_complated_loss_count,handleChange:u,minInputName:"min_complated_loss_count",maxInputName:"max_complated_loss_count",name:"Loss Count",isTooltip:!1}),e.period!=999&&i.jsx(El,{minFilterType:e.advancedFilters.min_long_kar,maxFilterType:e.advancedFilters.max_long_kar,handleChange:u,minInputName:"min_long_kar",maxInputName:"max_long_kar",name:"Long PnL",isTooltip:!1}),e.period!=999&&i.jsx(El,{minFilterType:e.advancedFilters.min_short_kar,maxFilterType:e.advancedFilters.max_short_kar,handleChange:u,minInputName:"min_short_kar",maxInputName:"max_short_kar",name:"Short PnL",isTooltip:!1}),e.period!=999&&i.jsx(El,{minFilterType:e.advancedFilters.min_rTx_count,maxFilterType:e.advancedFilters.max_rTx_count,handleChange:u,minInputName:"min_rTx_count",maxInputName:"max_rTx_count",name:"Tx Count",isTooltip:!1})]}),i.jsxs(OY,{title:"Performance Filters",titleInfo:N(e.advancedFilters,e.period==999?U:e.period==1?L:F),icon:i.jsx(grn,{}),children:[i.jsx(El,{minFilterType:e.advancedFilters.min_uPnl,maxFilterType:e.advancedFilters.max_uPnl,handleChange:u,minInputName:"min_uPnl",maxInputName:"max_uPnl",name:"uPnL",isTooltip:!1}),e.period!=1&&e.period!=999&&i.jsx(El,{minFilterType:e.advancedFilters.min_growth_rate,maxFilterType:e.advancedFilters.max_growth_rate,handleChange:u,minInputName:"min_growth_rate",maxInputName:"max_growth_rate",name:"Growth Rate",isTooltip:!1}),e.period!=1&&e.period!=999&&i.jsx(El,{minFilterType:e.advancedFilters.min_perp_dd,maxFilterType:e.advancedFilters.max_perp_dd,handleChange:u,minInputName:"min_perp_dd",maxInputName:"max_perp_dd",name:"Drawdown",isTooltip:!1}),e.period!=1&&e.period!=999&&i.jsx(El,{minFilterType:e.advancedFilters.min_sharpe,maxFilterType:e.advancedFilters.max_sharpe,handleChange:u,minInputName:"min_sharpe",maxInputName:"max_sharpe",name:"Sharpe",isTooltip:!1}),i.jsx(El,{minFilterType:e.advancedFilters.min_perp_equity,maxFilterType:e.advancedFilters.max_perp_equity,handleChange:u,minInputName:"min_perp_equity",maxInputName:"max_perp_equity",name:"Perp Equity",isTooltip:!1}),i.jsx(El,{minFilterType:e.advancedFilters.min_margin_roi,maxFilterType:e.advancedFilters.max_margin_roi,handleChange:u,minInputName:"min_margin_roi",maxInputName:"max_margin_roi",name:"ROE",isTooltip:!1}),i.jsx(El,{minFilterType:e.advancedFilters.min_margin_used_percentage,maxFilterType:e.advancedFilters.max_margin_used_percentage,handleChange:u,minInputName:"min_margin_used_percentage",maxInputName:"max_margin_used_percentage",name:"Margin %",isTooltip:!1}),i.jsx(El,{minFilterType:e.advancedFilters.min_margin_used,maxFilterType:e.advancedFilters.max_margin_used,handleChange:u,minInputName:"min_margin_used",maxInputName:"max_margin_used",name:"Margin Used",isTooltip:!1}),i.jsx(El,{minFilterType:e.advancedFilters.min_avg_uLeverage_value,maxFilterType:e.advancedFilters.max_avg_uLeverage_value,handleChange:u,minInputName:"min_avg_uLeverage_value",maxInputName:"max_avg_uLeverage_value",name:"Avg. Lvg.",isTooltip:!1}),i.jsx(El,{minFilterType:e.advancedFilters.min_funding,maxFilterType:e.advancedFilters.max_funding,handleChange:u,minInputName:"min_funding",maxInputName:"max_funding",name:"Funding",isTooltip:!1}),e.period!=999&&i.jsx(El,{minFilterType:e.advancedFilters.min_rToken_count,maxFilterType:e.advancedFilters.max_rToken_count,handleChange:u,minInputName:"min_rToken_count",maxInputName:"max_rToken_count",name:"rToken",isTooltip:!1}),i.jsx(El,{minFilterType:e.advancedFilters.min_uToken_count,maxFilterType:e.advancedFilters.max_uToken_count,handleChange:u,minInputName:"min_uToken_count",maxInputName:"max_uToken_count",name:"uToken",isTooltip:!1})]}),e.period!=999&&i.jsxs(OY,{title:"Date Filters",titleInfo:N(e.advancedFilters,z),icon:i.jsx(brn,{}),children:[i.jsx(q6e,{minFilterType:e.advancedFilters.min_first_time,maxFilterType:e.advancedFilters.max_first_time,advancedFilters:e.advancedFilters,setAdvancedFilters:e.setAdvancedFilters,minInputName:"min_first_time",maxInputName:"max_first_time",name:"First Tx Time",minValue:e.minFirstValue,maxValue:e.maxFirstValue,setMinValue:e.setMinFirstValue,setMaxValue:e.setMaxFirstValue,setFilters:e.setFilters}),i.jsx(q6e,{minFilterType:e.advancedFilters.min_end_time,maxFilterType:e.advancedFilters.max_end_time,advancedFilters:e.advancedFilters,setAdvancedFilters:e.setAdvancedFilters,minInputName:"min_end_time",maxInputName:"max_end_time",name:"Last Tx Time",minValue:e.minEndValue,maxValue:e.maxEndValue,setMinValue:e.setMinEndValue,setMaxValue:e.setMaxEndValue,setFilters:e.setFilters})]})]})}const vrn=({period:e,advancedFilters:t,setAdvancedFilters:n,resetFilters:r,setFilters:s,minFirstValue:a,setMinFirstValue:o,maxFirstValue:l,setMaxFirstValue:c,minEndValue:u,setMinEndValue:d,maxEndValue:f,setMaxEndValue:x,dataCoin:g,selectedCoins:v,setSelectedCoins:w,isLoadingCoin:C,setIsLoadingCoin:N,dataReferral:I,selectedReferrals:P,setSelectedReferrals:R,isLoadingReferral:F,setIsLoadingReferral:U})=>{const[L,z]=m.useState(!1);return m.useEffect(()=>{localStorage.getItem("fire_ref_modal_seen")||z(!0)},[]),i.jsx(i.Fragment,{children:i.jsxs("div",{className:"bg-[#232323] rounded-2xl min-h-[340px] sm:max-h-full lg:min-h-[66vh] order-last lg:order-none lg:w-min min-w-[286px] lg:max-w-[286px] p-1 py-3 font-manrope overflow-hidden relative h-[calc(100vh-150px)] sm:h-[calc(100vh-125px)]",children:[i.jsxs("div",{className:"w-full flex justify-between items-center pt-[2px] pl-3 pr-1 pb-[10px]",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[8px]",children:"Filters"}),i.jsx("div",{className:"flex sm:hidden justify-center",children:i.jsx("div",{onClick:()=>s(),className:"w-[134px] h-6 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] pointer-events-none",children:"Search"})})}),i.jsx("div",{onClick:()=>{r()},className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex mr-3 cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("div",{className:"h-full w-full overflow-y-scroll font-manrope py-1 px-3",children:i.jsx("div",{className:"font-manrope font-normal pb-[120px] sm:pb-[80px] max-w-full lg:max-w-[256px]",children:i.jsx(yrn,{period:e,resetFilters:r,setFilters:s,advancedFilters:t,setAdvancedFilters:n,minFirstValue:a,setMinFirstValue:o,maxFirstValue:l,setMaxFirstValue:c,minEndValue:u,setMinEndValue:d,maxEndValue:f,setMaxEndValue:x,dataCoin:g,selectedCoins:v,setSelectedCoins:w,isLoadingCoin:C,setIsLoadingCoin:N,dataReferral:I,selectedReferrals:P,setSelectedReferrals:R,isLoadingReferral:F,setIsLoadingReferral:U})})}),i.jsx("div",{className:"hidden sm:block absolute bottom-0 w-full",children:i.jsx("div",{className:"sticky h-12 bg-[#1b1b1b]/30 rounded-bl-2xl rounded-br-2xl border-t border-[#353535] backdrop-blur-[32px] min-h-14 pt-[11px] w-full z-10",children:i.jsx("div",{className:"flex justify-center -ml-3",children:i.jsx("div",{onClick:()=>s(),className:"w-[234px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] pointer-events-none",children:"Search"})})})})})]})})},CUe=()=>i.jsxs("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:[i.jsx("div",{className:"p-4 bg-#FFA756 bg-opacity-20 rounded-full",children:i.jsx("img",{src:$bt,alt:"",className:"w-8 h-8"})}),i.jsxs("div",{className:"flex flex-col items-center justify-center gap-1",children:[i.jsx("div",{className:"text-#FFA756",children:"No Data"}),i.jsxs("div",{className:"text-#767676",children:["There isn't any data"," ",i.jsxs("span",{children:["for this",i.jsx("br",{})," time range at the moment"]})]})]})]}),G6e=({content:e,positionTop:t,alignRight:n,type:r})=>{const s=e?r==="coin"?e.split(", ").map(a=>{const[o,l]=a.split(" (");return{name:o,value:l==null?void 0:l.replace(")","")}}):r==="position"?e==null?void 0:e.map(a=>({name:a.coin,value:a.unrealized_pnl})):[]:[];return i.jsx("span",{className:`tooltip ${n?"left-5 top-1/2 -translate-y-1/2 ":t?"-top-6 translate-x-[10%] -left-[20%]":"-top-6 translate-x-[10%] right-[20%] mr-9"} transform text-white font-manrope font-semibold text-xs leading-3 whitespace-nowrap mt-1`,children:i.jsxs("div",{className:`${t?"ml-6":"mr-6"}  border border-[#404040] bg-[#222222] p-2 rounded-sm relative`,children:[i.jsx("div",{className:"overflow-y-auto scroll-design-search-scroll w-max min-h-[31px] h-max max-h-[160px]",children:i.jsx("ul",{style:{margin:0,padding:0,listStyle:"none"},children:(s==null?void 0:s.length)>0?s==null?void 0:s.map((a,o)=>i.jsxs("li",{className:`${o===(s==null?void 0:s.length)-1?"mb-0":"mb-[5px]"} flex justify-between pl-1 pr-2 h-max p-2  rounded border  border-[#7d7c7c]`,children:[i.jsx("span",{className:`${(a==null?void 0:a.value)==null||isNaN(parseFloat(a==null?void 0:a.value))||(a==null?void 0:a.value)==0?"text-white":(a==null?void 0:a.value)>0?"text-[#1DE6A3]":"text-[#FF7173]"} flex justify-start items-center gap-1 min-w-20 border-r border-white`,children:a==null?void 0:a.name}),i.jsx("span",{className:`${(a==null?void 0:a.value)==null||isNaN(parseFloat(a==null?void 0:a.value))||(a==null?void 0:a.value)==0?"text-white":(a==null?void 0:a.value)>0?"text-[#1DE6A3]":"text-[#FF7173]"} pl-4`,children:`${(a==null?void 0:a.value)==null||isNaN(parseFloat(a==null?void 0:a.value))?"-":_s(Math.abs(a==null?void 0:a.value))}`})]},o)):i.jsx("span",{children:"No data available"})})}),i.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:`absolute transform -z-1 ${n?"-rotate-90 left-1 -translate-x-full -translate-y-1/2 top-1/2 ":t?"-left-2 top-[15%] -rotate-90 -translate-y-1/2":"-right-2 top-[15%] rotate-90 -translate-y-1/2"}`,children:i.jsx("path",{d:"M3.70096 1.25C4.27831 0.25 5.72169 0.25 6.29904 1.25L8.89711 5.75C9.47446 6.75 8.75278 8 7.59808 8H2.40192C1.24722 8 0.525536 6.75 1.10289 5.75L3.70096 1.25Z",fill:"#404040",stroke:"#404040"})})]})})},kce=({periods:e,selectedPeriod:t,handlePeriod:n,borderColor:r})=>i.jsx(i.Fragment,{children:e?i.jsx("div",{className:`${r=="ticker"?"border-[#333333]":"border-[#232323]"} flex items-center justify-center w-max h-[28px] rounded-lg border  font-manrope p-[3px] `,children:e.map((s,a)=>i.jsx("button",{onClick:o=>n(o.target.dataset.value),"data-value":s.value,className:`${s.value===t?"bg-[#3d3d3d] text-white":"bg-transparent text-[#9b9b9b]"} flex justify-center items-center uppercase font-manrope focus:outline-none focus:ring-0 border-none rounded-md text-xs font-bold leading-[8px] tracking-wide h-5 w-[35.5px] sm:w-[48px]`,children:s.name},a))}):null});function wrn({currentPage:e,offset:t,setOffset:n,totalPage:r,totalWalletCount:s}){return i.jsxs("header",{className:"flex items-center justify-between gap-2 z-4 bg-[#161616] font-manrope",children:[i.jsxs("div",{className:"flex justify-center items-center gap-1",children:[i.jsx(vi,{className:"text-white hidden sm:block"}),i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("span",{className:"text-white text-[12px] font-semibold font-manrope leading-[14px]",children:s}),i.jsx("span",{className:"text-[#7e7e7e] text-[12px] font-semibold font-manrope leading-[14px]",children:"wallets found"})]})]}),i.jsxs("div",{className:"flex items-center justify-start gap-[4px]",children:[i.jsx("button",{onClick:e===1?()=>{}:()=>n(t===0?0:t-50),type:"button",className:e===1?"relative inline-flex items-center p-1.5 text-sm font-medium text-white/20 rounded-md focus:ring-0 focus:outline-none border-none cursor-not-allowed bg-[#3d3d3d] w-6 h-6":"relative inline-flex items-center p-1.5 rounded-md bg-[#3d3d3d] text-sm font-medium text-white hover:bg-white/40 focus:outline-none focus:ring-0 border-none focus:z-10",children:i.jsx(zh,{className:`${e===1?"text-white/30":"text-white"} w-3 h-3 rotate-90`})}),i.jsxs("div",{type:"button",className:"-ml-px relative inline-flex items-center px-2 py-2 bg-[#3d3d3d]/60 text-sm font-medium text-white  focus:z-10 focus:outline-none focus:ring-0 outline-none min-w-max h-6 max-h-6 rounded-md",children:[e," / ",r]}),i.jsx("button",{onClick:e===r||r===0?()=>{}:()=>n(t+50),type:"button",className:e===r?"bg-[#3d3d3d] w-6 h-6 cursor-not-allowed relative inline-flex items-center p-1.5 rounded-md text-sm font-medium text-black focus:z-10 focus:outline-none focus:ring-0 border-none":"relative inline-flex items-center p-1.5 rounded-md bg-[#3d3d3d] w-6 h-6 text-sm font-medium text-white hover:bg-white/40 focus:z-10 focus:outline-none focus:ring-0 border-none",children:i.jsx(zh,{className:`${e===r?"text-white/30":"text-white"} w-3 h-3 -rotate-90`})})]})]})}const Crn=({info1:e,info2:t,padding:n,icon:r,info1_Color:s,info2_Color:a,rowTwo:o,info3:l})=>i.jsxs("div",{className:`${n||"pl-1 pr-2"} flex flex-col gap-2 font-manrope`,children:[t&&i.jsx("div",{className:`${a} text-xs font-normal not-italic font-inter flex items-center justify-end leading-3 min-w-max text-white`,children:t}),i.jsxs("div",{className:`${s} ${o?"-mt-3.5":""} text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px]`,children:[i.jsx("img",{src:r,alt:"",className:""}),l?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-[#1DE6A3]",children:e})," /"," ",i.jsx("span",{className:"text-[#FF7173]",children:l})]}):e]})]});function Srn({open:e,setOpen:t}){return i.jsxs(ga,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Oa})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Hi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-4",children:[i.jsx("div",{className:"text-center text-white text-[32px] font-manrope font-semibold leading-loose",children:"Coming Soon"}),i.jsx("div",{className:"w-[300px] text-center text-white/60 text-sm font-medium font-manrope leading-[18px] tracking-[0.28px] pt-4 pb-8 px-5",children:"Join Dextrabot on Discord for the latest features and announcements!"}),i.jsx("div",{onClick:()=>{window.open("https://discord.gg/dextrabot","_blank"),t(!1)},className:"flex justify-center items-center w-[348px] h-12 bg-[#7446FF] rounded-2xl mt-2 cursor-pointer",children:i.jsx("div",{className:"text-center text-white text-sm font-semibold font-manrope leading-[0.28px] tracking-tight",children:"Join Dextrabot on Discord"})})]})]})})})})})]})}function Nrn(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),s=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(s),t&&(r.href=t),s.href=e,s.href}const Arn=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function jy(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let nC=null;function SUe(e={}){return nC||(e.includeStyleProperties?(nC=e.includeStyleProperties,nC):(nC=jy(window.getComputedStyle(document.documentElement)),nC))}function UL(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function jrn(e){const t=UL(e,"border-left-width"),n=UL(e,"border-right-width");return e.clientWidth+t+n}function Ern(e){const t=UL(e,"border-top-width"),n=UL(e,"border-bottom-width");return e.clientHeight+t+n}function NUe(e,t={}){const n=t.width||jrn(e),r=t.height||Ern(e);return{width:n,height:r}}function _rn(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const bf=16384;function krn(e){(e.width>bf||e.height>bf)&&(e.width>bf&&e.height>bf?e.width>e.height?(e.height*=bf/e.width,e.width=bf):(e.width*=bf/e.height,e.height=bf):e.width>bf?(e.height*=bf/e.width,e.width=bf):(e.width*=bf/e.height,e.height=bf))}function zL(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function Trn(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Irn(e,t,n){const r="http://www.w3.org/2000/svg",s=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return s.setAttribute("width",`${t}`),s.setAttribute("height",`${n}`),s.setAttribute("viewBox",`0 0 ${t} ${n}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),s.appendChild(a),a.appendChild(e),Trn(s)}const Zd=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Zd(n,t)};function Prn(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Frn(e,t){return SUe(t).map(n=>{const r=e.getPropertyValue(n),s=e.getPropertyPriority(n);return`${n}: ${r}${s?" !important":""};`}).join(" ")}function Orn(e,t,n,r){const s=`.${e}:${t}`,a=n.cssText?Prn(n):Frn(n,r);return document.createTextNode(`${s}{${a}}`)}function K6e(e,t,n,r){const s=window.getComputedStyle(e,n),a=s.getPropertyValue("content");if(a===""||a==="none")return;const o=Arn();try{t.className=`${t.className} ${o}`}catch{return}const l=document.createElement("style");l.appendChild(Orn(o,n,s,r)),t.appendChild(l)}function Mrn(e,t,n){K6e(e,t,":before",n),K6e(e,t,":after",n)}const Y6e="application/font-woff",X6e="image/jpeg",Rrn={woff:Y6e,woff2:Y6e,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:X6e,jpeg:X6e,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Lrn(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Tce(e){const t=Lrn(e).toLowerCase();return Rrn[t]||""}function Drn(e){return e.split(/,/)[1]}function Ane(e){return e.search(/^(data:)/)!==-1}function Brn(e,t){return`data:${t};base64,${e}`}async function AUe(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const s=await r.blob();return new Promise((a,o)=>{const l=new FileReader;l.onerror=o,l.onloadend=()=>{try{a(n({res:r,result:l.result}))}catch(c){o(c)}},l.readAsDataURL(s)})}const MY={};function $rn(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function Ice(e,t,n){const r=$rn(e,t,n.includeQueryParams);if(MY[r]!=null)return MY[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let s;try{const a=await AUe(e,n.fetchRequestInit,({res:o,result:l})=>(t||(t=o.headers.get("Content-Type")||""),Drn(l)));s=Brn(a,t)}catch(a){s=n.imagePlaceholder||"";let o=`Failed to fetch resource: ${e}`;a&&(o=typeof a=="string"?a:a.message),o&&console.warn(o)}return MY[r]=s,s}async function Urn(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):zL(t)}async function zrn(e,t){if(e.currentSrc){const a=document.createElement("canvas"),o=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,o==null||o.drawImage(e,0,0,a.width,a.height);const l=a.toDataURL();return zL(l)}const n=e.poster,r=Tce(n),s=await Ice(n,r,t);return zL(s)}async function Hrn(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await uU(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Vrn(e,t){return Zd(e,HTMLCanvasElement)?Urn(e):Zd(e,HTMLVideoElement)?zrn(e,t):Zd(e,HTMLIFrameElement)?Hrn(e,t):e.cloneNode(jUe(e))}const Wrn=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",jUe=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function qrn(e,t,n){var r,s;if(jUe(t))return t;let a=[];return Wrn(e)&&e.assignedNodes?a=jy(e.assignedNodes()):Zd(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?a=jy(e.contentDocument.body.childNodes):a=jy(((s=e.shadowRoot)!==null&&s!==void 0?s:e).childNodes),a.length===0||Zd(e,HTMLVideoElement)||await a.reduce((o,l)=>o.then(()=>uU(l,n)).then(c=>{c&&t.appendChild(c)}),Promise.resolve()),t}function Grn(e,t,n){const r=t.style;if(!r)return;const s=window.getComputedStyle(e);s.cssText?(r.cssText=s.cssText,r.transformOrigin=s.transformOrigin):SUe(n).forEach(a=>{let o=s.getPropertyValue(a);a==="font-size"&&o.endsWith("px")&&(o=`${Math.floor(parseFloat(o.substring(0,o.length-2)))-.1}px`),Zd(e,HTMLIFrameElement)&&a==="display"&&o==="inline"&&(o="block"),a==="d"&&t.getAttribute("d")&&(o=`path(${t.getAttribute("d")})`),r.setProperty(a,o,s.getPropertyPriority(a))})}function Krn(e,t){Zd(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Zd(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Yrn(e,t){if(Zd(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(s=>e.value===s.getAttribute("value"));r&&r.setAttribute("selected","")}}function Xrn(e,t,n){return Zd(t,Element)&&(Grn(e,t,n),Mrn(e,t,n),Krn(e,t),Yrn(e,t)),t}async function Qrn(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let a=0;a<n.length;a++){const l=n[a].getAttribute("xlink:href");if(l){const c=e.querySelector(l),u=document.querySelector(l);!c&&u&&!r[l]&&(r[l]=await uU(u,t,!0))}}const s=Object.values(r);if(s.length){const a="http://www.w3.org/1999/xhtml",o=document.createElementNS(a,"svg");o.setAttribute("xmlns",a),o.style.position="absolute",o.style.width="0",o.style.height="0",o.style.overflow="hidden",o.style.display="none";const l=document.createElementNS(a,"defs");o.appendChild(l);for(let c=0;c<s.length;c++)l.appendChild(s[c]);e.appendChild(o)}return e}async function uU(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>Vrn(r,t)).then(r=>qrn(e,r,t)).then(r=>Xrn(e,r,t)).then(r=>Qrn(r,t))}const EUe=/url\((['"]?)([^'"]+?)\1\)/g,Zrn=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Jrn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function esn(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function tsn(e){const t=[];return e.replace(EUe,(n,r,s)=>(t.push(s),n)),t.filter(n=>!Ane(n))}async function nsn(e,t,n,r,s){try{const a=n?Nrn(t,n):t,o=Tce(t);let l;return s||(l=await Ice(a,o,r)),e.replace(esn(t),`$1${l}$3`)}catch{}return e}function rsn(e,{preferredFontFormat:t}){return t?e.replace(Jrn,n=>{for(;;){const[r,,s]=Zrn.exec(n)||[];if(!s)return"";if(s===t)return`src: ${r};`}}):e}function _Ue(e){return e.search(EUe)!==-1}async function kUe(e,t,n){if(!_Ue(e))return e;const r=rsn(e,n);return tsn(r).reduce((a,o)=>a.then(l=>nsn(l,o,t,n)),Promise.resolve(r))}async function rC(e,t,n){var r;const s=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(s){const a=await kUe(s,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function ssn(e,t){await rC("background",e,t)||await rC("background-image",e,t),await rC("mask",e,t)||await rC("-webkit-mask",e,t)||await rC("mask-image",e,t)||await rC("-webkit-mask-image",e,t)}async function isn(e,t){const n=Zd(e,HTMLImageElement);if(!(n&&!Ane(e.src))&&!(Zd(e,SVGImageElement)&&!Ane(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,s=await Ice(r,Tce(r),t);await new Promise((a,o)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...c)=>{try{a(t.onImageErrorHandler(...c))}catch(u){o(u)}}:o;const l=e;l.decode&&(l.decode=a),l.loading==="lazy"&&(l.loading="eager"),n?(e.srcset="",e.src=s):e.href.baseVal=s})}async function asn(e,t){const r=jy(e.childNodes).map(s=>TUe(s,t));await Promise.all(r).then(()=>e)}async function TUe(e,t){Zd(e,Element)&&(await ssn(e,t),await isn(e,t),await asn(e,t))}function osn(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(s=>{n[s]=r[s]}),e}const Q6e={};async function Z6e(e){let t=Q6e[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},Q6e[e]=t,t}async function J6e(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,a=(n.match(/url\([^)]+\)/g)||[]).map(async o=>{let l=o.replace(r,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),AUe(l,t.fetchRequestInit,({result:c})=>(n=n.replace(o,`url(${c})`),[o,c]))});return Promise.all(a).then(()=>n)}function eCe(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const s=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const c=s.exec(r);if(c===null)break;t.push(c[0])}r=r.replace(s,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(o,"gi");for(;;){let c=a.exec(r);if(c===null){if(c=l.exec(r),c===null)break;a.lastIndex=l.lastIndex}else l.lastIndex=a.lastIndex;t.push(c[0])}return t}async function lsn(e,t){const n=[],r=[];return e.forEach(s=>{if("cssRules"in s)try{jy(s.cssRules||[]).forEach((a,o)=>{if(a.type===CSSRule.IMPORT_RULE){let l=o+1;const c=a.href,u=Z6e(c).then(d=>J6e(d,t)).then(d=>eCe(d).forEach(f=>{try{s.insertRule(f,f.startsWith("@import")?l+=1:s.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:f,error:x})}})).catch(d=>{console.error("Error loading remote css",d.toString())});r.push(u)}})}catch(a){const o=e.find(l=>l.href==null)||document.styleSheets[0];s.href!=null&&r.push(Z6e(s.href).then(l=>J6e(l,t)).then(l=>eCe(l).forEach(c=>{o.insertRule(c,o.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",a)}}),Promise.all(r).then(()=>(e.forEach(s=>{if("cssRules"in s)try{jy(s.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${s.href}`,a)}}),n))}function csn(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>_Ue(t.style.getPropertyValue("src")))}async function usn(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=jy(e.ownerDocument.styleSheets),r=await lsn(n,t);return csn(r)}function IUe(e){return e.trim().replace(/["']/g,"")}function dsn(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(a=>{t.add(IUe(a))}),Array.from(r.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function fsn(e,t){const n=await usn(e,t),r=dsn(e);return(await Promise.all(n.filter(a=>r.has(IUe(a.style.fontFamily))).map(a=>{const o=a.parentStyleSheet?a.parentStyleSheet.href:null;return kUe(a.cssText,o,t)}))).join(`
`)}async function hsn(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await fsn(e,t);if(n){const r=document.createElement("style"),s=document.createTextNode(n);r.appendChild(s),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function psn(e,t={}){const{width:n,height:r}=NUe(e,t),s=await uU(e,t,!0);return await hsn(s,t),await TUe(s,t),osn(s,t),await Irn(s,n,r)}async function msn(e,t={}){const{width:n,height:r}=NUe(e,t),s=await psn(e,t),a=await zL(s),o=document.createElement("canvas"),l=o.getContext("2d"),c=t.pixelRatio||_rn(),u=t.canvasWidth||n,d=t.canvasHeight||r;return o.width=u*c,o.height=d*c,t.skipAutoScale||krn(o),o.style.width=`${u}`,o.style.height=`${d}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,o.width,o.height)),l.drawImage(a,0,0,o.width,o.height),o}async function j1(e,t={}){return(await msn(e,t)).toDataURL()}function xsn({open:e,setOpen:t,data:n,setTradeInfo:r,period:s}){const a=m.useRef(null),o=async()=>{if(a.current)try{await document.fonts.ready,await new Promise(u=>setTimeout(u,500));const l=await j1(a.current,{cacheBust:!0,backgroundColor:null,useCORS:!0,style:{transform:"scale(1)",transformOrigin:"top left"}}),c=document.createElement("a");c.href=l,c.download="dextrabot.png",document.body.appendChild(c),c.click(),document.body.removeChild(c),on.success("PNG successfully downloaded!")}catch(l){console.error("Error generating PNG:",l),on.error("Failed to download PNG.")}};return i.jsxs(ga,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 scale-75",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-max relative bg-[#1b1b1b] rounded-2xl",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),setTimeout(()=>{r(l=>({...l,pnl:0,winRate:0,tradeCount:0,longWinRate:0,shortWinRate:0,leverage:0,roe:0,unrealizedPnL:0}))},300)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Oa})})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4 w-full",children:[i.jsx("div",{className:"flex justify-start items-center w-full pt-6 pl-6 text-white text-base font-semibold font-manrope leading-[8px]",children:"Share PnL"}),i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 px-2 pb-2.5",children:[i.jsx("div",{ref:a,style:{overflow:"visible",position:"relative"},className:"w-[838px] h-[608px] rounded-2xl border border-dashed border-[#353535] justify-center items-center inline-flex overflow-hidden",children:i.jsxs("div",{className:"w-[830px] h-[600px] rounded-xl flex justify-start items-center bg-[#0F1211]",children:[i.jsx("div",{className:"flex justify-start items-center w-[482px] max-h-[600px] bg-[#0F1211] rounded-xl share-pnl-background",children:i.jsxs("div",{className:"flex flex-col items-start gap-4 px-[42px] py-[40px] h-full w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-4 relative",children:[i.jsx("img",{src:jA,alt:"",className:"w-12 h-12 max-w-12 min-h-12"}),i.jsx("p",{className:"flex justify-center items-center text-white text-2xl font-semibold font-manrope",children:"Dextrabot - Copy Trade"})]}),i.jsxs("div",{className:`${s==999?"mt-20":"mt-[44px]"} flex flex-col items-start justify-start gap-2 `,children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"PnL"}),i.jsx("div",{className:`${(n==null?void 0:n.pnl)>=0?"text-[#67ffbd]":"text-[#ff6767]"} text-[66px] font-semibold font-manrope leading-[52px] inline-flex justify-center items-center min-w-max`,children:(n==null?void 0:n.pnl)==null||isNaN(parseFloat(n==null?void 0:n.pnl))?"--":`$${_s(Math.abs(n==null?void 0:n.pnl))}`})]}),i.jsxs("div",{className:`${s==999?"hidden":""} flex justify-start items-start gap-[65px] pt-[26px]`,children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max min-w-[140px]",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"WIN RATE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:`${(n==null?void 0:n.winRate)==null||isNaN(parseFloat(n==null?void 0:n.winRate))?"--":(n==null?void 0:n.winRate)+"%"}`})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"TX COUNT"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:`${(n==null?void 0:n.tradeCount)==null||isNaN(parseFloat(n==null?void 0:n.tradeCount))?"--":_s(n==null?void 0:n.tradeCount)}`})]})]}),i.jsxs("div",{className:`${s==999?"hidden":""} flex justify-start items-start gap-[65px] pt-[8px]`,children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"LONG WIN RATE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:`${(n==null?void 0:n.longWinRate)==null||isNaN(parseFloat(n==null?void 0:n.longWinRate))?"--":(n==null?void 0:n.longWinRate)+"%"}`})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"SHORT WIN RATE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:`${(n==null?void 0:n.shortWinRate)==null||isNaN(parseFloat(n==null?void 0:n.shortWinRate))?"--":(n==null?void 0:n.shortWinRate)+"%"}`})]})]}),(n==null?void 0:n.referral)&&i.jsx("div",{className:`${s==999?"pt-[150px]":"pt-[26px]"} flex justify-start items-start gap-[65px]`,children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope leading-loose tracking-wider flex",children:"REFERRAL"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]})}),i.jsx("div",{className:`${n!=null&&n.referral?"pt-[1px]":s==999?"pt-[240px]":"pt-[82px]"} flex justify-start items-start `,children:i.jsx("div",{className:"text-[#828483] text-lg font-medium font-manrope leading-loose tracking-wide",children:n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"})})]})}),i.jsx("div",{className:"flex justify-center items-center h-[600px] max-h-[600px] bg-[#0F1211] rounded-tr-xl rounded-br-xl max-w-[378px] overflow-hidden",children:(n==null?void 0:n.pnl)>=0?i.jsx("img",{src:NA,alt:"",className:"h-full"}):i.jsx("img",{src:AA,alt:"",className:"h-full"})})]})}),i.jsxs("div",{className:"flex flex-col items-start justify-between gap-4 w-[400px] h-[600px] bg-[#232323] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start w-full gap-4",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[21px]",children:"Customization"}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Referral Code"}),i.jsxs("div",{className:"flex justify-start items-center gap-2 px-2.5 w-full h-8 bg-[#1b1b1b] rounded-md border border-[#303030]",children:[i.jsx("div",{className:"text-[#7b7b7b] text-sm font-medium font-inter leading-[8px]",children:"#"}),i.jsx("div",{className:"text-white text-sm font-medium font-inter leading-[8px]",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Comment"}),i.jsx("div",{className:"flex justify-start items-center gap-2 p-2 w-full h-max bg-[#1b1b1b] rounded-lg border border-[#303030]",children:i.jsx("div",{className:"w-max text-[#909090] text-sm font-normal font-inter leading-[18px]",children:n!=null&&n.referral?i.jsxs("span",{children:["Numbers don’t lie! 🔥 Total Profit:"," ",(n==null?void 0:n.pnl)>=0?"":"-",(n==null?void 0:n.pnl)==null||isNaN(parseFloat(n==null?void 0:n.pnl))?"--":`$${_s(Math.abs(n==null?void 0:n.pnl))}`," ","🚀 Tap into the best trades with Dextrabot on Hyperliquid! Copy top traders and save 4% on fees using my referral: ",n==null?void 0:n.referral," ","@Dextrabot"," "]}):i.jsxs("span",{children:["Numbers don’t lie! 🔥 Total Profit:"," ",(n==null?void 0:n.pnl)>=0?"":"-",(n==null?void 0:n.pnl)==null||isNaN(parseFloat(n==null?void 0:n.pnl))?"--":`$${_s(Math.abs(n==null?void 0:n.pnl))}`," ","🚀 Tap into the best trades with Dextrabot on Hyperliquid! Copy top traders! @Dextrabot"]})})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2.5 w-full",children:[i.jsx("div",{onClick:l=>{l.stopPropagation(),navigator.clipboard.writeText(n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Copy URL"})}),i.jsx("div",{onClick:()=>{o()},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex has-tooltip relative cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Download PNG"})}),i.jsx("a",{href:`https://x.com/intent/post?url=${n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"}&text=Numbers%20don’t%20lie!%20🔥%20Total%20Profit:%20${(n==null?void 0:n.pnl)==null||isNaN(parseFloat(n==null?void 0:n.pnl))?"--":`${(n==null?void 0:n.pnl)>=0?"":"-"}%24${_s(Math.abs(n==null?void 0:n.pnl))}`}%20🚀%20Tap%20into%20the%20best%20trades%20with%20Dextrabot%20on%20Hyperliquid!%20Copy%20top%20traders${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`%20and%20save%204%25%20on%20fees%20using%20my%20referral:%20${n==null?void 0:n.referral}`:"!"}%20%40Dextrabot%0A`,target:"_blank",className:"w-full h-8 px-6 py-3 bg-white rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#363636] text-[13px] font-medium font-inter leading-[8px]",children:"Share on X"})})]})]})]})]})]})})})})})]})}function gsn({open:e,setOpen:t,data:n,setTradeInfo:r}){const s=m.useRef(null),a=async()=>{if(s.current)try{await document.fonts.ready,await new Promise(c=>setTimeout(c,500));const o=await j1(s.current,{cacheBust:!0,backgroundColor:null,useCORS:!0,style:{transform:"scale(1)",transformOrigin:"top left"}}),l=document.createElement("a");l.href=o,l.download="dextrabot.png",document.body.appendChild(l),l.click(),document.body.removeChild(l),on.success("PNG successfully downloaded!")}catch(o){console.error("Error generating PNG:",o),on.error("Failed to download PNG.")}};return i.jsxs(ga,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 scale-75",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-max relative bg-[#1b1b1b] rounded-2xl",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),setTimeout(()=>{r(o=>({...o,pnl:0,winRate:0,tradeCount:0,longWinRate:0,shortWinRate:0,leverage:0,roe:0,unrealizedPnL:0}))},300)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Oa})})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4 w-full",children:[i.jsx("div",{className:"flex justify-start items-center w-full pt-6 pl-6 text-white text-base font-semibold font-manrope leading-[8px]",children:"Share PnL"}),i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 px-2 pb-2.5",children:[i.jsx("div",{ref:s,style:{overflow:"visible",position:"relative"},className:"w-[858px] h-[608px] rounded-2xl border border-dashed border-[#353535] justify-center items-center inline-flex overflow-hidden",children:i.jsxs("div",{className:"w-[850px] h-[600px] rounded-xl flex justify-start items-center bg-[#0F1211]",children:[i.jsx("div",{className:"flex justify-start items-center w-[502px] max-h-[600px] bg-[#0F1211] rounded-xl share-pnl-background",children:i.jsxs("div",{className:"flex flex-col items-start gap-4 px-[42px] py-[40px] h-full w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-4 relative",children:[i.jsx("img",{src:jA,alt:"",className:"w-12 h-12 max-w-12 min-h-12"}),i.jsx("p",{className:"flex justify-center items-center text-white text-2xl font-semibold font-manrope",children:"Dextrabot - Copy Trade"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start",children:[i.jsx("div",{className:"flex justify-start items-center gap-2 relative mt-16",children:i.jsx("div",{className:"bg-[#67ffbd]/20 text-[#67ffbd] h-9 min-w-[64px] px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope tracking-wide",children:`${(n==null?void 0:n.leverage)==null||isNaN(parseFloat(n==null?void 0:n.leverage))?"--":`${parseFloat(n==null?void 0:n.leverage).toFixed(2)}x`}`})}),i.jsxs("div",{className:`${(n==null?void 0:n.roe)>=0?"text-[#67ffbd]":"text-[#ff6767]"} text-[86px] font-semibold font-manrope leading-[92px] inline-flex justify-center items-center min-w-max`,children:[(n==null?void 0:n.roe)>=0?"+":"-",`${(n==null?void 0:n.roe)==null||isNaN(parseFloat(n==null?void 0:n.roe))?"--":`${_s(Math.abs(n==null?void 0:n.roe))}%`}`]})]}),i.jsx("div",{className:"flex justify-start items-start gap-[65px] pt-[22px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max min-w-[130px]",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"UNREALIZED PNL"}),i.jsx("div",{className:`${(n==null?void 0:n.unrealizedPnL)==null||isNaN(parseFloat(n==null?void 0:n.unrealizedPnL))||(n==null?void 0:n.unrealizedPnL)==0?"text-white":(n==null?void 0:n.unrealizedPnL)>0?"text-[#1DE6A3]":"text-[#FF7173]"} text-[32px] font-semibold font-manrope leading-none flex`,children:(n==null?void 0:n.unrealizedPnL)==null||isNaN(parseFloat(n==null?void 0:n.unrealizedPnL))?"--":`$${_s(Math.abs(n==null?void 0:n.unrealizedPnL))}`})]})}),(n==null?void 0:n.referral)&&i.jsx("div",{className:"flex justify-start items-start gap-[65px] pt-[26px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope leading-loose tracking-wider flex",children:"REFERRAL"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]})}),i.jsx("div",{className:`${n!=null&&n.referral?"pt-[16px]":"pt-[112px]"} flex justify-start items-start`,children:i.jsx("div",{className:"text-[#828483] text-lg font-medium font-manrope leading-loose tracking-wide",children:n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"})})]})}),i.jsx("div",{className:"flex justify-center items-center h-[600px] max-h-[600px] bg-[#0F1211] rounded-tr-xl rounded-br-xl max-w-[398px] overflow-hidden",children:(n==null?void 0:n.roe)>=0?i.jsx("img",{src:NA,alt:"",className:"h-full"}):i.jsx("img",{src:AA,alt:"",className:"h-full"})})]})}),i.jsxs("div",{className:"flex flex-col items-start justify-between gap-4 w-[400px] h-[600px] bg-[#232323] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start w-full gap-4",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[21px]",children:"Customization"}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Referral Code"}),i.jsxs("div",{className:"flex justify-start items-center gap-2 px-2.5 w-full h-8 bg-[#1b1b1b] rounded-md border border-[#303030]",children:[i.jsx("div",{className:"text-[#7b7b7b] text-sm font-medium font-inter leading-[8px]",children:"#"}),i.jsx("div",{className:"text-white text-sm font-medium font-inter leading-[8px]",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Comment"}),i.jsx("div",{className:"flex justify-start items-center gap-2 p-2 w-full h-max bg-[#1b1b1b] rounded-lg border border-[#303030]",children:i.jsx("div",{className:"w-max text-[#909090] text-sm font-normal font-inter leading-[18px]",children:n!=null&&n.referral?i.jsxs("span",{children:["Numbers don’t lie! 🔥 Unrealized PnL:"," ",(n==null?void 0:n.unrealizedPnL)>=0?"":"-",(n==null?void 0:n.unrealizedPnL)==null||isNaN(parseFloat(n==null?void 0:n.unrealizedPnL))?"--":`$${_s(Math.abs(n==null?void 0:n.unrealizedPnL))}`," ","🚀 Tap into the best trades with Dextrabot on Hyperliquid! Copy top traders and save 4% on fees using my referral: ",n==null?void 0:n.referral," ","@Dextrabot"," "]}):i.jsxs("span",{children:["Numbers don’t lie! 🔥 Unrealized PnL:"," ",(n==null?void 0:n.unrealizedPnL)>=0?"":"-",(n==null?void 0:n.unrealizedPnL)==null||isNaN(parseFloat(n==null?void 0:n.unrealizedPnL))?"--":`$${_s(Math.abs(n==null?void 0:n.unrealizedPnL))}`," ","🚀 Tap into the best trades with Dextrabot on Hyperliquid! Copy top traders! @Dextrabot"]})})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2.5 w-full",children:[i.jsx("div",{onClick:o=>{o.stopPropagation(),navigator.clipboard.writeText(n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Copy URL"})}),i.jsx("div",{onClick:()=>{a()},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex has-tooltip relative cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Download PNG"})}),i.jsx("a",{href:`https://x.com/intent/post?url=${n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"}&text=Numbers%20don’t%20lie!%20🔥%20Unrealized%20PnL:%20${(n==null?void 0:n.unrealizedPnL)==null||isNaN(parseFloat(n==null?void 0:n.unrealizedPnL))?"--":`${(n==null?void 0:n.unrealizedPnL)>=0?"":"-"}$${_s(Math.abs(n==null?void 0:n.unrealizedPnL))}`}%20🚀%20Tap%20into%20the%20best%20trades%20with%20Dextrabot%20on%20Hyperliquid!%20Copy%20top%20traders${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`%20and%20save%204%25%20on%20fees%20using%20my%20referral:%20${n==null?void 0:n.referral}`:"!"}%20%40Dextrabot%0A`,target:"_blank",className:"w-full h-8 px-6 py-3 bg-white rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#363636] text-[13px] font-medium font-inter leading-[8px]",children:"Share on X"})})]})]})]})]})]})})})})})]})}const PUe=()=>{const[e,t]=m.useState(!1);m.useEffect(()=>{(()=>{localStorage.getItem("isCopyTradeIntroductionModal")||(t(!0),localStorage.removeItem("copyTradeIntroductionModal"))})()},[]),m.useEffect(()=>{const r=s=>{s.key==="Escape"&&(localStorage.setItem("isCopyTradeIntroductionModal","true"),t(!1))};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[]);const n=()=>{localStorage.setItem("isCopyTradeIntroductionModal","true"),t(!1)};return i.jsxs(ga,{open:e,onClose:n,className:"relative z-50 font-manrope hidden lg:block",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative transform overflow-hidden bg-[#1b1b1b] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[480px] h-max relative bg-[#1b1b1b] rounded-3xl pb-8",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{n()},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#67FFBD52]",children:i.jsx("img",{className:"p-1",src:Oa})})}),i.jsx("div",{className:"pt-2 px-2",children:i.jsx("img",{src:eyt,alt:""})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-4 pt-[14px]",children:[i.jsxs("div",{className:"text-center justify-center",children:[i.jsxs("span",{className:"text-white text-2xl font-semibold font-manrope leading-7 tracking-tight",children:["You can start"," "]}),i.jsx("span",{className:"text-[#67ffbd] text-2xl font-semibold font-manrope leading-7 tracking-tight",children:"Copy Trading"}),i.jsxs("span",{className:"text-white text-2xl font-semibold font-manrope leading-7 tracking-tight",children:[" ","now!"]})]}),i.jsx("div",{className:"w-[320px] text-center justify-start text-[#979797] text-[13px] font-normal font-manrope leading-4 tracking-tight",children:"Hyperliquid Copy Trading is live on Dextrabot. Best wallets. Auto trades. Simple. 🚀"})]})]})})})})})]})},bsn=({info1:e,info2:t,info3:n,padding:r,icon:s,info1_Color:a,info2_Color:o,info3_Color:l,rowTwo:c})=>i.jsx("div",{className:`${r||"pl-1 pr-2"} flex flex-col gap-2 font-manrope`,children:i.jsx("div",{className:`${c?"-mt-3.5":""} text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px] text-white`,children:e=="--"&&t=="--"&&n=="--"?"--":i.jsxs(i.Fragment,{children:[i.jsx("span",{className:`${a}`,children:`${e}/`}),i.jsx("span",{className:`${o}`,children:`${t}/`}),i.jsx("span",{className:`${l}`,children:`${n}`})]})})}),ysn=({setCurrentPage:e,offset:t,setOffset:n,setTotalPage:r,setTotalWalletCount:s,period:a,periods:o,totalPage:l,totalWalletCount:c,currentPage:u,handlePeriodChange:d})=>{const[f,x]=m.useState([]),[g,v]=m.useState(!0),[w,C]=m.useState(null),{hyperToken:N,copyTradeWatchList:I,getCopyTradeWatchList:P,trackedWatchList:R,getTrackedWatchList:F,setSignModalOpen:U,setTelegramChatId:L,setSubscriberRole:z,setSubsExpireDay:X,setMushboomerETH:ne,setMushboomerSOL:J,setIsReferralCode:Z,isReferralCodeName:re,setIsReferralCodeName:he,setIsWhitelist:Y,setHyperToken:ie,setHyperAddress:oe}=m.useContext(Gr),{isConnected:G,address:V}=Yr();nl(),Ic();const[ee,ae]=m.useState(!1),[fe,Ae]=m.useState(null),[ce,ye]=m.useState(null),[Ne,be]=m.useState(""),[je,Ie]=m.useState(""),[Re,Qe]=m.useState(""),[Be,it]=m.useState(""),[tt,at]=m.useState(""),[dt,ct]=m.useState([]),[Ut,kt]=m.useState(!0),[tn,jt]=m.useState([]),[un,cn]=m.useState([]),[Pt,Xe]=m.useState(!0),[Vt,Yt]=m.useState([]),[Ve,Ke]=m.useState(!1),[ft,en]=m.useState(!1),Dt=`portfolio_perp_${{1:"day",7:"week",30:"month",90:"3month",999:"all_time"}[a]||"day"}_pnl`,At=`portfolio_perp_${{1:"day",7:"week",30:"month",90:"3month",999:"all_time"}[a]||"day"}_dd`,Je=`portfolio_perp_${{1:"day",7:"week",30:"month",90:"3month",999:"all_time"}[a]||"day"}_growth_rate`,He=`portfolio_perp_${{1:"day",7:"week",30:"month",90:"3month",999:"all_time"}[a]||"day"}_sharpe`;function Rt(Oe){if(!Oe)return"--";const sn=parseInt(Oe==null?void 0:Oe.split(":")[0]),fn=parseInt(Oe==null?void 0:Oe.split(":")[1]);return`${sn}h ${fn}m`}m.useEffect(()=>{(async()=>{var Et,Kn;const sn=window.localStorage.getItem("hyperToken"),fn=window.localStorage.getItem("hyperAddress");if(!(!sn||!fn))try{const Cn=await Si(fn.toLowerCase(),sn);Cn!=null&&Cn.success?(L(Cn==null?void 0:Cn.telegram_chat_id),z(Cn==null?void 0:Cn.subscriber_role),X(Cn==null?void 0:Cn.subs_expire_day),ne((Et=Cn==null?void 0:Cn.mushboomer_counts)==null?void 0:Et.eth),J((Kn=Cn==null?void 0:Cn.mushboomer_counts)==null?void 0:Kn.sol),Z(Cn==null?void 0:Cn.referral_code),he(Cn==null?void 0:Cn.refcode),Y(Cn==null?void 0:Cn.whitelist),ie(sn),oe(fn)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),ie(""),oe(""))}catch(Cn){console.error("Token verification error:",Cn),console.error(Cn.message||"An unknown error occurred.")}})()},[]);const qe={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};m.useEffect(()=>{(async()=>{var sn,fn;try{const Kn=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_coins/")).json(),Cn=()=>di.random().hex(),Bt=(fn=(sn=Kn.coins)==null?void 0:sn.filter(an=>!an.startsWith("@")&&!an.endsWith("/USDC")))==null?void 0:fn.map(an=>({value:an,label:an.endsWith("/USDC")?an+" (Spot)":an,color:Cn(),icon:`https://app.hyperliquid.xyz/coins/${qe[an]||(an==null?void 0:an.split("/")[0])}.svg`}));ct(Bt),kt(!1)}catch(Et){console.error("Data retrieval error:",Et),kt(!1)}})()},[]),m.useEffect(()=>{(async()=>{var sn,fn;try{const Kn=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_refcodes/")).json(),Cn=()=>di.random().hex(),Bt=(fn=(sn=Kn==null?void 0:Kn.refcodes)==null?void 0:sn.filter(an=>an.code!=="DEXTRABOT"))==null?void 0:fn.slice(0,1300).map(an=>({value:an.code,label:an.code,color:Cn()}));cn(Bt),Xe(!1)}catch(Et){console.error("Data retrieval error:",Et),Xe(!1)}})()},[]);const lt=Oe=>{const sn=["Growth Rate","Drawdown","Drawdown PnL","Sharpe"],fn=[{header:"Popular Wallet",value:Et=>{const Kn=Number(Et.copier_count)||0;return Kn===0?"":Kn<=5?"F":Kn<=10?"FF":"FFF"}},{header:"Wallet",value:Et=>Et.user_token},{header:"PnL",value:Et=>(Et==null?void 0:Et[Dt])==null||isNaN(+(Et==null?void 0:Et[Dt]))?"--":`$${_s(Et==null?void 0:Et[Dt])}`},{header:"uPnL",value:Et=>Et.total_unrealized_pnl==null||isNaN(+Et.total_unrealized_pnl)?"--":`$${_s(Et.total_unrealized_pnl)}`},{header:"Perp Equity",value:Et=>Et.portfolio_perp_all_time_value==null||isNaN(+Et.portfolio_perp_all_time_value)?"--":`$${_s(Math.abs(Et.portfolio_perp_all_time_value))}`},{header:"Win Rate",value:Et=>Et.win_complated_rate==null||isNaN(+Et.win_complated_rate)||Oe==999?"--":`%${Math.abs(Et.win_complated_rate)}`},{header:"Trades Count",value:Et=>Et.complated_trades_count==null||isNaN(+Et.complated_trades_count)||Oe==999?"--":`${_s(Math.abs(Et.complated_trades_count))}`},{header:"Win Count",value:Et=>Et.complated_win_count==null||isNaN(+Et.complated_win_count)||Oe==999?"--":`${_s(Math.abs(Et.complated_win_count))}`},{header:"Loss Count",value:Et=>Et.complated_loss_count==null||isNaN(+Et.complated_loss_count)?"--":`${_s(Math.abs(Et.complated_loss_count))}`},{header:"Long PnL",value:Et=>Et.long_kar==null||isNaN(+Et.long_kar)||Oe==999?"--":`$${_s(Math.abs(Et.long_kar))}`},{header:"Short PnL",value:Et=>Et.short_kar==null||isNaN(+Et.short_kar)||Oe==999?"--":`$${_s(Et.short_kar)}`},{header:"Growth Rate",value:Et=>(Et==null?void 0:Et[Je])==null||isNaN(+(Et==null?void 0:Et[Je]))||Oe==1||Oe==999?"--":`%${_s(Et==null?void 0:Et[Je])}`},{header:"Drawdown",value:Et=>(Et==null?void 0:Et[At])==null||isNaN(+(Et==null?void 0:Et[At]))||Oe==999?"--":`%${_s(Et==null?void 0:Et[At])}`},{header:"Sharpe",value:Et=>(Et==null?void 0:Et[He])==null||isNaN(+(Et==null?void 0:Et[He]))||Oe==999?"--":`${Et==null?void 0:Et[He]}`},{header:"Tx Count",value:Et=>Et.rtx_count==null||isNaN(+Et.rtx_count)||Oe==999?"--":`${_s(Et.rtx_count)}`},{header:"ROE (%)",value:Et=>Et.margin_roi==null||isNaN(+Et.margin_roi)?"--":`${_s(Et.margin_roi)}%`},{header:"Margin / Used",value:Et=>Et.margin_used==null||isNaN(+Et.margin_used)||Et.margin_percentage==null||isNaN(+Et.margin_percentage)?"--":`${_s(Et.margin_used)} / %${parseFloat(Et.margin_percentage).toFixed(2)}`},{header:"Avg. Lvg.",value:Et=>Et.avg_uleverage_value==null||isNaN(+Et.avg_uleverage_value)?"--":`${parseFloat(Et.avg_uleverage_value).toFixed(2)}x`},{header:"Funding",value:Et=>Et.funding==null||isNaN(+Et.funding)?"--":`$${_s(Et.funding)}`},{header:"rToken #",value:Et=>Et.token_count==null||isNaN(+Et.token_count)||Oe==999?"--":_s(Et.token_count)},{header:"uToken #",value:Et=>Et.position_count==null||isNaN(+Et.position_count)?"--":_s(Et.position_count)},{header:"Avg. Dur.",value:Et=>Oe==999?"--":`${Rt(Et.complated_avg_duration)}`},{header:"First Tx Time",value:Et=>Oe==999?"--":PI(Et.first_time)},{header:"Last Tx Time",value:Et=>Oe==999?"--":PI(Et.end_time)}];return Oe===1?fn.filter(Et=>!sn.includes(Et.header)):fn},xt=()=>{if(!(f!=null&&f.length))return;const Oe=new Date,sn=qn=>qn.toString().padStart(2,"0"),fn=`discoverwallet_${sn(Oe.getDate())}${sn(Oe.getMonth()+1)}${Oe.getFullYear()}_${sn(Oe.getHours())}${sn(Oe.getMinutes())}.csv`,Et=lt(a),Kn=Et.map(qn=>`"${qn.header}"`).join(","),Cn=f==null?void 0:f.map(qn=>Et==null?void 0:Et.map(nr=>`"${nr.value(qn)}"`).join(",")),Bt=new Blob([Kn+`\r
`+Cn.join(`\r
`)],{type:"text/csv;charset=utf-8;"}),an=URL.createObjectURL(Bt);Object.assign(document.createElement("a"),{href:an,download:fn}).click(),URL.revokeObjectURL(an)},[Nt,It]=m.useState("-perp_pnl"),[xn,dn]=m.useState({max_first_time:"",min_first_time:"",max_end_time:"",min_end_time:"",max_short_kar:"",min_short_kar:"",max_long_kar:"",min_long_kar:"",max_pnl:"",min_pnl:"",max_uPnl:"",min_uPnl:"",max_rToken_count:"",min_rToken_count:"",max_uToken_count:"",min_uToken_count:"",max_perp_equity:"",min_perp_equity:"",max_margin_used:"",min_margin_used:"",max_margin_used_percentage:"",min_margin_used_percentage:"",max_avg_uLeverage_value:"",min_avg_uLeverage_value:"",max_funding:"",min_funding:"",max_margin_roi:"",min_margin_roi:"",max_rTx_count:"",min_rTx_count:"",max_sharpe:"",min_sharpe:"",max_growth_rate:"",min_growth_rate:"",max_perp_dd:"",min_perp_dd:"",max_perp_dd_pnl:"",min_perp_dd_pnl:"",max_win_complated_rate:"",min_win_complated_rate:"",max_complated_trades_count:"",min_complated_trades_count:"",max_complated_win_count:"",min_complated_win_count:"",max_complated_loss_count:"",min_complated_loss_count:"",user_token:"",coin:"",refcode:"",is_favorite_wallet:""});m.useEffect(()=>{async function Oe(){try{v(!0);const sn={period:a===999?"all_time":a,order:Nt,offset:t===-50?"0":t.toString(),limit:"50",...xn},fn=Object.entries(sn).filter(([an,Pn])=>Pn!=null).map(([an,Pn])=>`${encodeURIComponent(an)}=${encodeURIComponent(Pn)}`).join("&"),Et=`https://dextradata.nftinit.io/api/hyper/${a==999?"get_wallets_profit_all_time":"get_wallets_profit_new"}/?${fn}`,Kn=await fetch(Et.toString());if(!Kn.ok)throw new Error(`HTTP error! status: ${Kn.status}`);const Cn=await Kn.json();r(Math.ceil(Cn.count/50)),s(Cn.count),e((t+50)/50),window.localStorage.getItem("hyperToken")&&(P(),F()),x(Cn.results)}catch(sn){x([]),console.error("Error fetching data:",sn),C(sn.message)}finally{v(!1)}}Oe()},[t,Nt,a]);async function Mn(Oe){try{v(!0);const sn={period:a===999?"all_time":a,order:Nt,offset:t===-50?"0":t.toString(),limit:"50",...xn},fn=Object.entries(sn).filter(([an,Pn])=>Pn!=null).map(([an,Pn])=>`${encodeURIComponent(an)}=${encodeURIComponent(Pn)}`).join("&"),Et=`https://dextradata.nftinit.io/api/hyper/${a==999?"get_wallets_profit_all_time":"get_wallets_profit_new"}/?${fn}`,Kn=await fetch(Et);if(!Kn.ok)throw new Error(`HTTP error! status: ${Kn.status}`);const Cn=await Kn.json();e(1),r(Math.ceil(Cn.count/50)),s(Cn.count),n(0),window.localStorage.getItem("hyperToken")&&(P(),F()),x(Cn.results)}catch(sn){x([]),console.error("Error fetching data:",sn),C(sn.message)}finally{v(!1)}}async function _n(Oe){try{v(!0);const sn=await fetch(`https://dextradata.nftinit.io/api/hyper/${a==999?"get_wallets_profit_all_time":"get_wallets_profit_new"}/?period=${a==999?"all_time":a}&order=${Nt}&offset=0&limit=50`);if(!sn.ok)throw new Error(`HTTP error! status: ${sn.status}`);const fn=await sn.json();e(50/50),r(Math.ceil(fn.count/50)),s(fn.count),n(0),x(fn.results),window.localStorage.getItem("hyperToken")&&(P(),F()),dn({max_first_time:"",min_first_time:"",max_end_time:"",min_end_time:"",max_short_kar:"",min_short_kar:"",max_long_kar:"",min_long_kar:"",max_pnl:"",min_pnl:"",max_uPnl:"",min_uPnl:"",max_rToken_count:"",min_rToken_count:"",max_uToken_count:"",min_uToken_count:"",max_perp_equity:"",min_perp_equity:"",max_margin_used:"",min_margin_used:"",max_margin_used_percentage:"",min_margin_used_percentage:"",max_avg_uLeverage_value:"",min_avg_uLeverage_value:"",max_funding:"",min_funding:"",max_margin_roi:"",min_margin_roi:"",max_rTx_count:"",min_rTx_count:"",max_sharpe:"",min_sharpe:"",max_growth_rate:"",min_growth_rate:"",max_perp_dd:"",min_perp_dd:"",max_perp_dd_pnl:"",min_perp_dd_pnl:"",max_win_complated_rate:"",min_win_complated_rate:"",max_complated_trades_count:"",min_complated_trades_count:"",max_complated_win_count:"",min_complated_win_count:"",max_complated_loss_count:"",min_complated_loss_count:"",user_token:"",coin:"",refcode:"",is_favorite_wallet:""}),Ie(""),Qe(""),it(""),at(""),jt([])}catch(sn){x([]),console.error("Error resetting filters:",sn),C(sn.message)}finally{v(!1)}}const kn=async({walletAddress:Oe,isFollow:sn,isScalper:fn})=>{try{be(Oe);const Et=window.localStorage.getItem("hyperToken"),Kn=window.localStorage.getItem("hyperAddress");if(!Et){U(!0);return}const Cn=sn?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",Bt=sn?{address:V?V.toLowerCase():Kn,token:Et,follow_address:Oe.toLowerCase()}:{address:V?V.toLowerCase():Kn,token:Et},an=await fetch(Cn,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(Bt)});if(!an.ok)throw new Error(`Server responded with status ${an.status}`);const Pn=await an.json();Pn.success?(Ae(Array.isArray(Pn==null?void 0:Pn.data)?[...Pn.data].sort((qn,nr)=>new Date(nr.created_at||0)-new Date(qn.created_at||0)):Pn==null?void 0:Pn.data),ye(fn),ae(!0)):(console.log(Pn.error_message),on.error(Pn.error_message))}catch(Et){console.error("Error in like function:",Et),on.error(Et.message||"Something went wrong!")}},vn=Oe=>Oe>=640&&Oe<1024?7:Oe>=1024&&Oe<1240?6:Oe>=1240&&Oe<1540?7:Oe>=1540?10:4,[Qn,Hn]=m.useState(!1),[$n,Jn]=m.useState(!1),[Nn,ln]=m.useState({pnl:0,winRate:0,tradeCount:0,longWinRate:0,shortWinRate:0,leverage:0,roe:0,unrealizedPnL:0,referral:""});return i.jsxs(i.Fragment,{children:[i.jsx(PUe,{}),i.jsx(Srn,{open:Ve,setOpen:Ke}),i.jsx(g5,{open:ee,setOpen:ae,copyTradeData:fe,setCopyTradeData:Ae,copyTradeWallet:Ne,setCopyTradeWallet:be,isScalper:ce}),i.jsx(xsn,{open:Qn,setOpen:Hn,data:Nn,setTradeInfo:ln,period:a}),i.jsx(gsn,{open:$n,setOpen:Jn,data:Nn,setTradeInfo:ln}),i.jsxs("div",{className:"block lg:hidden w-full p-2 space-y-2",children:[i.jsx(rMe,{}),i.jsx("button",{className:"px-2 py-2 text-xs font-bold rounded-2xl border border-gray-600 text-white hover:bg-[#1D1D1D] bg-[#171717] h-8 font-manrope w-full",onClick:xt,children:"Export CSV"})]}),i.jsx("div",{className:"lg:hidden flex w-full p-2",children:i.jsx("button",{className:"px-2 py-2 text-xs font-medium rounded-2xl border border-gray-600 text-white hover:bg-[#1D1D1D] w-full bg-[#171717]",onClick:()=>en(!ft),children:ft?"Hide Filters":"Show Filters"})}),i.jsxs("div",{className:"flex-grow flex flex-col lg:flex-row items-start justify-start gap-2 lg:gap-6 bg-[#161616] w-full  h-full overflow-y-scroll pl-1 sm:pl-4 pt-1 sm:pt-4 pr-0.5 pb-3 font-manrope relative",children:[i.jsx("div",{className:`${ft?"block":"hidden"} lg:flex flex-shrink-0 lg:w-auto w-full lg:max-w-none max-w-full h-full`,children:i.jsx(vrn,{period:a,advancedFilters:xn,setAdvancedFilters:dn,resetFilters:_n,setFilters:Mn,minFirstValue:je,setMinFirstValue:Ie,maxFirstValue:Re,setMaxFirstValue:Qe,minEndValue:Be,setMinEndValue:it,maxEndValue:tt,setMaxEndValue:at,dataCoin:dt,selectedCoins:tn,setSelectedCoins:jt,isLoadingCoin:Ut,setIsLoadingCoin:kt,dataReferral:un,selectedReferrals:Vt,setSelectedReferrals:Yt,isLoadingReferral:Pt,setIsLoadingReferral:Xe})}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[10px] bg-[#161616] max-h-full lg:min-w-0 lg:flex-grow max-w-full lg:max-w-none overflow-auto font-manrope",children:[i.jsxs("div",{className:"sticky sm:static top-0 sm:mt-2 flex flex-row sm:flex-col items-center sm:items-start justify-between sm:justify-start gap-2 font-manrope max-w-full w-full bg-[#161616] pl-2 sm:pl-0 pb-2 sm:pb-0 pr-2 sm:pr-0 z-10",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2 min-w-max mt-[10px] sm:mt-0",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-[16px] sm:text-[18px] font-medium font-manrope leading-[21px]",children:"Discover Wallets"})})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-end sm:items-center justify-between w-full gap-1 pr-0 sm:pr-2",children:[i.jsx("div",{className:"flex",children:i.jsx(kce,{periods:o,selectedPeriod:a,handlePeriod:d,borderColor:"discover"})}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(wrn,{offset:t,setOffset:n,totalPage:l,totalWalletCount:c,currentPage:u}),i.jsx("div",{className:"hidden lg:block",children:i.jsx("button",{className:"px-2 py-2 text-xs font-bold rounded-2xl border border-gray-600 text-white hover:bg-[#1D1D1D] bg-[#171717] h-8 font-manrope",onClick:xt,children:"Export CSV"})})]})]})]}),i.jsx("div",{className:"w-full overflow-scroll h-[calc(100vh-200px)] flex-grow bg-[#161616] rounded mt-2 sm:mt-0",children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] font-semibold leading-[13px] tracking-[0.26px] text-[#9b9b9b] text-[13px] font-manrope mr-10",children:[i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] sm:left-0 h-10 pl-2 sm:pl-4 min-w-[130px] sm:min-w-[130px] z-[8]",children:i.jsx("div",{className:"flex items-center justify-start w-full gap-1 min-w-max max-w-max ",children:i.jsx("div",{className:"flex items-center justify-start group",children:"Action"})})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] sm:left-[130px] h-10 px-1 min-w-[50px] sm:min-w-[50px] z-[8]",children:i.jsxs("div",{className:"flex justify-start items-center w-full",children:[i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsxs("div",{className:"flex justify-start items-center has-tooltip relative",children:["🔥",i.jsx("span",{className:"",children:i.jsx(eo,{content:"🔥🔥🔥 Copytrend indicator. More flames = more followers.",positionTop:!1,alignRight:!1,tooltipCss:"max-w-[215px] min-w-[215px] leading-[16px] -mb-5"})})]})}),i.jsx(Wo,{title:"",sortKey:"copier_count",sortOption:Nt,setSortOption:It,isFilterIcon:!1,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] sm:left-[180px] h-10 px-1 min-w-[120px] sm:min-w-[140px] z-[7]",children:i.jsx(Wo,{title:"Wallet",sortKey:"user_token",sortOption:Nt,setSortOption:It,isFilterIcon:!1,isFilter:!1})}),i.jsx("th",{scope:"col",className:"min-w-[120px] sm:min-w-[140px] px-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(eo,{content:"Realized profit/loss from completed trades.",positionTop:!1,alignRight:!1,tooltipCss:"max-w-[200px] min-w-[200px] leading-[16px] -mb-5"})})]})}),i.jsx(Wo,{title:"PnL",sortKey:"perp_pnl",sortOption:Nt,setSortOption:It,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:"min-w-[140px] sm:min-w-[170px] px-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(_a,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Wo,{title:"uPnL",sortKey:"total_unrealized_pnl",sortOption:Nt,setSortOption:It,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:"min-w-[150px] sm:min-w-[170px] px-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(_a,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Wo,{title:"Perp Equity",sortKey:"portfolio_perp_all_time_value",sortOption:Nt,setSortOption:It,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[140px] sm:min-w-[165px] px-1"}`,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(_a,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Wo,{title:"Win Rate",sortKey:"win_complated_rate",sortOption:Nt,setSortOption:It,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[170px] sm:min-w-[200px] px-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(_a,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Wo,{title:"Total/Win/Loss",sortKey:"complated_trades_count",sortOption:Nt,setSortOption:It,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[130px] sm:min-w-[160px] px-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(_a,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Wo,{title:"Long PnL",sortKey:"long_kar",sortOption:Nt,setSortOption:It,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[130px] sm:min-w-[160px] px-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(_a,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Wo,{title:"Short PnL",sortKey:"short_kar",sortOption:Nt,setSortOption:It,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==1||a==999?"min-w-[120px] sm:min-w-[150px] px-1":"min-w-[150px] sm:min-w-[170px] px-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:`${a==1||a==999?"flex":"hidden"} justify-end items-center has-tooltip relative`,children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(eo,{content:"Available for 7, 30, 90 days",positionTop:!1,alignRight:!1,tooltipCss:"max-w-[180px] min-w-[180px] leading-[16px] h-10 -mb-2"})})]})}),a==1||a==999?i.jsx("div",{className:"flex items-center justify-start",children:"Growth Rate"}):i.jsx(Wo,{title:"Growth Rate",sortKey:"growth_rate",sortOption:Nt,setSortOption:It,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==1||a==999?"min-w-[120px] sm:min-w-[140px] px-1":"min-w-[140px] sm:min-w-[160px] px-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:`${a==1||a==999?"flex":"hidden"} justify-end items-center has-tooltip relative`,children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(eo,{content:"Available for 7, 30, 90 days",positionTop:!1,alignRight:!1,tooltipCss:"max-w-[180px] min-w-[180px] leading-[16px] h-10 -mb-2"})})]})}),a==1||a==999?i.jsx("div",{className:"flex items-center justify-start",children:"Drawdown"}):i.jsx(Wo,{title:"Drawdown",sortKey:"perp_dd",sortOption:Nt,setSortOption:It,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==1||a==999?"min-w-[100px] sm:min-w-[120px] px-1":"min-w-[120px] sm:min-w-[145px] px-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"flex justify-end items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(eo,{content:a==1||a==999?"Available for 7, 30, 90 days":"Sharpe_tooltip",positionTop:!1,alignRight:!1,tooltipCss:a==1||a==999?"max-w-[180px] min-w-[180px] leading-[16px] h-10 -mb-2":"max-w-[80px] min-w-[80px] leading-[16px] -mb-12"})})]})}),a==1||a==999?i.jsx("div",{className:"flex items-center justify-start",children:"Sharpe"}):i.jsx(Wo,{title:"Sharpe",sortKey:"sharpe",sortOption:Nt,setSortOption:It,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[130px] sm:min-w-[150px] px-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(_a,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Wo,{title:"Tx Count",sortKey:"rtx_count",sortOption:Nt,setSortOption:It,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:"min-w-[110px] sm:min-w-[135px] px-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(_a,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Wo,{title:"ROE",sortKey:"margin_roi",sortOption:Nt,setSortOption:It,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:"min-w-[125px] sm:min-w-[150px] px-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(_a,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Wo,{title:"Margin",sortKey:"margin_percentage",sortOption:Nt,setSortOption:It,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:"min-w-[130px] sm:min-w-[150px] px-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{children:i.jsx(_a,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Wo,{title:"Avg. Lvg.",sortKey:"avg_uleverage_value",sortOption:Nt,setSortOption:It,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:"min-w-[125px] sm:min-w-[155px] px-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(_a,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Wo,{title:"Funding",sortKey:"funding",sortOption:Nt,setSortOption:It,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[130px] sm:min-w-[150px] pr-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(_a,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Wo,{title:"rToken #",sortKey:"token_count",sortOption:Nt,setSortOption:It,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"min-w-[120px] sm:min-w-[150px] pl-1 pr-7":"min-w-[120px] sm:min-w-[150px] pr-1"}`,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(_a,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Wo,{title:"uToken #",sortKey:"position_count",sortOption:Nt,setSortOption:It,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[120px] sm:min-w-[150px] pr-1"} `,children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"hidden justify-end items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(_a,{content:"Snapshot data per hour",positionTop:!1,alignRight:!1})})]})}),i.jsx(Wo,{title:"Avg. Dur.",sortKey:"complated_avg_duration",sortOption:Nt,setSortOption:It,isFilterIcon:!0,isFilter:!1})]})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[140px] sm:min-w-[160px] pl-1 pr-1.5"} `,children:i.jsx(Wo,{title:"First Tx Time",sortKey:"first_time",sortOption:Nt,setSortOption:It,isFilterIcon:!0,isFilter:!1})}),i.jsx("th",{scope:"col",className:`${a==999?"hidden":"min-w-[150px] sm:min-w-[180px] pl-1 pr-7"} `,children:i.jsx(Wo,{title:"Last Tx Time",sortKey:"end_time",sortOption:Nt,setSortOption:It,isFilterIcon:!0,isFilter:!1})})]})}),i.jsx("tbody",{children:!f||g?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:vn(window.innerWidth),className:"h-[30vh]",children:i.jsx("div",{className:"flex min-h-[46vh] lg:min-h-[66vh] flex-col justify-center items-center fixed top-[20%] lg:top-[25%] left-[45%] sm:left-[50%] lg:left-[60%] 2xl:left-[55%] z-10",children:i.jsx(Ma,{})})})}):w&&!f?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:vn(window.innerWidth),className:"h-[30vh]",children:i.jsx("div",{className:"flex min-h-[46vh] lg:min-h-[66vh] flex-col justify-center items-center fixed top-[20%] lg:top-[25%] left-[45%] sm:left-[50%] lg:left-[60%] 2xl:left-[55%] z-10",children:i.jsx(Error,{})})})}):(f==null?void 0:f.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:vn(window.innerWidth),className:"h-[30vh]",children:!ft&&i.jsx("div",{className:"flex flex-col justify-center items-center fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2",children:i.jsx(CUe,{})})})}):f&&(f==null?void 0:f.map((Oe,sn)=>i.jsxs(Se.Fragment,{children:[i.jsxs("tr",{className:`${sn%2==0?"bg-[#1b1b1b]":"bg-[#1f1f1f]"} relative group hover:bg-[#222222] h-[56px] max-h-[56px] text-white rounded-2xl`,style:{margin:"2px"},children:[i.jsx("td",{scope:"row",className:`${sn%2==0?"bg-[#1b1b1b]":"bg-[#1f1f1f]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222] sm:rounded-l-2xl`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 sm:pl-4 h-14 max-h-14 rounded-2xl",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{onClick:fn=>{fn.preventDefault();const Et=I==null?void 0:I.some(Kn=>Kn.wallet_address===(Oe==null?void 0:Oe.user_token));kn({walletAddress:Oe==null?void 0:Oe.user_token,isFollow:Et,isScalper:Oe==null?void 0:Oe.is_scalper})},className:`
                                  ${I.some(fn=>fn.wallet_address===(Oe==null?void 0:Oe.user_token))?"bg-[#67ffbd] text-[#161616] font-semibold":"border border-[#67ffbd] bg-[#161616] text-[#67ffbd] hover:bg-[#67ffbd] hover:text-[#161616] font-bold"} 
                                  h-[22px] rounded-[256px] justify-center items-center gap-1 inline-flex cursor-pointer text-xs font-['Manrope'] leading-[8px] tracking-tight px-2 min-w-max`,children:"Copy Trade"}),i.jsx(x5,{walletAddress:Oe==null?void 0:Oe.user_token,children:i.jsx("div",{className:"w-[18px] h-[18px] justify-center items-center flex cursor-pointer",children:R.some(fn=>fn.wallet_address===(Oe==null?void 0:Oe.user_token))?i.jsx("img",{src:r5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:SA,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})})]})})}),i.jsx("td",{scope:"row",className:`${sn%2==0?"bg-[#1b1b1b]":"bg-[#1f1f1f]"} sm:sticky sm:left-[130px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-14 max-h-14",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5 mr-6 sm:mr-0",children:i.jsx("div",{className:"pl-2 pr-2 flex flex-col gap-2 font-manrope hover:scale-125 transition-transform duration-150 cursor-pointer",children:i.jsxs("div",{className:"flex items-center justify-end gap-[3px]",children:[i.jsx("div",{className:`${Oe!=null&&Oe.is_favorite_wallet?"":"hidden"} relative w-1 h-[16px] bg-[#4a3131] rounded-md`,children:i.jsx("div",{className:`${(Oe==null?void 0:Oe.copier_count)>=1&&(Oe==null?void 0:Oe.copier_count)<=5?"bg-[#FFAA22] shadow-[0px_2px_4px_0px_rgba(255,170,34,0.32)]":(Oe==null?void 0:Oe.copier_count)>5&&(Oe==null?void 0:Oe.copier_count)<=10?"bg-[#FF8C00] shadow-[0px_2px_4px_0px_rgba(255,140,0,0.32)]":(Oe==null?void 0:Oe.copier_count)>10?"bg-gradient-to-b from-[#ff0000] to-[#ff8c00] shadow-[0px_2px_4px_0px_rgba(255,45,45,0.32)]":"bg-[#FF8C00] shadow-[0px_2px_4px_0px_rgba(255,140,0,0.32)]"} absolute bottom-0 w-full rounded-md`,style:{height:`${(Oe==null?void 0:Oe.copier_count)>=1&&(Oe==null?void 0:Oe.copier_count)<=5?25:(Oe==null?void 0:Oe.copier_count)>5&&(Oe==null?void 0:Oe.copier_count)<=10?50:(Oe==null?void 0:Oe.copier_count)>10?100:0}%`,transition:"height 0.3s ease"}})}),i.jsx("span",{className:"text-[14px] text-white  font-semibold font-manrope leading-[8px]",children:Oe!=null&&Oe.is_favorite_wallet?"🔥":""})]})})})})}),i.jsx("td",{scope:"row",className:`${sn%2==0?"bg-[#1b1b1b]":"bg-[#1f1f1f]"} sm:sticky sm:left-[180px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${Oe==null?void 0:Oe.user_token}`,"_blank")},className:"cursor-pointer group-hover:bg-[#222222] flex justify-start items-center gap-2 h-14 max-h-14",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5 mr-6 sm:mr-0",children:[i.jsx(ra,{info1:`${(Oe==null?void 0:Oe.user_token).slice(0,5)+"..."+(Oe==null?void 0:Oe.user_token).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:fn=>{fn.stopPropagation(),navigator.clipboard.writeText(Oe==null?void 0:Oe.user_token),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:bo,alt:"",className:"cursor-pointer"})]})})}),i.jsx("td",{className:"",children:i.jsxs("div",{onClick:fn=>{fn.preventDefault(),(Oe==null?void 0:Oe[Dt])!=null&&!isNaN(parseFloat(Oe==null?void 0:Oe[Dt]))&&(ln(Et=>({...Et,pnl:Oe==null?void 0:Oe[Dt],winRate:Oe==null?void 0:Oe.win_complated_rate,tradeCount:Oe==null?void 0:Oe.rtx_count,longWinRate:Oe==null?void 0:Oe.long_win_rate,shortWinRate:Oe==null?void 0:Oe.short_win_rate,roe:Oe==null?void 0:Oe.margin_roi,referral:window.localStorage.getItem("hyperToken")?re:null})),Hn(!0))},className:`${(Oe==null?void 0:Oe[Dt])!=null&&!isNaN(parseFloat(Oe==null?void 0:Oe[Dt]))?"cursor-pointer":""} flex justify-end items-center gap-1 min-w-max px-1`,children:[i.jsx(ra,{info1:`$${_s(Math.abs(Oe==null?void 0:Oe[Dt]))}`,info1_Color:`${(Oe==null?void 0:Oe[Dt])==null||isNaN(parseFloat(Oe==null?void 0:Oe[Dt]))||(Oe==null?void 0:Oe[Dt])==0?"text-white":(Oe==null?void 0:Oe[Dt])>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1}),(Oe==null?void 0:Oe[Dt])!=null&&!isNaN(parseFloat(Oe==null?void 0:Oe[Dt]))&&i.jsx("div",{className:"flex justify-center items-center rounded",children:i.jsx("img",{src:cm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})}),i.jsx("td",{className:"",children:i.jsxs("div",{onClick:fn=>{fn.preventDefault(),(Oe==null?void 0:Oe.total_unrealized_pnl)!=null&&!isNaN(parseFloat(Oe==null?void 0:Oe.total_unrealized_pnl))&&(ln(Et=>({...Et,pnl:Oe==null?void 0:Oe[Dt],unrealizedPnL:Oe==null?void 0:Oe.total_unrealized_pnl,roe:Oe==null?void 0:Oe.margin_roi,leverage:Oe==null?void 0:Oe.avg_uleverage_value,referral:N?re:null})),Jn(!0))},className:`${(Oe==null?void 0:Oe.total_unrealized_pnl)!=null&&!isNaN(parseFloat(Oe==null?void 0:Oe.total_unrealized_pnl))?"cursor-pointer":""} flex justify-end items-center gap-1 min-w-max px-1`,children:[i.jsx(ra,{info1:(Oe==null?void 0:Oe.total_unrealized_pnl)==null||isNaN(parseFloat(Oe==null?void 0:Oe.total_unrealized_pnl))?"--":`$${_s(Math.abs(Oe==null?void 0:Oe.total_unrealized_pnl))}`,info1_Color:`${(Oe==null?void 0:Oe.total_unrealized_pnl)==null||isNaN(parseFloat(Oe==null?void 0:Oe.total_unrealized_pnl))||(Oe==null?void 0:Oe.total_unrealized_pnl)==0?"text-white":(Oe==null?void 0:Oe.total_unrealized_pnl)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1}),(Oe==null?void 0:Oe.total_unrealized_pnl)!=null&&!isNaN(parseFloat(Oe==null?void 0:Oe.total_unrealized_pnl))&&i.jsx("div",{className:"flex justify-center items-center rounded",children:i.jsx("img",{src:cm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})}),i.jsx("td",{className:"",children:i.jsx(ra,{info1:(Oe==null?void 0:Oe.portfolio_perp_all_time_value)==null||isNaN(parseFloat(Oe==null?void 0:Oe.portfolio_perp_all_time_value))?"--":`$${_s(Math.abs(Oe==null?void 0:Oe.portfolio_perp_all_time_value))}`,info1_Color:`${(Oe==null?void 0:Oe.portfolio_perp_all_time_value)==null||isNaN(parseFloat(Oe==null?void 0:Oe.portfolio_perp_all_time_value))||(Oe==null?void 0:Oe.portfolio_perp_all_time_value)==0?"text-white":(Oe==null?void 0:Oe.portfolio_perp_all_time_value)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(ra,{info1:(Oe==null?void 0:Oe.win_complated_rate)==null||isNaN(parseFloat(Oe==null?void 0:Oe.win_complated_rate))?"--":`${Math.abs(Oe==null?void 0:Oe.win_complated_rate)}%`,info1_Color:"text-white",rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(bsn,{info1:(Oe==null?void 0:Oe.complated_trades_count)==null||isNaN(parseFloat(Oe==null?void 0:Oe.complated_trades_count))?"--":`${_s(Math.abs(Oe==null?void 0:Oe.complated_trades_count))}`,info2:(Oe==null?void 0:Oe.complated_win_count)==null||isNaN(parseFloat(Oe==null?void 0:Oe.complated_win_count))?"--":`${_s(Math.abs(Oe==null?void 0:Oe.complated_win_count))}`,info3:(Oe==null?void 0:Oe.complated_loss_count)==null||isNaN(parseFloat(Oe==null?void 0:Oe.complated_loss_count))?"--":`${_s(Math.abs(Oe==null?void 0:Oe.complated_loss_count))}`,info1_Color:"text-white",info2_Color:"text-[#1DE6A3]",info3_Color:"text-[#FF7173]",rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(ra,{info1:(Oe==null?void 0:Oe.long_kar)==null||isNaN(parseFloat(Oe==null?void 0:Oe.long_kar))?"--":`$${_s(Math.abs(Oe==null?void 0:Oe.long_kar))}`,info1_Color:`${(Oe==null?void 0:Oe.long_kar)==null||isNaN(parseFloat(Oe==null?void 0:Oe.long_kar))||(Oe==null?void 0:Oe.long_kar)==0?"text-white":(Oe==null?void 0:Oe.long_kar)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(ra,{info1:`$${(Oe==null?void 0:Oe.short_kar)==null||isNaN(parseFloat(Oe==null?void 0:Oe.short_kar))?"--":_s(Math.abs(Oe==null?void 0:Oe.short_kar))}`,info1_Color:`${(Oe==null?void 0:Oe.short_kar)==null||isNaN(parseFloat(Oe==null?void 0:Oe.short_kar))||(Oe==null?void 0:Oe.short_kar)==0?"text-white":(Oe==null?void 0:Oe.short_kar)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{children:a==1||a==999?i.jsx("div",{className:"space-y-2 flex justify-end items-center",children:i.jsx(fi,{content:"Available for 7, 30, 90 days",children:i.jsx("div",{className:"text-gray-500 text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px] w-max pl-16 h-10",children:"--"})})}):i.jsx(ra,{info1:`${a==1||a==999||(Oe==null?void 0:Oe[Je])==null||isNaN(parseFloat(Oe==null?void 0:Oe[Je]))||Je=="portfolio_perp_day_growth_rate"?"--":`${_s(Oe==null?void 0:Oe[Je])}%`}`,info1_Color:`${a==1||a==999?"text-gray-600":(Oe==null?void 0:Oe[Je])==null||isNaN(parseFloat(Oe==null?void 0:Oe[Je]))||Je=="portfolio_perp_day_growth_rate"||(Oe==null?void 0:Oe[Je])==0?"text-white":(Oe==null?void 0:Oe[Je])>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{children:a==1||a==999?i.jsx("div",{className:"space-y-2 flex justify-end items-center",children:i.jsx(fi,{content:"Available for 7, 30, 90 days",children:i.jsx("div",{className:"text-gray-500 text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px] w-max pl-16 h-10",children:"--"})})}):i.jsx(ra,{info1:`${a==1||a==999||(Oe==null?void 0:Oe[At])==null||isNaN(parseFloat(Oe==null?void 0:Oe[At]))||At=="portfolio_perp_day_dd"?"--":`${_s(Math.abs(Oe==null?void 0:Oe[At]))}%`}`,info1_Color:`${a==1||a==999?"text-gray-600":(Oe==null?void 0:Oe[At])==null||isNaN(parseFloat(Oe==null?void 0:Oe[At]))||At=="portfolio_perp_day_dd"||(Oe==null?void 0:Oe[At])==0?"text-white":(Oe==null?void 0:Oe[At])>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{children:a==1||a==999?i.jsx("div",{className:"space-y-2 flex justify-end items-center",children:i.jsx(fi,{content:"Available for 7, 30, 90 days",children:i.jsx("div",{className:"text-gray-500 text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px] w-max pl-16 h-10",children:"--"})})}):i.jsx(ra,{info1:`${a==1||a==999||(Oe==null?void 0:Oe[He])==null||isNaN(parseFloat(Oe==null?void 0:Oe[He]))||He=="portfolio_perp_day_sharpe"?"--":`${Er(Oe==null?void 0:Oe[He])}`}`,info1_Color:`${a==1||a==999?"text-gray-600":(Oe==null?void 0:Oe[He])==null||isNaN(parseFloat(Oe==null?void 0:Oe[He]))||He=="portfolio_perp_day_sharpe"?"text-white":(Oe==null?void 0:Oe[He])>=1&&(Oe==null?void 0:Oe[He])<=2?"text-[#E5BB18]":(Oe==null?void 0:Oe[He])>2?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(ra,{info1:`${(Oe==null?void 0:Oe.rtx_count)==null||isNaN(parseFloat(Oe==null?void 0:Oe.rtx_count))?"--":_s(Oe==null?void 0:Oe.rtx_count)}`,info1_Color:"text-white",rowTwo:!1})}),i.jsx("td",{children:i.jsx(ra,{info1:`${(Oe==null?void 0:Oe.margin_roi)==null||isNaN(parseFloat(Oe==null?void 0:Oe.margin_roi))?"--":`${_s(Math.abs(Oe==null?void 0:Oe.margin_roi))}%`}`,info1_Color:`${(Oe==null?void 0:Oe.margin_roi)==null||isNaN(parseFloat(Oe==null?void 0:Oe.margin_roi))||(Oe==null?void 0:Oe.margin_roi)==0?"text-white":(Oe==null?void 0:Oe.margin_roi)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{children:i.jsx(Crn,{info1:`${(Oe==null?void 0:Oe.margin_used)==null||isNaN(parseFloat(Oe==null?void 0:Oe.margin_used))?"--":_s(Oe==null?void 0:Oe.margin_used)}`,info2:`${(Oe==null?void 0:Oe.margin_percentage)==null||isNaN(parseFloat(Oe==null?void 0:Oe.margin_percentage))?"--":parseFloat(Oe==null?void 0:Oe.margin_percentage).toFixed(2)+"%"}`,info1_Color:"text-white",info2_Color:"text-[#979797]",rowTwo:!1})}),i.jsx("td",{children:i.jsx(ra,{info1:`${(Oe==null?void 0:Oe.avg_uleverage_value)==null||isNaN(parseFloat(Oe==null?void 0:Oe.avg_uleverage_value))?"--":`${parseFloat(Oe==null?void 0:Oe.avg_uleverage_value).toFixed(2)}x`}`,info1_Color:"text-white",rowTwo:!1})}),i.jsx("td",{children:i.jsx(ra,{info1:`${(Oe==null?void 0:Oe.funding)==null||isNaN(parseFloat(Oe==null?void 0:Oe.funding))?"--":`$${_s(Math.abs(Oe==null?void 0:Oe.funding))}`}`,info1_Color:`${(Oe==null?void 0:Oe.funding)==null||isNaN(parseFloat(Oe==null?void 0:Oe.funding))||(Oe==null?void 0:Oe.funding)==0?"text-white":(Oe==null?void 0:Oe.funding)<0?"text-[#1DE6A3]":"text-[#FF7173]"}`,rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-1",children:i.jsx("div",{className:"text-sm font-medium font-manrope leading-none flex items-center justify-center gap-0.5",children:i.jsxs("div",{className:"has-tooltip relative w-5 h-5",children:[i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-center gap-2 font-manrope w-full h-full has-tooltip",children:i.jsx("div",{className:`${(Oe==null?void 0:Oe.token_count)>0?"underline underline-offset-2":""} text-white text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px]`,children:(Oe==null?void 0:Oe.token_count)==null||isNaN(parseFloat(Oe==null?void 0:Oe.token_count))?"--":_s(Oe==null?void 0:Oe.token_count)})}),(Oe==null?void 0:Oe.token_count)>0&&i.jsx(G6e,{content:Oe==null?void 0:Oe.coins_with_profit,positionTop:!0,alignRight:!1,type:"coin"})]})})})}),i.jsx("td",{className:`${a==999?"pr-6 sm:rounded-r-2xl":""} `,children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-1",children:i.jsx("div",{className:"text-sm font-medium font-manrope leading-none flex items-center justify-center gap-0.5",children:i.jsxs("div",{className:"has-tooltip relative w-5 h-5",children:[i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-center gap-2 font-manrope w-full h-full has-tooltip",children:i.jsx("div",{className:`${(Oe==null?void 0:Oe.position_count)>0?"underline underline-offset-2":""} text-white text-sm font-semibold font-manrope leading-[13px] flex items-center justify-end gap-0.5 tracking-[0.28px]`,children:(Oe==null?void 0:Oe.position_count)==null||isNaN(parseFloat(Oe==null?void 0:Oe.position_count))?"--":_s(Oe==null?void 0:Oe.position_count)})}),(Oe==null?void 0:Oe.position_count)>0&&i.jsx(G6e,{content:Oe==null?void 0:Oe.open_positions,positionTop:a!=999,alignRight:!1,type:"position"})]})})})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(ra,{info1:`${Rt(Oe==null?void 0:Oe.complated_avg_duration)}`,info1_Color:"text-white",rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":""}`,children:i.jsx(ra,{info1:`${PI(Oe==null?void 0:Oe.first_time)}`,info1_Color:"text-white",rowTwo:!1})}),i.jsx("td",{className:`${a==999?"hidden":"pr-6 sm:rounded-r-2xl"}`,children:i.jsx(ra,{info1:`${PI(Oe==null?void 0:Oe.end_time)}`,info1_Color:"text-white",rowTwo:!1})})]}),i.jsx("tr",{children:i.jsx("td",{colSpan:"100",style:{height:"2px"}})})]},sn)))})]})})]})]})]})};var RY,tCe;function vsn(){if(tCe)return RY;tCe=1;var e=typeof Element<"u",t=typeof Map=="function",n=typeof Set=="function",r=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function s(a,o){if(a===o)return!0;if(a&&o&&typeof a=="object"&&typeof o=="object"){if(a.constructor!==o.constructor)return!1;var l,c,u;if(Array.isArray(a)){if(l=a.length,l!=o.length)return!1;for(c=l;c--!==0;)if(!s(a[c],o[c]))return!1;return!0}var d;if(t&&a instanceof Map&&o instanceof Map){if(a.size!==o.size)return!1;for(d=a.entries();!(c=d.next()).done;)if(!o.has(c.value[0]))return!1;for(d=a.entries();!(c=d.next()).done;)if(!s(c.value[1],o.get(c.value[0])))return!1;return!0}if(n&&a instanceof Set&&o instanceof Set){if(a.size!==o.size)return!1;for(d=a.entries();!(c=d.next()).done;)if(!o.has(c.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(a)&&ArrayBuffer.isView(o)){if(l=a.length,l!=o.length)return!1;for(c=l;c--!==0;)if(a[c]!==o[c])return!1;return!0}if(a.constructor===RegExp)return a.source===o.source&&a.flags===o.flags;if(a.valueOf!==Object.prototype.valueOf&&typeof a.valueOf=="function"&&typeof o.valueOf=="function")return a.valueOf()===o.valueOf();if(a.toString!==Object.prototype.toString&&typeof a.toString=="function"&&typeof o.toString=="function")return a.toString()===o.toString();if(u=Object.keys(a),l=u.length,l!==Object.keys(o).length)return!1;for(c=l;c--!==0;)if(!Object.prototype.hasOwnProperty.call(o,u[c]))return!1;if(e&&a instanceof Element)return!1;for(c=l;c--!==0;)if(!((u[c]==="_owner"||u[c]==="__v"||u[c]==="__o")&&a.$$typeof)&&!s(a[u[c]],o[u[c]]))return!1;return!0}return a!==a&&o!==o}return RY=function(o,l){try{return s(o,l)}catch(c){if((c.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw c}},RY}var wsn=vsn();const Csn=ji(wsn);var LY,nCe;function Ssn(){if(nCe)return LY;nCe=1;var e=function(t,n,r,s,a,o,l,c){if(!t){var u;if(n===void 0)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[r,s,a,o,l,c],f=0;u=new Error(n.replace(/%s/g,function(){return d[f++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};return LY=e,LY}var Nsn=Ssn();const rCe=ji(Nsn);var DY,sCe;function Asn(){return sCe||(sCe=1,DY=function(t,n,r,s){var a=r?r.call(s,t,n):void 0;if(a!==void 0)return!!a;if(t===n)return!0;if(typeof t!="object"||!t||typeof n!="object"||!n)return!1;var o=Object.keys(t),l=Object.keys(n);if(o.length!==l.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(n),u=0;u<o.length;u++){var d=o[u];if(!c(d))return!1;var f=t[d],x=n[d];if(a=r?r.call(s,f,x,d):void 0,a===!1||a===void 0&&f!==x)return!1}return!0}),DY}var jsn=Asn();const Esn=ji(jsn);var FUe=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(FUe||{}),BY={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},iCe=Object.values(FUe),Pce={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},_sn=Object.entries(Pce).reduce((e,[t,n])=>(e[n]=t,e),{}),tm="data-rh",p4={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},m4=(e,t)=>{for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},ksn=e=>{let t=m4(e,"title");const n=m4(e,p4.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,()=>t);const r=m4(e,p4.DEFAULT_TITLE);return t||r||void 0},Tsn=e=>m4(e,p4.ON_CHANGE_CLIENT_STATE)||(()=>{}),$Y=(e,t)=>t.filter(n=>typeof n[e]<"u").map(n=>n[e]).reduce((n,r)=>({...n,...r}),{}),Isn=(e,t)=>t.filter(n=>typeof n.base<"u").map(n=>n.base).reverse().reduce((n,r)=>{if(!n.length){const s=Object.keys(r);for(let a=0;a<s.length;a+=1){const l=s[a].toLowerCase();if(e.indexOf(l)!==-1&&r[l])return n.concat(r)}}return n},[]),Psn=e=>console&&typeof console.warn=="function"&&console.warn(e),z7=(e,t,n)=>{const r={};return n.filter(s=>Array.isArray(s[e])?!0:(typeof s[e]<"u"&&Psn(`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`),!1)).map(s=>s[e]).reverse().reduce((s,a)=>{const o={};a.filter(c=>{let u;const d=Object.keys(c);for(let x=0;x<d.length;x+=1){const g=d[x],v=g.toLowerCase();t.indexOf(v)!==-1&&!(u==="rel"&&c[u].toLowerCase()==="canonical")&&!(v==="rel"&&c[v].toLowerCase()==="stylesheet")&&(u=v),t.indexOf(g)!==-1&&(g==="innerHTML"||g==="cssText"||g==="itemprop")&&(u=g)}if(!u||!c[u])return!1;const f=c[u].toLowerCase();return r[u]||(r[u]={}),o[u]||(o[u]={}),r[u][f]?!1:(o[u][f]=!0,!0)}).reverse().forEach(c=>s.push(c));const l=Object.keys(o);for(let c=0;c<l.length;c+=1){const u=l[c],d={...r[u],...o[u]};r[u]=d}return s},[]).reverse()},Fsn=(e,t)=>{if(Array.isArray(e)&&e.length){for(let n=0;n<e.length;n+=1)if(e[n][t])return!0}return!1},Osn=e=>({baseTag:Isn(["href"],e),bodyAttributes:$Y("bodyAttributes",e),defer:m4(e,p4.DEFER),encode:m4(e,p4.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:$Y("htmlAttributes",e),linkTags:z7("link",["rel","href"],e),metaTags:z7("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:z7("noscript",["innerHTML"],e),onChangeClientState:Tsn(e),scriptTags:z7("script",["src","innerHTML"],e),styleTags:z7("style",["cssText"],e),title:ksn(e),titleAttributes:$Y("titleAttributes",e),prioritizeSeoTags:Fsn(e,p4.PRIORITIZE_SEO_TAGS)}),OUe=e=>Array.isArray(e)?e.join(""):e,Msn=(e,t)=>{const n=Object.keys(e);for(let r=0;r<n.length;r+=1)if(t[n[r]]&&t[n[r]].includes(e[n[r]]))return!0;return!1},UY=(e,t)=>Array.isArray(e)?e.reduce((n,r)=>(Msn(r,t)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:e,priority:[]},aCe=(e,t)=>({...e,[t]:void 0}),Rsn=["noscript","script","style"],jne=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"),MUe=e=>Object.keys(e).reduce((t,n)=>{const r=typeof e[n]<"u"?`${n}="${e[n]}"`:`${n}`;return t?`${t} ${r}`:r},""),Lsn=(e,t,n,r)=>{const s=MUe(n),a=OUe(t);return s?`<${e} ${tm}="true" ${s}>${jne(a,r)}</${e}>`:`<${e} ${tm}="true">${jne(a,r)}</${e}>`},Dsn=(e,t,n=!0)=>t.reduce((r,s)=>{const a=s,o=Object.keys(a).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,d)=>{const f=typeof a[d]>"u"?d:`${d}="${jne(a[d],n)}"`;return u?`${u} ${f}`:f},""),l=a.innerHTML||a.cssText||"",c=Rsn.indexOf(e)===-1;return`${r}<${e} ${tm}="true" ${o}${c?"/>":`>${l}</${e}>`}`},""),RUe=(e,t={})=>Object.keys(e).reduce((n,r)=>{const s=Pce[r];return n[s||r]=e[r],n},t),Bsn=(e,t,n)=>{const r={key:t,[tm]:!0},s=RUe(n,r);return[Se.createElement("title",s,t)]},yO=(e,t)=>t.map((n,r)=>{const s={key:r,[tm]:!0};return Object.keys(n).forEach(a=>{const l=Pce[a]||a;if(l==="innerHTML"||l==="cssText"){const c=n.innerHTML||n.cssText;s.dangerouslySetInnerHTML={__html:c}}else s[l]=n[a]}),Se.createElement(e,s)}),_h=(e,t,n=!0)=>{switch(e){case"title":return{toComponent:()=>Bsn(e,t.title,t.titleAttributes),toString:()=>Lsn(e,t.title,t.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>RUe(t),toString:()=>MUe(t)};default:return{toComponent:()=>yO(e,t),toString:()=>Dsn(e,t,n)}}},$sn=({metaTags:e,linkTags:t,scriptTags:n,encode:r})=>{const s=UY(e,BY.meta),a=UY(t,BY.link),o=UY(n,BY.script);return{priorityMethods:{toComponent:()=>[...yO("meta",s.priority),...yO("link",a.priority),...yO("script",o.priority)],toString:()=>`${_h("meta",s.priority,r)} ${_h("link",a.priority,r)} ${_h("script",o.priority,r)}`},metaTags:s.default,linkTags:a.default,scriptTags:o.default}},Usn=e=>{const{baseTag:t,bodyAttributes:n,encode:r=!0,htmlAttributes:s,noscriptTags:a,styleTags:o,title:l="",titleAttributes:c,prioritizeSeoTags:u}=e;let{linkTags:d,metaTags:f,scriptTags:x}=e,g={toComponent:()=>{},toString:()=>""};return u&&({priorityMethods:g,linkTags:d,metaTags:f,scriptTags:x}=$sn(e)),{priority:g,base:_h("base",t,r),bodyAttributes:_h("bodyAttributes",n,r),htmlAttributes:_h("htmlAttributes",s,r),link:_h("link",d,r),meta:_h("meta",f,r),noscript:_h("noscript",a,r),script:_h("script",x,r),style:_h("style",o,r),title:_h("title",{title:l,titleAttributes:c},r)}},LUe=Usn,RP=[],DUe=!!(typeof window<"u"&&window.document&&window.document.createElement),Ene=class{constructor(e,t){Un(this,"instances",[]);Un(this,"canUseDOM",DUe);Un(this,"context");Un(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?RP:this.instances,add:e=>{(this.canUseDOM?RP:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?RP:this.instances).indexOf(e);(this.canUseDOM?RP:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=LUe({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},zsn={},BUe=Se.createContext(zsn),Dw,Io=(Dw=class extends m.Component{constructor(n){super(n);Un(this,"helmetData");this.helmetData=new Ene(this.props.context||{},Dw.canUseDOM)}render(){return Se.createElement(BUe.Provider,{value:this.helmetData.value},this.props.children)}},Un(Dw,"canUseDOM",DUe),Dw),sC=(e,t)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll(`${e}[${tm}]`),s=[].slice.call(r),a=[];let o;return t&&t.length&&t.forEach(l=>{const c=document.createElement(e);for(const u in l)if(Object.prototype.hasOwnProperty.call(l,u))if(u==="innerHTML")c.innerHTML=l.innerHTML;else if(u==="cssText")c.styleSheet?c.styleSheet.cssText=l.cssText:c.appendChild(document.createTextNode(l.cssText));else{const d=u,f=typeof l[d]>"u"?"":l[d];c.setAttribute(u,f)}c.setAttribute(tm,"true"),s.some((u,d)=>(o=d,c.isEqualNode(u)))?s.splice(o,1):a.push(c)}),s.forEach(l=>{var c;return(c=l.parentNode)==null?void 0:c.removeChild(l)}),a.forEach(l=>n.appendChild(l)),{oldTags:s,newTags:a}},_ne=(e,t)=>{const n=document.getElementsByTagName(e)[0];if(!n)return;const r=n.getAttribute(tm),s=r?r.split(","):[],a=[...s],o=Object.keys(t);for(const l of o){const c=t[l]||"";n.getAttribute(l)!==c&&n.setAttribute(l,c),s.indexOf(l)===-1&&s.push(l);const u=a.indexOf(l);u!==-1&&a.splice(u,1)}for(let l=a.length-1;l>=0;l-=1)n.removeAttribute(a[l]);s.length===a.length?n.removeAttribute(tm):n.getAttribute(tm)!==o.join(",")&&n.setAttribute(tm,o.join(","))},Hsn=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=OUe(e)),_ne("title",t)},oCe=(e,t)=>{const{baseTag:n,bodyAttributes:r,htmlAttributes:s,linkTags:a,metaTags:o,noscriptTags:l,onChangeClientState:c,scriptTags:u,styleTags:d,title:f,titleAttributes:x}=e;_ne("body",r),_ne("html",s),Hsn(f,x);const g={baseTag:sC("base",n),linkTags:sC("link",a),metaTags:sC("meta",o),noscriptTags:sC("noscript",l),scriptTags:sC("script",u),styleTags:sC("style",d)},v={},w={};Object.keys(g).forEach(C=>{const{newTags:N,oldTags:I}=g[C];N.length&&(v[C]=N),I.length&&(w[C]=g[C].oldTags)}),t&&t(),c(e,v,w)},H7=null,Vsn=e=>{H7&&cancelAnimationFrame(H7),e.defer?H7=requestAnimationFrame(()=>{oCe(e,()=>{H7=null})}):(oCe(e),H7=null)},Wsn=Vsn,lCe=class extends m.Component{constructor(){super(...arguments);Un(this,"rendered",!1)}shouldComponentUpdate(t){return!Esn(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let r=null;const s=Osn(t.get().map(a=>{const o={...a.props};return delete o.context,o}));Io.canUseDOM?Wsn(s):r=LUe(s),n(r)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},aQ,$o=(aQ=class extends m.Component{shouldComponentUpdate(e){return!Csn(aCe(this.props,"helmetData"),aCe(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,n,r){return{...t,[e.type]:[...t[e.type]||[],{...n,...this.mapNestedChildrenToProps(e,r)}]}}mapObjectTypeChildren(e,t,n,r){switch(e.type){case"title":return{...t,[e.type]:r,titleAttributes:{...n}};case"body":return{...t,bodyAttributes:{...n}};case"html":return{...t,htmlAttributes:{...n}};default:return{...t,[e.type]:{...n}}}}mapArrayTypeChildrenToProps(e,t){let n={...t};return Object.keys(e).forEach(r=>{n={...n,[r]:e[r]}}),n}warnOnInvalidChildren(e,t){return rCe(iCe.some(n=>e.type===n),typeof e.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${iCe.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),rCe(!t||typeof t=="string"||Array.isArray(t)&&!t.some(n=>typeof n!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let n={};return Se.Children.forEach(e,r=>{if(!r||!r.props)return;const{children:s,...a}=r.props,o=Object.keys(a).reduce((c,u)=>(c[_sn[u]||u]=a[u],c),{});let{type:l}=r;switch(typeof l=="symbol"?l=l.toString():this.warnOnInvalidChildren(r,s),l){case"Symbol(react.fragment)":t=this.mapChildrenToProps(s,t);break;case"link":case"meta":case"noscript":case"script":case"style":n=this.flattenArrayTypeChildren(r,n,o,s);break;default:t=this.mapObjectTypeChildren(r,t,o,s);break}}),this.mapArrayTypeChildrenToProps(n,t)}render(){const{children:e,...t}=this.props;let n={...t},{helmetData:r}=t;if(e&&(n=this.mapChildrenToProps(e,n)),r&&!(r instanceof Ene)){const s=r;r=new Ene(s.context,!0),delete n.helmetData}return r?Se.createElement(lCe,{...n,context:r.value}):Se.createElement(BUe.Consumer,null,s=>Se.createElement(lCe,{...n,context:s}))}},Un(aQ,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),aQ);const qsn=()=>{const[e,t]=m.useState(1),[n,r]=m.useState("-"),[s,a]=m.useState("-"),o=0,[l,c]=m.useState(o),u=[{index:0,name:"1D",value:1},{index:1,name:"7D",value:7},{index:2,name:"30D",value:30},{index:3,name:"90D",value:90},{index:4,name:"All",value:999}],d=parseInt(localStorage.getItem("discover_period")),f=!isNaN(d)&&u[d]?u[d].value:u[1].value,[x,g]=m.useState(f),v=w=>{g(Number(w)),localStorage.setItem("discover_period",u.findIndex(C=>C.value===Number(w)).toFixed(0))};return i.jsxs(i.Fragment,{children:[i.jsx(Io,{children:i.jsxs($o,{children:[i.jsx("title",{children:"Discover Top HyperLiquid Wallets for Copy Trading - Dextrabot"}),i.jsx("meta",{name:"description",content:"Find and analyze the best HyperLiquid wallets for copy trading. Use powerful filters to discover profitable traders and automate your trades effortlessly."}),i.jsx("meta",{name:"og:title",content:"Discover Top HyperLiquid Wallets for Copy Trading - Dextrabot"}),i.jsx("meta",{name:"og:description",content:"Find and analyze the best HyperLiquid wallets for copy trading. Use powerful filters to discover profitable traders and automate your trades effortlessly."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/discover-wallets"})]})}),i.jsx("div",{className:"flex flex-col items-stretch justify-start  sm:justify-center text-white w-full bg-[#161616] overflow-hidden min-h-[calc(100vh)] sm:min-h-[calc(100vh-5rem)] sm:h-[calc(100vh-5rem)] overflow-y-auto sm:pb-0",children:i.jsx(ysn,{currentPage:e,setCurrentPage:t,offset:l,setOffset:c,totalPage:n,totalWalletCount:s,setTotalPage:r,setTotalWalletCount:a,period:x,periods:u,handlePeriodChange:v})})]})},ci=({title:e,sortKey:t,sortOption:n,setSortOption:r,isFilterIcon:s})=>{const a=()=>{r(n===`-${t}`?t:`-${t}`)};return i.jsx(i.Fragment,{children:i.jsxs("div",{onClick:()=>a(),className:`${e==="Wallet"?"sm:sticky left-0 h-8":s?"justify-end":"justify-start"} flex items-center gap-1 min-w-max font-manrope`,children:[i.jsx("div",{className:`${n.includes(t)?"text-white":""} cursor-pointer flex items-center justify-end group`,children:e}),i.jsx(cU,{sortKey:t,state:n,className:""})]})})};var LP={},DP={exports:{}};/*!
 * ApexCharts v3.54.1
 * (c) 2018-2024 ApexCharts
 * Released under the MIT License.
 */var cCe;function Gsn(){return cCe||(cCe=1,function(e,t){function n(Ee,p){(p==null||p>Ee.length)&&(p=Ee.length);for(var h=0,S=Array(p);h<p;h++)S[h]=Ee[h];return S}function r(Ee){if(Ee===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Ee}function s(Ee,p){if(!(Ee instanceof p))throw new TypeError("Cannot call a class as a function")}function a(Ee,p){for(var h=0;h<p.length;h++){var S=p[h];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(Ee,I(S.key),S)}}function o(Ee,p,h){return p&&a(Ee.prototype,p),h&&a(Ee,h),Object.defineProperty(Ee,"prototype",{writable:!1}),Ee}function l(Ee,p){var h=typeof Symbol<"u"&&Ee[Symbol.iterator]||Ee["@@iterator"];if(!h){if(Array.isArray(Ee)||(h=R(Ee))||p){h&&(Ee=h);var S=0,_=function(){};return{s:_,n:function(){return S>=Ee.length?{done:!0}:{done:!1,value:Ee[S++]}},e:function(q){throw q},f:_}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var k,T=!0,B=!1;return{s:function(){h=h.call(Ee)},n:function(){var q=h.next();return T=q.done,q},e:function(q){B=!0,k=q},f:function(){try{T||h.return==null||h.return()}finally{if(B)throw k}}}}function c(Ee){var p=x();return function(){var h,S=d(Ee);if(p){var _=d(this).constructor;h=Reflect.construct(S,arguments,_)}else h=S.apply(this,arguments);return function(k,T){if(T&&(typeof T=="object"||typeof T=="function"))return T;if(T!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return r(k)}(this,h)}}function u(Ee,p,h){return(p=I(p))in Ee?Object.defineProperty(Ee,p,{value:h,enumerable:!0,configurable:!0,writable:!0}):Ee[p]=h,Ee}function d(Ee){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(p){return p.__proto__||Object.getPrototypeOf(p)},d(Ee)}function f(Ee,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");Ee.prototype=Object.create(p&&p.prototype,{constructor:{value:Ee,writable:!0,configurable:!0}}),Object.defineProperty(Ee,"prototype",{writable:!1}),p&&w(Ee,p)}function x(){try{var Ee=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(x=function(){return!!Ee})()}function g(Ee,p){var h=Object.keys(Ee);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(Ee);p&&(S=S.filter(function(_){return Object.getOwnPropertyDescriptor(Ee,_).enumerable})),h.push.apply(h,S)}return h}function v(Ee){for(var p=1;p<arguments.length;p++){var h=arguments[p]!=null?arguments[p]:{};p%2?g(Object(h),!0).forEach(function(S){u(Ee,S,h[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Ee,Object.getOwnPropertyDescriptors(h)):g(Object(h)).forEach(function(S){Object.defineProperty(Ee,S,Object.getOwnPropertyDescriptor(h,S))})}return Ee}function w(Ee,p){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(h,S){return h.__proto__=S,h},w(Ee,p)}function C(Ee,p){return function(h){if(Array.isArray(h))return h}(Ee)||function(h,S){var _=h==null?null:typeof Symbol<"u"&&h[Symbol.iterator]||h["@@iterator"];if(_!=null){var k,T,B,q,te=[],ue=!0,de=!1;try{if(B=(_=_.call(h)).next,S===0){if(Object(_)!==_)return;ue=!1}else for(;!(ue=(k=B.call(_)).done)&&(te.push(k.value),te.length!==S);ue=!0);}catch(xe){de=!0,T=xe}finally{try{if(!ue&&_.return!=null&&(q=_.return(),Object(q)!==q))return}finally{if(de)throw T}}return te}}(Ee,p)||R(Ee,p)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function N(Ee){return function(p){if(Array.isArray(p))return n(p)}(Ee)||function(p){if(typeof Symbol<"u"&&p[Symbol.iterator]!=null||p["@@iterator"]!=null)return Array.from(p)}(Ee)||R(Ee)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function I(Ee){var p=function(h,S){if(typeof h!="object"||!h)return h;var _=h[Symbol.toPrimitive];if(_!==void 0){var k=_.call(h,S||"default");if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(h)}(Ee,"string");return typeof p=="symbol"?p:p+""}function P(Ee){return P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},P(Ee)}function R(Ee,p){if(Ee){if(typeof Ee=="string")return n(Ee,p);var h={}.toString.call(Ee).slice(8,-1);return h==="Object"&&Ee.constructor&&(h=Ee.constructor.name),h==="Map"||h==="Set"?Array.from(Ee):h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h)?n(Ee,p):void 0}}var F=function(){function Ee(){s(this,Ee)}return o(Ee,[{key:"shadeRGBColor",value:function(p,h){var S=h.split(","),_=p<0?0:255,k=p<0?-1*p:p,T=parseInt(S[0].slice(4),10),B=parseInt(S[1],10),q=parseInt(S[2],10);return"rgb("+(Math.round((_-T)*k)+T)+","+(Math.round((_-B)*k)+B)+","+(Math.round((_-q)*k)+q)+")"}},{key:"shadeHexColor",value:function(p,h){var S=parseInt(h.slice(1),16),_=p<0?0:255,k=p<0?-1*p:p,T=S>>16,B=S>>8&255,q=255&S;return"#"+(16777216+65536*(Math.round((_-T)*k)+T)+256*(Math.round((_-B)*k)+B)+(Math.round((_-q)*k)+q)).toString(16).slice(1)}},{key:"shadeColor",value:function(p,h){return Ee.isColorHex(h)?this.shadeHexColor(p,h):this.shadeRGBColor(p,h)}}],[{key:"bind",value:function(p,h){return function(){return p.apply(h,arguments)}}},{key:"isObject",value:function(p){return p&&P(p)==="object"&&!Array.isArray(p)&&p!=null}},{key:"is",value:function(p,h){return Object.prototype.toString.call(h)==="[object "+p+"]"}},{key:"listToArray",value:function(p){var h,S=[];for(h=0;h<p.length;h++)S[h]=p[h];return S}},{key:"extend",value:function(p,h){var S=this;typeof Object.assign!="function"&&(Object.assign=function(k){if(k==null)throw new TypeError("Cannot convert undefined or null to object");for(var T=Object(k),B=1;B<arguments.length;B++){var q=arguments[B];if(q!=null)for(var te in q)q.hasOwnProperty(te)&&(T[te]=q[te])}return T});var _=Object.assign({},p);return this.isObject(p)&&this.isObject(h)&&Object.keys(h).forEach(function(k){S.isObject(h[k])&&k in p?_[k]=S.extend(p[k],h[k]):Object.assign(_,u({},k,h[k]))}),_}},{key:"extendArray",value:function(p,h){var S=[];return p.map(function(_){S.push(Ee.extend(h,_))}),p=S}},{key:"monthMod",value:function(p){return p%12}},{key:"clone",value:function(p){if(Ee.is("Array",p)){for(var h=[],S=0;S<p.length;S++)h[S]=this.clone(p[S]);return h}if(Ee.is("Null",p))return null;if(Ee.is("Date",p))return p;if(P(p)==="object"){var _={};for(var k in p)p.hasOwnProperty(k)&&(_[k]=this.clone(p[k]));return _}return p}},{key:"log10",value:function(p){return Math.log(p)/Math.LN10}},{key:"roundToBase10",value:function(p){return Math.pow(10,Math.floor(Math.log10(p)))}},{key:"roundToBase",value:function(p,h){return Math.pow(h,Math.floor(Math.log(p)/Math.log(h)))}},{key:"parseNumber",value:function(p){return p===null?p:parseFloat(p)}},{key:"stripNumber",value:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return Number.isInteger(p)?p:parseFloat(p.toPrecision(h))}},{key:"randomId",value:function(){return(Math.random()+1).toString(36).substring(4)}},{key:"noExponents",value:function(p){var h=String(p).split(/[eE]/);if(h.length===1)return h[0];var S="",_=p<0?"-":"",k=h[0].replace(".",""),T=Number(h[1])+1;if(T<0){for(S=_+"0.";T++;)S+="0";return S+k.replace(/^-/,"")}for(T-=k.length;T--;)S+="0";return k+S}},{key:"getDimensions",value:function(p){var h=getComputedStyle(p,null),S=p.clientHeight,_=p.clientWidth;return S-=parseFloat(h.paddingTop)+parseFloat(h.paddingBottom),[_-=parseFloat(h.paddingLeft)+parseFloat(h.paddingRight),S]}},{key:"getBoundingClientRect",value:function(p){var h=p.getBoundingClientRect();return{top:h.top,right:h.right,bottom:h.bottom,left:h.left,width:p.clientWidth,height:p.clientHeight,x:h.left,y:h.top}}},{key:"getLargestStringFromArr",value:function(p){return p.reduce(function(h,S){return Array.isArray(S)&&(S=S.reduce(function(_,k){return _.length>k.length?_:k})),h.length>S.length?h:S},0)}},{key:"hexToRgba",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"#999999",h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:.6;p.substring(0,1)!=="#"&&(p="#999999");var S=p.replace("#","");S=S.match(new RegExp("(.{"+S.length/3+"})","g"));for(var _=0;_<S.length;_++)S[_]=parseInt(S[_].length===1?S[_]+S[_]:S[_],16);return h!==void 0&&S.push(h),"rgba("+S.join(",")+")"}},{key:"getOpacityFromRGBA",value:function(p){return parseFloat(p.replace(/^.*,(.+)\)/,"$1"))}},{key:"rgb2hex",value:function(p){return(p=p.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&p.length===4?"#"+("0"+parseInt(p[1],10).toString(16)).slice(-2)+("0"+parseInt(p[2],10).toString(16)).slice(-2)+("0"+parseInt(p[3],10).toString(16)).slice(-2):""}},{key:"isColorHex",value:function(p){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)/i.test(p)}},{key:"getPolygonPos",value:function(p,h){for(var S=[],_=2*Math.PI/h,k=0;k<h;k++){var T={};T.x=p*Math.sin(k*_),T.y=-p*Math.cos(k*_),S.push(T)}return S}},{key:"polarToCartesian",value:function(p,h,S,_){var k=(_-90)*Math.PI/180;return{x:p+S*Math.cos(k),y:h+S*Math.sin(k)}}},{key:"escapeString",value:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"x",S=p.toString().slice();return S=S.replace(/[` ~!@#$%^&*()|+\=?;:'",.<>{}[\]\\/]/gi,h)}},{key:"negToZero",value:function(p){return p<0?0:p}},{key:"moveIndexInArray",value:function(p,h,S){if(S>=p.length)for(var _=S-p.length+1;_--;)p.push(void 0);return p.splice(S,0,p.splice(h,1)[0]),p}},{key:"extractNumber",value:function(p){return parseFloat(p.replace(/[^\d.]*/g,""))}},{key:"findAncestor",value:function(p,h){for(;(p=p.parentElement)&&!p.classList.contains(h););return p}},{key:"setELstyles",value:function(p,h){for(var S in h)h.hasOwnProperty(S)&&(p.style.key=h[S])}},{key:"preciseAddition",value:function(p,h){var S=(String(p).split(".")[1]||"").length,_=(String(h).split(".")[1]||"").length,k=Math.pow(10,Math.max(S,_));return(Math.round(p*k)+Math.round(h*k))/k}},{key:"isNumber",value:function(p){return!isNaN(p)&&parseFloat(Number(p))===p&&!isNaN(parseInt(p,10))}},{key:"isFloat",value:function(p){return Number(p)===p&&p%1!=0}},{key:"isSafari",value:function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}},{key:"isFirefox",value:function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1}},{key:"isMsEdge",value:function(){var p=window.navigator.userAgent,h=p.indexOf("Edge/");return h>0&&parseInt(p.substring(h+5,p.indexOf(".",h)),10)}},{key:"getGCD",value:function(p,h){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:7,_=Math.pow(10,S-Math.floor(Math.log10(Math.max(p,h))));for(p=Math.round(Math.abs(p)*_),h=Math.round(Math.abs(h)*_);h;){var k=h;h=p%h,p=k}return p/_}},{key:"getPrimeFactors",value:function(p){for(var h=[],S=2;p>=2;)p%S==0?(h.push(S),p/=S):S++;return h}},{key:"mod",value:function(p,h){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:7,_=Math.pow(10,S-Math.floor(Math.log10(Math.max(p,h))));return(p=Math.round(Math.abs(p)*_))%(h=Math.round(Math.abs(h)*_))/_}}]),Ee}(),U=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.setEasingFunctions()}return o(Ee,[{key:"setEasingFunctions",value:function(){var p;if(!this.w.globals.easing){switch(this.w.config.chart.animations.easing){case"linear":p="-";break;case"easein":p="<";break;case"easeout":p=">";break;case"easeinout":default:p="<>";break;case"swing":p=function(h){var S=1.70158;return(h-=1)*h*((S+1)*h+S)+1};break;case"bounce":p=function(h){return h<1/2.75?7.5625*h*h:h<2/2.75?7.5625*(h-=1.5/2.75)*h+.75:h<2.5/2.75?7.5625*(h-=2.25/2.75)*h+.9375:7.5625*(h-=2.625/2.75)*h+.984375};break;case"elastic":p=function(h){return h===!!h?h:Math.pow(2,-10*h)*Math.sin((h-.075)*(2*Math.PI)/.3)+1}}this.w.globals.easing=p}}},{key:"animateLine",value:function(p,h,S,_){p.attr(h).animate(_).attr(S)}},{key:"animateMarker",value:function(p,h,S,_){p.attr({opacity:0}).animate(h,S).attr({opacity:1}).afterAll(function(){_()})}},{key:"animateRect",value:function(p,h,S,_,k){p.attr(h).animate(_).attr(S).afterAll(function(){return k()})}},{key:"animatePathsGradually",value:function(p){var h=p.el,S=p.realIndex,_=p.j,k=p.fill,T=p.pathFrom,B=p.pathTo,q=p.speed,te=p.delay,ue=this.w,de=0;ue.config.chart.animations.animateGradually.enabled&&(de=ue.config.chart.animations.animateGradually.delay),ue.config.chart.animations.dynamicAnimation.enabled&&ue.globals.dataChanged&&ue.config.chart.type!=="bar"&&(de=0),this.morphSVG(h,S,_,ue.config.chart.type!=="line"||ue.globals.comboCharts?k:"stroke",T,B,q,te*de)}},{key:"showDelayedElements",value:function(){this.w.globals.delayedElements.forEach(function(p){var h=p.el;h.classList.remove("apexcharts-element-hidden"),h.classList.add("apexcharts-hidden-element-shown")})}},{key:"animationCompleted",value:function(p){var h=this.w;h.globals.animationEnded||(h.globals.animationEnded=!0,this.showDelayedElements(),typeof h.config.chart.events.animationEnd=="function"&&h.config.chart.events.animationEnd(this.ctx,{el:p,w:h}))}},{key:"morphSVG",value:function(p,h,S,_,k,T,B,q){var te=this,ue=this.w;k||(k=p.attr("pathFrom")),T||(T=p.attr("pathTo"));var de=function(xe){return ue.config.chart.type==="radar"&&(B=1),"M 0 ".concat(ue.globals.gridHeight)};(!k||k.indexOf("undefined")>-1||k.indexOf("NaN")>-1)&&(k=de()),(!T||T.indexOf("undefined")>-1||T.indexOf("NaN")>-1)&&(T=de()),ue.globals.shouldAnimate||(B=1),p.plot(k).animate(1,ue.globals.easing,q).plot(k).animate(B,ue.globals.easing,q).plot(T).afterAll(function(){F.isNumber(S)?S===ue.globals.series[ue.globals.maxValsInArrayIndex].length-2&&ue.globals.shouldAnimate&&te.animationCompleted(p):_!=="none"&&ue.globals.shouldAnimate&&(!ue.globals.comboCharts&&h===ue.globals.series.length-1||ue.globals.comboCharts)&&te.animationCompleted(p),te.showDelayedElements()})}}]),Ee}(),L=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"getDefaultFilter",value:function(p,h){var S=this.w;p.unfilter(!0),new window.SVG.Filter().size("120%","180%","-5%","-40%"),S.config.states.normal.filter!=="none"?this.applyFilter(p,h,S.config.states.normal.filter.type,S.config.states.normal.filter.value):S.config.chart.dropShadow.enabled&&this.dropShadow(p,S.config.chart.dropShadow,h)}},{key:"addNormalFilter",value:function(p,h){var S=this.w;S.config.chart.dropShadow.enabled&&!p.node.classList.contains("apexcharts-marker")&&this.dropShadow(p,S.config.chart.dropShadow,h)}},{key:"addLightenFilter",value:function(p,h,S){var _=this,k=this.w,T=S.intensity;p.unfilter(!0),new window.SVG.Filter,p.filter(function(B){var q=k.config.chart.dropShadow;(q.enabled?_.addShadow(B,h,q):B).componentTransfer({rgb:{type:"linear",slope:1.5,intercept:T}})}),p.filterer.node.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(p.filterer.node)}},{key:"addDarkenFilter",value:function(p,h,S){var _=this,k=this.w,T=S.intensity;p.unfilter(!0),new window.SVG.Filter,p.filter(function(B){var q=k.config.chart.dropShadow;(q.enabled?_.addShadow(B,h,q):B).componentTransfer({rgb:{type:"linear",slope:T}})}),p.filterer.node.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(p.filterer.node)}},{key:"applyFilter",value:function(p,h,S){var _=arguments.length>3&&arguments[3]!==void 0?arguments[3]:.5;switch(S){case"none":this.addNormalFilter(p,h);break;case"lighten":this.addLightenFilter(p,h,{intensity:_});break;case"darken":this.addDarkenFilter(p,h,{intensity:_})}}},{key:"addShadow",value:function(p,h,S){var _,k=this.w,T=S.blur,B=S.top,q=S.left,te=S.color,ue=S.opacity;if(((_=k.config.chart.dropShadow.enabledOnSeries)===null||_===void 0?void 0:_.length)>0&&k.config.chart.dropShadow.enabledOnSeries.indexOf(h)===-1)return p;var de=p.flood(Array.isArray(te)?te[h]:te,ue).composite(p.sourceAlpha,"in").offset(q,B).gaussianBlur(T).merge(p.source);return p.blend(p.source,de)}},{key:"dropShadow",value:function(p,h){var S,_,k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,T=h.top,B=h.left,q=h.blur,te=h.color,ue=h.opacity,de=h.noUserSpaceOnUse,xe=this.w;return p.unfilter(!0),F.isMsEdge()&&xe.config.chart.type==="radialBar"||((S=xe.config.chart.dropShadow.enabledOnSeries)===null||S===void 0?void 0:S.length)>0&&((_=xe.config.chart.dropShadow.enabledOnSeries)===null||_===void 0?void 0:_.indexOf(k))===-1||(te=Array.isArray(te)?te[k]:te,p.filter(function(we){var ke=null;ke=F.isSafari()||F.isFirefox()||F.isMsEdge()?we.flood(te,ue).composite(we.sourceAlpha,"in").offset(B,T).gaussianBlur(q):we.flood(te,ue).composite(we.sourceAlpha,"in").offset(B,T).gaussianBlur(q).merge(we.source),we.blend(we.source,ke)}),de||p.filterer.node.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(p.filterer.node)),p}},{key:"setSelectionFilter",value:function(p,h,S){var _=this.w;if(_.globals.selectedDataPoints[h]!==void 0&&_.globals.selectedDataPoints[h].indexOf(S)>-1){p.node.setAttribute("selected",!0);var k=_.config.states.active.filter;k!=="none"&&this.applyFilter(p,h,k.type,k.value)}}},{key:"_scaleFilterSize",value:function(p){(function(h){for(var S in h)h.hasOwnProperty(S)&&p.setAttribute(S,h[S])})({width:"200%",height:"200%",x:"-50%",y:"-50%"})}}]),Ee}(),z=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"roundPathCorners",value:function(p,h){function S(nt,ot,gt){var Jt=ot.x-nt.x,Ge=ot.y-nt.y,et=Math.sqrt(Jt*Jt+Ge*Ge);return _(nt,ot,Math.min(1,gt/et))}function _(nt,ot,gt){return{x:nt.x+(ot.x-nt.x)*gt,y:nt.y+(ot.y-nt.y)*gt}}function k(nt,ot){nt.length>2&&(nt[nt.length-2]=ot.x,nt[nt.length-1]=ot.y)}function T(nt){return{x:parseFloat(nt[nt.length-2]),y:parseFloat(nt[nt.length-1])}}p.indexOf("NaN")>-1&&(p="");var B=p.split(/[,\s]/).reduce(function(nt,ot){var gt=ot.match("([a-zA-Z])(.+)");return gt?(nt.push(gt[1]),nt.push(gt[2])):nt.push(ot),nt},[]).reduce(function(nt,ot){return parseFloat(ot)==ot&&nt.length?nt[nt.length-1].push(ot):nt.push([ot]),nt},[]),q=[];if(B.length>1){var te=T(B[0]),ue=null;B[B.length-1][0]=="Z"&&B[0].length>2&&(ue=["L",te.x,te.y],B[B.length-1]=ue),q.push(B[0]);for(var de=1;de<B.length;de++){var xe=q[q.length-1],we=B[de],ke=we==ue?B[1]:B[de+1];if(ke&&xe&&xe.length>2&&we[0]=="L"&&ke.length>2&&ke[0]=="L"){var Me,Ye,Fe=T(xe),rt=T(we),se=T(ke);Me=S(rt,Fe,h),Ye=S(rt,se,h),k(we,Me),we.origPoint=rt,q.push(we);var Ce=_(Me,rt,.5),De=_(rt,Ye,.5),Le=["C",Ce.x,Ce.y,De.x,De.y,Ye.x,Ye.y];Le.origPoint=rt,q.push(Le)}else q.push(we)}if(ue){var _e=T(q[q.length-1]);q.push(["Z"]),k(q[0],_e)}}else q=B;return q.reduce(function(nt,ot){return nt+ot.join(" ")+" "},"")}},{key:"drawLine",value:function(p,h,S,_){var k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"#a8a8a8",T=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,B=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null,q=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"butt";return this.w.globals.dom.Paper.line().attr({x1:p,y1:h,x2:S,y2:_,stroke:k,"stroke-dasharray":T,"stroke-width":B,"stroke-linecap":q})}},{key:"drawRect",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,_=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,T=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"#fefefe",B=arguments.length>6&&arguments[6]!==void 0?arguments[6]:1,q=arguments.length>7&&arguments[7]!==void 0?arguments[7]:null,te=arguments.length>8&&arguments[8]!==void 0?arguments[8]:null,ue=arguments.length>9&&arguments[9]!==void 0?arguments[9]:0,de=this.w.globals.dom.Paper.rect();return de.attr({x:p,y:h,width:S>0?S:0,height:_>0?_:0,rx:k,ry:k,opacity:B,"stroke-width":q!==null?q:0,stroke:te!==null?te:"none","stroke-dasharray":ue}),de.node.setAttribute("fill",T),de}},{key:"drawPolygon",value:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"#e1e1e1",S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"none";return this.w.globals.dom.Paper.polygon(p).attr({fill:_,stroke:h,"stroke-width":S})}},{key:"drawCircle",value:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;p<0&&(p=0);var S=this.w.globals.dom.Paper.circle(2*p);return h!==null&&S.attr(h),S}},{key:"drawPath",value:function(p){var h=p.d,S=h===void 0?"":h,_=p.stroke,k=_===void 0?"#a8a8a8":_,T=p.strokeWidth,B=T===void 0?1:T,q=p.fill,te=p.fillOpacity,ue=te===void 0?1:te,de=p.strokeOpacity,xe=de===void 0?1:de,we=p.classes,ke=p.strokeLinecap,Me=ke===void 0?null:ke,Ye=p.strokeDashArray,Fe=Ye===void 0?0:Ye,rt=this.w;return Me===null&&(Me=rt.config.stroke.lineCap),(S.indexOf("undefined")>-1||S.indexOf("NaN")>-1)&&(S="M 0 ".concat(rt.globals.gridHeight)),rt.globals.dom.Paper.path(S).attr({fill:q,"fill-opacity":ue,stroke:k,"stroke-opacity":xe,"stroke-linecap":Me,"stroke-width":B,"stroke-dasharray":Fe,class:we})}},{key:"group",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,h=this.w.globals.dom.Paper.group();return p!==null&&h.attr(p),h}},{key:"move",value:function(p,h){var S=["M",p,h].join(" ");return S}},{key:"line",value:function(p,h){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_=null;return S===null?_=[" L",p,h].join(" "):S==="H"?_=[" H",p].join(" "):S==="V"&&(_=[" V",h].join(" ")),_}},{key:"curve",value:function(p,h,S,_,k,T){var B=["C",p,h,S,_,k,T].join(" ");return B}},{key:"quadraticCurve",value:function(p,h,S,_){return["Q",p,h,S,_].join(" ")}},{key:"arc",value:function(p,h,S,_,k,T,B){var q="A";arguments.length>7&&arguments[7]!==void 0&&arguments[7]&&(q="a");var te=[q,p,h,S,_,k,T,B].join(" ");return te}},{key:"renderPaths",value:function(p){var h,S=p.j,_=p.realIndex,k=p.pathFrom,T=p.pathTo,B=p.stroke,q=p.strokeWidth,te=p.strokeLinecap,ue=p.fill,de=p.animationDelay,xe=p.initialSpeed,we=p.dataChangeSpeed,ke=p.className,Me=p.chartType,Ye=p.shouldClipToGrid,Fe=Ye===void 0||Ye,rt=p.bindEventsOnPaths,se=rt===void 0||rt,Ce=p.drawShadow,De=Ce===void 0||Ce,Le=this.w,_e=new L(this.ctx),nt=new U(this.ctx),ot=this.w.config.chart.animations.enabled,gt=ot&&this.w.config.chart.animations.dynamicAnimation.enabled,Jt=!!(ot&&!Le.globals.resized||gt&&Le.globals.dataChanged&&Le.globals.shouldAnimate);Jt?h=k:(h=T,Le.globals.animationEnded=!0);var Ge=Le.config.stroke.dashArray,et=0;et=Array.isArray(Ge)?Ge[_]:Le.config.stroke.dashArray;var We=this.drawPath({d:h,stroke:B,strokeWidth:q,fill:ue,fillOpacity:1,classes:ke,strokeLinecap:te,strokeDashArray:et});if(We.attr("index",_),Fe&&(Me==="bar"&&!Le.globals.isHorizontal||Le.globals.comboCharts?We.attr({"clip-path":"url(#gridRectBarMask".concat(Le.globals.cuid,")")}):We.attr({"clip-path":"url(#gridRectMask".concat(Le.globals.cuid,")")})),Le.config.states.normal.filter.type!=="none")_e.getDefaultFilter(We,_);else if(Le.config.chart.dropShadow.enabled&&De){var wt=Le.config.chart.dropShadow;_e.dropShadow(We,wt,_)}se&&(We.node.addEventListener("mouseenter",this.pathMouseEnter.bind(this,We)),We.node.addEventListener("mouseleave",this.pathMouseLeave.bind(this,We)),We.node.addEventListener("mousedown",this.pathMouseDown.bind(this,We))),We.attr({pathTo:T,pathFrom:k});var St={el:We,j:S,realIndex:_,pathFrom:k,pathTo:T,fill:ue,strokeWidth:q,delay:de};return!ot||Le.globals.resized||Le.globals.dataChanged?!Le.globals.resized&&Le.globals.dataChanged||nt.showDelayedElements():nt.animatePathsGradually(v(v({},St),{},{speed:xe})),Le.globals.dataChanged&&gt&&Jt&&nt.animatePathsGradually(v(v({},St),{},{speed:we})),We}},{key:"drawPattern",value:function(p,h,S){var _=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"#a8a8a8",k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;return this.w.globals.dom.Paper.pattern(h,S,function(T){p==="horizontalLines"?T.line(0,0,S,0).stroke({color:_,width:k+1}):p==="verticalLines"?T.line(0,0,0,h).stroke({color:_,width:k+1}):p==="slantedLines"?T.line(0,0,h,S).stroke({color:_,width:k}):p==="squares"?T.rect(h,S).fill("none").stroke({color:_,width:k}):p==="circles"&&T.circle(h).fill("none").stroke({color:_,width:k})})}},{key:"drawGradient",value:function(p,h,S,_,k){var T,B=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,q=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null,te=arguments.length>7&&arguments[7]!==void 0?arguments[7]:null,ue=arguments.length>8&&arguments[8]!==void 0?arguments[8]:0,de=this.w;h.length<9&&h.indexOf("#")===0&&(h=F.hexToRgba(h,_)),S.length<9&&S.indexOf("#")===0&&(S=F.hexToRgba(S,k));var xe=0,we=1,ke=1,Me=null;q!==null&&(xe=q[0]!==void 0?q[0]/100:0,we=q[1]!==void 0?q[1]/100:1,ke=q[2]!==void 0?q[2]/100:1,Me=q[3]!==void 0?q[3]/100:null);var Ye=!(de.config.chart.type!=="donut"&&de.config.chart.type!=="pie"&&de.config.chart.type!=="polarArea"&&de.config.chart.type!=="bubble");if(T=te===null||te.length===0?de.globals.dom.Paper.gradient(Ye?"radial":"linear",function(se){se.at(xe,h,_),se.at(we,S,k),se.at(ke,S,k),Me!==null&&se.at(Me,h,_)}):de.globals.dom.Paper.gradient(Ye?"radial":"linear",function(se){(Array.isArray(te[ue])?te[ue]:te).forEach(function(Ce){se.at(Ce.offset/100,Ce.color,Ce.opacity)})}),Ye){var Fe=de.globals.gridWidth/2,rt=de.globals.gridHeight/2;de.config.chart.type!=="bubble"?T.attr({gradientUnits:"userSpaceOnUse",cx:Fe,cy:rt,r:B}):T.attr({cx:.5,cy:.5,r:.8,fx:.2,fy:.2})}else p==="vertical"?T.from(0,0).to(0,1):p==="diagonal"?T.from(0,0).to(1,1):p==="horizontal"?T.from(0,1).to(1,1):p==="diagonal2"&&T.from(1,0).to(0,1);return T}},{key:"getTextBasedOnMaxWidth",value:function(p){var h=p.text,S=p.maxWidth,_=p.fontSize,k=p.fontFamily,T=this.getTextRects(h,_,k),B=T.width/h.length,q=Math.floor(S/B);return S<T.width?h.slice(0,q-3)+"...":h}},{key:"drawText",value:function(p){var h=this,S=p.x,_=p.y,k=p.text,T=p.textAnchor,B=p.fontSize,q=p.fontFamily,te=p.fontWeight,ue=p.foreColor,de=p.opacity,xe=p.maxWidth,we=p.cssClass,ke=we===void 0?"":we,Me=p.isPlainText,Ye=Me===void 0||Me,Fe=p.dominantBaseline,rt=Fe===void 0?"auto":Fe,se=this.w;k===void 0&&(k="");var Ce=k;T||(T="start"),ue&&ue.length||(ue=se.config.chart.foreColor),q=q||se.config.chart.fontFamily,te=te||"regular";var De,Le={maxWidth:xe,fontSize:B=B||"11px",fontFamily:q};return Array.isArray(k)?De=se.globals.dom.Paper.text(function(_e){for(var nt=0;nt<k.length;nt++)Ce=k[nt],xe&&(Ce=h.getTextBasedOnMaxWidth(v({text:k[nt]},Le))),nt===0?_e.tspan(Ce):_e.tspan(Ce).newLine()}):(xe&&(Ce=this.getTextBasedOnMaxWidth(v({text:k},Le))),De=Ye?se.globals.dom.Paper.plain(k):se.globals.dom.Paper.text(function(_e){return _e.tspan(Ce)})),De.attr({x:S,y:_,"text-anchor":T,"dominant-baseline":rt,"font-size":B,"font-family":q,"font-weight":te,fill:ue,class:"apexcharts-text "+ke}),De.node.style.fontFamily=q,De.node.style.opacity=de,De}},{key:"getMarkerPath",value:function(p,h,S,_){var k="";switch(S){case"cross":k="M ".concat(p-(_/=1.4)," ").concat(h-_," L ").concat(p+_," ").concat(h+_,"  M ").concat(p-_," ").concat(h+_," L ").concat(p+_," ").concat(h-_);break;case"plus":k="M ".concat(p-(_/=1.12)," ").concat(h," L ").concat(p+_," ").concat(h,"  M ").concat(p," ").concat(h-_," L ").concat(p," ").concat(h+_);break;case"star":case"sparkle":var T=5;_*=1.15,S==="sparkle"&&(_/=1.1,T=4);for(var B=Math.PI/T,q=0;q<=2*T;q++){var te=q*B,ue=q%2==0?_:_/2;k+=(q===0?"M":"L")+(p+ue*Math.sin(te))+","+(h-ue*Math.cos(te))}k+="Z";break;case"triangle":k="M ".concat(p," ").concat(h-_,` 
             L `).concat(p+_," ").concat(h+_,` 
             L `).concat(p-_," ").concat(h+_,` 
             Z`);break;case"square":case"rect":k="M ".concat(p-(_/=1.125)," ").concat(h-_,` 
           L `).concat(p+_," ").concat(h-_,` 
           L `).concat(p+_," ").concat(h+_,` 
           L `).concat(p-_," ").concat(h+_,` 
           Z`);break;case"diamond":_*=1.05,k="M ".concat(p," ").concat(h-_,` 
             L `).concat(p+_," ").concat(h,` 
             L `).concat(p," ").concat(h+_,` 
             L `).concat(p-_," ").concat(h,` 
            Z`);break;case"line":k="M ".concat(p-(_/=1.1)," ").concat(h,` 
           L `).concat(p+_," ").concat(h);break;default:_*=2,k="M ".concat(p,", ").concat(h,` 
           m -`).concat(_/2,`, 0 
           a `).concat(_/2,",").concat(_/2," 0 1,0 ").concat(_,`,0 
           a `).concat(_/2,",").concat(_/2," 0 1,0 -").concat(_,",0")}return k}},{key:"drawMarkerShape",value:function(p,h,S,_,k){var T=this.drawPath({d:this.getMarkerPath(p,h,S,_,k),stroke:k.pointStrokeColor,strokeDashArray:k.pointStrokeDashArray,strokeWidth:k.pointStrokeWidth,fill:k.pointFillColor,fillOpacity:k.pointFillOpacity,strokeOpacity:k.pointStrokeOpacity});return T.attr({cx:p,cy:h,shape:k.shape,class:k.class?k.class:""}),T}},{key:"drawMarker",value:function(p,h,S){p=p||0;var _=S.pSize||0;return F.isNumber(h)||(_=0,h=0),this.drawMarkerShape(p,h,S==null?void 0:S.shape,_,v(v({},S),S.shape==="line"||S.shape==="plus"||S.shape==="cross"?{pointStrokeColor:S.pointFillColor,pointStrokeOpacity:S.pointFillOpacity}:{}))}},{key:"pathMouseEnter",value:function(p,h){var S=this.w,_=new L(this.ctx),k=parseInt(p.node.getAttribute("index"),10),T=parseInt(p.node.getAttribute("j"),10);if(typeof S.config.chart.events.dataPointMouseEnter=="function"&&S.config.chart.events.dataPointMouseEnter(h,this.ctx,{seriesIndex:k,dataPointIndex:T,w:S}),this.ctx.events.fireEvent("dataPointMouseEnter",[h,this.ctx,{seriesIndex:k,dataPointIndex:T,w:S}]),(S.config.states.active.filter.type==="none"||p.node.getAttribute("selected")!=="true")&&S.config.states.hover.filter.type!=="none"&&!S.globals.isTouchDevice){var B=S.config.states.hover.filter;_.applyFilter(p,k,B.type,B.value)}}},{key:"pathMouseLeave",value:function(p,h){var S=this.w,_=new L(this.ctx),k=parseInt(p.node.getAttribute("index"),10),T=parseInt(p.node.getAttribute("j"),10);typeof S.config.chart.events.dataPointMouseLeave=="function"&&S.config.chart.events.dataPointMouseLeave(h,this.ctx,{seriesIndex:k,dataPointIndex:T,w:S}),this.ctx.events.fireEvent("dataPointMouseLeave",[h,this.ctx,{seriesIndex:k,dataPointIndex:T,w:S}]),S.config.states.active.filter.type!=="none"&&p.node.getAttribute("selected")==="true"||S.config.states.hover.filter.type!=="none"&&_.getDefaultFilter(p,k)}},{key:"pathMouseDown",value:function(p,h){var S=this.w,_=new L(this.ctx),k=parseInt(p.node.getAttribute("index"),10),T=parseInt(p.node.getAttribute("j"),10),B="false";if(p.node.getAttribute("selected")==="true"){if(p.node.setAttribute("selected","false"),S.globals.selectedDataPoints[k].indexOf(T)>-1){var q=S.globals.selectedDataPoints[k].indexOf(T);S.globals.selectedDataPoints[k].splice(q,1)}}else{if(!S.config.states.active.allowMultipleDataPointsSelection&&S.globals.selectedDataPoints.length>0){S.globals.selectedDataPoints=[];var te=S.globals.dom.Paper.select(".apexcharts-series path").members,ue=S.globals.dom.Paper.select(".apexcharts-series circle, .apexcharts-series rect").members,de=function(ke){Array.prototype.forEach.call(ke,function(Me){Me.node.setAttribute("selected","false"),_.getDefaultFilter(Me,k)})};de(te),de(ue)}p.node.setAttribute("selected","true"),B="true",S.globals.selectedDataPoints[k]===void 0&&(S.globals.selectedDataPoints[k]=[]),S.globals.selectedDataPoints[k].push(T)}if(B==="true"){var xe=S.config.states.active.filter;if(xe!=="none")_.applyFilter(p,k,xe.type,xe.value);else if(S.config.states.hover.filter!=="none"&&!S.globals.isTouchDevice){var we=S.config.states.hover.filter;_.applyFilter(p,k,we.type,we.value)}}else S.config.states.active.filter.type!=="none"&&(S.config.states.hover.filter.type==="none"||S.globals.isTouchDevice?_.getDefaultFilter(p,k):(we=S.config.states.hover.filter,_.applyFilter(p,k,we.type,we.value)));typeof S.config.chart.events.dataPointSelection=="function"&&S.config.chart.events.dataPointSelection(h,this.ctx,{selectedDataPoints:S.globals.selectedDataPoints,seriesIndex:k,dataPointIndex:T,w:S}),h&&this.ctx.events.fireEvent("dataPointSelection",[h,this.ctx,{selectedDataPoints:S.globals.selectedDataPoints,seriesIndex:k,dataPointIndex:T,w:S}])}},{key:"rotateAroundCenter",value:function(p){var h={};return p&&typeof p.getBBox=="function"&&(h=p.getBBox()),{x:h.x+h.width/2,y:h.y+h.height/2}}},{key:"getTextRects",value:function(p,h,S,_){var k=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],T=this.w,B=this.drawText({x:-200,y:-200,text:p,textAnchor:"start",fontSize:h,fontFamily:S,foreColor:"#fff",opacity:0});_&&B.attr("transform",_),T.globals.dom.Paper.add(B);var q=B.bbox();return k||(q=B.node.getBoundingClientRect()),B.remove(),{width:q.width,height:q.height}}},{key:"placeTextWithEllipsis",value:function(p,h,S){if(typeof p.getComputedTextLength=="function"&&(p.textContent=h,h.length>0&&p.getComputedTextLength()>=S/1.1)){for(var _=h.length-3;_>0;_-=3)if(p.getSubStringLength(0,_)<=S/1.1)return void(p.textContent=h.substring(0,_)+"...");p.textContent="."}}}],[{key:"setAttrs",value:function(p,h){for(var S in h)h.hasOwnProperty(S)&&p.setAttribute(S,h[S])}}]),Ee}(),X=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"getStackedSeriesTotals",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],h=this.w,S=[];if(h.globals.series.length===0)return S;for(var _=0;_<h.globals.series[h.globals.maxValsInArrayIndex].length;_++){for(var k=0,T=0;T<h.globals.series.length;T++)h.globals.series[T][_]!==void 0&&p.indexOf(T)===-1&&(k+=h.globals.series[T][_]);S.push(k)}return S}},{key:"getSeriesTotalByIndex",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return p===null?this.w.config.series.reduce(function(h,S){return h+S},0):this.w.globals.series[p].reduce(function(h,S){return h+S},0)}},{key:"getStackedSeriesTotalsByGroups",value:function(){var p=this,h=this.w,S=[];return h.globals.seriesGroups.forEach(function(_){var k=[];h.config.series.forEach(function(B,q){_.indexOf(h.globals.seriesNames[q])>-1&&k.push(q)});var T=h.globals.series.map(function(B,q){return k.indexOf(q)===-1?q:-1}).filter(function(B){return B!==-1});S.push(p.getStackedSeriesTotals(T))}),S}},{key:"setSeriesYAxisMappings",value:function(){var p=this.w.globals,h=this.w.config,S=[],_=[],k=[],T=p.series.length>h.yaxis.length||h.yaxis.some(function(de){return Array.isArray(de.seriesName)});h.series.forEach(function(de,xe){k.push(xe),_.push(null)}),h.yaxis.forEach(function(de,xe){S[xe]=[]});var B=[];h.yaxis.forEach(function(de,xe){var we=!1;if(de.seriesName){var ke=[];Array.isArray(de.seriesName)?ke=de.seriesName:ke.push(de.seriesName),ke.forEach(function(Me){h.series.forEach(function(Ye,Fe){if(Ye.name===Me){var rt=Fe;xe===Fe||T?!T||k.indexOf(Fe)>-1?S[xe].push([xe,Fe]):console.warn("Series '"+Ye.name+"' referenced more than once in what looks like the new style. That is, when using either seriesName: [], or when there are more series than yaxes."):(S[Fe].push([Fe,xe]),rt=xe),we=!0,(rt=k.indexOf(rt))!==-1&&k.splice(rt,1)}})})}we||B.push(xe)}),S=S.map(function(de,xe){var we=[];return de.forEach(function(ke){_[ke[1]]=ke[0],we.push(ke[1])}),we});for(var q=h.yaxis.length-1,te=0;te<B.length&&(q=B[te],S[q]=[],k);te++){var ue=k[0];k.shift(),S[q].push(ue),_[ue]=q}k.forEach(function(de){S[q].push(de),_[de]=q}),p.seriesYAxisMap=S.map(function(de){return de}),p.seriesYAxisReverseMap=_.map(function(de){return de}),p.seriesYAxisMap.forEach(function(de,xe){de.forEach(function(we){h.series[we]&&h.series[we].group===void 0&&(h.series[we].group="apexcharts-axis-".concat(xe.toString()))})})}},{key:"isSeriesNull",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return(p===null?this.w.config.series.filter(function(h){return h!==null}):this.w.config.series[p].data.filter(function(h){return h!==null})).length===0}},{key:"seriesHaveSameValues",value:function(p){return this.w.globals.series[p].every(function(h,S,_){return h===_[0]})}},{key:"getCategoryLabels",value:function(p){var h=this.w,S=p.slice();return h.config.xaxis.convertedCatToNumeric&&(S=p.map(function(_,k){return h.config.xaxis.labels.formatter(_-h.globals.minX+1)})),S}},{key:"getLargestSeries",value:function(){var p=this.w;p.globals.maxValsInArrayIndex=p.globals.series.map(function(h){return h.length}).indexOf(Math.max.apply(Math,p.globals.series.map(function(h){return h.length})))}},{key:"getLargestMarkerSize",value:function(){var p=this.w,h=0;return p.globals.markers.size.forEach(function(S){h=Math.max(h,S)}),p.config.markers.discrete&&p.config.markers.discrete.length&&p.config.markers.discrete.forEach(function(S){h=Math.max(h,S.size)}),h>0&&(p.config.markers.hover.size>0?h=p.config.markers.hover.size:h+=p.config.markers.hover.sizeOffset),p.globals.markers.largestSize=h,h}},{key:"getSeriesTotals",value:function(){var p=this.w;p.globals.seriesTotals=p.globals.series.map(function(h,S){var _=0;if(Array.isArray(h))for(var k=0;k<h.length;k++)_+=h[k];else _+=h;return _})}},{key:"getSeriesTotalsXRange",value:function(p,h){var S=this.w;return S.globals.series.map(function(_,k){for(var T=0,B=0;B<_.length;B++)S.globals.seriesX[k][B]>p&&S.globals.seriesX[k][B]<h&&(T+=_[B]);return T})}},{key:"getPercentSeries",value:function(){var p=this.w;p.globals.seriesPercent=p.globals.series.map(function(h,S){var _=[];if(Array.isArray(h))for(var k=0;k<h.length;k++){var T=p.globals.stackedSeriesTotals[k],B=0;T&&(B=100*h[k]/T),_.push(B)}else{var q=100*h/p.globals.seriesTotals.reduce(function(te,ue){return te+ue},0);_.push(q)}return _})}},{key:"getCalculatedRatios",value:function(){var p,h,S,_=this,k=this.w,T=k.globals,B=[],q=0,te=[],ue=.1,de=0;if(T.yRange=[],T.isMultipleYAxis)for(var xe=0;xe<T.minYArr.length;xe++)T.yRange.push(Math.abs(T.minYArr[xe]-T.maxYArr[xe])),te.push(0);else T.yRange.push(Math.abs(T.minY-T.maxY));T.xRange=Math.abs(T.maxX-T.minX),T.zRange=Math.abs(T.maxZ-T.minZ);for(var we=0;we<T.yRange.length;we++)B.push(T.yRange[we]/T.gridHeight);if(h=T.xRange/T.gridWidth,p=T.yRange/T.gridWidth,S=T.xRange/T.gridHeight,(q=T.zRange/T.gridHeight*16)||(q=1),T.minY!==Number.MIN_VALUE&&Math.abs(T.minY)!==0&&(T.hasNegs=!0),k.globals.seriesYAxisReverseMap.length>0){var ke=function(Ye,Fe){var rt=k.config.yaxis[k.globals.seriesYAxisReverseMap[Fe]],se=Ye<0?-1:1;return Ye=Math.abs(Ye),rt.logarithmic&&(Ye=_.getBaseLog(rt.logBase,Ye)),-se*Ye/B[Fe]};if(T.isMultipleYAxis){te=[];for(var Me=0;Me<B.length;Me++)te.push(ke(T.minYArr[Me],Me))}else(te=[]).push(ke(T.minY,0)),T.minY!==Number.MIN_VALUE&&Math.abs(T.minY)!==0&&(ue=-T.minY/p,de=T.minX/h)}else(te=[]).push(0),ue=0,de=0;return{yRatio:B,invertedYRatio:p,zRatio:q,xRatio:h,invertedXRatio:S,baseLineInvertedY:ue,baseLineY:te,baseLineX:de}}},{key:"getLogSeries",value:function(p){var h=this,S=this.w;return S.globals.seriesLog=p.map(function(_,k){var T=S.globals.seriesYAxisReverseMap[k];return S.config.yaxis[T]&&S.config.yaxis[T].logarithmic?_.map(function(B){return B===null?null:h.getLogVal(S.config.yaxis[T].logBase,B,k)}):_}),S.globals.invalidLogScale?p:S.globals.seriesLog}},{key:"getBaseLog",value:function(p,h){return Math.log(h)/Math.log(p)}},{key:"getLogVal",value:function(p,h,S){if(h<=0)return 0;var _=this.w,k=_.globals.minYArr[S]===0?-1:this.getBaseLog(p,_.globals.minYArr[S]),T=(_.globals.maxYArr[S]===0?0:this.getBaseLog(p,_.globals.maxYArr[S]))-k;return h<1?h/T:(this.getBaseLog(p,h)-k)/T}},{key:"getLogYRatios",value:function(p){var h=this,S=this.w,_=this.w.globals;return _.yLogRatio=p.slice(),_.logYRange=_.yRange.map(function(k,T){var B=S.globals.seriesYAxisReverseMap[T];if(S.config.yaxis[B]&&h.w.config.yaxis[B].logarithmic){var q,te=-Number.MAX_VALUE,ue=Number.MIN_VALUE;return _.seriesLog.forEach(function(de,xe){de.forEach(function(we){S.config.yaxis[xe]&&S.config.yaxis[xe].logarithmic&&(te=Math.max(we,te),ue=Math.min(we,ue))})}),q=Math.pow(_.yRange[T],Math.abs(ue-te)/_.yRange[T]),_.yLogRatio[T]=q/_.gridHeight,q}}),_.invalidLogScale?p.slice():_.yLogRatio}},{key:"drawSeriesByGroup",value:function(p,h,S,_){var k=this.w,T=[];return p.series.length>0&&h.forEach(function(B){var q=[],te=[];p.i.forEach(function(ue,de){k.config.series[ue].group===B&&(q.push(p.series[de]),te.push(ue))}),q.length>0&&T.push(_.draw(q,S,te))}),T}}],[{key:"checkComboSeries",value:function(p,h){var S=!1,_=0,k=0;return h===void 0&&(h="line"),p.length&&p[0].type!==void 0&&p.forEach(function(T){T.type!=="bar"&&T.type!=="column"&&T.type!=="candlestick"&&T.type!=="boxPlot"||_++,T.type!==void 0&&T.type!==h&&k++}),k>0&&(S=!0),{comboBarCount:_,comboCharts:S}}},{key:"extendArrayProps",value:function(p,h,S){var _,k,T,B,q,te;return(_=h)!==null&&_!==void 0&&_.yaxis&&(h=p.extendYAxis(h,S)),(k=h)!==null&&k!==void 0&&k.annotations&&(h.annotations.yaxis&&(h=p.extendYAxisAnnotations(h)),(T=h)!==null&&T!==void 0&&(B=T.annotations)!==null&&B!==void 0&&B.xaxis&&(h=p.extendXAxisAnnotations(h)),(q=h)!==null&&q!==void 0&&(te=q.annotations)!==null&&te!==void 0&&te.points&&(h=p.extendPointAnnotations(h))),h}}]),Ee}(),ne=function(){function Ee(p){s(this,Ee),this.w=p.w,this.annoCtx=p}return o(Ee,[{key:"setOrientations",value:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,S=this.w;if(p.label.orientation==="vertical"){var _=h!==null?h:0,k=S.globals.dom.baseEl.querySelector(".apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='".concat(_,"']"));if(k!==null){var T=k.getBoundingClientRect();k.setAttribute("x",parseFloat(k.getAttribute("x"))-T.height+4);var B=p.label.position==="top"?T.width:-T.width;k.setAttribute("y",parseFloat(k.getAttribute("y"))+B);var q=this.annoCtx.graphics.rotateAroundCenter(k),te=q.x,ue=q.y;k.setAttribute("transform","rotate(-90 ".concat(te," ").concat(ue,")"))}}}},{key:"addBackgroundToAnno",value:function(p,h){var S=this.w;if(!p||!h.label.text||!String(h.label.text).trim())return null;var _=S.globals.dom.baseEl.querySelector(".apexcharts-grid").getBoundingClientRect(),k=p.getBoundingClientRect(),T=h.label.style.padding,B=T.left,q=T.right,te=T.top,ue=T.bottom;if(h.label.orientation==="vertical"){var de=[B,q,te,ue];te=de[0],ue=de[1],B=de[2],q=de[3]}var xe=k.left-_.left-B,we=k.top-_.top-te,ke=this.annoCtx.graphics.drawRect(xe-S.globals.barPadForNumericAxis,we,k.width+B+q,k.height+te+ue,h.label.borderRadius,h.label.style.background,1,h.label.borderWidth,h.label.borderColor,0);return h.id&&ke.node.classList.add(h.id),ke}},{key:"annotationsBackground",value:function(){var p=this,h=this.w,S=function(_,k,T){var B=h.globals.dom.baseEl.querySelector(".apexcharts-".concat(T,"-annotations .apexcharts-").concat(T,"-annotation-label[rel='").concat(k,"']"));if(B){var q=B.parentNode,te=p.addBackgroundToAnno(B,_);te&&(q.insertBefore(te.node,B),_.label.mouseEnter&&te.node.addEventListener("mouseenter",_.label.mouseEnter.bind(p,_)),_.label.mouseLeave&&te.node.addEventListener("mouseleave",_.label.mouseLeave.bind(p,_)),_.label.click&&te.node.addEventListener("click",_.label.click.bind(p,_)))}};h.config.annotations.xaxis.forEach(function(_,k){return S(_,k,"xaxis")}),h.config.annotations.yaxis.forEach(function(_,k){return S(_,k,"yaxis")}),h.config.annotations.points.forEach(function(_,k){return S(_,k,"point")})}},{key:"getY1Y2",value:function(p,h){var S,_=this.w,k=p==="y1"?h.y:h.y2,T=!1;if(this.annoCtx.invertAxis){var B=_.config.xaxis.convertedCatToNumeric?_.globals.categoryLabels:_.globals.labels,q=B.indexOf(k),te=_.globals.dom.baseEl.querySelector(".apexcharts-yaxis-texts-g text:nth-child(".concat(q+1,")"));S=te?parseFloat(te.getAttribute("y")):(_.globals.gridHeight/B.length-1)*(q+1)-_.globals.barHeight,h.seriesIndex!==void 0&&_.globals.barHeight&&(S-=_.globals.barHeight/2*(_.globals.series.length-1)-_.globals.barHeight*h.seriesIndex)}else{var ue,de=_.globals.seriesYAxisMap[h.yAxisIndex][0],xe=_.config.yaxis[h.yAxisIndex].logarithmic?new X(this.annoCtx.ctx).getLogVal(_.config.yaxis[h.yAxisIndex].logBase,k,de)/_.globals.yLogRatio[de]:(k-_.globals.minYArr[de])/(_.globals.yRange[de]/_.globals.gridHeight);S=_.globals.gridHeight-Math.min(Math.max(xe,0),_.globals.gridHeight),T=xe>_.globals.gridHeight||xe<0,!h.marker||h.y!==void 0&&h.y!==null||(S=0),(ue=_.config.yaxis[h.yAxisIndex])!==null&&ue!==void 0&&ue.reversed&&(S=xe)}return typeof k=="string"&&k.includes("px")&&(S=parseFloat(k)),{yP:S,clipped:T}}},{key:"getX1X2",value:function(p,h){var S=this.w,_=p==="x1"?h.x:h.x2,k=this.annoCtx.invertAxis?S.globals.minY:S.globals.minX,T=this.annoCtx.invertAxis?S.globals.maxY:S.globals.maxX,B=this.annoCtx.invertAxis?S.globals.yRange[0]:S.globals.xRange,q=!1,te=this.annoCtx.inversedReversedAxis?(T-_)/(B/S.globals.gridWidth):(_-k)/(B/S.globals.gridWidth);return S.config.xaxis.type!=="category"&&!S.config.xaxis.convertedCatToNumeric||this.annoCtx.invertAxis||S.globals.dataFormatXNumeric||S.config.chart.sparkline.enabled||(te=this.getStringX(_)),typeof _=="string"&&_.includes("px")&&(te=parseFloat(_)),_==null&&h.marker&&(te=S.globals.gridWidth),h.seriesIndex!==void 0&&S.globals.barWidth&&!this.annoCtx.invertAxis&&(te-=S.globals.barWidth/2*(S.globals.series.length-1)-S.globals.barWidth*h.seriesIndex),te>S.globals.gridWidth?(te=S.globals.gridWidth,q=!0):te<0&&(te=0,q=!0),{x:te,clipped:q}}},{key:"getStringX",value:function(p){var h=this.w,S=p;h.config.xaxis.convertedCatToNumeric&&h.globals.categoryLabels.length&&(p=h.globals.categoryLabels.indexOf(p)+1);var _=h.globals.labels.map(function(T){return Array.isArray(T)?T.join(" "):T}).indexOf(p),k=h.globals.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g text:nth-child(".concat(_+1,")"));return k&&(S=parseFloat(k.getAttribute("x"))),S}}]),Ee}(),J=function(){function Ee(p){s(this,Ee),this.w=p.w,this.annoCtx=p,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new ne(this.annoCtx)}return o(Ee,[{key:"addXaxisAnnotation",value:function(p,h,S){var _,k=this.w,T=this.helpers.getX1X2("x1",p),B=T.x,q=T.clipped,te=!0,ue=p.label.text,de=p.strokeDashArray;if(F.isNumber(B)){if(p.x2===null||p.x2===void 0){if(!q){var xe=this.annoCtx.graphics.drawLine(B+p.offsetX,0+p.offsetY,B+p.offsetX,k.globals.gridHeight+p.offsetY,p.borderColor,de,p.borderWidth);h.appendChild(xe.node),p.id&&xe.node.classList.add(p.id)}}else{var we=this.helpers.getX1X2("x2",p);if(_=we.x,te=we.clipped,!q||!te){if(_<B){var ke=B;B=_,_=ke}var Me=this.annoCtx.graphics.drawRect(B+p.offsetX,0+p.offsetY,_-B,k.globals.gridHeight+p.offsetY,0,p.fillColor,p.opacity,1,p.borderColor,de);Me.node.classList.add("apexcharts-annotation-rect"),Me.attr("clip-path","url(#gridRectMask".concat(k.globals.cuid,")")),h.appendChild(Me.node),p.id&&Me.node.classList.add(p.id)}}if(!q||!te){var Ye=this.annoCtx.graphics.getTextRects(ue,parseFloat(p.label.style.fontSize)),Fe=p.label.position==="top"?4:p.label.position==="center"?k.globals.gridHeight/2+(p.label.orientation==="vertical"?Ye.width/2:0):k.globals.gridHeight,rt=this.annoCtx.graphics.drawText({x:B+p.label.offsetX,y:Fe+p.label.offsetY-(p.label.orientation==="vertical"?p.label.position==="top"?Ye.width/2-12:-Ye.width/2:0),text:ue,textAnchor:p.label.textAnchor,fontSize:p.label.style.fontSize,fontFamily:p.label.style.fontFamily,fontWeight:p.label.style.fontWeight,foreColor:p.label.style.color,cssClass:"apexcharts-xaxis-annotation-label ".concat(p.label.style.cssClass," ").concat(p.id?p.id:"")});rt.attr({rel:S}),h.appendChild(rt.node),this.annoCtx.helpers.setOrientations(p,S)}}}},{key:"drawXAxisAnnotations",value:function(){var p=this,h=this.w,S=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return h.config.annotations.xaxis.map(function(_,k){p.addXaxisAnnotation(_,S.node,k)}),S}}]),Ee}(),Z=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.months31=[1,3,5,7,8,10,12],this.months30=[2,4,6,9,11],this.daysCntOfYear=[0,31,59,90,120,151,181,212,243,273,304,334]}return o(Ee,[{key:"isValidDate",value:function(p){return typeof p!="number"&&!isNaN(this.parseDate(p))}},{key:"getTimeStamp",value:function(p){return Date.parse(p)?this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(p).toISOString().substr(0,25)).getTime():new Date(p).getTime():p}},{key:"getDate",value:function(p){return this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(p).toUTCString()):new Date(p)}},{key:"parseDate",value:function(p){var h=Date.parse(p);if(!isNaN(h))return this.getTimeStamp(p);var S=Date.parse(p.replace(/-/g,"/").replace(/[a-z]+/gi," "));return S=this.getTimeStamp(S)}},{key:"parseDateWithTimezone",value:function(p){return Date.parse(p.replace(/-/g,"/").replace(/[a-z]+/gi," "))}},{key:"formatDate",value:function(p,h){var S=this.w.globals.locale,_=this.w.config.xaxis.labels.datetimeUTC,k=["\0"].concat(N(S.months)),T=[""].concat(N(S.shortMonths)),B=[""].concat(N(S.days)),q=[""].concat(N(S.shortDays));function te(nt,ot){var gt=nt+"";for(ot=ot||2;gt.length<ot;)gt="0"+gt;return gt}var ue=_?p.getUTCFullYear():p.getFullYear();h=(h=(h=h.replace(/(^|[^\\])yyyy+/g,"$1"+ue)).replace(/(^|[^\\])yy/g,"$1"+ue.toString().substr(2,2))).replace(/(^|[^\\])y/g,"$1"+ue);var de=(_?p.getUTCMonth():p.getMonth())+1;h=(h=(h=(h=h.replace(/(^|[^\\])MMMM+/g,"$1"+k[0])).replace(/(^|[^\\])MMM/g,"$1"+T[0])).replace(/(^|[^\\])MM/g,"$1"+te(de))).replace(/(^|[^\\])M/g,"$1"+de);var xe=_?p.getUTCDate():p.getDate();h=(h=(h=(h=h.replace(/(^|[^\\])dddd+/g,"$1"+B[0])).replace(/(^|[^\\])ddd/g,"$1"+q[0])).replace(/(^|[^\\])dd/g,"$1"+te(xe))).replace(/(^|[^\\])d/g,"$1"+xe);var we=_?p.getUTCHours():p.getHours(),ke=we>12?we-12:we===0?12:we;h=(h=(h=(h=h.replace(/(^|[^\\])HH+/g,"$1"+te(we))).replace(/(^|[^\\])H/g,"$1"+we)).replace(/(^|[^\\])hh+/g,"$1"+te(ke))).replace(/(^|[^\\])h/g,"$1"+ke);var Me=_?p.getUTCMinutes():p.getMinutes();h=(h=h.replace(/(^|[^\\])mm+/g,"$1"+te(Me))).replace(/(^|[^\\])m/g,"$1"+Me);var Ye=_?p.getUTCSeconds():p.getSeconds();h=(h=h.replace(/(^|[^\\])ss+/g,"$1"+te(Ye))).replace(/(^|[^\\])s/g,"$1"+Ye);var Fe=_?p.getUTCMilliseconds():p.getMilliseconds();h=h.replace(/(^|[^\\])fff+/g,"$1"+te(Fe,3)),Fe=Math.round(Fe/10),h=h.replace(/(^|[^\\])ff/g,"$1"+te(Fe)),Fe=Math.round(Fe/10);var rt=we<12?"AM":"PM";h=(h=(h=h.replace(/(^|[^\\])f/g,"$1"+Fe)).replace(/(^|[^\\])TT+/g,"$1"+rt)).replace(/(^|[^\\])T/g,"$1"+rt.charAt(0));var se=rt.toLowerCase();h=(h=h.replace(/(^|[^\\])tt+/g,"$1"+se)).replace(/(^|[^\\])t/g,"$1"+se.charAt(0));var Ce=-p.getTimezoneOffset(),De=_||!Ce?"Z":Ce>0?"+":"-";if(!_){var Le=(Ce=Math.abs(Ce))%60;De+=te(Math.floor(Ce/60))+":"+te(Le)}h=h.replace(/(^|[^\\])K/g,"$1"+De);var _e=(_?p.getUTCDay():p.getDay())+1;return h=(h=(h=(h=(h=h.replace(new RegExp(B[0],"g"),B[_e])).replace(new RegExp(q[0],"g"),q[_e])).replace(new RegExp(k[0],"g"),k[de])).replace(new RegExp(T[0],"g"),T[de])).replace(/\\(.)/g,"$1")}},{key:"getTimeUnitsfromTimestamp",value:function(p,h,S){var _=this.w;_.config.xaxis.min!==void 0&&(p=_.config.xaxis.min),_.config.xaxis.max!==void 0&&(h=_.config.xaxis.max);var k=this.getDate(p),T=this.getDate(h),B=this.formatDate(k,"yyyy MM dd HH mm ss fff").split(" "),q=this.formatDate(T,"yyyy MM dd HH mm ss fff").split(" ");return{minMillisecond:parseInt(B[6],10),maxMillisecond:parseInt(q[6],10),minSecond:parseInt(B[5],10),maxSecond:parseInt(q[5],10),minMinute:parseInt(B[4],10),maxMinute:parseInt(q[4],10),minHour:parseInt(B[3],10),maxHour:parseInt(q[3],10),minDate:parseInt(B[2],10),maxDate:parseInt(q[2],10),minMonth:parseInt(B[1],10)-1,maxMonth:parseInt(q[1],10)-1,minYear:parseInt(B[0],10),maxYear:parseInt(q[0],10)}}},{key:"isLeapYear",value:function(p){return p%4==0&&p%100!=0||p%400==0}},{key:"calculcateLastDaysOfMonth",value:function(p,h,S){return this.determineDaysOfMonths(p,h)-S}},{key:"determineDaysOfYear",value:function(p){var h=365;return this.isLeapYear(p)&&(h=366),h}},{key:"determineRemainingDaysOfYear",value:function(p,h,S){var _=this.daysCntOfYear[h]+S;return h>1&&this.isLeapYear()&&_++,_}},{key:"determineDaysOfMonths",value:function(p,h){var S=30;switch(p=F.monthMod(p),!0){case this.months30.indexOf(p)>-1:p===2&&(S=this.isLeapYear(h)?29:28);break;case this.months31.indexOf(p)>-1:default:S=31}return S}}]),Ee}(),re=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.tooltipKeyFormat="dd MMM"}return o(Ee,[{key:"xLabelFormat",value:function(p,h,S,_){var k=this.w;if(k.config.xaxis.type==="datetime"&&k.config.xaxis.labels.formatter===void 0&&k.config.tooltip.x.formatter===void 0){var T=new Z(this.ctx);return T.formatDate(T.getDate(h),k.config.tooltip.x.format)}return p(h,S,_)}},{key:"defaultGeneralFormatter",value:function(p){return Array.isArray(p)?p.map(function(h){return h}):p}},{key:"defaultYFormatter",value:function(p,h,S){var _=this.w;if(F.isNumber(p))if(_.globals.yValueDecimal!==0)p=p.toFixed(h.decimalsInFloat!==void 0?h.decimalsInFloat:_.globals.yValueDecimal);else{var k=p.toFixed(0);p=p==k?k:p.toFixed(1)}return p}},{key:"setLabelFormatters",value:function(){var p=this,h=this.w;return h.globals.xaxisTooltipFormatter=function(S){return p.defaultGeneralFormatter(S)},h.globals.ttKeyFormatter=function(S){return p.defaultGeneralFormatter(S)},h.globals.ttZFormatter=function(S){return S},h.globals.legendFormatter=function(S){return p.defaultGeneralFormatter(S)},h.config.xaxis.labels.formatter!==void 0?h.globals.xLabelFormatter=h.config.xaxis.labels.formatter:h.globals.xLabelFormatter=function(S){if(F.isNumber(S)){if(!h.config.xaxis.convertedCatToNumeric&&h.config.xaxis.type==="numeric"){if(F.isNumber(h.config.xaxis.decimalsInFloat))return S.toFixed(h.config.xaxis.decimalsInFloat);var _=h.globals.maxX-h.globals.minX;return _>0&&_<100?S.toFixed(1):S.toFixed(0)}return h.globals.isBarHorizontal&&h.globals.maxY-h.globals.minYArr<4?S.toFixed(1):S.toFixed(0)}return S},typeof h.config.tooltip.x.formatter=="function"?h.globals.ttKeyFormatter=h.config.tooltip.x.formatter:h.globals.ttKeyFormatter=h.globals.xLabelFormatter,typeof h.config.xaxis.tooltip.formatter=="function"&&(h.globals.xaxisTooltipFormatter=h.config.xaxis.tooltip.formatter),(Array.isArray(h.config.tooltip.y)||h.config.tooltip.y.formatter!==void 0)&&(h.globals.ttVal=h.config.tooltip.y),h.config.tooltip.z.formatter!==void 0&&(h.globals.ttZFormatter=h.config.tooltip.z.formatter),h.config.legend.formatter!==void 0&&(h.globals.legendFormatter=h.config.legend.formatter),h.config.yaxis.forEach(function(S,_){S.labels.formatter!==void 0?h.globals.yLabelFormatters[_]=S.labels.formatter:h.globals.yLabelFormatters[_]=function(k){return h.globals.xyCharts?Array.isArray(k)?k.map(function(T){return p.defaultYFormatter(T,S,_)}):p.defaultYFormatter(k,S,_):k}}),h.globals}},{key:"heatmapLabelFormatters",value:function(){var p=this.w;if(p.config.chart.type==="heatmap"){p.globals.yAxisScale[0].result=p.globals.seriesNames.slice();var h=p.globals.seriesNames.reduce(function(S,_){return S.length>_.length?S:_},0);p.globals.yAxisScale[0].niceMax=h,p.globals.yAxisScale[0].niceMin=h}}}]),Ee}(),he=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"getLabel",value:function(p,h,S,_){var k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],T=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"12px",B=!(arguments.length>6&&arguments[6]!==void 0)||arguments[6],q=this.w,te=p[_]===void 0?"":p[_],ue=te,de=q.globals.xLabelFormatter,xe=q.config.xaxis.labels.formatter,we=!1,ke=new re(this.ctx),Me=te;B&&(ue=ke.xLabelFormat(de,te,Me,{i:_,dateFormatter:new Z(this.ctx).formatDate,w:q}),xe!==void 0&&(ue=xe(te,p[_],{i:_,dateFormatter:new Z(this.ctx).formatDate,w:q})));var Ye,Fe;h.length>0?(Ye=h[_].unit,Fe=null,h.forEach(function(De){De.unit==="month"?Fe="year":De.unit==="day"?Fe="month":De.unit==="hour"?Fe="day":De.unit==="minute"&&(Fe="hour")}),we=Fe===Ye,S=h[_].position,ue=h[_].value):q.config.xaxis.type==="datetime"&&xe===void 0&&(ue=""),ue===void 0&&(ue=""),ue=Array.isArray(ue)?ue:ue.toString();var rt=new z(this.ctx),se={};se=q.globals.rotateXLabels&&B?rt.getTextRects(ue,parseInt(T,10),null,"rotate(".concat(q.config.xaxis.labels.rotate," 0 0)"),!1):rt.getTextRects(ue,parseInt(T,10));var Ce=!q.config.xaxis.labels.showDuplicates&&this.ctx.timeScale;return!Array.isArray(ue)&&(String(ue)==="NaN"||k.indexOf(ue)>=0&&Ce)&&(ue=""),{x:S,text:ue,textRect:se,isBold:we}}},{key:"checkLabelBasedOnTickamount",value:function(p,h,S){var _=this.w,k=_.config.xaxis.tickAmount;return k==="dataPoints"&&(k=Math.round(_.globals.gridWidth/120)),k>S||p%Math.round(S/(k+1))==0||(h.text=""),h}},{key:"checkForOverflowingLabels",value:function(p,h,S,_,k){var T=this.w;if(p===0&&T.globals.skipFirstTimelinelabel&&(h.text=""),p===S-1&&T.globals.skipLastTimelinelabel&&(h.text=""),T.config.xaxis.labels.hideOverlappingLabels&&_.length>0){var B=k[k.length-1];h.x<B.textRect.width/(T.globals.rotateXLabels?Math.abs(T.config.xaxis.labels.rotate)/12:1.01)+B.x&&(h.text="")}return h}},{key:"checkForReversedLabels",value:function(p,h){var S=this.w;return S.config.yaxis[p]&&S.config.yaxis[p].reversed&&h.reverse(),h}},{key:"yAxisAllSeriesCollapsed",value:function(p){var h=this.w.globals;return!h.seriesYAxisMap[p].some(function(S){return h.collapsedSeriesIndices.indexOf(S)===-1})}},{key:"translateYAxisIndex",value:function(p){var h=this.w,S=h.globals,_=h.config.yaxis;return S.series.length>_.length||_.some(function(k){return Array.isArray(k.seriesName)})?p:S.seriesYAxisReverseMap[p]}},{key:"isYAxisHidden",value:function(p){var h=this.w,S=h.config.yaxis[p];if(!S.show||this.yAxisAllSeriesCollapsed(p))return!0;if(!S.showForNullSeries){var _=h.globals.seriesYAxisMap[p],k=new X(this.ctx);return _.every(function(T){return k.isSeriesNull(T)})}return!1}},{key:"getYAxisForeColor",value:function(p,h){var S=this.w;return Array.isArray(p)&&S.globals.yAxisScale[h]&&this.ctx.theme.pushExtraColors(p,S.globals.yAxisScale[h].result.length,!1),p}},{key:"drawYAxisTicks",value:function(p,h,S,_,k,T,B){var q=this.w,te=new z(this.ctx),ue=q.globals.translateY+q.config.yaxis[k].labels.offsetY;if(q.globals.isBarHorizontal?ue=0:q.config.chart.type==="heatmap"&&(ue+=T/2),_.show&&h>0){q.config.yaxis[k].opposite===!0&&(p+=_.width);for(var de=h;de>=0;de--){var xe=te.drawLine(p+S.offsetX-_.width+_.offsetX,ue+_.offsetY,p+S.offsetX+_.offsetX,ue+_.offsetY,_.color);B.add(xe),ue+=T}}}}]),Ee}(),Y=function(){function Ee(p){s(this,Ee),this.w=p.w,this.annoCtx=p,this.helpers=new ne(this.annoCtx),this.axesUtils=new he(this.annoCtx)}return o(Ee,[{key:"addYaxisAnnotation",value:function(p,h,S){var _,k=this.w,T=p.strokeDashArray,B=this.helpers.getY1Y2("y1",p),q=B.yP,te=B.clipped,ue=!0,de=!1,xe=p.label.text;if(p.y2===null||p.y2===void 0){if(!te){de=!0;var we=this.annoCtx.graphics.drawLine(0+p.offsetX,q+p.offsetY,this._getYAxisAnnotationWidth(p),q+p.offsetY,p.borderColor,T,p.borderWidth);h.appendChild(we.node),p.id&&we.node.classList.add(p.id)}}else{if(_=(B=this.helpers.getY1Y2("y2",p)).yP,ue=B.clipped,_>q){var ke=q;q=_,_=ke}if(!te||!ue){de=!0;var Me=this.annoCtx.graphics.drawRect(0+p.offsetX,_+p.offsetY,this._getYAxisAnnotationWidth(p),q-_,0,p.fillColor,p.opacity,1,p.borderColor,T);Me.node.classList.add("apexcharts-annotation-rect"),Me.attr("clip-path","url(#gridRectMask".concat(k.globals.cuid,")")),h.appendChild(Me.node),p.id&&Me.node.classList.add(p.id)}}if(de){var Ye=p.label.position==="right"?k.globals.gridWidth:p.label.position==="center"?k.globals.gridWidth/2:0,Fe=this.annoCtx.graphics.drawText({x:Ye+p.label.offsetX,y:(_??q)+p.label.offsetY-3,text:xe,textAnchor:p.label.textAnchor,fontSize:p.label.style.fontSize,fontFamily:p.label.style.fontFamily,fontWeight:p.label.style.fontWeight,foreColor:p.label.style.color,cssClass:"apexcharts-yaxis-annotation-label ".concat(p.label.style.cssClass," ").concat(p.id?p.id:"")});Fe.attr({rel:S}),h.appendChild(Fe.node)}}},{key:"_getYAxisAnnotationWidth",value:function(p){var h=this.w;return h.globals.gridWidth,(p.width.indexOf("%")>-1?h.globals.gridWidth*parseInt(p.width,10)/100:parseInt(p.width,10))+p.offsetX}},{key:"drawYAxisAnnotations",value:function(){var p=this,h=this.w,S=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return h.config.annotations.yaxis.forEach(function(_,k){_.yAxisIndex=p.axesUtils.translateYAxisIndex(_.yAxisIndex),p.axesUtils.isYAxisHidden(_.yAxisIndex)&&p.axesUtils.yAxisAllSeriesCollapsed(_.yAxisIndex)||p.addYaxisAnnotation(_,S.node,k)}),S}}]),Ee}(),ie=function(){function Ee(p){s(this,Ee),this.w=p.w,this.annoCtx=p,this.helpers=new ne(this.annoCtx)}return o(Ee,[{key:"addPointAnnotation",value:function(p,h,S){if(!(this.w.globals.collapsedSeriesIndices.indexOf(p.seriesIndex)>-1)){var _=this.helpers.getX1X2("x1",p),k=_.x,T=_.clipped,B=(_=this.helpers.getY1Y2("y1",p)).yP,q=_.clipped;if(F.isNumber(k)&&!q&&!T){var te={pSize:p.marker.size,pointStrokeWidth:p.marker.strokeWidth,pointFillColor:p.marker.fillColor,pointStrokeColor:p.marker.strokeColor,shape:p.marker.shape,pRadius:p.marker.radius,class:"apexcharts-point-annotation-marker ".concat(p.marker.cssClass," ").concat(p.id?p.id:"")},ue=this.annoCtx.graphics.drawMarker(k+p.marker.offsetX,B+p.marker.offsetY,te);h.appendChild(ue.node);var de=p.label.text?p.label.text:"",xe=this.annoCtx.graphics.drawText({x:k+p.label.offsetX,y:B+p.label.offsetY-p.marker.size-parseFloat(p.label.style.fontSize)/1.6,text:de,textAnchor:p.label.textAnchor,fontSize:p.label.style.fontSize,fontFamily:p.label.style.fontFamily,fontWeight:p.label.style.fontWeight,foreColor:p.label.style.color,cssClass:"apexcharts-point-annotation-label ".concat(p.label.style.cssClass," ").concat(p.id?p.id:"")});if(xe.attr({rel:S}),h.appendChild(xe.node),p.customSVG.SVG){var we=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+p.customSVG.cssClass});we.attr({transform:"translate(".concat(k+p.customSVG.offsetX,", ").concat(B+p.customSVG.offsetY,")")}),we.node.innerHTML=p.customSVG.SVG,h.appendChild(we.node)}if(p.image.path){var ke=p.image.width?p.image.width:20,Me=p.image.height?p.image.height:20;ue=this.annoCtx.addImage({x:k+p.image.offsetX-ke/2,y:B+p.image.offsetY-Me/2,width:ke,height:Me,path:p.image.path,appendTo:".apexcharts-point-annotations"})}p.mouseEnter&&ue.node.addEventListener("mouseenter",p.mouseEnter.bind(this,p)),p.mouseLeave&&ue.node.addEventListener("mouseleave",p.mouseLeave.bind(this,p)),p.click&&ue.node.addEventListener("click",p.click.bind(this,p))}}}},{key:"drawPointAnnotations",value:function(){var p=this,h=this.w,S=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return h.config.annotations.points.map(function(_,k){p.addPointAnnotation(_,S.node,k)}),S}}]),Ee}(),oe={name:"en",options:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],toolbar:{exportToSVG:"Download SVG",exportToPNG:"Download PNG",exportToCSV:"Download CSV",menu:"Menu",selection:"Selection",selectionZoom:"Selection Zoom",zoomIn:"Zoom In",zoomOut:"Zoom Out",pan:"Panning",reset:"Reset Zoom"}}},G=function(){function Ee(){s(this,Ee),this.yAxis={show:!0,showAlways:!1,showForNullSeries:!0,seriesName:void 0,opposite:!1,reversed:!1,logarithmic:!1,logBase:10,tickAmount:void 0,stepSize:void 0,forceNiceScale:!1,max:void 0,min:void 0,floating:!1,decimalsInFloat:void 0,labels:{show:!0,showDuplicates:!1,minWidth:0,maxWidth:160,offsetX:0,offsetY:0,align:void 0,rotate:0,padding:20,style:{colors:[],fontSize:"11px",fontWeight:400,fontFamily:void 0,cssClass:""},formatter:void 0},axisBorder:{show:!1,color:"#e0e0e0",width:1,offsetX:0,offsetY:0},axisTicks:{show:!1,color:"#e0e0e0",width:6,offsetX:0,offsetY:0},title:{text:void 0,rotate:-90,offsetY:0,offsetX:0,style:{color:void 0,fontSize:"11px",fontWeight:900,fontFamily:void 0,cssClass:""}},tooltip:{enabled:!1,offsetX:0},crosshairs:{show:!0,position:"front",stroke:{color:"#b6b6b6",width:1,dashArray:0}}},this.pointAnnotation={id:void 0,x:0,y:null,yAxisIndex:0,seriesIndex:void 0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,marker:{size:4,fillColor:"#fff",strokeWidth:2,strokeColor:"#333",shape:"circle",offsetX:0,offsetY:0,cssClass:""},label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}},customSVG:{SVG:void 0,cssClass:void 0,offsetX:0,offsetY:0},image:{path:void 0,width:20,height:20,offsetX:0,offsetY:0}},this.yAxisAnnotation={id:void 0,y:0,y2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,width:"100%",yAxisIndex:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"end",position:"right",offsetX:0,offsetY:-3,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.xAxisAnnotation={id:void 0,x:0,x2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",orientation:"vertical",position:"top",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.text={x:0,y:0,text:"",textAnchor:"start",foreColor:void 0,fontSize:"13px",fontFamily:void 0,fontWeight:400,appendTo:".apexcharts-annotations",backgroundColor:"transparent",borderColor:"#c2c2c2",borderRadius:0,borderWidth:0,paddingLeft:4,paddingRight:4,paddingTop:2,paddingBottom:2}}return o(Ee,[{key:"init",value:function(){return{annotations:{yaxis:[this.yAxisAnnotation],xaxis:[this.xAxisAnnotation],points:[this.pointAnnotation],texts:[],images:[],shapes:[]},chart:{animations:{enabled:!0,easing:"easeinout",speed:800,animateGradually:{delay:150,enabled:!0},dynamicAnimation:{enabled:!0,speed:350}},background:"",locales:[oe],defaultLocale:"en",dropShadow:{enabled:!1,enabledOnSeries:void 0,top:2,left:2,blur:4,color:"#000",opacity:.35},events:{animationEnd:void 0,beforeMount:void 0,mounted:void 0,updated:void 0,click:void 0,mouseMove:void 0,mouseLeave:void 0,xAxisLabelClick:void 0,legendClick:void 0,markerClick:void 0,selection:void 0,dataPointSelection:void 0,dataPointMouseEnter:void 0,dataPointMouseLeave:void 0,beforeZoom:void 0,beforeResetZoom:void 0,zoomed:void 0,scrolled:void 0,brushScrolled:void 0},foreColor:"#373d3f",fontFamily:"Helvetica, Arial, sans-serif",height:"auto",parentHeightOffset:15,redrawOnParentResize:!0,redrawOnWindowResize:!0,id:void 0,group:void 0,nonce:void 0,offsetX:0,offsetY:0,selection:{enabled:!1,type:"x",fill:{color:"#24292e",opacity:.1},stroke:{width:1,color:"#24292e",opacity:.4,dashArray:3},xaxis:{min:void 0,max:void 0},yaxis:{min:void 0,max:void 0}},sparkline:{enabled:!1},brush:{enabled:!1,autoScaleYaxis:!0,target:void 0,targets:void 0},stacked:!1,stackOnlyBar:!0,stackType:"normal",toolbar:{show:!0,offsetX:0,offsetY:0,tools:{download:!0,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!0,reset:!0,customIcons:[]},export:{csv:{filename:void 0,columnDelimiter:",",headerCategory:"category",headerValue:"value",categoryFormatter:void 0,valueFormatter:void 0},png:{filename:void 0},svg:{filename:void 0},scale:void 0,width:void 0},autoSelected:"zoom"},type:"line",width:"100%",zoom:{enabled:!0,type:"x",autoScaleYaxis:!1,allowMouseWheelZoom:!0,zoomedArea:{fill:{color:"#90CAF9",opacity:.4},stroke:{color:"#0D47A1",opacity:.4,width:1}}}},plotOptions:{line:{isSlopeChart:!1},area:{fillTo:"origin"},bar:{horizontal:!1,columnWidth:"70%",barHeight:"70%",distributed:!1,borderRadius:0,borderRadiusApplication:"around",borderRadiusWhenStacked:"last",rangeBarOverlap:!0,rangeBarGroupRows:!1,hideZeroBarsWhenGrouped:!1,isDumbbell:!1,dumbbellColors:void 0,isFunnel:!1,isFunnel3d:!0,colors:{ranges:[],backgroundBarColors:[],backgroundBarOpacity:1,backgroundBarRadius:0},dataLabels:{position:"top",maxItems:100,hideOverflowingLabels:!0,orientation:"horizontal",total:{enabled:!1,formatter:void 0,offsetX:0,offsetY:0,style:{color:"#373d3f",fontSize:"12px",fontFamily:void 0,fontWeight:600}}}},bubble:{zScaling:!0,minBubbleRadius:void 0,maxBubbleRadius:void 0},candlestick:{colors:{upward:"#00B746",downward:"#EF403C"},wick:{useFillColor:!0}},boxPlot:{colors:{upper:"#00E396",lower:"#008FFB"}},heatmap:{radius:2,enableShades:!0,shadeIntensity:.5,reverseNegativeShade:!1,distributed:!1,useFillColorAsStroke:!1,colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0}},treemap:{enableShades:!0,shadeIntensity:.5,distributed:!1,reverseNegativeShade:!1,useFillColorAsStroke:!1,borderRadius:4,dataLabels:{format:"scale"},colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0}},radialBar:{inverseOrder:!1,startAngle:0,endAngle:360,offsetX:0,offsetY:0,hollow:{margin:5,size:"50%",background:"transparent",image:void 0,imageWidth:150,imageHeight:150,imageOffsetX:0,imageOffsetY:0,imageClipped:!0,position:"front",dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},track:{show:!0,startAngle:void 0,endAngle:void 0,background:"#f2f2f2",strokeWidth:"97%",opacity:1,margin:5,dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},dataLabels:{show:!0,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:0,formatter:function(p){return p}},value:{show:!0,fontSize:"14px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:16,formatter:function(p){return p+"%"}},total:{show:!1,label:"Total",fontSize:"16px",fontWeight:600,fontFamily:void 0,color:void 0,formatter:function(p){return p.globals.seriesTotals.reduce(function(h,S){return h+S},0)/p.globals.series.length+"%"}}},barLabels:{enabled:!1,offsetX:0,offsetY:0,useSeriesColors:!0,fontFamily:void 0,fontWeight:600,fontSize:"16px",formatter:function(p){return p},onClick:void 0}},pie:{customScale:1,offsetX:0,offsetY:0,startAngle:0,endAngle:360,expandOnClick:!0,dataLabels:{offset:0,minAngleToShowLabel:10},donut:{size:"65%",background:"transparent",labels:{show:!1,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:-10,formatter:function(p){return p}},value:{show:!0,fontSize:"20px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:10,formatter:function(p){return p}},total:{show:!1,showAlways:!1,label:"Total",fontSize:"16px",fontWeight:400,fontFamily:void 0,color:void 0,formatter:function(p){return p.globals.seriesTotals.reduce(function(h,S){return h+S},0)}}}}},polarArea:{rings:{strokeWidth:1,strokeColor:"#e8e8e8"},spokes:{strokeWidth:1,connectorColors:"#e8e8e8"}},radar:{size:void 0,offsetX:0,offsetY:0,polygons:{strokeWidth:1,strokeColors:"#e8e8e8",connectorColors:"#e8e8e8",fill:{colors:void 0}}}},colors:void 0,dataLabels:{enabled:!0,enabledOnSeries:void 0,formatter:function(p){return p!==null?p:""},textAnchor:"middle",distributed:!1,offsetX:0,offsetY:0,style:{fontSize:"12px",fontFamily:void 0,fontWeight:600,colors:void 0},background:{enabled:!0,foreColor:"#fff",borderRadius:2,padding:4,opacity:.9,borderWidth:1,borderColor:"#fff",dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.45}},dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.45}},fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]},image:{src:[],width:void 0,height:void 0},pattern:{style:"squares",width:6,height:6,strokeWidth:2}},forecastDataPoints:{count:0,fillOpacity:.5,strokeWidth:void 0,dashArray:4},grid:{show:!0,borderColor:"#e0e0e0",strokeDashArray:0,position:"back",xaxis:{lines:{show:!1}},yaxis:{lines:{show:!0}},row:{colors:void 0,opacity:.5},column:{colors:void 0,opacity:.5},padding:{top:0,right:10,bottom:0,left:12}},labels:[],legend:{show:!0,showForSingleSeries:!1,showForNullSeries:!0,showForZeroSeries:!0,floating:!1,position:"bottom",horizontalAlign:"center",inverseOrder:!1,fontSize:"12px",fontFamily:void 0,fontWeight:400,width:void 0,height:void 0,formatter:void 0,tooltipHoverFormatter:void 0,offsetX:-20,offsetY:4,customLegendItems:[],labels:{colors:void 0,useSeriesColors:!1},markers:{size:7,fillColors:void 0,strokeWidth:1,shape:void 0,offsetX:0,offsetY:0,customHTML:void 0,onClick:void 0},itemMargin:{horizontal:5,vertical:4},onItemClick:{toggleDataSeries:!0},onItemHover:{highlightDataSeries:!0}},markers:{discrete:[],size:0,colors:void 0,strokeColors:"#fff",strokeWidth:2,strokeOpacity:.9,strokeDashArray:0,fillOpacity:1,shape:"circle",offsetX:0,offsetY:0,showNullDataPoints:!0,onClick:void 0,onDblClick:void 0,hover:{size:void 0,sizeOffset:3}},noData:{text:void 0,align:"center",verticalAlign:"middle",offsetX:0,offsetY:0,style:{color:void 0,fontSize:"14px",fontFamily:void 0}},responsive:[],series:void 0,states:{normal:{filter:{type:"none",value:0}},hover:{filter:{type:"lighten",value:.1}},active:{allowMultipleDataPointsSelection:!1,filter:{type:"darken",value:.5}}},title:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:0,floating:!1,style:{fontSize:"14px",fontWeight:900,fontFamily:void 0,color:void 0}},subtitle:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:30,floating:!1,style:{fontSize:"12px",fontWeight:400,fontFamily:void 0,color:void 0}},stroke:{show:!0,curve:"smooth",lineCap:"butt",width:2,colors:void 0,dashArray:0,fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]}}},tooltip:{enabled:!0,enabledOnSeries:void 0,shared:!0,hideEmptySeries:!1,followCursor:!1,intersect:!1,inverseOrder:!1,custom:void 0,fillSeriesColor:!1,theme:"light",cssClass:"",style:{fontSize:"12px",fontFamily:void 0},onDatasetHover:{highlightDataSeries:!1},x:{show:!0,format:"dd MMM",formatter:void 0},y:{formatter:void 0,title:{formatter:function(p){return p?p+": ":""}}},z:{formatter:void 0,title:"Size: "},marker:{show:!0,fillColors:void 0},items:{display:"flex"},fixed:{enabled:!1,position:"topRight",offsetX:0,offsetY:0}},xaxis:{type:"category",categories:[],convertedCatToNumeric:!1,offsetX:0,offsetY:0,overwriteCategories:void 0,labels:{show:!0,rotate:-45,rotateAlways:!1,hideOverlappingLabels:!0,trim:!1,minHeight:void 0,maxHeight:120,showDuplicates:!0,style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""},offsetX:0,offsetY:0,format:void 0,formatter:void 0,datetimeUTC:!0,datetimeFormatter:{year:"yyyy",month:"MMM 'yy",day:"dd MMM",hour:"HH:mm",minute:"HH:mm:ss",second:"HH:mm:ss"}},group:{groups:[],style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""}},axisBorder:{show:!0,color:"#e0e0e0",width:"100%",height:1,offsetX:0,offsetY:0},axisTicks:{show:!0,color:"#e0e0e0",height:6,offsetX:0,offsetY:0},stepSize:void 0,tickAmount:void 0,tickPlacement:"on",min:void 0,max:void 0,range:void 0,floating:!1,decimalsInFloat:void 0,position:"bottom",title:{text:void 0,offsetX:0,offsetY:0,style:{color:void 0,fontSize:"12px",fontWeight:900,fontFamily:void 0,cssClass:""}},crosshairs:{show:!0,width:1,position:"back",opacity:.9,stroke:{color:"#b6b6b6",width:1,dashArray:3},fill:{type:"solid",color:"#B1B9C4",gradient:{colorFrom:"#D8E3F0",colorTo:"#BED1E6",stops:[0,100],opacityFrom:.4,opacityTo:.5}},dropShadow:{enabled:!1,left:0,top:0,blur:1,opacity:.4}},tooltip:{enabled:!0,offsetY:0,formatter:void 0,style:{fontSize:"12px",fontFamily:void 0}}},yaxis:this.yAxis,theme:{mode:"",palette:"palette1",monochrome:{enabled:!1,color:"#008FFB",shadeTo:"light",shadeIntensity:.65}}}}}]),Ee}(),V=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.graphics=new z(this.ctx),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new ne(this),this.xAxisAnnotations=new J(this),this.yAxisAnnotations=new Y(this),this.pointsAnnotations=new ie(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0),this.xDivision=this.w.globals.gridWidth/this.w.globals.dataPoints}return o(Ee,[{key:"drawAxesAnnotations",value:function(){var p=this.w;if(p.globals.axisCharts&&p.globals.dataPoints){for(var h=this.yAxisAnnotations.drawYAxisAnnotations(),S=this.xAxisAnnotations.drawXAxisAnnotations(),_=this.pointsAnnotations.drawPointAnnotations(),k=p.config.chart.animations.enabled,T=[h,S,_],B=[S.node,h.node,_.node],q=0;q<3;q++)p.globals.dom.elGraphical.add(T[q]),!k||p.globals.resized||p.globals.dataChanged||p.config.chart.type!=="scatter"&&p.config.chart.type!=="bubble"&&p.globals.dataPoints>1&&B[q].classList.add("apexcharts-element-hidden"),p.globals.delayedElements.push({el:B[q],index:0});this.helpers.annotationsBackground()}}},{key:"drawImageAnnos",value:function(){var p=this;this.w.config.annotations.images.map(function(h,S){p.addImage(h,S)})}},{key:"drawTextAnnos",value:function(){var p=this;this.w.config.annotations.texts.map(function(h,S){p.addText(h,S)})}},{key:"addXaxisAnnotation",value:function(p,h,S){this.xAxisAnnotations.addXaxisAnnotation(p,h,S)}},{key:"addYaxisAnnotation",value:function(p,h,S){this.yAxisAnnotations.addYaxisAnnotation(p,h,S)}},{key:"addPointAnnotation",value:function(p,h,S){this.pointsAnnotations.addPointAnnotation(p,h,S)}},{key:"addText",value:function(p,h){var S=p.x,_=p.y,k=p.text,T=p.textAnchor,B=p.foreColor,q=p.fontSize,te=p.fontFamily,ue=p.fontWeight,de=p.cssClass,xe=p.backgroundColor,we=p.borderWidth,ke=p.strokeDashArray,Me=p.borderRadius,Ye=p.borderColor,Fe=p.appendTo,rt=Fe===void 0?".apexcharts-svg":Fe,se=p.paddingLeft,Ce=se===void 0?4:se,De=p.paddingRight,Le=De===void 0?4:De,_e=p.paddingBottom,nt=_e===void 0?2:_e,ot=p.paddingTop,gt=ot===void 0?2:ot,Jt=this.w,Ge=this.graphics.drawText({x:S,y:_,text:k,textAnchor:T||"start",fontSize:q||"12px",fontWeight:ue||"regular",fontFamily:te||Jt.config.chart.fontFamily,foreColor:B||Jt.config.chart.foreColor,cssClass:de}),et=Jt.globals.dom.baseEl.querySelector(rt);et&&et.appendChild(Ge.node);var We=Ge.bbox();if(k){var wt=this.graphics.drawRect(We.x-Ce,We.y-gt,We.width+Ce+Le,We.height+nt+gt,Me,xe||"transparent",1,we,Ye,ke);et.insertBefore(wt.node,Ge.node)}}},{key:"addImage",value:function(p,h){var S=this.w,_=p.path,k=p.x,T=k===void 0?0:k,B=p.y,q=B===void 0?0:B,te=p.width,ue=te===void 0?20:te,de=p.height,xe=de===void 0?20:de,we=p.appendTo,ke=we===void 0?".apexcharts-svg":we,Me=S.globals.dom.Paper.image(_);Me.size(ue,xe).move(T,q);var Ye=S.globals.dom.baseEl.querySelector(ke);return Ye&&Ye.appendChild(Me.node),Me}},{key:"addXaxisAnnotationExternal",value:function(p,h,S){return this.addAnnotationExternal({params:p,pushToMemory:h,context:S,type:"xaxis",contextMethod:S.addXaxisAnnotation}),S}},{key:"addYaxisAnnotationExternal",value:function(p,h,S){return this.addAnnotationExternal({params:p,pushToMemory:h,context:S,type:"yaxis",contextMethod:S.addYaxisAnnotation}),S}},{key:"addPointAnnotationExternal",value:function(p,h,S){return this.invertAxis===void 0&&(this.invertAxis=S.w.globals.isBarHorizontal),this.addAnnotationExternal({params:p,pushToMemory:h,context:S,type:"point",contextMethod:S.addPointAnnotation}),S}},{key:"addAnnotationExternal",value:function(p){var h=p.params,S=p.pushToMemory,_=p.context,k=p.type,T=p.contextMethod,B=_,q=B.w,te=q.globals.dom.baseEl.querySelector(".apexcharts-".concat(k,"-annotations")),ue=te.childNodes.length+1,de=new G,xe=Object.assign({},k==="xaxis"?de.xAxisAnnotation:k==="yaxis"?de.yAxisAnnotation:de.pointAnnotation),we=F.extend(xe,h);switch(k){case"xaxis":this.addXaxisAnnotation(we,te,ue);break;case"yaxis":this.addYaxisAnnotation(we,te,ue);break;case"point":this.addPointAnnotation(we,te,ue)}var ke=q.globals.dom.baseEl.querySelector(".apexcharts-".concat(k,"-annotations .apexcharts-").concat(k,"-annotation-label[rel='").concat(ue,"']")),Me=this.helpers.addBackgroundToAnno(ke,we);return Me&&te.insertBefore(Me.node,ke),S&&q.globals.memory.methodsToExec.push({context:B,id:we.id?we.id:F.randomId(),method:T,label:"addAnnotation",params:h}),_}},{key:"clearAnnotations",value:function(p){for(var h=p.w,S=h.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations"),_=h.globals.memory.methodsToExec.length-1;_>=0;_--)h.globals.memory.methodsToExec[_].label!=="addText"&&h.globals.memory.methodsToExec[_].label!=="addAnnotation"||h.globals.memory.methodsToExec.splice(_,1);S=F.listToArray(S),Array.prototype.forEach.call(S,function(k){for(;k.firstChild;)k.removeChild(k.firstChild)})}},{key:"removeAnnotation",value:function(p,h){var S=p.w,_=S.globals.dom.baseEl.querySelectorAll(".".concat(h));_&&(S.globals.memory.methodsToExec.map(function(k,T){k.id===h&&S.globals.memory.methodsToExec.splice(T,1)}),Array.prototype.forEach.call(_,function(k){k.parentElement.removeChild(k)}))}}]),Ee}(),ee=function(Ee){var p,h=Ee.isTimeline,S=Ee.ctx,_=Ee.seriesIndex,k=Ee.dataPointIndex,T=Ee.y1,B=Ee.y2,q=Ee.w,te=q.globals.seriesRangeStart[_][k],ue=q.globals.seriesRangeEnd[_][k],de=q.globals.labels[k],xe=q.config.series[_].name?q.config.series[_].name:"",we=q.globals.ttKeyFormatter,ke=q.config.tooltip.y.title.formatter,Me={w:q,seriesIndex:_,dataPointIndex:k,start:te,end:ue};typeof ke=="function"&&(xe=ke(xe,Me)),(p=q.config.series[_].data[k])!==null&&p!==void 0&&p.x&&(de=q.config.series[_].data[k].x),h||q.config.xaxis.type==="datetime"&&(de=new re(S).xLabelFormat(q.globals.ttKeyFormatter,de,de,{i:void 0,dateFormatter:new Z(S).formatDate,w:q})),typeof we=="function"&&(de=we(de,Me)),Number.isFinite(T)&&Number.isFinite(B)&&(te=T,ue=B);var Ye="",Fe="",rt=q.globals.colors[_];if(q.config.tooltip.x.formatter===void 0)if(q.config.xaxis.type==="datetime"){var se=new Z(S);Ye=se.formatDate(se.getDate(te),q.config.tooltip.x.format),Fe=se.formatDate(se.getDate(ue),q.config.tooltip.x.format)}else Ye=te,Fe=ue;else Ye=q.config.tooltip.x.formatter(te),Fe=q.config.tooltip.x.formatter(ue);return{start:te,end:ue,startVal:Ye,endVal:Fe,ylabel:de,color:rt,seriesName:xe}},ae=function(Ee){var p=Ee.color,h=Ee.seriesName,S=Ee.ylabel,_=Ee.start,k=Ee.end,T=Ee.seriesIndex,B=Ee.dataPointIndex,q=Ee.ctx.tooltip.tooltipLabels.getFormatters(T);_=q.yLbFormatter(_),k=q.yLbFormatter(k);var te=q.yLbFormatter(Ee.w.globals.series[T][B]),ue=`<span class="value start-value">
  `.concat(_,`
  </span> <span class="separator">-</span> <span class="value end-value">
  `).concat(k,`
  </span>`);return'<div class="apexcharts-tooltip-rangebar"><div> <span class="series-name" style="color: '+p+'">'+(h||"")+'</span></div><div> <span class="category">'+S+": </span> "+(Ee.w.globals.comboCharts?Ee.w.config.series[T].type==="rangeArea"||Ee.w.config.series[T].type==="rangeBar"?ue:"<span>".concat(te,"</span>"):ue)+" </div></div>"},fe=function(){function Ee(p){s(this,Ee),this.opts=p}return o(Ee,[{key:"hideYAxis",value:function(){this.opts.yaxis[0].show=!1,this.opts.yaxis[0].title.text="",this.opts.yaxis[0].axisBorder.show=!1,this.opts.yaxis[0].axisTicks.show=!1,this.opts.yaxis[0].floating=!0}},{key:"line",value:function(){return{chart:{animations:{easing:"swing"}},dataLabels:{enabled:!1},stroke:{width:5,curve:"straight"},markers:{size:0,hover:{sizeOffset:6}},xaxis:{crosshairs:{width:1}}}}},{key:"sparkline",value:function(p){return this.hideYAxis(),F.extend(p,{grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},legend:{show:!1},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}},chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1}})}},{key:"slope",value:function(){return this.hideYAxis(),{chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!0,formatter:function(p,h){var S=h.w.config.series[h.seriesIndex].name;return p!==null?S+": "+p:""},background:{enabled:!1},offsetX:-5},grid:{xaxis:{lines:{show:!0}},yaxis:{lines:{show:!1}}},xaxis:{position:"top",labels:{style:{fontSize:14,fontWeight:900}},tooltip:{enabled:!1},crosshairs:{show:!1}},markers:{size:8,hover:{sizeOffset:1}},legend:{show:!1},tooltip:{shared:!1,intersect:!0,followCursor:!0},stroke:{width:5,curve:"straight"}}}},{key:"bar",value:function(){return{chart:{stacked:!1,animations:{easing:"swing"}},plotOptions:{bar:{dataLabels:{position:"center"}}},dataLabels:{style:{colors:["#fff"]},background:{enabled:!1}},stroke:{width:0,lineCap:"round"},fill:{opacity:.85},legend:{markers:{shape:"square"}},tooltip:{shared:!1,intersect:!0},xaxis:{tooltip:{enabled:!1},tickPlacement:"between",crosshairs:{width:"barWidth",position:"back",fill:{type:"gradient"},dropShadow:{enabled:!1},stroke:{width:0}}}}}},{key:"funnel",value:function(){return this.hideYAxis(),v(v({},this.bar()),{},{chart:{animations:{easing:"linear",speed:800,animateGradually:{enabled:!1}}},plotOptions:{bar:{horizontal:!0,borderRadiusApplication:"around",borderRadius:0,dataLabels:{position:"center"}}},grid:{show:!1,padding:{left:0,right:0}},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}}})}},{key:"candlestick",value:function(){var p=this;return{stroke:{width:1,colors:["#333"]},fill:{opacity:1},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:function(h){var S=h.seriesIndex,_=h.dataPointIndex,k=h.w;return p._getBoxTooltip(k,S,_,["Open","High","","Low","Close"],"candlestick")}},states:{active:{filter:{type:"none"}}},xaxis:{crosshairs:{width:1}}}}},{key:"boxPlot",value:function(){var p=this;return{chart:{animations:{dynamicAnimation:{enabled:!1}}},stroke:{width:1,colors:["#24292e"]},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:function(h){var S=h.seriesIndex,_=h.dataPointIndex,k=h.w;return p._getBoxTooltip(k,S,_,["Minimum","Q1","Median","Q3","Maximum"],"boxPlot")}},markers:{size:7,strokeWidth:1,strokeColors:"#111"},xaxis:{crosshairs:{width:1}}}}},{key:"rangeBar",value:function(){return{chart:{animations:{animateGradually:!1}},stroke:{width:0,lineCap:"square"},plotOptions:{bar:{borderRadius:0,dataLabels:{position:"center"}}},dataLabels:{enabled:!1,formatter:function(p,h){h.ctx;var S=h.seriesIndex,_=h.dataPointIndex,k=h.w,T=function(){var B=k.globals.seriesRangeStart[S][_];return k.globals.seriesRangeEnd[S][_]-B};return k.globals.comboCharts?k.config.series[S].type==="rangeBar"||k.config.series[S].type==="rangeArea"?T():p:T()},background:{enabled:!1},style:{colors:["#fff"]}},markers:{size:10},tooltip:{shared:!1,followCursor:!0,custom:function(p){return p.w.config.plotOptions&&p.w.config.plotOptions.bar&&p.w.config.plotOptions.bar.horizontal?function(h){var S=ee(v(v({},h),{},{isTimeline:!0})),_=S.color,k=S.seriesName,T=S.ylabel,B=S.startVal,q=S.endVal;return ae(v(v({},h),{},{color:_,seriesName:k,ylabel:T,start:B,end:q}))}(p):function(h){var S=ee(h),_=S.color,k=S.seriesName,T=S.ylabel,B=S.start,q=S.end;return ae(v(v({},h),{},{color:_,seriesName:k,ylabel:T,start:B,end:q}))}(p)}},xaxis:{tickPlacement:"between",tooltip:{enabled:!1},crosshairs:{stroke:{width:0}}}}}},{key:"dumbbell",value:function(p){var h,S;return(h=p.plotOptions.bar)!==null&&h!==void 0&&h.barHeight||(p.plotOptions.bar.barHeight=2),(S=p.plotOptions.bar)!==null&&S!==void 0&&S.columnWidth||(p.plotOptions.bar.columnWidth=2),p}},{key:"area",value:function(){return{stroke:{width:4,fill:{type:"solid",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}}},fill:{type:"gradient",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}},markers:{size:0,hover:{sizeOffset:6}},tooltip:{followCursor:!1}}}},{key:"rangeArea",value:function(){return{stroke:{curve:"straight",width:0},fill:{type:"solid",opacity:.6},markers:{size:0},states:{hover:{filter:{type:"none"}},active:{filter:{type:"none"}}},tooltip:{intersect:!1,shared:!0,followCursor:!0,custom:function(p){return function(h){var S=ee(h),_=S.color,k=S.seriesName,T=S.ylabel,B=S.start,q=S.end;return ae(v(v({},h),{},{color:_,seriesName:k,ylabel:T,start:B,end:q}))}(p)}}}}},{key:"brush",value:function(p){return F.extend(p,{chart:{toolbar:{autoSelected:"selection",show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1},stroke:{width:1},tooltip:{enabled:!1},xaxis:{tooltip:{enabled:!1}}})}},{key:"stacked100",value:function(p){p.dataLabels=p.dataLabels||{},p.dataLabels.formatter=p.dataLabels.formatter||void 0;var h=p.dataLabels.formatter;return p.yaxis.forEach(function(S,_){p.yaxis[_].min=0,p.yaxis[_].max=100}),p.chart.type==="bar"&&(p.dataLabels.formatter=h||function(S){return typeof S=="number"&&S?S.toFixed(0)+"%":S}),p}},{key:"stackedBars",value:function(){var p=this.bar();return v(v({},p),{},{plotOptions:v(v({},p.plotOptions),{},{bar:v(v({},p.plotOptions.bar),{},{borderRadiusApplication:"end",borderRadiusWhenStacked:"last"})})})}},{key:"convertCatToNumeric",value:function(p){return p.xaxis.convertedCatToNumeric=!0,p}},{key:"convertCatToNumericXaxis",value:function(p,h,S){p.xaxis.type="numeric",p.xaxis.labels=p.xaxis.labels||{},p.xaxis.labels.formatter=p.xaxis.labels.formatter||function(T){return F.isNumber(T)?Math.floor(T):T};var _=p.xaxis.labels.formatter,k=p.xaxis.categories&&p.xaxis.categories.length?p.xaxis.categories:p.labels;return S&&S.length&&(k=S.map(function(T){return Array.isArray(T)?T:String(T)})),k&&k.length&&(p.xaxis.labels.formatter=function(T){return F.isNumber(T)?_(k[Math.floor(T)-1]):_(T)}),p.xaxis.categories=[],p.labels=[],p.xaxis.tickAmount=p.xaxis.tickAmount||"dataPoints",p}},{key:"bubble",value:function(){return{dataLabels:{style:{colors:["#fff"]}},tooltip:{shared:!1,intersect:!0},xaxis:{crosshairs:{width:0}},fill:{type:"solid",gradient:{shade:"light",inverse:!0,shadeIntensity:.55,opacityFrom:.4,opacityTo:.8}}}}},{key:"scatter",value:function(){return{dataLabels:{enabled:!1},tooltip:{shared:!1,intersect:!0},markers:{size:6,strokeWidth:1,hover:{sizeOffset:2}}}}},{key:"heatmap",value:function(){return{chart:{stacked:!1},fill:{opacity:1},dataLabels:{style:{colors:["#fff"]}},stroke:{colors:["#fff"]},tooltip:{followCursor:!0,marker:{show:!1},x:{show:!1}},legend:{position:"top",markers:{shape:"square"}},grid:{padding:{right:20}}}}},{key:"treemap",value:function(){return{chart:{zoom:{enabled:!1}},dataLabels:{style:{fontSize:14,fontWeight:600,colors:["#fff"]}},stroke:{show:!0,width:2,colors:["#fff"]},legend:{show:!1},fill:{opacity:1,gradient:{stops:[0,100]}},tooltip:{followCursor:!0,x:{show:!1}},grid:{padding:{left:0,right:0}},xaxis:{crosshairs:{show:!1},tooltip:{enabled:!1}}}}},{key:"pie",value:function(){return{chart:{toolbar:{show:!1}},plotOptions:{pie:{donut:{labels:{show:!1}}}},dataLabels:{formatter:function(p){return p.toFixed(1)+"%"},style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",stops:[0,100]}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}},{key:"donut",value:function(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:function(p){return p.toFixed(1)+"%"},style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",shadeIntensity:.35,stops:[80,100],opacityFrom:1,opacityTo:1}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}},{key:"polarArea",value:function(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:function(p){return p.toFixed(1)+"%"},enabled:!1},stroke:{show:!0,width:2},fill:{opacity:.7},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}},{key:"radar",value:function(){return this.opts.yaxis[0].labels.offsetY=this.opts.yaxis[0].labels.offsetY?this.opts.yaxis[0].labels.offsetY:6,{dataLabels:{enabled:!1,style:{fontSize:"11px"}},stroke:{width:2},markers:{size:5,strokeWidth:1,strokeOpacity:1},fill:{opacity:.2},tooltip:{shared:!1,intersect:!0,followCursor:!0},grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},xaxis:{labels:{formatter:function(p){return p},style:{colors:["#a8a8a8"],fontSize:"11px"}},tooltip:{enabled:!1},crosshairs:{show:!1}}}}},{key:"radialBar",value:function(){return{chart:{animations:{dynamicAnimation:{enabled:!0,speed:800}},toolbar:{show:!1}},fill:{gradient:{shade:"dark",shadeIntensity:.4,inverseColors:!1,type:"diagonal2",opacityFrom:1,opacityTo:1,stops:[70,98,100]}},legend:{show:!1,position:"right"},tooltip:{enabled:!1,fillSeriesColor:!0},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}},{key:"_getBoxTooltip",value:function(p,h,S,_,k){var T=p.globals.seriesCandleO[h][S],B=p.globals.seriesCandleH[h][S],q=p.globals.seriesCandleM[h][S],te=p.globals.seriesCandleL[h][S],ue=p.globals.seriesCandleC[h][S];return p.config.series[h].type&&p.config.series[h].type!==k?`<div class="apexcharts-custom-tooltip">
          `.concat(p.config.series[h].name?p.config.series[h].name:"series-"+(h+1),": <strong>").concat(p.globals.series[h][S],`</strong>
        </div>`):'<div class="apexcharts-tooltip-box apexcharts-tooltip-'.concat(p.config.chart.type,'">')+"<div>".concat(_[0],': <span class="value">')+T+"</span></div>"+"<div>".concat(_[1],': <span class="value">')+B+"</span></div>"+(q?"<div>".concat(_[2],': <span class="value">')+q+"</span></div>":"")+"<div>".concat(_[3],': <span class="value">')+te+"</span></div>"+"<div>".concat(_[4],': <span class="value">')+ue+"</span></div></div>"}}]),Ee}(),Ae=function(){function Ee(p){s(this,Ee),this.opts=p}return o(Ee,[{key:"init",value:function(p){var h=p.responsiveOverride,S=this.opts,_=new G,k=new fe(S);this.chartType=S.chart.type,S=this.extendYAxis(S),S=this.extendAnnotations(S);var T=_.init(),B={};if(S&&P(S)==="object"){var q,te,ue,de,xe,we,ke,Me,Ye,Fe,rt={};rt=["line","area","bar","candlestick","boxPlot","rangeBar","rangeArea","bubble","scatter","heatmap","treemap","pie","polarArea","donut","radar","radialBar"].indexOf(S.chart.type)!==-1?k[S.chart.type]():k.line(),(q=S.plotOptions)!==null&&q!==void 0&&(te=q.bar)!==null&&te!==void 0&&te.isFunnel&&(rt=k.funnel()),S.chart.stacked&&S.chart.type==="bar"&&(rt=k.stackedBars()),(ue=S.chart.brush)!==null&&ue!==void 0&&ue.enabled&&(rt=k.brush(rt)),(de=S.plotOptions)!==null&&de!==void 0&&(xe=de.line)!==null&&xe!==void 0&&xe.isSlopeChart&&(rt=k.slope()),S.chart.stacked&&S.chart.stackType==="100%"&&(S=k.stacked100(S)),(we=S.plotOptions)!==null&&we!==void 0&&(ke=we.bar)!==null&&ke!==void 0&&ke.isDumbbell&&(S=k.dumbbell(S)),this.checkForDarkTheme(window.Apex),this.checkForDarkTheme(S),S.xaxis=S.xaxis||window.Apex.xaxis||{},h||(S.xaxis.convertedCatToNumeric=!1),((Me=(S=this.checkForCatToNumericXAxis(this.chartType,rt,S)).chart.sparkline)!==null&&Me!==void 0&&Me.enabled||(Ye=window.Apex.chart)!==null&&Ye!==void 0&&(Fe=Ye.sparkline)!==null&&Fe!==void 0&&Fe.enabled)&&(rt=k.sparkline(rt)),B=F.extend(T,rt)}var se=F.extend(B,window.Apex);return T=F.extend(se,S),T=this.handleUserInputErrors(T)}},{key:"checkForCatToNumericXAxis",value:function(p,h,S){var _,k,T=new fe(S),B=(p==="bar"||p==="boxPlot")&&((_=S.plotOptions)===null||_===void 0||(k=_.bar)===null||k===void 0?void 0:k.horizontal),q=p==="pie"||p==="polarArea"||p==="donut"||p==="radar"||p==="radialBar"||p==="heatmap",te=S.xaxis.type!=="datetime"&&S.xaxis.type!=="numeric",ue=S.xaxis.tickPlacement?S.xaxis.tickPlacement:h.xaxis&&h.xaxis.tickPlacement;return B||q||!te||ue==="between"||(S=T.convertCatToNumeric(S)),S}},{key:"extendYAxis",value:function(p,h){var S=new G;(p.yaxis===void 0||!p.yaxis||Array.isArray(p.yaxis)&&p.yaxis.length===0)&&(p.yaxis={}),p.yaxis.constructor!==Array&&window.Apex.yaxis&&window.Apex.yaxis.constructor!==Array&&(p.yaxis=F.extend(p.yaxis,window.Apex.yaxis)),p.yaxis.constructor!==Array?p.yaxis=[F.extend(S.yAxis,p.yaxis)]:p.yaxis=F.extendArray(p.yaxis,S.yAxis);var _=!1;p.yaxis.forEach(function(T){T.logarithmic&&(_=!0)});var k=p.series;return h&&!k&&(k=h.config.series),_&&k.length!==p.yaxis.length&&k.length&&(p.yaxis=k.map(function(T,B){if(T.name||(k[B].name="series-".concat(B+1)),p.yaxis[B])return p.yaxis[B].seriesName=k[B].name,p.yaxis[B];var q=F.extend(S.yAxis,p.yaxis[0]);return q.show=!1,q})),_&&k.length>1&&k.length!==p.yaxis.length&&console.warn("A multi-series logarithmic chart should have equal number of series and y-axes"),p}},{key:"extendAnnotations",value:function(p){return p.annotations===void 0&&(p.annotations={},p.annotations.yaxis=[],p.annotations.xaxis=[],p.annotations.points=[]),p=this.extendYAxisAnnotations(p),p=this.extendXAxisAnnotations(p),p=this.extendPointAnnotations(p)}},{key:"extendYAxisAnnotations",value:function(p){var h=new G;return p.annotations.yaxis=F.extendArray(p.annotations.yaxis!==void 0?p.annotations.yaxis:[],h.yAxisAnnotation),p}},{key:"extendXAxisAnnotations",value:function(p){var h=new G;return p.annotations.xaxis=F.extendArray(p.annotations.xaxis!==void 0?p.annotations.xaxis:[],h.xAxisAnnotation),p}},{key:"extendPointAnnotations",value:function(p){var h=new G;return p.annotations.points=F.extendArray(p.annotations.points!==void 0?p.annotations.points:[],h.pointAnnotation),p}},{key:"checkForDarkTheme",value:function(p){p.theme&&p.theme.mode==="dark"&&(p.tooltip||(p.tooltip={}),p.tooltip.theme!=="light"&&(p.tooltip.theme="dark"),p.chart.foreColor||(p.chart.foreColor="#f6f7f8"),p.theme.palette||(p.theme.palette="palette4"))}},{key:"handleUserInputErrors",value:function(p){var h=p;if(h.tooltip.shared&&h.tooltip.intersect)throw new Error("tooltip.shared cannot be enabled when tooltip.intersect is true. Turn off any other option by setting it to false.");if(h.chart.type==="bar"&&h.plotOptions.bar.horizontal){if(h.yaxis.length>1)throw new Error("Multiple Y Axis for bars are not supported. Switch to column chart by setting plotOptions.bar.horizontal=false");h.yaxis[0].reversed&&(h.yaxis[0].opposite=!0),h.xaxis.tooltip.enabled=!1,h.yaxis[0].tooltip.enabled=!1,h.chart.zoom.enabled=!1}return h.chart.type!=="bar"&&h.chart.type!=="rangeBar"||h.tooltip.shared&&h.xaxis.crosshairs.width==="barWidth"&&h.series.length>1&&(h.xaxis.crosshairs.width="tickWidth"),h.chart.type!=="candlestick"&&h.chart.type!=="boxPlot"||h.yaxis[0].reversed&&(console.warn("Reversed y-axis in ".concat(h.chart.type," chart is not supported.")),h.yaxis[0].reversed=!1),h}}]),Ee}(),ce=function(){function Ee(){s(this,Ee)}return o(Ee,[{key:"initGlobalVars",value:function(p){p.series=[],p.seriesCandleO=[],p.seriesCandleH=[],p.seriesCandleM=[],p.seriesCandleL=[],p.seriesCandleC=[],p.seriesRangeStart=[],p.seriesRangeEnd=[],p.seriesRange=[],p.seriesPercent=[],p.seriesGoals=[],p.seriesX=[],p.seriesZ=[],p.seriesNames=[],p.seriesTotals=[],p.seriesLog=[],p.seriesColors=[],p.stackedSeriesTotals=[],p.seriesXvalues=[],p.seriesYvalues=[],p.labels=[],p.hasXaxisGroups=!1,p.groups=[],p.barGroups=[],p.lineGroups=[],p.areaGroups=[],p.hasSeriesGroups=!1,p.seriesGroups=[],p.categoryLabels=[],p.timescaleLabels=[],p.noLabelsProvided=!1,p.resizeTimer=null,p.selectionResizeTimer=null,p.lastWheelExecution=0,p.delayedElements=[],p.pointsArray=[],p.dataLabelsRects=[],p.isXNumeric=!1,p.skipLastTimelinelabel=!1,p.skipFirstTimelinelabel=!1,p.isDataXYZ=!1,p.isMultiLineX=!1,p.isMultipleYAxis=!1,p.maxY=-Number.MAX_VALUE,p.minY=Number.MIN_VALUE,p.minYArr=[],p.maxYArr=[],p.maxX=-Number.MAX_VALUE,p.minX=Number.MAX_VALUE,p.initialMaxX=-Number.MAX_VALUE,p.initialMinX=Number.MAX_VALUE,p.maxDate=0,p.minDate=Number.MAX_VALUE,p.minZ=Number.MAX_VALUE,p.maxZ=-Number.MAX_VALUE,p.minXDiff=Number.MAX_VALUE,p.yAxisScale=[],p.xAxisScale=null,p.xAxisTicksPositions=[],p.yLabelsCoords=[],p.yTitleCoords=[],p.barPadForNumericAxis=0,p.padHorizontal=0,p.xRange=0,p.yRange=[],p.zRange=0,p.dataPoints=0,p.xTickAmount=0,p.multiAxisTickAmount=0}},{key:"globalVars",value:function(p){return{chartID:null,cuid:null,events:{beforeMount:[],mounted:[],updated:[],clicked:[],selection:[],dataPointSelection:[],zoomed:[],scrolled:[]},colors:[],clientX:null,clientY:null,fill:{colors:[]},stroke:{colors:[]},dataLabels:{style:{colors:[]}},radarPolygons:{fill:{colors:[]}},markers:{colors:[],size:p.markers.size,largestSize:0},animationEnded:!1,isTouchDevice:"ontouchstart"in window||navigator.msMaxTouchPoints,isDirty:!1,isExecCalled:!1,initialConfig:null,initialSeries:[],lastXAxis:[],lastYAxis:[],columnSeries:null,labels:[],timescaleLabels:[],noLabelsProvided:!1,allSeriesCollapsed:!1,collapsedSeries:[],collapsedSeriesIndices:[],ancillaryCollapsedSeries:[],ancillaryCollapsedSeriesIndices:[],risingSeries:[],dataFormatXNumeric:!1,capturedSeriesIndex:-1,capturedDataPointIndex:-1,selectedDataPoints:[],invalidLogScale:!1,ignoreYAxisIndexes:[],maxValsInArrayIndex:0,radialSize:0,selection:void 0,zoomEnabled:p.chart.toolbar.autoSelected==="zoom"&&p.chart.toolbar.tools.zoom&&p.chart.zoom.enabled,panEnabled:p.chart.toolbar.autoSelected==="pan"&&p.chart.toolbar.tools.pan,selectionEnabled:p.chart.toolbar.autoSelected==="selection"&&p.chart.toolbar.tools.selection,yaxis:null,mousedown:!1,lastClientPosition:{},visibleXRange:void 0,yValueDecimal:0,total:0,SVGNS:"http://www.w3.org/2000/svg",svgWidth:0,svgHeight:0,noData:!1,locale:{},dom:{},memory:{methodsToExec:[]},shouldAnimate:!0,skipLastTimelinelabel:!1,skipFirstTimelinelabel:!1,delayedElements:[],axisCharts:!0,isDataXYZ:!1,isSlopeChart:p.plotOptions.line.isSlopeChart,resized:!1,resizeTimer:null,comboCharts:!1,dataChanged:!1,previousPaths:[],allSeriesHasEqualX:!0,pointsArray:[],dataLabelsRects:[],lastDrawnDataLabelsIndexes:[],hasNullValues:!1,easing:null,zoomed:!1,gridWidth:0,gridHeight:0,rotateXLabels:!1,defaultLabels:!1,xLabelFormatter:void 0,yLabelFormatters:[],xaxisTooltipFormatter:void 0,ttKeyFormatter:void 0,ttVal:void 0,ttZFormatter:void 0,LINE_HEIGHT_RATIO:1.618,xAxisLabelsHeight:0,xAxisGroupLabelsHeight:0,xAxisLabelsWidth:0,yAxisLabelsWidth:0,scaleX:1,scaleY:1,translateX:0,translateY:0,translateYAxisX:[],yAxisWidths:[],translateXAxisY:0,translateXAxisX:0,tooltip:null,niceScaleAllowedMagMsd:[[1,1,2,5,5,5,10,10,10,10,10],[1,1,2,5,5,5,10,10,10,10,10]],niceScaleDefaultTicks:[1,2,4,4,6,6,6,6,6,6,6,6,6,6,6,6,6,6,12,12,12,12,12,12,12,12,12,24],seriesYAxisMap:[],seriesYAxisReverseMap:[]}}},{key:"init",value:function(p){var h=this.globalVars(p);return this.initGlobalVars(h),h.initialConfig=F.extend({},p),h.initialSeries=F.clone(p.series),h.lastXAxis=F.clone(h.initialConfig.xaxis),h.lastYAxis=F.clone(h.initialConfig.yaxis),h}}]),Ee}(),ye=function(){function Ee(p){s(this,Ee),this.opts=p}return o(Ee,[{key:"init",value:function(){var p=new Ae(this.opts).init({responsiveOverride:!1});return{config:p,globals:new ce().init(p)}}}]),Ee}(),Ne=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.opts=null,this.seriesIndex=0,this.patternIDs=[]}return o(Ee,[{key:"clippedImgArea",value:function(p){var h=this.w,S=h.config,_=parseInt(h.globals.gridWidth,10),k=parseInt(h.globals.gridHeight,10),T=_>k?_:k,B=p.image,q=0,te=0;p.width===void 0&&p.height===void 0?S.fill.image.width!==void 0&&S.fill.image.height!==void 0?(q=S.fill.image.width+1,te=S.fill.image.height):(q=T+1,te=T):(q=p.width,te=p.height);var ue=document.createElementNS(h.globals.SVGNS,"pattern");z.setAttrs(ue,{id:p.patternID,patternUnits:p.patternUnits?p.patternUnits:"userSpaceOnUse",width:q+"px",height:te+"px"});var de=document.createElementNS(h.globals.SVGNS,"image");ue.appendChild(de),de.setAttributeNS(window.SVG.xlink,"href",B),z.setAttrs(de,{x:0,y:0,preserveAspectRatio:"none",width:q+"px",height:te+"px"}),de.style.opacity=p.opacity,h.globals.dom.elDefs.node.appendChild(ue)}},{key:"getSeriesIndex",value:function(p){var h=this.w,S=h.config.chart.type;return(S==="bar"||S==="rangeBar")&&h.config.plotOptions.bar.distributed||S==="heatmap"||S==="treemap"?this.seriesIndex=p.seriesNumber:this.seriesIndex=p.seriesNumber%h.globals.series.length,this.seriesIndex}},{key:"fillPath",value:function(p){var h=this.w;this.opts=p;var S,_,k,T=this.w.config;this.seriesIndex=this.getSeriesIndex(p);var B=this.getFillColors()[this.seriesIndex];h.globals.seriesColors[this.seriesIndex]!==void 0&&(B=h.globals.seriesColors[this.seriesIndex]),typeof B=="function"&&(B=B({seriesIndex:this.seriesIndex,dataPointIndex:p.dataPointIndex,value:p.value,w:h}));var q=p.fillType?p.fillType:this.getFillType(this.seriesIndex),te=Array.isArray(T.fill.opacity)?T.fill.opacity[this.seriesIndex]:T.fill.opacity;p.color&&(B=p.color),B||(B="#fff",console.warn("undefined color - ApexCharts"));var ue=B;if(B.indexOf("rgb")===-1?B.length<9&&(ue=F.hexToRgba(B,te)):B.indexOf("rgba")>-1&&(te=F.getOpacityFromRGBA(B)),p.opacity&&(te=p.opacity),q==="pattern"&&(_=this.handlePatternFill({fillConfig:p.fillConfig,patternFill:_,fillColor:B,fillOpacity:te,defaultColor:ue})),q==="gradient"&&(k=this.handleGradientFill({fillConfig:p.fillConfig,fillColor:B,fillOpacity:te,i:this.seriesIndex})),q==="image"){var de=T.fill.image.src,xe=p.patternID?p.patternID:"",we="pattern".concat(h.globals.cuid).concat(p.seriesNumber+1).concat(xe);this.patternIDs.indexOf(we)===-1&&(this.clippedImgArea({opacity:te,image:Array.isArray(de)?p.seriesNumber<de.length?de[p.seriesNumber]:de[0]:de,width:p.width?p.width:void 0,height:p.height?p.height:void 0,patternUnits:p.patternUnits,patternID:we}),this.patternIDs.push(we)),S="url(#".concat(we,")")}else S=q==="gradient"?k:q==="pattern"?_:ue;return p.solid&&(S=ue),S}},{key:"getFillType",value:function(p){var h=this.w;return Array.isArray(h.config.fill.type)?h.config.fill.type[p]:h.config.fill.type}},{key:"getFillColors",value:function(){var p=this.w,h=p.config,S=this.opts,_=[];return p.globals.comboCharts?p.config.series[this.seriesIndex].type==="line"?Array.isArray(p.globals.stroke.colors)?_=p.globals.stroke.colors:_.push(p.globals.stroke.colors):Array.isArray(p.globals.fill.colors)?_=p.globals.fill.colors:_.push(p.globals.fill.colors):h.chart.type==="line"?Array.isArray(p.globals.stroke.colors)?_=p.globals.stroke.colors:_.push(p.globals.stroke.colors):Array.isArray(p.globals.fill.colors)?_=p.globals.fill.colors:_.push(p.globals.fill.colors),S.fillColors!==void 0&&(_=[],Array.isArray(S.fillColors)?_=S.fillColors.slice():_.push(S.fillColors)),_}},{key:"handlePatternFill",value:function(p){var h=p.fillConfig,S=p.patternFill,_=p.fillColor,k=p.fillOpacity,T=p.defaultColor,B=this.w.config.fill;h&&(B=h);var q=this.opts,te=new z(this.ctx),ue=Array.isArray(B.pattern.strokeWidth)?B.pattern.strokeWidth[this.seriesIndex]:B.pattern.strokeWidth,de=_;return Array.isArray(B.pattern.style)?S=B.pattern.style[q.seriesNumber]!==void 0?te.drawPattern(B.pattern.style[q.seriesNumber],B.pattern.width,B.pattern.height,de,ue,k):T:S=te.drawPattern(B.pattern.style,B.pattern.width,B.pattern.height,de,ue,k),S}},{key:"handleGradientFill",value:function(p){var h=p.fillColor,S=p.fillOpacity,_=p.fillConfig,k=p.i,T=this.w.config.fill;_&&(T=v(v({},T),_));var B,q=this.opts,te=new z(this.ctx),ue=new F,de=T.gradient.type,xe=h,we=T.gradient.opacityFrom===void 0?S:Array.isArray(T.gradient.opacityFrom)?T.gradient.opacityFrom[k]:T.gradient.opacityFrom;xe.indexOf("rgba")>-1&&(we=F.getOpacityFromRGBA(xe));var ke=T.gradient.opacityTo===void 0?S:Array.isArray(T.gradient.opacityTo)?T.gradient.opacityTo[k]:T.gradient.opacityTo;if(T.gradient.gradientToColors===void 0||T.gradient.gradientToColors.length===0)B=T.gradient.shade==="dark"?ue.shadeColor(-1*parseFloat(T.gradient.shadeIntensity),h.indexOf("rgb")>-1?F.rgb2hex(h):h):ue.shadeColor(parseFloat(T.gradient.shadeIntensity),h.indexOf("rgb")>-1?F.rgb2hex(h):h);else if(T.gradient.gradientToColors[q.seriesNumber]){var Me=T.gradient.gradientToColors[q.seriesNumber];B=Me,Me.indexOf("rgba")>-1&&(ke=F.getOpacityFromRGBA(Me))}else B=h;if(T.gradient.gradientFrom&&(xe=T.gradient.gradientFrom),T.gradient.gradientTo&&(B=T.gradient.gradientTo),T.gradient.inverseColors){var Ye=xe;xe=B,B=Ye}return xe.indexOf("rgb")>-1&&(xe=F.rgb2hex(xe)),B.indexOf("rgb")>-1&&(B=F.rgb2hex(B)),te.drawGradient(de,xe,B,we,ke,q.size,T.gradient.stops,T.gradient.colorStops,k)}}]),Ee}(),be=function(){function Ee(p,h){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"setGlobalMarkerSize",value:function(){var p=this.w;if(p.globals.markers.size=Array.isArray(p.config.markers.size)?p.config.markers.size:[p.config.markers.size],p.globals.markers.size.length>0){if(p.globals.markers.size.length<p.globals.series.length+1)for(var h=0;h<=p.globals.series.length;h++)p.globals.markers.size[h]===void 0&&p.globals.markers.size.push(p.globals.markers.size[0])}else p.globals.markers.size=p.config.series.map(function(S){return p.config.markers.size})}},{key:"plotChartMarkers",value:function(p,h,S,_){var k,T=arguments.length>4&&arguments[4]!==void 0&&arguments[4],B=this.w,q=h,te=p,ue=null,de=new z(this.ctx),xe=B.config.markers.discrete&&B.config.markers.discrete.length;if((B.globals.markers.size[h]>0||T||xe)&&(ue=de.group({class:T||xe?"":"apexcharts-series-markers"})).attr("clip-path","url(#gridRectMarkerMask".concat(B.globals.cuid,")")),Array.isArray(te.x))for(var we=0;we<te.x.length;we++){var ke=S;S===1&&we===0&&(ke=0),S===1&&we===1&&(ke=1);var Me="apexcharts-marker";if(B.config.chart.type!=="line"&&B.config.chart.type!=="area"||B.globals.comboCharts||B.config.tooltip.intersect||(Me+=" no-pointer-events"),(Array.isArray(B.config.markers.size)?B.globals.markers.size[h]>0:B.config.markers.size>0)||T||xe){F.isNumber(te.y[we])?Me+=" w".concat(F.randomId()):Me="apexcharts-nullpoint";var Ye=this.getMarkerConfig({cssClass:Me,seriesIndex:h,dataPointIndex:ke});B.config.series[q].data[ke]&&(B.config.series[q].data[ke].fillColor&&(Ye.pointFillColor=B.config.series[q].data[ke].fillColor),B.config.series[q].data[ke].strokeColor&&(Ye.pointStrokeColor=B.config.series[q].data[ke].strokeColor)),_!==void 0&&(Ye.pSize=_),(te.x[we]<-B.globals.markers.largestSize||te.x[we]>B.globals.gridWidth+B.globals.markers.largestSize||te.y[we]<-B.globals.markers.largestSize||te.y[we]>B.globals.gridHeight+B.globals.markers.largestSize)&&(Ye.pSize=0),(k=de.drawMarker(te.x[we],te.y[we],Ye)).attr("rel",ke),k.attr("j",ke),k.attr("index",h),k.node.setAttribute("default-marker-size",Ye.pSize),new L(this.ctx).setSelectionFilter(k,h,ke),this.addEvents(k),ue&&ue.add(k)}else B.globals.pointsArray[h]===void 0&&(B.globals.pointsArray[h]=[]),B.globals.pointsArray[h].push([te.x[we],te.y[we]])}return ue}},{key:"getMarkerConfig",value:function(p){var h=p.cssClass,S=p.seriesIndex,_=p.dataPointIndex,k=_===void 0?null:_,T=p.radius,B=T===void 0?null:T,q=p.size,te=q===void 0?null:q,ue=p.strokeWidth,de=ue===void 0?null:ue,xe=this.w,we=this.getMarkerStyle(S),ke=te===null?xe.globals.markers.size[S]:te,Me=xe.config.markers;return k!==null&&Me.discrete.length&&Me.discrete.map(function(Ye){Ye.seriesIndex===S&&Ye.dataPointIndex===k&&(we.pointStrokeColor=Ye.strokeColor,we.pointFillColor=Ye.fillColor,ke=Ye.size,we.pointShape=Ye.shape)}),{pSize:B===null?ke:B,pRadius:B!==null?B:Me.radius,pointStrokeWidth:de!==null?de:Array.isArray(Me.strokeWidth)?Me.strokeWidth[S]:Me.strokeWidth,pointStrokeColor:we.pointStrokeColor,pointFillColor:we.pointFillColor,shape:we.pointShape||(Array.isArray(Me.shape)?Me.shape[S]:Me.shape),class:h,pointStrokeOpacity:Array.isArray(Me.strokeOpacity)?Me.strokeOpacity[S]:Me.strokeOpacity,pointStrokeDashArray:Array.isArray(Me.strokeDashArray)?Me.strokeDashArray[S]:Me.strokeDashArray,pointFillOpacity:Array.isArray(Me.fillOpacity)?Me.fillOpacity[S]:Me.fillOpacity,seriesIndex:S}}},{key:"addEvents",value:function(p){var h=this.w,S=new z(this.ctx);p.node.addEventListener("mouseenter",S.pathMouseEnter.bind(this.ctx,p)),p.node.addEventListener("mouseleave",S.pathMouseLeave.bind(this.ctx,p)),p.node.addEventListener("mousedown",S.pathMouseDown.bind(this.ctx,p)),p.node.addEventListener("click",h.config.markers.onClick),p.node.addEventListener("dblclick",h.config.markers.onDblClick),p.node.addEventListener("touchstart",S.pathMouseDown.bind(this.ctx,p),{passive:!0})}},{key:"getMarkerStyle",value:function(p){var h=this.w,S=h.globals.markers.colors,_=h.config.markers.strokeColor||h.config.markers.strokeColors;return{pointStrokeColor:Array.isArray(_)?_[p]:_,pointFillColor:Array.isArray(S)?S[p]:S}}}]),Ee}(),je=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.initialAnim=this.w.config.chart.animations.enabled}return o(Ee,[{key:"draw",value:function(p,h,S){var _=this.w,k=new z(this.ctx),T=S.realIndex,B=S.pointsPos,q=S.zRatio,te=S.elParent,ue=k.group({class:"apexcharts-series-markers apexcharts-series-".concat(_.config.chart.type)});if(ue.attr("clip-path","url(#gridRectMarkerMask".concat(_.globals.cuid,")")),Array.isArray(B.x))for(var de=0;de<B.x.length;de++){var xe=h+1,we=!0;h===0&&de===0&&(xe=0),h===0&&de===1&&(xe=1);var ke=_.globals.markers.size[T];if(q!==1/0){var Me=_.config.plotOptions.bubble;ke=_.globals.seriesZ[T][xe],Me.zScaling&&(ke/=q),Me.minBubbleRadius&&ke<Me.minBubbleRadius&&(ke=Me.minBubbleRadius),Me.maxBubbleRadius&&ke>Me.maxBubbleRadius&&(ke=Me.maxBubbleRadius)}var Ye=B.x[de],Fe=B.y[de];if(ke=ke||0,Fe!==null&&_.globals.series[T][xe]!==void 0||(we=!1),we){var rt=this.drawPoint(Ye,Fe,ke,T,xe,h);ue.add(rt)}te.add(ue)}}},{key:"drawPoint",value:function(p,h,S,_,k,T){var B=this.w,q=_,te=new U(this.ctx),ue=new L(this.ctx),de=new Ne(this.ctx),xe=new be(this.ctx),we=new z(this.ctx),ke=xe.getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:q,dataPointIndex:k,radius:B.config.chart.type==="bubble"||B.globals.comboCharts&&B.config.series[_]&&B.config.series[_].type==="bubble"?S:null}),Me=de.fillPath({seriesNumber:_,dataPointIndex:k,color:ke.pointFillColor,patternUnits:"objectBoundingBox",value:B.globals.series[_][T]}),Ye=we.drawMarker(p,h,ke);if(B.config.series[q].data[k]&&B.config.series[q].data[k].fillColor&&(Me=B.config.series[q].data[k].fillColor),Ye.attr({fill:Me}),B.config.chart.dropShadow.enabled){var Fe=B.config.chart.dropShadow;ue.dropShadow(Ye,Fe,_)}if(!this.initialAnim||B.globals.dataChanged||B.globals.resized)B.globals.animationEnded=!0;else{var rt=B.config.chart.animations.speed;te.animateMarker(Ye,rt,B.globals.easing,function(){window.setTimeout(function(){te.animationCompleted(Ye)},100)})}return Ye.attr({rel:k,j:k,index:_,"default-marker-size":ke.pSize}),ue.setSelectionFilter(Ye,_,k),xe.addEvents(Ye),Ye.node.classList.add("apexcharts-marker"),Ye}},{key:"centerTextInBubble",value:function(p){var h=this.w;return{y:p+=parseInt(h.config.dataLabels.style.fontSize,10)/4}}}]),Ee}(),Ie=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"dataLabelsCorrection",value:function(p,h,S,_,k,T,B){var q=this.w,te=!1,ue=new z(this.ctx).getTextRects(S,B),de=ue.width,xe=ue.height;h<0&&(h=0),h>q.globals.gridHeight+xe&&(h=q.globals.gridHeight+xe/2),q.globals.dataLabelsRects[_]===void 0&&(q.globals.dataLabelsRects[_]=[]),q.globals.dataLabelsRects[_].push({x:p,y:h,width:de,height:xe});var we=q.globals.dataLabelsRects[_].length-2,ke=q.globals.lastDrawnDataLabelsIndexes[_]!==void 0?q.globals.lastDrawnDataLabelsIndexes[_][q.globals.lastDrawnDataLabelsIndexes[_].length-1]:0;if(q.globals.dataLabelsRects[_][we]!==void 0){var Me=q.globals.dataLabelsRects[_][ke];(p>Me.x+Me.width||h>Me.y+Me.height||h+xe<Me.y||p+de<Me.x)&&(te=!0)}return(k===0||T)&&(te=!0),{x:p,y:h,textRects:ue,drawnextLabel:te}}},{key:"drawDataLabel",value:function(p){var h=this,S=p.type,_=p.pos,k=p.i,T=p.j,B=p.isRangeStart,q=p.strokeWidth,te=q===void 0?2:q,ue=this.w,de=new z(this.ctx),xe=ue.config.dataLabels,we=0,ke=0,Me=T,Ye=null;if(ue.globals.collapsedSeriesIndices.indexOf(k)!==-1||!xe.enabled||!Array.isArray(_.x))return Ye;Ye=de.group({class:"apexcharts-data-labels"});for(var Fe=0;Fe<_.x.length;Fe++)if(we=_.x[Fe]+xe.offsetX,ke=_.y[Fe]+xe.offsetY+te,!isNaN(we)){T===1&&Fe===0&&(Me=0),T===1&&Fe===1&&(Me=1);var rt=ue.globals.series[k][Me];S==="rangeArea"&&(rt=B?ue.globals.seriesRangeStart[k][Me]:ue.globals.seriesRangeEnd[k][Me]);var se="",Ce=function(Le){return ue.config.dataLabels.formatter(Le,{ctx:h.ctx,seriesIndex:k,dataPointIndex:Me,w:ue})};ue.config.chart.type==="bubble"?(se=Ce(rt=ue.globals.seriesZ[k][Me]),ke=_.y[Fe],ke=new je(this.ctx).centerTextInBubble(ke,k,Me).y):rt!==void 0&&(se=Ce(rt));var De=ue.config.dataLabels.textAnchor;ue.globals.isSlopeChart&&(De=Me===0?"end":Me===ue.config.series[k].data.length-1?"start":"middle"),this.plotDataLabelsText({x:we,y:ke,text:se,i:k,j:Me,parent:Ye,offsetCorrection:!0,dataLabelsConfig:ue.config.dataLabels,textAnchor:De})}return Ye}},{key:"plotDataLabelsText",value:function(p){var h=this.w,S=new z(this.ctx),_=p.x,k=p.y,T=p.i,B=p.j,q=p.text,te=p.textAnchor,ue=p.fontSize,de=p.parent,xe=p.dataLabelsConfig,we=p.color,ke=p.alwaysDrawDataLabel,Me=p.offsetCorrection,Ye=p.className,Fe=null;if(Array.isArray(h.config.dataLabels.enabledOnSeries)&&h.config.dataLabels.enabledOnSeries.indexOf(T)<0)return Fe;var rt={x:_,y:k,drawnextLabel:!0,textRects:null};Me&&(rt=this.dataLabelsCorrection(_,k,q,T,B,ke,parseInt(xe.style.fontSize,10))),h.globals.zoomed||(_=rt.x,k=rt.y),rt.textRects&&(_<-20-rt.textRects.width||_>h.globals.gridWidth+rt.textRects.width+30)&&(q="");var se=h.globals.dataLabels.style.colors[T];((h.config.chart.type==="bar"||h.config.chart.type==="rangeBar")&&h.config.plotOptions.bar.distributed||h.config.dataLabels.distributed)&&(se=h.globals.dataLabels.style.colors[B]),typeof se=="function"&&(se=se({series:h.globals.series,seriesIndex:T,dataPointIndex:B,w:h})),we&&(se=we);var Ce=xe.offsetX,De=xe.offsetY;if(h.config.chart.type!=="bar"&&h.config.chart.type!=="rangeBar"||(Ce=0,De=0),h.globals.isSlopeChart&&(B!==0&&(Ce=-2*xe.offsetX+5),B!==0&&B!==h.config.series[T].data.length-1&&(Ce=0)),rt.drawnextLabel){if((Fe=S.drawText({width:100,height:parseInt(xe.style.fontSize,10),x:_+Ce,y:k+De,foreColor:se,textAnchor:te||xe.textAnchor,text:q,fontSize:ue||xe.style.fontSize,fontFamily:xe.style.fontFamily,fontWeight:xe.style.fontWeight||"normal"})).attr({class:Ye||"apexcharts-datalabel",cx:_,cy:k}),xe.dropShadow.enabled){var Le=xe.dropShadow;new L(this.ctx).dropShadow(Fe,Le)}de.add(Fe),h.globals.lastDrawnDataLabelsIndexes[T]===void 0&&(h.globals.lastDrawnDataLabelsIndexes[T]=[]),h.globals.lastDrawnDataLabelsIndexes[T].push(B)}return Fe}},{key:"addBackgroundToDataLabel",value:function(p,h){var S=this.w,_=S.config.dataLabels.background,k=_.padding,T=_.padding/2,B=h.width,q=h.height,te=new z(this.ctx).drawRect(h.x-k,h.y-T/2,B+2*k,q+T,_.borderRadius,S.config.chart.background!=="transparent"&&S.config.chart.background?S.config.chart.background:"#fff",_.opacity,_.borderWidth,_.borderColor);return _.dropShadow.enabled&&new L(this.ctx).dropShadow(te,_.dropShadow),te}},{key:"dataLabelsBackground",value:function(){var p=this.w;if(p.config.chart.type!=="bubble")for(var h=p.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels text"),S=0;S<h.length;S++){var _=h[S],k=_.getBBox(),T=null;if(k.width&&k.height&&(T=this.addBackgroundToDataLabel(_,k)),T){_.parentNode.insertBefore(T.node,_);var B=_.getAttribute("fill");p.config.chart.animations.enabled&&!p.globals.resized&&!p.globals.dataChanged?T.animate().attr({fill:B}):T.attr({fill:B}),_.setAttribute("fill",p.config.dataLabels.background.foreColor)}}}},{key:"bringForward",value:function(){for(var p=this.w,h=p.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels"),S=p.globals.dom.baseEl.querySelector(".apexcharts-plot-series:last-child"),_=0;_<h.length;_++)S&&S.insertBefore(h[_],S.nextSibling)}}]),Ee}(),Re=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.legendInactiveClass="legend-mouseover-inactive"}return o(Ee,[{key:"getAllSeriesEls",value:function(){return this.w.globals.dom.baseEl.getElementsByClassName("apexcharts-series")}},{key:"getSeriesByName",value:function(p){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner .apexcharts-series[seriesName='".concat(F.escapeString(p),"']"))}},{key:"isSeriesHidden",value:function(p){var h=this.getSeriesByName(p),S=parseInt(h.getAttribute("data:realIndex"),10);return{isHidden:h.classList.contains("apexcharts-series-collapsed"),realIndex:S}}},{key:"addCollapsedClassToSeries",value:function(p,h){var S=this.w;function _(k){for(var T=0;T<k.length;T++)k[T].index===h&&p.node.classList.add("apexcharts-series-collapsed")}_(S.globals.collapsedSeries),_(S.globals.ancillaryCollapsedSeries)}},{key:"toggleSeries",value:function(p){var h=this.isSeriesHidden(p);return this.ctx.legend.legendHelpers.toggleDataSeries(h.realIndex,h.isHidden),h.isHidden}},{key:"showSeries",value:function(p){var h=this.isSeriesHidden(p);h.isHidden&&this.ctx.legend.legendHelpers.toggleDataSeries(h.realIndex,!0)}},{key:"hideSeries",value:function(p){var h=this.isSeriesHidden(p);h.isHidden||this.ctx.legend.legendHelpers.toggleDataSeries(h.realIndex,!1)}},{key:"resetSeries",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],h=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],_=this.w,k=F.clone(_.globals.initialSeries);_.globals.previousPaths=[],S?(_.globals.collapsedSeries=[],_.globals.ancillaryCollapsedSeries=[],_.globals.collapsedSeriesIndices=[],_.globals.ancillaryCollapsedSeriesIndices=[]):k=this.emptyCollapsedSeries(k),_.config.series=k,p&&(h&&(_.globals.zoomed=!1,this.ctx.updateHelpers.revertDefaultAxisMinMax()),this.ctx.updateHelpers._updateSeries(k,_.config.chart.animations.dynamicAnimation.enabled))}},{key:"emptyCollapsedSeries",value:function(p){for(var h=this.w,S=0;S<p.length;S++)h.globals.collapsedSeriesIndices.indexOf(S)>-1&&(p[S].data=[]);return p}},{key:"highlightSeries",value:function(p){var h=this.w,S=this.getSeriesByName(p),_=parseInt(S==null?void 0:S.getAttribute("data:realIndex"),10),k=h.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis"),T=null,B=null,q=null;if(h.globals.axisCharts||h.config.chart.type==="radialBar")if(h.globals.axisCharts){T=h.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(_,"']")),B=h.globals.dom.baseEl.querySelector(".apexcharts-datalabels[data\\:realIndex='".concat(_,"']"));var te=h.globals.seriesYAxisReverseMap[_];q=h.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(te,"']"))}else T=h.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(_+1,"']"));else T=h.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(_+1,"'] path"));for(var ue=0;ue<k.length;ue++)k[ue].classList.add(this.legendInactiveClass);if(T)h.globals.axisCharts||T.parentNode.classList.remove(this.legendInactiveClass),T.classList.remove(this.legendInactiveClass),B!==null&&B.classList.remove(this.legendInactiveClass),q!==null&&q.classList.remove(this.legendInactiveClass);else for(var de=0;de<k.length;de++)k[de].classList.remove(this.legendInactiveClass)}},{key:"toggleSeriesOnHover",value:function(p,h){var S=this.w;h||(h=p.target);var _=S.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis");if(p.type==="mousemove"){var k=parseInt(h.getAttribute("rel"),10)-1;this.highlightSeries(S.globals.seriesNames[k])}else if(p.type==="mouseout")for(var T=0;T<_.length;T++)_[T].classList.remove(this.legendInactiveClass)}},{key:"highlightRangeInSeries",value:function(p,h){var S=this,_=this.w,k=_.globals.dom.baseEl.getElementsByClassName("apexcharts-heatmap-rect"),T=function(te){for(var ue=0;ue<k.length;ue++)k[ue].classList[te](S.legendInactiveClass)};if(p.type==="mousemove"){var B=parseInt(h.getAttribute("rel"),10)-1;T("add");var q=_.config.plotOptions.heatmap.colorScale.ranges;(function(te,ue){for(var de=0;de<k.length;de++){var xe=Number(k[de].getAttribute("val"));xe>=te.from&&(xe<te.to||te.to===ue&&xe===ue)&&k[de].classList.remove(S.legendInactiveClass)}})(q[B],q.reduce(function(te,ue){return Math.max(te,ue.to)},0))}else p.type==="mouseout"&&T("remove")}},{key:"getActiveConfigSeriesIndex",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"asc",h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],S=this.w,_=0;if(S.config.series.length>1){for(var k=S.config.series.map(function(B,q){return B.data&&B.data.length>0&&S.globals.collapsedSeriesIndices.indexOf(q)===-1&&(!S.globals.comboCharts||h.length===0||h.length&&h.indexOf(S.config.series[q].type)>-1)?q:-1}),T=p==="asc"?0:k.length-1;p==="asc"?T<k.length:T>=0;p==="asc"?T++:T--)if(k[T]!==-1){_=k[T];break}}return _}},{key:"getBarSeriesIndices",value:function(){return this.w.globals.comboCharts?this.w.config.series.map(function(p,h){return p.type==="bar"||p.type==="column"?h:-1}).filter(function(p){return p!==-1}):this.w.config.series.map(function(p,h){return h})}},{key:"getPreviousPaths",value:function(){var p=this.w;function h(T,B,q){for(var te=T[B].childNodes,ue={type:q,paths:[],realIndex:T[B].getAttribute("data:realIndex")},de=0;de<te.length;de++)if(te[de].hasAttribute("pathTo")){var xe=te[de].getAttribute("pathTo");ue.paths.push({d:xe})}p.globals.previousPaths.push(ue)}p.globals.previousPaths=[],["line","area","bar","rangebar","rangeArea","candlestick","radar"].forEach(function(T){for(var B,q=(B=T,p.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(B,"-series .apexcharts-series"))),te=0;te<q.length;te++)h(q,te,T)}),this.handlePrevBubbleScatterPaths("bubble"),this.handlePrevBubbleScatterPaths("scatter");var S=p.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(p.config.chart.type," .apexcharts-series"));if(S.length>0)for(var _=function(T){for(var B=p.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(p.config.chart.type," .apexcharts-series[data\\:realIndex='").concat(T,"'] rect")),q=[],te=function(de){var xe=function(ke){return B[de].getAttribute(ke)},we={x:parseFloat(xe("x")),y:parseFloat(xe("y")),width:parseFloat(xe("width")),height:parseFloat(xe("height"))};q.push({rect:we,color:B[de].getAttribute("color")})},ue=0;ue<B.length;ue++)te(ue);p.globals.previousPaths.push(q)},k=0;k<S.length;k++)_(k);p.globals.axisCharts||(p.globals.previousPaths=p.globals.series)}},{key:"handlePrevBubbleScatterPaths",value:function(p){var h=this.w,S=h.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(p,"-series .apexcharts-series"));if(S.length>0)for(var _=0;_<S.length;_++){for(var k=h.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(p,"-series .apexcharts-series[data\\:realIndex='").concat(_,"'] circle")),T=[],B=0;B<k.length;B++)T.push({x:k[B].getAttribute("cx"),y:k[B].getAttribute("cy"),r:k[B].getAttribute("r")});h.globals.previousPaths.push(T)}}},{key:"clearPreviousPaths",value:function(){var p=this.w;p.globals.previousPaths=[],p.globals.allSeriesCollapsed=!1}},{key:"handleNoData",value:function(){var p=this.w,h=p.config.noData,S=new z(this.ctx),_=p.globals.svgWidth/2,k=p.globals.svgHeight/2,T="middle";if(p.globals.noData=!0,p.globals.animationEnded=!0,h.align==="left"?(_=10,T="start"):h.align==="right"&&(_=p.globals.svgWidth-10,T="end"),h.verticalAlign==="top"?k=50:h.verticalAlign==="bottom"&&(k=p.globals.svgHeight-50),_+=h.offsetX,k=k+parseInt(h.style.fontSize,10)+2+h.offsetY,h.text!==void 0&&h.text!==""){var B=S.drawText({x:_,y:k,text:h.text,textAnchor:T,fontSize:h.style.fontSize,fontFamily:h.style.fontFamily,foreColor:h.style.color,opacity:1,class:"apexcharts-text-nodata"});p.globals.dom.Paper.add(B)}}},{key:"setNullSeriesToZeroValues",value:function(p){for(var h=this.w,S=0;S<p.length;S++)if(p[S].length===0)for(var _=0;_<p[h.globals.maxValsInArrayIndex].length;_++)p[S].push(0);return p}},{key:"hasAllSeriesEqualX",value:function(){for(var p=!0,h=this.w,S=this.filteredSeriesX(),_=0;_<S.length-1;_++)if(S[_][0]!==S[_+1][0]){p=!1;break}return h.globals.allSeriesHasEqualX=p,p}},{key:"filteredSeriesX",value:function(){var p=this.w.globals.seriesX.map(function(h){return h.length>0?h:[]});return p}}]),Ee}(),Qe=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.twoDSeries=[],this.threeDSeries=[],this.twoDSeriesX=[],this.seriesGoals=[],this.coreUtils=new X(this.ctx)}return o(Ee,[{key:"isMultiFormat",value:function(){return this.isFormatXY()||this.isFormat2DArray()}},{key:"isFormatXY",value:function(){var p=this.w.config.series.slice(),h=new Re(this.ctx);if(this.activeSeriesIndex=h.getActiveConfigSeriesIndex(),p[this.activeSeriesIndex].data!==void 0&&p[this.activeSeriesIndex].data.length>0&&p[this.activeSeriesIndex].data[0]!==null&&p[this.activeSeriesIndex].data[0].x!==void 0&&p[this.activeSeriesIndex].data[0]!==null)return!0}},{key:"isFormat2DArray",value:function(){var p=this.w.config.series.slice(),h=new Re(this.ctx);if(this.activeSeriesIndex=h.getActiveConfigSeriesIndex(),p[this.activeSeriesIndex].data!==void 0&&p[this.activeSeriesIndex].data.length>0&&p[this.activeSeriesIndex].data[0]!==void 0&&p[this.activeSeriesIndex].data[0]!==null&&p[this.activeSeriesIndex].data[0].constructor===Array)return!0}},{key:"handleFormat2DArray",value:function(p,h){for(var S=this.w.config,_=this.w.globals,k=S.chart.type==="boxPlot"||S.series[h].type==="boxPlot",T=0;T<p[h].data.length;T++)if(p[h].data[T][1]!==void 0&&(Array.isArray(p[h].data[T][1])&&p[h].data[T][1].length===4&&!k?this.twoDSeries.push(F.parseNumber(p[h].data[T][1][3])):p[h].data[T].length>=5?this.twoDSeries.push(F.parseNumber(p[h].data[T][4])):this.twoDSeries.push(F.parseNumber(p[h].data[T][1])),_.dataFormatXNumeric=!0),S.xaxis.type==="datetime"){var B=new Date(p[h].data[T][0]);B=new Date(B).getTime(),this.twoDSeriesX.push(B)}else this.twoDSeriesX.push(p[h].data[T][0]);for(var q=0;q<p[h].data.length;q++)p[h].data[q][2]!==void 0&&(this.threeDSeries.push(p[h].data[q][2]),_.isDataXYZ=!0)}},{key:"handleFormatXY",value:function(p,h){var S=this.w.config,_=this.w.globals,k=new Z(this.ctx),T=h;_.collapsedSeriesIndices.indexOf(h)>-1&&(T=this.activeSeriesIndex);for(var B=0;B<p[h].data.length;B++)p[h].data[B].y!==void 0&&(Array.isArray(p[h].data[B].y)?this.twoDSeries.push(F.parseNumber(p[h].data[B].y[p[h].data[B].y.length-1])):this.twoDSeries.push(F.parseNumber(p[h].data[B].y))),p[h].data[B].goals!==void 0&&Array.isArray(p[h].data[B].goals)?(this.seriesGoals[h]===void 0&&(this.seriesGoals[h]=[]),this.seriesGoals[h].push(p[h].data[B].goals)):(this.seriesGoals[h]===void 0&&(this.seriesGoals[h]=[]),this.seriesGoals[h].push(null));for(var q=0;q<p[T].data.length;q++){var te=typeof p[T].data[q].x=="string",ue=Array.isArray(p[T].data[q].x),de=!ue&&!!k.isValidDate(p[T].data[q].x);if(te||de)if(te||S.xaxis.convertedCatToNumeric){var xe=_.isBarHorizontal&&_.isRangeData;S.xaxis.type!=="datetime"||xe?(this.fallbackToCategory=!0,this.twoDSeriesX.push(p[T].data[q].x),isNaN(p[T].data[q].x)||this.w.config.xaxis.type==="category"||typeof p[T].data[q].x=="string"||(_.isXNumeric=!0)):this.twoDSeriesX.push(k.parseDate(p[T].data[q].x))}else S.xaxis.type==="datetime"?this.twoDSeriesX.push(k.parseDate(p[T].data[q].x.toString())):(_.dataFormatXNumeric=!0,_.isXNumeric=!0,this.twoDSeriesX.push(parseFloat(p[T].data[q].x)));else ue?(this.fallbackToCategory=!0,this.twoDSeriesX.push(p[T].data[q].x)):(_.isXNumeric=!0,_.dataFormatXNumeric=!0,this.twoDSeriesX.push(p[T].data[q].x))}if(p[h].data[0]&&p[h].data[0].z!==void 0){for(var we=0;we<p[h].data.length;we++)this.threeDSeries.push(p[h].data[we].z);_.isDataXYZ=!0}}},{key:"handleRangeData",value:function(p,h){var S=this.w.globals,_={};return this.isFormat2DArray()?_=this.handleRangeDataFormat("array",p,h):this.isFormatXY()&&(_=this.handleRangeDataFormat("xy",p,h)),S.seriesRangeStart.push(_.start===void 0?[]:_.start),S.seriesRangeEnd.push(_.end===void 0?[]:_.end),S.seriesRange.push(_.rangeUniques),S.seriesRange.forEach(function(k,T){k&&k.forEach(function(B,q){B.y.forEach(function(te,ue){for(var de=0;de<B.y.length;de++)if(ue!==de){var xe=te.y1,we=te.y2,ke=B.y[de].y1;xe<=B.y[de].y2&&ke<=we&&(B.overlaps.indexOf(te.rangeName)<0&&B.overlaps.push(te.rangeName),B.overlaps.indexOf(B.y[de].rangeName)<0&&B.overlaps.push(B.y[de].rangeName))}})})}),_}},{key:"handleCandleStickBoxData",value:function(p,h){var S=this.w.globals,_={};return this.isFormat2DArray()?_=this.handleCandleStickBoxDataFormat("array",p,h):this.isFormatXY()&&(_=this.handleCandleStickBoxDataFormat("xy",p,h)),S.seriesCandleO[h]=_.o,S.seriesCandleH[h]=_.h,S.seriesCandleM[h]=_.m,S.seriesCandleL[h]=_.l,S.seriesCandleC[h]=_.c,_}},{key:"handleRangeDataFormat",value:function(p,h,S){var _=[],k=[],T=h[S].data.filter(function(ue,de,xe){return de===xe.findIndex(function(we){return we.x===ue.x})}).map(function(ue,de){return{x:ue.x,overlaps:[],y:[]}});if(p==="array")for(var B=0;B<h[S].data.length;B++)Array.isArray(h[S].data[B])?(_.push(h[S].data[B][1][0]),k.push(h[S].data[B][1][1])):(_.push(h[S].data[B]),k.push(h[S].data[B]));else if(p==="xy")for(var q=function(ue){var de=Array.isArray(h[S].data[ue].y),xe=F.randomId(),we=h[S].data[ue].x,ke={y1:de?h[S].data[ue].y[0]:h[S].data[ue].y,y2:de?h[S].data[ue].y[1]:h[S].data[ue].y,rangeName:xe};h[S].data[ue].rangeName=xe;var Me=T.findIndex(function(Ye){return Ye.x===we});T[Me].y.push(ke),_.push(ke.y1),k.push(ke.y2)},te=0;te<h[S].data.length;te++)q(te);return{start:_,end:k,rangeUniques:T}}},{key:"handleCandleStickBoxDataFormat",value:function(p,h,S){var _=this.w,k=_.config.chart.type==="boxPlot"||_.config.series[S].type==="boxPlot",T=[],B=[],q=[],te=[],ue=[];if(p==="array")if(k&&h[S].data[0].length===6||!k&&h[S].data[0].length===5)for(var de=0;de<h[S].data.length;de++)T.push(h[S].data[de][1]),B.push(h[S].data[de][2]),k?(q.push(h[S].data[de][3]),te.push(h[S].data[de][4]),ue.push(h[S].data[de][5])):(te.push(h[S].data[de][3]),ue.push(h[S].data[de][4]));else for(var xe=0;xe<h[S].data.length;xe++)Array.isArray(h[S].data[xe][1])&&(T.push(h[S].data[xe][1][0]),B.push(h[S].data[xe][1][1]),k?(q.push(h[S].data[xe][1][2]),te.push(h[S].data[xe][1][3]),ue.push(h[S].data[xe][1][4])):(te.push(h[S].data[xe][1][2]),ue.push(h[S].data[xe][1][3])));else if(p==="xy")for(var we=0;we<h[S].data.length;we++)Array.isArray(h[S].data[we].y)&&(T.push(h[S].data[we].y[0]),B.push(h[S].data[we].y[1]),k?(q.push(h[S].data[we].y[2]),te.push(h[S].data[we].y[3]),ue.push(h[S].data[we].y[4])):(te.push(h[S].data[we].y[2]),ue.push(h[S].data[we].y[3])));return{o:T,h:B,m:q,l:te,c:ue}}},{key:"parseDataAxisCharts",value:function(p){var h=this,S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.ctx,_=this.w.config,k=this.w.globals,T=new Z(S),B=_.labels.length>0?_.labels.slice():_.xaxis.categories.slice();k.isRangeBar=_.chart.type==="rangeBar"&&k.isBarHorizontal,k.hasXaxisGroups=_.xaxis.type==="category"&&_.xaxis.group.groups.length>0,k.hasXaxisGroups&&(k.groups=_.xaxis.group.groups),p.forEach(function(we,ke){we.name!==void 0?k.seriesNames.push(we.name):k.seriesNames.push("series-"+parseInt(ke+1,10))}),this.coreUtils.setSeriesYAxisMappings();var q=[],te=N(new Set(_.series.map(function(we){return we.group})));_.series.forEach(function(we,ke){var Me=te.indexOf(we.group);q[Me]||(q[Me]=[]),q[Me].push(k.seriesNames[ke])}),k.seriesGroups=q;for(var ue=function(){for(var we=0;we<B.length;we++)if(typeof B[we]=="string"){if(!T.isValidDate(B[we]))throw new Error("You have provided invalid Date format. Please provide a valid JavaScript Date");h.twoDSeriesX.push(T.parseDate(B[we]))}else h.twoDSeriesX.push(B[we])},de=0;de<p.length;de++){if(this.twoDSeries=[],this.twoDSeriesX=[],this.threeDSeries=[],p[de].data===void 0)return void console.error("It is a possibility that you may have not included 'data' property in series.");if(_.chart.type!=="rangeBar"&&_.chart.type!=="rangeArea"&&p[de].type!=="rangeBar"&&p[de].type!=="rangeArea"||(k.isRangeData=!0,_.chart.type!=="rangeBar"&&_.chart.type!=="rangeArea"||this.handleRangeData(p,de)),this.isMultiFormat())this.isFormat2DArray()?this.handleFormat2DArray(p,de):this.isFormatXY()&&this.handleFormatXY(p,de),_.chart.type!=="candlestick"&&p[de].type!=="candlestick"&&_.chart.type!=="boxPlot"&&p[de].type!=="boxPlot"||this.handleCandleStickBoxData(p,de),k.series.push(this.twoDSeries),k.labels.push(this.twoDSeriesX),k.seriesX.push(this.twoDSeriesX),k.seriesGoals=this.seriesGoals,de!==this.activeSeriesIndex||this.fallbackToCategory||(k.isXNumeric=!0);else{_.xaxis.type==="datetime"?(k.isXNumeric=!0,ue(),k.seriesX.push(this.twoDSeriesX)):_.xaxis.type==="numeric"&&(k.isXNumeric=!0,B.length>0&&(this.twoDSeriesX=B,k.seriesX.push(this.twoDSeriesX))),k.labels.push(this.twoDSeriesX);var xe=p[de].data.map(function(we){return F.parseNumber(we)});k.series.push(xe)}k.seriesZ.push(this.threeDSeries),p[de].color!==void 0?k.seriesColors.push(p[de].color):k.seriesColors.push(void 0)}return this.w}},{key:"parseDataNonAxisCharts",value:function(p){var h=this.w.globals,S=this.w.config;h.series=p.slice(),h.seriesNames=S.labels.slice();for(var _=0;_<h.series.length;_++)h.seriesNames[_]===void 0&&h.seriesNames.push("series-"+(_+1));return this.w}},{key:"handleExternalLabelsData",value:function(p){var h=this.w.config,S=this.w.globals;h.xaxis.categories.length>0?S.labels=h.xaxis.categories:h.labels.length>0?S.labels=h.labels.slice():this.fallbackToCategory?(S.labels=S.labels[0],S.seriesRange.length&&(S.seriesRange.map(function(_){_.forEach(function(k){S.labels.indexOf(k.x)<0&&k.x&&S.labels.push(k.x)})}),S.labels=Array.from(new Set(S.labels.map(JSON.stringify)),JSON.parse)),h.xaxis.convertedCatToNumeric&&(new fe(h).convertCatToNumericXaxis(h,this.ctx,S.seriesX[0]),this._generateExternalLabels(p))):this._generateExternalLabels(p)}},{key:"_generateExternalLabels",value:function(p){var h=this.w.globals,S=this.w.config,_=[];if(h.axisCharts){if(h.series.length>0)if(this.isFormatXY())for(var k=S.series.map(function(de,xe){return de.data.filter(function(we,ke,Me){return Me.findIndex(function(Ye){return Ye.x===we.x})===ke})}),T=k.reduce(function(de,xe,we,ke){return ke[de].length>xe.length?de:we},0),B=0;B<k[T].length;B++)_.push(B+1);else for(var q=0;q<h.series[h.maxValsInArrayIndex].length;q++)_.push(q+1);h.seriesX=[];for(var te=0;te<p.length;te++)h.seriesX.push(_);this.w.globals.isBarHorizontal||(h.isXNumeric=!0)}if(_.length===0){_=h.axisCharts?[]:h.series.map(function(de,xe){return xe+1});for(var ue=0;ue<p.length;ue++)h.seriesX.push(_)}h.labels=_,S.xaxis.convertedCatToNumeric&&(h.categoryLabels=_.map(function(de){return S.xaxis.labels.formatter(de)})),h.noLabelsProvided=!0}},{key:"parseData",value:function(p){var h=this.w,S=h.config,_=h.globals;if(this.excludeCollapsedSeriesInYAxis(),this.fallbackToCategory=!1,this.ctx.core.resetGlobals(),this.ctx.core.isMultipleY(),_.axisCharts?(this.parseDataAxisCharts(p),this.coreUtils.getLargestSeries()):this.parseDataNonAxisCharts(p),S.chart.stacked){var k=new Re(this.ctx);_.series=k.setNullSeriesToZeroValues(_.series)}this.coreUtils.getSeriesTotals(),_.axisCharts&&(_.stackedSeriesTotals=this.coreUtils.getStackedSeriesTotals(),_.stackedSeriesTotalsByGroups=this.coreUtils.getStackedSeriesTotalsByGroups()),this.coreUtils.getPercentSeries(),_.dataFormatXNumeric||_.isXNumeric&&(S.xaxis.type!=="numeric"||S.labels.length!==0||S.xaxis.categories.length!==0)||this.handleExternalLabelsData(p);for(var T=this.coreUtils.getCategoryLabels(_.labels),B=0;B<T.length;B++)if(Array.isArray(T[B])){_.isMultiLineX=!0;break}}},{key:"excludeCollapsedSeriesInYAxis",value:function(){var p=this.w,h=[];p.globals.seriesYAxisMap.forEach(function(S,_){var k=0;S.forEach(function(T){p.globals.collapsedSeriesIndices.indexOf(T)!==-1&&k++}),k>0&&k==S.length&&h.push(_)}),p.globals.ignoreYAxisIndexes=h.map(function(S){return S})}}]),Ee}(),Be=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"scaleSvgNode",value:function(p,h){var S=parseFloat(p.getAttributeNS(null,"width")),_=parseFloat(p.getAttributeNS(null,"height"));p.setAttributeNS(null,"width",S*h),p.setAttributeNS(null,"height",_*h),p.setAttributeNS(null,"viewBox","0 0 "+S+" "+_)}},{key:"getSvgString",value:function(){var p=this;return new Promise(function(h){var S=p.w,_=S.config.chart.toolbar.export.width,k=S.config.chart.toolbar.export.scale||_/S.globals.svgWidth;k||(k=1);var T=p.w.globals.dom.Paper.svg(),B=p.w.globals.dom.Paper.node.cloneNode(!0);k!==1&&p.scaleSvgNode(B,k),p.convertImagesToBase64(B).then(function(){T=new XMLSerializer().serializeToString(B),h(T.replace(/&nbsp;/g,"&#160;"))})})}},{key:"convertImagesToBase64",value:function(p){var h=this,S=p.getElementsByTagName("image"),_=Array.from(S).map(function(k){var T=k.getAttributeNS("http://www.w3.org/1999/xlink","href");return T&&!T.startsWith("data:")?h.getBase64FromUrl(T).then(function(B){k.setAttributeNS("http://www.w3.org/1999/xlink","href",B)}).catch(function(B){console.error("Error converting image to base64:",B)}):Promise.resolve()});return Promise.all(_)}},{key:"getBase64FromUrl",value:function(p){return new Promise(function(h,S){var _=new Image;_.crossOrigin="Anonymous",_.onload=function(){var k=document.createElement("canvas");k.width=_.width,k.height=_.height,k.getContext("2d").drawImage(_,0,0),h(k.toDataURL())},_.onerror=S,_.src=p})}},{key:"cleanup",value:function(){var p=this.w,h=p.globals.dom.baseEl.getElementsByClassName("apexcharts-xcrosshairs"),S=p.globals.dom.baseEl.getElementsByClassName("apexcharts-ycrosshairs"),_=p.globals.dom.baseEl.querySelectorAll(".apexcharts-zoom-rect, .apexcharts-selection-rect");Array.prototype.forEach.call(_,function(k){k.setAttribute("width",0)}),h&&h[0]&&(h[0].setAttribute("x",-500),h[0].setAttribute("x1",-500),h[0].setAttribute("x2",-500)),S&&S[0]&&(S[0].setAttribute("y",-100),S[0].setAttribute("y1",-100),S[0].setAttribute("y2",-100))}},{key:"svgUrl",value:function(){var p=this;return new Promise(function(h){p.cleanup(),p.getSvgString().then(function(S){var _=new Blob([S],{type:"image/svg+xml;charset=utf-8"});h(URL.createObjectURL(_))})})}},{key:"dataURI",value:function(p){var h=this;return new Promise(function(S){var _=h.w,k=p?p.scale||p.width/_.globals.svgWidth:1;h.cleanup();var T=document.createElement("canvas");T.width=_.globals.svgWidth*k,T.height=parseInt(_.globals.dom.elWrap.style.height,10)*k;var B=_.config.chart.background!=="transparent"&&_.config.chart.background?_.config.chart.background:"#fff",q=T.getContext("2d");q.fillStyle=B,q.fillRect(0,0,T.width*k,T.height*k),h.getSvgString().then(function(te){var ue="data:image/svg+xml,"+encodeURIComponent(te),de=new Image;de.crossOrigin="anonymous",de.onload=function(){if(q.drawImage(de,0,0),T.msToBlob){var xe=T.msToBlob();S({blob:xe})}else{var we=T.toDataURL("image/png");S({imgURI:we})}},de.src=ue})})}},{key:"exportToSVG",value:function(){var p=this;this.svgUrl().then(function(h){p.triggerDownload(h,p.w.config.chart.toolbar.export.svg.filename,".svg")})}},{key:"exportToPng",value:function(){var p=this,h=this.w.config.chart.toolbar.export.scale,S=this.w.config.chart.toolbar.export.width,_=h?{scale:h}:S?{width:S}:void 0;this.dataURI(_).then(function(k){var T=k.imgURI,B=k.blob;B?navigator.msSaveOrOpenBlob(B,p.w.globals.chartID+".png"):p.triggerDownload(T,p.w.config.chart.toolbar.export.png.filename,".png")})}},{key:"exportToCSV",value:function(p){var h=this,S=p.series,_=p.fileName,k=p.columnDelimiter,T=k===void 0?",":k,B=p.lineDelimiter,q=B===void 0?`
`:B,te=this.w;S||(S=te.config.series);var ue,de,xe=[],we=[],ke="",Me=te.globals.series.map(function(_e,nt){return te.globals.collapsedSeriesIndices.indexOf(nt)===-1?_e:[]}),Ye=function(_e){return typeof te.config.chart.toolbar.export.csv.categoryFormatter=="function"?te.config.chart.toolbar.export.csv.categoryFormatter(_e):te.config.xaxis.type==="datetime"&&String(_e).length>=10?new Date(_e).toDateString():F.isNumber(_e)?_e:_e.split(T).join("")},Fe=function(_e){return typeof te.config.chart.toolbar.export.csv.valueFormatter=="function"?te.config.chart.toolbar.export.csv.valueFormatter(_e):_e},rt=Math.max.apply(Math,N(S.map(function(_e){return _e.data?_e.data.length:0}))),se=new Qe(this.ctx),Ce=new he(this.ctx),De=function(_e){var nt="";if(te.globals.axisCharts){if(te.config.xaxis.type==="category"||te.config.xaxis.convertedCatToNumeric)if(te.globals.isBarHorizontal){var ot=te.globals.yLabelFormatters[0],gt=new Re(h.ctx).getActiveConfigSeriesIndex();nt=ot(te.globals.labels[_e],{seriesIndex:gt,dataPointIndex:_e,w:te})}else nt=Ce.getLabel(te.globals.labels,te.globals.timescaleLabels,0,_e).text;te.config.xaxis.type==="datetime"&&(te.config.xaxis.categories.length?nt=te.config.xaxis.categories[_e]:te.config.labels.length&&(nt=te.config.labels[_e]))}else nt=te.config.labels[_e];return nt===null?"nullvalue":(Array.isArray(nt)&&(nt=nt.join(" ")),F.isNumber(nt)?nt:nt.split(T).join(""))},Le=function(_e,nt){if(xe.length&&nt===0&&we.push(xe.join(T)),_e.data){_e.data=_e.data.length&&_e.data||N(Array(rt)).map(function(){return""});for(var ot=0;ot<_e.data.length;ot++){xe=[];var gt=De(ot);if(gt!=="nullvalue"){if(gt||(se.isFormatXY()?gt=S[nt].data[ot].x:se.isFormat2DArray()&&(gt=S[nt].data[ot]?S[nt].data[ot][0]:"")),nt===0){xe.push(Ye(gt));for(var Jt=0;Jt<te.globals.series.length;Jt++){var Ge,et=se.isFormatXY()?(Ge=S[Jt].data[ot])===null||Ge===void 0?void 0:Ge.y:Me[Jt][ot];xe.push(Fe(et))}}(te.config.chart.type==="candlestick"||_e.type&&_e.type==="candlestick")&&(xe.pop(),xe.push(te.globals.seriesCandleO[nt][ot]),xe.push(te.globals.seriesCandleH[nt][ot]),xe.push(te.globals.seriesCandleL[nt][ot]),xe.push(te.globals.seriesCandleC[nt][ot])),(te.config.chart.type==="boxPlot"||_e.type&&_e.type==="boxPlot")&&(xe.pop(),xe.push(te.globals.seriesCandleO[nt][ot]),xe.push(te.globals.seriesCandleH[nt][ot]),xe.push(te.globals.seriesCandleM[nt][ot]),xe.push(te.globals.seriesCandleL[nt][ot]),xe.push(te.globals.seriesCandleC[nt][ot])),te.config.chart.type==="rangeBar"&&(xe.pop(),xe.push(te.globals.seriesRangeStart[nt][ot]),xe.push(te.globals.seriesRangeEnd[nt][ot])),xe.length&&we.push(xe.join(T))}}}};xe.push(te.config.chart.toolbar.export.csv.headerCategory),te.config.chart.type==="boxPlot"?(xe.push("minimum"),xe.push("q1"),xe.push("median"),xe.push("q3"),xe.push("maximum")):te.config.chart.type==="candlestick"?(xe.push("open"),xe.push("high"),xe.push("low"),xe.push("close")):te.config.chart.type==="rangeBar"?(xe.push("minimum"),xe.push("maximum")):S.map(function(_e,nt){var ot=(_e.name?_e.name:"series-".concat(nt))+"";te.globals.axisCharts&&xe.push(ot.split(T).join("")?ot.split(T).join(""):"series-".concat(nt))}),te.globals.axisCharts||(xe.push(te.config.chart.toolbar.export.csv.headerValue),we.push(xe.join(T))),te.globals.allSeriesHasEqualX||!te.globals.axisCharts||te.config.xaxis.categories.length||te.config.labels.length?S.map(function(_e,nt){te.globals.axisCharts?Le(_e,nt):((xe=[]).push(Ye(te.globals.labels[nt])),xe.push(Fe(Me[nt])),we.push(xe.join(T)))}):(ue=new Set,de={},S.forEach(function(_e,nt){_e==null||_e.data.forEach(function(ot){var gt,Jt;if(se.isFormatXY())gt=ot.x,Jt=ot.y;else{if(!se.isFormat2DArray())return;gt=ot[0],Jt=ot[1]}de[gt]||(de[gt]=Array(S.length).fill("")),de[gt][nt]=Fe(Jt),ue.add(gt)})}),xe.length&&we.push(xe.join(T)),Array.from(ue).sort().forEach(function(_e){we.push([Ye(_e),de[_e].join(T)])})),ke+=we.join(q),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\uFEFF"+ke),_||te.config.chart.toolbar.export.csv.filename,".csv")}},{key:"triggerDownload",value:function(p,h,S){var _=document.createElement("a");_.href=p,_.download=(h||this.w.globals.chartID)+S,document.body.appendChild(_),_.click(),document.body.removeChild(_)}}]),Ee}(),it=function(){function Ee(p,h){s(this,Ee),this.ctx=p,this.elgrid=h,this.w=p.w;var S=this.w;this.axesUtils=new he(p),this.xaxisLabels=S.globals.labels.slice(),S.globals.timescaleLabels.length>0&&!S.globals.isBarHorizontal&&(this.xaxisLabels=S.globals.timescaleLabels.slice()),S.config.xaxis.overwriteCategories&&(this.xaxisLabels=S.config.xaxis.overwriteCategories),this.drawnLabels=[],this.drawnLabelsRects=[],S.config.xaxis.position==="top"?this.offY=0:this.offY=S.globals.gridHeight,this.offY=this.offY+S.config.xaxis.axisBorder.offsetY,this.isCategoryBarHorizontal=S.config.chart.type==="bar"&&S.config.plotOptions.bar.horizontal,this.xaxisFontSize=S.config.xaxis.labels.style.fontSize,this.xaxisFontFamily=S.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=S.config.xaxis.labels.style.colors,this.xaxisBorderWidth=S.config.xaxis.axisBorder.width,this.isCategoryBarHorizontal&&(this.xaxisBorderWidth=S.config.yaxis[0].axisBorder.width.toString()),this.xaxisBorderWidth.indexOf("%")>-1?this.xaxisBorderWidth=S.globals.gridWidth*parseInt(this.xaxisBorderWidth,10)/100:this.xaxisBorderWidth=parseInt(this.xaxisBorderWidth,10),this.xaxisBorderHeight=S.config.xaxis.axisBorder.height,this.yaxis=S.config.yaxis[0]}return o(Ee,[{key:"drawXaxis",value:function(){var p=this.w,h=new z(this.ctx),S=h.group({class:"apexcharts-xaxis",transform:"translate(".concat(p.config.xaxis.offsetX,", ").concat(p.config.xaxis.offsetY,")")}),_=h.group({class:"apexcharts-xaxis-texts-g",transform:"translate(".concat(p.globals.translateXAxisX,", ").concat(p.globals.translateXAxisY,")")});S.add(_);for(var k=[],T=0;T<this.xaxisLabels.length;T++)k.push(this.xaxisLabels[T]);if(this.drawXAxisLabelAndGroup(!0,h,_,k,p.globals.isXNumeric,function(ke,Me){return Me}),p.globals.hasXaxisGroups){var B=p.globals.groups;k=[];for(var q=0;q<B.length;q++)k.push(B[q].title);var te={};p.config.xaxis.group.style&&(te.xaxisFontSize=p.config.xaxis.group.style.fontSize,te.xaxisFontFamily=p.config.xaxis.group.style.fontFamily,te.xaxisForeColors=p.config.xaxis.group.style.colors,te.fontWeight=p.config.xaxis.group.style.fontWeight,te.cssClass=p.config.xaxis.group.style.cssClass),this.drawXAxisLabelAndGroup(!1,h,_,k,!1,function(ke,Me){return B[ke].cols*Me},te)}if(p.config.xaxis.title.text!==void 0){var ue=h.group({class:"apexcharts-xaxis-title"}),de=h.drawText({x:p.globals.gridWidth/2+p.config.xaxis.title.offsetX,y:this.offY+parseFloat(this.xaxisFontSize)+(p.config.xaxis.position==="bottom"?p.globals.xAxisLabelsHeight:-p.globals.xAxisLabelsHeight-10)+p.config.xaxis.title.offsetY,text:p.config.xaxis.title.text,textAnchor:"middle",fontSize:p.config.xaxis.title.style.fontSize,fontFamily:p.config.xaxis.title.style.fontFamily,fontWeight:p.config.xaxis.title.style.fontWeight,foreColor:p.config.xaxis.title.style.color,cssClass:"apexcharts-xaxis-title-text "+p.config.xaxis.title.style.cssClass});ue.add(de),S.add(ue)}if(p.config.xaxis.axisBorder.show){var xe=p.globals.barPadForNumericAxis,we=h.drawLine(p.globals.padHorizontal+p.config.xaxis.axisBorder.offsetX-xe,this.offY,this.xaxisBorderWidth+xe,this.offY,p.config.xaxis.axisBorder.color,0,this.xaxisBorderHeight);this.elgrid&&this.elgrid.elGridBorders&&p.config.grid.show?this.elgrid.elGridBorders.add(we):S.add(we)}return S}},{key:"drawXAxisLabelAndGroup",value:function(p,h,S,_,k,T){var B,q=this,te=arguments.length>6&&arguments[6]!==void 0?arguments[6]:{},ue=[],de=[],xe=this.w,we=te.xaxisFontSize||this.xaxisFontSize,ke=te.xaxisFontFamily||this.xaxisFontFamily,Me=te.xaxisForeColors||this.xaxisForeColors,Ye=te.fontWeight||xe.config.xaxis.labels.style.fontWeight,Fe=te.cssClass||xe.config.xaxis.labels.style.cssClass,rt=xe.globals.padHorizontal,se=_.length,Ce=xe.config.xaxis.type==="category"?xe.globals.dataPoints:se;if(Ce===0&&se>Ce&&(Ce=se),k){var De=Ce>1?Ce-1:Ce;B=xe.globals.gridWidth/Math.min(De,se-1),rt=rt+T(0,B)/2+xe.config.xaxis.labels.offsetX}else B=xe.globals.gridWidth/Ce,rt=rt+T(0,B)+xe.config.xaxis.labels.offsetX;for(var Le=function(nt){var ot=rt-T(nt,B)/2+xe.config.xaxis.labels.offsetX;nt===0&&se===1&&B/2===rt&&Ce===1&&(ot=xe.globals.gridWidth/2);var gt=q.axesUtils.getLabel(_,xe.globals.timescaleLabels,ot,nt,ue,we,p),Jt=28;if(xe.globals.rotateXLabels&&p&&(Jt=22),xe.config.xaxis.title.text&&xe.config.xaxis.position==="top"&&(Jt+=parseFloat(xe.config.xaxis.title.style.fontSize)+2),p||(Jt=Jt+parseFloat(we)+(xe.globals.xAxisLabelsHeight-xe.globals.xAxisGroupLabelsHeight)+(xe.globals.rotateXLabels?10:0)),gt=xe.config.xaxis.tickAmount!==void 0&&xe.config.xaxis.tickAmount!=="dataPoints"&&xe.config.xaxis.type!=="datetime"?q.axesUtils.checkLabelBasedOnTickamount(nt,gt,se):q.axesUtils.checkForOverflowingLabels(nt,gt,se,ue,de),xe.config.xaxis.labels.show){var Ge=h.drawText({x:gt.x,y:q.offY+xe.config.xaxis.labels.offsetY+Jt-(xe.config.xaxis.position==="top"?xe.globals.xAxisHeight+xe.config.xaxis.axisTicks.height-2:0),text:gt.text,textAnchor:"middle",fontWeight:gt.isBold?600:Ye,fontSize:we,fontFamily:ke,foreColor:Array.isArray(Me)?p&&xe.config.xaxis.convertedCatToNumeric?Me[xe.globals.minX+nt-1]:Me[nt]:Me,isPlainText:!1,cssClass:(p?"apexcharts-xaxis-label ":"apexcharts-xaxis-group-label ")+Fe});if(S.add(Ge),Ge.on("click",function(We){if(typeof xe.config.chart.events.xAxisLabelClick=="function"){var wt=Object.assign({},xe,{labelIndex:nt});xe.config.chart.events.xAxisLabelClick(We,q.ctx,wt)}}),p){var et=document.createElementNS(xe.globals.SVGNS,"title");et.textContent=Array.isArray(gt.text)?gt.text.join(" "):gt.text,Ge.node.appendChild(et),gt.text!==""&&(ue.push(gt.text),de.push(gt))}}nt<se-1&&(rt+=T(nt+1,B))},_e=0;_e<=se-1;_e++)Le(_e)}},{key:"drawXaxisInversed",value:function(p){var h,S,_=this,k=this.w,T=new z(this.ctx),B=k.config.yaxis[0].opposite?k.globals.translateYAxisX[p]:0,q=T.group({class:"apexcharts-yaxis apexcharts-xaxis-inversed",rel:p}),te=T.group({class:"apexcharts-yaxis-texts-g apexcharts-xaxis-inversed-texts-g",transform:"translate("+B+", 0)"});q.add(te);var ue=[];if(k.config.yaxis[p].show)for(var de=0;de<this.xaxisLabels.length;de++)ue.push(this.xaxisLabels[de]);h=k.globals.gridHeight/ue.length,S=-h/2.2;var xe=k.globals.yLabelFormatters[0],we=k.config.yaxis[0].labels;if(we.show)for(var ke=function(De){var Le=ue[De]===void 0?"":ue[De];Le=xe(Le,{seriesIndex:p,dataPointIndex:De,w:k});var _e=_.axesUtils.getYAxisForeColor(we.style.colors,p),nt=0;Array.isArray(Le)&&(nt=Le.length/2*parseInt(we.style.fontSize,10));var ot=we.offsetX-15,gt="end";_.yaxis.opposite&&(gt="start"),k.config.yaxis[0].labels.align==="left"?(ot=we.offsetX,gt="start"):k.config.yaxis[0].labels.align==="center"?(ot=we.offsetX,gt="middle"):k.config.yaxis[0].labels.align==="right"&&(gt="end");var Jt=T.drawText({x:ot,y:S+h+we.offsetY-nt,text:Le,textAnchor:gt,foreColor:Array.isArray(_e)?_e[De]:_e,fontSize:we.style.fontSize,fontFamily:we.style.fontFamily,fontWeight:we.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-yaxis-label "+we.style.cssClass,maxWidth:we.maxWidth});te.add(Jt),Jt.on("click",function(We){if(typeof k.config.chart.events.xAxisLabelClick=="function"){var wt=Object.assign({},k,{labelIndex:De});k.config.chart.events.xAxisLabelClick(We,_.ctx,wt)}});var Ge=document.createElementNS(k.globals.SVGNS,"title");if(Ge.textContent=Array.isArray(Le)?Le.join(" "):Le,Jt.node.appendChild(Ge),k.config.yaxis[p].labels.rotate!==0){var et=T.rotateAroundCenter(Jt.node);Jt.node.setAttribute("transform","rotate(".concat(k.config.yaxis[p].labels.rotate," 0 ").concat(et.y,")"))}S+=h},Me=0;Me<=ue.length-1;Me++)ke(Me);if(k.config.yaxis[0].title.text!==void 0){var Ye=T.group({class:"apexcharts-yaxis-title apexcharts-xaxis-title-inversed",transform:"translate("+B+", 0)"}),Fe=T.drawText({x:k.config.yaxis[0].title.offsetX,y:k.globals.gridHeight/2+k.config.yaxis[0].title.offsetY,text:k.config.yaxis[0].title.text,textAnchor:"middle",foreColor:k.config.yaxis[0].title.style.color,fontSize:k.config.yaxis[0].title.style.fontSize,fontWeight:k.config.yaxis[0].title.style.fontWeight,fontFamily:k.config.yaxis[0].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text "+k.config.yaxis[0].title.style.cssClass});Ye.add(Fe),q.add(Ye)}var rt=0;this.isCategoryBarHorizontal&&k.config.yaxis[0].opposite&&(rt=k.globals.gridWidth);var se=k.config.xaxis.axisBorder;if(se.show){var Ce=T.drawLine(k.globals.padHorizontal+se.offsetX+rt,1+se.offsetY,k.globals.padHorizontal+se.offsetX+rt,k.globals.gridHeight+se.offsetY,se.color,0);this.elgrid&&this.elgrid.elGridBorders&&k.config.grid.show?this.elgrid.elGridBorders.add(Ce):q.add(Ce)}return k.config.yaxis[0].axisTicks.show&&this.axesUtils.drawYAxisTicks(rt,ue.length,k.config.yaxis[0].axisBorder,k.config.yaxis[0].axisTicks,0,h,q),q}},{key:"drawXaxisTicks",value:function(p,h,S){var _=this.w,k=p;if(!(p<0||p-2>_.globals.gridWidth)){var T=this.offY+_.config.xaxis.axisTicks.offsetY;if(h=h+T+_.config.xaxis.axisTicks.height,_.config.xaxis.position==="top"&&(h=T-_.config.xaxis.axisTicks.height),_.config.xaxis.axisTicks.show){var B=new z(this.ctx).drawLine(p+_.config.xaxis.axisTicks.offsetX,T+_.config.xaxis.offsetY,k+_.config.xaxis.axisTicks.offsetX,h+_.config.xaxis.offsetY,_.config.xaxis.axisTicks.color);S.add(B),B.node.classList.add("apexcharts-xaxis-tick")}}}},{key:"getXAxisTicksPositions",value:function(){var p=this.w,h=[],S=this.xaxisLabels.length,_=p.globals.padHorizontal;if(p.globals.timescaleLabels.length>0)for(var k=0;k<S;k++)_=this.xaxisLabels[k].position,h.push(_);else for(var T=S,B=0;B<T;B++){var q=T;p.globals.isXNumeric&&p.config.chart.type!=="bar"&&(q-=1),_+=p.globals.gridWidth/q,h.push(_)}return h}},{key:"xAxisLabelCorrections",value:function(){var p=this.w,h=new z(this.ctx),S=p.globals.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g"),_=p.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-texts-g text:not(.apexcharts-xaxis-group-label)"),k=p.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis-inversed text"),T=p.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-inversed-texts-g text tspan");if(p.globals.rotateXLabels||p.config.xaxis.labels.rotateAlways)for(var B=0;B<_.length;B++){var q=h.rotateAroundCenter(_[B]);q.y=q.y-1,q.x=q.x+1,_[B].setAttribute("transform","rotate(".concat(p.config.xaxis.labels.rotate," ").concat(q.x," ").concat(q.y,")")),_[B].setAttribute("text-anchor","end"),S.setAttribute("transform","translate(0, ".concat(-10,")"));var te=_[B].childNodes;p.config.xaxis.labels.trim&&Array.prototype.forEach.call(te,function(we){h.placeTextWithEllipsis(we,we.textContent,p.globals.xAxisLabelsHeight-(p.config.legend.position==="bottom"?20:10))})}else(function(){for(var we=p.globals.gridWidth/(p.globals.labels.length+1),ke=0;ke<_.length;ke++){var Me=_[ke].childNodes;p.config.xaxis.labels.trim&&p.config.xaxis.type!=="datetime"&&Array.prototype.forEach.call(Me,function(Ye){h.placeTextWithEllipsis(Ye,Ye.textContent,we)})}})();if(k.length>0){var ue=k[k.length-1].getBBox(),de=k[0].getBBox();ue.x<-20&&k[k.length-1].parentNode.removeChild(k[k.length-1]),de.x+de.width>p.globals.gridWidth&&!p.globals.isBarHorizontal&&k[0].parentNode.removeChild(k[0]);for(var xe=0;xe<T.length;xe++)h.placeTextWithEllipsis(T[xe],T[xe].textContent,p.config.yaxis[0].labels.maxWidth-(p.config.yaxis[0].title.text?2*parseFloat(p.config.yaxis[0].title.style.fontSize):0)-15)}}}]),Ee}(),tt=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w;var h=this.w;this.xaxisLabels=h.globals.labels.slice(),this.axesUtils=new he(p),this.isRangeBar=h.globals.seriesRange.length&&h.globals.isBarHorizontal,h.globals.timescaleLabels.length>0&&(this.xaxisLabels=h.globals.timescaleLabels.slice())}return o(Ee,[{key:"drawGridArea",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,h=this.w,S=new z(this.ctx);p||(p=S.group({class:"apexcharts-grid"}));var _=S.drawLine(h.globals.padHorizontal,1,h.globals.padHorizontal,h.globals.gridHeight,"transparent"),k=S.drawLine(h.globals.padHorizontal,h.globals.gridHeight,h.globals.gridWidth,h.globals.gridHeight,"transparent");return p.add(k),p.add(_),p}},{key:"drawGrid",value:function(){if(this.w.globals.axisCharts){var p=this.renderGrid();return this.drawGridArea(p.el),p}return null}},{key:"createGridMask",value:function(){var p=this.w,h=p.globals,S=new z(this.ctx),_=Array.isArray(p.config.stroke.width)?Math.max.apply(Math,N(p.config.stroke.width)):p.config.stroke.width,k=function(ue){var de=document.createElementNS(h.SVGNS,"clipPath");return de.setAttribute("id",ue),de};h.dom.elGridRectMask=k("gridRectMask".concat(h.cuid)),h.dom.elGridRectBarMask=k("gridRectBarMask".concat(h.cuid)),h.dom.elGridRectMarkerMask=k("gridRectMarkerMask".concat(h.cuid)),h.dom.elForecastMask=k("forecastMask".concat(h.cuid)),h.dom.elNonForecastMask=k("nonForecastMask".concat(h.cuid));var T=0,B=0;(["bar","rangeBar","candlestick","boxPlot"].includes(p.config.chart.type)||p.globals.comboBarCount>0)&&p.globals.isXNumeric&&!p.globals.isBarHorizontal&&(T=Math.max(p.config.grid.padding.left,h.barPadForNumericAxis),B=Math.max(p.config.grid.padding.right,h.barPadForNumericAxis)),h.dom.elGridRect=S.drawRect(0,0,h.gridWidth,h.gridHeight,0,"#fff"),h.dom.elGridRectBar=S.drawRect(-_/2-T-2,-_/2-2,h.gridWidth+_+B+T+4,h.gridHeight+_+4,0,"#fff");var q=p.globals.markers.largestSize;h.dom.elGridRectMarker=S.drawRect(-q,-q,h.gridWidth+2*q,h.gridHeight+2*q,0,"#fff"),h.dom.elGridRectMask.appendChild(h.dom.elGridRect.node),h.dom.elGridRectBarMask.appendChild(h.dom.elGridRectBar.node),h.dom.elGridRectMarkerMask.appendChild(h.dom.elGridRectMarker.node);var te=h.dom.baseEl.querySelector("defs");te.appendChild(h.dom.elGridRectMask),te.appendChild(h.dom.elGridRectBarMask),te.appendChild(h.dom.elGridRectMarkerMask),te.appendChild(h.dom.elForecastMask),te.appendChild(h.dom.elNonForecastMask)}},{key:"_drawGridLines",value:function(p){var h=p.i,S=p.x1,_=p.y1,k=p.x2,T=p.y2,B=p.xCount,q=p.parent,te=this.w;if(!(h===0&&te.globals.skipFirstTimelinelabel||h===B-1&&te.globals.skipLastTimelinelabel&&!te.config.xaxis.labels.formatter||te.config.chart.type==="radar")){te.config.grid.xaxis.lines.show&&this._drawGridLine({i:h,x1:S,y1:_,x2:k,y2:T,xCount:B,parent:q});var ue=0;if(te.globals.hasXaxisGroups&&te.config.xaxis.tickPlacement==="between"){var de=te.globals.groups;if(de){for(var xe=0,we=0;xe<h&&we<de.length;we++)xe+=de[we].cols;xe===h&&(ue=.6*te.globals.xAxisLabelsHeight)}}new it(this.ctx).drawXaxisTicks(S,ue,te.globals.dom.elGraphical)}}},{key:"_drawGridLine",value:function(p){var h=p.i,S=p.x1,_=p.y1,k=p.x2,T=p.y2,B=p.xCount,q=p.parent,te=this.w,ue=q.node.classList.contains("apexcharts-gridlines-horizontal"),de=te.globals.barPadForNumericAxis,xe=_===0&&T===0||S===0&&k===0||_===te.globals.gridHeight&&T===te.globals.gridHeight||te.globals.isBarHorizontal&&(h===0||h===B-1),we=new z(this).drawLine(S-(ue?de:0),_,k+(ue?de:0),T,te.config.grid.borderColor,te.config.grid.strokeDashArray);we.node.classList.add("apexcharts-gridline"),xe&&te.config.grid.show?this.elGridBorders.add(we):q.add(we)}},{key:"_drawGridBandRect",value:function(p){var h=p.c,S=p.x1,_=p.y1,k=p.x2,T=p.y2,B=p.type,q=this.w,te=new z(this.ctx),ue=q.globals.barPadForNumericAxis,de=q.config.grid[B].colors[h],xe=te.drawRect(S-(B==="row"?ue:0),_,k+(B==="row"?2*ue:0),T,0,de,q.config.grid[B].opacity);this.elg.add(xe),xe.attr("clip-path","url(#gridRectMask".concat(q.globals.cuid,")")),xe.node.classList.add("apexcharts-grid-".concat(B))}},{key:"_drawXYLines",value:function(p){var h=this,S=p.xCount,_=p.tickAmount,k=this.w;if(k.config.grid.xaxis.lines.show||k.config.xaxis.axisTicks.show){var T,B=k.globals.padHorizontal,q=k.globals.gridHeight;k.globals.timescaleLabels.length?function(ke){for(var Me=ke.xC,Ye=ke.x1,Fe=ke.y1,rt=ke.x2,se=ke.y2,Ce=0;Ce<Me;Ce++)Ye=h.xaxisLabels[Ce].position,rt=h.xaxisLabels[Ce].position,h._drawGridLines({i:Ce,x1:Ye,y1:Fe,x2:rt,y2:se,xCount:S,parent:h.elgridLinesV})}({xC:S,x1:B,y1:0,x2:T,y2:q}):(k.globals.isXNumeric&&(S=k.globals.xAxisScale.result.length),function(ke){for(var Me=ke.xC,Ye=ke.x1,Fe=ke.y1,rt=ke.x2,se=ke.y2,Ce=0;Ce<Me+(k.globals.isXNumeric?0:1);Ce++)Ce===0&&Me===1&&k.globals.dataPoints===1&&(rt=Ye=k.globals.gridWidth/2),h._drawGridLines({i:Ce,x1:Ye,y1:Fe,x2:rt,y2:se,xCount:S,parent:h.elgridLinesV}),rt=Ye+=k.globals.gridWidth/(k.globals.isXNumeric?Me-1:Me)}({xC:S,x1:B,y1:0,x2:T,y2:q}))}if(k.config.grid.yaxis.lines.show){var te=0,ue=0,de=k.globals.gridWidth,xe=_+1;this.isRangeBar&&(xe=k.globals.labels.length);for(var we=0;we<xe+(this.isRangeBar?1:0);we++)this._drawGridLine({i:we,xCount:xe+(this.isRangeBar?1:0),x1:0,y1:te,x2:de,y2:ue,parent:this.elgridLinesH}),ue=te+=k.globals.gridHeight/(this.isRangeBar?xe:_)}}},{key:"_drawInvertedXYLines",value:function(p){var h=p.xCount,S=this.w;if(S.config.grid.xaxis.lines.show||S.config.xaxis.axisTicks.show)for(var _,k=S.globals.padHorizontal,T=S.globals.gridHeight,B=0;B<h+1;B++)S.config.grid.xaxis.lines.show&&this._drawGridLine({i:B,xCount:h+1,x1:k,y1:0,x2:_,y2:T,parent:this.elgridLinesV}),new it(this.ctx).drawXaxisTicks(k,0,S.globals.dom.elGraphical),_=k+=S.globals.gridWidth/h;if(S.config.grid.yaxis.lines.show)for(var q=0,te=0,ue=S.globals.gridWidth,de=0;de<S.globals.dataPoints+1;de++)this._drawGridLine({i:de,xCount:S.globals.dataPoints+1,x1:0,y1:q,x2:ue,y2:te,parent:this.elgridLinesH}),te=q+=S.globals.gridHeight/S.globals.dataPoints}},{key:"renderGrid",value:function(){var p=this.w,h=p.globals,S=new z(this.ctx);this.elg=S.group({class:"apexcharts-grid"}),this.elgridLinesH=S.group({class:"apexcharts-gridlines-horizontal"}),this.elgridLinesV=S.group({class:"apexcharts-gridlines-vertical"}),this.elGridBorders=S.group({class:"apexcharts-grid-borders"}),this.elg.add(this.elgridLinesH),this.elg.add(this.elgridLinesV),p.config.grid.show||(this.elgridLinesV.hide(),this.elgridLinesH.hide(),this.elGridBorders.hide());for(var _=0;_<h.seriesYAxisMap.length&&h.ignoreYAxisIndexes.includes(_);)_++;_===h.seriesYAxisMap.length&&(_=0);var k,T=h.yAxisScale[_].result.length-1;if(!h.isBarHorizontal||this.isRangeBar){var B,q,te;k=this.xaxisLabels.length,this.isRangeBar&&(T=h.labels.length,p.config.xaxis.tickAmount&&p.config.xaxis.labels.formatter&&(k=p.config.xaxis.tickAmount),((B=h.yAxisScale)===null||B===void 0||(q=B[_])===null||q===void 0||(te=q.result)===null||te===void 0?void 0:te.length)>0&&p.config.xaxis.type!=="datetime"&&(k=h.yAxisScale[_].result.length-1)),this._drawXYLines({xCount:k,tickAmount:T})}else k=T,T=h.xTickAmount,this._drawInvertedXYLines({xCount:k,tickAmount:T});return this.drawGridBands(k,T),{el:this.elg,elGridBorders:this.elGridBorders,xAxisTickWidth:h.gridWidth/k}}},{key:"drawGridBands",value:function(p,h){var S,_,k=this,T=this.w;if(((S=T.config.grid.row.colors)===null||S===void 0?void 0:S.length)>0&&function(ke,Me,Ye,Fe,rt,se){for(var Ce=0,De=0;Ce<Me;Ce++,De++)De>=T.config.grid[ke].colors.length&&(De=0),k._drawGridBandRect({c:De,x1:Ye,y1:Fe,x2:rt,y2:se,type:ke}),Fe+=T.globals.gridHeight/h}("row",h,0,0,T.globals.gridWidth,T.globals.gridHeight/h),((_=T.config.grid.column.colors)===null||_===void 0?void 0:_.length)>0){var B=T.globals.isBarHorizontal||T.config.xaxis.tickPlacement!=="on"||T.config.xaxis.type!=="category"&&!T.config.xaxis.convertedCatToNumeric?p:p-1;T.globals.isXNumeric&&(B=T.globals.xAxisScale.result.length-1);for(var q=T.globals.padHorizontal,te=T.globals.padHorizontal+T.globals.gridWidth/B,ue=T.globals.gridHeight,de=0,xe=0;de<p;de++,xe++){var we;xe>=T.config.grid.column.colors.length&&(xe=0),T.config.xaxis.type==="datetime"&&(q=this.xaxisLabels[de].position,te=(((we=this.xaxisLabels[de+1])===null||we===void 0?void 0:we.position)||T.globals.gridWidth)-this.xaxisLabels[de].position),this._drawGridBandRect({c:xe,x1:q,y1:0,x2:te,y2:ue,type:"column"}),q+=T.globals.gridWidth/B}}}}]),Ee}(),at=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.coreUtils=new X(this.ctx)}return o(Ee,[{key:"niceScale",value:function(p,h){var S,_,k,T,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,q=1e-11,te=this.w,ue=te.globals;ue.isBarHorizontal?(S=te.config.xaxis,_=Math.max((ue.svgWidth-100)/25,2)):(S=te.config.yaxis[B],_=Math.max((ue.svgHeight-100)/15,2)),F.isNumber(_)||(_=10),k=S.min!==void 0&&S.min!==null,T=S.max!==void 0&&S.min!==null;var de=S.stepSize!==void 0&&S.stepSize!==null,xe=S.tickAmount!==void 0&&S.tickAmount!==null,we=xe?S.tickAmount:ue.niceScaleDefaultTicks[Math.min(Math.round(_/2),ue.niceScaleDefaultTicks.length-1)];if(ue.isMultipleYAxis&&!xe&&ue.multiAxisTickAmount>0&&(we=ue.multiAxisTickAmount,xe=!0),we=we==="dataPoints"?ue.dataPoints-1:Math.abs(Math.round(we)),(p===Number.MIN_VALUE&&h===0||!F.isNumber(p)&&!F.isNumber(h)||p===Number.MIN_VALUE&&h===-Number.MAX_VALUE)&&(p=F.isNumber(S.min)?S.min:0,h=F.isNumber(S.max)?S.max:p+we,ue.allSeriesCollapsed=!1),p>h){console.warn("axis.min cannot be greater than axis.max: swapping min and max");var ke=h;h=p,p=ke}else p===h&&(p=p===0?0:p-1,h=h===0?2:h+1);var Me=[];we<1&&(we=1);var Ye=we,Fe=Math.abs(h-p);!k&&p>0&&p/Fe<.15&&(p=0,k=!0),!T&&h<0&&-h/Fe<.15&&(h=0,T=!0);var rt=(Fe=Math.abs(h-p))/Ye,se=rt,Ce=Math.floor(Math.log10(se)),De=Math.pow(10,Ce),Le=Math.ceil(se/De);if(rt=se=(Le=ue.niceScaleAllowedMagMsd[ue.yValueDecimal===0?0:1][Le])*De,ue.isBarHorizontal&&S.stepSize&&S.type!=="datetime"?(rt=S.stepSize,de=!0):de&&(rt=S.stepSize),de&&S.forceNiceScale){var _e=Math.floor(Math.log10(rt));rt*=Math.pow(10,Ce-_e)}if(k&&T){var nt=Fe/Ye;if(xe)if(de)if(F.mod(Fe,rt)!=0){var ot=F.getGCD(rt,nt);rt=nt/ot<10?ot:nt}else F.mod(rt,nt)==0?rt=nt:(nt=rt,xe=!1);else rt=nt;else if(de)F.mod(Fe,rt)==0?nt=rt:rt=nt;else if(F.mod(Fe,rt)==0)nt=rt;else{nt=Fe/(Ye=Math.ceil(Fe/rt));var gt=F.getGCD(Fe,rt);Fe/gt<_&&(nt=gt),rt=nt}Ye=Math.round(Fe/rt)}else{if(k||T){if(T)if(xe)p=h-rt*Ye;else{var Jt=p;p=rt*Math.floor(p/rt),Math.abs(h-p)/F.getGCD(Fe,rt)>_&&(p=h-rt*we,p+=rt*Math.floor((Jt-p)/rt))}else if(k)if(xe)h=p+rt*Ye;else{var Ge=h;h=rt*Math.ceil(h/rt),Math.abs(h-p)/F.getGCD(Fe,rt)>_&&(h=p+rt*we,h+=rt*Math.ceil((Ge-h)/rt))}}else if(ue.isMultipleYAxis&&xe){var et=rt*Math.floor(p/rt),We=et+rt*Ye;We<h&&(rt*=2),We=h,h=(p=et)+rt*Ye,Fe=Math.abs(h-p),p>0&&p<Math.abs(We-h)&&(p=0,h=rt*Ye),h<0&&-h<Math.abs(et-p)&&(h=0,p=-rt*Ye)}else p=rt*Math.floor(p/rt),h=rt*Math.ceil(h/rt);Fe=Math.abs(h-p),rt=F.getGCD(Fe,rt),Ye=Math.round(Fe/rt)}if(xe||k||T||(Ye=Math.ceil((Fe-q)/(rt+q)))>16&&F.getPrimeFactors(Ye).length<2&&Ye++,!xe&&S.forceNiceScale&&ue.yValueDecimal===0&&Ye>Fe&&(Ye=Fe,rt=Math.round(Fe/Ye)),Ye>_&&(!xe&&!de||S.forceNiceScale)){var wt=F.getPrimeFactors(Ye),St=wt.length-1,Kt=Ye;e:for(var gn=0;gn<St;gn++)for(var yn=0;yn<=St-gn;yn++){for(var hn=Math.min(yn+gn,St),br=Kt,pt=1,Wt=yn;Wt<=hn;Wt++)pt*=wt[Wt];if((br/=pt)<_){Kt=br;break e}}rt=Kt===Ye?Fe:Fe/Kt,Ye=Math.round(Fe/rt)}ue.isMultipleYAxis&&ue.multiAxisTickAmount==0&&ue.ignoreYAxisIndexes.indexOf(B)<0&&(ue.multiAxisTickAmount=Ye);var Zt=p-rt,vt=rt*q;do Zt+=rt,Me.push(F.stripNumber(Zt,7));while(h-Zt>vt);return{result:Me,niceMin:Me[0],niceMax:Me[Me.length-1]}}},{key:"linearScale",value:function(p,h){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:10,_=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:void 0,T=Math.abs(h-p),B=[];if(p===h)return{result:B=[p],niceMin:B[0],niceMax:B[B.length-1]};(S=this._adjustTicksForSmallRange(S,_,T))==="dataPoints"&&(S=this.w.globals.dataPoints-1),k||(k=T/S),k=Math.round(10*(k+Number.EPSILON))/10,S===Number.MAX_VALUE&&(S=5,k=1);for(var q=p;S>=0;)B.push(q),q=F.preciseAddition(q,k),S-=1;return{result:B,niceMin:B[0],niceMax:B[B.length-1]}}},{key:"logarithmicScaleNice",value:function(p,h,S){h<=0&&(h=Math.max(p,S)),p<=0&&(p=Math.min(h,S));for(var _=[],k=Math.ceil(Math.log(h)/Math.log(S)+1),T=Math.floor(Math.log(p)/Math.log(S));T<k;T++)_.push(Math.pow(S,T));return{result:_,niceMin:_[0],niceMax:_[_.length-1]}}},{key:"logarithmicScale",value:function(p,h,S){h<=0&&(h=Math.max(p,S)),p<=0&&(p=Math.min(h,S));for(var _=[],k=Math.log(h)/Math.log(S),T=Math.log(p)/Math.log(S),B=k-T,q=Math.round(B),te=B/q,ue=0,de=T;ue<q;ue++,de+=te)_.push(Math.pow(S,de));return _.push(Math.pow(S,k)),{result:_,niceMin:p,niceMax:h}}},{key:"_adjustTicksForSmallRange",value:function(p,h,S){var _=p;if(h!==void 0&&this.w.config.yaxis[h].labels.formatter&&this.w.config.yaxis[h].tickAmount===void 0){var k=Number(this.w.config.yaxis[h].labels.formatter(1));F.isNumber(k)&&this.w.globals.yValueDecimal===0&&(_=Math.ceil(S))}return _<p?_:p}},{key:"setYScaleForIndex",value:function(p,h,S){var _=this.w.globals,k=this.w.config,T=_.isBarHorizontal?k.xaxis:k.yaxis[p];_.yAxisScale[p]===void 0&&(_.yAxisScale[p]=[]);var B=Math.abs(S-h);T.logarithmic&&B<=5&&(_.invalidLogScale=!0),T.logarithmic&&B>5?(_.allSeriesCollapsed=!1,_.yAxisScale[p]=T.forceNiceScale?this.logarithmicScaleNice(h,S,T.logBase):this.logarithmicScale(h,S,T.logBase)):S!==-Number.MAX_VALUE&&F.isNumber(S)&&h!==Number.MAX_VALUE&&F.isNumber(h)?(_.allSeriesCollapsed=!1,_.yAxisScale[p]=this.niceScale(h,S,p)):_.yAxisScale[p]=this.niceScale(Number.MIN_VALUE,0,p)}},{key:"setXScale",value:function(p,h){var S=this.w,_=S.globals,k=Math.abs(h-p);if(h!==-Number.MAX_VALUE&&F.isNumber(h)){var T=_.xTickAmount+1;k<10&&k>1&&(T=k),_.xAxisScale=this.linearScale(p,h,T,0,S.config.xaxis.stepSize)}else _.xAxisScale=this.linearScale(0,10,10);return _.xAxisScale}},{key:"scaleMultipleYAxes",value:function(){var p=this,h=this.w.config,S=this.w.globals;this.coreUtils.setSeriesYAxisMappings();var _=S.seriesYAxisMap,k=S.minYArr,T=S.maxYArr;S.allSeriesCollapsed=!0,S.barGroups=[],_.forEach(function(B,q){var te=[];B.forEach(function(ue){var de=h.series[ue].group;te.indexOf(de)<0&&te.push(de)}),B.length>0?function(){var ue,de,xe=Number.MAX_VALUE,we=-Number.MAX_VALUE,ke=xe,Me=we;if(h.chart.stacked)(function(){var rt=new Array(S.dataPoints).fill(0),se=[],Ce=[],De=[];te.forEach(function(){se.push(rt.map(function(){return Number.MIN_VALUE})),Ce.push(rt.map(function(){return Number.MIN_VALUE})),De.push(rt.map(function(){return Number.MIN_VALUE}))});for(var Le=function(nt){!ue&&h.series[B[nt]].type&&(ue=h.series[B[nt]].type);var ot=B[nt];de=h.series[ot].group?h.series[ot].group:"axis-".concat(q),!(S.collapsedSeriesIndices.indexOf(ot)<0&&S.ancillaryCollapsedSeriesIndices.indexOf(ot)<0)||(S.allSeriesCollapsed=!1,te.forEach(function(gt,Jt){if(h.series[ot].group===gt)for(var Ge=0;Ge<S.series[ot].length;Ge++){var et=S.series[ot][Ge];et>=0?Ce[Jt][Ge]+=et:De[Jt][Ge]+=et,se[Jt][Ge]+=et,ke=Math.min(ke,et),Me=Math.max(Me,et)}})),ue!=="bar"&&ue!=="column"||S.barGroups.push(de)},_e=0;_e<B.length;_e++)Le(_e);ue||(ue=h.chart.type),ue==="bar"||ue==="column"?te.forEach(function(nt,ot){xe=Math.min(xe,Math.min.apply(null,De[ot])),we=Math.max(we,Math.max.apply(null,Ce[ot]))}):(te.forEach(function(nt,ot){ke=Math.min(ke,Math.min.apply(null,se[ot])),Me=Math.max(Me,Math.max.apply(null,se[ot]))}),xe=ke,we=Me),xe===Number.MIN_VALUE&&we===Number.MIN_VALUE&&(we=-Number.MAX_VALUE)})();else for(var Ye=0;Ye<B.length;Ye++){var Fe=B[Ye];xe=Math.min(xe,k[Fe]),we=Math.max(we,T[Fe]),!(S.collapsedSeriesIndices.indexOf(Fe)<0&&S.ancillaryCollapsedSeriesIndices.indexOf(Fe)<0)||(S.allSeriesCollapsed=!1)}h.yaxis[q].min!==void 0&&(xe=typeof h.yaxis[q].min=="function"?h.yaxis[q].min(xe):h.yaxis[q].min),h.yaxis[q].max!==void 0&&(we=typeof h.yaxis[q].max=="function"?h.yaxis[q].max(we):h.yaxis[q].max),S.barGroups=S.barGroups.filter(function(rt,se,Ce){return Ce.indexOf(rt)===se}),p.setYScaleForIndex(q,xe,we),B.forEach(function(rt){k[rt]=S.yAxisScale[q].niceMin,T[rt]=S.yAxisScale[q].niceMax})}():p.setYScaleForIndex(q,0,-Number.MAX_VALUE)})}}]),Ee}(),dt=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.scales=new at(p)}return o(Ee,[{key:"init",value:function(){this.setYRange(),this.setXRange(),this.setZRange()}},{key:"getMinYMaxY",value:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-Number.MAX_VALUE,_=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,k=this.w.config,T=this.w.globals,B=-Number.MAX_VALUE,q=Number.MIN_VALUE;_===null&&(_=p+1);var te=T.series,ue=te,de=te;k.chart.type==="candlestick"?(ue=T.seriesCandleL,de=T.seriesCandleH):k.chart.type==="boxPlot"?(ue=T.seriesCandleO,de=T.seriesCandleC):T.isRangeData&&(ue=T.seriesRangeStart,de=T.seriesRangeEnd);var xe=!1;if(T.seriesX.length>=_){var we,ke=(we=T.brushSource)===null||we===void 0?void 0:we.w.config.chart.brush;(k.chart.zoom.enabled&&k.chart.zoom.autoScaleYaxis||ke!=null&&ke.enabled&&ke!=null&&ke.autoScaleYaxis)&&(xe=!0)}for(var Me=p;Me<_;Me++){T.dataPoints=Math.max(T.dataPoints,te[Me].length);var Ye=k.series[Me].type;T.categoryLabels.length&&(T.dataPoints=T.categoryLabels.filter(function(De){return De!==void 0}).length),T.labels.length&&k.xaxis.type!=="datetime"&&T.series.reduce(function(De,Le){return De+Le.length},0)!==0&&(T.dataPoints=Math.max(T.dataPoints,T.labels.length));var Fe=0,rt=te[Me].length-1;if(xe){if(k.xaxis.min)for(;Fe<rt&&T.seriesX[Me][Fe]<k.xaxis.min;Fe++);if(k.xaxis.max)for(;rt>Fe&&T.seriesX[Me][rt]>k.xaxis.max;rt--);}for(var se=Fe;se<=rt&&se<T.series[Me].length;se++){var Ce=te[Me][se];if(Ce!==null&&F.isNumber(Ce)){switch(de[Me][se]!==void 0&&(B=Math.max(B,de[Me][se]),h=Math.min(h,de[Me][se])),ue[Me][se]!==void 0&&(h=Math.min(h,ue[Me][se]),S=Math.max(S,ue[Me][se])),Ye){case"candlestick":T.seriesCandleC[Me][se]!==void 0&&(B=Math.max(B,T.seriesCandleH[Me][se]),h=Math.min(h,T.seriesCandleL[Me][se]));break;case"boxPlot":T.seriesCandleC[Me][se]!==void 0&&(B=Math.max(B,T.seriesCandleC[Me][se]),h=Math.min(h,T.seriesCandleO[Me][se]))}Ye&&Ye!=="candlestick"&&Ye!=="boxPlot"&&Ye!=="rangeArea"&&Ye!=="rangeBar"&&(B=Math.max(B,T.series[Me][se]),h=Math.min(h,T.series[Me][se])),S=B,T.seriesGoals[Me]&&T.seriesGoals[Me][se]&&Array.isArray(T.seriesGoals[Me][se])&&T.seriesGoals[Me][se].forEach(function(De){q!==Number.MIN_VALUE&&(q=Math.min(q,De.value),h=q),B=Math.max(B,De.value),S=B}),F.isFloat(Ce)&&(Ce=F.noExponents(Ce),T.yValueDecimal=Math.max(T.yValueDecimal,Ce.toString().split(".")[1].length)),q>ue[Me][se]&&ue[Me][se]<0&&(q=ue[Me][se])}else T.hasNullValues=!0}Ye!=="bar"&&Ye!=="column"||(q<0&&B<0&&(B=0,S=Math.max(S,0)),q===Number.MIN_VALUE&&(q=0,h=Math.min(h,0)))}return k.chart.type==="rangeBar"&&T.seriesRangeStart.length&&T.isBarHorizontal&&(q=h),k.chart.type==="bar"&&(q<0&&B<0&&(B=0),q===Number.MIN_VALUE&&(q=0)),{minY:q,maxY:B,lowestY:h,highestY:S}}},{key:"setYRange",value:function(){var p=this.w.globals,h=this.w.config;p.maxY=-Number.MAX_VALUE,p.minY=Number.MIN_VALUE;var S,_=Number.MAX_VALUE;if(p.isMultipleYAxis){_=Number.MAX_VALUE;for(var k=0;k<p.series.length;k++)S=this.getMinYMaxY(k),p.minYArr[k]=S.lowestY,p.maxYArr[k]=S.highestY,_=Math.min(_,S.lowestY)}return S=this.getMinYMaxY(0,_,null,p.series.length),h.chart.type==="bar"?(p.minY=S.minY,p.maxY=S.maxY):(p.minY=S.lowestY,p.maxY=S.highestY),_=S.lowestY,h.chart.stacked&&this._setStackedMinMax(),h.chart.type==="line"||h.chart.type==="area"||h.chart.type==="scatter"||h.chart.type==="candlestick"||h.chart.type==="boxPlot"||h.chart.type==="rangeBar"&&!p.isBarHorizontal?p.minY===Number.MIN_VALUE&&_!==-Number.MAX_VALUE&&_!==p.maxY&&(p.minY=_):p.minY=p.minY!==Number.MIN_VALUE?Math.min(S.minY,p.minY):S.minY,h.yaxis.forEach(function(T,B){T.max!==void 0&&(typeof T.max=="number"?p.maxYArr[B]=T.max:typeof T.max=="function"&&(p.maxYArr[B]=T.max(p.isMultipleYAxis?p.maxYArr[B]:p.maxY)),p.maxY=p.maxYArr[B]),T.min!==void 0&&(typeof T.min=="number"?p.minYArr[B]=T.min:typeof T.min=="function"&&(p.minYArr[B]=T.min(p.isMultipleYAxis?p.minYArr[B]===Number.MIN_VALUE?0:p.minYArr[B]:p.minY)),p.minY=p.minYArr[B])}),p.isBarHorizontal&&["min","max"].forEach(function(T){h.xaxis[T]!==void 0&&typeof h.xaxis[T]=="number"&&(T==="min"?p.minY=h.xaxis[T]:p.maxY=h.xaxis[T])}),p.isMultipleYAxis?(this.scales.scaleMultipleYAxes(),p.minY=_):(this.scales.setYScaleForIndex(0,p.minY,p.maxY),p.minY=p.yAxisScale[0].niceMin,p.maxY=p.yAxisScale[0].niceMax,p.minYArr[0]=p.minY,p.maxYArr[0]=p.maxY),p.barGroups=[],p.lineGroups=[],p.areaGroups=[],h.series.forEach(function(T){switch(T.type||h.chart.type){case"bar":case"column":p.barGroups.push(T.group);break;case"line":p.lineGroups.push(T.group);break;case"area":p.areaGroups.push(T.group)}}),p.barGroups=p.barGroups.filter(function(T,B,q){return q.indexOf(T)===B}),p.lineGroups=p.lineGroups.filter(function(T,B,q){return q.indexOf(T)===B}),p.areaGroups=p.areaGroups.filter(function(T,B,q){return q.indexOf(T)===B}),{minY:p.minY,maxY:p.maxY,minYArr:p.minYArr,maxYArr:p.maxYArr,yAxisScale:p.yAxisScale}}},{key:"setXRange",value:function(){var p=this.w.globals,h=this.w.config,S=h.xaxis.type==="numeric"||h.xaxis.type==="datetime"||h.xaxis.type==="category"&&!p.noLabelsProvided||p.noLabelsProvided||p.isXNumeric;if(p.isXNumeric&&function(){for(var q=0;q<p.series.length;q++)if(p.labels[q])for(var te=0;te<p.labels[q].length;te++)p.labels[q][te]!==null&&F.isNumber(p.labels[q][te])&&(p.maxX=Math.max(p.maxX,p.labels[q][te]),p.initialMaxX=Math.max(p.maxX,p.labels[q][te]),p.minX=Math.min(p.minX,p.labels[q][te]),p.initialMinX=Math.min(p.minX,p.labels[q][te]))}(),p.noLabelsProvided&&h.xaxis.categories.length===0&&(p.maxX=p.labels[p.labels.length-1],p.initialMaxX=p.labels[p.labels.length-1],p.minX=1,p.initialMinX=1),p.isXNumeric||p.noLabelsProvided||p.dataFormatXNumeric){var _=10;if(h.xaxis.tickAmount===void 0)_=Math.round(p.svgWidth/150),h.xaxis.type==="numeric"&&p.dataPoints<30&&(_=p.dataPoints-1),_>p.dataPoints&&p.dataPoints!==0&&(_=p.dataPoints-1);else if(h.xaxis.tickAmount==="dataPoints"){if(p.series.length>1&&(_=p.series[p.maxValsInArrayIndex].length-1),p.isXNumeric){var k=p.maxX-p.minX;k<30&&(_=k-1)}}else _=h.xaxis.tickAmount;if(p.xTickAmount=_,h.xaxis.max!==void 0&&typeof h.xaxis.max=="number"&&(p.maxX=h.xaxis.max),h.xaxis.min!==void 0&&typeof h.xaxis.min=="number"&&(p.minX=h.xaxis.min),h.xaxis.range!==void 0&&(p.minX=p.maxX-h.xaxis.range),p.minX!==Number.MAX_VALUE&&p.maxX!==-Number.MAX_VALUE)if(h.xaxis.convertedCatToNumeric&&!p.dataFormatXNumeric){for(var T=[],B=p.minX-1;B<p.maxX;B++)T.push(B+1);p.xAxisScale={result:T,niceMin:T[0],niceMax:T[T.length-1]}}else p.xAxisScale=this.scales.setXScale(p.minX,p.maxX);else p.xAxisScale=this.scales.linearScale(0,_,_,0,h.xaxis.stepSize),p.noLabelsProvided&&p.labels.length>0&&(p.xAxisScale=this.scales.linearScale(1,p.labels.length,_-1,0,h.xaxis.stepSize),p.seriesX=p.labels.slice());S&&(p.labels=p.xAxisScale.result.slice())}return p.isBarHorizontal&&p.labels.length&&(p.xTickAmount=p.labels.length),this._handleSingleDataPoint(),this._getMinXDiff(),{minX:p.minX,maxX:p.maxX}}},{key:"setZRange",value:function(){var p=this.w.globals;if(p.isDataXYZ){for(var h=0;h<p.series.length;h++)if(p.seriesZ[h]!==void 0)for(var S=0;S<p.seriesZ[h].length;S++)p.seriesZ[h][S]!==null&&F.isNumber(p.seriesZ[h][S])&&(p.maxZ=Math.max(p.maxZ,p.seriesZ[h][S]),p.minZ=Math.min(p.minZ,p.seriesZ[h][S]))}}},{key:"_handleSingleDataPoint",value:function(){var p=this.w.globals,h=this.w.config;if(p.minX===p.maxX){var S=new Z(this.ctx);if(h.xaxis.type==="datetime"){var _=S.getDate(p.minX);h.xaxis.labels.datetimeUTC?_.setUTCDate(_.getUTCDate()-2):_.setDate(_.getDate()-2),p.minX=new Date(_).getTime();var k=S.getDate(p.maxX);h.xaxis.labels.datetimeUTC?k.setUTCDate(k.getUTCDate()+2):k.setDate(k.getDate()+2),p.maxX=new Date(k).getTime()}else(h.xaxis.type==="numeric"||h.xaxis.type==="category"&&!p.noLabelsProvided)&&(p.minX=p.minX-2,p.initialMinX=p.minX,p.maxX=p.maxX+2,p.initialMaxX=p.maxX)}}},{key:"_getMinXDiff",value:function(){var p=this.w.globals;p.isXNumeric&&p.seriesX.forEach(function(h,S){h.length===1&&h.push(p.seriesX[p.maxValsInArrayIndex][p.seriesX[p.maxValsInArrayIndex].length-1]);var _=h.slice();_.sort(function(k,T){return k-T}),_.forEach(function(k,T){if(T>0){var B=k-_[T-1];B>0&&(p.minXDiff=Math.min(B,p.minXDiff))}}),p.dataPoints!==1&&p.minXDiff!==Number.MAX_VALUE||(p.minXDiff=.5)})}},{key:"_setStackedMinMax",value:function(){var p=this,h=this.w.globals;if(h.series.length){var S=h.seriesGroups;S.length||(S=[this.w.globals.seriesNames.map(function(T){return T})]);var _={},k={};S.forEach(function(T){_[T]=[],k[T]=[],p.w.config.series.map(function(B,q){return T.indexOf(h.seriesNames[q])>-1?q:null}).filter(function(B){return B!==null}).forEach(function(B){for(var q=0;q<h.series[h.maxValsInArrayIndex].length;q++){var te,ue,de,xe;_[T][q]===void 0&&(_[T][q]=0,k[T][q]=0),(p.w.config.chart.stacked&&!h.comboCharts||p.w.config.chart.stacked&&h.comboCharts&&(!p.w.config.chart.stackOnlyBar||((te=p.w.config.series)===null||te===void 0||(ue=te[B])===null||ue===void 0?void 0:ue.type)==="bar"||((de=p.w.config.series)===null||de===void 0||(xe=de[B])===null||xe===void 0?void 0:xe.type)==="column"))&&h.series[B][q]!==null&&F.isNumber(h.series[B][q])&&(h.series[B][q]>0?_[T][q]+=parseFloat(h.series[B][q])+1e-4:k[T][q]+=parseFloat(h.series[B][q]))}})}),Object.entries(_).forEach(function(T){var B=C(T,1)[0];_[B].forEach(function(q,te){h.maxY=Math.max(h.maxY,_[B][te]),h.minY=Math.min(h.minY,k[B][te])})})}}}]),Ee}(),ct=function(){function Ee(p,h){s(this,Ee),this.ctx=p,this.elgrid=h,this.w=p.w;var S=this.w;this.xaxisFontSize=S.config.xaxis.labels.style.fontSize,this.axisFontFamily=S.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=S.config.xaxis.labels.style.colors,this.isCategoryBarHorizontal=S.config.chart.type==="bar"&&S.config.plotOptions.bar.horizontal,this.xAxisoffX=S.config.xaxis.position==="bottom"?S.globals.gridHeight:0,this.drawnLabels=[],this.axesUtils=new he(p)}return o(Ee,[{key:"drawYaxis",value:function(p){var h=this.w,S=new z(this.ctx),_=h.config.yaxis[p].labels.style,k=_.fontSize,T=_.fontFamily,B=_.fontWeight,q=S.group({class:"apexcharts-yaxis",rel:p,transform:"translate(".concat(h.globals.translateYAxisX[p],", 0)")});if(this.axesUtils.isYAxisHidden(p))return q;var te=S.group({class:"apexcharts-yaxis-texts-g"});q.add(te);var ue=h.globals.yAxisScale[p].result.length-1,de=h.globals.gridHeight/ue,xe=h.globals.yLabelFormatters[p],we=this.axesUtils.checkForReversedLabels(p,h.globals.yAxisScale[p].result.slice());if(h.config.yaxis[p].labels.show){var ke=h.globals.translateY+h.config.yaxis[p].labels.offsetY;h.globals.isBarHorizontal?ke=0:h.config.chart.type==="heatmap"&&(ke-=de/2),ke+=parseInt(k,10)/3;for(var Me=ue;Me>=0;Me--){var Ye=xe(we[Me],Me,h),Fe=h.config.yaxis[p].labels.padding;h.config.yaxis[p].opposite&&h.config.yaxis.length!==0&&(Fe*=-1);var rt=this.getTextAnchor(h.config.yaxis[p].labels.align,h.config.yaxis[p].opposite),se=this.axesUtils.getYAxisForeColor(_.colors,p),Ce=Array.isArray(se)?se[Me]:se,De=F.listToArray(h.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis[rel='".concat(p,"'] .apexcharts-yaxis-label tspan"))).map(function(_e){return _e.textContent}),Le=S.drawText({x:Fe,y:ke,text:De.includes(Ye)&&!h.config.yaxis[p].labels.showDuplicates?"":Ye,textAnchor:rt,fontSize:k,fontFamily:T,fontWeight:B,maxWidth:h.config.yaxis[p].labels.maxWidth,foreColor:Ce,isPlainText:!1,cssClass:"apexcharts-yaxis-label ".concat(_.cssClass)});te.add(Le),this.addTooltip(Le,Ye),h.config.yaxis[p].labels.rotate!==0&&this.rotateLabel(S,Le,firstLabel,h.config.yaxis[p].labels.rotate),ke+=de}}return this.addYAxisTitle(S,q,p),this.addAxisBorder(S,q,p,ue,de),q}},{key:"getTextAnchor",value:function(p,h){return p==="left"?"start":p==="center"?"middle":p==="right"?"end":h?"start":"end"}},{key:"addTooltip",value:function(p,h){var S=document.createElementNS(this.w.globals.SVGNS,"title");S.textContent=Array.isArray(h)?h.join(" "):h,p.node.appendChild(S)}},{key:"rotateLabel",value:function(p,h,S,_){var k=p.rotateAroundCenter(S.node),T=p.rotateAroundCenter(h.node);h.node.setAttribute("transform","rotate(".concat(_," ").concat(k.x," ").concat(T.y,")"))}},{key:"addYAxisTitle",value:function(p,h,S){var _=this.w;if(_.config.yaxis[S].title.text!==void 0){var k=p.group({class:"apexcharts-yaxis-title"}),T=_.config.yaxis[S].opposite?_.globals.translateYAxisX[S]:0,B=p.drawText({x:T,y:_.globals.gridHeight/2+_.globals.translateY+_.config.yaxis[S].title.offsetY,text:_.config.yaxis[S].title.text,textAnchor:"end",foreColor:_.config.yaxis[S].title.style.color,fontSize:_.config.yaxis[S].title.style.fontSize,fontWeight:_.config.yaxis[S].title.style.fontWeight,fontFamily:_.config.yaxis[S].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text ".concat(_.config.yaxis[S].title.style.cssClass)});k.add(B),h.add(k)}}},{key:"addAxisBorder",value:function(p,h,S,_,k){var T=this.w,B=T.config.yaxis[S].axisBorder,q=31+B.offsetX;if(T.config.yaxis[S].opposite&&(q=-31-B.offsetX),B.show){var te=p.drawLine(q,T.globals.translateY+B.offsetY-2,q,T.globals.gridHeight+T.globals.translateY+B.offsetY+2,B.color,0,B.width);h.add(te)}T.config.yaxis[S].axisTicks.show&&this.axesUtils.drawYAxisTicks(q,_,B,T.config.yaxis[S].axisTicks,S,k,h)}},{key:"drawYaxisInversed",value:function(p){var h=this.w,S=new z(this.ctx),_=S.group({class:"apexcharts-xaxis apexcharts-yaxis-inversed"}),k=S.group({class:"apexcharts-xaxis-texts-g",transform:"translate(".concat(h.globals.translateXAxisX,", ").concat(h.globals.translateXAxisY,")")});_.add(k);var T=h.globals.yAxisScale[p].result.length-1,B=h.globals.gridWidth/T+.1,q=B+h.config.xaxis.labels.offsetX,te=h.globals.xLabelFormatter,ue=this.axesUtils.checkForReversedLabels(p,h.globals.yAxisScale[p].result.slice()),de=h.globals.timescaleLabels;if(de.length>0&&(this.xaxisLabels=de.slice(),T=(ue=de.slice()).length),h.config.xaxis.labels.show)for(var xe=de.length?0:T;de.length?xe<de.length:xe>=0;de.length?xe++:xe--){var we=te(ue[xe],xe,h),ke=h.globals.gridWidth+h.globals.padHorizontal-(q-B+h.config.xaxis.labels.offsetX);if(de.length){var Me=this.axesUtils.getLabel(ue,de,ke,xe,this.drawnLabels,this.xaxisFontSize);ke=Me.x,we=Me.text,this.drawnLabels.push(Me.text),xe===0&&h.globals.skipFirstTimelinelabel&&(we=""),xe===ue.length-1&&h.globals.skipLastTimelinelabel&&(we="")}var Ye=S.drawText({x:ke,y:this.xAxisoffX+h.config.xaxis.labels.offsetY+30-(h.config.xaxis.position==="top"?h.globals.xAxisHeight+h.config.xaxis.axisTicks.height-2:0),text:we,textAnchor:"middle",foreColor:Array.isArray(this.xaxisForeColors)?this.xaxisForeColors[p]:this.xaxisForeColors,fontSize:this.xaxisFontSize,fontFamily:this.xaxisFontFamily,fontWeight:h.config.xaxis.labels.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-xaxis-label ".concat(h.config.xaxis.labels.style.cssClass)});k.add(Ye),Ye.tspan(we),this.addTooltip(Ye,we),q+=B}return this.inversedYAxisTitleText(_),this.inversedYAxisBorder(_),_}},{key:"inversedYAxisBorder",value:function(p){var h=this.w,S=new z(this.ctx),_=h.config.xaxis.axisBorder;if(_.show){var k=0;h.config.chart.type==="bar"&&h.globals.isXNumeric&&(k-=15);var T=S.drawLine(h.globals.padHorizontal+k+_.offsetX,this.xAxisoffX,h.globals.gridWidth,this.xAxisoffX,_.color,0,_.height);this.elgrid&&this.elgrid.elGridBorders&&h.config.grid.show?this.elgrid.elGridBorders.add(T):p.add(T)}}},{key:"inversedYAxisTitleText",value:function(p){var h=this.w,S=new z(this.ctx);if(h.config.xaxis.title.text!==void 0){var _=S.group({class:"apexcharts-xaxis-title apexcharts-yaxis-title-inversed"}),k=S.drawText({x:h.globals.gridWidth/2+h.config.xaxis.title.offsetX,y:this.xAxisoffX+parseFloat(this.xaxisFontSize)+parseFloat(h.config.xaxis.title.style.fontSize)+h.config.xaxis.title.offsetY+20,text:h.config.xaxis.title.text,textAnchor:"middle",fontSize:h.config.xaxis.title.style.fontSize,fontFamily:h.config.xaxis.title.style.fontFamily,fontWeight:h.config.xaxis.title.style.fontWeight,foreColor:h.config.xaxis.title.style.color,cssClass:"apexcharts-xaxis-title-text ".concat(h.config.xaxis.title.style.cssClass)});_.add(k),p.add(_)}}},{key:"yAxisTitleRotate",value:function(p,h){var S=this.w,_=new z(this.ctx),k=S.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(p,"'] .apexcharts-yaxis-texts-g")),T=k?k.getBoundingClientRect():{width:0,height:0},B=S.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(p,"'] .apexcharts-yaxis-title text")),q=B?B.getBoundingClientRect():{width:0,height:0};if(B){var te=this.xPaddingForYAxisTitle(p,T,q,h);B.setAttribute("x",te.xPos-(h?10:0));var ue=_.rotateAroundCenter(B);B.setAttribute("transform","rotate(".concat(h?-1*S.config.yaxis[p].title.rotate:S.config.yaxis[p].title.rotate," ").concat(ue.x," ").concat(ue.y,")"))}}},{key:"xPaddingForYAxisTitle",value:function(p,h,S,_){var k=this.w,T=0,B=10;return k.config.yaxis[p].title.text===void 0||p<0?{xPos:T,padd:0}:(_?T=h.width+k.config.yaxis[p].title.offsetX+S.width/2+B/2:(T=-1*h.width+k.config.yaxis[p].title.offsetX+B/2+S.width/2,k.globals.isBarHorizontal&&(B=25,T=-1*h.width-k.config.yaxis[p].title.offsetX-B)),{xPos:T,padd:B})}},{key:"setYAxisXPosition",value:function(p,h){var S=this.w,_=0,k=0,T=18,B=1;S.config.yaxis.length>1&&(this.multipleYs=!0),S.config.yaxis.forEach(function(q,te){var ue=S.globals.ignoreYAxisIndexes.includes(te)||!q.show||q.floating||p[te].width===0,de=p[te].width+h[te].width;q.opposite?S.globals.isBarHorizontal?(k=S.globals.gridWidth+S.globals.translateX-1,S.globals.translateYAxisX[te]=k-q.labels.offsetX):(k=S.globals.gridWidth+S.globals.translateX+B,ue||(B+=de+20),S.globals.translateYAxisX[te]=k-q.labels.offsetX+20):(_=S.globals.translateX-T,ue||(T+=de+20),S.globals.translateYAxisX[te]=_+q.labels.offsetX)})}},{key:"setYAxisTextAlignments",value:function(){var p=this.w;F.listToArray(p.globals.dom.baseEl.getElementsByClassName("apexcharts-yaxis")).forEach(function(h,S){var _=p.config.yaxis[S];if(_&&!_.floating&&_.labels.align!==void 0){var k=p.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(S,"'] .apexcharts-yaxis-texts-g")),T=F.listToArray(p.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis[rel='".concat(S,"'] .apexcharts-yaxis-label"))),B=k.getBoundingClientRect();T.forEach(function(q){q.setAttribute("text-anchor",_.labels.align)}),_.labels.align!=="left"||_.opposite?_.labels.align==="center"?k.setAttribute("transform","translate(".concat(B.width/2*(_.opposite?1:-1),", 0)")):_.labels.align==="right"&&_.opposite&&k.setAttribute("transform","translate(".concat(B.width,", 0)")):k.setAttribute("transform","translate(-".concat(B.width,", 0)"))}})}}]),Ee}(),Ut=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.documentEvent=F.bind(this.documentEvent,this)}return o(Ee,[{key:"addEventListener",value:function(p,h){var S=this.w;S.globals.events.hasOwnProperty(p)?S.globals.events[p].push(h):S.globals.events[p]=[h]}},{key:"removeEventListener",value:function(p,h){var S=this.w;if(S.globals.events.hasOwnProperty(p)){var _=S.globals.events[p].indexOf(h);_!==-1&&S.globals.events[p].splice(_,1)}}},{key:"fireEvent",value:function(p,h){var S=this.w;if(S.globals.events.hasOwnProperty(p)){h&&h.length||(h=[]);for(var _=S.globals.events[p],k=_.length,T=0;T<k;T++)_[T].apply(null,h)}}},{key:"setupEventHandlers",value:function(){var p=this,h=this.w,S=this.ctx,_=h.globals.dom.baseEl.querySelector(h.globals.chartClass);this.ctx.eventList.forEach(function(k){_.addEventListener(k,function(T){var B=Object.assign({},h,{seriesIndex:h.globals.axisCharts?h.globals.capturedSeriesIndex:0,dataPointIndex:h.globals.capturedDataPointIndex});T.type==="mousemove"||T.type==="touchmove"?typeof h.config.chart.events.mouseMove=="function"&&h.config.chart.events.mouseMove(T,S,B):T.type==="mouseleave"||T.type==="touchleave"?typeof h.config.chart.events.mouseLeave=="function"&&h.config.chart.events.mouseLeave(T,S,B):(T.type==="mouseup"&&T.which===1||T.type==="touchend")&&(typeof h.config.chart.events.click=="function"&&h.config.chart.events.click(T,S,B),S.ctx.events.fireEvent("click",[T,S,B]))},{capture:!1,passive:!0})}),this.ctx.eventList.forEach(function(k){h.globals.dom.baseEl.addEventListener(k,p.documentEvent,{passive:!0})}),this.ctx.core.setupBrushHandler()}},{key:"documentEvent",value:function(p){var h=this.w,S=p.target.className;if(p.type==="click"){var _=h.globals.dom.baseEl.querySelector(".apexcharts-menu");_&&_.classList.contains("apexcharts-menu-open")&&S!=="apexcharts-menu-icon"&&_.classList.remove("apexcharts-menu-open")}h.globals.clientX=p.type==="touchmove"?p.touches[0].clientX:p.clientX,h.globals.clientY=p.type==="touchmove"?p.touches[0].clientY:p.clientY}}]),Ee}(),kt=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"setCurrentLocaleValues",value:function(p){var h=this.w.config.chart.locales;window.Apex.chart&&window.Apex.chart.locales&&window.Apex.chart.locales.length>0&&(h=this.w.config.chart.locales.concat(window.Apex.chart.locales));var S=h.filter(function(k){return k.name===p})[0];if(!S)throw new Error("Wrong locale name provided. Please make sure you set the correct locale name in options");var _=F.extend(oe,S);this.w.globals.locale=_.options}}]),Ee}(),tn=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"drawAxis",value:function(p,h){var S,_,k=this,T=this.w.globals,B=this.w.config,q=new it(this.ctx,h),te=new ct(this.ctx,h);T.axisCharts&&p!=="radar"&&(T.isBarHorizontal?(_=te.drawYaxisInversed(0),S=q.drawXaxisInversed(0),T.dom.elGraphical.add(S),T.dom.elGraphical.add(_)):(S=q.drawXaxis(),T.dom.elGraphical.add(S),B.yaxis.map(function(ue,de){if(T.ignoreYAxisIndexes.indexOf(de)===-1&&(_=te.drawYaxis(de),T.dom.Paper.add(_),k.w.config.grid.position==="back")){var xe=T.dom.Paper.children()[1];xe.remove(),T.dom.Paper.add(xe)}})))}}]),Ee}(),jt=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"drawXCrosshairs",value:function(){var p=this.w,h=new z(this.ctx),S=new L(this.ctx),_=p.config.xaxis.crosshairs.fill.gradient,k=p.config.xaxis.crosshairs.dropShadow,T=p.config.xaxis.crosshairs.fill.type,B=_.colorFrom,q=_.colorTo,te=_.opacityFrom,ue=_.opacityTo,de=_.stops,xe=k.enabled,we=k.left,ke=k.top,Me=k.blur,Ye=k.color,Fe=k.opacity,rt=p.config.xaxis.crosshairs.fill.color;if(p.config.xaxis.crosshairs.show){T==="gradient"&&(rt=h.drawGradient("vertical",B,q,te,ue,null,de,null));var se=h.drawRect();p.config.xaxis.crosshairs.width===1&&(se=h.drawLine());var Ce=p.globals.gridHeight;(!F.isNumber(Ce)||Ce<0)&&(Ce=0);var De=p.config.xaxis.crosshairs.width;(!F.isNumber(De)||De<0)&&(De=0),se.attr({class:"apexcharts-xcrosshairs",x:0,y:0,y2:Ce,width:De,height:Ce,fill:rt,filter:"none","fill-opacity":p.config.xaxis.crosshairs.opacity,stroke:p.config.xaxis.crosshairs.stroke.color,"stroke-width":p.config.xaxis.crosshairs.stroke.width,"stroke-dasharray":p.config.xaxis.crosshairs.stroke.dashArray}),xe&&(se=S.dropShadow(se,{left:we,top:ke,blur:Me,color:Ye,opacity:Fe})),p.globals.dom.elGraphical.add(se)}}},{key:"drawYCrosshairs",value:function(){var p=this.w,h=new z(this.ctx),S=p.config.yaxis[0].crosshairs,_=p.globals.barPadForNumericAxis;if(p.config.yaxis[0].crosshairs.show){var k=h.drawLine(-_,0,p.globals.gridWidth+_,0,S.stroke.color,S.stroke.dashArray,S.stroke.width);k.attr({class:"apexcharts-ycrosshairs"}),p.globals.dom.elGraphical.add(k)}var T=h.drawLine(-_,0,p.globals.gridWidth+_,0,S.stroke.color,0,0);T.attr({class:"apexcharts-ycrosshairs-hidden"}),p.globals.dom.elGraphical.add(T)}}]),Ee}(),un=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"checkResponsiveConfig",value:function(p){var h=this,S=this.w,_=S.config;if(_.responsive.length!==0){var k=_.responsive.slice();k.sort(function(te,ue){return te.breakpoint>ue.breakpoint?1:ue.breakpoint>te.breakpoint?-1:0}).reverse();var T=new Ae({}),B=function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ue=k[0].breakpoint,de=window.innerWidth>0?window.innerWidth:screen.width;if(de>ue){var xe=F.clone(S.globals.initialConfig);xe.series=F.clone(S.config.series);var we=X.extendArrayProps(T,xe,S);te=F.extend(we,te),te=F.extend(S.config,te),h.overrideResponsiveOptions(te)}else for(var ke=0;ke<k.length;ke++)de<k[ke].breakpoint&&(te=X.extendArrayProps(T,k[ke].options,S),te=F.extend(S.config,te),h.overrideResponsiveOptions(te))};if(p){var q=X.extendArrayProps(T,p,S);q=F.extend(S.config,q),B(q=F.extend(q,p))}else B({})}}},{key:"overrideResponsiveOptions",value:function(p){var h=new Ae(p).init({responsiveOverride:!0});this.w.config=h}}]),Ee}(),cn=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.colors=[],this.isColorFn=!1,this.isHeatmapDistributed=this.checkHeatmapDistributed(),this.isBarDistributed=this.checkBarDistributed()}return o(Ee,[{key:"checkHeatmapDistributed",value:function(){var p=this.w.config,h=p.chart,S=p.plotOptions;return h.type==="treemap"&&S.treemap&&S.treemap.distributed||h.type==="heatmap"&&S.heatmap&&S.heatmap.distributed}},{key:"checkBarDistributed",value:function(){var p=this.w.config,h=p.chart,S=p.plotOptions;return S.bar&&S.bar.distributed&&(h.type==="bar"||h.type==="rangeBar")}},{key:"init",value:function(){this.setDefaultColors()}},{key:"setDefaultColors",value:function(){var p=this.w,h=new F;p.globals.dom.elWrap.classList.add("apexcharts-theme-".concat(p.config.theme.mode));var S=N(p.config.colors||p.config.fill.colors||[]);p.globals.colors=this.getColors(S),this.applySeriesColors(p.globals.seriesColors,p.globals.colors),p.config.theme.monochrome.enabled&&(p.globals.colors=this.getMonochromeColors(p.config.theme.monochrome,p.globals.series,h));var _=p.globals.colors.slice();this.pushExtraColors(p.globals.colors),this.applyColorTypes(["fill","stroke"],_),this.applyDataLabelsColors(_),this.applyRadarPolygonsColors(),this.applyMarkersColors(_)}},{key:"getColors",value:function(p){var h=this,S=this.w;return p&&p.length!==0?Array.isArray(p)&&p.length>0&&typeof p[0]=="function"?(this.isColorFn=!0,S.config.series.map(function(_,k){var T=p[k]||p[0];return typeof T=="function"?T({value:S.globals.axisCharts?S.globals.series[k][0]||0:S.globals.series[k],seriesIndex:k,dataPointIndex:k,w:h.w}):T})):p:this.predefined()}},{key:"applySeriesColors",value:function(p,h){p.forEach(function(S,_){S&&(h[_]=S)})}},{key:"getMonochromeColors",value:function(p,h,S){var _=p.color,k=p.shadeIntensity,T=p.shadeTo,B=this.isBarDistributed||this.isHeatmapDistributed?h[0].length*h.length:h.length,q=1/(B/k),te=0;return Array.from({length:B},function(){var ue=T==="dark"?S.shadeColor(-1*te,_):S.shadeColor(te,_);return te+=q,ue})}},{key:"applyColorTypes",value:function(p,h){var S=this,_=this.w;p.forEach(function(k){_.globals[k].colors=_.config[k].colors===void 0?S.isColorFn?_.config.colors:h:_.config[k].colors.slice(),S.pushExtraColors(_.globals[k].colors)})}},{key:"applyDataLabelsColors",value:function(p){var h=this.w;h.globals.dataLabels.style.colors=h.config.dataLabels.style.colors===void 0?p:h.config.dataLabels.style.colors.slice(),this.pushExtraColors(h.globals.dataLabels.style.colors,50)}},{key:"applyRadarPolygonsColors",value:function(){var p=this.w;p.globals.radarPolygons.fill.colors=p.config.plotOptions.radar.polygons.fill.colors===void 0?[p.config.theme.mode==="dark"?"#424242":"none"]:p.config.plotOptions.radar.polygons.fill.colors.slice(),this.pushExtraColors(p.globals.radarPolygons.fill.colors,20)}},{key:"applyMarkersColors",value:function(p){var h=this.w;h.globals.markers.colors=h.config.markers.colors===void 0?p:h.config.markers.colors.slice(),this.pushExtraColors(h.globals.markers.colors)}},{key:"pushExtraColors",value:function(p,h){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_=this.w,k=h||_.globals.series.length;if(S===null&&(S=this.isBarDistributed||this.isHeatmapDistributed||_.config.chart.type==="heatmap"&&_.config.plotOptions.heatmap&&_.config.plotOptions.heatmap.colorScale.inverse),S&&_.globals.series.length&&(k=_.globals.series[_.globals.maxValsInArrayIndex].length*_.globals.series.length),p.length<k)for(var T=k-p.length,B=0;B<T;B++)p.push(p[B])}},{key:"updateThemeOptions",value:function(p){p.chart=p.chart||{},p.tooltip=p.tooltip||{};var h=p.theme.mode,S=h==="dark"?"palette4":h==="light"?"palette1":p.theme.palette||"palette1",_=h==="dark"?"#f6f7f8":h==="light"?"#373d3f":p.chart.foreColor||"#373d3f";return p.tooltip.theme=h||"light",p.chart.foreColor=_,p.theme.palette=S,p}},{key:"predefined",value:function(){var p={palette1:["#008FFB","#00E396","#FEB019","#FF4560","#775DD0"],palette2:["#3f51b5","#03a9f4","#4caf50","#f9ce1d","#FF9800"],palette3:["#33b2df","#546E7A","#d4526e","#13d8aa","#A5978B"],palette4:["#4ecdc4","#c7f464","#81D4FA","#fd6a6a","#546E7A"],palette5:["#2b908f","#f9a3a4","#90ee7e","#fa4443","#69d2e7"],palette6:["#449DD1","#F86624","#EA3546","#662E9B","#C5D86D"],palette7:["#D7263D","#1B998B","#2E294E","#F46036","#E2C044"],palette8:["#662E9B","#F86624","#F9C80E","#EA3546","#43BCCD"],palette9:["#5C4742","#A5978B","#8D5B4C","#5A2A27","#C4BBAF"],palette10:["#A300D6","#7D02EB","#5653FE","#2983FF","#00B1F2"],default:["#008FFB","#00E396","#FEB019","#FF4560","#775DD0"]};return p[this.w.config.theme.palette]||p.default}}]),Ee}(),Pt=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"draw",value:function(){this.drawTitleSubtitle("title"),this.drawTitleSubtitle("subtitle")}},{key:"drawTitleSubtitle",value:function(p){var h=this.w,S=p==="title"?h.config.title:h.config.subtitle,_=h.globals.svgWidth/2,k=S.offsetY,T="middle";if(S.align==="left"?(_=10,T="start"):S.align==="right"&&(_=h.globals.svgWidth-10,T="end"),_+=S.offsetX,k=k+parseInt(S.style.fontSize,10)+S.margin/2,S.text!==void 0){var B=new z(this.ctx).drawText({x:_,y:k,text:S.text,textAnchor:T,fontSize:S.style.fontSize,fontFamily:S.style.fontFamily,fontWeight:S.style.fontWeight,foreColor:S.style.color,opacity:1});B.node.setAttribute("class","apexcharts-".concat(p,"-text")),h.globals.dom.Paper.add(B)}}}]),Ee}(),Xe=function(){function Ee(p){s(this,Ee),this.w=p.w,this.dCtx=p}return o(Ee,[{key:"getTitleSubtitleCoords",value:function(p){var h=this.w,S=0,_=0,k=p==="title"?h.config.title.floating:h.config.subtitle.floating,T=h.globals.dom.baseEl.querySelector(".apexcharts-".concat(p,"-text"));if(T!==null&&!k){var B=T.getBoundingClientRect();S=B.width,_=h.globals.axisCharts?B.height+5:B.height}return{width:S,height:_}}},{key:"getLegendsRect",value:function(){var p=this.w,h=p.globals.dom.elLegendWrap;p.config.legend.height||p.config.legend.position!=="top"&&p.config.legend.position!=="bottom"||(h.style.maxHeight=p.globals.svgHeight/2+"px");var S=Object.assign({},F.getBoundingClientRect(h));return h!==null&&!p.config.legend.floating&&p.config.legend.show?this.dCtx.lgRect={x:S.x,y:S.y,height:S.height,width:S.height===0?0:S.width}:this.dCtx.lgRect={x:0,y:0,height:0,width:0},p.config.legend.position!=="left"&&p.config.legend.position!=="right"||1.5*this.dCtx.lgRect.width>p.globals.svgWidth&&(this.dCtx.lgRect.width=p.globals.svgWidth/1.5),this.dCtx.lgRect}},{key:"getDatalabelsRect",value:function(){var p=this,h=this.w,S=[];h.config.series.forEach(function(q,te){q.data.forEach(function(ue,de){var xe;xe=h.globals.series[te][de],_=h.config.dataLabels.formatter(xe,{ctx:p.dCtx.ctx,seriesIndex:te,dataPointIndex:de,w:h}),S.push(_)})});var _=F.getLargestStringFromArr(S),k=new z(this.dCtx.ctx),T=h.config.dataLabels.style,B=k.getTextRects(_,parseInt(T.fontSize),T.fontFamily);return{width:1.05*B.width,height:B.height}}},{key:"getLargestStringFromMultiArr",value:function(p,h){var S=p;if(this.w.globals.isMultiLineX){var _=h.map(function(T,B){return Array.isArray(T)?T.length:1}),k=Math.max.apply(Math,N(_));S=h[_.indexOf(k)]}return S}}]),Ee}(),Vt=function(){function Ee(p){s(this,Ee),this.w=p.w,this.dCtx=p}return o(Ee,[{key:"getxAxisLabelsCoords",value:function(){var p,h=this.w,S=h.globals.labels.slice();if(h.config.xaxis.convertedCatToNumeric&&S.length===0&&(S=h.globals.categoryLabels),h.globals.timescaleLabels.length>0){var _=this.getxAxisTimeScaleLabelsCoords();p={width:_.width,height:_.height},h.globals.rotateXLabels=!1}else{this.dCtx.lgWidthForSideLegends=h.config.legend.position!=="left"&&h.config.legend.position!=="right"||h.config.legend.floating?0:this.dCtx.lgRect.width;var k=h.globals.xLabelFormatter,T=F.getLargestStringFromArr(S),B=this.dCtx.dimHelpers.getLargestStringFromMultiArr(T,S);h.globals.isBarHorizontal&&(B=T=h.globals.yAxisScale[0].result.reduce(function(ke,Me){return ke.length>Me.length?ke:Me},0));var q=new re(this.dCtx.ctx),te=T;T=q.xLabelFormat(k,T,te,{i:void 0,dateFormatter:new Z(this.dCtx.ctx).formatDate,w:h}),B=q.xLabelFormat(k,B,te,{i:void 0,dateFormatter:new Z(this.dCtx.ctx).formatDate,w:h}),(h.config.xaxis.convertedCatToNumeric&&T===void 0||String(T).trim()==="")&&(B=T="1");var ue=new z(this.dCtx.ctx),de=ue.getTextRects(T,h.config.xaxis.labels.style.fontSize),xe=de;if(T!==B&&(xe=ue.getTextRects(B,h.config.xaxis.labels.style.fontSize)),(p={width:de.width>=xe.width?de.width:xe.width,height:de.height>=xe.height?de.height:xe.height}).width*S.length>h.globals.svgWidth-this.dCtx.lgWidthForSideLegends-this.dCtx.yAxisWidth-this.dCtx.gridPad.left-this.dCtx.gridPad.right&&h.config.xaxis.labels.rotate!==0||h.config.xaxis.labels.rotateAlways){if(!h.globals.isBarHorizontal){h.globals.rotateXLabels=!0;var we=function(ke){return ue.getTextRects(ke,h.config.xaxis.labels.style.fontSize,h.config.xaxis.labels.style.fontFamily,"rotate(".concat(h.config.xaxis.labels.rotate," 0 0)"),!1)};de=we(T),T!==B&&(xe=we(B)),p.height=(de.height>xe.height?de.height:xe.height)/1.5,p.width=de.width>xe.width?de.width:xe.width}}else h.globals.rotateXLabels=!1}return h.config.xaxis.labels.show||(p={width:0,height:0}),{width:p.width,height:p.height}}},{key:"getxAxisGroupLabelsCoords",value:function(){var p,h=this.w;if(!h.globals.hasXaxisGroups)return{width:0,height:0};var S,_=((p=h.config.xaxis.group.style)===null||p===void 0?void 0:p.fontSize)||h.config.xaxis.labels.style.fontSize,k=h.globals.groups.map(function(de){return de.title}),T=F.getLargestStringFromArr(k),B=this.dCtx.dimHelpers.getLargestStringFromMultiArr(T,k),q=new z(this.dCtx.ctx),te=q.getTextRects(T,_),ue=te;return T!==B&&(ue=q.getTextRects(B,_)),S={width:te.width>=ue.width?te.width:ue.width,height:te.height>=ue.height?te.height:ue.height},h.config.xaxis.labels.show||(S={width:0,height:0}),{width:S.width,height:S.height}}},{key:"getxAxisTitleCoords",value:function(){var p=this.w,h=0,S=0;if(p.config.xaxis.title.text!==void 0){var _=new z(this.dCtx.ctx).getTextRects(p.config.xaxis.title.text,p.config.xaxis.title.style.fontSize);h=_.width,S=_.height}return{width:h,height:S}}},{key:"getxAxisTimeScaleLabelsCoords",value:function(){var p,h=this.w;this.dCtx.timescaleLabels=h.globals.timescaleLabels.slice();var S=this.dCtx.timescaleLabels.map(function(k){return k.value}),_=S.reduce(function(k,T){return k===void 0?(console.error("You have possibly supplied invalid Date format. Please supply a valid JavaScript Date"),0):k.length>T.length?k:T},0);return 1.05*(p=new z(this.dCtx.ctx).getTextRects(_,h.config.xaxis.labels.style.fontSize)).width*S.length>h.globals.gridWidth&&h.config.xaxis.labels.rotate!==0&&(h.globals.overlappingXLabels=!0),p}},{key:"additionalPaddingXLabels",value:function(p){var h=this,S=this.w,_=S.globals,k=S.config,T=k.xaxis.type,B=p.width;_.skipLastTimelinelabel=!1,_.skipFirstTimelinelabel=!1;var q=S.config.yaxis[0].opposite&&S.globals.isBarHorizontal,te=function(ue,de){k.yaxis.length>1&&function(xe){return _.collapsedSeriesIndices.indexOf(xe)!==-1}(de)||function(xe){if(h.dCtx.timescaleLabels&&h.dCtx.timescaleLabels.length){var we=h.dCtx.timescaleLabels[0],ke=h.dCtx.timescaleLabels[h.dCtx.timescaleLabels.length-1].position+B/1.75-h.dCtx.yAxisWidthRight,Me=we.position-B/1.75+h.dCtx.yAxisWidthLeft,Ye=S.config.legend.position==="right"&&h.dCtx.lgRect.width>0?h.dCtx.lgRect.width:0;ke>_.svgWidth-_.translateX-Ye&&(_.skipLastTimelinelabel=!0),Me<-(xe.show&&!xe.floating||k.chart.type!=="bar"&&k.chart.type!=="candlestick"&&k.chart.type!=="rangeBar"&&k.chart.type!=="boxPlot"?10:B/1.75)&&(_.skipFirstTimelinelabel=!0)}else T==="datetime"?h.dCtx.gridPad.right<B&&!_.rotateXLabels&&(_.skipLastTimelinelabel=!0):T!=="datetime"&&h.dCtx.gridPad.right<B/2-h.dCtx.yAxisWidthRight&&!_.rotateXLabels&&!S.config.xaxis.labels.trim&&(h.dCtx.xPadRight=B/2+1)}(ue)};k.yaxis.forEach(function(ue,de){q?(h.dCtx.gridPad.left<B&&(h.dCtx.xPadLeft=B/2+1),h.dCtx.xPadRight=B/2+1):te(ue,de)})}}]),Ee}(),Yt=function(){function Ee(p){s(this,Ee),this.w=p.w,this.dCtx=p}return o(Ee,[{key:"getyAxisLabelsCoords",value:function(){var p=this,h=this.w,S=[],_=10,k=new he(this.dCtx.ctx);return h.config.yaxis.map(function(T,B){var q={seriesIndex:B,dataPointIndex:-1,w:h},te=h.globals.yAxisScale[B],ue=0;if(!k.isYAxisHidden(B)&&T.labels.show&&T.labels.minWidth!==void 0&&(ue=T.labels.minWidth),!k.isYAxisHidden(B)&&T.labels.show&&te.result.length){var de=h.globals.yLabelFormatters[B],xe=te.niceMin===Number.MIN_VALUE?0:te.niceMin,we=te.result.reduce(function(Ce,De){var Le,_e;return((Le=String(de(Ce,q)))===null||Le===void 0?void 0:Le.length)>((_e=String(de(De,q)))===null||_e===void 0?void 0:_e.length)?Ce:De},xe),ke=we=de(we,q);if(we!==void 0&&we.length!==0||(we=te.niceMax),h.globals.isBarHorizontal){_=0;var Me=h.globals.labels.slice();we=F.getLargestStringFromArr(Me),we=de(we,{seriesIndex:B,dataPointIndex:-1,w:h}),ke=p.dCtx.dimHelpers.getLargestStringFromMultiArr(we,Me)}var Ye=new z(p.dCtx.ctx),Fe="rotate(".concat(T.labels.rotate," 0 0)"),rt=Ye.getTextRects(we,T.labels.style.fontSize,T.labels.style.fontFamily,Fe,!1),se=rt;we!==ke&&(se=Ye.getTextRects(ke,T.labels.style.fontSize,T.labels.style.fontFamily,Fe,!1)),S.push({width:(ue>se.width||ue>rt.width?ue:se.width>rt.width?se.width:rt.width)+_,height:se.height>rt.height?se.height:rt.height})}else S.push({width:0,height:0})}),S}},{key:"getyAxisTitleCoords",value:function(){var p=this,h=this.w,S=[];return h.config.yaxis.map(function(_,k){if(_.show&&_.title.text!==void 0){var T=new z(p.dCtx.ctx),B="rotate(".concat(_.title.rotate," 0 0)"),q=T.getTextRects(_.title.text,_.title.style.fontSize,_.title.style.fontFamily,B,!1);S.push({width:q.width,height:q.height})}else S.push({width:0,height:0})}),S}},{key:"getTotalYAxisWidth",value:function(){var p=this.w,h=0,S=0,_=0,k=p.globals.yAxisScale.length>1?10:0,T=new he(this.dCtx.ctx),B=function(q,te){var ue=p.config.yaxis[te].floating,de=0;q.width>0&&!ue?(de=q.width+k,function(xe){return p.globals.ignoreYAxisIndexes.indexOf(xe)>-1}(te)&&(de=de-q.width-k)):de=ue||T.isYAxisHidden(te)?0:5,p.config.yaxis[te].opposite?_+=de:S+=de,h+=de};return p.globals.yLabelsCoords.map(function(q,te){B(q,te)}),p.globals.yTitleCoords.map(function(q,te){B(q,te)}),p.globals.isBarHorizontal&&!p.config.yaxis[0].floating&&(h=p.globals.yLabelsCoords[0].width+p.globals.yTitleCoords[0].width+15),this.dCtx.yAxisWidthLeft=S,this.dCtx.yAxisWidthRight=_,h}}]),Ee}(),Ve=function(){function Ee(p){s(this,Ee),this.w=p.w,this.dCtx=p}return o(Ee,[{key:"gridPadForColumnsInNumericAxis",value:function(p){var h=this.w,S=h.config,_=h.globals;if(_.noData||_.collapsedSeries.length+_.ancillaryCollapsedSeries.length===S.series.length)return 0;var k=function(we){return["bar","rangeBar","candlestick","boxPlot"].includes(we)},T=S.chart.type,B=0,q=k(T)?S.series.length:1;_.comboBarCount>0&&(q=_.comboBarCount),_.collapsedSeries.forEach(function(we){k(we.type)&&(q-=1)}),S.chart.stacked&&(q=1);var te=k(T)||_.comboBarCount>0,ue=Math.abs(_.initialMaxX-_.initialMinX);if(te&&_.isXNumeric&&!_.isBarHorizontal&&q>0&&ue!==0){ue<=3&&(ue=_.dataPoints);var de=ue/p,xe=_.minXDiff&&_.minXDiff/de>0?_.minXDiff/de:0;xe>p/2&&(xe/=2),(B=xe*parseInt(S.plotOptions.bar.columnWidth,10)/100)<1&&(B=1),_.barPadForNumericAxis=B}return B}},{key:"gridPadFortitleSubtitle",value:function(){var p=this,h=this.w,S=h.globals,_=this.dCtx.isSparkline||!S.axisCharts?0:10;["title","subtitle"].forEach(function(B){h.config[B].text!==void 0?_+=h.config[B].margin:_+=p.dCtx.isSparkline||!S.axisCharts?0:5}),!h.config.legend.show||h.config.legend.position!=="bottom"||h.config.legend.floating||S.axisCharts||(_+=10);var k=this.dCtx.dimHelpers.getTitleSubtitleCoords("title"),T=this.dCtx.dimHelpers.getTitleSubtitleCoords("subtitle");S.gridHeight-=k.height+T.height+_,S.translateY+=k.height+T.height+_}},{key:"setGridXPosForDualYAxis",value:function(p,h){var S=this.w,_=new he(this.dCtx.ctx);S.config.yaxis.forEach(function(k,T){S.globals.ignoreYAxisIndexes.indexOf(T)!==-1||k.floating||_.isYAxisHidden(T)||(k.opposite&&(S.globals.translateX-=h[T].width+p[T].width+parseInt(k.labels.style.fontSize,10)/1.2+12),S.globals.translateX<2&&(S.globals.translateX=2))})}}]),Ee}(),Ke=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.lgRect={},this.yAxisWidth=0,this.yAxisWidthLeft=0,this.yAxisWidthRight=0,this.xAxisHeight=0,this.isSparkline=this.w.config.chart.sparkline.enabled,this.dimHelpers=new Xe(this),this.dimYAxis=new Yt(this),this.dimXAxis=new Vt(this),this.dimGrid=new Ve(this),this.lgWidthForSideLegends=0,this.gridPad=this.w.config.grid.padding,this.xPadRight=0,this.xPadLeft=0}return o(Ee,[{key:"plotCoords",value:function(){var p=this,h=this.w,S=h.globals;this.lgRect=this.dimHelpers.getLegendsRect(),this.datalabelsCoords={width:0,height:0};var _=Array.isArray(h.config.stroke.width)?Math.max.apply(Math,N(h.config.stroke.width)):h.config.stroke.width;this.isSparkline&&((h.config.markers.discrete.length>0||h.config.markers.size>0)&&Object.entries(this.gridPad).forEach(function(T){var B=C(T,2),q=B[0],te=B[1];p.gridPad[q]=Math.max(te,p.w.globals.markers.largestSize/1.5)}),this.gridPad.top=Math.max(_/2,this.gridPad.top),this.gridPad.bottom=Math.max(_/2,this.gridPad.bottom)),S.axisCharts?this.setDimensionsForAxisCharts():this.setDimensionsForNonAxisCharts(),this.dimGrid.gridPadFortitleSubtitle(),S.gridHeight=S.gridHeight-this.gridPad.top-this.gridPad.bottom,S.gridWidth=S.gridWidth-this.gridPad.left-this.gridPad.right-this.xPadRight-this.xPadLeft;var k=this.dimGrid.gridPadForColumnsInNumericAxis(S.gridWidth);S.gridWidth=S.gridWidth-2*k,S.translateX=S.translateX+this.gridPad.left+this.xPadLeft+(k>0?k:0),S.translateY=S.translateY+this.gridPad.top}},{key:"setDimensionsForAxisCharts",value:function(){var p=this,h=this.w,S=h.globals,_=this.dimYAxis.getyAxisLabelsCoords(),k=this.dimYAxis.getyAxisTitleCoords();S.isSlopeChart&&(this.datalabelsCoords=this.dimHelpers.getDatalabelsRect()),h.globals.yLabelsCoords=[],h.globals.yTitleCoords=[],h.config.yaxis.map(function(we,ke){h.globals.yLabelsCoords.push({width:_[ke].width,index:ke}),h.globals.yTitleCoords.push({width:k[ke].width,index:ke})}),this.yAxisWidth=this.dimYAxis.getTotalYAxisWidth();var T=this.dimXAxis.getxAxisLabelsCoords(),B=this.dimXAxis.getxAxisGroupLabelsCoords(),q=this.dimXAxis.getxAxisTitleCoords();this.conditionalChecksForAxisCoords(T,q,B),S.translateXAxisY=h.globals.rotateXLabels?this.xAxisHeight/8:-4,S.translateXAxisX=h.globals.rotateXLabels&&h.globals.isXNumeric&&h.config.xaxis.labels.rotate<=-45?-this.xAxisWidth/4:0,h.globals.isBarHorizontal&&(S.rotateXLabels=!1,S.translateXAxisY=parseInt(h.config.xaxis.labels.style.fontSize,10)/1.5*-1),S.translateXAxisY=S.translateXAxisY+h.config.xaxis.labels.offsetY,S.translateXAxisX=S.translateXAxisX+h.config.xaxis.labels.offsetX;var te=this.yAxisWidth,ue=this.xAxisHeight;S.xAxisLabelsHeight=this.xAxisHeight-q.height,S.xAxisGroupLabelsHeight=S.xAxisLabelsHeight-T.height,S.xAxisLabelsWidth=this.xAxisWidth,S.xAxisHeight=this.xAxisHeight;var de=10;(h.config.chart.type==="radar"||this.isSparkline)&&(te=0,ue=0),this.isSparkline&&(this.lgRect={height:0,width:0}),(this.isSparkline||h.config.chart.type==="treemap")&&(te=0,ue=0,de=0),this.isSparkline||h.config.chart.type==="treemap"||this.dimXAxis.additionalPaddingXLabels(T);var xe=function(){S.translateX=te+p.datalabelsCoords.width,S.gridHeight=S.svgHeight-p.lgRect.height-ue-(p.isSparkline||h.config.chart.type==="treemap"?0:h.globals.rotateXLabels?10:15),S.gridWidth=S.svgWidth-te-2*p.datalabelsCoords.width};switch(h.config.xaxis.position==="top"&&(de=S.xAxisHeight-h.config.xaxis.axisTicks.height-5),h.config.legend.position){case"bottom":S.translateY=de,xe();break;case"top":S.translateY=this.lgRect.height+de,xe();break;case"left":S.translateY=de,S.translateX=this.lgRect.width+te+this.datalabelsCoords.width,S.gridHeight=S.svgHeight-ue-12,S.gridWidth=S.svgWidth-this.lgRect.width-te-2*this.datalabelsCoords.width;break;case"right":S.translateY=de,S.translateX=te+this.datalabelsCoords.width,S.gridHeight=S.svgHeight-ue-12,S.gridWidth=S.svgWidth-this.lgRect.width-te-2*this.datalabelsCoords.width-5;break;default:throw new Error("Legend position not supported")}this.dimGrid.setGridXPosForDualYAxis(k,_),new ct(this.ctx).setYAxisXPosition(_,k)}},{key:"setDimensionsForNonAxisCharts",value:function(){var p=this.w,h=p.globals,S=p.config,_=0;p.config.legend.show&&!p.config.legend.floating&&(_=20);var k=S.chart.type==="pie"||S.chart.type==="polarArea"||S.chart.type==="donut"?"pie":"radialBar",T=S.plotOptions[k].offsetY,B=S.plotOptions[k].offsetX;if(!S.legend.show||S.legend.floating){h.gridHeight=h.svgHeight;var q=h.dom.elWrap.getBoundingClientRect().width;return h.gridWidth=Math.min(q,h.gridHeight),h.translateY=T,void(h.translateX=B+(h.svgWidth-h.gridWidth)/2)}switch(S.legend.position){case"bottom":h.gridHeight=h.svgHeight-this.lgRect.height,h.gridWidth=h.svgWidth,h.translateY=T-10,h.translateX=B+(h.svgWidth-h.gridWidth)/2;break;case"top":h.gridHeight=h.svgHeight-this.lgRect.height,h.gridWidth=h.svgWidth,h.translateY=this.lgRect.height+T+10,h.translateX=B+(h.svgWidth-h.gridWidth)/2;break;case"left":h.gridWidth=h.svgWidth-this.lgRect.width-_,h.gridHeight=S.chart.height!=="auto"?h.svgHeight:h.gridWidth,h.translateY=T,h.translateX=B+this.lgRect.width+_;break;case"right":h.gridWidth=h.svgWidth-this.lgRect.width-_-5,h.gridHeight=S.chart.height!=="auto"?h.svgHeight:h.gridWidth,h.translateY=T,h.translateX=B+10;break;default:throw new Error("Legend position not supported")}}},{key:"conditionalChecksForAxisCoords",value:function(p,h,S){var _=this.w,k=_.globals.hasXaxisGroups?2:1,T=S.height+p.height+h.height,B=_.globals.isMultiLineX?1.2:_.globals.LINE_HEIGHT_RATIO,q=_.globals.rotateXLabels?22:10,te=_.globals.rotateXLabels&&_.config.legend.position==="bottom"?10:0;this.xAxisHeight=T*B+k*q+te,this.xAxisWidth=p.width,this.xAxisHeight-h.height>_.config.xaxis.labels.maxHeight&&(this.xAxisHeight=_.config.xaxis.labels.maxHeight),_.config.xaxis.labels.minHeight&&this.xAxisHeight<_.config.xaxis.labels.minHeight&&(this.xAxisHeight=_.config.xaxis.labels.minHeight),_.config.xaxis.floating&&(this.xAxisHeight=0);var ue=0,de=0;_.config.yaxis.forEach(function(xe){ue+=xe.labels.minWidth,de+=xe.labels.maxWidth}),this.yAxisWidth<ue&&(this.yAxisWidth=ue),this.yAxisWidth>de&&(this.yAxisWidth=de)}}]),Ee}(),ft=function(){function Ee(p){s(this,Ee),this.w=p.w,this.lgCtx=p}return o(Ee,[{key:"getLegendStyles",value:function(){var p,h,S,_=document.createElement("style");_.setAttribute("type","text/css");var k=((p=this.lgCtx.ctx)===null||p===void 0||(h=p.opts)===null||h===void 0||(S=h.chart)===null||S===void 0?void 0:S.nonce)||this.w.config.chart.nonce;k&&_.setAttribute("nonce",k);var T=document.createTextNode(`
      .apexcharts-flip-y {
        transform: scaleY(-1) translateY(-100%);
        transform-origin: top;
        transform-box: fill-box;
      }
      .apexcharts-flip-x {
        transform: scaleX(-1);
        transform-origin: center;
        transform-box: fill-box;
      }
      .apexcharts-legend {
        display: flex;
        overflow: auto;
        padding: 0 10px;
      }
      .apexcharts-legend.apx-legend-position-bottom, .apexcharts-legend.apx-legend-position-top {
        flex-wrap: wrap
      }
      .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {
        flex-direction: column;
        bottom: 0;
      }
      .apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left, .apexcharts-legend.apx-legend-position-top.apexcharts-align-left, .apexcharts-legend.apx-legend-position-right, .apexcharts-legend.apx-legend-position-left {
        justify-content: flex-start;
      }
      .apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center {
        justify-content: center;
      }
      .apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right, .apexcharts-legend.apx-legend-position-top.apexcharts-align-right {
        justify-content: flex-end;
      }
      .apexcharts-legend-series {
        cursor: pointer;
        line-height: normal;
        display: flex;
        align-items: center;
      }
      .apexcharts-legend-text {
        position: relative;
        font-size: 14px;
      }
      .apexcharts-legend-text *, .apexcharts-legend-marker * {
        pointer-events: none;
      }
      .apexcharts-legend-marker {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        margin-right: 1px;
      }

      .apexcharts-legend-series.apexcharts-no-click {
        cursor: auto;
      }
      .apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series {
        display: none !important;
      }
      .apexcharts-inactive-legend {
        opacity: 0.45;
      }`);return _.appendChild(T),_}},{key:"getLegendDimensions",value:function(){var p=this.w.globals.dom.baseEl.querySelector(".apexcharts-legend").getBoundingClientRect(),h=p.width;return{clwh:p.height,clww:h}}},{key:"appendToForeignObject",value:function(){this.w.globals.dom.elLegendForeign.appendChild(this.getLegendStyles())}},{key:"toggleDataSeries",value:function(p,h){var S=this,_=this.w;if(_.globals.axisCharts||_.config.chart.type==="radialBar"){_.globals.resized=!0;var k=null,T=null;_.globals.risingSeries=[],_.globals.axisCharts?(k=_.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(p,"']")),T=parseInt(k.getAttribute("data:realIndex"),10)):(k=_.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(p+1,"']")),T=parseInt(k.getAttribute("rel"),10)-1),h?[{cs:_.globals.collapsedSeries,csi:_.globals.collapsedSeriesIndices},{cs:_.globals.ancillaryCollapsedSeries,csi:_.globals.ancillaryCollapsedSeriesIndices}].forEach(function(ue){S.riseCollapsedSeries(ue.cs,ue.csi,T)}):this.hideSeries({seriesEl:k,realIndex:T})}else{var B=_.globals.dom.Paper.select(" .apexcharts-series[rel='".concat(p+1,"'] path")),q=_.config.chart.type;if(q==="pie"||q==="polarArea"||q==="donut"){var te=_.config.plotOptions.pie.donut.labels;new z(this.lgCtx.ctx).pathMouseDown(B.members[0],null),this.lgCtx.ctx.pie.printDataLabelsInner(B.members[0].node,te)}B.fire("click")}}},{key:"getSeriesAfterCollapsing",value:function(p){var h=p.realIndex,S=this.w,_=S.globals,k=F.clone(S.config.series);if(_.axisCharts){var T=S.config.yaxis[_.seriesYAxisReverseMap[h]],B={index:h,data:k[h].data.slice(),type:k[h].type||S.config.chart.type};if(T&&T.show&&T.showAlways)_.ancillaryCollapsedSeriesIndices.indexOf(h)<0&&(_.ancillaryCollapsedSeries.push(B),_.ancillaryCollapsedSeriesIndices.push(h));else if(_.collapsedSeriesIndices.indexOf(h)<0){_.collapsedSeries.push(B),_.collapsedSeriesIndices.push(h);var q=_.risingSeries.indexOf(h);_.risingSeries.splice(q,1)}}else _.collapsedSeries.push({index:h,data:k[h]}),_.collapsedSeriesIndices.push(h);return _.allSeriesCollapsed=_.collapsedSeries.length+_.ancillaryCollapsedSeries.length===S.config.series.length,this._getSeriesBasedOnCollapsedState(k)}},{key:"hideSeries",value:function(p){for(var h=p.seriesEl,S=p.realIndex,_=this.w,k=this.getSeriesAfterCollapsing({realIndex:S}),T=h.childNodes,B=0;B<T.length;B++)T[B].classList.contains("apexcharts-series-markers-wrap")&&(T[B].classList.contains("apexcharts-hide")?T[B].classList.remove("apexcharts-hide"):T[B].classList.add("apexcharts-hide"));this.lgCtx.ctx.updateHelpers._updateSeries(k,_.config.chart.animations.dynamicAnimation.enabled)}},{key:"riseCollapsedSeries",value:function(p,h,S){var _=this.w,k=F.clone(_.config.series);if(p.length>0){for(var T=0;T<p.length;T++)p[T].index===S&&(_.globals.axisCharts?k[S].data=p[T].data.slice():k[S]=p[T].data,k[S].hidden=!1,p.splice(T,1),h.splice(T,1),_.globals.risingSeries.push(S));k=this._getSeriesBasedOnCollapsedState(k),this.lgCtx.ctx.updateHelpers._updateSeries(k,_.config.chart.animations.dynamicAnimation.enabled)}}},{key:"_getSeriesBasedOnCollapsedState",value:function(p){var h=this.w,S=0;return h.globals.axisCharts?p.forEach(function(_,k){h.globals.collapsedSeriesIndices.indexOf(k)<0&&h.globals.ancillaryCollapsedSeriesIndices.indexOf(k)<0||(p[k].data=[],S++)}):p.forEach(function(_,k){!h.globals.collapsedSeriesIndices.indexOf(k)<0&&(p[k]=0,S++)}),h.globals.allSeriesCollapsed=S===p.length,p}}]),Ee}(),en=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.isBarsDistributed=this.w.config.chart.type==="bar"&&this.w.config.plotOptions.bar.distributed&&this.w.config.series.length===1,this.legendHelpers=new ft(this)}return o(Ee,[{key:"init",value:function(){var p=this.w,h=p.globals,S=p.config,_=S.legend.showForSingleSeries&&h.series.length===1||this.isBarsDistributed||h.series.length>1;if(this.legendHelpers.appendToForeignObject(),(_||!h.axisCharts)&&S.legend.show){for(;h.dom.elLegendWrap.firstChild;)h.dom.elLegendWrap.removeChild(h.dom.elLegendWrap.firstChild);this.drawLegends(),S.legend.position==="bottom"||S.legend.position==="top"?this.legendAlignHorizontal():S.legend.position!=="right"&&S.legend.position!=="left"||this.legendAlignVertical()}}},{key:"createLegendMarker",value:function(p){var h=p.i,S=p.fillcolor,_=this.w,k=document.createElement("span");k.classList.add("apexcharts-legend-marker");var T=_.config.legend.markers.shape||_.config.markers.shape,B=T;Array.isArray(T)&&(B=T[h]);var q=Array.isArray(_.config.legend.markers.size)?parseFloat(_.config.legend.markers.size[h]):parseFloat(_.config.legend.markers.size),te=Array.isArray(_.config.legend.markers.offsetX)?parseFloat(_.config.legend.markers.offsetX[h]):parseFloat(_.config.legend.markers.offsetX),ue=Array.isArray(_.config.legend.markers.offsetY)?parseFloat(_.config.legend.markers.offsetY[h]):parseFloat(_.config.legend.markers.offsetY),de=Array.isArray(_.config.legend.markers.strokeWidth)?parseFloat(_.config.legend.markers.strokeWidth[h]):parseFloat(_.config.legend.markers.strokeWidth),xe=k.style;if(xe.height=2*(q+de)+"px",xe.width=2*(q+de)+"px",xe.left=te+"px",xe.top=ue+"px",_.config.legend.markers.customHTML)xe.background="transparent",xe.color=S[h],Array.isArray(_.config.legend.markers.customHTML)?_.config.legend.markers.customHTML[h]&&(k.innerHTML=_.config.legend.markers.customHTML[h]()):k.innerHTML=_.config.legend.markers.customHTML();else{var we=new be(this.ctx).getMarkerConfig({cssClass:"apexcharts-legend-marker apexcharts-marker apexcharts-marker-".concat(B),seriesIndex:h,strokeWidth:de,size:q}),ke=SVG(k).size("100%","100%"),Me=new z(this.ctx).drawMarker(0,0,v(v({},we),{},{pointFillColor:Array.isArray(S)?S[h]:we.pointFillColor,shape:B}));SVG.select(".apexcharts-legend-marker.apexcharts-marker").members.forEach(function(Ye){Ye.node.classList.contains("apexcharts-marker-triangle")?Ye.node.style.transform="translate(50%, 45%)":Ye.node.style.transform="translate(50%, 50%)"}),ke.add(Me)}return k}},{key:"drawLegends",value:function(){var p=this,h=this.w,S=h.config.legend.fontFamily,_=h.globals.seriesNames,k=h.config.legend.markers.fillColors?h.config.legend.markers.fillColors.slice():h.globals.colors.slice();if(h.config.chart.type==="heatmap"){var T=h.config.plotOptions.heatmap.colorScale.ranges;_=T.map(function(De){return De.name?De.name:De.from+" - "+De.to}),k=T.map(function(De){return De.color})}else this.isBarsDistributed&&(_=h.globals.labels.slice());h.config.legend.customLegendItems.length&&(_=h.config.legend.customLegendItems);for(var B=h.globals.legendFormatter,q=h.config.legend.inverseOrder,te=q?_.length-1:0;q?te>=0:te<=_.length-1;q?te--:te++){var ue,de=B(_[te],{seriesIndex:te,w:h}),xe=!1,we=!1;if(h.globals.collapsedSeries.length>0)for(var ke=0;ke<h.globals.collapsedSeries.length;ke++)h.globals.collapsedSeries[ke].index===te&&(xe=!0);if(h.globals.ancillaryCollapsedSeriesIndices.length>0)for(var Me=0;Me<h.globals.ancillaryCollapsedSeriesIndices.length;Me++)h.globals.ancillaryCollapsedSeriesIndices[Me]===te&&(we=!0);var Ye=this.createLegendMarker({i:te,fillcolor:k});z.setAttrs(Ye,{rel:te+1,"data:collapsed":xe||we}),(xe||we)&&Ye.classList.add("apexcharts-inactive-legend");var Fe=document.createElement("div"),rt=document.createElement("span");rt.classList.add("apexcharts-legend-text"),rt.innerHTML=Array.isArray(de)?de.join(" "):de;var se=h.config.legend.labels.useSeriesColors?h.globals.colors[te]:Array.isArray(h.config.legend.labels.colors)?(ue=h.config.legend.labels.colors)===null||ue===void 0?void 0:ue[te]:h.config.legend.labels.colors;se||(se=h.config.chart.foreColor),rt.style.color=se,rt.style.fontSize=parseFloat(h.config.legend.fontSize)+"px",rt.style.fontWeight=h.config.legend.fontWeight,rt.style.fontFamily=S||h.config.chart.fontFamily,z.setAttrs(rt,{rel:te+1,i:te,"data:default-text":encodeURIComponent(de),"data:collapsed":xe||we}),Fe.appendChild(Ye),Fe.appendChild(rt);var Ce=new X(this.ctx);h.config.legend.showForZeroSeries||Ce.getSeriesTotalByIndex(te)===0&&Ce.seriesHaveSameValues(te)&&!Ce.isSeriesNull(te)&&h.globals.collapsedSeriesIndices.indexOf(te)===-1&&h.globals.ancillaryCollapsedSeriesIndices.indexOf(te)===-1&&Fe.classList.add("apexcharts-hidden-zero-series"),h.config.legend.showForNullSeries||Ce.isSeriesNull(te)&&h.globals.collapsedSeriesIndices.indexOf(te)===-1&&h.globals.ancillaryCollapsedSeriesIndices.indexOf(te)===-1&&Fe.classList.add("apexcharts-hidden-null-series"),h.globals.dom.elLegendWrap.appendChild(Fe),h.globals.dom.elLegendWrap.classList.add("apexcharts-align-".concat(h.config.legend.horizontalAlign)),h.globals.dom.elLegendWrap.classList.add("apx-legend-position-"+h.config.legend.position),Fe.classList.add("apexcharts-legend-series"),Fe.style.margin="".concat(h.config.legend.itemMargin.vertical,"px ").concat(h.config.legend.itemMargin.horizontal,"px"),h.globals.dom.elLegendWrap.style.width=h.config.legend.width?h.config.legend.width+"px":"",h.globals.dom.elLegendWrap.style.height=h.config.legend.height?h.config.legend.height+"px":"",z.setAttrs(Fe,{rel:te+1,seriesName:F.escapeString(_[te]),"data:collapsed":xe||we}),(xe||we)&&Fe.classList.add("apexcharts-inactive-legend"),h.config.legend.onItemClick.toggleDataSeries||Fe.classList.add("apexcharts-no-click")}h.globals.dom.elWrap.addEventListener("click",p.onLegendClick,!0),h.config.legend.onItemHover.highlightDataSeries&&h.config.legend.customLegendItems.length===0&&(h.globals.dom.elWrap.addEventListener("mousemove",p.onLegendHovered,!0),h.globals.dom.elWrap.addEventListener("mouseout",p.onLegendHovered,!0))}},{key:"setLegendWrapXY",value:function(p,h){var S=this.w,_=S.globals.dom.elLegendWrap,k=_.clientHeight,T=0,B=0;if(S.config.legend.position==="bottom")B=S.globals.svgHeight-Math.min(k,S.globals.svgHeight/2)-5;else if(S.config.legend.position==="top"){var q=new Ke(this.ctx),te=q.dimHelpers.getTitleSubtitleCoords("title").height,ue=q.dimHelpers.getTitleSubtitleCoords("subtitle").height;B=(te>0?te-10:0)+(ue>0?ue-10:0)}_.style.position="absolute",T=T+p+S.config.legend.offsetX,B=B+h+S.config.legend.offsetY,_.style.left=T+"px",_.style.top=B+"px",S.config.legend.position==="right"&&(_.style.left="auto",_.style.right=25+S.config.legend.offsetX+"px"),["width","height"].forEach(function(de){_.style[de]&&(_.style[de]=parseInt(S.config.legend[de],10)+"px")})}},{key:"legendAlignHorizontal",value:function(){var p=this.w;p.globals.dom.elLegendWrap.style.right=0;var h=new Ke(this.ctx),S=h.dimHelpers.getTitleSubtitleCoords("title"),_=h.dimHelpers.getTitleSubtitleCoords("subtitle"),k=0;p.config.legend.position==="top"&&(k=S.height+_.height+p.config.title.margin+p.config.subtitle.margin-10),this.setLegendWrapXY(20,k)}},{key:"legendAlignVertical",value:function(){var p=this.w,h=this.legendHelpers.getLegendDimensions(),S=0;p.config.legend.position==="left"&&(S=20),p.config.legend.position==="right"&&(S=p.globals.svgWidth-h.clww-10),this.setLegendWrapXY(S,20)}},{key:"onLegendHovered",value:function(p){var h=this.w,S=p.target.classList.contains("apexcharts-legend-series")||p.target.classList.contains("apexcharts-legend-text")||p.target.classList.contains("apexcharts-legend-marker");if(h.config.chart.type==="heatmap"||this.isBarsDistributed){if(S){var _=parseInt(p.target.getAttribute("rel"),10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,_,this.w]),new Re(this.ctx).highlightRangeInSeries(p,p.target)}}else!p.target.classList.contains("apexcharts-inactive-legend")&&S&&new Re(this.ctx).toggleSeriesOnHover(p,p.target)}},{key:"onLegendClick",value:function(p){var h=this.w;if(!h.config.legend.customLegendItems.length&&(p.target.classList.contains("apexcharts-legend-series")||p.target.classList.contains("apexcharts-legend-text")||p.target.classList.contains("apexcharts-legend-marker"))){var S=parseInt(p.target.getAttribute("rel"),10)-1,_=p.target.getAttribute("data:collapsed")==="true",k=this.w.config.chart.events.legendClick;typeof k=="function"&&k(this.ctx,S,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,S,this.w]);var T=this.w.config.legend.markers.onClick;typeof T=="function"&&p.target.classList.contains("apexcharts-legend-marker")&&(T(this.ctx,S,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,S,this.w])),h.config.chart.type!=="treemap"&&h.config.chart.type!=="heatmap"&&!this.isBarsDistributed&&h.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(S,_)}}}]),Ee}(),Dt=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w;var h=this.w;this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.minX=h.globals.minX,this.maxX=h.globals.maxX}return o(Ee,[{key:"createToolbar",value:function(){var p=this,h=this.w,S=function(){return document.createElement("div")},_=S();if(_.setAttribute("class","apexcharts-toolbar"),_.style.top=h.config.chart.toolbar.offsetY+"px",_.style.right=3-h.config.chart.toolbar.offsetX+"px",h.globals.dom.elWrap.appendChild(_),this.elZoom=S(),this.elZoomIn=S(),this.elZoomOut=S(),this.elPan=S(),this.elSelection=S(),this.elZoomReset=S(),this.elMenuIcon=S(),this.elMenu=S(),this.elCustomIcons=[],this.t=h.config.chart.toolbar.tools,Array.isArray(this.t.customIcons))for(var k=0;k<this.t.customIcons.length;k++)this.elCustomIcons.push(S());var T=[],B=function(de,xe,we){var ke=de.toLowerCase();p.t[ke]&&h.config.chart.zoom.enabled&&T.push({el:xe,icon:typeof p.t[ke]=="string"?p.t[ke]:we,title:p.localeValues[de],class:"apexcharts-".concat(ke,"-icon")})};B("zoomIn",this.elZoomIn,`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
    <path d="M0 0h24v24H0z" fill="none"/>
    <path d="M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>
</svg>
`),B("zoomOut",this.elZoomOut,`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
    <path d="M0 0h24v24H0z" fill="none"/>
    <path d="M7 11v2h10v-2H7zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>
</svg>
`);var q=function(de){p.t[de]&&h.config.chart[de].enabled&&T.push({el:de==="zoom"?p.elZoom:p.elSelection,icon:typeof p.t[de]=="string"?p.t[de]:de==="zoom"?`<svg xmlns="http://www.w3.org/2000/svg" fill="#000000" height="24" viewBox="0 0 24 24" width="24">
    <path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>
    <path d="M0 0h24v24H0V0z" fill="none"/>
    <path d="M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"/>
</svg>`:`<svg fill="#6E8192" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
    <path d="M0 0h24v24H0z" fill="none"/>
    <path d="M3 5h2V3c-1.1 0-2 .9-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2c0-1.1-.9-2-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2z"/>
</svg>`,title:p.localeValues[de==="zoom"?"selectionZoom":"selection"],class:h.globals.isTouchDevice?"apexcharts-element-hidden":"apexcharts-".concat(de,"-icon")})};q("zoom"),q("selection"),this.t.pan&&h.config.chart.zoom.enabled&&T.push({el:this.elPan,icon:typeof this.t.pan=="string"?this.t.pan:`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000" height="24" viewBox="0 0 24 24" width="24">
    <defs>
        <path d="M0 0h24v24H0z" id="a"/>
    </defs>
    <clipPath id="b">
        <use overflow="visible" xlink:href="#a"/>
    </clipPath>
    <path clip-path="url(#b)" d="M23 5.5V20c0 2.2-1.8 4-4 4h-7.3c-1.08 0-2.1-.43-2.85-1.19L1 14.83s1.26-1.23 1.3-1.25c.22-.19.49-.29.79-.29.22 0 .42.06.6.16.04.01 4.31 2.46 4.31 2.46V4c0-.83.67-1.5 1.5-1.5S11 3.17 11 4v7h1V1.5c0-.83.67-1.5 1.5-1.5S15 .67 15 1.5V11h1V2.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5V11h1V5.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5z"/>
</svg>`,title:this.localeValues.pan,class:h.globals.isTouchDevice?"apexcharts-element-hidden":"apexcharts-pan-icon"}),B("reset",this.elZoomReset,`<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
    <path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>
    <path d="M0 0h24v24H0z" fill="none"/>
</svg>`),this.t.download&&T.push({el:this.elMenuIcon,icon:typeof this.t.download=="string"?this.t.download:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(var te=0;te<this.elCustomIcons.length;te++)T.push({el:this.elCustomIcons[te],icon:this.t.customIcons[te].icon,title:this.t.customIcons[te].title,index:this.t.customIcons[te].index,class:"apexcharts-toolbar-custom-icon "+this.t.customIcons[te].class});T.forEach(function(de,xe){de.index&&F.moveIndexInArray(T,xe,de.index)});for(var ue=0;ue<T.length;ue++)z.setAttrs(T[ue].el,{class:T[ue].class,title:T[ue].title}),T[ue].el.innerHTML=T[ue].icon,_.appendChild(T[ue].el);this._createHamburgerMenu(_),h.globals.zoomEnabled?this.elZoom.classList.add(this.selectedClass):h.globals.panEnabled?this.elPan.classList.add(this.selectedClass):h.globals.selectionEnabled&&this.elSelection.classList.add(this.selectedClass),this.addToolbarEventListeners()}},{key:"_createHamburgerMenu",value:function(p){this.elMenuItems=[],p.appendChild(this.elMenu),z.setAttrs(this.elMenu,{class:"apexcharts-menu"});for(var h=[{name:"exportSVG",title:this.localeValues.exportToSVG},{name:"exportPNG",title:this.localeValues.exportToPNG},{name:"exportCSV",title:this.localeValues.exportToCSV}],S=0;S<h.length;S++)this.elMenuItems.push(document.createElement("div")),this.elMenuItems[S].innerHTML=h[S].title,z.setAttrs(this.elMenuItems[S],{class:"apexcharts-menu-item ".concat(h[S].name),title:h[S].title}),this.elMenu.appendChild(this.elMenuItems[S])}},{key:"addToolbarEventListeners",value:function(){var p=this;this.elZoomReset.addEventListener("click",this.handleZoomReset.bind(this)),this.elSelection.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),this.elZoom.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),this.elZoomIn.addEventListener("click",this.handleZoomIn.bind(this)),this.elZoomOut.addEventListener("click",this.handleZoomOut.bind(this)),this.elPan.addEventListener("click",this.togglePanning.bind(this)),this.elMenuIcon.addEventListener("click",this.toggleMenu.bind(this)),this.elMenuItems.forEach(function(S){S.classList.contains("exportSVG")?S.addEventListener("click",p.handleDownload.bind(p,"svg")):S.classList.contains("exportPNG")?S.addEventListener("click",p.handleDownload.bind(p,"png")):S.classList.contains("exportCSV")&&S.addEventListener("click",p.handleDownload.bind(p,"csv"))});for(var h=0;h<this.t.customIcons.length;h++)this.elCustomIcons[h].addEventListener("click",this.t.customIcons[h].click.bind(this,this.ctx,this.ctx.w))}},{key:"toggleZoomSelection",value:function(p){this.ctx.getSyncedCharts().forEach(function(h){h.ctx.toolbar.toggleOtherControls();var S=p==="selection"?h.ctx.toolbar.elSelection:h.ctx.toolbar.elZoom,_=p==="selection"?"selectionEnabled":"zoomEnabled";h.w.globals[_]=!h.w.globals[_],S.classList.contains(h.ctx.toolbar.selectedClass)?S.classList.remove(h.ctx.toolbar.selectedClass):S.classList.add(h.ctx.toolbar.selectedClass)})}},{key:"getToolbarIconsReference",value:function(){var p=this.w;this.elZoom||(this.elZoom=p.globals.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=p.globals.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=p.globals.dom.baseEl.querySelector(".apexcharts-selection-icon"))}},{key:"enableZoomPanFromToolbar",value:function(p){this.toggleOtherControls(),p==="pan"?this.w.globals.panEnabled=!0:this.w.globals.zoomEnabled=!0;var h=p==="pan"?this.elPan:this.elZoom,S=p==="pan"?this.elZoom:this.elPan;h&&h.classList.add(this.selectedClass),S&&S.classList.remove(this.selectedClass)}},{key:"togglePanning",value:function(){this.ctx.getSyncedCharts().forEach(function(p){p.ctx.toolbar.toggleOtherControls(),p.w.globals.panEnabled=!p.w.globals.panEnabled,p.ctx.toolbar.elPan.classList.contains(p.ctx.toolbar.selectedClass)?p.ctx.toolbar.elPan.classList.remove(p.ctx.toolbar.selectedClass):p.ctx.toolbar.elPan.classList.add(p.ctx.toolbar.selectedClass)})}},{key:"toggleOtherControls",value:function(){var p=this,h=this.w;h.globals.panEnabled=!1,h.globals.zoomEnabled=!1,h.globals.selectionEnabled=!1,this.getToolbarIconsReference(),[this.elPan,this.elSelection,this.elZoom].forEach(function(S){S&&S.classList.remove(p.selectedClass)})}},{key:"handleZoomIn",value:function(){var p=this.w;p.globals.isRangeBar&&(this.minX=p.globals.minY,this.maxX=p.globals.maxY);var h=(this.minX+this.maxX)/2,S=(this.minX+h)/2,_=(this.maxX+h)/2,k=this._getNewMinXMaxX(S,_);p.globals.disableZoomIn||this.zoomUpdateOptions(k.minX,k.maxX)}},{key:"handleZoomOut",value:function(){var p=this.w;if(p.globals.isRangeBar&&(this.minX=p.globals.minY,this.maxX=p.globals.maxY),!(p.config.xaxis.type==="datetime"&&new Date(this.minX).getUTCFullYear()<1e3)){var h=(this.minX+this.maxX)/2,S=this.minX-(h-this.minX),_=this.maxX-(h-this.maxX),k=this._getNewMinXMaxX(S,_);p.globals.disableZoomOut||this.zoomUpdateOptions(k.minX,k.maxX)}}},{key:"_getNewMinXMaxX",value:function(p,h){var S=this.w.config.xaxis.convertedCatToNumeric;return{minX:S?Math.floor(p):p,maxX:S?Math.floor(h):h}}},{key:"zoomUpdateOptions",value:function(p,h){var S=this.w;if(p!==void 0||h!==void 0){if(!(S.config.xaxis.convertedCatToNumeric&&(p<1&&(p=1,h=S.globals.dataPoints),h-p<2))){var _={min:p,max:h},k=this.getBeforeZoomRange(_);k&&(_=k.xaxis);var T={xaxis:_},B=F.clone(S.globals.initialConfig.yaxis);S.config.chart.group||(T.yaxis=B),this.w.globals.zoomed=!0,this.ctx.updateHelpers._updateOptions(T,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(_,B)}}else this.handleZoomReset()}},{key:"zoomCallback",value:function(p,h){typeof this.ev.zoomed=="function"&&this.ev.zoomed(this.ctx,{xaxis:p,yaxis:h})}},{key:"getBeforeZoomRange",value:function(p,h){var S=null;return typeof this.ev.beforeZoom=="function"&&(S=this.ev.beforeZoom(this,{xaxis:p,yaxis:h})),S}},{key:"toggleMenu",value:function(){var p=this;window.setTimeout(function(){p.elMenu.classList.contains("apexcharts-menu-open")?p.elMenu.classList.remove("apexcharts-menu-open"):p.elMenu.classList.add("apexcharts-menu-open")},0)}},{key:"handleDownload",value:function(p){var h=this.w,S=new Be(this.ctx);switch(p){case"svg":S.exportToSVG(this.ctx);break;case"png":S.exportToPng(this.ctx);break;case"csv":S.exportToCSV({series:h.config.series,columnDelimiter:h.config.chart.toolbar.export.csv.columnDelimiter})}}},{key:"handleZoomReset",value:function(p){this.ctx.getSyncedCharts().forEach(function(h){var S=h.w;if(S.globals.lastXAxis.min=S.globals.initialConfig.xaxis.min,S.globals.lastXAxis.max=S.globals.initialConfig.xaxis.max,h.updateHelpers.revertDefaultAxisMinMax(),typeof S.config.chart.events.beforeResetZoom=="function"){var _=S.config.chart.events.beforeResetZoom(h,S);_&&h.updateHelpers.revertDefaultAxisMinMax(_)}typeof S.config.chart.events.zoomed=="function"&&h.ctx.toolbar.zoomCallback({min:S.config.xaxis.min,max:S.config.xaxis.max}),S.globals.zoomed=!1;var k=h.ctx.series.emptyCollapsedSeries(F.clone(S.globals.initialSeries));h.updateHelpers._updateSeries(k,S.config.chart.animations.dynamicAnimation.enabled)})}},{key:"destroy",value:function(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elZoomReset=null,this.elMenuIcon=null}}]),Ee}(),At=function(Ee){f(h,Dt);var p=c(h);function h(S){var _;return s(this,h),(_=p.call(this,S)).ctx=S,_.w=S.w,_.dragged=!1,_.graphics=new z(_.ctx),_.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend","wheel"],_.clientX=0,_.clientY=0,_.startX=0,_.endX=0,_.dragX=0,_.startY=0,_.endY=0,_.dragY=0,_.moveDirection="none",_.debounceTimer=null,_.debounceDelay=100,_.wheelDelay=400,_}return o(h,[{key:"init",value:function(S){var _=this,k=S.xyRatios,T=this.w,B=this;this.xyRatios=k,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.gridRect=T.globals.dom.baseEl.querySelector(".apexcharts-grid"),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),T.globals.dom.elGraphical.add(this.zoomRect),T.globals.dom.elGraphical.add(this.selectionRect),T.config.chart.selection.type==="x"?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:T.globals.gridWidth,maxY:T.globals.gridHeight}).on("dragmove",this.selectionDragging.bind(this,"dragging")):T.config.chart.selection.type==="y"?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:T.globals.gridWidth}).on("dragmove",this.selectionDragging.bind(this,"dragging")):this.slDraggableRect=this.selectionRect.draggable().on("dragmove",this.selectionDragging.bind(this,"dragging")),this.preselectedSelection(),this.hoverArea=T.globals.dom.baseEl.querySelector("".concat(T.globals.chartClass," .apexcharts-svg")),this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(function(q){_.hoverArea.addEventListener(q,B.svgMouseEvents.bind(B,k),{capture:!1,passive:!0})}),T.config.chart.zoom.allowMouseWheelZoom&&this.hoverArea.addEventListener("wheel",B.mouseWheelEvent.bind(B),{capture:!1,passive:!1})}},{key:"destroy",value:function(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null,this.gridRect=null}},{key:"svgMouseEvents",value:function(S,_){var k=this.w,T=this,B=this.ctx.toolbar,q=k.globals.zoomEnabled?k.config.chart.zoom.type:k.config.chart.selection.type,te=k.config.chart.toolbar.autoSelected;if(_.shiftKey?(this.shiftWasPressed=!0,B.enableZoomPanFromToolbar(te==="pan"?"zoom":"pan")):this.shiftWasPressed&&(B.enableZoomPanFromToolbar(te),this.shiftWasPressed=!1),_.target){var ue,de=_.target.classList;if(_.target.parentNode&&_.target.parentNode!==null&&(ue=_.target.parentNode.classList),!(de.contains("apexcharts-selection-rect")||de.contains("apexcharts-legend-marker")||de.contains("apexcharts-legend-text")||ue&&ue.contains("apexcharts-toolbar"))){if(T.clientX=_.type==="touchmove"||_.type==="touchstart"?_.touches[0].clientX:_.type==="touchend"?_.changedTouches[0].clientX:_.clientX,T.clientY=_.type==="touchmove"||_.type==="touchstart"?_.touches[0].clientY:_.type==="touchend"?_.changedTouches[0].clientY:_.clientY,_.type==="mousedown"&&_.which===1){var xe=T.gridRect.getBoundingClientRect();T.startX=T.clientX-xe.left,T.startY=T.clientY-xe.top,T.dragged=!1,T.w.globals.mousedown=!0}if((_.type==="mousemove"&&_.which===1||_.type==="touchmove")&&(T.dragged=!0,k.globals.panEnabled?(k.globals.selection=null,T.w.globals.mousedown&&T.panDragging({context:T,zoomtype:q,xyRatios:S})):(T.w.globals.mousedown&&k.globals.zoomEnabled||T.w.globals.mousedown&&k.globals.selectionEnabled)&&(T.selection=T.selectionDrawing({context:T,zoomtype:q}))),_.type==="mouseup"||_.type==="touchend"||_.type==="mouseleave"){var we,ke=(we=T.gridRect)===null||we===void 0?void 0:we.getBoundingClientRect();ke&&T.w.globals.mousedown&&(T.endX=T.clientX-ke.left,T.endY=T.clientY-ke.top,T.dragX=Math.abs(T.endX-T.startX),T.dragY=Math.abs(T.endY-T.startY),(k.globals.zoomEnabled||k.globals.selectionEnabled)&&T.selectionDrawn({context:T,zoomtype:q}),k.globals.panEnabled&&k.config.xaxis.convertedCatToNumeric&&T.delayedPanScrolled()),k.globals.zoomEnabled&&T.hideSelectionRect(this.selectionRect),T.dragged=!1,T.w.globals.mousedown=!1}this.makeSelectionRectDraggable()}}}},{key:"mouseWheelEvent",value:function(S){var _=this,k=this.w;S.preventDefault();var T=Date.now();T-k.globals.lastWheelExecution>this.wheelDelay&&(this.executeMouseWheelZoom(S),k.globals.lastWheelExecution=T),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(function(){T-k.globals.lastWheelExecution>_.wheelDelay&&(_.executeMouseWheelZoom(S),k.globals.lastWheelExecution=T)},this.debounceDelay)}},{key:"executeMouseWheelZoom",value:function(S){var _,k=this.w;this.minX=k.globals.isRangeBar?k.globals.minY:k.globals.minX,this.maxX=k.globals.isRangeBar?k.globals.maxY:k.globals.maxX;var T=(_=this.gridRect)===null||_===void 0?void 0:_.getBoundingClientRect();if(T){var B,q,te,ue=(S.clientX-T.left)/T.width,de=this.minX,xe=this.maxX,we=xe-de;if(S.deltaY<0){var ke=de+ue*we;q=ke-(B=.5*we)/2,te=ke+B/2}else q=de-(B=1.5*we)/2,te=xe+B/2;if(!k.globals.isRangeBar){q=Math.max(q,k.globals.initialMinX),te=Math.min(te,k.globals.initialMaxX);var Me=.01*(k.globals.initialMaxX-k.globals.initialMinX);if(te-q<Me){var Ye=(q+te)/2;q=Ye-Me/2,te=Ye+Me/2}}var Fe=this._getNewMinXMaxX(q,te);isNaN(Fe.minX)||isNaN(Fe.maxX)||this.zoomUpdateOptions(Fe.minX,Fe.maxX)}}},{key:"makeSelectionRectDraggable",value:function(){var S=this.w;if(this.selectionRect){var _=this.selectionRect.node.getBoundingClientRect();_.width>0&&_.height>0&&this.slDraggableRect.selectize({points:"l, r",pointSize:8,pointType:"rect"}).resize({constraint:{minX:0,minY:0,maxX:S.globals.gridWidth,maxY:S.globals.gridHeight}}).on("resizing",this.selectionDragging.bind(this,"resizing"))}}},{key:"preselectedSelection",value:function(){var S=this.w,_=this.xyRatios;if(!S.globals.zoomEnabled){if(S.globals.selection!==void 0&&S.globals.selection!==null)this.drawSelectionRect(S.globals.selection);else if(S.config.chart.selection.xaxis.min!==void 0&&S.config.chart.selection.xaxis.max!==void 0){var k=(S.config.chart.selection.xaxis.min-S.globals.minX)/_.xRatio,T=S.globals.gridWidth-(S.globals.maxX-S.config.chart.selection.xaxis.max)/_.xRatio-k;S.globals.isRangeBar&&(k=(S.config.chart.selection.xaxis.min-S.globals.yAxisScale[0].niceMin)/_.invertedYRatio,T=(S.config.chart.selection.xaxis.max-S.config.chart.selection.xaxis.min)/_.invertedYRatio);var B={x:k,y:0,width:T,height:S.globals.gridHeight,translateX:0,translateY:0,selectionEnabled:!0};this.drawSelectionRect(B),this.makeSelectionRectDraggable(),typeof S.config.chart.events.selection=="function"&&S.config.chart.events.selection(this.ctx,{xaxis:{min:S.config.chart.selection.xaxis.min,max:S.config.chart.selection.xaxis.max},yaxis:{}})}}}},{key:"drawSelectionRect",value:function(S){var _=S.x,k=S.y,T=S.width,B=S.height,q=S.translateX,te=q===void 0?0:q,ue=S.translateY,de=ue===void 0?0:ue,xe=this.w,we=this.zoomRect,ke=this.selectionRect;if(this.dragged||xe.globals.selection!==null){var Me={transform:"translate("+te+", "+de+")"};xe.globals.zoomEnabled&&this.dragged&&(T<0&&(T=1),we.attr({x:_,y:k,width:T,height:B,fill:xe.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":xe.config.chart.zoom.zoomedArea.fill.opacity,stroke:xe.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":xe.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":xe.config.chart.zoom.zoomedArea.stroke.opacity}),z.setAttrs(we.node,Me)),xe.globals.selectionEnabled&&(ke.attr({x:_,y:k,width:T>0?T:0,height:B>0?B:0,fill:xe.config.chart.selection.fill.color,"fill-opacity":xe.config.chart.selection.fill.opacity,stroke:xe.config.chart.selection.stroke.color,"stroke-width":xe.config.chart.selection.stroke.width,"stroke-dasharray":xe.config.chart.selection.stroke.dashArray,"stroke-opacity":xe.config.chart.selection.stroke.opacity}),z.setAttrs(ke.node,Me))}}},{key:"hideSelectionRect",value:function(S){S&&S.attr({x:0,y:0,width:0,height:0})}},{key:"selectionDrawing",value:function(S){var _=S.context,k=S.zoomtype,T=this.w,B=_,q=this.gridRect.getBoundingClientRect(),te=B.startX-1,ue=B.startY,de=!1,xe=!1,we=B.clientX-q.left-te,ke=B.clientY-q.top-ue,Me={};return Math.abs(we+te)>T.globals.gridWidth?we=T.globals.gridWidth-te:B.clientX-q.left<0&&(we=te),te>B.clientX-q.left&&(de=!0,we=Math.abs(we)),ue>B.clientY-q.top&&(xe=!0,ke=Math.abs(ke)),Me=k==="x"?{x:de?te-we:te,y:0,width:we,height:T.globals.gridHeight}:k==="y"?{x:0,y:xe?ue-ke:ue,width:T.globals.gridWidth,height:ke}:{x:de?te-we:te,y:xe?ue-ke:ue,width:we,height:ke},B.drawSelectionRect(Me),B.selectionDragging("resizing"),Me}},{key:"selectionDragging",value:function(S,_){var k=this,T=this.w,B=this.xyRatios,q=this.selectionRect,te=0;S==="resizing"&&(te=30);var ue=function(xe){return parseFloat(q.node.getAttribute(xe))},de={x:ue("x"),y:ue("y"),width:ue("width"),height:ue("height")};T.globals.selection=de,typeof T.config.chart.events.selection=="function"&&T.globals.selectionEnabled&&(clearTimeout(this.w.globals.selectionResizeTimer),this.w.globals.selectionResizeTimer=window.setTimeout(function(){var xe,we,ke,Me,Ye=k.gridRect.getBoundingClientRect(),Fe=q.node.getBoundingClientRect();T.globals.isRangeBar?(xe=T.globals.yAxisScale[0].niceMin+(Fe.left-Ye.left)*B.invertedYRatio,we=T.globals.yAxisScale[0].niceMin+(Fe.right-Ye.left)*B.invertedYRatio,ke=0,Me=1):(xe=T.globals.xAxisScale.niceMin+(Fe.left-Ye.left)*B.xRatio,we=T.globals.xAxisScale.niceMin+(Fe.right-Ye.left)*B.xRatio,ke=T.globals.yAxisScale[0].niceMin+(Ye.bottom-Fe.bottom)*B.yRatio[0],Me=T.globals.yAxisScale[0].niceMax-(Fe.top-Ye.top)*B.yRatio[0]);var rt={xaxis:{min:xe,max:we},yaxis:{min:ke,max:Me}};T.config.chart.events.selection(k.ctx,rt),T.config.chart.brush.enabled&&T.config.chart.events.brushScrolled!==void 0&&T.config.chart.events.brushScrolled(k.ctx,rt)},te))}},{key:"selectionDrawn",value:function(S){var _=S.context,k=S.zoomtype,T=this.w,B=_,q=this.xyRatios,te=this.ctx.toolbar;if(B.startX>B.endX){var ue=B.startX;B.startX=B.endX,B.endX=ue}if(B.startY>B.endY){var de=B.startY;B.startY=B.endY,B.endY=de}var xe=void 0,we=void 0;T.globals.isRangeBar?(xe=T.globals.yAxisScale[0].niceMin+B.startX*q.invertedYRatio,we=T.globals.yAxisScale[0].niceMin+B.endX*q.invertedYRatio):(xe=T.globals.xAxisScale.niceMin+B.startX*q.xRatio,we=T.globals.xAxisScale.niceMin+B.endX*q.xRatio);var ke=[],Me=[];if(T.config.yaxis.forEach(function(Le,_e){var nt=T.globals.seriesYAxisMap[_e][0];ke.push(T.globals.yAxisScale[_e].niceMax-q.yRatio[nt]*B.startY),Me.push(T.globals.yAxisScale[_e].niceMax-q.yRatio[nt]*B.endY)}),B.dragged&&(B.dragX>10||B.dragY>10)&&xe!==we){if(T.globals.zoomEnabled){var Ye=F.clone(T.globals.initialConfig.yaxis),Fe=F.clone(T.globals.initialConfig.xaxis);if(T.globals.zoomed=!0,T.config.xaxis.convertedCatToNumeric&&(xe=Math.floor(xe),we=Math.floor(we),xe<1&&(xe=1,we=T.globals.dataPoints),we-xe<2&&(we=xe+1)),k!=="xy"&&k!=="x"||(Fe={min:xe,max:we}),k!=="xy"&&k!=="y"||Ye.forEach(function(Le,_e){Ye[_e].min=Me[_e],Ye[_e].max=ke[_e]}),te){var rt=te.getBeforeZoomRange(Fe,Ye);rt&&(Fe=rt.xaxis?rt.xaxis:Fe,Ye=rt.yaxis?rt.yaxis:Ye)}var se={xaxis:Fe};T.config.chart.group||(se.yaxis=Ye),B.ctx.updateHelpers._updateOptions(se,!1,B.w.config.chart.animations.dynamicAnimation.enabled),typeof T.config.chart.events.zoomed=="function"&&te.zoomCallback(Fe,Ye)}else if(T.globals.selectionEnabled){var Ce,De=null;Ce={min:xe,max:we},k!=="xy"&&k!=="y"||(De=F.clone(T.config.yaxis)).forEach(function(Le,_e){De[_e].min=Me[_e],De[_e].max=ke[_e]}),T.globals.selection=B.selection,typeof T.config.chart.events.selection=="function"&&T.config.chart.events.selection(B.ctx,{xaxis:Ce,yaxis:De})}}}},{key:"panDragging",value:function(S){var _=S.context,k=this.w,T=_;if(k.globals.lastClientPosition.x!==void 0){var B=k.globals.lastClientPosition.x-T.clientX,q=k.globals.lastClientPosition.y-T.clientY;Math.abs(B)>Math.abs(q)&&B>0?this.moveDirection="left":Math.abs(B)>Math.abs(q)&&B<0?this.moveDirection="right":Math.abs(q)>Math.abs(B)&&q>0?this.moveDirection="up":Math.abs(q)>Math.abs(B)&&q<0&&(this.moveDirection="down")}k.globals.lastClientPosition={x:T.clientX,y:T.clientY};var te=k.globals.isRangeBar?k.globals.minY:k.globals.minX,ue=k.globals.isRangeBar?k.globals.maxY:k.globals.maxX;k.config.xaxis.convertedCatToNumeric||T.panScrolled(te,ue)}},{key:"delayedPanScrolled",value:function(){var S=this.w,_=S.globals.minX,k=S.globals.maxX,T=(S.globals.maxX-S.globals.minX)/2;this.moveDirection==="left"?(_=S.globals.minX+T,k=S.globals.maxX+T):this.moveDirection==="right"&&(_=S.globals.minX-T,k=S.globals.maxX-T),_=Math.floor(_),k=Math.floor(k),this.updateScrolledChart({xaxis:{min:_,max:k}},_,k)}},{key:"panScrolled",value:function(S,_){var k=this.w,T=this.xyRatios,B=F.clone(k.globals.initialConfig.yaxis),q=T.xRatio,te=k.globals.minX,ue=k.globals.maxX;k.globals.isRangeBar&&(q=T.invertedYRatio,te=k.globals.minY,ue=k.globals.maxY),this.moveDirection==="left"?(S=te+k.globals.gridWidth/15*q,_=ue+k.globals.gridWidth/15*q):this.moveDirection==="right"&&(S=te-k.globals.gridWidth/15*q,_=ue-k.globals.gridWidth/15*q),k.globals.isRangeBar||(S<k.globals.initialMinX||_>k.globals.initialMaxX)&&(S=te,_=ue);var de={xaxis:{min:S,max:_}};k.config.chart.group||(de.yaxis=B),this.updateScrolledChart(de,S,_)}},{key:"updateScrolledChart",value:function(S,_,k){var T=this.w;this.ctx.updateHelpers._updateOptions(S,!1,!1),typeof T.config.chart.events.scrolled=="function"&&T.config.chart.events.scrolled(this.ctx,{xaxis:{min:_,max:k}})}}]),h}(),Je=function(){function Ee(p){s(this,Ee),this.w=p.w,this.ttCtx=p,this.ctx=p.ctx}return o(Ee,[{key:"getNearestValues",value:function(p){var h=p.hoverArea,S=p.elGrid,_=p.clientX,k=p.clientY,T=this.w,B=S.getBoundingClientRect(),q=B.width,te=B.height,ue=q/(T.globals.dataPoints-1),de=te/T.globals.dataPoints,xe=this.hasBars();!T.globals.comboCharts&&!xe||T.config.xaxis.convertedCatToNumeric||(ue=q/T.globals.dataPoints);var we=_-B.left-T.globals.barPadForNumericAxis,ke=k-B.top;we<0||ke<0||we>q||ke>te?(h.classList.remove("hovering-zoom"),h.classList.remove("hovering-pan")):T.globals.zoomEnabled?(h.classList.remove("hovering-pan"),h.classList.add("hovering-zoom")):T.globals.panEnabled&&(h.classList.remove("hovering-zoom"),h.classList.add("hovering-pan"));var Me=Math.round(we/ue),Ye=Math.floor(ke/de);xe&&!T.config.xaxis.convertedCatToNumeric&&(Me=Math.ceil(we/ue),Me-=1);var Fe=null,rt=null,se=T.globals.seriesXvalues.map(function(nt){return nt.filter(function(ot){return F.isNumber(ot)})}),Ce=T.globals.seriesYvalues.map(function(nt){return nt.filter(function(ot){return F.isNumber(ot)})});if(T.globals.isXNumeric){var De=this.ttCtx.getElGrid().getBoundingClientRect(),Le=we*(De.width/q),_e=ke*(De.height/te);Fe=(rt=this.closestInMultiArray(Le,_e,se,Ce)).index,Me=rt.j,Fe!==null&&(se=T.globals.seriesXvalues[Fe],Me=(rt=this.closestInArray(Le,se)).index)}return T.globals.capturedSeriesIndex=Fe===null?-1:Fe,(!Me||Me<1)&&(Me=0),T.globals.isBarHorizontal?T.globals.capturedDataPointIndex=Ye:T.globals.capturedDataPointIndex=Me,{capturedSeries:Fe,j:T.globals.isBarHorizontal?Ye:Me,hoverX:we,hoverY:ke}}},{key:"closestInMultiArray",value:function(p,h,S,_){var k=this.w,T=0,B=null,q=-1;k.globals.series.length>1?T=this.getFirstActiveXArray(S):B=0;var te=S[T][0],ue=Math.abs(p-te);if(S.forEach(function(we){we.forEach(function(ke,Me){var Ye=Math.abs(p-ke);Ye<=ue&&(ue=Ye,q=Me)})}),q!==-1){var de=_[T][q],xe=Math.abs(h-de);B=T,_.forEach(function(we,ke){var Me=Math.abs(h-we[q]);Me<=xe&&(xe=Me,B=ke)})}return{index:B,j:q}}},{key:"getFirstActiveXArray",value:function(p){for(var h=this.w,S=0,_=p.map(function(T,B){return T.length>0?B:-1}),k=0;k<_.length;k++)if(_[k]!==-1&&h.globals.collapsedSeriesIndices.indexOf(k)===-1&&h.globals.ancillaryCollapsedSeriesIndices.indexOf(k)===-1){S=_[k];break}return S}},{key:"closestInArray",value:function(p,h){for(var S=h[0],_=null,k=Math.abs(p-S),T=0;T<h.length;T++){var B=Math.abs(p-h[T]);B<k&&(k=B,_=T)}return{index:_}}},{key:"isXoverlap",value:function(p){var h=[],S=this.w.globals.seriesX.filter(function(k){return k[0]!==void 0});if(S.length>0)for(var _=0;_<S.length-1;_++)S[_][p]!==void 0&&S[_+1][p]!==void 0&&S[_][p]!==S[_+1][p]&&h.push("unEqual");return h.length===0}},{key:"isInitialSeriesSameLen",value:function(){for(var p=!0,h=this.w.globals.initialSeries,S=0;S<h.length-1;S++)if(h[S].data.length!==h[S+1].data.length){p=!1;break}return p}},{key:"getBarsHeight",value:function(p){return N(p).reduce(function(h,S){return h+S.getBBox().height},0)}},{key:"getElMarkers",value:function(p){return typeof p=="number"?this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:realIndex='".concat(p,"'] .apexcharts-series-markers-wrap > *")):this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap > *")}},{key:"getAllMarkers",value:function(){var p=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap");(p=N(p)).sort(function(S,_){var k=Number(S.getAttribute("data:realIndex")),T=Number(_.getAttribute("data:realIndex"));return T<k?1:T>k?-1:0});var h=[];return p.forEach(function(S){h.push(S.querySelector(".apexcharts-marker"))}),h}},{key:"hasMarkers",value:function(p){return this.getElMarkers(p).length>0}},{key:"getPathFromPoint",value:function(p,h){var S=Number(p.getAttribute("cx")),_=Number(p.getAttribute("cy")),k=p.getAttribute("shape");return new z(this.ctx).getMarkerPath(S,_,k,h)}},{key:"getElBars",value:function(){return this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-bar-series,  .apexcharts-candlestick-series, .apexcharts-boxPlot-series, .apexcharts-rangebar-series")}},{key:"hasBars",value:function(){return this.getElBars().length>0}},{key:"getHoverMarkerSize",value:function(p){var h=this.w,S=h.config.markers.hover.size;return S===void 0&&(S=h.globals.markers.size[p]+h.config.markers.hover.sizeOffset),S}},{key:"toggleAllTooltipSeriesGroups",value:function(p){var h=this.w,S=this.ttCtx;S.allTooltipSeriesGroups.length===0&&(S.allTooltipSeriesGroups=h.globals.dom.baseEl.querySelectorAll(".apexcharts-tooltip-series-group"));for(var _=S.allTooltipSeriesGroups,k=0;k<_.length;k++)p==="enable"?(_[k].classList.add("apexcharts-active"),_[k].style.display=h.config.tooltip.items.display):(_[k].classList.remove("apexcharts-active"),_[k].style.display="none")}}]),Ee}(),He=function(){function Ee(p){s(this,Ee),this.w=p.w,this.ctx=p.ctx,this.ttCtx=p,this.tooltipUtil=new Je(p)}return o(Ee,[{key:"drawSeriesTexts",value:function(p){var h=p.shared,S=h===void 0||h,_=p.ttItems,k=p.i,T=k===void 0?0:k,B=p.j,q=B===void 0?null:B,te=p.y1,ue=p.y2,de=p.e,xe=this.w;xe.config.tooltip.custom!==void 0?this.handleCustomTooltip({i:T,j:q,y1:te,y2:ue,w:xe}):this.toggleActiveInactiveSeries(S,T);var we=this.getValuesToPrint({i:T,j:q});this.printLabels({i:T,j:q,values:we,ttItems:_,shared:S,e:de});var ke=this.ttCtx.getElTooltip();this.ttCtx.tooltipRect.ttWidth=ke.getBoundingClientRect().width,this.ttCtx.tooltipRect.ttHeight=ke.getBoundingClientRect().height}},{key:"printLabels",value:function(p){var h,S=this,_=p.i,k=p.j,T=p.values,B=p.ttItems,q=p.shared,te=p.e,ue=this.w,de=[],xe=function(De){return ue.globals.seriesGoals[De]&&ue.globals.seriesGoals[De][k]&&Array.isArray(ue.globals.seriesGoals[De][k])},we=T.xVal,ke=T.zVal,Me=T.xAxisTTVal,Ye="",Fe=ue.globals.colors[_];k!==null&&ue.config.plotOptions.bar.distributed&&(Fe=ue.globals.colors[k]);for(var rt=function(De,Le){var _e=S.getFormatters(_);Ye=S.getSeriesName({fn:_e.yLbTitleFormatter,index:_,seriesIndex:_,j:k}),ue.config.chart.type==="treemap"&&(Ye=_e.yLbTitleFormatter(String(ue.config.series[_].data[k].x),{series:ue.globals.series,seriesIndex:_,dataPointIndex:k,w:ue}));var nt=ue.config.tooltip.inverseOrder?Le:De;if(ue.globals.axisCharts){var ot=function(Ge){var et,We,wt,St;return ue.globals.isRangeData?_e.yLbFormatter((et=ue.globals.seriesRangeStart)===null||et===void 0||(We=et[Ge])===null||We===void 0?void 0:We[k],{series:ue.globals.seriesRangeStart,seriesIndex:Ge,dataPointIndex:k,w:ue})+" - "+_e.yLbFormatter((wt=ue.globals.seriesRangeEnd)===null||wt===void 0||(St=wt[Ge])===null||St===void 0?void 0:St[k],{series:ue.globals.seriesRangeEnd,seriesIndex:Ge,dataPointIndex:k,w:ue}):_e.yLbFormatter(ue.globals.series[Ge][k],{series:ue.globals.series,seriesIndex:Ge,dataPointIndex:k,w:ue})};if(q)_e=S.getFormatters(nt),Ye=S.getSeriesName({fn:_e.yLbTitleFormatter,index:nt,seriesIndex:_,j:k}),Fe=ue.globals.colors[nt],h=ot(nt),xe(nt)&&(de=ue.globals.seriesGoals[nt][k].map(function(Ge){return{attrs:Ge,val:_e.yLbFormatter(Ge.value,{seriesIndex:nt,dataPointIndex:k,w:ue})}}));else{var gt,Jt=te==null||(gt=te.target)===null||gt===void 0?void 0:gt.getAttribute("fill");Jt&&(Jt.indexOf("url")!==-1?Jt.indexOf("Pattern")!==-1&&(Fe=ue.globals.dom.baseEl.querySelector(Jt.substr(4).slice(0,-1)).childNodes[0].getAttribute("stroke")):Fe=Jt),h=ot(_),xe(_)&&Array.isArray(ue.globals.seriesGoals[_][k])&&(de=ue.globals.seriesGoals[_][k].map(function(Ge){return{attrs:Ge,val:_e.yLbFormatter(Ge.value,{seriesIndex:_,dataPointIndex:k,w:ue})}}))}}k===null&&(h=_e.yLbFormatter(ue.globals.series[_],v(v({},ue),{},{seriesIndex:_,dataPointIndex:_}))),S.DOMHandling({i:_,t:nt,j:k,ttItems:B,values:{val:h,goalVals:de,xVal:we,xAxisTTVal:Me,zVal:ke},seriesName:Ye,shared:q,pColor:Fe})},se=0,Ce=ue.globals.series.length-1;se<ue.globals.series.length;se++,Ce--)rt(se,Ce)}},{key:"getFormatters",value:function(p){var h,S=this.w,_=S.globals.yLabelFormatters[p];return S.globals.ttVal!==void 0?Array.isArray(S.globals.ttVal)?(_=S.globals.ttVal[p]&&S.globals.ttVal[p].formatter,h=S.globals.ttVal[p]&&S.globals.ttVal[p].title&&S.globals.ttVal[p].title.formatter):(_=S.globals.ttVal.formatter,typeof S.globals.ttVal.title.formatter=="function"&&(h=S.globals.ttVal.title.formatter)):h=S.config.tooltip.y.title.formatter,typeof _!="function"&&(_=S.globals.yLabelFormatters[0]?S.globals.yLabelFormatters[0]:function(k){return k}),typeof h!="function"&&(h=function(k){return k}),{yLbFormatter:_,yLbTitleFormatter:h}}},{key:"getSeriesName",value:function(p){var h=p.fn,S=p.index,_=p.seriesIndex,k=p.j,T=this.w;return h(String(T.globals.seriesNames[S]),{series:T.globals.series,seriesIndex:_,dataPointIndex:k,w:T})}},{key:"DOMHandling",value:function(p){p.i;var h=p.t,S=p.j,_=p.ttItems,k=p.values,T=p.seriesName,B=p.shared,q=p.pColor,te=this.w,ue=this.ttCtx,de=k.val,xe=k.goalVals,we=k.xVal,ke=k.xAxisTTVal,Me=k.zVal,Ye=null;Ye=_[h].children,te.config.tooltip.fillSeriesColor&&(_[h].style.backgroundColor=q,Ye[0].style.display="none"),ue.showTooltipTitle&&(ue.tooltipTitle===null&&(ue.tooltipTitle=te.globals.dom.baseEl.querySelector(".apexcharts-tooltip-title")),ue.tooltipTitle.innerHTML=we),ue.isXAxisTooltipEnabled&&(ue.xaxisTooltipText.innerHTML=ke!==""?ke:we);var Fe=_[h].querySelector(".apexcharts-tooltip-text-y-label");Fe&&(Fe.innerHTML=T||"");var rt=_[h].querySelector(".apexcharts-tooltip-text-y-value");rt&&(rt.innerHTML=de!==void 0?de:""),Ye[0]&&Ye[0].classList.contains("apexcharts-tooltip-marker")&&(te.config.tooltip.marker.fillColors&&Array.isArray(te.config.tooltip.marker.fillColors)&&(q=te.config.tooltip.marker.fillColors[h]),Ye[0].style.backgroundColor=q),te.config.tooltip.marker.show||(Ye[0].style.display="none");var se=_[h].querySelector(".apexcharts-tooltip-text-goals-label"),Ce=_[h].querySelector(".apexcharts-tooltip-text-goals-value");if(xe.length&&te.globals.seriesGoals[h]){var De=function(){var nt="<div >",ot="<div>";xe.forEach(function(gt,Jt){nt+=' <div style="display: flex"><span class="apexcharts-tooltip-marker" style="background-color: '.concat(gt.attrs.strokeColor,'; height: 3px; border-radius: 0; top: 5px;"></span> ').concat(gt.attrs.name,"</div>"),ot+="<div>".concat(gt.val,"</div>")}),se.innerHTML=nt+"</div>",Ce.innerHTML=ot+"</div>"};B?te.globals.seriesGoals[h][S]&&Array.isArray(te.globals.seriesGoals[h][S])?De():(se.innerHTML="",Ce.innerHTML=""):De()}else se.innerHTML="",Ce.innerHTML="";if(Me!==null&&(_[h].querySelector(".apexcharts-tooltip-text-z-label").innerHTML=te.config.tooltip.z.title,_[h].querySelector(".apexcharts-tooltip-text-z-value").innerHTML=Me!==void 0?Me:""),B&&Ye[0]){if(te.config.tooltip.hideEmptySeries){var Le=_[h].querySelector(".apexcharts-tooltip-marker"),_e=_[h].querySelector(".apexcharts-tooltip-text");parseFloat(de)==0?(Le.style.display="none",_e.style.display="none"):(Le.style.display="block",_e.style.display="block")}de==null||te.globals.ancillaryCollapsedSeriesIndices.indexOf(h)>-1||te.globals.collapsedSeriesIndices.indexOf(h)>-1||Array.isArray(ue.tConfig.enabledOnSeries)&&ue.tConfig.enabledOnSeries.indexOf(h)===-1?Ye[0].parentNode.style.display="none":Ye[0].parentNode.style.display=te.config.tooltip.items.display}else Array.isArray(ue.tConfig.enabledOnSeries)&&ue.tConfig.enabledOnSeries.indexOf(h)===-1&&(Ye[0].parentNode.style.display="none")}},{key:"toggleActiveInactiveSeries",value:function(p,h){var S=this.w;if(p)this.tooltipUtil.toggleAllTooltipSeriesGroups("enable");else{this.tooltipUtil.toggleAllTooltipSeriesGroups("disable");var _=S.globals.dom.baseEl.querySelector(".apexcharts-tooltip-series-group-".concat(h));_&&(_.classList.add("apexcharts-active"),_.style.display=S.config.tooltip.items.display)}}},{key:"getValuesToPrint",value:function(p){var h=p.i,S=p.j,_=this.w,k=this.ctx.series.filteredSeriesX(),T="",B="",q=null,te=null,ue={series:_.globals.series,seriesIndex:h,dataPointIndex:S,w:_},de=_.globals.ttZFormatter;S===null?te=_.globals.series[h]:_.globals.isXNumeric&&_.config.chart.type!=="treemap"?(T=k[h][S],k[h].length===0&&(T=k[this.tooltipUtil.getFirstActiveXArray(k)][S])):T=new Qe(this.ctx).isFormatXY()?_.config.series[h].data[S]!==void 0?_.config.series[h].data[S].x:"":_.globals.labels[S]!==void 0?_.globals.labels[S]:"";var xe=T;return _.globals.isXNumeric&&_.config.xaxis.type==="datetime"?T=new re(this.ctx).xLabelFormat(_.globals.ttKeyFormatter,xe,xe,{i:void 0,dateFormatter:new Z(this.ctx).formatDate,w:this.w}):T=_.globals.isBarHorizontal?_.globals.yLabelFormatters[0](xe,ue):_.globals.xLabelFormatter(xe,ue),_.config.tooltip.x.formatter!==void 0&&(T=_.globals.ttKeyFormatter(xe,ue)),_.globals.seriesZ.length>0&&_.globals.seriesZ[h].length>0&&(q=de(_.globals.seriesZ[h][S],_)),B=typeof _.config.xaxis.tooltip.formatter=="function"?_.globals.xaxisTooltipFormatter(xe,ue):T,{val:Array.isArray(te)?te.join(" "):te,xVal:Array.isArray(T)?T.join(" "):T,xAxisTTVal:Array.isArray(B)?B.join(" "):B,zVal:q}}},{key:"handleCustomTooltip",value:function(p){var h=p.i,S=p.j,_=p.y1,k=p.y2,T=p.w,B=this.ttCtx.getElTooltip(),q=T.config.tooltip.custom;Array.isArray(q)&&q[h]&&(q=q[h]),B.innerHTML=q({ctx:this.ctx,series:T.globals.series,seriesIndex:h,dataPointIndex:S,y1:_,y2:k,w:T})}}]),Ee}(),Rt=function(){function Ee(p){s(this,Ee),this.ttCtx=p,this.ctx=p.ctx,this.w=p.w}return o(Ee,[{key:"moveXCrosshairs",value:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,S=this.ttCtx,_=this.w,k=S.getElXCrosshairs(),T=p-S.xcrosshairsWidth/2,B=_.globals.labels.slice().length;if(h!==null&&(T=_.globals.gridWidth/B*h),k===null||_.globals.isBarHorizontal||(k.setAttribute("x",T),k.setAttribute("x1",T),k.setAttribute("x2",T),k.setAttribute("y2",_.globals.gridHeight),k.classList.add("apexcharts-active")),T<0&&(T=0),T>_.globals.gridWidth&&(T=_.globals.gridWidth),S.isXAxisTooltipEnabled){var q=T;_.config.xaxis.crosshairs.width!=="tickWidth"&&_.config.xaxis.crosshairs.width!=="barWidth"||(q=T+S.xcrosshairsWidth/2),this.moveXAxisTooltip(q)}}},{key:"moveYCrosshairs",value:function(p){var h=this.ttCtx;h.ycrosshairs!==null&&z.setAttrs(h.ycrosshairs,{y1:p,y2:p}),h.ycrosshairsHidden!==null&&z.setAttrs(h.ycrosshairsHidden,{y1:p,y2:p})}},{key:"moveXAxisTooltip",value:function(p){var h=this.w,S=this.ttCtx;if(S.xaxisTooltip!==null&&S.xcrosshairsWidth!==0){S.xaxisTooltip.classList.add("apexcharts-active");var _=S.xaxisOffY+h.config.xaxis.tooltip.offsetY+h.globals.translateY+1+h.config.xaxis.offsetY;if(p-=S.xaxisTooltip.getBoundingClientRect().width/2,!isNaN(p)){p+=h.globals.translateX;var k;k=new z(this.ctx).getTextRects(S.xaxisTooltipText.innerHTML),S.xaxisTooltipText.style.minWidth=k.width+"px",S.xaxisTooltip.style.left=p+"px",S.xaxisTooltip.style.top=_+"px"}}}},{key:"moveYAxisTooltip",value:function(p){var h=this.w,S=this.ttCtx;S.yaxisTTEls===null&&(S.yaxisTTEls=h.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));var _=parseInt(S.ycrosshairsHidden.getAttribute("y1"),10),k=h.globals.translateY+_,T=S.yaxisTTEls[p].getBoundingClientRect().height,B=h.globals.translateYAxisX[p]-2;h.config.yaxis[p].opposite&&(B-=26),k-=T/2,h.globals.ignoreYAxisIndexes.indexOf(p)===-1?(S.yaxisTTEls[p].classList.add("apexcharts-active"),S.yaxisTTEls[p].style.top=k+"px",S.yaxisTTEls[p].style.left=B+h.config.yaxis[p].tooltip.offsetX+"px"):S.yaxisTTEls[p].classList.remove("apexcharts-active")}},{key:"moveTooltip",value:function(p,h){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_=this.w,k=this.ttCtx,T=k.getElTooltip(),B=k.tooltipRect,q=S!==null?parseFloat(S):1,te=parseFloat(p)+q+5,ue=parseFloat(h)+q/2;if(te>_.globals.gridWidth/2&&(te=te-B.ttWidth-q-10),te>_.globals.gridWidth-B.ttWidth-10&&(te=_.globals.gridWidth-B.ttWidth),te<-20&&(te=-20),_.config.tooltip.followCursor){var de=k.getElGrid().getBoundingClientRect();(te=k.e.clientX-de.left)>_.globals.gridWidth/2&&(te-=k.tooltipRect.ttWidth),(ue=k.e.clientY+_.globals.translateY-de.top)>_.globals.gridHeight/2&&(ue-=k.tooltipRect.ttHeight)}else _.globals.isBarHorizontal||B.ttHeight/2+ue>_.globals.gridHeight&&(ue=_.globals.gridHeight-B.ttHeight+_.globals.translateY);isNaN(te)||(te+=_.globals.translateX,T.style.left=te+"px",T.style.top=ue+"px")}},{key:"moveMarkers",value:function(p,h){var S=this.w,_=this.ttCtx;if(S.globals.markers.size[p]>0)for(var k=S.globals.dom.baseEl.querySelectorAll(" .apexcharts-series[data\\:realIndex='".concat(p,"'] .apexcharts-marker")),T=0;T<k.length;T++)parseInt(k[T].getAttribute("rel"),10)===h&&(_.marker.resetPointsSize(),_.marker.enlargeCurrentPoint(h,k[T]));else _.marker.resetPointsSize(),this.moveDynamicPointOnHover(h,p)}},{key:"moveDynamicPointOnHover",value:function(p,h){var S,_,k,T,B=this.w,q=this.ttCtx,te=new z(this.ctx),ue=B.globals.pointsArray,de=q.tooltipUtil.getHoverMarkerSize(h),xe=B.config.series[h].type;if(!xe||xe!=="column"&&xe!=="candlestick"&&xe!=="boxPlot"){k=(S=ue[h][p])===null||S===void 0?void 0:S[0],T=((_=ue[h][p])===null||_===void 0?void 0:_[1])||0;var we=B.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(h,"'] .apexcharts-series-markers path"));if(we&&T<B.globals.gridHeight&&T>0){var ke=we.getAttribute("shape"),Me=te.getMarkerPath(k,T,ke,1.5*de);we.setAttribute("d",Me)}this.moveXCrosshairs(k),q.fixedTooltip||this.moveTooltip(k,T,de)}}},{key:"moveDynamicPointsOnHover",value:function(p){var h,S=this.ttCtx,_=S.w,k=0,T=0,B=_.globals.pointsArray,q=new Re(this.ctx),te=new z(this.ctx);h=q.getActiveConfigSeriesIndex("asc",["line","area","scatter","bubble"]);var ue=S.tooltipUtil.getHoverMarkerSize(h);B[h]&&(k=B[h][p][0],T=B[h][p][1]);var de=S.tooltipUtil.getAllMarkers();if(de!==null)for(var xe=0;xe<_.globals.series.length;xe++){var we=B[xe];if(_.globals.comboCharts&&we===void 0&&de.splice(xe,0,null),we&&we.length){var ke=B[xe][p][1],Me=void 0;de[xe].setAttribute("cx",k);var Ye=de[xe].getAttribute("shape");if(_.config.chart.type==="rangeArea"&&!_.globals.comboCharts){var Fe=p+_.globals.series[xe].length;Me=B[xe][Fe][1],ke-=Math.abs(ke-Me)/2}if(ke!==null&&!isNaN(ke)&&ke<_.globals.gridHeight+ue&&ke+ue>0){var rt=te.getMarkerPath(k,ke,Ye,ue);de[xe].setAttribute("d",rt)}else de[xe].setAttribute("d","")}}this.moveXCrosshairs(k),S.fixedTooltip||this.moveTooltip(k,T||_.globals.gridHeight,ue)}},{key:"moveStickyTooltipOverBars",value:function(p,h){var S=this.w,_=this.ttCtx,k=S.globals.columnSeries?S.globals.columnSeries.length:S.globals.series.length,T=k>=2&&k%2==0?Math.floor(k/2):Math.floor(k/2)+1;S.globals.isBarHorizontal&&(T=new Re(this.ctx).getActiveConfigSeriesIndex("desc")+1);var B=S.globals.dom.baseEl.querySelector(".apexcharts-bar-series .apexcharts-series[rel='".concat(T,"'] path[j='").concat(p,"'], .apexcharts-candlestick-series .apexcharts-series[rel='").concat(T,"'] path[j='").concat(p,"'], .apexcharts-boxPlot-series .apexcharts-series[rel='").concat(T,"'] path[j='").concat(p,"'], .apexcharts-rangebar-series .apexcharts-series[rel='").concat(T,"'] path[j='").concat(p,"']"));B||typeof h!="number"||(B=S.globals.dom.baseEl.querySelector(".apexcharts-bar-series .apexcharts-series[data\\:realIndex='".concat(h,"'] path[j='").concat(p,`'],
        .apexcharts-candlestick-series .apexcharts-series[data\\:realIndex='`).concat(h,"'] path[j='").concat(p,`'],
        .apexcharts-boxPlot-series .apexcharts-series[data\\:realIndex='`).concat(h,"'] path[j='").concat(p,`'],
        .apexcharts-rangebar-series .apexcharts-series[data\\:realIndex='`).concat(h,"'] path[j='").concat(p,"']")));var q=B?parseFloat(B.getAttribute("cx")):0,te=B?parseFloat(B.getAttribute("cy")):0,ue=B?parseFloat(B.getAttribute("barWidth")):0,de=_.getElGrid().getBoundingClientRect(),xe=B&&(B.classList.contains("apexcharts-candlestick-area")||B.classList.contains("apexcharts-boxPlot-area"));S.globals.isXNumeric?(B&&!xe&&(q-=k%2!=0?ue/2:0),B&&xe&&S.globals.comboCharts&&(q-=ue/2)):S.globals.isBarHorizontal||(q=_.xAxisTicksPositions[p-1]+_.dataPointsDividedWidth/2,isNaN(q)&&(q=_.xAxisTicksPositions[p]-_.dataPointsDividedWidth/2)),S.globals.isBarHorizontal?te-=_.tooltipRect.ttHeight:S.config.tooltip.followCursor?te=_.e.clientY-de.top-_.tooltipRect.ttHeight/2:te+_.tooltipRect.ttHeight+15>S.globals.gridHeight&&(te=S.globals.gridHeight),S.globals.isBarHorizontal||this.moveXCrosshairs(q),_.fixedTooltip||this.moveTooltip(q,te||S.globals.gridHeight)}}]),Ee}(),qe=function(){function Ee(p){s(this,Ee),this.w=p.w,this.ttCtx=p,this.ctx=p.ctx,this.tooltipPosition=new Rt(p)}return o(Ee,[{key:"drawDynamicPoints",value:function(){var p=this.w,h=new z(this.ctx),S=new be(this.ctx),_=p.globals.dom.baseEl.querySelectorAll(".apexcharts-series");_=N(_),p.config.chart.stacked&&_.sort(function(de,xe){return parseFloat(de.getAttribute("data:realIndex"))-parseFloat(xe.getAttribute("data:realIndex"))});for(var k=0;k<_.length;k++){var T=_[k].querySelector(".apexcharts-series-markers-wrap");if(T!==null){var B=void 0,q="apexcharts-marker w".concat((Math.random()+1).toString(36).substring(4));p.config.chart.type!=="line"&&p.config.chart.type!=="area"||p.globals.comboCharts||p.config.tooltip.intersect||(q+=" no-pointer-events");var te=S.getMarkerConfig({cssClass:q,seriesIndex:Number(T.getAttribute("data:realIndex"))});(B=h.drawMarker(0,0,te)).node.setAttribute("default-marker-size",0);var ue=document.createElementNS(p.globals.SVGNS,"g");ue.classList.add("apexcharts-series-markers"),ue.appendChild(B.node),T.appendChild(ue)}}}},{key:"enlargeCurrentPoint",value:function(p,h){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,k=this.w;k.config.chart.type!=="bubble"&&this.newPointSize(p,h);var T=h.getAttribute("cx"),B=h.getAttribute("cy");if(S!==null&&_!==null&&(T=S,B=_),this.tooltipPosition.moveXCrosshairs(T),!this.fixedTooltip){if(k.config.chart.type==="radar"){var q=this.ttCtx.getElGrid().getBoundingClientRect();T=this.ttCtx.e.clientX-q.left}this.tooltipPosition.moveTooltip(T,B,k.config.markers.hover.size)}}},{key:"enlargePoints",value:function(p){for(var h=this.w,S=this,_=this.ttCtx,k=p,T=h.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"),B=h.config.markers.hover.size,q=0;q<T.length;q++){var te=T[q].getAttribute("rel"),ue=T[q].getAttribute("index");if(B===void 0&&(B=h.globals.markers.size[ue]+h.config.markers.hover.sizeOffset),k===parseInt(te,10)){S.newPointSize(k,T[q]);var de=T[q].getAttribute("cx"),xe=T[q].getAttribute("cy");S.tooltipPosition.moveXCrosshairs(de),_.fixedTooltip||S.tooltipPosition.moveTooltip(de,xe,B)}else S.oldPointSize(T[q])}}},{key:"newPointSize",value:function(p,h){var S=this.w,_=S.config.markers.hover.size,k=p===0?h.parentNode.firstChild:h.parentNode.lastChild;if(k.getAttribute("default-marker-size")!=="0"){var T=parseInt(k.getAttribute("index"),10);_===void 0&&(_=S.globals.markers.size[T]+S.config.markers.hover.sizeOffset),_<0&&(_=0);var B=this.ttCtx.tooltipUtil.getPathFromPoint(h,_);h.setAttribute("d",B)}}},{key:"oldPointSize",value:function(p){var h=parseFloat(p.getAttribute("default-marker-size")),S=this.ttCtx.tooltipUtil.getPathFromPoint(p,h);p.setAttribute("d",S)}},{key:"resetPointsSize",value:function(){for(var p=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"),h=0;h<p.length;h++){var S=parseFloat(p[h].getAttribute("default-marker-size"));if(F.isNumber(S)&&S>=0){var _=this.ttCtx.tooltipUtil.getPathFromPoint(p[h],S);p[h].setAttribute("d",_)}else p[h].setAttribute("d","M0,0")}}}]),Ee}(),lt=function(){function Ee(p){s(this,Ee),this.w=p.w;var h=this.w;this.ttCtx=p,this.isVerticalGroupedRangeBar=!h.globals.isBarHorizontal&&h.config.chart.type==="rangeBar"&&h.config.plotOptions.bar.rangeBarGroupRows}return o(Ee,[{key:"getAttr",value:function(p,h){return parseFloat(p.target.getAttribute(h))}},{key:"handleHeatTreeTooltip",value:function(p){var h=p.e,S=p.opt,_=p.x,k=p.y,T=p.type,B=this.ttCtx,q=this.w;if(h.target.classList.contains("apexcharts-".concat(T,"-rect"))){var te=this.getAttr(h,"i"),ue=this.getAttr(h,"j"),de=this.getAttr(h,"cx"),xe=this.getAttr(h,"cy"),we=this.getAttr(h,"width"),ke=this.getAttr(h,"height");if(B.tooltipLabels.drawSeriesTexts({ttItems:S.ttItems,i:te,j:ue,shared:!1,e:h}),q.globals.capturedSeriesIndex=te,q.globals.capturedDataPointIndex=ue,_=de+B.tooltipRect.ttWidth/2+we,k=xe+B.tooltipRect.ttHeight/2-ke/2,B.tooltipPosition.moveXCrosshairs(de+we/2),_>q.globals.gridWidth/2&&(_=de-B.tooltipRect.ttWidth/2+we),B.w.config.tooltip.followCursor){var Me=q.globals.dom.elWrap.getBoundingClientRect();_=q.globals.clientX-Me.left-(_>q.globals.gridWidth/2?B.tooltipRect.ttWidth:0),k=q.globals.clientY-Me.top-(k>q.globals.gridHeight/2?B.tooltipRect.ttHeight:0)}}return{x:_,y:k}}},{key:"handleMarkerTooltip",value:function(p){var h,S,_=p.e,k=p.opt,T=p.x,B=p.y,q=this.w,te=this.ttCtx;if(_.target.classList.contains("apexcharts-marker")){var ue=parseInt(k.paths.getAttribute("cx"),10),de=parseInt(k.paths.getAttribute("cy"),10),xe=parseFloat(k.paths.getAttribute("val"));if(S=parseInt(k.paths.getAttribute("rel"),10),h=parseInt(k.paths.parentNode.parentNode.parentNode.getAttribute("rel"),10)-1,te.intersect){var we=F.findAncestor(k.paths,"apexcharts-series");we&&(h=parseInt(we.getAttribute("data:realIndex"),10))}if(te.tooltipLabels.drawSeriesTexts({ttItems:k.ttItems,i:h,j:S,shared:!te.showOnIntersect&&q.config.tooltip.shared,e:_}),_.type==="mouseup"&&te.markerClick(_,h,S),q.globals.capturedSeriesIndex=h,q.globals.capturedDataPointIndex=S,T=ue,B=de+q.globals.translateY-1.4*te.tooltipRect.ttHeight,te.w.config.tooltip.followCursor){var ke=te.getElGrid().getBoundingClientRect();B=te.e.clientY+q.globals.translateY-ke.top}xe<0&&(B=de),te.marker.enlargeCurrentPoint(S,k.paths,T,B)}return{x:T,y:B}}},{key:"handleBarTooltip",value:function(p){var h,S,_=p.e,k=p.opt,T=this.w,B=this.ttCtx,q=B.getElTooltip(),te=0,ue=0,de=0,xe=this.getBarTooltipXY({e:_,opt:k});h=xe.i;var we=xe.j;T.globals.capturedSeriesIndex=h,T.globals.capturedDataPointIndex=we,T.globals.isBarHorizontal&&B.tooltipUtil.hasBars()||!T.config.tooltip.shared?(ue=xe.x,de=xe.y,S=Array.isArray(T.config.stroke.width)?T.config.stroke.width[h]:T.config.stroke.width,te=ue):T.globals.comboCharts||T.config.tooltip.shared||(te/=2),isNaN(de)&&(de=T.globals.svgHeight-B.tooltipRect.ttHeight);var ke=parseInt(k.paths.parentNode.getAttribute("data:realIndex"),10);if(T.globals.isMultipleYAxis?T.config.yaxis[ke]&&T.config.yaxis[ke].reversed:T.config.yaxis[0].reversed,ue+B.tooltipRect.ttWidth>T.globals.gridWidth?ue-=B.tooltipRect.ttWidth:ue<0&&(ue=0),B.w.config.tooltip.followCursor){var Me=B.getElGrid().getBoundingClientRect();de=B.e.clientY-Me.top}B.tooltip===null&&(B.tooltip=T.globals.dom.baseEl.querySelector(".apexcharts-tooltip")),T.config.tooltip.shared||(T.globals.comboBarCount>0?B.tooltipPosition.moveXCrosshairs(te+S/2):B.tooltipPosition.moveXCrosshairs(te)),!B.fixedTooltip&&(!T.config.tooltip.shared||T.globals.isBarHorizontal&&B.tooltipUtil.hasBars())&&(de=de+T.globals.translateY-B.tooltipRect.ttHeight/2,q.style.left=ue+T.globals.translateX+"px",q.style.top=de+"px")}},{key:"getBarTooltipXY",value:function(p){var h=this,S=p.e,_=p.opt,k=this.w,T=null,B=this.ttCtx,q=0,te=0,ue=0,de=0,xe=0,we=S.target.classList;if(we.contains("apexcharts-bar-area")||we.contains("apexcharts-candlestick-area")||we.contains("apexcharts-boxPlot-area")||we.contains("apexcharts-rangebar-area")){var ke=S.target,Me=ke.getBoundingClientRect(),Ye=_.elGrid.getBoundingClientRect(),Fe=Me.height;xe=Me.height;var rt=Me.width,se=parseInt(ke.getAttribute("cx"),10),Ce=parseInt(ke.getAttribute("cy"),10);de=parseFloat(ke.getAttribute("barWidth"));var De=S.type==="touchmove"?S.touches[0].clientX:S.clientX;T=parseInt(ke.getAttribute("j"),10),q=parseInt(ke.parentNode.getAttribute("rel"),10)-1;var Le=ke.getAttribute("data-range-y1"),_e=ke.getAttribute("data-range-y2");k.globals.comboCharts&&(q=parseInt(ke.parentNode.getAttribute("data:realIndex"),10));var nt=function(gt){return k.globals.isXNumeric?se-rt/2:h.isVerticalGroupedRangeBar?se+rt/2:se-B.dataPointsDividedWidth+rt/2},ot=function(){return Ce-B.dataPointsDividedHeight+Fe/2-B.tooltipRect.ttHeight/2};B.tooltipLabels.drawSeriesTexts({ttItems:_.ttItems,i:q,j:T,y1:Le?parseInt(Le,10):null,y2:_e?parseInt(_e,10):null,shared:!B.showOnIntersect&&k.config.tooltip.shared,e:S}),k.config.tooltip.followCursor?k.globals.isBarHorizontal?(te=De-Ye.left+15,ue=ot()):(te=nt(),ue=S.clientY-Ye.top-B.tooltipRect.ttHeight/2-15):k.globals.isBarHorizontal?((te=se)<B.xyRatios.baseLineInvertedY&&(te=se-B.tooltipRect.ttWidth),ue=ot()):(te=nt(),ue=Ce)}return{x:te,y:ue,barHeight:xe,barWidth:de,i:q,j:T}}}]),Ee}(),xt=function(){function Ee(p){s(this,Ee),this.w=p.w,this.ttCtx=p}return o(Ee,[{key:"drawXaxisTooltip",value:function(){var p=this.w,h=this.ttCtx,S=p.config.xaxis.position==="bottom";h.xaxisOffY=S?p.globals.gridHeight+1:-p.globals.xAxisHeight-p.config.xaxis.axisTicks.height+3;var _=S?"apexcharts-xaxistooltip apexcharts-xaxistooltip-bottom":"apexcharts-xaxistooltip apexcharts-xaxistooltip-top",k=p.globals.dom.elWrap;h.isXAxisTooltipEnabled&&p.globals.dom.baseEl.querySelector(".apexcharts-xaxistooltip")===null&&(h.xaxisTooltip=document.createElement("div"),h.xaxisTooltip.setAttribute("class",_+" apexcharts-theme-"+p.config.tooltip.theme),k.appendChild(h.xaxisTooltip),h.xaxisTooltipText=document.createElement("div"),h.xaxisTooltipText.classList.add("apexcharts-xaxistooltip-text"),h.xaxisTooltipText.style.fontFamily=p.config.xaxis.tooltip.style.fontFamily||p.config.chart.fontFamily,h.xaxisTooltipText.style.fontSize=p.config.xaxis.tooltip.style.fontSize,h.xaxisTooltip.appendChild(h.xaxisTooltipText))}},{key:"drawYaxisTooltip",value:function(){for(var p=this.w,h=this.ttCtx,S=0;S<p.config.yaxis.length;S++){var _=p.config.yaxis[S].opposite||p.config.yaxis[S].crosshairs.opposite;h.yaxisOffX=_?p.globals.gridWidth+1:1;var k="apexcharts-yaxistooltip apexcharts-yaxistooltip-".concat(S,_?" apexcharts-yaxistooltip-right":" apexcharts-yaxistooltip-left"),T=p.globals.dom.elWrap;p.globals.dom.baseEl.querySelector(".apexcharts-yaxistooltip apexcharts-yaxistooltip-".concat(S))===null&&(h.yaxisTooltip=document.createElement("div"),h.yaxisTooltip.setAttribute("class",k+" apexcharts-theme-"+p.config.tooltip.theme),T.appendChild(h.yaxisTooltip),S===0&&(h.yaxisTooltipText=[]),h.yaxisTooltipText[S]=document.createElement("div"),h.yaxisTooltipText[S].classList.add("apexcharts-yaxistooltip-text"),h.yaxisTooltip.appendChild(h.yaxisTooltipText[S]))}}},{key:"setXCrosshairWidth",value:function(){var p=this.w,h=this.ttCtx,S=h.getElXCrosshairs();if(h.xcrosshairsWidth=parseInt(p.config.xaxis.crosshairs.width,10),p.globals.comboCharts){var _=p.globals.dom.baseEl.querySelector(".apexcharts-bar-area");if(_!==null&&p.config.xaxis.crosshairs.width==="barWidth"){var k=parseFloat(_.getAttribute("barWidth"));h.xcrosshairsWidth=k}else if(p.config.xaxis.crosshairs.width==="tickWidth"){var T=p.globals.labels.length;h.xcrosshairsWidth=p.globals.gridWidth/T}}else if(p.config.xaxis.crosshairs.width==="tickWidth"){var B=p.globals.labels.length;h.xcrosshairsWidth=p.globals.gridWidth/B}else if(p.config.xaxis.crosshairs.width==="barWidth"){var q=p.globals.dom.baseEl.querySelector(".apexcharts-bar-area");if(q!==null){var te=parseFloat(q.getAttribute("barWidth"));h.xcrosshairsWidth=te}else h.xcrosshairsWidth=1}p.globals.isBarHorizontal&&(h.xcrosshairsWidth=0),S!==null&&h.xcrosshairsWidth>0&&S.setAttribute("width",h.xcrosshairsWidth)}},{key:"handleYCrosshair",value:function(){var p=this.w,h=this.ttCtx;h.ycrosshairs=p.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs"),h.ycrosshairsHidden=p.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs-hidden")}},{key:"drawYaxisTooltipText",value:function(p,h,S){var _=this.ttCtx,k=this.w,T=k.globals,B=T.seriesYAxisMap[p];if(_.yaxisTooltips[p]&&B.length>0){var q=T.yLabelFormatters[p],te=_.getElGrid().getBoundingClientRect(),ue=B[0],de=0;S.yRatio.length>1&&(de=ue);var xe=(h-te.top)*S.yRatio[de],we=T.maxYArr[ue]-T.minYArr[ue],ke=T.minYArr[ue]+(we-xe);k.config.yaxis[p].reversed&&(ke=T.maxYArr[ue]-(we-xe)),_.tooltipPosition.moveYCrosshairs(h-te.top),_.yaxisTooltipText[p].innerHTML=q(ke),_.tooltipPosition.moveYAxisTooltip(p)}}}]),Ee}(),Nt=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w;var h=this.w;this.tConfig=h.config.tooltip,this.tooltipUtil=new Je(this),this.tooltipLabels=new He(this),this.tooltipPosition=new Rt(this),this.marker=new qe(this),this.intersect=new lt(this),this.axesTooltip=new xt(this),this.showOnIntersect=this.tConfig.intersect,this.showTooltipTitle=this.tConfig.x.show,this.fixedTooltip=this.tConfig.fixed.enabled,this.xaxisTooltip=null,this.yaxisTTEls=null,this.isBarShared=!h.globals.isBarHorizontal&&this.tConfig.shared,this.lastHoverTime=Date.now()}return o(Ee,[{key:"getElTooltip",value:function(p){return p||(p=this),p.w.globals.dom.baseEl?p.w.globals.dom.baseEl.querySelector(".apexcharts-tooltip"):null}},{key:"getElXCrosshairs",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-xcrosshairs")}},{key:"getElGrid",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-grid")}},{key:"drawTooltip",value:function(p){var h=this.w;this.xyRatios=p,this.isXAxisTooltipEnabled=h.config.xaxis.tooltip.enabled&&h.globals.axisCharts,this.yaxisTooltips=h.config.yaxis.map(function(T,B){return!!(T.show&&T.tooltip.enabled&&h.globals.axisCharts)}),this.allTooltipSeriesGroups=[],h.globals.axisCharts||(this.showTooltipTitle=!1);var S=document.createElement("div");if(S.classList.add("apexcharts-tooltip"),h.config.tooltip.cssClass&&S.classList.add(h.config.tooltip.cssClass),S.classList.add("apexcharts-theme-".concat(this.tConfig.theme)),h.globals.dom.elWrap.appendChild(S),h.globals.axisCharts){this.axesTooltip.drawXaxisTooltip(),this.axesTooltip.drawYaxisTooltip(),this.axesTooltip.setXCrosshairWidth(),this.axesTooltip.handleYCrosshair();var _=new it(this.ctx);this.xAxisTicksPositions=_.getXAxisTicksPositions()}if(!h.globals.comboCharts&&!this.tConfig.intersect&&h.config.chart.type!=="rangeBar"||this.tConfig.shared||(this.showOnIntersect=!0),h.config.markers.size!==0&&h.globals.markers.largestSize!==0||this.marker.drawDynamicPoints(this),h.globals.collapsedSeries.length!==h.globals.series.length){this.dataPointsDividedHeight=h.globals.gridHeight/h.globals.dataPoints,this.dataPointsDividedWidth=h.globals.gridWidth/h.globals.dataPoints,this.showTooltipTitle&&(this.tooltipTitle=document.createElement("div"),this.tooltipTitle.classList.add("apexcharts-tooltip-title"),this.tooltipTitle.style.fontFamily=this.tConfig.style.fontFamily||h.config.chart.fontFamily,this.tooltipTitle.style.fontSize=this.tConfig.style.fontSize,S.appendChild(this.tooltipTitle));var k=h.globals.series.length;(h.globals.xyCharts||h.globals.comboCharts)&&this.tConfig.shared&&(k=this.showOnIntersect?1:h.globals.series.length),this.legendLabels=h.globals.dom.baseEl.querySelectorAll(".apexcharts-legend-text"),this.ttItems=this.createTTElements(k),this.addSVGEvents()}}},{key:"createTTElements",value:function(p){for(var h=this,S=this.w,_=[],k=this.getElTooltip(),T=function(q){var te=document.createElement("div");te.classList.add("apexcharts-tooltip-series-group","apexcharts-tooltip-series-group-".concat(q)),te.style.order=S.config.tooltip.inverseOrder?p-q:q+1;var ue=document.createElement("span");ue.classList.add("apexcharts-tooltip-marker"),ue.style.backgroundColor=S.globals.colors[q],te.appendChild(ue);var de=document.createElement("div");de.classList.add("apexcharts-tooltip-text"),de.style.fontFamily=h.tConfig.style.fontFamily||S.config.chart.fontFamily,de.style.fontSize=h.tConfig.style.fontSize,["y","goals","z"].forEach(function(xe){var we=document.createElement("div");we.classList.add("apexcharts-tooltip-".concat(xe,"-group"));var ke=document.createElement("span");ke.classList.add("apexcharts-tooltip-text-".concat(xe,"-label")),we.appendChild(ke);var Me=document.createElement("span");Me.classList.add("apexcharts-tooltip-text-".concat(xe,"-value")),we.appendChild(Me),de.appendChild(we)}),te.appendChild(de),k.appendChild(te),_.push(te)},B=0;B<p;B++)T(B);return _}},{key:"addSVGEvents",value:function(){var p=this.w,h=p.config.chart.type,S=this.getElTooltip(),_=!(h!=="bar"&&h!=="candlestick"&&h!=="boxPlot"&&h!=="rangeBar"),k=h==="area"||h==="line"||h==="scatter"||h==="bubble"||h==="radar",T=p.globals.dom.Paper.node,B=this.getElGrid();B&&(this.seriesBound=B.getBoundingClientRect());var q,te=[],ue=[],de={hoverArea:T,elGrid:B,tooltipEl:S,tooltipY:te,tooltipX:ue,ttItems:this.ttItems};if(p.globals.axisCharts&&(k?q=p.globals.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:longestSeries='true'] .apexcharts-marker"):_?q=p.globals.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-bar-area, .apexcharts-series .apexcharts-candlestick-area, .apexcharts-series .apexcharts-boxPlot-area, .apexcharts-series .apexcharts-rangebar-area"):h!=="heatmap"&&h!=="treemap"||(q=p.globals.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-heatmap, .apexcharts-series .apexcharts-treemap")),q&&q.length))for(var xe=0;xe<q.length;xe++)te.push(q[xe].getAttribute("cy")),ue.push(q[xe].getAttribute("cx"));if(p.globals.xyCharts&&!this.showOnIntersect||p.globals.comboCharts&&!this.showOnIntersect||_&&this.tooltipUtil.hasBars()&&this.tConfig.shared)this.addPathsEventListeners([T],de);else if(_&&!p.globals.comboCharts||k&&this.showOnIntersect)this.addDatapointEventsListeners(de);else if(!p.globals.axisCharts||h==="heatmap"||h==="treemap"){var we=p.globals.dom.baseEl.querySelectorAll(".apexcharts-series");this.addPathsEventListeners(we,de)}if(this.showOnIntersect){var ke=p.globals.dom.baseEl.querySelectorAll(".apexcharts-line-series .apexcharts-marker, .apexcharts-area-series .apexcharts-marker");ke.length>0&&this.addPathsEventListeners(ke,de),this.tooltipUtil.hasBars()&&!this.tConfig.shared&&this.addDatapointEventsListeners(de)}}},{key:"drawFixedTooltipRect",value:function(){var p=this.w,h=this.getElTooltip(),S=h.getBoundingClientRect(),_=S.width+10,k=S.height+10,T=this.tConfig.fixed.offsetX,B=this.tConfig.fixed.offsetY,q=this.tConfig.fixed.position.toLowerCase();return q.indexOf("right")>-1&&(T=T+p.globals.svgWidth-_+10),q.indexOf("bottom")>-1&&(B=B+p.globals.svgHeight-k-10),h.style.left=T+"px",h.style.top=B+"px",{x:T,y:B,ttWidth:_,ttHeight:k}}},{key:"addDatapointEventsListeners",value:function(p){var h=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers .apexcharts-marker, .apexcharts-bar-area, .apexcharts-candlestick-area, .apexcharts-boxPlot-area, .apexcharts-rangebar-area");this.addPathsEventListeners(h,p)}},{key:"addPathsEventListeners",value:function(p,h){for(var S=this,_=function(T){var B={paths:p[T],tooltipEl:h.tooltipEl,tooltipY:h.tooltipY,tooltipX:h.tooltipX,elGrid:h.elGrid,hoverArea:h.hoverArea,ttItems:h.ttItems};["mousemove","mouseup","touchmove","mouseout","touchend"].map(function(q){return p[T].addEventListener(q,S.onSeriesHover.bind(S,B),{capture:!1,passive:!0})})},k=0;k<p.length;k++)_(k)}},{key:"onSeriesHover",value:function(p,h){var S=this,_=Date.now()-this.lastHoverTime;_>=100?this.seriesHover(p,h):(clearTimeout(this.seriesHoverTimeout),this.seriesHoverTimeout=setTimeout(function(){S.seriesHover(p,h)},100-_))}},{key:"seriesHover",value:function(p,h){var S=this;this.lastHoverTime=Date.now();var _=[],k=this.w;k.config.chart.group&&(_=this.ctx.getGroupedCharts()),k.globals.axisCharts&&(k.globals.minX===-1/0&&k.globals.maxX===1/0||k.globals.dataPoints===0)||(_.length?_.forEach(function(T){var B=S.getElTooltip(T),q={paths:p.paths,tooltipEl:B,tooltipY:p.tooltipY,tooltipX:p.tooltipX,elGrid:p.elGrid,hoverArea:p.hoverArea,ttItems:T.w.globals.tooltip.ttItems};T.w.globals.minX===S.w.globals.minX&&T.w.globals.maxX===S.w.globals.maxX&&T.w.globals.tooltip.seriesHoverByContext({chartCtx:T,ttCtx:T.w.globals.tooltip,opt:q,e:h})}):this.seriesHoverByContext({chartCtx:this.ctx,ttCtx:this.w.globals.tooltip,opt:p,e:h}))}},{key:"seriesHoverByContext",value:function(p){var h=p.chartCtx,S=p.ttCtx,_=p.opt,k=p.e,T=h.w,B=this.getElTooltip(h);B&&(S.tooltipRect={x:0,y:0,ttWidth:B.getBoundingClientRect().width,ttHeight:B.getBoundingClientRect().height},S.e=k,S.tooltipUtil.hasBars()&&!T.globals.comboCharts&&!S.isBarShared&&this.tConfig.onDatasetHover.highlightDataSeries&&new Re(h).toggleSeriesOnHover(k,k.target.parentNode),S.fixedTooltip&&S.drawFixedTooltipRect(),T.globals.axisCharts?S.axisChartsTooltips({e:k,opt:_,tooltipRect:S.tooltipRect}):S.nonAxisChartsTooltips({e:k,opt:_,tooltipRect:S.tooltipRect}))}},{key:"axisChartsTooltips",value:function(p){var h,S,_=p.e,k=p.opt,T=this.w,B=k.elGrid.getBoundingClientRect(),q=_.type==="touchmove"?_.touches[0].clientX:_.clientX,te=_.type==="touchmove"?_.touches[0].clientY:_.clientY;if(this.clientY=te,this.clientX=q,T.globals.capturedSeriesIndex=-1,T.globals.capturedDataPointIndex=-1,te<B.top||te>B.top+B.height)this.handleMouseOut(k);else{if(Array.isArray(this.tConfig.enabledOnSeries)&&!T.config.tooltip.shared){var ue=parseInt(k.paths.getAttribute("index"),10);if(this.tConfig.enabledOnSeries.indexOf(ue)<0)return void this.handleMouseOut(k)}var de=this.getElTooltip(),xe=this.getElXCrosshairs(),we=[];T.config.chart.group&&(we=this.ctx.getSyncedCharts());var ke=T.globals.xyCharts||T.config.chart.type==="bar"&&!T.globals.isBarHorizontal&&this.tooltipUtil.hasBars()&&this.tConfig.shared||T.globals.comboCharts&&this.tooltipUtil.hasBars();if(_.type==="mousemove"||_.type==="touchmove"||_.type==="mouseup"){if(T.globals.collapsedSeries.length+T.globals.ancillaryCollapsedSeries.length===T.globals.series.length)return;xe!==null&&xe.classList.add("apexcharts-active");var Me=this.yaxisTooltips.filter(function(rt){return rt===!0});if(this.ycrosshairs!==null&&Me.length&&this.ycrosshairs.classList.add("apexcharts-active"),ke&&!this.showOnIntersect||we.length>1)this.handleStickyTooltip(_,q,te,k);else if(T.config.chart.type==="heatmap"||T.config.chart.type==="treemap"){var Ye=this.intersect.handleHeatTreeTooltip({e:_,opt:k,x:h,y:S,type:T.config.chart.type});h=Ye.x,S=Ye.y,de.style.left=h+"px",de.style.top=S+"px"}else this.tooltipUtil.hasBars()&&this.intersect.handleBarTooltip({e:_,opt:k}),this.tooltipUtil.hasMarkers()&&this.intersect.handleMarkerTooltip({e:_,opt:k,x:h,y:S});if(this.yaxisTooltips.length)for(var Fe=0;Fe<T.config.yaxis.length;Fe++)this.axesTooltip.drawYaxisTooltipText(Fe,te,this.xyRatios);T.globals.dom.baseEl.classList.add("apexcharts-tooltip-active"),k.tooltipEl.classList.add("apexcharts-active")}else _.type!=="mouseout"&&_.type!=="touchend"||this.handleMouseOut(k)}}},{key:"nonAxisChartsTooltips",value:function(p){var h=p.e,S=p.opt,_=p.tooltipRect,k=this.w,T=S.paths.getAttribute("rel"),B=this.getElTooltip(),q=k.globals.dom.elWrap.getBoundingClientRect();if(h.type==="mousemove"||h.type==="touchmove"){k.globals.dom.baseEl.classList.add("apexcharts-tooltip-active"),B.classList.add("apexcharts-active"),this.tooltipLabels.drawSeriesTexts({ttItems:S.ttItems,i:parseInt(T,10)-1,shared:!1});var te=k.globals.clientX-q.left-_.ttWidth/2,ue=k.globals.clientY-q.top-_.ttHeight-10;if(B.style.left=te+"px",B.style.top=ue+"px",k.config.legend.tooltipHoverFormatter){var de=T-1,xe=(0,k.config.legend.tooltipHoverFormatter)(this.legendLabels[de].getAttribute("data:default-text"),{seriesIndex:de,dataPointIndex:de,w:k});this.legendLabels[de].innerHTML=xe}}else h.type!=="mouseout"&&h.type!=="touchend"||(B.classList.remove("apexcharts-active"),k.globals.dom.baseEl.classList.remove("apexcharts-tooltip-active"),k.config.legend.tooltipHoverFormatter&&this.legendLabels.forEach(function(we){var ke=we.getAttribute("data:default-text");we.innerHTML=decodeURIComponent(ke)}))}},{key:"handleStickyTooltip",value:function(p,h,S,_){var k=this.w,T=this.tooltipUtil.getNearestValues({context:this,hoverArea:_.hoverArea,elGrid:_.elGrid,clientX:h,clientY:S}),B=T.j,q=T.capturedSeries;k.globals.collapsedSeriesIndices.includes(q)&&(q=null);var te=_.elGrid.getBoundingClientRect();if(T.hoverX<0||T.hoverX>te.width)this.handleMouseOut(_);else if(q!==null)this.handleStickyCapturedSeries(p,q,_,B);else if(this.tooltipUtil.isXoverlap(B)||k.globals.isBarHorizontal){var ue=k.globals.series.findIndex(function(de,xe){return!k.globals.collapsedSeriesIndices.includes(xe)});this.create(p,this,ue,B,_.ttItems)}}},{key:"handleStickyCapturedSeries",value:function(p,h,S,_){var k=this.w;if(!this.tConfig.shared&&k.globals.series[h][_]===null)return void this.handleMouseOut(S);if(k.globals.series[h][_]!==void 0)this.tConfig.shared&&this.tooltipUtil.isXoverlap(_)&&this.tooltipUtil.isInitialSeriesSameLen()?this.create(p,this,h,_,S.ttItems):this.create(p,this,h,_,S.ttItems,!1);else if(this.tooltipUtil.isXoverlap(_)){var T=k.globals.series.findIndex(function(B,q){return!k.globals.collapsedSeriesIndices.includes(q)});this.create(p,this,T,_,S.ttItems)}}},{key:"deactivateHoverFilter",value:function(){for(var p=this.w,h=new z(this.ctx),S=p.globals.dom.Paper.select(".apexcharts-bar-area"),_=0;_<S.length;_++)h.pathMouseLeave(S[_])}},{key:"handleMouseOut",value:function(p){var h=this.w,S=this.getElXCrosshairs();if(h.globals.dom.baseEl.classList.remove("apexcharts-tooltip-active"),p.tooltipEl.classList.remove("apexcharts-active"),this.deactivateHoverFilter(),h.config.chart.type!=="bubble"&&this.marker.resetPointsSize(),S!==null&&S.classList.remove("apexcharts-active"),this.ycrosshairs!==null&&this.ycrosshairs.classList.remove("apexcharts-active"),this.isXAxisTooltipEnabled&&this.xaxisTooltip.classList.remove("apexcharts-active"),this.yaxisTooltips.length){this.yaxisTTEls===null&&(this.yaxisTTEls=h.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));for(var _=0;_<this.yaxisTTEls.length;_++)this.yaxisTTEls[_].classList.remove("apexcharts-active")}h.config.legend.tooltipHoverFormatter&&this.legendLabels.forEach(function(k){var T=k.getAttribute("data:default-text");k.innerHTML=decodeURIComponent(T)})}},{key:"markerClick",value:function(p,h,S){var _=this.w;typeof _.config.chart.events.markerClick=="function"&&_.config.chart.events.markerClick(p,this.ctx,{seriesIndex:h,dataPointIndex:S,w:_}),this.ctx.events.fireEvent("markerClick",[p,this.ctx,{seriesIndex:h,dataPointIndex:S,w:_}])}},{key:"create",value:function(p,h,S,_,k){var T,B,q,te,ue,de,xe,we,ke,Me,Ye,Fe,rt,se,Ce,De,Le=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,_e=this.w,nt=h;p.type==="mouseup"&&this.markerClick(p,S,_),Le===null&&(Le=this.tConfig.shared);var ot=this.tooltipUtil.hasMarkers(S),gt=this.tooltipUtil.getElBars();if(_e.config.legend.tooltipHoverFormatter){var Jt=_e.config.legend.tooltipHoverFormatter,Ge=Array.from(this.legendLabels);Ge.forEach(function(pt){var Wt=pt.getAttribute("data:default-text");pt.innerHTML=decodeURIComponent(Wt)});for(var et=0;et<Ge.length;et++){var We=Ge[et],wt=parseInt(We.getAttribute("i"),10),St=decodeURIComponent(We.getAttribute("data:default-text")),Kt=Jt(St,{seriesIndex:Le?wt:S,dataPointIndex:_,w:_e});if(Le)We.innerHTML=_e.globals.collapsedSeriesIndices.indexOf(wt)<0?Kt:St;else if(We.innerHTML=wt===S?Kt:St,S===wt)break}}var gn=v(v({ttItems:k,i:S,j:_},((T=_e.globals.seriesRange)===null||T===void 0||(B=T[S])===null||B===void 0||(q=B[_])===null||q===void 0||(te=q.y[0])===null||te===void 0?void 0:te.y1)!==void 0&&{y1:(ue=_e.globals.seriesRange)===null||ue===void 0||(de=ue[S])===null||de===void 0||(xe=de[_])===null||xe===void 0||(we=xe.y[0])===null||we===void 0?void 0:we.y1}),((ke=_e.globals.seriesRange)===null||ke===void 0||(Me=ke[S])===null||Me===void 0||(Ye=Me[_])===null||Ye===void 0||(Fe=Ye.y[0])===null||Fe===void 0?void 0:Fe.y2)!==void 0&&{y2:(rt=_e.globals.seriesRange)===null||rt===void 0||(se=rt[S])===null||se===void 0||(Ce=se[_])===null||Ce===void 0||(De=Ce.y[0])===null||De===void 0?void 0:De.y2});if(Le){if(nt.tooltipLabels.drawSeriesTexts(v(v({},gn),{},{shared:!this.showOnIntersect&&this.tConfig.shared})),ot)_e.globals.markers.largestSize>0?nt.marker.enlargePoints(_):nt.tooltipPosition.moveDynamicPointsOnHover(_);else if(this.tooltipUtil.hasBars()&&(this.barSeriesHeight=this.tooltipUtil.getBarsHeight(gt),this.barSeriesHeight>0)){var yn=new z(this.ctx),hn=_e.globals.dom.Paper.select(".apexcharts-bar-area[j='".concat(_,"']"));this.deactivateHoverFilter(),this.tooltipPosition.moveStickyTooltipOverBars(_,S);for(var br=0;br<hn.length;br++)yn.pathMouseEnter(hn[br])}}else nt.tooltipLabels.drawSeriesTexts(v({shared:!1},gn)),this.tooltipUtil.hasBars()&&nt.tooltipPosition.moveStickyTooltipOverBars(_,S),ot&&nt.tooltipPosition.moveMarkers(S,_)}}]),Ee}(),It=function(){function Ee(p){s(this,Ee),this.w=p.w,this.barCtx=p,this.totalFormatter=this.w.config.plotOptions.bar.dataLabels.total.formatter,this.totalFormatter||(this.totalFormatter=this.w.config.dataLabels.formatter)}return o(Ee,[{key:"handleBarDataLabels",value:function(p){var h,S,_=p.x,k=p.y,T=p.y1,B=p.y2,q=p.i,te=p.j,ue=p.realIndex,de=p.columnGroupIndex,xe=p.series,we=p.barHeight,ke=p.barWidth,Me=p.barXPosition,Ye=p.barYPosition,Fe=p.visibleSeries,rt=p.renderedPath,se=this.w,Ce=new z(this.barCtx.ctx),De=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[ue]:this.barCtx.strokeWidth;se.globals.isXNumeric&&!se.globals.isBarHorizontal?(h=_+parseFloat(ke*(Fe+1)),S=k+parseFloat(we*(Fe+1))-De):(h=_+parseFloat(ke*Fe),S=k+parseFloat(we*Fe));var Le,_e=null,nt=_,ot=k,gt={},Jt=se.config.dataLabels,Ge=this.barCtx.barOptions.dataLabels,et=this.barCtx.barOptions.dataLabels.total;Ye!==void 0&&this.barCtx.isRangeBar&&(S=Ye,ot=Ye),Me!==void 0&&this.barCtx.isVerticalGroupedRangeBar&&(h=Me,nt=Me);var We=Jt.offsetX,wt=Jt.offsetY,St={width:0,height:0};if(se.config.dataLabels.enabled){var Kt=se.globals.series[q][te];St=Ce.getTextRects(se.config.dataLabels.formatter?se.config.dataLabels.formatter(Kt,v(v({},se),{},{seriesIndex:q,dataPointIndex:te,w:se})):se.globals.yLabelFormatters[0](Kt),parseFloat(Jt.style.fontSize))}var gn={x:_,y:k,i:q,j:te,realIndex:ue,columnGroupIndex:de,renderedPath:rt,bcx:h,bcy:S,barHeight:we,barWidth:ke,textRects:St,strokeWidth:De,dataLabelsX:nt,dataLabelsY:ot,dataLabelsConfig:Jt,barDataLabelsConfig:Ge,barTotalDataLabelsConfig:et,offX:We,offY:wt};return gt=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(gn):this.calculateColumnsDataLabelsPosition(gn),rt.attr({cy:gt.bcy,cx:gt.bcx,j:te,val:se.globals.series[q][te],barHeight:we,barWidth:ke}),Le=this.drawCalculatedDataLabels({x:gt.dataLabelsX,y:gt.dataLabelsY,val:this.barCtx.isRangeBar?[T,B]:se.config.chart.stackType==="100%"?xe[ue][te]:se.globals.series[ue][te],i:ue,j:te,barWidth:ke,barHeight:we,textRects:St,dataLabelsConfig:Jt}),se.config.chart.stacked&&et.enabled&&(_e=this.drawTotalDataLabels({x:gt.totalDataLabelsX,y:gt.totalDataLabelsY,barWidth:ke,barHeight:we,realIndex:ue,textAnchor:gt.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:ue,j:te}),dataLabelsConfig:Jt,barTotalDataLabelsConfig:et})),{dataLabels:Le,totalDataLabels:_e}}},{key:"getStackedTotalDataLabel",value:function(p){var h=p.realIndex,S=p.j,_=this.w,k=this.barCtx.stackedSeriesTotals[S];return this.totalFormatter&&(k=this.totalFormatter(k,v(v({},_),{},{seriesIndex:h,dataPointIndex:S,w:_}))),k}},{key:"calculateColumnsDataLabelsPosition",value:function(p){var h=this.w,S=p.i,_=p.j,k=p.realIndex;p.columnGroupIndex;var T,B,q=p.y,te=p.bcx,ue=p.barWidth,de=p.barHeight,xe=p.textRects,we=p.dataLabelsX,ke=p.dataLabelsY,Me=p.dataLabelsConfig,Ye=p.barDataLabelsConfig,Fe=p.barTotalDataLabelsConfig,rt=p.strokeWidth,se=p.offX,Ce=p.offY,De=te;de=Math.abs(de);var Le=h.config.plotOptions.bar.dataLabels.orientation==="vertical",_e=this.barCtx.barHelpers.getZeroValueEncounters({i:S,j:_}).zeroEncounters;te-=rt/2;var nt=h.globals.gridWidth/h.globals.dataPoints;this.barCtx.isVerticalGroupedRangeBar?we+=ue/2:(we=h.globals.isXNumeric?te-ue/2+se:te-nt+ue/2+se,_e>0&&h.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(we-=ue*_e)),Le&&(we=we+xe.height/2-rt/2-2);var ot=h.globals.series[S][_]<0,gt=q;switch(this.barCtx.isReversed&&(gt=q+(ot?de:-de)),Ye.position){case"center":ke=Le?ot?gt-de/2+Ce:gt+de/2-Ce:ot?gt-de/2+xe.height/2+Ce:gt+de/2+xe.height/2-Ce;break;case"bottom":ke=Le?ot?gt-de+Ce:gt+de-Ce:ot?gt-de+xe.height+rt+Ce:gt+de-xe.height/2+rt-Ce;break;case"top":ke=Le?ot?gt+Ce:gt-Ce:ot?gt-xe.height/2-Ce:gt+xe.height+Ce}if(this.barCtx.lastActiveBarSerieIndex===k&&Fe.enabled){var Jt=new z(this.barCtx.ctx).getTextRects(this.getStackedTotalDataLabel({realIndex:k,j:_}),Me.fontSize);T=ot?gt-Jt.height/2-Ce-Fe.offsetY+18:gt+Jt.height+Ce+Fe.offsetY-18;var Ge=nt;B=De+(h.globals.isXNumeric?-ue*h.globals.barGroups.length/2:h.globals.barGroups.length*ue/2-(h.globals.barGroups.length-1)*ue-Ge)+Fe.offsetX}return h.config.chart.stacked||(ke<0?ke=0+rt:ke+xe.height/3>h.globals.gridHeight&&(ke=h.globals.gridHeight-rt)),{bcx:te,bcy:q,dataLabelsX:we,dataLabelsY:ke,totalDataLabelsX:B,totalDataLabelsY:T,totalDataLabelsAnchor:"middle"}}},{key:"calculateBarsDataLabelsPosition",value:function(p){var h=this.w,S=p.x,_=p.i,k=p.j,T=p.realIndex,B=p.bcy,q=p.barHeight,te=p.barWidth,ue=p.textRects,de=p.dataLabelsX,xe=p.strokeWidth,we=p.dataLabelsConfig,ke=p.barDataLabelsConfig,Me=p.barTotalDataLabelsConfig,Ye=p.offX,Fe=p.offY,rt=h.globals.gridHeight/h.globals.dataPoints;te=Math.abs(te);var se,Ce,De=B-(this.barCtx.isRangeBar?0:rt)+q/2+ue.height/2+Fe-3,Le="start",_e=h.globals.series[_][k]<0,nt=S;switch(this.barCtx.isReversed&&(nt=S+(_e?-te:te),Le=_e?"start":"end"),ke.position){case"center":de=_e?nt+te/2-Ye:Math.max(ue.width/2,nt-te/2)+Ye;break;case"bottom":de=_e?nt+te-xe-Ye:nt-te+xe+Ye;break;case"top":de=_e?nt-xe-Ye:nt-xe+Ye}if(this.barCtx.lastActiveBarSerieIndex===T&&Me.enabled){var ot=new z(this.barCtx.ctx).getTextRects(this.getStackedTotalDataLabel({realIndex:T,j:k}),we.fontSize);_e?(se=nt-xe-Ye-Me.offsetX,Le="end"):se=nt+Ye+Me.offsetX+(this.barCtx.isReversed?-(te+xe):xe),Ce=De-ue.height/2+ot.height/2+Me.offsetY+xe}return h.config.chart.stacked||(we.textAnchor==="start"?de-ue.width<0?de=_e?ue.width+xe:xe:de+ue.width>h.globals.gridWidth&&(de=_e?h.globals.gridWidth-xe:h.globals.gridWidth-ue.width-xe):we.textAnchor==="middle"?de-ue.width/2<0?de=ue.width/2+xe:de+ue.width/2>h.globals.gridWidth&&(de=h.globals.gridWidth-ue.width/2-xe):we.textAnchor==="end"&&(de<1?de=ue.width+xe:de+1>h.globals.gridWidth&&(de=h.globals.gridWidth-ue.width-xe))),{bcx:S,bcy:B,dataLabelsX:de,dataLabelsY:De,totalDataLabelsX:se,totalDataLabelsY:Ce,totalDataLabelsAnchor:Le}}},{key:"drawCalculatedDataLabels",value:function(p){var h=p.x,S=p.y,_=p.val,k=p.i,T=p.j,B=p.textRects,q=p.barHeight,te=p.barWidth,ue=p.dataLabelsConfig,de=this.w,xe="rotate(0)";de.config.plotOptions.bar.dataLabels.orientation==="vertical"&&(xe="rotate(-90, ".concat(h,", ").concat(S,")"));var we=new Ie(this.barCtx.ctx),ke=new z(this.barCtx.ctx),Me=ue.formatter,Ye=null,Fe=de.globals.collapsedSeriesIndices.indexOf(k)>-1;if(ue.enabled&&!Fe){Ye=ke.group({class:"apexcharts-data-labels",transform:xe});var rt="";_!==void 0&&(rt=Me(_,v(v({},de),{},{seriesIndex:k,dataPointIndex:T,w:de}))),!_&&de.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(rt="");var se=de.globals.series[k][T]<0,Ce=de.config.plotOptions.bar.dataLabels.position;de.config.plotOptions.bar.dataLabels.orientation==="vertical"&&(Ce==="top"&&(ue.textAnchor=se?"end":"start"),Ce==="center"&&(ue.textAnchor="middle"),Ce==="bottom"&&(ue.textAnchor=se?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&te<ke.getTextRects(rt,parseFloat(ue.style.fontSize)).width&&(rt=""),de.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&(this.barCtx.isHorizontal?B.width/1.6>Math.abs(te)&&(rt=""):B.height/1.6>Math.abs(q)&&(rt=""));var De=v({},ue);this.barCtx.isHorizontal&&_<0&&(ue.textAnchor==="start"?De.textAnchor="end":ue.textAnchor==="end"&&(De.textAnchor="start")),we.plotDataLabelsText({x:h,y:S,text:rt,i:k,j:T,parent:Ye,dataLabelsConfig:De,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return Ye}},{key:"drawTotalDataLabels",value:function(p){var h=p.x,S=p.y,_=p.val,k=p.realIndex,T=p.textAnchor,B=p.barTotalDataLabelsConfig;this.w;var q,te=new z(this.barCtx.ctx);return B.enabled&&h!==void 0&&S!==void 0&&this.barCtx.lastActiveBarSerieIndex===k&&(q=te.drawText({x:h,y:S,foreColor:B.style.color,text:_,textAnchor:T,fontFamily:B.style.fontFamily,fontSize:B.style.fontSize,fontWeight:B.style.fontWeight})),q}}]),Ee}(),xn=function(){function Ee(p){s(this,Ee),this.w=p.w,this.barCtx=p}return o(Ee,[{key:"initVariables",value:function(p){var h=this.w;this.barCtx.series=p,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(var S=0;S<p.length;S++)if(p[S].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=p[S].length),h.globals.isXNumeric)for(var _=0;_<p[S].length;_++)h.globals.seriesX[S][_]>h.globals.minX&&h.globals.seriesX[S][_]<h.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=h.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(h.globals.series),this.barCtx.seriesLen===0&&(this.barCtx.seriesLen=1),this.barCtx.zeroSerieses=[],h.globals.comboCharts||this.checkZeroSeries({series:p})}},{key:"initialPositions",value:function(){var p,h,S,_,k,T,B,q,te=this.w,ue=te.globals.dataPoints;this.barCtx.isRangeBar&&(ue=te.globals.labels.length);var de=this.barCtx.seriesLen;if(te.config.plotOptions.bar.rangeBarGroupRows&&(de=1),this.barCtx.isHorizontal)k=(S=te.globals.gridHeight/ue)/de,te.globals.isXNumeric&&(k=(S=te.globals.gridHeight/this.barCtx.totalItems)/this.barCtx.seriesLen),k=k*parseInt(this.barCtx.barOptions.barHeight,10)/100,String(this.barCtx.barOptions.barHeight).indexOf("%")===-1&&(k=parseInt(this.barCtx.barOptions.barHeight,10)),q=this.barCtx.baseLineInvertedY+te.globals.padHorizontal+(this.barCtx.isReversed?te.globals.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),this.barCtx.isFunnel&&(q=te.globals.gridWidth/2),h=(S-k*this.barCtx.seriesLen)/2;else{if(_=te.globals.gridWidth/this.barCtx.visibleItems,te.config.xaxis.convertedCatToNumeric&&(_=te.globals.gridWidth/te.globals.dataPoints),T=_/de*parseInt(this.barCtx.barOptions.columnWidth,10)/100,te.globals.isXNumeric){var xe=this.barCtx.xRatio;te.globals.minXDiff&&te.globals.minXDiff!==.5&&te.globals.minXDiff/xe>0&&(_=te.globals.minXDiff/xe),(T=_/de*parseInt(this.barCtx.barOptions.columnWidth,10)/100)<1&&(T=1)}String(this.barCtx.barOptions.columnWidth).indexOf("%")===-1&&(T=parseInt(this.barCtx.barOptions.columnWidth,10)),B=te.globals.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?te.globals.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),p=te.globals.padHorizontal+(_-T*this.barCtx.seriesLen)/2}return te.globals.barHeight=k,te.globals.barWidth=T,{x:p,y:h,yDivision:S,xDivision:_,barHeight:k,barWidth:T,zeroH:B,zeroW:q}}},{key:"initializeStackedPrevVars",value:function(p){p.w.globals.seriesGroups.forEach(function(h){p[h]||(p[h]={}),p[h].prevY=[],p[h].prevX=[],p[h].prevYF=[],p[h].prevXF=[],p[h].prevYVal=[],p[h].prevXVal=[]})}},{key:"initializeStackedXYVars",value:function(p){p.w.globals.seriesGroups.forEach(function(h){p[h]||(p[h]={}),p[h].xArrj=[],p[h].xArrjF=[],p[h].xArrjVal=[],p[h].yArrj=[],p[h].yArrjF=[],p[h].yArrjVal=[]})}},{key:"getPathFillColor",value:function(p,h,S,_){var k,T,B,q,te,ue=this.w,de=this.barCtx.ctx.fill,xe=null,we=this.barCtx.barOptions.distributed?S:h;return this.barCtx.barOptions.colors.ranges.length>0&&this.barCtx.barOptions.colors.ranges.map(function(ke){p[h][S]>=ke.from&&p[h][S]<=ke.to&&(xe=ke.color)}),(k=ue.config.series[h].data[S])!==null&&k!==void 0&&k.fillColor&&(xe=ue.config.series[h].data[S].fillColor),de.fillPath({seriesNumber:this.barCtx.barOptions.distributed?we:_,dataPointIndex:S,color:xe,value:p[h][S],fillConfig:(T=ue.config.series[h].data[S])===null||T===void 0?void 0:T.fill,fillType:(B=ue.config.series[h].data[S])!==null&&B!==void 0&&(q=B.fill)!==null&&q!==void 0&&q.type?(te=ue.config.series[h].data[S])===null||te===void 0?void 0:te.fill.type:Array.isArray(ue.config.fill.type)?ue.config.fill.type[_]:ue.config.fill.type})}},{key:"getStrokeWidth",value:function(p,h,S){var _=0,k=this.w;return this.barCtx.series[p][h]?this.barCtx.isNullValue=!1:this.barCtx.isNullValue=!0,k.config.stroke.show&&(this.barCtx.isNullValue||(_=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[S]:this.barCtx.strokeWidth)),_}},{key:"createBorderRadiusArr",value:function(p){var h=this.w,S=!this.w.config.chart.stacked||h.config.plotOptions.bar.borderRadiusWhenStacked!=="last"||h.config.plotOptions.bar.borderRadius<=0,_=p.length,k=p[0].length,T=Array.from({length:_},function(){return Array(k).fill(S?"top":"none")});if(S)return T;for(var B=0;B<k;B++){for(var q=[],te=[],ue=0,de=0;de<_;de++){var xe=p[de][B];xe>0?(q.push(de),ue++):xe<0&&(te.push(de),ue++)}if(q.length>0&&te.length===0)if(q.length===1)T[q[0]][B]="both";else{var we,ke=q[0],Me=q[q.length-1],Ye=l(q);try{for(Ye.s();!(we=Ye.n()).done;){var Fe=we.value;T[Fe][B]=Fe===ke?"bottom":Fe===Me?"top":"none"}}catch(wt){Ye.e(wt)}finally{Ye.f()}}else if(te.length>0&&q.length===0)if(te.length===1)T[te[0]][B]="both";else{var rt,se=te[0],Ce=te[te.length-1],De=l(te);try{for(De.s();!(rt=De.n()).done;){var Le=rt.value;T[Le][B]=Le===se?"bottom":Le===Ce?"top":"none"}}catch(wt){De.e(wt)}finally{De.f()}}else if(q.length>0&&te.length>0){var _e,nt=q[q.length-1],ot=l(q);try{for(ot.s();!(_e=ot.n()).done;){var gt=_e.value;T[gt][B]=gt===nt?"top":"none"}}catch(wt){ot.e(wt)}finally{ot.f()}var Jt,Ge=te[te.length-1],et=l(te);try{for(et.s();!(Jt=et.n()).done;){var We=Jt.value;T[We][B]=We===Ge?"bottom":"none"}}catch(wt){et.e(wt)}finally{et.f()}}else ue===1&&(T[q[0]||te[0]][B]="both")}return T}},{key:"barBackground",value:function(p){var h=p.j,S=p.i,_=p.x1,k=p.x2,T=p.y1,B=p.y2,q=p.elSeries,te=this.w,ue=new z(this.barCtx.ctx),de=new Re(this.barCtx.ctx).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&de===S){h>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(h%=this.barCtx.barOptions.colors.backgroundBarColors.length);var xe=this.barCtx.barOptions.colors.backgroundBarColors[h],we=ue.drawRect(_!==void 0?_:0,T!==void 0?T:0,k!==void 0?k:te.globals.gridWidth,B!==void 0?B:te.globals.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,xe,this.barCtx.barOptions.colors.backgroundBarOpacity);q.add(we),we.node.classList.add("apexcharts-backgroundBar")}}},{key:"getColumnPaths",value:function(p){var h,S=p.barWidth,_=p.barXPosition,k=p.y1,T=p.y2,B=p.strokeWidth,q=p.isReversed,te=p.series,ue=p.seriesGroup,de=p.realIndex,xe=p.i,we=p.j,ke=p.w,Me=new z(this.barCtx.ctx);(B=Array.isArray(B)?B[de]:B)||(B=0);var Ye=S,Fe=_;(h=ke.config.series[de].data[we])!==null&&h!==void 0&&h.columnWidthOffset&&(Fe=_-ke.config.series[de].data[we].columnWidthOffset/2,Ye=S+ke.config.series[de].data[we].columnWidthOffset);var rt=B/2,se=Fe+rt,Ce=Fe+Ye-rt,De=(te[xe][we]>=0?1:-1)*(q?-1:1);k+=.001-rt*De,T+=.001+rt*De;var Le=Me.move(se,k),_e=Me.move(se,k),nt=Me.line(Ce,k);if(ke.globals.previousPaths.length>0&&(_e=this.barCtx.getPreviousPath(de,we,!1)),Le=Le+Me.line(se,T)+Me.line(Ce,T)+nt+(ke.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[de][we]==="both"?" Z":" z"),_e=_e+Me.line(se,k)+nt+nt+nt+nt+nt+Me.line(se,k)+(ke.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[de][we]==="both"?" Z":" z"),this.arrBorderRadius[de][we]!=="none"&&(Le=Me.roundPathCorners(Le,ke.config.plotOptions.bar.borderRadius)),ke.config.chart.stacked){var ot=this.barCtx;(ot=this.barCtx[ue]).yArrj.push(T-rt*De),ot.yArrjF.push(Math.abs(k-T+B*De)),ot.yArrjVal.push(this.barCtx.series[xe][we])}return{pathTo:Le,pathFrom:_e}}},{key:"getBarpaths",value:function(p){var h,S=p.barYPosition,_=p.barHeight,k=p.x1,T=p.x2,B=p.strokeWidth,q=p.isReversed,te=p.series,ue=p.seriesGroup,de=p.realIndex,xe=p.i,we=p.j,ke=p.w,Me=new z(this.barCtx.ctx);(B=Array.isArray(B)?B[de]:B)||(B=0);var Ye=S,Fe=_;(h=ke.config.series[de].data[we])!==null&&h!==void 0&&h.barHeightOffset&&(Ye=S-ke.config.series[de].data[we].barHeightOffset/2,Fe=_+ke.config.series[de].data[we].barHeightOffset);var rt=B/2,se=Ye+rt,Ce=Ye+Fe-rt,De=(te[xe][we]>=0?1:-1)*(q?-1:1);k+=.001+rt*De,T+=.001-rt*De;var Le=Me.move(k,se),_e=Me.move(k,se);ke.globals.previousPaths.length>0&&(_e=this.barCtx.getPreviousPath(de,we,!1));var nt=Me.line(k,Ce);if(Le=Le+Me.line(T,se)+Me.line(T,Ce)+nt+(ke.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[de][we]==="both"?" Z":" z"),_e=_e+Me.line(k,se)+nt+nt+nt+nt+nt+Me.line(k,se)+(ke.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[de][we]==="both"?" Z":" z"),this.arrBorderRadius[de][we]!=="none"&&(Le=Me.roundPathCorners(Le,ke.config.plotOptions.bar.borderRadius)),ke.config.chart.stacked){var ot=this.barCtx;(ot=this.barCtx[ue]).xArrj.push(T+rt*De),ot.xArrjF.push(Math.abs(k-T-B*De)),ot.xArrjVal.push(this.barCtx.series[xe][we])}return{pathTo:Le,pathFrom:_e}}},{key:"checkZeroSeries",value:function(p){for(var h=p.series,S=this.w,_=0;_<h.length;_++){for(var k=0,T=0;T<h[S.globals.maxValsInArrayIndex].length;T++)k+=h[_][T];k===0&&this.barCtx.zeroSerieses.push(_)}}},{key:"getXForValue",value:function(p,h){var S=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2]?h:null;return p!=null&&(S=h+p/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?p/this.barCtx.invertedYRatio:0)),S}},{key:"getYForValue",value:function(p,h,S){var _=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3]?h:null;return p!=null&&(_=h-p/this.barCtx.yRatio[S]+2*(this.barCtx.isReversed?p/this.barCtx.yRatio[S]:0)),_}},{key:"getGoalValues",value:function(p,h,S,_,k,T){var B=this,q=this.w,te=[],ue=function(we,ke){var Me;te.push((u(Me={},p,p==="x"?B.getXForValue(we,h,!1):B.getYForValue(we,S,T,!1)),u(Me,"attrs",ke),Me))};if(q.globals.seriesGoals[_]&&q.globals.seriesGoals[_][k]&&Array.isArray(q.globals.seriesGoals[_][k])&&q.globals.seriesGoals[_][k].forEach(function(we){ue(we.value,we)}),this.barCtx.barOptions.isDumbbell&&q.globals.seriesRange.length){var de=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:q.globals.colors,xe={strokeHeight:p==="x"?0:q.globals.markers.size[_],strokeWidth:p==="x"?q.globals.markers.size[_]:0,strokeDashArray:0,strokeLineCap:"round",strokeColor:Array.isArray(de[_])?de[_][0]:de[_]};ue(q.globals.seriesRangeStart[_][k],xe),ue(q.globals.seriesRangeEnd[_][k],v(v({},xe),{},{strokeColor:Array.isArray(de[_])?de[_][1]:de[_]}))}return te}},{key:"drawGoalLine",value:function(p){var h=p.barXPosition,S=p.barYPosition,_=p.goalX,k=p.goalY,T=p.barWidth,B=p.barHeight,q=new z(this.barCtx.ctx),te=q.group({className:"apexcharts-bar-goals-groups"});te.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:te.node}),te.attr("clip-path","url(#gridRectMarkerMask".concat(this.barCtx.w.globals.cuid,")"));var ue=null;return this.barCtx.isHorizontal?Array.isArray(_)&&_.forEach(function(de){if(de.x>=-1&&de.x<=q.w.globals.gridWidth+1){var xe=de.attrs.strokeHeight!==void 0?de.attrs.strokeHeight:B/2,we=S+xe+B/2;ue=q.drawLine(de.x,we-2*xe,de.x,we,de.attrs.strokeColor?de.attrs.strokeColor:void 0,de.attrs.strokeDashArray,de.attrs.strokeWidth?de.attrs.strokeWidth:2,de.attrs.strokeLineCap),te.add(ue)}}):Array.isArray(k)&&k.forEach(function(de){if(de.y>=-1&&de.y<=q.w.globals.gridHeight+1){var xe=de.attrs.strokeWidth!==void 0?de.attrs.strokeWidth:T/2,we=h+xe+T/2;ue=q.drawLine(we-2*xe,de.y,we,de.y,de.attrs.strokeColor?de.attrs.strokeColor:void 0,de.attrs.strokeDashArray,de.attrs.strokeHeight?de.attrs.strokeHeight:2,de.attrs.strokeLineCap),te.add(ue)}}),te}},{key:"drawBarShadow",value:function(p){var h=p.prevPaths,S=p.currPaths,_=p.color,k=this.w,T=h.x,B=h.x1,q=h.barYPosition,te=S.x,ue=S.x1,de=S.barYPosition,xe=q+S.barHeight,we=new z(this.barCtx.ctx),ke=new F,Me=we.move(B,xe)+we.line(T,xe)+we.line(te,de)+we.line(ue,de)+we.line(B,xe)+(k.config.plotOptions.bar.borderRadiusApplication==="around"||this.arrBorderRadius[realIndex][j]==="both"?" Z":" z");return we.drawPath({d:Me,fill:ke.shadeColor(.5,F.rgb2hex(_)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadows"})}},{key:"getZeroValueEncounters",value:function(p){var h,S=p.i,_=p.j,k=this.w,T=0,B=0;return(k.config.plotOptions.bar.horizontal?k.globals.series.map(function(q,te){return te}):((h=k.globals.columnSeries)===null||h===void 0?void 0:h.i.map(function(q){return q}))||[]).forEach(function(q){var te=k.globals.seriesPercent[q][_];te&&T++,q<S&&te===0&&B++}),{nonZeroColumns:T,zeroEncounters:B}}},{key:"getGroupIndex",value:function(p){var h=this.w,S=h.globals.seriesGroups.findIndex(function(T){return T.indexOf(h.globals.seriesNames[p])>-1}),_=this.barCtx.columnGroupIndices,k=_.indexOf(S);return k<0&&(_.push(S),k=_.length-1),{groupIndex:S,columnGroupIndex:k}}}]),Ee}(),dn=function(){function Ee(p,h){s(this,Ee),this.ctx=p,this.w=p.w;var S=this.w;this.barOptions=S.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=S.config.stroke.width,this.isNullValue=!1,this.isRangeBar=S.globals.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!S.globals.isBarHorizontal&&S.globals.seriesRange.length&&S.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.xyRatios=h,this.xyRatios!==null&&(this.xRatio=h.xRatio,this.yRatio=h.yRatio,this.invertedXRatio=h.invertedXRatio,this.invertedYRatio=h.invertedYRatio,this.baseLineY=h.baseLineY,this.baseLineInvertedY=h.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[];var _=new Re(this.ctx);this.lastActiveBarSerieIndex=_.getActiveConfigSeriesIndex("desc",["bar","column"]),this.columnGroupIndices=[];var k=_.getBarSeriesIndices(),T=new X(this.ctx);this.stackedSeriesTotals=T.getStackedSeriesTotals(this.w.config.series.map(function(B,q){return k.indexOf(q)===-1?q:-1}).filter(function(B){return B!==-1})),this.barHelpers=new xn(this)}return o(Ee,[{key:"draw",value:function(p,h){var S=this.w,_=new z(this.ctx),k=new X(this.ctx,S);p=k.getLogSeries(p),this.series=p,this.yRatio=k.getLogYRatios(this.yRatio),this.barHelpers.initVariables(p);var T=_.group({class:"apexcharts-bar-series apexcharts-plot-series"});S.config.dataLabels.enabled&&this.totalItems>this.barOptions.dataLabels.maxItems&&console.warn("WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering - ApexCharts");for(var B=0,q=0;B<p.length;B++,q++){var te,ue,de,xe,we=void 0,ke=void 0,Me=[],Ye=[],Fe=S.globals.comboCharts?h[B]:B,rt=this.barHelpers.getGroupIndex(Fe).columnGroupIndex,se=_.group({class:"apexcharts-series",rel:B+1,seriesName:F.escapeString(S.globals.seriesNames[Fe]),"data:realIndex":Fe});this.ctx.series.addCollapsedClassToSeries(se,Fe),p[B].length>0&&(this.visibleI=this.visibleI+1);var Ce=0,De=0;this.yRatio.length>1&&(this.yaxisIndex=S.globals.seriesYAxisReverseMap[Fe],this.translationsIndex=Fe);var Le=this.translationsIndex;this.isReversed=S.config.yaxis[this.yaxisIndex]&&S.config.yaxis[this.yaxisIndex].reversed;var _e=this.barHelpers.initialPositions();ke=_e.y,Ce=_e.barHeight,ue=_e.yDivision,xe=_e.zeroW,we=_e.x,De=_e.barWidth,te=_e.xDivision,de=_e.zeroH,this.horizontal||Ye.push(we+De/2);var nt=_.group({class:"apexcharts-datalabels","data:realIndex":Fe});S.globals.delayedElements.push({el:nt.node}),nt.node.classList.add("apexcharts-element-hidden");var ot=_.group({class:"apexcharts-bar-goals-markers"}),gt=_.group({class:"apexcharts-bar-shadows"});S.globals.delayedElements.push({el:gt.node}),gt.node.classList.add("apexcharts-element-hidden");for(var Jt=0;Jt<p[B].length;Jt++){var Ge=this.barHelpers.getStrokeWidth(B,Jt,Fe),et=null,We={indexes:{i:B,j:Jt,realIndex:Fe,translationsIndex:Le,bc:q},x:we,y:ke,strokeWidth:Ge,elSeries:se};this.isHorizontal?(et=this.drawBarPaths(v(v({},We),{},{barHeight:Ce,zeroW:xe,yDivision:ue})),De=this.series[B][Jt]/this.invertedYRatio):(et=this.drawColumnPaths(v(v({},We),{},{xDivision:te,barWidth:De,zeroH:de})),Ce=this.series[B][Jt]/this.yRatio[Le]);var wt=this.barHelpers.getPathFillColor(p,B,Jt,Fe);if(this.isFunnel&&this.barOptions.isFunnel3d&&this.pathArr.length&&Jt>0){var St=this.barHelpers.drawBarShadow({color:typeof wt=="string"&&(wt==null?void 0:wt.indexOf("url"))===-1?wt:F.hexToRgba(S.globals.colors[B]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:et});St&&gt.add(St)}this.pathArr.push(et);var Kt=this.barHelpers.drawGoalLine({barXPosition:et.barXPosition,barYPosition:et.barYPosition,goalX:et.goalX,goalY:et.goalY,barHeight:Ce,barWidth:De});Kt&&ot.add(Kt),ke=et.y,we=et.x,Jt>0&&Ye.push(we+De/2),Me.push(ke),this.renderSeries({realIndex:Fe,pathFill:wt,j:Jt,i:B,columnGroupIndex:rt,pathFrom:et.pathFrom,pathTo:et.pathTo,strokeWidth:Ge,elSeries:se,x:we,y:ke,series:p,barHeight:Math.abs(et.barHeight?et.barHeight:Ce),barWidth:Math.abs(et.barWidth?et.barWidth:De),elDataLabelsWrap:nt,elGoalsMarkers:ot,elBarShadows:gt,visibleSeries:this.visibleI,type:"bar"})}S.globals.seriesXvalues[Fe]=Ye,S.globals.seriesYvalues[Fe]=Me,T.add(se)}return T}},{key:"renderSeries",value:function(p){var h=p.realIndex,S=p.pathFill,_=p.lineFill,k=p.j,T=p.i,B=p.columnGroupIndex,q=p.pathFrom,te=p.pathTo,ue=p.strokeWidth,de=p.elSeries,xe=p.x,we=p.y,ke=p.y1,Me=p.y2,Ye=p.series,Fe=p.barHeight,rt=p.barWidth,se=p.barXPosition,Ce=p.barYPosition,De=p.elDataLabelsWrap,Le=p.elGoalsMarkers,_e=p.elBarShadows,nt=p.visibleSeries,ot=p.type,gt=p.classes,Jt=this.w,Ge=new z(this.ctx);if(!_){var et=typeof Jt.globals.stroke.colors[h]=="function"?function(gn){var yn,hn=Jt.config.stroke.colors;return Array.isArray(hn)&&hn.length>0&&((yn=hn[gn])||(yn=""),typeof yn=="function")?yn({value:Jt.globals.series[gn][k],dataPointIndex:k,w:Jt}):yn}(h):Jt.globals.stroke.colors[h];_=this.barOptions.distributed?Jt.globals.stroke.colors[k]:et}Jt.config.series[T].data[k]&&Jt.config.series[T].data[k].strokeColor&&(_=Jt.config.series[T].data[k].strokeColor),this.isNullValue&&(S="none");var We=k/Jt.config.chart.animations.animateGradually.delay*(Jt.config.chart.animations.speed/Jt.globals.dataPoints)/2.4,wt=Ge.renderPaths({i:T,j:k,realIndex:h,pathFrom:q,pathTo:te,stroke:_,strokeWidth:ue,strokeLineCap:Jt.config.stroke.lineCap,fill:S,animationDelay:We,initialSpeed:Jt.config.chart.animations.speed,dataChangeSpeed:Jt.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(ot,"-area ").concat(gt),chartType:ot});wt.attr("clip-path","url(#gridRectBarMask".concat(Jt.globals.cuid,")"));var St=Jt.config.forecastDataPoints;St.count>0&&k>=Jt.globals.dataPoints-St.count&&(wt.node.setAttribute("stroke-dasharray",St.dashArray),wt.node.setAttribute("stroke-width",St.strokeWidth),wt.node.setAttribute("fill-opacity",St.fillOpacity)),ke!==void 0&&Me!==void 0&&(wt.attr("data-range-y1",ke),wt.attr("data-range-y2",Me)),new L(this.ctx).setSelectionFilter(wt,h,k),de.add(wt);var Kt=new It(this).handleBarDataLabels({x:xe,y:we,y1:ke,y2:Me,i:T,j:k,series:Ye,realIndex:h,columnGroupIndex:B,barHeight:Fe,barWidth:rt,barXPosition:se,barYPosition:Ce,renderedPath:wt,visibleSeries:nt});return Kt.dataLabels!==null&&De.add(Kt.dataLabels),Kt.totalDataLabels&&De.add(Kt.totalDataLabels),de.add(De),Le&&de.add(Le),_e&&de.add(_e),de}},{key:"drawBarPaths",value:function(p){var h,S=p.indexes,_=p.barHeight,k=p.strokeWidth,T=p.zeroW,B=p.x,q=p.y,te=p.yDivision,ue=p.elSeries,de=this.w,xe=S.i,we=S.j;if(de.globals.isXNumeric)h=(q=(de.globals.seriesX[xe][we]-de.globals.minX)/this.invertedXRatio-_)+_*this.visibleI;else if(de.config.plotOptions.bar.hideZeroBarsWhenGrouped){var ke=0,Me=0;de.globals.seriesPercent.forEach(function(Fe,rt){Fe[we]&&ke++,rt<xe&&Fe[we]===0&&Me++}),ke>0&&(_=this.seriesLen*_/ke),h=q+_*this.visibleI,h-=_*Me}else h=q+_*this.visibleI;this.isFunnel&&(T-=(this.barHelpers.getXForValue(this.series[xe][we],T)-T)/2),B=this.barHelpers.getXForValue(this.series[xe][we],T);var Ye=this.barHelpers.getBarpaths({barYPosition:h,barHeight:_,x1:T,x2:B,strokeWidth:k,isReversed:this.isReversed,series:this.series,realIndex:S.realIndex,i:xe,j:we,w:de});return de.globals.isXNumeric||(q+=te),this.barHelpers.barBackground({j:we,i:xe,y1:h-_*this.visibleI,y2:_*this.seriesLen,elSeries:ue}),{pathTo:Ye.pathTo,pathFrom:Ye.pathFrom,x1:T,x:B,y:q,goalX:this.barHelpers.getGoalValues("x",T,null,xe,we),barYPosition:h,barHeight:_}}},{key:"drawColumnPaths",value:function(p){var h,S=p.indexes,_=p.x,k=p.y,T=p.xDivision,B=p.barWidth,q=p.zeroH,te=p.strokeWidth,ue=p.elSeries,de=this.w,xe=S.realIndex,we=S.translationsIndex,ke=S.i,Me=S.j,Ye=S.bc;if(de.globals.isXNumeric){var Fe=this.getBarXForNumericXAxis({x:_,j:Me,realIndex:xe,barWidth:B});_=Fe.x,h=Fe.barXPosition}else if(de.config.plotOptions.bar.hideZeroBarsWhenGrouped){var rt=this.barHelpers.getZeroValueEncounters({i:ke,j:Me}),se=rt.nonZeroColumns,Ce=rt.zeroEncounters;se>0&&(B=this.seriesLen*B/se),h=_+B*this.visibleI,h-=B*Ce}else h=_+B*this.visibleI;k=this.barHelpers.getYForValue(this.series[ke][Me],q,we);var De=this.barHelpers.getColumnPaths({barXPosition:h,barWidth:B,y1:q,y2:k,strokeWidth:te,isReversed:this.isReversed,series:this.series,realIndex:xe,i:ke,j:Me,w:de});return de.globals.isXNumeric||(_+=T),this.barHelpers.barBackground({bc:Ye,j:Me,i:ke,x1:h-te/2-B*this.visibleI,x2:B*this.seriesLen+te/2,elSeries:ue}),{pathTo:De.pathTo,pathFrom:De.pathFrom,x:_,y:k,goalY:this.barHelpers.getGoalValues("y",null,q,ke,Me,we),barXPosition:h,barWidth:B}}},{key:"getBarXForNumericXAxis",value:function(p){var h=p.x,S=p.barWidth,_=p.realIndex,k=p.j,T=this.w,B=_;return T.globals.seriesX[_].length||(B=T.globals.maxValsInArrayIndex),T.globals.seriesX[B][k]&&(h=(T.globals.seriesX[B][k]-T.globals.minX)/this.xRatio-S*this.seriesLen/2),{barXPosition:h+S*this.visibleI,x:h}}},{key:"getPreviousPath",value:function(p,h){for(var S,_=this.w,k=0;k<_.globals.previousPaths.length;k++){var T=_.globals.previousPaths[k];T.paths&&T.paths.length>0&&parseInt(T.realIndex,10)===parseInt(p,10)&&_.globals.previousPaths[k].paths[h]!==void 0&&(S=_.globals.previousPaths[k].paths[h].d)}return S}}]),Ee}(),Mn=function(Ee){f(h,dn);var p=c(h);function h(){return s(this,h),p.apply(this,arguments)}return o(h,[{key:"draw",value:function(S,_){var k=this,T=this.w;this.graphics=new z(this.ctx),this.bar=new dn(this.ctx,this.xyRatios);var B=new X(this.ctx,T);S=B.getLogSeries(S),this.yRatio=B.getLogYRatios(this.yRatio),this.barHelpers.initVariables(S),T.config.chart.stackType==="100%"&&(S=T.globals.comboCharts?_.map(function(ke){return T.globals.seriesPercent[ke]}):T.globals.seriesPercent.slice()),this.series=S,this.barHelpers.initializeStackedPrevVars(this);for(var q=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"}),te=0,ue=0,de=function(ke,Me){var Ye=void 0,Fe=void 0,rt=void 0,se=void 0,Ce=T.globals.comboCharts?_[ke]:ke,De=k.barHelpers.getGroupIndex(Ce),Le=De.groupIndex,_e=De.columnGroupIndex;k.groupCtx=k[T.globals.seriesGroups[Le]];var nt=[],ot=[],gt=0;k.yRatio.length>1&&(k.yaxisIndex=T.globals.seriesYAxisReverseMap[Ce][0],gt=Ce),k.isReversed=T.config.yaxis[k.yaxisIndex]&&T.config.yaxis[k.yaxisIndex].reversed;var Jt=k.graphics.group({class:"apexcharts-series",seriesName:F.escapeString(T.globals.seriesNames[Ce]),rel:ke+1,"data:realIndex":Ce});k.ctx.series.addCollapsedClassToSeries(Jt,Ce);var Ge=k.graphics.group({class:"apexcharts-datalabels","data:realIndex":Ce}),et=k.graphics.group({class:"apexcharts-bar-goals-markers"}),We=0,wt=0,St=k.initialPositions(te,ue,Ye,Fe,rt,se,gt);ue=St.y,We=St.barHeight,Fe=St.yDivision,se=St.zeroW,te=St.x,wt=St.barWidth,Ye=St.xDivision,rt=St.zeroH,T.globals.barHeight=We,T.globals.barWidth=wt,k.barHelpers.initializeStackedXYVars(k),k.groupCtx.prevY.length===1&&k.groupCtx.prevY[0].every(function(Zt){return isNaN(Zt)})&&(k.groupCtx.prevY[0]=k.groupCtx.prevY[0].map(function(){return rt}),k.groupCtx.prevYF[0]=k.groupCtx.prevYF[0].map(function(){return 0}));for(var Kt=0;Kt<T.globals.dataPoints;Kt++){var gn=k.barHelpers.getStrokeWidth(ke,Kt,Ce),yn={indexes:{i:ke,j:Kt,realIndex:Ce,translationsIndex:gt,bc:Me},strokeWidth:gn,x:te,y:ue,elSeries:Jt,columnGroupIndex:_e,seriesGroup:T.globals.seriesGroups[Le]},hn=null;k.isHorizontal?(hn=k.drawStackedBarPaths(v(v({},yn),{},{zeroW:se,barHeight:We,yDivision:Fe})),wt=k.series[ke][Kt]/k.invertedYRatio):(hn=k.drawStackedColumnPaths(v(v({},yn),{},{xDivision:Ye,barWidth:wt,zeroH:rt})),We=k.series[ke][Kt]/k.yRatio[gt]);var br=k.barHelpers.drawGoalLine({barXPosition:hn.barXPosition,barYPosition:hn.barYPosition,goalX:hn.goalX,goalY:hn.goalY,barHeight:We,barWidth:wt});br&&et.add(br),ue=hn.y,te=hn.x,nt.push(te),ot.push(ue);var pt=k.barHelpers.getPathFillColor(S,ke,Kt,Ce),Wt="";T.globals.isBarHorizontal?k.barHelpers.arrBorderRadius[Ce][Kt]==="bottom"&&T.globals.series[Ce][Kt]>0&&(Wt="apexcharts-flip-x"):k.barHelpers.arrBorderRadius[Ce][Kt]==="bottom"&&T.globals.series[Ce][Kt]>0&&(Wt="apexcharts-flip-y"),Jt=k.renderSeries({realIndex:Ce,pathFill:pt,j:Kt,i:ke,columnGroupIndex:_e,pathFrom:hn.pathFrom,pathTo:hn.pathTo,strokeWidth:gn,elSeries:Jt,x:te,y:ue,series:S,barHeight:We,barWidth:wt,elDataLabelsWrap:Ge,elGoalsMarkers:et,type:"bar",visibleSeries:_e,classes:Wt})}T.globals.seriesXvalues[Ce]=nt,T.globals.seriesYvalues[Ce]=ot,k.groupCtx.prevY.push(k.groupCtx.yArrj),k.groupCtx.prevYF.push(k.groupCtx.yArrjF),k.groupCtx.prevYVal.push(k.groupCtx.yArrjVal),k.groupCtx.prevX.push(k.groupCtx.xArrj),k.groupCtx.prevXF.push(k.groupCtx.xArrjF),k.groupCtx.prevXVal.push(k.groupCtx.xArrjVal),q.add(Jt)},xe=0,we=0;xe<S.length;xe++,we++)de(xe,we);return q}},{key:"initialPositions",value:function(S,_,k,T,B,q,te){var ue,de,xe=this.w;if(this.isHorizontal){T=xe.globals.gridHeight/xe.globals.dataPoints;var we=xe.config.plotOptions.bar.barHeight;ue=String(we).indexOf("%")===-1?parseInt(we,10):T*parseInt(we,10)/100,q=xe.globals.padHorizontal+(this.isReversed?xe.globals.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),_=(T-ue)/2}else{de=k=xe.globals.gridWidth/xe.globals.dataPoints;var ke=xe.config.plotOptions.bar.columnWidth;xe.globals.isXNumeric&&xe.globals.dataPoints>1?de=(k=xe.globals.minXDiff/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:String(ke).indexOf("%")===-1?de=parseInt(ke,10):de*=parseInt(ke,10)/100,B=this.isReversed?this.baseLineY[te]:xe.globals.gridHeight-this.baseLineY[te],S=xe.globals.padHorizontal+(k-de)/2}var Me=xe.globals.barGroups.length||1;return{x:S,y:_,yDivision:T,xDivision:k,barHeight:ue/Me,barWidth:de/Me,zeroH:B,zeroW:q}}},{key:"drawStackedBarPaths",value:function(S){for(var _,k=S.indexes,T=S.barHeight,B=S.strokeWidth,q=S.zeroW,te=S.x,ue=S.y,de=S.columnGroupIndex,xe=S.seriesGroup,we=S.yDivision,ke=S.elSeries,Me=this.w,Ye=ue+de*T,Fe=k.i,rt=k.j,se=k.realIndex,Ce=k.translationsIndex,De=0,Le=0;Le<this.groupCtx.prevXF.length;Le++)De+=this.groupCtx.prevXF[Le][rt];var _e;if((_e=xe.indexOf(Me.config.series[se].name))>0){var nt=q;this.groupCtx.prevXVal[_e-1][rt]<0?nt=this.series[Fe][rt]>=0?this.groupCtx.prevX[_e-1][rt]+De-2*(this.isReversed?De:0):this.groupCtx.prevX[_e-1][rt]:this.groupCtx.prevXVal[_e-1][rt]>=0&&(nt=this.series[Fe][rt]>=0?this.groupCtx.prevX[_e-1][rt]:this.groupCtx.prevX[_e-1][rt]-De+2*(this.isReversed?De:0)),_=nt}else _=q;te=this.series[Fe][rt]===null?_:_+this.series[Fe][rt]/this.invertedYRatio-2*(this.isReversed?this.series[Fe][rt]/this.invertedYRatio:0);var ot=this.barHelpers.getBarpaths({barYPosition:Ye,barHeight:T,x1:_,x2:te,strokeWidth:B,isReversed:this.isReversed,series:this.series,realIndex:k.realIndex,seriesGroup:xe,i:Fe,j:rt,w:Me});return this.barHelpers.barBackground({j:rt,i:Fe,y1:Ye,y2:T,elSeries:ke}),ue+=we,{pathTo:ot.pathTo,pathFrom:ot.pathFrom,goalX:this.barHelpers.getGoalValues("x",q,null,Fe,rt,Ce),barXPosition:_,barYPosition:Ye,x:te,y:ue}}},{key:"drawStackedColumnPaths",value:function(S){var _=S.indexes,k=S.x,T=S.y,B=S.xDivision,q=S.barWidth,te=S.zeroH,ue=S.columnGroupIndex,de=S.seriesGroup,xe=S.elSeries,we=this.w,ke=_.i,Me=_.j,Ye=_.bc,Fe=_.realIndex,rt=_.translationsIndex;if(we.globals.isXNumeric){var se=we.globals.seriesX[Fe][Me];se||(se=0),k=(se-we.globals.minX)/this.xRatio-q/2*we.globals.barGroups.length}for(var Ce,De=k+ue*q,Le=0,_e=0;_e<this.groupCtx.prevYF.length;_e++)Le+=isNaN(this.groupCtx.prevYF[_e][Me])?0:this.groupCtx.prevYF[_e][Me];var nt=ke;if(de&&(nt=de.indexOf(we.globals.seriesNames[Fe])),nt>0&&!we.globals.isXNumeric||nt>0&&we.globals.isXNumeric&&we.globals.seriesX[Fe-1][Me]===we.globals.seriesX[Fe][Me]){var ot,gt,Jt,Ge=Math.min(this.yRatio.length+1,Fe+1);if(this.groupCtx.prevY[nt-1]!==void 0&&this.groupCtx.prevY[nt-1].length)for(var et=1;et<Ge;et++){var We;if(!isNaN((We=this.groupCtx.prevY[nt-et])===null||We===void 0?void 0:We[Me])){Jt=this.groupCtx.prevY[nt-et][Me];break}}for(var wt=1;wt<Ge;wt++){var St,Kt;if(((St=this.groupCtx.prevYVal[nt-wt])===null||St===void 0?void 0:St[Me])<0){gt=this.series[ke][Me]>=0?Jt-Le+2*(this.isReversed?Le:0):Jt;break}if(((Kt=this.groupCtx.prevYVal[nt-wt])===null||Kt===void 0?void 0:Kt[Me])>=0){gt=this.series[ke][Me]>=0?Jt:Jt+Le-2*(this.isReversed?Le:0);break}}gt===void 0&&(gt=we.globals.gridHeight),Ce=(ot=this.groupCtx.prevYF[0])!==null&&ot!==void 0&&ot.every(function(yn){return yn===0})&&this.groupCtx.prevYF.slice(1,nt).every(function(yn){return yn.every(function(hn){return isNaN(hn)})})?te:gt}else Ce=te;T=this.series[ke][Me]?Ce-this.series[ke][Me]/this.yRatio[rt]+2*(this.isReversed?this.series[ke][Me]/this.yRatio[rt]:0):Ce;var gn=this.barHelpers.getColumnPaths({barXPosition:De,barWidth:q,y1:Ce,y2:T,yRatio:this.yRatio[rt],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,seriesGroup:de,realIndex:_.realIndex,i:ke,j:Me,w:we});return this.barHelpers.barBackground({bc:Ye,j:Me,i:ke,x1:De,x2:q,elSeries:xe}),{pathTo:gn.pathTo,pathFrom:gn.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,te,ke,Me),barXPosition:De,x:we.globals.isXNumeric?k:k+B,y:T}}}]),h}(),_n=function(Ee){f(h,dn);var p=c(h);function h(){return s(this,h),p.apply(this,arguments)}return o(h,[{key:"draw",value:function(S,_,k){var T=this,B=this.w,q=new z(this.ctx),te=B.globals.comboCharts?_:B.config.chart.type,ue=new Ne(this.ctx);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=B.config.plotOptions.bar.horizontal;var de=new X(this.ctx,B);S=de.getLogSeries(S),this.series=S,this.yRatio=de.getLogYRatios(this.yRatio),this.barHelpers.initVariables(S);for(var xe=q.group({class:"apexcharts-".concat(te,"-series apexcharts-plot-series")}),we=function(Me){T.isBoxPlot=B.config.chart.type==="boxPlot"||B.config.series[Me].type==="boxPlot";var Ye,Fe,rt,se,Ce=void 0,De=void 0,Le=[],_e=[],nt=B.globals.comboCharts?k[Me]:Me,ot=T.barHelpers.getGroupIndex(nt).columnGroupIndex,gt=q.group({class:"apexcharts-series",seriesName:F.escapeString(B.globals.seriesNames[nt]),rel:Me+1,"data:realIndex":nt});T.ctx.series.addCollapsedClassToSeries(gt,nt),S[Me].length>0&&(T.visibleI=T.visibleI+1);var Jt,Ge,et=0;T.yRatio.length>1&&(T.yaxisIndex=B.globals.seriesYAxisReverseMap[nt][0],et=nt);var We=T.barHelpers.initialPositions();De=We.y,Jt=We.barHeight,Fe=We.yDivision,se=We.zeroW,Ce=We.x,Ge=We.barWidth,Ye=We.xDivision,rt=We.zeroH,_e.push(Ce+Ge/2);for(var wt=q.group({class:"apexcharts-datalabels","data:realIndex":nt}),St=function(gn){var yn=T.barHelpers.getStrokeWidth(Me,gn,nt),hn=null,br={indexes:{i:Me,j:gn,realIndex:nt,translationsIndex:et},x:Ce,y:De,strokeWidth:yn,elSeries:gt};hn=T.isHorizontal?T.drawHorizontalBoxPaths(v(v({},br),{},{yDivision:Fe,barHeight:Jt,zeroW:se})):T.drawVerticalBoxPaths(v(v({},br),{},{xDivision:Ye,barWidth:Ge,zeroH:rt})),De=hn.y,Ce=hn.x,gn>0&&_e.push(Ce+Ge/2),Le.push(De),hn.pathTo.forEach(function(pt,Wt){var Zt=!T.isBoxPlot&&T.candlestickOptions.wick.useFillColor?hn.color[Wt]:B.globals.stroke.colors[Me],vt=ue.fillPath({seriesNumber:nt,dataPointIndex:gn,color:hn.color[Wt],value:S[Me][gn]});T.renderSeries({realIndex:nt,pathFill:vt,lineFill:Zt,j:gn,i:Me,pathFrom:hn.pathFrom,pathTo:pt,strokeWidth:yn,elSeries:gt,x:Ce,y:De,series:S,columnGroupIndex:ot,barHeight:Jt,barWidth:Ge,elDataLabelsWrap:wt,visibleSeries:T.visibleI,type:B.config.chart.type})})},Kt=0;Kt<B.globals.dataPoints;Kt++)St(Kt);B.globals.seriesXvalues[nt]=_e,B.globals.seriesYvalues[nt]=Le,xe.add(gt)},ke=0;ke<S.length;ke++)we(ke);return xe}},{key:"drawVerticalBoxPaths",value:function(S){var _=S.indexes,k=S.x;S.y;var T=S.xDivision,B=S.barWidth,q=S.zeroH,te=S.strokeWidth,ue=this.w,de=new z(this.ctx),xe=_.i,we=_.j,ke=!0,Me=ue.config.plotOptions.candlestick.colors.upward,Ye=ue.config.plotOptions.candlestick.colors.downward,Fe="";this.isBoxPlot&&(Fe=[this.boxOptions.colors.lower,this.boxOptions.colors.upper]);var rt=this.yRatio[_.translationsIndex],se=_.realIndex,Ce=this.getOHLCValue(se,we),De=q,Le=q;Ce.o>Ce.c&&(ke=!1);var _e=Math.min(Ce.o,Ce.c),nt=Math.max(Ce.o,Ce.c),ot=Ce.m;ue.globals.isXNumeric&&(k=(ue.globals.seriesX[se][we]-ue.globals.minX)/this.xRatio-B/2);var gt=k+B*this.visibleI;this.series[xe][we]===void 0||this.series[xe][we]===null?(_e=q,nt=q):(_e=q-_e/rt,nt=q-nt/rt,De=q-Ce.h/rt,Le=q-Ce.l/rt,ot=q-Ce.m/rt);var Jt=de.move(gt,q),Ge=de.move(gt+B/2,_e);return ue.globals.previousPaths.length>0&&(Ge=this.getPreviousPath(se,we,!0)),Jt=this.isBoxPlot?[de.move(gt,_e)+de.line(gt+B/2,_e)+de.line(gt+B/2,De)+de.line(gt+B/4,De)+de.line(gt+B-B/4,De)+de.line(gt+B/2,De)+de.line(gt+B/2,_e)+de.line(gt+B,_e)+de.line(gt+B,ot)+de.line(gt,ot)+de.line(gt,_e+te/2),de.move(gt,ot)+de.line(gt+B,ot)+de.line(gt+B,nt)+de.line(gt+B/2,nt)+de.line(gt+B/2,Le)+de.line(gt+B-B/4,Le)+de.line(gt+B/4,Le)+de.line(gt+B/2,Le)+de.line(gt+B/2,nt)+de.line(gt,nt)+de.line(gt,ot)+"z"]:[de.move(gt,nt)+de.line(gt+B/2,nt)+de.line(gt+B/2,De)+de.line(gt+B/2,nt)+de.line(gt+B,nt)+de.line(gt+B,_e)+de.line(gt+B/2,_e)+de.line(gt+B/2,Le)+de.line(gt+B/2,_e)+de.line(gt,_e)+de.line(gt,nt-te/2)],Ge+=de.move(gt,_e),ue.globals.isXNumeric||(k+=T),{pathTo:Jt,pathFrom:Ge,x:k,y:nt,barXPosition:gt,color:this.isBoxPlot?Fe:ke?[Me]:[Ye]}}},{key:"drawHorizontalBoxPaths",value:function(S){var _=S.indexes;S.x;var k=S.y,T=S.yDivision,B=S.barHeight,q=S.zeroW,te=S.strokeWidth,ue=this.w,de=new z(this.ctx),xe=_.i,we=_.j,ke=this.boxOptions.colors.lower;this.isBoxPlot&&(ke=[this.boxOptions.colors.lower,this.boxOptions.colors.upper]);var Me=this.invertedYRatio,Ye=_.realIndex,Fe=this.getOHLCValue(Ye,we),rt=q,se=q,Ce=Math.min(Fe.o,Fe.c),De=Math.max(Fe.o,Fe.c),Le=Fe.m;ue.globals.isXNumeric&&(k=(ue.globals.seriesX[Ye][we]-ue.globals.minX)/this.invertedXRatio-B/2);var _e=k+B*this.visibleI;this.series[xe][we]===void 0||this.series[xe][we]===null?(Ce=q,De=q):(Ce=q+Ce/Me,De=q+De/Me,rt=q+Fe.h/Me,se=q+Fe.l/Me,Le=q+Fe.m/Me);var nt=de.move(q,_e),ot=de.move(Ce,_e+B/2);return ue.globals.previousPaths.length>0&&(ot=this.getPreviousPath(Ye,we,!0)),nt=[de.move(Ce,_e)+de.line(Ce,_e+B/2)+de.line(rt,_e+B/2)+de.line(rt,_e+B/2-B/4)+de.line(rt,_e+B/2+B/4)+de.line(rt,_e+B/2)+de.line(Ce,_e+B/2)+de.line(Ce,_e+B)+de.line(Le,_e+B)+de.line(Le,_e)+de.line(Ce+te/2,_e),de.move(Le,_e)+de.line(Le,_e+B)+de.line(De,_e+B)+de.line(De,_e+B/2)+de.line(se,_e+B/2)+de.line(se,_e+B-B/4)+de.line(se,_e+B/4)+de.line(se,_e+B/2)+de.line(De,_e+B/2)+de.line(De,_e)+de.line(Le,_e)+"z"],ot+=de.move(Ce,_e),ue.globals.isXNumeric||(k+=T),{pathTo:nt,pathFrom:ot,x:De,y:k,barYPosition:_e,color:ke}}},{key:"getOHLCValue",value:function(S,_){var k=this.w;return{o:this.isBoxPlot?k.globals.seriesCandleH[S][_]:k.globals.seriesCandleO[S][_],h:this.isBoxPlot?k.globals.seriesCandleO[S][_]:k.globals.seriesCandleH[S][_],m:k.globals.seriesCandleM[S][_],l:this.isBoxPlot?k.globals.seriesCandleC[S][_]:k.globals.seriesCandleL[S][_],c:this.isBoxPlot?k.globals.seriesCandleL[S][_]:k.globals.seriesCandleC[S][_]}}}]),h}(),kn=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"checkColorRange",value:function(){var p=this.w,h=!1,S=p.config.plotOptions[p.config.chart.type];return S.colorScale.ranges.length>0&&S.colorScale.ranges.map(function(_,k){_.from<=0&&(h=!0)}),h}},{key:"getShadeColor",value:function(p,h,S,_){var k=this.w,T=1,B=k.config.plotOptions[p].shadeIntensity,q=this.determineColor(p,h,S);k.globals.hasNegs||_?T=k.config.plotOptions[p].reverseNegativeShade?q.percent<0?q.percent/100*(1.25*B):(1-q.percent/100)*(1.25*B):q.percent<=0?1-(1+q.percent/100)*B:(1-q.percent/100)*B:(T=1-q.percent/100,p==="treemap"&&(T=(1-q.percent/100)*(1.25*B)));var te=q.color,ue=new F;if(k.config.plotOptions[p].enableShades)if(this.w.config.theme.mode==="dark"){var de=ue.shadeColor(-1*T,q.color);te=F.hexToRgba(F.isColorHex(de)?de:F.rgb2hex(de),k.config.fill.opacity)}else{var xe=ue.shadeColor(T,q.color);te=F.hexToRgba(F.isColorHex(xe)?xe:F.rgb2hex(xe),k.config.fill.opacity)}return{color:te,colorProps:q}}},{key:"determineColor",value:function(p,h,S){var _=this.w,k=_.globals.series[h][S],T=_.config.plotOptions[p],B=T.colorScale.inverse?S:h;T.distributed&&_.config.chart.type==="treemap"&&(B=S);var q=_.globals.colors[B],te=null,ue=Math.min.apply(Math,N(_.globals.series[h])),de=Math.max.apply(Math,N(_.globals.series[h]));T.distributed||p!=="heatmap"||(ue=_.globals.minY,de=_.globals.maxY),T.colorScale.min!==void 0&&(ue=T.colorScale.min<_.globals.minY?T.colorScale.min:_.globals.minY,de=T.colorScale.max>_.globals.maxY?T.colorScale.max:_.globals.maxY);var xe=Math.abs(de)+Math.abs(ue),we=100*k/(xe===0?xe-1e-6:xe);return T.colorScale.ranges.length>0&&T.colorScale.ranges.map(function(ke,Me){if(k>=ke.from&&k<=ke.to){q=ke.color,te=ke.foreColor?ke.foreColor:null,ue=ke.from,de=ke.to;var Ye=Math.abs(de)+Math.abs(ue);we=100*k/(Ye===0?Ye-1e-6:Ye)}}),{color:q,foreColor:te,percent:we}}},{key:"calculateDataLabels",value:function(p){var h=p.text,S=p.x,_=p.y,k=p.i,T=p.j,B=p.colorProps,q=p.fontSize,te=this.w.config.dataLabels,ue=new z(this.ctx),de=new Ie(this.ctx),xe=null;if(te.enabled){xe=ue.group({class:"apexcharts-data-labels"});var we=te.offsetX,ke=te.offsetY,Me=S+we,Ye=_+parseFloat(te.style.fontSize)/3+ke;de.plotDataLabelsText({x:Me,y:Ye,text:h,i:k,j:T,color:B.foreColor,parent:xe,fontSize:q,dataLabelsConfig:te})}return xe}},{key:"addListeners",value:function(p){var h=new z(this.ctx);p.node.addEventListener("mouseenter",h.pathMouseEnter.bind(this,p)),p.node.addEventListener("mouseleave",h.pathMouseLeave.bind(this,p)),p.node.addEventListener("mousedown",h.pathMouseDown.bind(this,p))}}]),Ee}(),vn=function(){function Ee(p,h){s(this,Ee),this.ctx=p,this.w=p.w,this.xRatio=h.xRatio,this.yRatio=h.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new kn(p),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}return o(Ee,[{key:"draw",value:function(p){var h=this.w,S=new z(this.ctx),_=S.group({class:"apexcharts-heatmap"});_.attr("clip-path","url(#gridRectMask".concat(h.globals.cuid,")"));var k=h.globals.gridWidth/h.globals.dataPoints,T=h.globals.gridHeight/h.globals.series.length,B=0,q=!1;this.negRange=this.helpers.checkColorRange();var te=p.slice();h.config.yaxis[0].reversed&&(q=!0,te.reverse());for(var ue=q?0:te.length-1;q?ue<te.length:ue>=0;q?ue++:ue--){var de=S.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:F.escapeString(h.globals.seriesNames[ue]),rel:ue+1,"data:realIndex":ue});if(this.ctx.series.addCollapsedClassToSeries(de,ue),h.config.chart.dropShadow.enabled){var xe=h.config.chart.dropShadow;new L(this.ctx).dropShadow(de,xe,ue)}for(var we=0,ke=h.config.plotOptions.heatmap.shadeIntensity,Me=0;Me<te[ue].length;Me++){var Ye=this.helpers.getShadeColor(h.config.chart.type,ue,Me,this.negRange),Fe=Ye.color,rt=Ye.colorProps;h.config.fill.type==="image"&&(Fe=new Ne(this.ctx).fillPath({seriesNumber:ue,dataPointIndex:Me,opacity:h.globals.hasNegs?rt.percent<0?1-(1+rt.percent/100):ke+rt.percent/100:rt.percent/100,patternID:F.randomId(),width:h.config.fill.image.width?h.config.fill.image.width:k,height:h.config.fill.image.height?h.config.fill.image.height:T}));var se=this.rectRadius,Ce=S.drawRect(we,B,k,T,se);if(Ce.attr({cx:we,cy:B}),Ce.node.classList.add("apexcharts-heatmap-rect"),de.add(Ce),Ce.attr({fill:Fe,i:ue,index:ue,j:Me,val:p[ue][Me],"stroke-width":this.strokeWidth,stroke:h.config.plotOptions.heatmap.useFillColorAsStroke?Fe:h.globals.stroke.colors[0],color:Fe}),this.helpers.addListeners(Ce),h.config.chart.animations.enabled&&!h.globals.dataChanged){var De=1;h.globals.resized||(De=h.config.chart.animations.speed),this.animateHeatMap(Ce,we,B,k,T,De)}if(h.globals.dataChanged){var Le=1;if(this.dynamicAnim.enabled&&h.globals.shouldAnimate){Le=this.dynamicAnim.speed;var _e=h.globals.previousPaths[ue]&&h.globals.previousPaths[ue][Me]&&h.globals.previousPaths[ue][Me].color;_e||(_e="rgba(255, 255, 255, 0)"),this.animateHeatColor(Ce,F.isColorHex(_e)?_e:F.rgb2hex(_e),F.isColorHex(Fe)?Fe:F.rgb2hex(Fe),Le)}}var nt=(0,h.config.dataLabels.formatter)(h.globals.series[ue][Me],{value:h.globals.series[ue][Me],seriesIndex:ue,dataPointIndex:Me,w:h}),ot=this.helpers.calculateDataLabels({text:nt,x:we+k/2,y:B+T/2,i:ue,j:Me,colorProps:rt,series:te});ot!==null&&de.add(ot),we+=k}B+=T,_.add(de)}var gt=h.globals.yAxisScale[0].result.slice();return h.config.yaxis[0].reversed?gt.unshift(""):gt.push(""),h.globals.yAxisScale[0].result=gt,_}},{key:"animateHeatMap",value:function(p,h,S,_,k,T){var B=new U(this.ctx);B.animateRect(p,{x:h+_/2,y:S+k/2,width:0,height:0},{x:h,y:S,width:_,height:k},T,function(){B.animationCompleted(p)})}},{key:"animateHeatColor",value:function(p,h,S,_){p.attr({fill:h}).animate(_).attr({fill:S})}}]),Ee}(),Qn=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"drawYAxisTexts",value:function(p,h,S,_){var k=this.w,T=k.config.yaxis[0],B=k.globals.yLabelFormatters[0];return new z(this.ctx).drawText({x:p+T.labels.offsetX,y:h+T.labels.offsetY,text:B(_,S),textAnchor:"middle",fontSize:T.labels.style.fontSize,fontFamily:T.labels.style.fontFamily,foreColor:Array.isArray(T.labels.style.colors)?T.labels.style.colors[S]:T.labels.style.colors})}}]),Ee}(),Hn=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w;var h=this.w;this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animBeginArr=[0],this.animDur=0,this.donutDataLabels=this.w.config.plotOptions.pie.donut.labels,this.lineColorArr=h.globals.stroke.colors!==void 0?h.globals.stroke.colors:h.globals.colors,this.defaultSize=Math.min(h.globals.gridWidth,h.globals.gridHeight),this.centerY=this.defaultSize/2,this.centerX=h.globals.gridWidth/2,h.config.chart.type==="radialBar"?this.fullAngle=360:this.fullAngle=Math.abs(h.config.plotOptions.pie.endAngle-h.config.plotOptions.pie.startAngle),this.initialAngle=h.config.plotOptions.pie.startAngle%this.fullAngle,h.globals.radialSize=this.defaultSize/2.05-h.config.stroke.width-(h.config.chart.sparkline.enabled?0:h.config.chart.dropShadow.blur),this.donutSize=h.globals.radialSize*parseInt(h.config.plotOptions.pie.donut.size,10)/100;var S=h.config.plotOptions.pie.customScale,_=h.globals.gridWidth/2,k=h.globals.gridHeight/2;this.translateX=_-_*S,this.translateY=k-k*S,this.dataLabelsGroup=new z(this.ctx).group({class:"apexcharts-datalabels-group",transform:"translate(".concat(this.translateX,", ").concat(this.translateY,") scale(").concat(S,")")}),this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSectorAngleArr=[]}return o(Ee,[{key:"draw",value:function(p){var h=this,S=this.w,_=new z(this.ctx),k=_.group({class:"apexcharts-pie"});if(S.globals.noData)return k;for(var T=0,B=0;B<p.length;B++)T+=F.negToZero(p[B]);var q=[],te=_.group();T===0&&(T=1e-5),p.forEach(function(se){h.maxY=Math.max(h.maxY,se)}),S.config.yaxis[0].max&&(this.maxY=S.config.yaxis[0].max),S.config.grid.position==="back"&&this.chartType==="polarArea"&&this.drawPolarElements(k);for(var ue=0;ue<p.length;ue++){var de=this.fullAngle*F.negToZero(p[ue])/T;q.push(de),this.chartType==="polarArea"?(q[ue]=this.fullAngle/p.length,this.sliceSizes.push(S.globals.radialSize*p[ue]/this.maxY)):this.sliceSizes.push(S.globals.radialSize)}if(S.globals.dataChanged){for(var xe,we=0,ke=0;ke<S.globals.previousPaths.length;ke++)we+=F.negToZero(S.globals.previousPaths[ke]);for(var Me=0;Me<S.globals.previousPaths.length;Me++)xe=this.fullAngle*F.negToZero(S.globals.previousPaths[Me])/we,this.prevSectorAngleArr.push(xe)}if(this.donutSize<0&&(this.donutSize=0),this.chartType==="donut"){var Ye=_.drawCircle(this.donutSize);Ye.attr({cx:this.centerX,cy:this.centerY,fill:S.config.plotOptions.pie.donut.background?S.config.plotOptions.pie.donut.background:"transparent"}),te.add(Ye)}var Fe=this.drawArcs(q,p);if(this.sliceLabels.forEach(function(se){Fe.add(se)}),te.attr({transform:"translate(".concat(this.translateX,", ").concat(this.translateY,") scale(").concat(S.config.plotOptions.pie.customScale,")")}),te.add(Fe),k.add(te),this.donutDataLabels.show){var rt=this.renderInnerDataLabels(this.dataLabelsGroup,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});k.add(rt)}return S.config.grid.position==="front"&&this.chartType==="polarArea"&&this.drawPolarElements(k),k}},{key:"drawArcs",value:function(p,h){var S=this.w,_=new L(this.ctx),k=new z(this.ctx),T=new Ne(this.ctx),B=k.group({class:"apexcharts-slices"}),q=this.initialAngle,te=this.initialAngle,ue=this.initialAngle,de=this.initialAngle;this.strokeWidth=S.config.stroke.show?S.config.stroke.width:0;for(var xe=0;xe<p.length;xe++){var we=k.group({class:"apexcharts-series apexcharts-pie-series",seriesName:F.escapeString(S.globals.seriesNames[xe]),rel:xe+1,"data:realIndex":xe});B.add(we),te=de,ue=(q=ue)+p[xe],de=te+this.prevSectorAngleArr[xe];var ke=ue<q?this.fullAngle+ue-q:ue-q,Me=T.fillPath({seriesNumber:xe,size:this.sliceSizes[xe],value:h[xe]}),Ye=this.getChangedPath(te,de),Fe=k.drawPath({d:Ye,stroke:Array.isArray(this.lineColorArr)?this.lineColorArr[xe]:this.lineColorArr,strokeWidth:0,fill:Me,fillOpacity:S.config.fill.opacity,classes:"apexcharts-pie-area apexcharts-".concat(this.chartType.toLowerCase(),"-slice-").concat(xe)});if(Fe.attr({index:0,j:xe}),_.setSelectionFilter(Fe,0,xe),S.config.chart.dropShadow.enabled){var rt=S.config.chart.dropShadow;_.dropShadow(Fe,rt,xe)}this.addListeners(Fe,this.donutDataLabels),z.setAttrs(Fe.node,{"data:angle":ke,"data:startAngle":q,"data:strokeWidth":this.strokeWidth,"data:value":h[xe]});var se={x:0,y:0};this.chartType==="pie"||this.chartType==="polarArea"?se=F.polarToCartesian(this.centerX,this.centerY,S.globals.radialSize/1.25+S.config.plotOptions.pie.dataLabels.offset,(q+ke/2)%this.fullAngle):this.chartType==="donut"&&(se=F.polarToCartesian(this.centerX,this.centerY,(S.globals.radialSize+this.donutSize)/2+S.config.plotOptions.pie.dataLabels.offset,(q+ke/2)%this.fullAngle)),we.add(Fe);var Ce=0;if(!this.initialAnim||S.globals.resized||S.globals.dataChanged?this.animBeginArr.push(0):((Ce=ke/this.fullAngle*S.config.chart.animations.speed)===0&&(Ce=1),this.animDur=Ce+this.animDur,this.animBeginArr.push(this.animDur)),this.dynamicAnim&&S.globals.dataChanged?this.animatePaths(Fe,{size:this.sliceSizes[xe],endAngle:ue,startAngle:q,prevStartAngle:te,prevEndAngle:de,animateStartingPos:!0,i:xe,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:S.config.chart.animations.dynamicAnimation.speed}):this.animatePaths(Fe,{size:this.sliceSizes[xe],endAngle:ue,startAngle:q,i:xe,totalItems:p.length-1,animBeginArr:this.animBeginArr,dur:Ce}),S.config.plotOptions.pie.expandOnClick&&this.chartType!=="polarArea"&&Fe.node.addEventListener("mouseup",this.pieClicked.bind(this,xe)),S.globals.selectedDataPoints[0]!==void 0&&S.globals.selectedDataPoints[0].indexOf(xe)>-1&&this.pieClicked(xe),S.config.dataLabels.enabled){var De=se.x,Le=se.y,_e=100*ke/this.fullAngle+"%";if(ke!==0&&S.config.plotOptions.pie.dataLabels.minAngleToShowLabel<p[xe]){var nt=S.config.dataLabels.formatter;nt!==void 0&&(_e=nt(S.globals.seriesPercent[xe][0],{seriesIndex:xe,w:S}));var ot=S.globals.dataLabels.style.colors[xe],gt=k.group({class:"apexcharts-datalabels"}),Jt=k.drawText({x:De,y:Le,text:_e,textAnchor:"middle",fontSize:S.config.dataLabels.style.fontSize,fontFamily:S.config.dataLabels.style.fontFamily,fontWeight:S.config.dataLabels.style.fontWeight,foreColor:ot});if(gt.add(Jt),S.config.dataLabels.dropShadow.enabled){var Ge=S.config.dataLabels.dropShadow;_.dropShadow(Jt,Ge)}Jt.node.classList.add("apexcharts-pie-label"),S.config.chart.animations.animate&&S.globals.resized===!1&&(Jt.node.classList.add("apexcharts-pie-label-delay"),Jt.node.style.animationDelay=S.config.chart.animations.speed/940+"s"),this.sliceLabels.push(gt)}}}return B}},{key:"addListeners",value:function(p,h){var S=new z(this.ctx);p.node.addEventListener("mouseenter",S.pathMouseEnter.bind(this,p)),p.node.addEventListener("mouseleave",S.pathMouseLeave.bind(this,p)),p.node.addEventListener("mouseleave",this.revertDataLabelsInner.bind(this,p.node,h)),p.node.addEventListener("mousedown",S.pathMouseDown.bind(this,p)),this.donutDataLabels.total.showAlways||(p.node.addEventListener("mouseenter",this.printDataLabelsInner.bind(this,p.node,h)),p.node.addEventListener("mousedown",this.printDataLabelsInner.bind(this,p.node,h)))}},{key:"animatePaths",value:function(p,h){var S=this.w,_=h.endAngle<h.startAngle?this.fullAngle+h.endAngle-h.startAngle:h.endAngle-h.startAngle,k=_,T=h.startAngle,B=h.startAngle;h.prevStartAngle!==void 0&&h.prevEndAngle!==void 0&&(T=h.prevEndAngle,k=h.prevEndAngle<h.prevStartAngle?this.fullAngle+h.prevEndAngle-h.prevStartAngle:h.prevEndAngle-h.prevStartAngle),h.i===S.config.series.length-1&&(_+B>this.fullAngle?h.endAngle=h.endAngle-(_+B):_+B<this.fullAngle&&(h.endAngle=h.endAngle+(this.fullAngle-(_+B)))),_===this.fullAngle&&(_=this.fullAngle-.01),this.animateArc(p,T,B,_,k,h)}},{key:"animateArc",value:function(p,h,S,_,k,T){var B,q=this,te=this.w,ue=new U(this.ctx),de=T.size;(isNaN(h)||isNaN(k))&&(h=S,k=_,T.dur=0);var xe=_,we=S,ke=h<S?this.fullAngle+h-S:h-S;te.globals.dataChanged&&T.shouldSetPrevPaths&&T.prevEndAngle&&(B=q.getPiePath({me:q,startAngle:T.prevStartAngle,angle:T.prevEndAngle<T.prevStartAngle?this.fullAngle+T.prevEndAngle-T.prevStartAngle:T.prevEndAngle-T.prevStartAngle,size:de}),p.attr({d:B})),T.dur!==0?p.animate(T.dur,te.globals.easing,T.animBeginArr[T.i]).afterAll(function(){q.chartType!=="pie"&&q.chartType!=="donut"&&q.chartType!=="polarArea"||this.animate(te.config.chart.animations.dynamicAnimation.speed).attr({"stroke-width":q.strokeWidth}),T.i===te.config.series.length-1&&ue.animationCompleted(p)}).during(function(Me){xe=ke+(_-ke)*Me,T.animateStartingPos&&(xe=k+(_-k)*Me,we=h-k+(S-(h-k))*Me),B=q.getPiePath({me:q,startAngle:we,angle:xe,size:de}),p.node.setAttribute("data:pathOrig",B),p.attr({d:B})}):(B=q.getPiePath({me:q,startAngle:we,angle:_,size:de}),T.isTrack||(te.globals.animationEnded=!0),p.node.setAttribute("data:pathOrig",B),p.attr({d:B,"stroke-width":q.strokeWidth}))}},{key:"pieClicked",value:function(p){var h,S=this.w,_=this,k=_.sliceSizes[p]+(S.config.plotOptions.pie.expandOnClick?4:0),T=S.globals.dom.Paper.select(".apexcharts-".concat(_.chartType.toLowerCase(),"-slice-").concat(p)).members[0];if(T.attr("data:pieClicked")!=="true"){var B=S.globals.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(B,function(de){de.setAttribute("data:pieClicked","false");var xe=de.getAttribute("data:pathOrig");xe&&de.setAttribute("d",xe)}),S.globals.capturedDataPointIndex=p,T.attr("data:pieClicked","true");var q=parseInt(T.attr("data:startAngle"),10),te=parseInt(T.attr("data:angle"),10);h=_.getPiePath({me:_,startAngle:q,angle:te,size:k}),te!==360&&T.plot(h)}else{T.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner(T.node,this.donutDataLabels);var ue=T.attr("data:pathOrig");T.attr({d:ue})}}},{key:"getChangedPath",value:function(p,h){var S="";return this.dynamicAnim&&this.w.globals.dataChanged&&(S=this.getPiePath({me:this,startAngle:p,angle:h-p,size:this.size})),S}},{key:"getPiePath",value:function(p){var h,S=p.me,_=p.startAngle,k=p.angle,T=p.size,B=new z(this.ctx),q=_,te=Math.PI*(q-90)/180,ue=k+_;Math.ceil(ue)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(ue=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01),Math.ceil(ue)>this.fullAngle&&(ue-=this.fullAngle);var de=Math.PI*(ue-90)/180,xe=S.centerX+T*Math.cos(te),we=S.centerY+T*Math.sin(te),ke=S.centerX+T*Math.cos(de),Me=S.centerY+T*Math.sin(de),Ye=F.polarToCartesian(S.centerX,S.centerY,S.donutSize,ue),Fe=F.polarToCartesian(S.centerX,S.centerY,S.donutSize,q),rt=k>180?1:0,se=["M",xe,we,"A",T,T,0,rt,1,ke,Me];return h=S.chartType==="donut"?[].concat(se,["L",Ye.x,Ye.y,"A",S.donutSize,S.donutSize,0,rt,0,Fe.x,Fe.y,"L",xe,we,"z"]).join(" "):S.chartType==="pie"||S.chartType==="polarArea"?[].concat(se,["L",S.centerX,S.centerY,"L",xe,we]).join(" "):[].concat(se).join(" "),B.roundPathCorners(h,2*this.strokeWidth)}},{key:"drawPolarElements",value:function(p){var h=this.w,S=new at(this.ctx),_=new z(this.ctx),k=new Qn(this.ctx),T=_.group(),B=_.group(),q=S.niceScale(0,Math.ceil(this.maxY),0),te=q.result.reverse(),ue=q.result.length;this.maxY=q.niceMax;for(var de=h.globals.radialSize,xe=de/(ue-1),we=0;we<ue-1;we++){var ke=_.drawCircle(de);if(ke.attr({cx:this.centerX,cy:this.centerY,fill:"none","stroke-width":h.config.plotOptions.polarArea.rings.strokeWidth,stroke:h.config.plotOptions.polarArea.rings.strokeColor}),h.config.yaxis[0].show){var Me=k.drawYAxisTexts(this.centerX,this.centerY-de+parseInt(h.config.yaxis[0].labels.style.fontSize,10)/2,we,te[we]);B.add(Me)}T.add(ke),de-=xe}this.drawSpokes(p),p.add(T),p.add(B)}},{key:"renderInnerDataLabels",value:function(p,h,S){var _=this.w,k=new z(this.ctx),T=h.total.show;p.node.innerHTML="",p.node.style.opacity=S.opacity;var B,q,te=S.centerX,ue=this.donutDataLabels.total.label?S.centerY:S.centerY-S.centerY/6;B=h.name.color===void 0?_.globals.colors[0]:h.name.color;var de=h.name.fontSize,xe=h.name.fontFamily,we=h.name.fontWeight;q=h.value.color===void 0?_.config.chart.foreColor:h.value.color;var ke=h.value.formatter,Me="",Ye="";if(T?(B=h.total.color,de=h.total.fontSize,xe=h.total.fontFamily,we=h.total.fontWeight,Ye=this.donutDataLabels.total.label?h.total.label:"",Me=h.total.formatter(_)):_.globals.series.length===1&&(Me=ke(_.globals.series[0],_),Ye=_.globals.seriesNames[0]),Ye&&(Ye=h.name.formatter(Ye,h.total.show,_)),h.name.show){var Fe=k.drawText({x:te,y:ue+parseFloat(h.name.offsetY),text:Ye,textAnchor:"middle",foreColor:B,fontSize:de,fontWeight:we,fontFamily:xe});Fe.node.classList.add("apexcharts-datalabel-label"),p.add(Fe)}if(h.value.show){var rt=h.name.show?parseFloat(h.value.offsetY)+16:h.value.offsetY,se=k.drawText({x:te,y:ue+rt,text:Me,textAnchor:"middle",foreColor:q,fontWeight:h.value.fontWeight,fontSize:h.value.fontSize,fontFamily:h.value.fontFamily});se.node.classList.add("apexcharts-datalabel-value"),p.add(se)}return p}},{key:"printInnerLabels",value:function(p,h,S,_){var k,T=this.w;_?k=p.name.color===void 0?T.globals.colors[parseInt(_.parentNode.getAttribute("rel"),10)-1]:p.name.color:T.globals.series.length>1&&p.total.show&&(k=p.total.color);var B=T.globals.dom.baseEl.querySelector(".apexcharts-datalabel-label"),q=T.globals.dom.baseEl.querySelector(".apexcharts-datalabel-value");S=(0,p.value.formatter)(S,T),_||typeof p.total.formatter!="function"||(S=p.total.formatter(T));var te=h===p.total.label;h=this.donutDataLabels.total.label?p.name.formatter(h,te,T):"",B!==null&&(B.textContent=h),q!==null&&(q.textContent=S),B!==null&&(B.style.fill=k)}},{key:"printDataLabelsInner",value:function(p,h){var S=this.w,_=p.getAttribute("data:value"),k=S.globals.seriesNames[parseInt(p.parentNode.getAttribute("rel"),10)-1];S.globals.series.length>1&&this.printInnerLabels(h,k,_,p);var T=S.globals.dom.baseEl.querySelector(".apexcharts-datalabels-group");T!==null&&(T.style.opacity=1)}},{key:"drawSpokes",value:function(p){var h=this,S=this.w,_=new z(this.ctx),k=S.config.plotOptions.polarArea.spokes;if(k.strokeWidth!==0){for(var T=[],B=360/S.globals.series.length,q=0;q<S.globals.series.length;q++)T.push(F.polarToCartesian(this.centerX,this.centerY,S.globals.radialSize,S.config.plotOptions.pie.startAngle+B*q));T.forEach(function(te,ue){var de=_.drawLine(te.x,te.y,h.centerX,h.centerY,Array.isArray(k.connectorColors)?k.connectorColors[ue]:k.connectorColors);p.add(de)})}}},{key:"revertDataLabelsInner",value:function(){var p=this.w;if(this.donutDataLabels.show){var h=p.globals.dom.Paper.select(".apexcharts-datalabels-group").members[0],S=this.renderInnerDataLabels(h,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});p.globals.dom.Paper.select(".apexcharts-radialbar, .apexcharts-pie").members[0].add(S)}}}]),Ee}(),$n=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animDur=0;var h=this.w;this.graphics=new z(this.ctx),this.lineColorArr=h.globals.stroke.colors!==void 0?h.globals.stroke.colors:h.globals.colors,this.defaultSize=h.globals.svgHeight<h.globals.svgWidth?h.globals.gridHeight:h.globals.gridWidth,this.isLog=h.config.yaxis[0].logarithmic,this.logBase=h.config.yaxis[0].logBase,this.coreUtils=new X(this.ctx),this.maxValue=this.isLog?this.coreUtils.getLogVal(this.logBase,h.globals.maxY,0):h.globals.maxY,this.minValue=this.isLog?this.coreUtils.getLogVal(this.logBase,this.w.globals.minY,0):h.globals.minY,this.polygons=h.config.plotOptions.radar.polygons,this.strokeWidth=h.config.stroke.show?h.config.stroke.width:0,this.size=this.defaultSize/2.1-this.strokeWidth-h.config.chart.dropShadow.blur,h.config.xaxis.labels.show&&(this.size=this.size-h.globals.xAxisLabelsWidth/1.75),h.config.plotOptions.radar.size!==void 0&&(this.size=h.config.plotOptions.radar.size),this.dataRadiusOfPercent=[],this.dataRadius=[],this.angleArr=[],this.yaxisLabelsTextsPos=[]}return o(Ee,[{key:"draw",value:function(p){var h=this,S=this.w,_=new Ne(this.ctx),k=[],T=new Ie(this.ctx);p.length&&(this.dataPointsLen=p[S.globals.maxValsInArrayIndex].length),this.disAngle=2*Math.PI/this.dataPointsLen;var B=S.globals.gridWidth/2,q=S.globals.gridHeight/2,te=B+S.config.plotOptions.radar.offsetX,ue=q+S.config.plotOptions.radar.offsetY,de=this.graphics.group({class:"apexcharts-radar-series apexcharts-plot-series",transform:"translate(".concat(te||0,", ").concat(ue||0,")")}),xe=[],we=null,ke=null;if(this.yaxisLabels=this.graphics.group({class:"apexcharts-yaxis"}),p.forEach(function(Ye,Fe){var rt=Ye.length===S.globals.dataPoints,se=h.graphics.group().attr({class:"apexcharts-series","data:longestSeries":rt,seriesName:F.escapeString(S.globals.seriesNames[Fe]),rel:Fe+1,"data:realIndex":Fe});h.dataRadiusOfPercent[Fe]=[],h.dataRadius[Fe]=[],h.angleArr[Fe]=[],Ye.forEach(function(et,We){var wt=Math.abs(h.maxValue-h.minValue);et-=h.minValue,h.isLog&&(et=h.coreUtils.getLogVal(h.logBase,et,0)),h.dataRadiusOfPercent[Fe][We]=et/wt,h.dataRadius[Fe][We]=h.dataRadiusOfPercent[Fe][We]*h.size,h.angleArr[Fe][We]=We*h.disAngle}),xe=h.getDataPointsPos(h.dataRadius[Fe],h.angleArr[Fe]);var Ce=h.createPaths(xe,{x:0,y:0});we=h.graphics.group({class:"apexcharts-series-markers-wrap apexcharts-element-hidden"}),ke=h.graphics.group({class:"apexcharts-datalabels","data:realIndex":Fe}),S.globals.delayedElements.push({el:we.node,index:Fe});var De={i:Fe,realIndex:Fe,animationDelay:Fe,initialSpeed:S.config.chart.animations.speed,dataChangeSpeed:S.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-radar",shouldClipToGrid:!1,bindEventsOnPaths:!1,stroke:S.globals.stroke.colors[Fe],strokeLineCap:S.config.stroke.lineCap},Le=null;S.globals.previousPaths.length>0&&(Le=h.getPreviousPath(Fe));for(var _e=0;_e<Ce.linePathsTo.length;_e++){var nt=h.graphics.renderPaths(v(v({},De),{},{pathFrom:Le===null?Ce.linePathsFrom[_e]:Le,pathTo:Ce.linePathsTo[_e],strokeWidth:Array.isArray(h.strokeWidth)?h.strokeWidth[Fe]:h.strokeWidth,fill:"none",drawShadow:!1}));se.add(nt);var ot=_.fillPath({seriesNumber:Fe}),gt=h.graphics.renderPaths(v(v({},De),{},{pathFrom:Le===null?Ce.areaPathsFrom[_e]:Le,pathTo:Ce.areaPathsTo[_e],strokeWidth:0,fill:ot,drawShadow:!1}));if(S.config.chart.dropShadow.enabled){var Jt=new L(h.ctx),Ge=S.config.chart.dropShadow;Jt.dropShadow(gt,Object.assign({},Ge,{noUserSpaceOnUse:!0}),Fe)}se.add(gt)}Ye.forEach(function(et,We){var wt=new be(h.ctx).getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:Fe,dataPointIndex:We}),St=h.graphics.drawMarker(xe[We].x,xe[We].y,wt);St.attr("rel",We),St.attr("j",We),St.attr("index",Fe),St.node.setAttribute("default-marker-size",wt.pSize);var Kt=h.graphics.group({class:"apexcharts-series-markers"});Kt&&Kt.add(St),we.add(Kt),se.add(we);var gn=S.config.dataLabels;if(gn.enabled){var yn=gn.formatter(S.globals.series[Fe][We],{seriesIndex:Fe,dataPointIndex:We,w:S});T.plotDataLabelsText({x:xe[We].x,y:xe[We].y,text:yn,textAnchor:"middle",i:Fe,j:Fe,parent:ke,offsetCorrection:!1,dataLabelsConfig:v({},gn)})}se.add(ke)}),k.push(se)}),this.drawPolygons({parent:de}),S.config.xaxis.labels.show){var Me=this.drawXAxisTexts();de.add(Me)}return k.forEach(function(Ye){de.add(Ye)}),de.add(this.yaxisLabels),de}},{key:"drawPolygons",value:function(p){for(var h=this,S=this.w,_=p.parent,k=new Qn(this.ctx),T=S.globals.yAxisScale[0].result.reverse(),B=T.length,q=[],te=this.size/(B-1),ue=0;ue<B;ue++)q[ue]=te*ue;q.reverse();var de=[],xe=[];q.forEach(function(we,ke){var Me=F.getPolygonPos(we,h.dataPointsLen),Ye="";Me.forEach(function(Fe,rt){if(ke===0){var se=h.graphics.drawLine(Fe.x,Fe.y,0,0,Array.isArray(h.polygons.connectorColors)?h.polygons.connectorColors[rt]:h.polygons.connectorColors);xe.push(se)}rt===0&&h.yaxisLabelsTextsPos.push({x:Fe.x,y:Fe.y}),Ye+=Fe.x+","+Fe.y+" "}),de.push(Ye)}),de.forEach(function(we,ke){var Me=h.polygons.strokeColors,Ye=h.polygons.strokeWidth,Fe=h.graphics.drawPolygon(we,Array.isArray(Me)?Me[ke]:Me,Array.isArray(Ye)?Ye[ke]:Ye,S.globals.radarPolygons.fill.colors[ke]);_.add(Fe)}),xe.forEach(function(we){_.add(we)}),S.config.yaxis[0].show&&this.yaxisLabelsTextsPos.forEach(function(we,ke){var Me=k.drawYAxisTexts(we.x,we.y,ke,T[ke]);h.yaxisLabels.add(Me)})}},{key:"drawXAxisTexts",value:function(){var p=this,h=this.w,S=h.config.xaxis.labels,_=this.graphics.group({class:"apexcharts-xaxis"}),k=F.getPolygonPos(this.size,this.dataPointsLen);return h.globals.labels.forEach(function(T,B){var q=h.config.xaxis.labels.formatter,te=new Ie(p.ctx);if(k[B]){var ue=p.getTextPos(k[B],p.size),de=q(T,{seriesIndex:-1,dataPointIndex:B,w:h});te.plotDataLabelsText({x:ue.newX,y:ue.newY,text:de,textAnchor:ue.textAnchor,i:B,j:B,parent:_,className:"apexcharts-xaxis-label",color:Array.isArray(S.style.colors)&&S.style.colors[B]?S.style.colors[B]:"#a8a8a8",dataLabelsConfig:v({textAnchor:ue.textAnchor,dropShadow:{enabled:!1}},S),offsetCorrection:!1}).on("click",function(xe){if(typeof h.config.chart.events.xAxisLabelClick=="function"){var we=Object.assign({},h,{labelIndex:B});h.config.chart.events.xAxisLabelClick(xe,p.ctx,we)}})}}),_}},{key:"createPaths",value:function(p,h){var S=this,_=[],k=[],T=[],B=[];if(p.length){k=[this.graphics.move(h.x,h.y)],B=[this.graphics.move(h.x,h.y)];var q=this.graphics.move(p[0].x,p[0].y),te=this.graphics.move(p[0].x,p[0].y);p.forEach(function(ue,de){q+=S.graphics.line(ue.x,ue.y),te+=S.graphics.line(ue.x,ue.y),de===p.length-1&&(q+="Z",te+="Z")}),_.push(q),T.push(te)}return{linePathsFrom:k,linePathsTo:_,areaPathsFrom:B,areaPathsTo:T}}},{key:"getTextPos",value:function(p,h){var S="middle",_=p.x,k=p.y;return Math.abs(p.x)>=10?p.x>0?(S="start",_+=10):p.x<0&&(S="end",_-=10):S="middle",Math.abs(p.y)>=h-10&&(p.y<0?k-=10:p.y>0&&(k+=10)),{textAnchor:S,newX:_,newY:k}}},{key:"getPreviousPath",value:function(p){for(var h=this.w,S=null,_=0;_<h.globals.previousPaths.length;_++){var k=h.globals.previousPaths[_];k.paths.length>0&&parseInt(k.realIndex,10)===parseInt(p,10)&&h.globals.previousPaths[_].paths[0]!==void 0&&(S=h.globals.previousPaths[_].paths[0].d)}return S}},{key:"getDataPointsPos",value:function(p,h){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.dataPointsLen;p=p||[],h=h||[];for(var _=[],k=0;k<S;k++){var T={};T.x=p[k]*Math.sin(h[k]),T.y=-p[k]*Math.cos(h[k]),_.push(T)}return _}}]),Ee}(),Jn=function(Ee){f(h,Hn);var p=c(h);function h(S){var _;s(this,h),(_=p.call(this,S)).ctx=S,_.w=S.w,_.animBeginArr=[0],_.animDur=0;var k=_.w;return _.startAngle=k.config.plotOptions.radialBar.startAngle,_.endAngle=k.config.plotOptions.radialBar.endAngle,_.totalAngle=Math.abs(k.config.plotOptions.radialBar.endAngle-k.config.plotOptions.radialBar.startAngle),_.trackStartAngle=k.config.plotOptions.radialBar.track.startAngle,_.trackEndAngle=k.config.plotOptions.radialBar.track.endAngle,_.barLabels=_.w.config.plotOptions.radialBar.barLabels,_.donutDataLabels=_.w.config.plotOptions.radialBar.dataLabels,_.radialDataLabels=_.donutDataLabels,_.trackStartAngle||(_.trackStartAngle=_.startAngle),_.trackEndAngle||(_.trackEndAngle=_.endAngle),_.endAngle===360&&(_.endAngle=359.99),_.margin=parseInt(k.config.plotOptions.radialBar.track.margin,10),_.onBarLabelClick=_.onBarLabelClick.bind(r(_)),_}return o(h,[{key:"draw",value:function(S){var _=this.w,k=new z(this.ctx),T=k.group({class:"apexcharts-radialbar"});if(_.globals.noData)return T;var B=k.group(),q=this.defaultSize/2,te=_.globals.gridWidth/2,ue=this.defaultSize/2.05;_.config.chart.sparkline.enabled||(ue=ue-_.config.stroke.width-_.config.chart.dropShadow.blur);var de=_.globals.fill.colors;if(_.config.plotOptions.radialBar.track.show){var xe=this.drawTracks({size:ue,centerX:te,centerY:q,colorArr:de,series:S});B.add(xe)}var we=this.drawArcs({size:ue,centerX:te,centerY:q,colorArr:de,series:S}),ke=360;_.config.plotOptions.radialBar.startAngle<0&&(ke=this.totalAngle);var Me=(360-ke)/360;if(_.globals.radialSize=ue-ue*Me,this.radialDataLabels.value.show){var Ye=Math.max(this.radialDataLabels.value.offsetY,this.radialDataLabels.name.offsetY);_.globals.radialSize+=Ye*Me}return B.add(we.g),_.config.plotOptions.radialBar.hollow.position==="front"&&(we.g.add(we.elHollow),we.dataLabels&&we.g.add(we.dataLabels)),T.add(B),T}},{key:"drawTracks",value:function(S){var _=this.w,k=new z(this.ctx),T=k.group({class:"apexcharts-tracks"}),B=new L(this.ctx),q=new Ne(this.ctx),te=this.getStrokeWidth(S);S.size=S.size-te/2;for(var ue=0;ue<S.series.length;ue++){var de=k.group({class:"apexcharts-radialbar-track apexcharts-track"});T.add(de),de.attr({rel:ue+1}),S.size=S.size-te-this.margin;var xe=_.config.plotOptions.radialBar.track,we=q.fillPath({seriesNumber:0,size:S.size,fillColors:Array.isArray(xe.background)?xe.background[ue]:xe.background,solid:!0}),ke=this.trackStartAngle,Me=this.trackEndAngle;Math.abs(Me)+Math.abs(ke)>=360&&(Me=360-Math.abs(this.startAngle)-.1);var Ye=k.drawPath({d:"",stroke:we,strokeWidth:te*parseInt(xe.strokeWidth,10)/100,fill:"none",strokeOpacity:xe.opacity,classes:"apexcharts-radialbar-area"});if(xe.dropShadow.enabled){var Fe=xe.dropShadow;B.dropShadow(Ye,Fe)}de.add(Ye),Ye.attr("id","apexcharts-radialbarTrack-"+ue),this.animatePaths(Ye,{centerX:S.centerX,centerY:S.centerY,endAngle:Me,startAngle:ke,size:S.size,i:ue,totalItems:2,animBeginArr:0,dur:0,isTrack:!0,easing:_.globals.easing})}return T}},{key:"drawArcs",value:function(S){var _=this.w,k=new z(this.ctx),T=new Ne(this.ctx),B=new L(this.ctx),q=k.group(),te=this.getStrokeWidth(S);S.size=S.size-te/2;var ue=_.config.plotOptions.radialBar.hollow.background,de=S.size-te*S.series.length-this.margin*S.series.length-te*parseInt(_.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,xe=de-_.config.plotOptions.radialBar.hollow.margin;_.config.plotOptions.radialBar.hollow.image!==void 0&&(ue=this.drawHollowImage(S,q,de,ue));var we=this.drawHollow({size:xe,centerX:S.centerX,centerY:S.centerY,fill:ue||"transparent"});if(_.config.plotOptions.radialBar.hollow.dropShadow.enabled){var ke=_.config.plotOptions.radialBar.hollow.dropShadow;B.dropShadow(we,ke)}var Me=1;!this.radialDataLabels.total.show&&_.globals.series.length>1&&(Me=0);var Ye=null;if(this.radialDataLabels.show){var Fe=_.globals.dom.Paper.select(".apexcharts-datalabels-group").members[0];Ye=this.renderInnerDataLabels(Fe,this.radialDataLabels,{hollowSize:de,centerX:S.centerX,centerY:S.centerY,opacity:Me})}_.config.plotOptions.radialBar.hollow.position==="back"&&(q.add(we),Ye&&q.add(Ye));var rt=!1;_.config.plotOptions.radialBar.inverseOrder&&(rt=!0);for(var se=rt?S.series.length-1:0;rt?se>=0:se<S.series.length;rt?se--:se++){var Ce=k.group({class:"apexcharts-series apexcharts-radial-series",seriesName:F.escapeString(_.globals.seriesNames[se])});q.add(Ce),Ce.attr({rel:se+1,"data:realIndex":se}),this.ctx.series.addCollapsedClassToSeries(Ce,se),S.size=S.size-te-this.margin;var De=T.fillPath({seriesNumber:se,size:S.size,value:S.series[se]}),Le=this.startAngle,_e=void 0,nt=F.negToZero(S.series[se]>100?100:S.series[se])/100,ot=Math.round(this.totalAngle*nt)+this.startAngle,gt=void 0;_.globals.dataChanged&&(_e=this.startAngle,gt=Math.round(this.totalAngle*F.negToZero(_.globals.previousPaths[se])/100)+_e),Math.abs(ot)+Math.abs(Le)>360&&(ot-=.01),Math.abs(gt)+Math.abs(_e)>360&&(gt-=.01);var Jt=ot-Le,Ge=Array.isArray(_.config.stroke.dashArray)?_.config.stroke.dashArray[se]:_.config.stroke.dashArray,et=k.drawPath({d:"",stroke:De,strokeWidth:te,fill:"none",fillOpacity:_.config.fill.opacity,classes:"apexcharts-radialbar-area apexcharts-radialbar-slice-"+se,strokeDashArray:Ge});if(z.setAttrs(et.node,{"data:angle":Jt,"data:value":S.series[se]}),_.config.chart.dropShadow.enabled){var We=_.config.chart.dropShadow;B.dropShadow(et,We,se)}if(B.setSelectionFilter(et,0,se),this.addListeners(et,this.radialDataLabels),Ce.add(et),et.attr({index:0,j:se}),this.barLabels.enabled){var wt=F.polarToCartesian(S.centerX,S.centerY,S.size,Le),St=this.barLabels.formatter(_.globals.seriesNames[se],{seriesIndex:se,w:_}),Kt=["apexcharts-radialbar-label"];this.barLabels.onClick||Kt.push("apexcharts-no-click");var gn=this.barLabels.useSeriesColors?_.globals.colors[se]:_.config.chart.foreColor;gn||(gn=_.config.chart.foreColor);var yn=wt.x+this.barLabels.offsetX,hn=wt.y+this.barLabels.offsetY,br=k.drawText({x:yn,y:hn,text:St,textAnchor:"end",dominantBaseline:"middle",fontFamily:this.barLabels.fontFamily,fontWeight:this.barLabels.fontWeight,fontSize:this.barLabels.fontSize,foreColor:gn,cssClass:Kt.join(" ")});br.on("click",this.onBarLabelClick),br.attr({rel:se+1}),Le!==0&&br.attr({"transform-origin":"".concat(yn," ").concat(hn),transform:"rotate(".concat(Le," 0 0)")}),Ce.add(br)}var pt=0;!this.initialAnim||_.globals.resized||_.globals.dataChanged||(pt=_.config.chart.animations.speed),_.globals.dataChanged&&(pt=_.config.chart.animations.dynamicAnimation.speed),this.animDur=pt/(1.2*S.series.length)+this.animDur,this.animBeginArr.push(this.animDur),this.animatePaths(et,{centerX:S.centerX,centerY:S.centerY,endAngle:ot,startAngle:Le,prevEndAngle:gt,prevStartAngle:_e,size:S.size,i:se,totalItems:2,animBeginArr:this.animBeginArr,dur:pt,shouldSetPrevPaths:!0,easing:_.globals.easing})}return{g:q,elHollow:we,dataLabels:Ye}}},{key:"drawHollow",value:function(S){var _=new z(this.ctx).drawCircle(2*S.size);return _.attr({class:"apexcharts-radialbar-hollow",cx:S.centerX,cy:S.centerY,r:S.size,fill:S.fill}),_}},{key:"drawHollowImage",value:function(S,_,k,T){var B=this.w,q=new Ne(this.ctx),te=F.randomId(),ue=B.config.plotOptions.radialBar.hollow.image;if(B.config.plotOptions.radialBar.hollow.imageClipped)q.clippedImgArea({width:k,height:k,image:ue,patternID:"pattern".concat(B.globals.cuid).concat(te)}),T="url(#pattern".concat(B.globals.cuid).concat(te,")");else{var de=B.config.plotOptions.radialBar.hollow.imageWidth,xe=B.config.plotOptions.radialBar.hollow.imageHeight;if(de===void 0&&xe===void 0){var we=B.globals.dom.Paper.image(ue).loaded(function(Me){this.move(S.centerX-Me.width/2+B.config.plotOptions.radialBar.hollow.imageOffsetX,S.centerY-Me.height/2+B.config.plotOptions.radialBar.hollow.imageOffsetY)});_.add(we)}else{var ke=B.globals.dom.Paper.image(ue).loaded(function(Me){this.move(S.centerX-de/2+B.config.plotOptions.radialBar.hollow.imageOffsetX,S.centerY-xe/2+B.config.plotOptions.radialBar.hollow.imageOffsetY),this.size(de,xe)});_.add(ke)}}return T}},{key:"getStrokeWidth",value:function(S){var _=this.w;return S.size*(100-parseInt(_.config.plotOptions.radialBar.hollow.size,10))/100/(S.series.length+1)-this.margin}},{key:"onBarLabelClick",value:function(S){var _=parseInt(S.target.getAttribute("rel"),10)-1,k=this.barLabels.onClick,T=this.w;k&&k(T.globals.seriesNames[_],{w:T,seriesIndex:_})}}]),h}(),Nn=function(Ee){f(h,dn);var p=c(h);function h(){return s(this,h),p.apply(this,arguments)}return o(h,[{key:"draw",value:function(S,_){var k=this.w,T=new z(this.ctx);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=S,this.seriesRangeStart=k.globals.seriesRangeStart,this.seriesRangeEnd=k.globals.seriesRangeEnd,this.barHelpers.initVariables(S);for(var B=T.group({class:"apexcharts-rangebar-series apexcharts-plot-series"}),q=0;q<S.length;q++){var te,ue,de,xe,we=void 0,ke=void 0,Me=k.globals.comboCharts?_[q]:q,Ye=this.barHelpers.getGroupIndex(Me).columnGroupIndex,Fe=T.group({class:"apexcharts-series",seriesName:F.escapeString(k.globals.seriesNames[Me]),rel:q+1,"data:realIndex":Me});this.ctx.series.addCollapsedClassToSeries(Fe,Me),S[q].length>0&&(this.visibleI=this.visibleI+1);var rt=0,se=0,Ce=0;this.yRatio.length>1&&(this.yaxisIndex=k.globals.seriesYAxisReverseMap[Me][0],Ce=Me);var De=this.barHelpers.initialPositions();ke=De.y,xe=De.zeroW,we=De.x,se=De.barWidth,rt=De.barHeight,te=De.xDivision,ue=De.yDivision,de=De.zeroH;for(var Le=T.group({class:"apexcharts-datalabels","data:realIndex":Me}),_e=T.group({class:"apexcharts-rangebar-goals-markers"}),nt=0;nt<k.globals.dataPoints;nt++){var ot=this.barHelpers.getStrokeWidth(q,nt,Me),gt=this.seriesRangeStart[q][nt],Jt=this.seriesRangeEnd[q][nt],Ge=null,et=null,We=null,wt={x:we,y:ke,strokeWidth:ot,elSeries:Fe},St=this.seriesLen;if(k.config.plotOptions.bar.rangeBarGroupRows&&(St=1),k.config.series[q].data[nt]===void 0)break;if(this.isHorizontal){We=ke+rt*this.visibleI;var Kt=(ue-rt*St)/2;if(k.config.series[q].data[nt].x){var gn=this.detectOverlappingBars({i:q,j:nt,barYPosition:We,srty:Kt,barHeight:rt,yDivision:ue,initPositions:De});rt=gn.barHeight,We=gn.barYPosition}se=(Ge=this.drawRangeBarPaths(v({indexes:{i:q,j:nt,realIndex:Me},barHeight:rt,barYPosition:We,zeroW:xe,yDivision:ue,y1:gt,y2:Jt},wt))).barWidth}else{k.globals.isXNumeric&&(we=(k.globals.seriesX[q][nt]-k.globals.minX)/this.xRatio-se/2),et=we+se*this.visibleI;var yn=(te-se*St)/2;if(k.config.series[q].data[nt].x){var hn=this.detectOverlappingBars({i:q,j:nt,barXPosition:et,srtx:yn,barWidth:se,xDivision:te,initPositions:De});se=hn.barWidth,et=hn.barXPosition}rt=(Ge=this.drawRangeColumnPaths(v({indexes:{i:q,j:nt,realIndex:Me,translationsIndex:Ce},barWidth:se,barXPosition:et,zeroH:de,xDivision:te},wt))).barHeight}var br=this.barHelpers.drawGoalLine({barXPosition:Ge.barXPosition,barYPosition:We,goalX:Ge.goalX,goalY:Ge.goalY,barHeight:rt,barWidth:se});br&&_e.add(br),ke=Ge.y,we=Ge.x;var pt=this.barHelpers.getPathFillColor(S,q,nt,Me),Wt=k.globals.stroke.colors[Me];this.renderSeries({realIndex:Me,pathFill:pt,lineFill:Wt,j:nt,i:q,x:we,y:ke,y1:gt,y2:Jt,pathFrom:Ge.pathFrom,pathTo:Ge.pathTo,strokeWidth:ot,elSeries:Fe,series:S,barHeight:rt,barWidth:se,barXPosition:et,barYPosition:We,columnGroupIndex:Ye,elDataLabelsWrap:Le,elGoalsMarkers:_e,visibleSeries:this.visibleI,type:"rangebar"})}B.add(Fe)}return B}},{key:"detectOverlappingBars",value:function(S){var _=S.i,k=S.j,T=S.barYPosition,B=S.barXPosition,q=S.srty,te=S.srtx,ue=S.barHeight,de=S.barWidth,xe=S.yDivision,we=S.xDivision,ke=S.initPositions,Me=this.w,Ye=[],Fe=Me.config.series[_].data[k].rangeName,rt=Me.config.series[_].data[k].x,se=Array.isArray(rt)?rt.join(" "):rt,Ce=Me.globals.labels.map(function(Le){return Array.isArray(Le)?Le.join(" "):Le}).indexOf(se),De=Me.globals.seriesRange[_].findIndex(function(Le){return Le.x===se&&Le.overlaps.length>0});return this.isHorizontal?(T=Me.config.plotOptions.bar.rangeBarGroupRows?q+xe*Ce:q+ue*this.visibleI+xe*Ce,De>-1&&!Me.config.plotOptions.bar.rangeBarOverlap&&(Ye=Me.globals.seriesRange[_][De].overlaps).indexOf(Fe)>-1&&(T=(ue=ke.barHeight/Ye.length)*this.visibleI+xe*(100-parseInt(this.barOptions.barHeight,10))/100/2+ue*(this.visibleI+Ye.indexOf(Fe))+xe*Ce)):(Ce>-1&&!Me.globals.timescaleLabels.length&&(B=Me.config.plotOptions.bar.rangeBarGroupRows?te+we*Ce:te+de*this.visibleI+we*Ce),De>-1&&!Me.config.plotOptions.bar.rangeBarOverlap&&(Ye=Me.globals.seriesRange[_][De].overlaps).indexOf(Fe)>-1&&(B=(de=ke.barWidth/Ye.length)*this.visibleI+we*(100-parseInt(this.barOptions.barWidth,10))/100/2+de*(this.visibleI+Ye.indexOf(Fe))+we*Ce)),{barYPosition:T,barXPosition:B,barHeight:ue,barWidth:de}}},{key:"drawRangeColumnPaths",value:function(S){var _=S.indexes,k=S.x,T=S.xDivision,B=S.barWidth,q=S.barXPosition,te=S.zeroH,ue=this.w,de=_.i,xe=_.j,we=_.realIndex,ke=_.translationsIndex,Me=this.yRatio[ke],Ye=this.getRangeValue(we,xe),Fe=Math.min(Ye.start,Ye.end),rt=Math.max(Ye.start,Ye.end);this.series[de][xe]===void 0||this.series[de][xe]===null?Fe=te:(Fe=te-Fe/Me,rt=te-rt/Me);var se=Math.abs(rt-Fe),Ce=this.barHelpers.getColumnPaths({barXPosition:q,barWidth:B,y1:Fe,y2:rt,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:we,i:we,j:xe,w:ue});if(ue.globals.isXNumeric){var De=this.getBarXForNumericXAxis({x:k,j:xe,realIndex:we,barWidth:B});k=De.x,q=De.barXPosition}else k+=T;return{pathTo:Ce.pathTo,pathFrom:Ce.pathFrom,barHeight:se,x:k,y:Ye.start<0&&Ye.end<0?Fe:rt,goalY:this.barHelpers.getGoalValues("y",null,te,de,xe,ke),barXPosition:q}}},{key:"preventBarOverflow",value:function(S){var _=this.w;return S<0&&(S=0),S>_.globals.gridWidth&&(S=_.globals.gridWidth),S}},{key:"drawRangeBarPaths",value:function(S){var _=S.indexes,k=S.y,T=S.y1,B=S.y2,q=S.yDivision,te=S.barHeight,ue=S.barYPosition,de=S.zeroW,xe=this.w,we=_.realIndex,ke=_.j,Me=this.preventBarOverflow(de+T/this.invertedYRatio),Ye=this.preventBarOverflow(de+B/this.invertedYRatio),Fe=this.getRangeValue(we,ke),rt=Math.abs(Ye-Me),se=this.barHelpers.getBarpaths({barYPosition:ue,barHeight:te,x1:Me,x2:Ye,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:we,realIndex:we,j:ke,w:xe});return xe.globals.isXNumeric||(k+=q),{pathTo:se.pathTo,pathFrom:se.pathFrom,barWidth:rt,x:Fe.start<0&&Fe.end<0?Me:Ye,goalX:this.barHelpers.getGoalValues("x",de,null,we,ke),y:k}}},{key:"getRangeValue",value:function(S,_){var k=this.w;return{start:k.globals.seriesRangeStart[S][_],end:k.globals.seriesRangeEnd[S][_]}}}]),h}(),ln=function(){function Ee(p){s(this,Ee),this.w=p.w,this.lineCtx=p}return o(Ee,[{key:"sameValueSeriesFix",value:function(p,h){var S=this.w;if((S.config.fill.type==="gradient"||S.config.fill.type[p]==="gradient")&&new X(this.lineCtx.ctx,S).seriesHaveSameValues(p)){var _=h[p].slice();_[_.length-1]=_[_.length-1]+1e-6,h[p]=_}return h}},{key:"calculatePoints",value:function(p){var h=p.series,S=p.realIndex,_=p.x,k=p.y,T=p.i,B=p.j,q=p.prevY,te=this.w,ue=[],de=[];if(B===0){var xe=this.lineCtx.categoryAxisCorrection+te.config.markers.offsetX;te.globals.isXNumeric&&(xe=(te.globals.seriesX[S][0]-te.globals.minX)/this.lineCtx.xRatio+te.config.markers.offsetX),ue.push(xe),de.push(F.isNumber(h[T][0])?q+te.config.markers.offsetY:null),ue.push(_+te.config.markers.offsetX),de.push(F.isNumber(h[T][B+1])?k+te.config.markers.offsetY:null)}else ue.push(_+te.config.markers.offsetX),de.push(F.isNumber(h[T][B+1])?k+te.config.markers.offsetY:null);return{x:ue,y:de}}},{key:"checkPreviousPaths",value:function(p){for(var h=p.pathFromLine,S=p.pathFromArea,_=p.realIndex,k=this.w,T=0;T<k.globals.previousPaths.length;T++){var B=k.globals.previousPaths[T];(B.type==="line"||B.type==="area")&&B.paths.length>0&&parseInt(B.realIndex,10)===parseInt(_,10)&&(B.type==="line"?(this.lineCtx.appendPathFrom=!1,h=k.globals.previousPaths[T].paths[0].d):B.type==="area"&&(this.lineCtx.appendPathFrom=!1,S=k.globals.previousPaths[T].paths[0].d,k.config.stroke.show&&k.globals.previousPaths[T].paths[1]&&(h=k.globals.previousPaths[T].paths[1].d)))}return{pathFromLine:h,pathFromArea:S}}},{key:"determineFirstPrevY",value:function(p){var h,S,_,k=p.i,T=p.realIndex,B=p.series,q=p.prevY,te=p.lineYPosition,ue=p.translationsIndex,de=this.w,xe=de.config.chart.stacked&&!de.globals.comboCharts||de.config.chart.stacked&&de.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||((h=this.w.config.series[T])===null||h===void 0?void 0:h.type)==="bar"||((S=this.w.config.series[T])===null||S===void 0?void 0:S.type)==="column");if(((_=B[k])===null||_===void 0?void 0:_[0])!==void 0)q=(te=xe&&k>0?this.lineCtx.prevSeriesY[k-1][0]:this.lineCtx.zeroY)-B[k][0]/this.lineCtx.yRatio[ue]+2*(this.lineCtx.isReversed?B[k][0]/this.lineCtx.yRatio[ue]:0);else if(xe&&k>0&&B[k][0]===void 0){for(var we=k-1;we>=0;we--)if(B[we][0]!==null&&B[we][0]!==void 0){q=te=this.lineCtx.prevSeriesY[we][0];break}}return{prevY:q,lineYPosition:te}}}]),Ee}(),Oe=function(Ee){for(var p,h,S,_,k=function(ue){for(var de=[],xe=ue[0],we=ue[1],ke=de[0]=Et(xe,we),Me=1,Ye=ue.length-1;Me<Ye;Me++)xe=we,we=ue[Me+1],de[Me]=.5*(ke+(ke=Et(xe,we)));return de[Me]=ke,de}(Ee),T=Ee.length-1,B=[],q=0;q<T;q++)S=Et(Ee[q],Ee[q+1]),Math.abs(S)<1e-6?k[q]=k[q+1]=0:(_=(p=k[q]/S)*p+(h=k[q+1]/S)*h)>9&&(_=3*S/Math.sqrt(_),k[q]=_*p,k[q+1]=_*h);for(var te=0;te<=T;te++)_=(Ee[Math.min(T,te+1)][0]-Ee[Math.max(0,te-1)][0])/(6*(1+k[te]*k[te])),B.push([_||0,k[te]*_||0]);return B},sn=function(Ee){var p=Oe(Ee),h=Ee[1],S=Ee[0],_=[],k=p[1],T=p[0];_.push(S,[S[0]+T[0],S[1]+T[1],h[0]-k[0],h[1]-k[1],h[0],h[1]]);for(var B=2,q=p.length;B<q;B++){var te=Ee[B],ue=p[B];_.push([te[0]-ue[0],te[1]-ue[1],te[0],te[1]])}return _},fn=function(Ee,p,h){var S=Ee.slice(p,h);if(p){if(h-p>1&&S[1].length<6){var _=S[0].length;S[1]=[2*S[0][_-2]-S[0][_-4],2*S[0][_-1]-S[0][_-3]].concat(S[1])}S[0]=S[0].slice(-2)}return S};function Et(Ee,p){return(p[1]-Ee[1])/(p[0]-Ee[0])}var Kn=function(){function Ee(p,h,S){s(this,Ee),this.ctx=p,this.w=p.w,this.xyRatios=h,this.pointsChart=!(this.w.config.chart.type!=="bubble"&&this.w.config.chart.type!=="scatter")||S,this.scatter=new je(this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new ln(this),this.markers=new be(this.ctx),this.prevSeriesY=[],this.categoryAxisCorrection=0,this.yaxisIndex=0}return o(Ee,[{key:"draw",value:function(p,h,S,_){var k,T=this.w,B=new z(this.ctx),q=T.globals.comboCharts?h:T.config.chart.type,te=B.group({class:"apexcharts-".concat(q,"-series apexcharts-plot-series")}),ue=new X(this.ctx,T);this.yRatio=this.xyRatios.yRatio,this.zRatio=this.xyRatios.zRatio,this.xRatio=this.xyRatios.xRatio,this.baseLineY=this.xyRatios.baseLineY,p=ue.getLogSeries(p),this.yRatio=ue.getLogYRatios(this.yRatio),this.prevSeriesY=[];for(var de=[],xe=0;xe<p.length;xe++){p=this.lineHelpers.sameValueSeriesFix(xe,p);var we=T.globals.comboCharts?S[xe]:xe,ke=this.yRatio.length>1?we:0;this._initSerieVariables(p,xe,we);var Me=[],Ye=[],Fe=[],rt=T.globals.padHorizontal+this.categoryAxisCorrection;this.ctx.series.addCollapsedClassToSeries(this.elSeries,we),T.globals.isXNumeric&&T.globals.seriesX.length>0&&(rt=(T.globals.seriesX[we][0]-T.globals.minX)/this.xRatio),Fe.push(rt);var se,Ce=rt,De=void 0,Le=Ce,_e=this.zeroY,nt=this.zeroY;_e=this.lineHelpers.determineFirstPrevY({i:xe,realIndex:we,series:p,prevY:_e,lineYPosition:0,translationsIndex:ke}).prevY,T.config.stroke.curve==="monotoneCubic"&&p[xe][0]===null?Me.push(null):Me.push(_e),se=_e,q==="rangeArea"&&(De=nt=this.lineHelpers.determineFirstPrevY({i:xe,realIndex:we,series:_,prevY:nt,lineYPosition:0,translationsIndex:ke}).prevY,Ye.push(Me[0]!==null?nt:null));var ot=this._calculatePathsFrom({type:q,series:p,i:xe,realIndex:we,translationsIndex:ke,prevX:Le,prevY:_e,prevY2:nt}),gt=[Me[0]],Jt=[Ye[0]],Ge={type:q,series:p,realIndex:we,translationsIndex:ke,i:xe,x:rt,y:1,pX:Ce,pY:se,pathsFrom:ot,linePaths:[],areaPaths:[],seriesIndex:S,lineYPosition:0,xArrj:Fe,yArrj:Me,y2Arrj:Ye,seriesRangeEnd:_},et=this._iterateOverDataPoints(v(v({},Ge),{},{iterations:q==="rangeArea"?p[xe].length-1:void 0,isRangeStart:!0}));if(q==="rangeArea"){for(var We=this._calculatePathsFrom({series:_,i:xe,realIndex:we,prevX:Le,prevY:nt}),wt=this._iterateOverDataPoints(v(v({},Ge),{},{series:_,xArrj:[rt],yArrj:gt,y2Arrj:Jt,pY:De,areaPaths:et.areaPaths,pathsFrom:We,iterations:_[xe].length-1,isRangeStart:!1})),St=et.linePaths.length/2,Kt=0;Kt<St;Kt++)et.linePaths[Kt]=wt.linePaths[Kt+St]+et.linePaths[Kt];et.linePaths.splice(St),et.pathFromLine=wt.pathFromLine+et.pathFromLine}else et.pathFromArea+="z";this._handlePaths({type:q,realIndex:we,i:xe,paths:et}),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),de.push(this.elSeries)}if(((k=T.config.series[0])===null||k===void 0?void 0:k.zIndex)!==void 0&&de.sort(function(hn,br){return Number(hn.node.getAttribute("zIndex"))-Number(br.node.getAttribute("zIndex"))}),T.config.chart.stacked)for(var gn=de.length-1;gn>=0;gn--)te.add(de[gn]);else for(var yn=0;yn<de.length;yn++)te.add(de[yn]);return te}},{key:"_initSerieVariables",value:function(p,h,S){var _=this.w,k=new z(this.ctx);this.xDivision=_.globals.gridWidth/(_.globals.dataPoints-(_.config.xaxis.tickPlacement==="on"?1:0)),this.strokeWidth=Array.isArray(_.config.stroke.width)?_.config.stroke.width[S]:_.config.stroke.width;var T=0;this.yRatio.length>1&&(this.yaxisIndex=_.globals.seriesYAxisReverseMap[S],T=S),this.isReversed=_.config.yaxis[this.yaxisIndex]&&_.config.yaxis[this.yaxisIndex].reversed,this.zeroY=_.globals.gridHeight-this.baseLineY[T]-(this.isReversed?_.globals.gridHeight:0)+(this.isReversed?2*this.baseLineY[T]:0),this.areaBottomY=this.zeroY,(this.zeroY>_.globals.gridHeight||_.config.plotOptions.area.fillTo==="end")&&(this.areaBottomY=_.globals.gridHeight),this.categoryAxisCorrection=this.xDivision/2,this.elSeries=k.group({class:"apexcharts-series",zIndex:_.config.series[S].zIndex!==void 0?_.config.series[S].zIndex:S,seriesName:F.escapeString(_.globals.seriesNames[S])}),this.elPointsMain=k.group({class:"apexcharts-series-markers-wrap","data:realIndex":S}),this.elDataLabelsWrap=k.group({class:"apexcharts-datalabels","data:realIndex":S});var B=p[h].length===_.globals.dataPoints;this.elSeries.attr({"data:longestSeries":B,rel:h+1,"data:realIndex":S}),this.appendPathFrom=!0}},{key:"_calculatePathsFrom",value:function(p){var h,S,_,k,T=p.type,B=p.series,q=p.i,te=p.realIndex,ue=p.translationsIndex,de=p.prevX,xe=p.prevY,we=p.prevY2,ke=this.w,Me=new z(this.ctx);if(B[q][0]===null){for(var Ye=0;Ye<B[q].length;Ye++)if(B[q][Ye]!==null){de=this.xDivision*Ye,xe=this.zeroY-B[q][Ye]/this.yRatio[ue],h=Me.move(de,xe),S=Me.move(de,this.areaBottomY);break}}else h=Me.move(de,xe),T==="rangeArea"&&(h=Me.move(de,we)+Me.line(de,xe)),S=Me.move(de,this.areaBottomY)+Me.line(de,xe);if(_=Me.move(0,this.zeroY)+Me.line(0,this.zeroY),k=Me.move(0,this.zeroY)+Me.line(0,this.zeroY),ke.globals.previousPaths.length>0){var Fe=this.lineHelpers.checkPreviousPaths({pathFromLine:_,pathFromArea:k,realIndex:te});_=Fe.pathFromLine,k=Fe.pathFromArea}return{prevX:de,prevY:xe,linePath:h,areaPath:S,pathFromLine:_,pathFromArea:k}}},{key:"_handlePaths",value:function(p){var h=p.type,S=p.realIndex,_=p.i,k=p.paths,T=this.w,B=new z(this.ctx),q=new Ne(this.ctx);this.prevSeriesY.push(k.yArrj),T.globals.seriesXvalues[S]=k.xArrj,T.globals.seriesYvalues[S]=k.yArrj;var te=T.config.forecastDataPoints;if(te.count>0&&h!=="rangeArea"){var ue=T.globals.seriesXvalues[S][T.globals.seriesXvalues[S].length-te.count-1],de=B.drawRect(ue,0,T.globals.gridWidth,T.globals.gridHeight,0);T.globals.dom.elForecastMask.appendChild(de.node);var xe=B.drawRect(0,0,ue,T.globals.gridHeight,0);T.globals.dom.elNonForecastMask.appendChild(xe.node)}this.pointsChart||T.globals.delayedElements.push({el:this.elPointsMain.node,index:S});var we={i:_,realIndex:S,animationDelay:_,initialSpeed:T.config.chart.animations.speed,dataChangeSpeed:T.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(h)};if(h==="area")for(var ke=q.fillPath({seriesNumber:S}),Me=0;Me<k.areaPaths.length;Me++){var Ye=B.renderPaths(v(v({},we),{},{pathFrom:k.pathFromArea,pathTo:k.areaPaths[Me],stroke:"none",strokeWidth:0,strokeLineCap:null,fill:ke}));this.elSeries.add(Ye)}if(T.config.stroke.show&&!this.pointsChart){var Fe=null;if(h==="line")Fe=q.fillPath({seriesNumber:S,i:_});else if(T.config.stroke.fill.type==="solid")Fe=T.globals.stroke.colors[S];else{var rt=T.config.fill;T.config.fill=T.config.stroke.fill,Fe=q.fillPath({seriesNumber:S,i:_}),T.config.fill=rt}for(var se=0;se<k.linePaths.length;se++){var Ce=Fe;h==="rangeArea"&&(Ce=q.fillPath({seriesNumber:S}));var De=v(v({},we),{},{pathFrom:k.pathFromLine,pathTo:k.linePaths[se],stroke:Fe,strokeWidth:this.strokeWidth,strokeLineCap:T.config.stroke.lineCap,fill:h==="rangeArea"?Ce:"none"}),Le=B.renderPaths(De);if(this.elSeries.add(Le),Le.attr("fill-rule","evenodd"),te.count>0&&h!=="rangeArea"){var _e=B.renderPaths(De);_e.node.setAttribute("stroke-dasharray",te.dashArray),te.strokeWidth&&_e.node.setAttribute("stroke-width",te.strokeWidth),this.elSeries.add(_e),_e.attr("clip-path","url(#forecastMask".concat(T.globals.cuid,")")),Le.attr("clip-path","url(#nonForecastMask".concat(T.globals.cuid,")"))}}}}},{key:"_iterateOverDataPoints",value:function(p){var h,S,_=this,k=p.type,T=p.series,B=p.iterations,q=p.realIndex,te=p.translationsIndex,ue=p.i,de=p.x,xe=p.y,we=p.pX,ke=p.pY,Me=p.pathsFrom,Ye=p.linePaths,Fe=p.areaPaths,rt=p.seriesIndex,se=p.lineYPosition,Ce=p.xArrj,De=p.yArrj,Le=p.y2Arrj,_e=p.isRangeStart,nt=p.seriesRangeEnd,ot=this.w,gt=new z(this.ctx),Jt=this.yRatio,Ge=Me.prevY,et=Me.linePath,We=Me.areaPath,wt=Me.pathFromLine,St=Me.pathFromArea,Kt=F.isNumber(ot.globals.minYArr[q])?ot.globals.minYArr[q]:ot.globals.minY;B||(B=ot.globals.dataPoints>1?ot.globals.dataPoints-1:ot.globals.dataPoints);var gn=function(fr,ur){return ur-fr/Jt[te]+2*(_.isReversed?fr/Jt[te]:0)},yn=xe,hn=ot.config.chart.stacked&&!ot.globals.comboCharts||ot.config.chart.stacked&&ot.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||((h=this.w.config.series[q])===null||h===void 0?void 0:h.type)==="bar"||((S=this.w.config.series[q])===null||S===void 0?void 0:S.type)==="column"),br=ot.config.stroke.curve;Array.isArray(br)&&(br=Array.isArray(rt)?br[rt[ue]]:br[ue]);for(var pt,Wt=0,Zt=0;Zt<B;Zt++){var vt=T[ue][Zt+1]===void 0||T[ue][Zt+1]===null;if(ot.globals.isXNumeric){var Ot=ot.globals.seriesX[q][Zt+1];ot.globals.seriesX[q][Zt+1]===void 0&&(Ot=ot.globals.seriesX[q][B-1]),de=(Ot-ot.globals.minX)/this.xRatio}else de+=this.xDivision;hn?ue>0&&ot.globals.collapsedSeries.length<ot.config.series.length-1?se=this.prevSeriesY[function(fr){for(var ur=fr;ur>0;ur--){if(!(ot.globals.collapsedSeriesIndices.indexOf((rt==null?void 0:rt[ur])||ur)>-1))return ur;ur--}return 0}(ue-1)][Zt+1]:se=this.zeroY:se=this.zeroY,vt?xe=gn(Kt,se):(xe=gn(T[ue][Zt+1],se),k==="rangeArea"&&(yn=gn(nt[ue][Zt+1],se))),Ce.push(de),!vt||ot.config.stroke.curve!=="smooth"&&ot.config.stroke.curve!=="monotoneCubic"?(De.push(xe),Le.push(yn)):(De.push(null),Le.push(null));var wn=this.lineHelpers.calculatePoints({series:T,x:de,y:xe,realIndex:q,i:ue,j:Zt,prevY:Ge}),Gn=this._createPaths({type:k,series:T,i:ue,realIndex:q,j:Zt,x:de,y:xe,y2:yn,xArrj:Ce,yArrj:De,y2Arrj:Le,pX:we,pY:ke,pathState:Wt,segmentStartX:pt,linePath:et,areaPath:We,linePaths:Ye,areaPaths:Fe,curve:br,isRangeStart:_e});Fe=Gn.areaPaths,Ye=Gn.linePaths,we=Gn.pX,ke=Gn.pY,Wt=Gn.pathState,pt=Gn.segmentStartX,We=Gn.areaPath,et=Gn.linePath,!this.appendPathFrom||br==="monotoneCubic"&&k==="rangeArea"||(wt+=gt.line(de,this.zeroY),St+=gt.line(de,this.zeroY)),this.handleNullDataPoints(T,wn,ue,Zt,q),this._handleMarkersAndLabels({type:k,pointsPos:wn,i:ue,j:Zt,realIndex:q,isRangeStart:_e})}return{yArrj:De,xArrj:Ce,pathFromArea:St,areaPaths:Fe,pathFromLine:wt,linePaths:Ye,linePath:et,areaPath:We}}},{key:"_handleMarkersAndLabels",value:function(p){var h=p.type,S=p.pointsPos,_=p.isRangeStart,k=p.i,T=p.j,B=p.realIndex,q=this.w,te=new Ie(this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,T,{realIndex:B,pointsPos:S,zRatio:this.zRatio,elParent:this.elPointsMain});else{q.globals.series[k].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");var ue=this.markers.plotChartMarkers(S,B,T+1);ue!==null&&this.elPointsMain.add(ue)}var de=te.drawDataLabel({type:h,isRangeStart:_,pos:S,i:B,j:T+1});de!==null&&this.elDataLabelsWrap.add(de)}},{key:"_createPaths",value:function(p){var h=p.type,S=p.series,_=p.i;p.realIndex;var k,T=p.j,B=p.x,q=p.y,te=p.xArrj,ue=p.yArrj,de=p.y2,xe=p.y2Arrj,we=p.pX,ke=p.pY,Me=p.pathState,Ye=p.segmentStartX,Fe=p.linePath,rt=p.areaPath,se=p.linePaths,Ce=p.areaPaths,De=p.curve,Le=p.isRangeStart,_e=new z(this.ctx),nt=this.areaBottomY,ot=h==="rangeArea",gt=h==="rangeArea"&&Le;switch(De){case"monotoneCubic":var Jt=Le?ue:xe;switch(Me){case 0:if(Jt[T+1]===null)break;Me=1;case 1:if(!(ot?te.length===S[_].length:T===S[_].length-2))break;case 2:var Ge=Le?te:te.slice().reverse(),et=Le?Jt:Jt.slice().reverse(),We=(k=et,Ge.map(function(Ot,wn){return[Ot,k[wn]]}).filter(function(Ot){return Ot[1]!==null})),wt=We.length>1?sn(We):We,St=[];ot&&(gt?Ce=We:St=Ce.reverse());var Kt=0,gn=0;if(function(Ot,wn){for(var Gn=function(nn){var Vn=[],lr=0;return nn.forEach(function(er){er!==null?lr++:lr>0&&(Vn.push(lr),lr=0)}),lr>0&&Vn.push(lr),Vn}(Ot),fr=[],ur=0,$t=0;ur<Gn.length;$t+=Gn[ur++])fr[ur]=fn(wn,$t,$t+Gn[ur]);return fr}(et,wt).forEach(function(Ot){Kt++;var wn=function(ur){for(var $t="",nn=0;nn<ur.length;nn++){var Vn=ur[nn],lr=Vn.length;lr>4?($t+="C".concat(Vn[0],", ").concat(Vn[1]),$t+=", ".concat(Vn[2],", ").concat(Vn[3]),$t+=", ".concat(Vn[4],", ").concat(Vn[5])):lr>2&&($t+="S".concat(Vn[0],", ").concat(Vn[1]),$t+=", ".concat(Vn[2],", ").concat(Vn[3]))}return $t}(Ot),Gn=gn,fr=(gn+=Ot.length)-1;gt?Fe=_e.move(We[Gn][0],We[Gn][1])+wn:ot?Fe=_e.move(St[Gn][0],St[Gn][1])+_e.line(We[Gn][0],We[Gn][1])+wn+_e.line(St[fr][0],St[fr][1]):(Fe=_e.move(We[Gn][0],We[Gn][1])+wn,rt=Fe+_e.line(We[fr][0],nt)+_e.line(We[Gn][0],nt)+"z",Ce.push(rt)),se.push(Fe)}),ot&&Kt>1&&!gt){var yn=se.slice(Kt).reverse();se.splice(Kt),yn.forEach(function(Ot){return se.push(Ot)})}Me=0}break;case"smooth":var hn=.35*(B-we);if(S[_][T]===null)Me=0;else switch(Me){case 0:if(Ye=we,Fe=gt?_e.move(we,xe[T])+_e.line(we,ke):_e.move(we,ke),rt=_e.move(we,ke),S[_][T+1]===null){se.push(Fe),Ce.push(rt);break}if(Me=1,T<S[_].length-2){var br=_e.curve(we+hn,ke,B-hn,q,B,q);Fe+=br,rt+=br;break}case 1:if(S[_][T+1]===null)Fe+=gt?_e.line(we,de):_e.move(we,ke),rt+=_e.line(we,nt)+_e.line(Ye,nt)+"z",se.push(Fe),Ce.push(rt),Me=-1;else{var pt=_e.curve(we+hn,ke,B-hn,q,B,q);Fe+=pt,rt+=pt,T>=S[_].length-2&&(gt&&(Fe+=_e.curve(B,q,B,q,B,de)+_e.move(B,de)),rt+=_e.curve(B,q,B,q,B,nt)+_e.line(Ye,nt)+"z",se.push(Fe),Ce.push(rt),Me=-1)}}we=B,ke=q;break;default:var Wt=function(Ot,wn,Gn){var fr=[];switch(Ot){case"stepline":fr=_e.line(wn,null,"H")+_e.line(null,Gn,"V");break;case"linestep":fr=_e.line(null,Gn,"V")+_e.line(wn,null,"H");break;case"straight":fr=_e.line(wn,Gn)}return fr};if(S[_][T]===null)Me=0;else switch(Me){case 0:if(Ye=we,Fe=gt?_e.move(we,xe[T])+_e.line(we,ke):_e.move(we,ke),rt=_e.move(we,ke),S[_][T+1]===null){se.push(Fe),Ce.push(rt);break}if(Me=1,T<S[_].length-2){var Zt=Wt(De,B,q);Fe+=Zt,rt+=Zt;break}case 1:if(S[_][T+1]===null)Fe+=gt?_e.line(we,de):_e.move(we,ke),rt+=_e.line(we,nt)+_e.line(Ye,nt)+"z",se.push(Fe),Ce.push(rt),Me=-1;else{var vt=Wt(De,B,q);Fe+=vt,rt+=vt,T>=S[_].length-2&&(gt&&(Fe+=_e.line(B,de)),rt+=_e.line(B,nt)+_e.line(Ye,nt)+"z",se.push(Fe),Ce.push(rt),Me=-1)}}we=B,ke=q}return{linePaths:se,areaPaths:Ce,pX:we,pY:ke,pathState:Me,segmentStartX:Ye,linePath:Fe,areaPath:rt}}},{key:"handleNullDataPoints",value:function(p,h,S,_,k){var T=this.w;if(p[S][_]===null&&T.config.markers.showNullDataPoints||p[S].length===1){var B=this.strokeWidth-T.config.markers.strokeWidth/2;B>0||(B=0);var q=this.markers.plotChartMarkers(h,k,_+1,B,!0);q!==null&&this.elPointsMain.add(q)}}}]),Ee}();window.TreemapSquared={},window.TreemapSquared.generate=function(){function Ee(B,q,te,ue){this.xoffset=B,this.yoffset=q,this.height=ue,this.width=te,this.shortestEdge=function(){return Math.min(this.height,this.width)},this.getCoordinates=function(de){var xe,we=[],ke=this.xoffset,Me=this.yoffset,Ye=k(de)/this.height,Fe=k(de)/this.width;if(this.width>=this.height)for(xe=0;xe<de.length;xe++)we.push([ke,Me,ke+Ye,Me+de[xe]/Ye]),Me+=de[xe]/Ye;else for(xe=0;xe<de.length;xe++)we.push([ke,Me,ke+de[xe]/Fe,Me+Fe]),ke+=de[xe]/Fe;return we},this.cutArea=function(de){var xe;if(this.width>=this.height){var we=de/this.height,ke=this.width-we;xe=new Ee(this.xoffset+we,this.yoffset,ke,this.height)}else{var Me=de/this.width,Ye=this.height-Me;xe=new Ee(this.xoffset,this.yoffset+Me,this.width,Ye)}return xe}}function p(B,q,te,ue,de){ue=ue===void 0?0:ue,de=de===void 0?0:de;var xe=h(function(we,ke){var Me,Ye=[],Fe=ke/k(we);for(Me=0;Me<we.length;Me++)Ye[Me]=we[Me]*Fe;return Ye}(B,q*te),[],new Ee(ue,de,q,te),[]);return function(we){var ke,Me,Ye=[];for(ke=0;ke<we.length;ke++)for(Me=0;Me<we[ke].length;Me++)Ye.push(we[ke][Me]);return Ye}(xe)}function h(B,q,te,ue){var de,xe,we;if(B.length!==0)return de=te.shortestEdge(),function(ke,Me,Ye){var Fe;if(ke.length===0)return!0;(Fe=ke.slice()).push(Me);var rt=S(ke,Ye),se=S(Fe,Ye);return rt>=se}(q,xe=B[0],de)?(q.push(xe),h(B.slice(1),q,te,ue)):(we=te.cutArea(k(q),ue),ue.push(te.getCoordinates(q)),h(B,[],we,ue)),ue;ue.push(te.getCoordinates(q))}function S(B,q){var te=Math.min.apply(Math,B),ue=Math.max.apply(Math,B),de=k(B);return Math.max(Math.pow(q,2)*ue/Math.pow(de,2),Math.pow(de,2)/(Math.pow(q,2)*te))}function _(B){return B&&B.constructor===Array}function k(B){var q,te=0;for(q=0;q<B.length;q++)te+=B[q];return te}function T(B){var q,te=0;if(_(B[0]))for(q=0;q<B.length;q++)te+=T(B[q]);else te=k(B);return te}return function B(q,te,ue,de,xe){de=de===void 0?0:de,xe=xe===void 0?0:xe;var we,ke,Me=[],Ye=[];if(_(q[0])){for(ke=0;ke<q.length;ke++)Me[ke]=T(q[ke]);for(we=p(Me,te,ue,de,xe),ke=0;ke<q.length;ke++)Ye.push(B(q[ke],we[ke][2]-we[ke][0],we[ke][3]-we[ke][1],we[ke][0],we[ke][1]))}else Ye=p(q,te,ue,de,xe);return Ye}}();var Cn,Bt,an=function(){function Ee(p,h){s(this,Ee),this.ctx=p,this.w=p.w,this.strokeWidth=this.w.config.stroke.width,this.helpers=new kn(p),this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.labels=[]}return o(Ee,[{key:"draw",value:function(p){var h=this,S=this.w,_=new z(this.ctx),k=new Ne(this.ctx),T=_.group({class:"apexcharts-treemap"});if(S.globals.noData)return T;var B=[];return p.forEach(function(q){var te=q.map(function(ue){return Math.abs(ue)});B.push(te)}),this.negRange=this.helpers.checkColorRange(),S.config.series.forEach(function(q,te){q.data.forEach(function(ue){Array.isArray(h.labels[te])||(h.labels[te]=[]),h.labels[te].push(ue.x)})}),window.TreemapSquared.generate(B,S.globals.gridWidth,S.globals.gridHeight).forEach(function(q,te){var ue=_.group({class:"apexcharts-series apexcharts-treemap-series",seriesName:F.escapeString(S.globals.seriesNames[te]),rel:te+1,"data:realIndex":te});if(S.config.chart.dropShadow.enabled){var de=S.config.chart.dropShadow;new L(h.ctx).dropShadow(T,de,te)}var xe=_.group({class:"apexcharts-data-labels"});q.forEach(function(we,ke){var Me=we[0],Ye=we[1],Fe=we[2],rt=we[3],se=_.drawRect(Me,Ye,Fe-Me,rt-Ye,S.config.plotOptions.treemap.borderRadius,"#fff",1,h.strokeWidth,S.config.plotOptions.treemap.useFillColorAsStroke?De:S.globals.stroke.colors[te]);se.attr({cx:Me,cy:Ye,index:te,i:te,j:ke,width:Fe-Me,height:rt-Ye});var Ce=h.helpers.getShadeColor(S.config.chart.type,te,ke,h.negRange),De=Ce.color;S.config.series[te].data[ke]!==void 0&&S.config.series[te].data[ke].fillColor&&(De=S.config.series[te].data[ke].fillColor);var Le=k.fillPath({color:De,seriesNumber:te,dataPointIndex:ke});se.node.classList.add("apexcharts-treemap-rect"),se.attr({fill:Le}),h.helpers.addListeners(se);var _e={x:Me+(Fe-Me)/2,y:Ye+(rt-Ye)/2,width:0,height:0},nt={x:Me,y:Ye,width:Fe-Me,height:rt-Ye};if(S.config.chart.animations.enabled&&!S.globals.dataChanged){var ot=1;S.globals.resized||(ot=S.config.chart.animations.speed),h.animateTreemap(se,_e,nt,ot)}if(S.globals.dataChanged){var gt=1;h.dynamicAnim.enabled&&S.globals.shouldAnimate&&(gt=h.dynamicAnim.speed,S.globals.previousPaths[te]&&S.globals.previousPaths[te][ke]&&S.globals.previousPaths[te][ke].rect&&(_e=S.globals.previousPaths[te][ke].rect),h.animateTreemap(se,_e,nt,gt))}var Jt=h.getFontSize(we),Ge=S.config.dataLabels.formatter(h.labels[te][ke],{value:S.globals.series[te][ke],seriesIndex:te,dataPointIndex:ke,w:S});S.config.plotOptions.treemap.dataLabels.format==="truncate"&&(Jt=parseInt(S.config.dataLabels.style.fontSize,10),Ge=h.truncateLabels(Ge,Jt,Me,Ye,Fe,rt));var et=null;S.globals.series[te][ke]&&(et=h.helpers.calculateDataLabels({text:Ge,x:(Me+Fe)/2,y:(Ye+rt)/2+h.strokeWidth/2+Jt/3,i:te,j:ke,colorProps:Ce,fontSize:Jt,series:p})),S.config.dataLabels.enabled&&et&&h.rotateToFitLabel(et,Jt,Ge,Me,Ye,Fe,rt),ue.add(se),et!==null&&ue.add(et)}),ue.add(xe),T.add(ue)}),T}},{key:"getFontSize",value:function(p){var h=this.w,S,_,k,T,B=function q(te){var ue,de=0;if(Array.isArray(te[0]))for(ue=0;ue<te.length;ue++)de+=q(te[ue]);else for(ue=0;ue<te.length;ue++)de+=te[ue].length;return de}(this.labels)/function q(te){var ue,de=0;if(Array.isArray(te[0]))for(ue=0;ue<te.length;ue++)de+=q(te[ue]);else for(ue=0;ue<te.length;ue++)de+=1;return de}(this.labels);return S=p[2]-p[0],_=p[3]-p[1],k=S*_,T=Math.pow(k,.5),Math.min(T/B,parseInt(h.config.dataLabels.style.fontSize,10))}},{key:"rotateToFitLabel",value:function(p,h,S,_,k,T,B){var q=new z(this.ctx),te=q.getTextRects(S,h);if(te.width+this.w.config.stroke.width+5>T-_&&te.width<=B-k){var ue=q.rotateAroundCenter(p.node);p.node.setAttribute("transform","rotate(-90 ".concat(ue.x," ").concat(ue.y,") translate(").concat(te.height/3,")"))}}},{key:"truncateLabels",value:function(p,h,S,_,k,T){var B=new z(this.ctx),q=B.getTextRects(p,h).width+this.w.config.stroke.width+5>k-S&&T-_>k-S?T-_:k-S,te=B.getTextBasedOnMaxWidth({text:p,maxWidth:q,fontSize:h});return p.length!==te.length&&q/h<5?"":te}},{key:"animateTreemap",value:function(p,h,S,_){var k=new U(this.ctx);k.animateRect(p,{x:h.x,y:h.y,width:h.width,height:h.height},{x:S.x,y:S.y,width:S.width,height:S.height},_,function(){k.animationCompleted(p)})}}]),Ee}(),Pn=86400,qn=10/Pn,nr=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w,this.timeScaleArray=[],this.utc=this.w.config.xaxis.labels.datetimeUTC}return o(Ee,[{key:"calculateTimeScaleTicks",value:function(p,h){var S=this,_=this.w;if(_.globals.allSeriesCollapsed)return _.globals.labels=[],_.globals.timescaleLabels=[],[];var k=new Z(this.ctx),T=(h-p)/864e5;this.determineInterval(T),_.globals.disableZoomIn=!1,_.globals.disableZoomOut=!1,T<qn?_.globals.disableZoomIn=!0:T>5e4&&(_.globals.disableZoomOut=!0);var B=k.getTimeUnitsfromTimestamp(p,h,this.utc),q=_.globals.gridWidth/T,te=q/24,ue=te/60,de=ue/60,xe=Math.floor(24*T),we=Math.floor(1440*T),ke=Math.floor(T*Pn),Me=Math.floor(T),Ye=Math.floor(T/30),Fe=Math.floor(T/365),rt={minMillisecond:B.minMillisecond,minSecond:B.minSecond,minMinute:B.minMinute,minHour:B.minHour,minDate:B.minDate,minMonth:B.minMonth,minYear:B.minYear},se={firstVal:rt,currentMillisecond:rt.minMillisecond,currentSecond:rt.minSecond,currentMinute:rt.minMinute,currentHour:rt.minHour,currentMonthDate:rt.minDate,currentDate:rt.minDate,currentMonth:rt.minMonth,currentYear:rt.minYear,daysWidthOnXAxis:q,hoursWidthOnXAxis:te,minutesWidthOnXAxis:ue,secondsWidthOnXAxis:de,numberOfSeconds:ke,numberOfMinutes:we,numberOfHours:xe,numberOfDays:Me,numberOfMonths:Ye,numberOfYears:Fe};switch(this.tickInterval){case"years":this.generateYearScale(se);break;case"months":case"half_year":this.generateMonthScale(se);break;case"months_days":case"months_fortnight":case"days":case"week_days":this.generateDayScale(se);break;case"hours":this.generateHourScale(se);break;case"minutes_fives":case"minutes":this.generateMinuteScale(se);break;case"seconds_tens":case"seconds_fives":case"seconds":this.generateSecondScale(se)}var Ce=this.timeScaleArray.map(function(De){var Le={position:De.position,unit:De.unit,year:De.year,day:De.day?De.day:1,hour:De.hour?De.hour:0,month:De.month+1};return De.unit==="month"?v(v({},Le),{},{day:1,value:De.value+1}):De.unit==="day"||De.unit==="hour"?v(v({},Le),{},{value:De.value}):De.unit==="minute"?v(v({},Le),{},{value:De.value,minute:De.value}):De.unit==="second"?v(v({},Le),{},{value:De.value,minute:De.minute,second:De.second}):De});return Ce.filter(function(De){var Le=1,_e=Math.ceil(_.globals.gridWidth/120),nt=De.value;_.config.xaxis.tickAmount!==void 0&&(_e=_.config.xaxis.tickAmount),Ce.length>_e&&(Le=Math.floor(Ce.length/_e));var ot=!1,gt=!1;switch(S.tickInterval){case"years":De.unit==="year"&&(ot=!0);break;case"half_year":Le=7,De.unit==="year"&&(ot=!0);break;case"months":Le=1,De.unit==="year"&&(ot=!0);break;case"months_fortnight":Le=15,De.unit!=="year"&&De.unit!=="month"||(ot=!0),nt===30&&(gt=!0);break;case"months_days":Le=10,De.unit==="month"&&(ot=!0),nt===30&&(gt=!0);break;case"week_days":Le=8,De.unit==="month"&&(ot=!0);break;case"days":Le=1,De.unit==="month"&&(ot=!0);break;case"hours":De.unit==="day"&&(ot=!0);break;case"minutes_fives":case"seconds_fives":nt%5!=0&&(gt=!0);break;case"seconds_tens":nt%10!=0&&(gt=!0)}if(S.tickInterval==="hours"||S.tickInterval==="minutes_fives"||S.tickInterval==="seconds_tens"||S.tickInterval==="seconds_fives"){if(!gt)return!0}else if((nt%Le==0||ot)&&!gt)return!0})}},{key:"recalcDimensionsBasedOnFormat",value:function(p,h){var S=this.w,_=this.formatDates(p),k=this.removeOverlappingTS(_);S.globals.timescaleLabels=k.slice(),new Ke(this.ctx).plotCoords()}},{key:"determineInterval",value:function(p){var h=24*p,S=60*h;switch(!0){case p/365>5:this.tickInterval="years";break;case p>800:this.tickInterval="half_year";break;case p>180:this.tickInterval="months";break;case p>90:this.tickInterval="months_fortnight";break;case p>60:this.tickInterval="months_days";break;case p>30:this.tickInterval="week_days";break;case p>2:this.tickInterval="days";break;case h>2.4:this.tickInterval="hours";break;case S>15:this.tickInterval="minutes_fives";break;case S>5:this.tickInterval="minutes";break;case S>1:this.tickInterval="seconds_tens";break;case 60*S>20:this.tickInterval="seconds_fives";break;default:this.tickInterval="seconds"}}},{key:"generateYearScale",value:function(p){var h=p.firstVal,S=p.currentMonth,_=p.currentYear,k=p.daysWidthOnXAxis,T=p.numberOfYears,B=h.minYear,q=0,te=new Z(this.ctx),ue="year";if(h.minDate>1||h.minMonth>0){var de=te.determineRemainingDaysOfYear(h.minYear,h.minMonth,h.minDate);q=(te.determineDaysOfYear(h.minYear)-de+1)*k,B=h.minYear+1,this.timeScaleArray.push({position:q,value:B,unit:ue,year:B,month:F.monthMod(S+1)})}else h.minDate===1&&h.minMonth===0&&this.timeScaleArray.push({position:q,value:B,unit:ue,year:_,month:F.monthMod(S+1)});for(var xe=B,we=q,ke=0;ke<T;ke++)xe++,we=te.determineDaysOfYear(xe-1)*k+we,this.timeScaleArray.push({position:we,value:xe,unit:ue,year:xe,month:1})}},{key:"generateMonthScale",value:function(p){var h=p.firstVal,S=p.currentMonthDate,_=p.currentMonth,k=p.currentYear,T=p.daysWidthOnXAxis,B=p.numberOfMonths,q=_,te=0,ue=new Z(this.ctx),de="month",xe=0;if(h.minDate>1){te=(ue.determineDaysOfMonths(_+1,h.minYear)-S+1)*T,q=F.monthMod(_+1);var we=k+xe,ke=F.monthMod(q),Me=q;q===0&&(de="year",Me=we,ke=1,we+=xe+=1),this.timeScaleArray.push({position:te,value:Me,unit:de,year:we,month:ke})}else this.timeScaleArray.push({position:te,value:q,unit:de,year:k,month:F.monthMod(_)});for(var Ye=q+1,Fe=te,rt=0,se=1;rt<B;rt++,se++){(Ye=F.monthMod(Ye))===0?(de="year",xe+=1):de="month";var Ce=this._getYear(k,Ye,xe);Fe=ue.determineDaysOfMonths(Ye,Ce)*T+Fe;var De=Ye===0?Ce:Ye;this.timeScaleArray.push({position:Fe,value:De,unit:de,year:Ce,month:Ye===0?1:Ye}),Ye++}}},{key:"generateDayScale",value:function(p){var h=p.firstVal,S=p.currentMonth,_=p.currentYear,k=p.hoursWidthOnXAxis,T=p.numberOfDays,B=new Z(this.ctx),q="day",te=h.minDate+1,ue=te,de=function(se,Ce,De){return se>B.determineDaysOfMonths(Ce+1,De)&&(ue=1,q="month",we=Ce+=1),Ce},xe=(24-h.minHour)*k,we=te,ke=de(ue,S,_);h.minHour===0&&h.minDate===1?(xe=0,we=F.monthMod(h.minMonth),q="month",ue=h.minDate):h.minDate!==1&&h.minHour===0&&h.minMinute===0&&(xe=0,te=h.minDate,we=te,ke=de(ue=te,S,_)),this.timeScaleArray.push({position:xe,value:we,unit:q,year:this._getYear(_,ke,0),month:F.monthMod(ke),day:ue});for(var Me=xe,Ye=0;Ye<T;Ye++){q="day",ke=de(ue+=1,ke,this._getYear(_,ke,0));var Fe=this._getYear(_,ke,0);Me=24*k+Me;var rt=ue===1?F.monthMod(ke):ue;this.timeScaleArray.push({position:Me,value:rt,unit:q,year:Fe,month:F.monthMod(ke),day:rt})}}},{key:"generateHourScale",value:function(p){var h=p.firstVal,S=p.currentDate,_=p.currentMonth,k=p.currentYear,T=p.minutesWidthOnXAxis,B=p.numberOfHours,q=new Z(this.ctx),te="hour",ue=function(Le,_e){return Le>q.determineDaysOfMonths(_e+1,k)&&(Ye=1,_e+=1),{month:_e,date:Ye}},de=function(Le,_e){return Le>q.determineDaysOfMonths(_e+1,k)?_e+=1:_e},xe=60-(h.minMinute+h.minSecond/60),we=xe*T,ke=h.minHour+1,Me=ke;xe===60&&(we=0,Me=ke=h.minHour);var Ye=S;Me>=24&&(Me=0,Ye+=1,te="day");var Fe=ue(Ye,_).month;Fe=de(Ye,Fe),this.timeScaleArray.push({position:we,value:ke,unit:te,day:Ye,hour:Me,year:k,month:F.monthMod(Fe)}),Me++;for(var rt=we,se=0;se<B;se++){te="hour",Me>=24&&(Me=0,te="day",Fe=ue(Ye+=1,Fe).month,Fe=de(Ye,Fe));var Ce=this._getYear(k,Fe,0);rt=60*T+rt;var De=Me===0?Ye:Me;this.timeScaleArray.push({position:rt,value:De,unit:te,hour:Me,day:Ye,year:Ce,month:F.monthMod(Fe)}),Me++}}},{key:"generateMinuteScale",value:function(p){for(var h=p.currentMillisecond,S=p.currentSecond,_=p.currentMinute,k=p.currentHour,T=p.currentDate,B=p.currentMonth,q=p.currentYear,te=p.minutesWidthOnXAxis,ue=p.secondsWidthOnXAxis,de=p.numberOfMinutes,xe=_+1,we=T,ke=B,Me=q,Ye=k,Fe=(60-S-h/1e3)*ue,rt=0;rt<de;rt++)xe>=60&&(xe=0,(Ye+=1)===24&&(Ye=0)),this.timeScaleArray.push({position:Fe,value:xe,unit:"minute",hour:Ye,minute:xe,day:we,year:this._getYear(Me,ke,0),month:F.monthMod(ke)}),Fe+=te,xe++}},{key:"generateSecondScale",value:function(p){for(var h=p.currentMillisecond,S=p.currentSecond,_=p.currentMinute,k=p.currentHour,T=p.currentDate,B=p.currentMonth,q=p.currentYear,te=p.secondsWidthOnXAxis,ue=p.numberOfSeconds,de=S+1,xe=_,we=T,ke=B,Me=q,Ye=k,Fe=(1e3-h)/1e3*te,rt=0;rt<ue;rt++)de>=60&&(de=0,++xe>=60&&(xe=0,++Ye===24&&(Ye=0))),this.timeScaleArray.push({position:Fe,value:de,unit:"second",hour:Ye,minute:xe,second:de,day:we,year:this._getYear(Me,ke,0),month:F.monthMod(ke)}),Fe+=te,de++}},{key:"createRawDateString",value:function(p,h){var S=p.year;return p.month===0&&(p.month=1),S+="-"+("0"+p.month.toString()).slice(-2),p.unit==="day"?S+=p.unit==="day"?"-"+("0"+h).slice(-2):"-01":S+="-"+("0"+(p.day?p.day:"1")).slice(-2),p.unit==="hour"?S+=p.unit==="hour"?"T"+("0"+h).slice(-2):"T00":S+="T"+("0"+(p.hour?p.hour:"0")).slice(-2),p.unit==="minute"?S+=":"+("0"+h).slice(-2):S+=":"+(p.minute?("0"+p.minute).slice(-2):"00"),p.unit==="second"?S+=":"+("0"+h).slice(-2):S+=":00",this.utc&&(S+=".000Z"),S}},{key:"formatDates",value:function(p){var h=this,S=this.w;return p.map(function(_){var k=_.value.toString(),T=new Z(h.ctx),B=h.createRawDateString(_,k),q=T.getDate(T.parseDate(B));if(h.utc||(q=T.getDate(T.parseDateWithTimezone(B))),S.config.xaxis.labels.format===void 0){var te="dd MMM",ue=S.config.xaxis.labels.datetimeFormatter;_.unit==="year"&&(te=ue.year),_.unit==="month"&&(te=ue.month),_.unit==="day"&&(te=ue.day),_.unit==="hour"&&(te=ue.hour),_.unit==="minute"&&(te=ue.minute),_.unit==="second"&&(te=ue.second),k=T.formatDate(q,te)}else k=T.formatDate(q,S.config.xaxis.labels.format);return{dateString:B,position:_.position,value:k,unit:_.unit,year:_.year,month:_.month}})}},{key:"removeOverlappingTS",value:function(p){var h,S=this,_=new z(this.ctx),k=!1;p.length>0&&p[0].value&&p.every(function(q){return q.value.length===p[0].value.length})&&(k=!0,h=_.getTextRects(p[0].value).width);var T=0,B=p.map(function(q,te){if(te>0&&S.w.config.xaxis.labels.hideOverlappingLabels){var ue=k?h:_.getTextRects(p[T].value).width,de=p[T].position;return q.position>de+ue+10?(T=te,q):null}return q});return B=B.filter(function(q){return q!==null})}},{key:"_getYear",value:function(p,h,S){return p+Math.floor(h/12)+S}}]),Ee}(),tr=function(){function Ee(p,h){s(this,Ee),this.ctx=h,this.w=h.w,this.el=p}return o(Ee,[{key:"setupElements",value:function(){var p=this.w,h=p.globals,S=p.config,_=S.chart.type;h.axisCharts=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble","radar","heatmap","treemap"].includes(_),h.xyCharts=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble"].includes(_),h.isBarHorizontal=["bar","rangeBar","boxPlot"].includes(_)&&S.plotOptions.bar.horizontal,h.chartClass=".apexcharts".concat(h.chartID),h.dom.baseEl=this.el,h.dom.elWrap=document.createElement("div"),z.setAttrs(h.dom.elWrap,{id:h.chartClass.substring(1),class:"apexcharts-canvas ".concat(h.chartClass.substring(1))}),this.el.appendChild(h.dom.elWrap),h.dom.Paper=new window.SVG.Doc(h.dom.elWrap),h.dom.Paper.attr({class:"apexcharts-svg","xmlns:data":"ApexChartsNS",transform:"translate(".concat(S.chart.offsetX,", ").concat(S.chart.offsetY,")")}),h.dom.Paper.node.style.background=S.theme.mode!=="dark"||S.chart.background?S.theme.mode!=="light"||S.chart.background?S.chart.background:"#fff":"#424242",this.setSVGDimensions(),h.dom.elLegendForeign=document.createElementNS(h.SVGNS,"foreignObject"),z.setAttrs(h.dom.elLegendForeign,{x:0,y:0,width:h.svgWidth,height:h.svgHeight}),h.dom.elLegendWrap=document.createElement("div"),h.dom.elLegendWrap.classList.add("apexcharts-legend"),h.dom.elLegendWrap.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),h.dom.elLegendForeign.appendChild(h.dom.elLegendWrap),h.dom.Paper.node.appendChild(h.dom.elLegendForeign),h.dom.elGraphical=h.dom.Paper.group().attr({class:"apexcharts-inner apexcharts-graphical"}),h.dom.elDefs=h.dom.Paper.defs(),h.dom.Paper.add(h.dom.elGraphical),h.dom.elGraphical.add(h.dom.elDefs)}},{key:"plotChartType",value:function(p,h){var S=this.w,_=this.ctx,k=S.config,T=S.globals,B={line:{series:[],i:[]},area:{series:[],i:[]},scatter:{series:[],i:[]},bubble:{series:[],i:[]},column:{series:[],i:[]},candlestick:{series:[],i:[]},boxPlot:{series:[],i:[]},rangeBar:{series:[],i:[]},rangeArea:{series:[],seriesRangeEnd:[],i:[]}},q=k.chart.type||"line",te=null,ue=0;T.series.forEach(function(Le,_e){var nt=p[_e].type||q;B[nt]?(nt==="rangeArea"?(B[nt].series.push(T.seriesRangeStart[_e]),B[nt].seriesRangeEnd.push(T.seriesRangeEnd[_e])):B[nt].series.push(Le),B[nt].i.push(_e),nt!=="column"&&nt!=="bar"||(S.globals.columnSeries=B.column)):["heatmap","treemap","pie","donut","polarArea","radialBar","radar"].includes(nt)?te=nt:nt==="bar"?(B.column.series.push(Le),B.column.i.push(_e)):console.warn("You have specified an unrecognized series type (".concat(nt,").")),q!==nt&&nt!=="scatter"&&ue++}),ue>0&&(te&&console.warn("Chart or series type ".concat(te," cannot appear with other chart or series types.")),B.column.series.length>0&&k.plotOptions.bar.horizontal&&(ue-=B.column.series.length,B.column={series:[],i:[]},S.globals.columnSeries={series:[],i:[]},console.warn("Horizontal bars are not supported in a mixed/combo chart. Please turn off `plotOptions.bar.horizontal`"))),T.comboCharts||(T.comboCharts=ue>0);var de=new Kn(_,h),xe=new _n(_,h);_.pie=new Hn(_);var we=new Jn(_);_.rangeBar=new Nn(_,h);var ke=new $n(_),Me=[];if(T.comboCharts){var Ye,Fe,rt=new X(_);if(B.area.series.length>0&&(Ye=Me).push.apply(Ye,N(rt.drawSeriesByGroup(B.area,T.areaGroups,"area",de))),B.column.series.length>0)if(k.chart.stacked){var se=new Mn(_,h);Me.push(se.draw(B.column.series,B.column.i))}else _.bar=new dn(_,h),Me.push(_.bar.draw(B.column.series,B.column.i));if(B.rangeArea.series.length>0&&Me.push(de.draw(B.rangeArea.series,"rangeArea",B.rangeArea.i,B.rangeArea.seriesRangeEnd)),B.line.series.length>0&&(Fe=Me).push.apply(Fe,N(rt.drawSeriesByGroup(B.line,T.lineGroups,"line",de))),B.candlestick.series.length>0&&Me.push(xe.draw(B.candlestick.series,"candlestick",B.candlestick.i)),B.boxPlot.series.length>0&&Me.push(xe.draw(B.boxPlot.series,"boxPlot",B.boxPlot.i)),B.rangeBar.series.length>0&&Me.push(_.rangeBar.draw(B.rangeBar.series,B.rangeBar.i)),B.scatter.series.length>0){var Ce=new Kn(_,h,!0);Me.push(Ce.draw(B.scatter.series,"scatter",B.scatter.i))}if(B.bubble.series.length>0){var De=new Kn(_,h,!0);Me.push(De.draw(B.bubble.series,"bubble",B.bubble.i))}}else switch(k.chart.type){case"line":Me=de.draw(T.series,"line");break;case"area":Me=de.draw(T.series,"area");break;case"bar":k.chart.stacked?Me=new Mn(_,h).draw(T.series):(_.bar=new dn(_,h),Me=_.bar.draw(T.series));break;case"candlestick":Me=new _n(_,h).draw(T.series,"candlestick");break;case"boxPlot":Me=new _n(_,h).draw(T.series,k.chart.type);break;case"rangeBar":Me=_.rangeBar.draw(T.series);break;case"rangeArea":Me=de.draw(T.seriesRangeStart,"rangeArea",void 0,T.seriesRangeEnd);break;case"heatmap":Me=new vn(_,h).draw(T.series);break;case"treemap":Me=new an(_,h).draw(T.series);break;case"pie":case"donut":case"polarArea":Me=_.pie.draw(T.series);break;case"radialBar":Me=we.draw(T.series);break;case"radar":Me=ke.draw(T.series);break;default:Me=de.draw(T.series)}return Me}},{key:"setSVGDimensions",value:function(){var p=this.w,h=p.globals,S=p.config;S.chart.width=S.chart.width||"100%",S.chart.height=S.chart.height||"auto",h.svgWidth=S.chart.width,h.svgHeight=S.chart.height;var _=F.getDimensions(this.el),k=S.chart.width.toString().split(/[0-9]+/g).pop();k==="%"?F.isNumber(_[0])&&(_[0].width===0&&(_=F.getDimensions(this.el.parentNode)),h.svgWidth=_[0]*parseInt(S.chart.width,10)/100):k!=="px"&&k!==""||(h.svgWidth=parseInt(S.chart.width,10));var T=String(S.chart.height).toString().split(/[0-9]+/g).pop();if(h.svgHeight!=="auto"&&h.svgHeight!=="")if(T==="%"){var B=F.getDimensions(this.el.parentNode);h.svgHeight=B[1]*parseInt(S.chart.height,10)/100}else h.svgHeight=parseInt(S.chart.height,10);else h.svgHeight=h.axisCharts?h.svgWidth/1.61:h.svgWidth/1.2;if(h.svgWidth=Math.max(h.svgWidth,0),h.svgHeight=Math.max(h.svgHeight,0),z.setAttrs(h.dom.Paper.node,{width:h.svgWidth,height:h.svgHeight}),T!=="%"){var q=S.chart.sparkline.enabled?0:h.axisCharts?S.chart.parentHeightOffset:0;h.dom.Paper.node.parentNode.parentNode.style.minHeight="".concat(h.svgHeight+q,"px")}h.dom.elWrap.style.width="".concat(h.svgWidth,"px"),h.dom.elWrap.style.height="".concat(h.svgHeight,"px")}},{key:"shiftGraphPosition",value:function(){var p=this.w.globals,h=p.translateY,S=p.translateX;z.setAttrs(p.dom.elGraphical.node,{transform:"translate(".concat(S,", ").concat(h,")")})}},{key:"resizeNonAxisCharts",value:function(){var p=this.w,h=p.globals,S=0,_=p.config.chart.sparkline.enabled?1:15;_+=p.config.grid.padding.bottom,["top","bottom"].includes(p.config.legend.position)&&p.config.legend.show&&!p.config.legend.floating&&(S=new en(this.ctx).legendHelpers.getLegendDimensions().clwh+7);var k=p.globals.dom.baseEl.querySelector(".apexcharts-radialbar, .apexcharts-pie"),T=2.05*p.globals.radialSize;if(k&&!p.config.chart.sparkline.enabled&&p.config.plotOptions.radialBar.startAngle!==0){var B=F.getBoundingClientRect(k);T=B.bottom;var q=B.bottom-B.top;T=Math.max(2.05*p.globals.radialSize,q)}var te=Math.ceil(T+h.translateY+S+_);h.dom.elLegendForeign&&h.dom.elLegendForeign.setAttribute("height",te),p.config.chart.height&&String(p.config.chart.height).includes("%")||(h.dom.elWrap.style.height="".concat(te,"px"),z.setAttrs(h.dom.Paper.node,{height:te}),h.dom.Paper.node.parentNode.parentNode.style.minHeight="".concat(te,"px"))}},{key:"coreCalculations",value:function(){new dt(this.ctx).init()}},{key:"resetGlobals",value:function(){var p=this,h=function(){return p.w.config.series.map(function(){return[]})},S=new ce,_=this.w.globals;S.initGlobalVars(_),_.seriesXvalues=h(),_.seriesYvalues=h()}},{key:"isMultipleY",value:function(){return!!(Array.isArray(this.w.config.yaxis)&&this.w.config.yaxis.length>1)&&(this.w.globals.isMultipleYAxis=!0,!0)}},{key:"xySettings",value:function(){var p=this.w,h=null;if(p.globals.axisCharts){if(p.config.xaxis.crosshairs.position==="back"&&new jt(this.ctx).drawXCrosshairs(),p.config.yaxis[0].crosshairs.position==="back"&&new jt(this.ctx).drawYCrosshairs(),p.config.xaxis.type==="datetime"&&p.config.xaxis.labels.formatter===void 0){this.ctx.timeScale=new nr(this.ctx);var S=[];isFinite(p.globals.minX)&&isFinite(p.globals.maxX)&&!p.globals.isBarHorizontal?S=this.ctx.timeScale.calculateTimeScaleTicks(p.globals.minX,p.globals.maxX):p.globals.isBarHorizontal&&(S=this.ctx.timeScale.calculateTimeScaleTicks(p.globals.minY,p.globals.maxY)),this.ctx.timeScale.recalcDimensionsBasedOnFormat(S)}h=new X(this.ctx).getCalculatedRatios()}return h}},{key:"updateSourceChart",value:function(p){this.ctx.w.globals.selection=void 0,this.ctx.updateHelpers._updateOptions({chart:{selection:{xaxis:{min:p.w.globals.minX,max:p.w.globals.maxX}}}},!1,!1)}},{key:"setupBrushHandler",value:function(){var p=this,h=this.w;if(h.config.chart.brush.enabled&&typeof h.config.chart.events.selection!="function"){var S=Array.isArray(h.config.chart.brush.targets)?h.config.chart.brush.targets:[h.config.chart.brush.target];S.forEach(function(_){var k=ApexCharts.getChartByID(_);k.w.globals.brushSource=p.ctx,typeof k.w.config.chart.events.zoomed!="function"&&(k.w.config.chart.events.zoomed=function(){return p.updateSourceChart(k)}),typeof k.w.config.chart.events.scrolled!="function"&&(k.w.config.chart.events.scrolled=function(){return p.updateSourceChart(k)})}),h.config.chart.events.selection=function(_,k){S.forEach(function(T){ApexCharts.getChartByID(T).ctx.updateHelpers._updateOptions({xaxis:{min:k.xaxis.min,max:k.xaxis.max}},!1,!1,!1,!1)})}}}}]),Ee}(),Qt=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"_updateOptions",value:function(p){var h=this,S=arguments.length>1&&arguments[1]!==void 0&&arguments[1],_=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],k=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],T=arguments.length>4&&arguments[4]!==void 0&&arguments[4];return new Promise(function(B){var q=[h.ctx];k&&(q=h.ctx.getSyncedCharts()),h.ctx.w.globals.isExecCalled&&(q=[h.ctx],h.ctx.w.globals.isExecCalled=!1),q.forEach(function(te,ue){var de=te.w;if(de.globals.shouldAnimate=_,S||(de.globals.resized=!0,de.globals.dataChanged=!0,_&&te.series.getPreviousPaths()),p&&P(p)==="object"&&(te.config=new Ae(p),p=X.extendArrayProps(te.config,p,de),te.w.globals.chartID!==h.ctx.w.globals.chartID&&delete p.series,de.config=F.extend(de.config,p),T&&(de.globals.lastXAxis=p.xaxis?F.clone(p.xaxis):[],de.globals.lastYAxis=p.yaxis?F.clone(p.yaxis):[],de.globals.initialConfig=F.extend({},de.config),de.globals.initialSeries=F.clone(de.config.series),p.series))){for(var xe=0;xe<de.globals.collapsedSeriesIndices.length;xe++){var we=de.config.series[de.globals.collapsedSeriesIndices[xe]];de.globals.collapsedSeries[xe].data=de.globals.axisCharts?we.data.slice():we}for(var ke=0;ke<de.globals.ancillaryCollapsedSeriesIndices.length;ke++){var Me=de.config.series[de.globals.ancillaryCollapsedSeriesIndices[ke]];de.globals.ancillaryCollapsedSeries[ke].data=de.globals.axisCharts?Me.data.slice():Me}te.series.emptyCollapsedSeries(de.config.series)}return te.update(p).then(function(){ue===q.length-1&&B(te)})})})}},{key:"_updateSeries",value:function(p,h){var S=this,_=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return new Promise(function(k){var T,B=S.w;return B.globals.shouldAnimate=h,B.globals.dataChanged=!0,h&&S.ctx.series.getPreviousPaths(),B.globals.axisCharts?((T=p.map(function(q,te){return S._extendSeries(q,te)})).length===0&&(T=[{data:[]}]),B.config.series=T):B.config.series=p.slice(),_&&(B.globals.initialConfig.series=F.clone(B.config.series),B.globals.initialSeries=F.clone(B.config.series)),S.ctx.update().then(function(){k(S.ctx)})})}},{key:"_extendSeries",value:function(p,h){var S=this.w,_=S.config.series[h];return v(v({},S.config.series[h]),{},{name:p.name?p.name:_==null?void 0:_.name,color:p.color?p.color:_==null?void 0:_.color,type:p.type?p.type:_==null?void 0:_.type,group:p.group?p.group:_==null?void 0:_.group,hidden:p.hidden!==void 0?p.hidden:_==null?void 0:_.hidden,data:p.data?p.data:_==null?void 0:_.data,zIndex:p.zIndex!==void 0?p.zIndex:h})}},{key:"toggleDataPointSelection",value:function(p,h){var S=this.w,_=null,k=".apexcharts-series[data\\:realIndex='".concat(p,"']");return S.globals.axisCharts?_=S.globals.dom.Paper.select("".concat(k," path[j='").concat(h,"'], ").concat(k," circle[j='").concat(h,"'], ").concat(k," rect[j='").concat(h,"']")).members[0]:h===void 0&&(_=S.globals.dom.Paper.select("".concat(k," path[j='").concat(p,"']")).members[0],S.config.chart.type!=="pie"&&S.config.chart.type!=="polarArea"&&S.config.chart.type!=="donut"||this.ctx.pie.pieClicked(p)),_?(new z(this.ctx).pathMouseDown(_,null),_.node?_.node:null):(console.warn("toggleDataPointSelection: Element not found"),null)}},{key:"forceXAxisUpdate",value:function(p){var h=this.w;if(["min","max"].forEach(function(_){p.xaxis[_]!==void 0&&(h.config.xaxis[_]=p.xaxis[_],h.globals.lastXAxis[_]=p.xaxis[_])}),p.xaxis.categories&&p.xaxis.categories.length&&(h.config.xaxis.categories=p.xaxis.categories),h.config.xaxis.convertedCatToNumeric){var S=new fe(p);p=S.convertCatToNumericXaxis(p,this.ctx)}return p}},{key:"forceYAxisUpdate",value:function(p){return p.chart&&p.chart.stacked&&p.chart.stackType==="100%"&&(Array.isArray(p.yaxis)?p.yaxis.forEach(function(h,S){p.yaxis[S].min=0,p.yaxis[S].max=100}):(p.yaxis.min=0,p.yaxis.max=100)),p}},{key:"revertDefaultAxisMinMax",value:function(p){var h=this,S=this.w,_=S.globals.lastXAxis,k=S.globals.lastYAxis;p&&p.xaxis&&(_=p.xaxis),p&&p.yaxis&&(k=p.yaxis),S.config.xaxis.min=_.min,S.config.xaxis.max=_.max;var T=function(B){k[B]!==void 0&&(S.config.yaxis[B].min=k[B].min,S.config.yaxis[B].max=k[B].max)};S.config.yaxis.map(function(B,q){S.globals.zoomed||k[q]!==void 0?T(q):h.ctx.opts.yaxis[q]!==void 0&&(B.min=h.ctx.opts.yaxis[q].min,B.max=h.ctx.opts.yaxis[q].max)})}}]),Ee}();Cn=typeof window<"u"?window:void 0,Bt=function(Ee,p){var h=(this!==void 0?this:Ee).SVG=function(se){if(h.supported)return se=new h.Doc(se),h.parser.draw||h.prepare(),se};if(h.ns="http://www.w3.org/2000/svg",h.xmlns="http://www.w3.org/2000/xmlns/",h.xlink="http://www.w3.org/1999/xlink",h.svgjs="http://svgjs.dev",h.supported=!0,!h.supported)return!1;h.did=1e3,h.eid=function(se){return"Svgjs"+ue(se)+h.did++},h.create=function(se){var Ce=p.createElementNS(this.ns,se);return Ce.setAttribute("id",this.eid(se)),Ce},h.extend=function(){var se,Ce;Ce=(se=[].slice.call(arguments)).pop();for(var De=se.length-1;De>=0;De--)if(se[De])for(var Le in Ce)se[De].prototype[Le]=Ce[Le];h.Set&&h.Set.inherit&&h.Set.inherit()},h.invent=function(se){var Ce=typeof se.create=="function"?se.create:function(){this.constructor.call(this,h.create(se.create))};return se.inherit&&(Ce.prototype=new se.inherit),se.extend&&h.extend(Ce,se.extend),se.construct&&h.extend(se.parent||h.Container,se.construct),Ce},h.adopt=function(se){return se?se.instance?se.instance:((Ce=se.nodeName=="svg"?se.parentNode instanceof Ee.SVGElement?new h.Nested:new h.Doc:se.nodeName=="linearGradient"?new h.Gradient("linear"):se.nodeName=="radialGradient"?new h.Gradient("radial"):h[ue(se.nodeName)]?new h[ue(se.nodeName)]:new h.Element(se)).type=se.nodeName,Ce.node=se,se.instance=Ce,Ce instanceof h.Doc&&Ce.namespace().defs(),Ce.setData(JSON.parse(se.getAttribute("svgjs:data"))||{}),Ce):null;var Ce},h.prepare=function(){var se=p.getElementsByTagName("body")[0],Ce=(se?new h.Doc(se):h.adopt(p.documentElement).nested()).size(2,0);h.parser={body:se||p.documentElement,draw:Ce.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").node,poly:Ce.polyline().node,path:Ce.path().node,native:h.create("svg")}},h.parser={native:h.create("svg")},p.addEventListener("DOMContentLoaded",function(){h.parser.draw||h.prepare()},!1),h.regex={numberAndUnit:/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,reference:/#([a-z0-9\-_]+)/i,transforms:/\)\s*,?\s*/,whitespace:/\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\s+)?$/,isNumber:/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,isPercent:/^-?[\d\.]+%$/,isImage:/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,delimiter:/[\s,]+/,hyphen:/([^e])\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,dots:/\./g},h.utils={map:function(se,Ce){for(var De=se.length,Le=[],_e=0;_e<De;_e++)Le.push(Ce(se[_e]));return Le},filter:function(se,Ce){for(var De=se.length,Le=[],_e=0;_e<De;_e++)Ce(se[_e])&&Le.push(se[_e]);return Le},filterSVGElements:function(se){return this.filter(se,function(Ce){return Ce instanceof Ee.SVGElement})}},h.defaults={attrs:{"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","font-size":16,"font-family":"Helvetica, Arial, sans-serif","text-anchor":"start"}},h.Color=function(se){var Ce,De;this.r=0,this.g=0,this.b=0,se&&(typeof se=="string"?h.regex.isRgb.test(se)?(Ce=h.regex.rgb.exec(se.replace(h.regex.whitespace,"")),this.r=parseInt(Ce[1]),this.g=parseInt(Ce[2]),this.b=parseInt(Ce[3])):h.regex.isHex.test(se)&&(Ce=h.regex.hex.exec((De=se).length==4?["#",De.substring(1,2),De.substring(1,2),De.substring(2,3),De.substring(2,3),De.substring(3,4),De.substring(3,4)].join(""):De),this.r=parseInt(Ce[1],16),this.g=parseInt(Ce[2],16),this.b=parseInt(Ce[3],16)):P(se)==="object"&&(this.r=se.r,this.g=se.g,this.b=se.b))},h.extend(h.Color,{toString:function(){return this.toHex()},toHex:function(){return"#"+de(this.r)+de(this.g)+de(this.b)},toRgb:function(){return"rgb("+[this.r,this.g,this.b].join()+")"},brightness:function(){return this.r/255*.3+this.g/255*.59+this.b/255*.11},morph:function(se){return this.destination=new h.Color(se),this},at:function(se){return this.destination?(se=se<0?0:se>1?1:se,new h.Color({r:~~(this.r+(this.destination.r-this.r)*se),g:~~(this.g+(this.destination.g-this.g)*se),b:~~(this.b+(this.destination.b-this.b)*se)})):this}}),h.Color.test=function(se){return se+="",h.regex.isHex.test(se)||h.regex.isRgb.test(se)},h.Color.isRgb=function(se){return se&&typeof se.r=="number"&&typeof se.g=="number"&&typeof se.b=="number"},h.Color.isColor=function(se){return h.Color.isRgb(se)||h.Color.test(se)},h.Array=function(se,Ce){(se=(se||[]).valueOf()).length==0&&Ce&&(se=Ce.valueOf()),this.value=this.parse(se)},h.extend(h.Array,{toString:function(){return this.value.join(" ")},valueOf:function(){return this.value},parse:function(se){return se=se.valueOf(),Array.isArray(se)?se:this.split(se)}}),h.PointArray=function(se,Ce){h.Array.call(this,se,Ce||[[0,0]])},h.PointArray.prototype=new h.Array,h.PointArray.prototype.constructor=h.PointArray;for(var S={M:function(se,Ce,De){return Ce.x=De.x=se[0],Ce.y=De.y=se[1],["M",Ce.x,Ce.y]},L:function(se,Ce){return Ce.x=se[0],Ce.y=se[1],["L",se[0],se[1]]},H:function(se,Ce){return Ce.x=se[0],["H",se[0]]},V:function(se,Ce){return Ce.y=se[0],["V",se[0]]},C:function(se,Ce){return Ce.x=se[4],Ce.y=se[5],["C",se[0],se[1],se[2],se[3],se[4],se[5]]},Q:function(se,Ce){return Ce.x=se[2],Ce.y=se[3],["Q",se[0],se[1],se[2],se[3]]},S:function(se,Ce){return Ce.x=se[2],Ce.y=se[3],["S",se[0],se[1],se[2],se[3]]},Z:function(se,Ce,De){return Ce.x=De.x,Ce.y=De.y,["Z"]}},_="mlhvqtcsaz".split(""),k=0,T=_.length;k<T;++k)S[_[k]]=function(se){return function(Ce,De,Le){if(se=="H")Ce[0]=Ce[0]+De.x;else if(se=="V")Ce[0]=Ce[0]+De.y;else if(se=="A")Ce[5]=Ce[5]+De.x,Ce[6]=Ce[6]+De.y;else for(var _e=0,nt=Ce.length;_e<nt;++_e)Ce[_e]=Ce[_e]+(_e%2?De.y:De.x);if(S&&typeof S[se]=="function")return S[se](Ce,De,Le)}}(_[k].toUpperCase());h.PathArray=function(se,Ce){h.Array.call(this,se,Ce||[["M",0,0]])},h.PathArray.prototype=new h.Array,h.PathArray.prototype.constructor=h.PathArray,h.extend(h.PathArray,{toString:function(){return function(se){for(var Ce=0,De=se.length,Le="";Ce<De;Ce++)Le+=se[Ce][0],se[Ce][1]!=null&&(Le+=se[Ce][1],se[Ce][2]!=null&&(Le+=" ",Le+=se[Ce][2],se[Ce][3]!=null&&(Le+=" ",Le+=se[Ce][3],Le+=" ",Le+=se[Ce][4],se[Ce][5]!=null&&(Le+=" ",Le+=se[Ce][5],Le+=" ",Le+=se[Ce][6],se[Ce][7]!=null&&(Le+=" ",Le+=se[Ce][7])))));return Le+" "}(this.value)},move:function(se,Ce){var De=this.bbox();return De.x,De.y,this},at:function(se){if(!this.destination)return this;for(var Ce=this.value,De=this.destination.value,Le=[],_e=new h.PathArray,nt=0,ot=Ce.length;nt<ot;nt++){Le[nt]=[Ce[nt][0]];for(var gt=1,Jt=Ce[nt].length;gt<Jt;gt++)Le[nt][gt]=Ce[nt][gt]+(De[nt][gt]-Ce[nt][gt])*se;Le[nt][0]==="A"&&(Le[nt][4]=+(Le[nt][4]!=0),Le[nt][5]=+(Le[nt][5]!=0))}return _e.value=Le,_e},parse:function(se){if(se instanceof h.PathArray)return se.valueOf();var Ce,De={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};se=typeof se=="string"?se.replace(h.regex.numbersWithDots,q).replace(h.regex.pathLetters," $& ").replace(h.regex.hyphen,"$1 -").trim().split(h.regex.delimiter):se.reduce(function(Jt,Ge){return[].concat.call(Jt,Ge)},[]);var Le=[],_e=new h.Point,nt=new h.Point,ot=0,gt=se.length;do h.regex.isPathLetter.test(se[ot])?(Ce=se[ot],++ot):Ce=="M"?Ce="L":Ce=="m"&&(Ce="l"),Le.push(S[Ce].call(null,se.slice(ot,ot+=De[Ce.toUpperCase()]).map(parseFloat),_e,nt));while(gt>ot);return Le},bbox:function(){return h.parser.draw||h.prepare(),h.parser.path.setAttribute("d",this.toString()),h.parser.path.getBBox()}}),h.Number=h.invent({create:function(se,Ce){this.value=0,this.unit=Ce||"",typeof se=="number"?this.value=isNaN(se)?0:isFinite(se)?se:se<0?-34e37:34e37:typeof se=="string"?(Ce=se.match(h.regex.numberAndUnit))&&(this.value=parseFloat(Ce[1]),Ce[5]=="%"?this.value/=100:Ce[5]=="s"&&(this.value*=1e3),this.unit=Ce[5]):se instanceof h.Number&&(this.value=se.valueOf(),this.unit=se.unit)},extend:{toString:function(){return(this.unit=="%"?~~(1e8*this.value)/1e6:this.unit=="s"?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(se){return se=new h.Number(se),new h.Number(this+se,this.unit||se.unit)},minus:function(se){return se=new h.Number(se),new h.Number(this-se,this.unit||se.unit)},times:function(se){return se=new h.Number(se),new h.Number(this*se,this.unit||se.unit)},divide:function(se){return se=new h.Number(se),new h.Number(this/se,this.unit||se.unit)},to:function(se){var Ce=new h.Number(this);return typeof se=="string"&&(Ce.unit=se),Ce},morph:function(se){return this.destination=new h.Number(se),se.relative&&(this.destination.value+=this.value),this},at:function(se){return this.destination?new h.Number(this.destination).minus(this).times(se).plus(this):this}}}),h.Element=h.invent({create:function(se){this._stroke=h.defaults.attrs.stroke,this._event=null,this.dom={},(this.node=se)&&(this.type=se.nodeName,this.node.instance=this,this._stroke=se.getAttribute("stroke")||this._stroke)},extend:{x:function(se){return this.attr("x",se)},y:function(se){return this.attr("y",se)},cx:function(se){return se==null?this.x()+this.width()/2:this.x(se-this.width()/2)},cy:function(se){return se==null?this.y()+this.height()/2:this.y(se-this.height()/2)},move:function(se,Ce){return this.x(se).y(Ce)},center:function(se,Ce){return this.cx(se).cy(Ce)},width:function(se){return this.attr("width",se)},height:function(se){return this.attr("height",se)},size:function(se,Ce){var De=xe(this,se,Ce);return this.width(new h.Number(De.width)).height(new h.Number(De.height))},clone:function(se){this.writeDataToDom();var Ce=Me(this.node.cloneNode(!0));return se?se.add(Ce):this.after(Ce),Ce},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(se){return this.after(se).remove(),se},addTo:function(se){return se.put(this)},putIn:function(se){return se.add(this)},id:function(se){return this.attr("id",se)},show:function(){return this.style("display","")},hide:function(){return this.style("display","none")},visible:function(){return this.style("display")!="none"},toString:function(){return this.attr("id")},classes:function(){var se=this.attr("class");return se==null?[]:se.trim().split(h.regex.delimiter)},hasClass:function(se){return this.classes().indexOf(se)!=-1},addClass:function(se){if(!this.hasClass(se)){var Ce=this.classes();Ce.push(se),this.attr("class",Ce.join(" "))}return this},removeClass:function(se){return this.hasClass(se)&&this.attr("class",this.classes().filter(function(Ce){return Ce!=se}).join(" ")),this},toggleClass:function(se){return this.hasClass(se)?this.removeClass(se):this.addClass(se)},reference:function(se){return h.get(this.attr(se))},parent:function(se){var Ce=this;if(!Ce.node.parentNode)return null;if(Ce=h.adopt(Ce.node.parentNode),!se)return Ce;for(;Ce&&Ce.node instanceof Ee.SVGElement;){if(typeof se=="string"?Ce.matches(se):Ce instanceof se)return Ce;if(!Ce.node.parentNode||Ce.node.parentNode.nodeName=="#document")return null;Ce=h.adopt(Ce.node.parentNode)}},doc:function(){return this instanceof h.Doc?this:this.parent(h.Doc)},parents:function(se){var Ce=[],De=this;do{if(!(De=De.parent(se))||!De.node)break;Ce.push(De)}while(De.parent);return Ce},matches:function(se){return function(Ce,De){return(Ce.matches||Ce.matchesSelector||Ce.msMatchesSelector||Ce.mozMatchesSelector||Ce.webkitMatchesSelector||Ce.oMatchesSelector).call(Ce,De)}(this.node,se)},native:function(){return this.node},svg:function(se){var Ce=p.createElementNS("http://www.w3.org/2000/svg","svg");if(!(se&&this instanceof h.Parent))return Ce.appendChild(se=p.createElementNS("http://www.w3.org/2000/svg","svg")),this.writeDataToDom(),se.appendChild(this.node.cloneNode(!0)),Ce.innerHTML.replace(/^<svg>/,"").replace(/<\/svg>$/,"");Ce.innerHTML="<svg>"+se.replace(/\n/,"").replace(/<([\w:-]+)([^<]+?)\/>/g,"<$1$2></$1>")+"</svg>";for(var De=0,Le=Ce.firstChild.childNodes.length;De<Le;De++)this.node.appendChild(Ce.firstChild.firstChild);return this},writeDataToDom:function(){return(this.each||this.lines)&&(this.each?this:this.lines()).each(function(){this.writeDataToDom()}),this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},setData:function(se){return this.dom=se,this},is:function(se){return function(Ce,De){return Ce instanceof De}(this,se)}}}),h.easing={"-":function(se){return se},"<>":function(se){return-Math.cos(se*Math.PI)/2+.5},">":function(se){return Math.sin(se*Math.PI/2)},"<":function(se){return 1-Math.cos(se*Math.PI/2)}},h.morph=function(se){return function(Ce,De){return new h.MorphObj(Ce,De).at(se)}},h.Situation=h.invent({create:function(se){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new h.Number(se.duration).valueOf(),this.delay=new h.Number(se.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=se.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),h.FX=h.invent({create:function(se){this._target=se,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1},extend:{animate:function(se,Ce,De){P(se)==="object"&&(Ce=se.ease,De=se.delay,se=se.duration);var Le=new h.Situation({duration:se||1e3,delay:De||0,ease:h.easing[Ce||"-"]||Ce});return this.queue(Le),this},target:function(se){return se&&se instanceof h.Element?(this._target=se,this):this._target},timeToAbsPos:function(se){return(se-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(se){return this.situation.duration/this._speed*se+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=Ee.requestAnimationFrame((function(){this.step()}).bind(this))},stopAnimFrame:function(){Ee.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(se){return(typeof se=="function"||se instanceof h.Situation)&&this.situations.push(se),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof h.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var se,Ce=this.situation;if(Ce.init)return this;for(var De in Ce.animations){se=this.target()[De](),Array.isArray(se)||(se=[se]),Array.isArray(Ce.animations[De])||(Ce.animations[De]=[Ce.animations[De]]);for(var Le=se.length;Le--;)Ce.animations[De][Le]instanceof h.Number&&(se[Le]=new h.Number(se[Le])),Ce.animations[De][Le]=se[Le].morph(Ce.animations[De][Le])}for(var De in Ce.attrs)Ce.attrs[De]=new h.MorphObj(this.target().attr(De),Ce.attrs[De]);for(var De in Ce.styles)Ce.styles[De]=new h.MorphObj(this.target().style(De),Ce.styles[De]);return Ce.initialTransformation=this.target().matrixify(),Ce.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(se,Ce){var De=this.active;return this.active=!1,Ce&&this.clearQueue(),se&&this.situation&&(!De&&this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},after:function(se){var Ce=this.last();return this.target().on("finished.fx",function De(Le){Le.detail.situation==Ce&&(se.call(this,Ce),this.off("finished.fx",De))}),this._callStart()},during:function(se){var Ce=this.last(),De=function(Le){Le.detail.situation==Ce&&se.call(this,Le.detail.pos,h.morph(Le.detail.pos),Le.detail.eased,Ce)};return this.target().off("during.fx",De).on("during.fx",De),this.after(function(){this.off("during.fx",De)}),this._callStart()},afterAll:function(se){var Ce=function De(Le){se.call(this),this.off("allfinished.fx",De)};return this.target().off("allfinished.fx",Ce).on("allfinished.fx",Ce),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(se,Ce,De){return this.last()[De||"animations"][se]=Ce,this._callStart()},step:function(se){var Ce,De,Le;se||(this.absPos=this.timeToAbsPos(+new Date)),this.situation.loops!==!1?(Ce=Math.max(this.absPos,0),De=Math.floor(Ce),this.situation.loops===!0||De<this.situation.loops?(this.pos=Ce-De,Le=this.situation.loop,this.situation.loop=De):(this.absPos=this.situation.loops,this.pos=1,Le=this.situation.loop-1,this.situation.loop=this.situation.loops),this.situation.reversing&&(this.situation.reversed=this.situation.reversed!=!!((this.situation.loop-Le)%2))):(this.absPos=Math.min(this.absPos,1),this.pos=this.absPos),this.pos<0&&(this.pos=0),this.situation.reversed&&(this.pos=1-this.pos);var _e=this.situation.ease(this.pos);for(var nt in this.situation.once)nt>this.lastPos&&nt<=_e&&(this.situation.once[nt].call(this.target(),this.pos,_e),delete this.situation.once[nt]);return this.active&&this.target().fire("during",{pos:this.pos,eased:_e,fx:this,situation:this.situation}),this.situation?(this.eachAt(),this.pos==1&&!this.situation.reversed||this.situation.reversed&&this.pos==0?(this.stopAnimFrame(),this.target().fire("finished",{fx:this,situation:this.situation}),this.situations.length||(this.target().fire("allfinished"),this.situations.length||(this.target().off(".fx"),this.active=!1)),this.active?this.dequeue():this.clearCurrent()):!this.paused&&this.active&&this.startAnimFrame(),this.lastPos=_e,this):this},eachAt:function(){var se,Ce=this,De=this.target(),Le=this.situation;for(var _e in Le.animations)se=[].concat(Le.animations[_e]).map(function(gt){return typeof gt!="string"&&gt.at?gt.at(Le.ease(Ce.pos),Ce.pos):gt}),De[_e].apply(De,se);for(var _e in Le.attrs)se=[_e].concat(Le.attrs[_e]).map(function(Jt){return typeof Jt!="string"&&Jt.at?Jt.at(Le.ease(Ce.pos),Ce.pos):Jt}),De.attr.apply(De,se);for(var _e in Le.styles)se=[_e].concat(Le.styles[_e]).map(function(Jt){return typeof Jt!="string"&&Jt.at?Jt.at(Le.ease(Ce.pos),Ce.pos):Jt}),De.style.apply(De,se);if(Le.transforms.length){se=Le.initialTransformation,_e=0;for(var nt=Le.transforms.length;_e<nt;_e++){var ot=Le.transforms[_e];ot instanceof h.Matrix?se=ot.relative?se.multiply(new h.Matrix().morph(ot).at(Le.ease(this.pos))):se.morph(ot).at(Le.ease(this.pos)):(ot.relative||ot.undo(se.extract()),se=se.multiply(ot.at(Le.ease(this.pos))))}De.matrix(se)}return this},once:function(se,Ce,De){var Le=this.last();return De||(se=Le.ease(se)),Le.once[se]=Ce,this},_callStart:function(){return setTimeout((function(){this.start()}).bind(this),0),this}},parent:h.Element,construct:{animate:function(se,Ce,De){return(this.fx||(this.fx=new h.FX(this))).animate(se,Ce,De)},delay:function(se){return(this.fx||(this.fx=new h.FX(this))).delay(se)},stop:function(se,Ce){return this.fx&&this.fx.stop(se,Ce),this},finish:function(){return this.fx&&this.fx.finish(),this}}}),h.MorphObj=h.invent({create:function(se,Ce){return h.Color.isColor(Ce)?new h.Color(se).morph(Ce):h.regex.delimiter.test(se)?h.regex.pathLetters.test(se)?new h.PathArray(se).morph(Ce):new h.Array(se).morph(Ce):h.regex.numberAndUnit.test(Ce)?new h.Number(se).morph(Ce):(this.value=se,void(this.destination=Ce))},extend:{at:function(se,Ce){return Ce<1?this.value:this.destination},valueOf:function(){return this.value}}}),h.extend(h.FX,{attr:function(se,Ce,De){if(P(se)==="object")for(var Le in se)this.attr(Le,se[Le]);else this.add(se,Ce,"attrs");return this},plot:function(se,Ce,De,Le){return arguments.length==4?this.plot([se,Ce,De,Le]):this.add("plot",new(this.target()).morphArray(se))}}),h.Box=h.invent({create:function(se,Ce,De,Le){if(!(P(se)!=="object"||se instanceof h.Element))return h.Box.call(this,se.left!=null?se.left:se.x,se.top!=null?se.top:se.y,se.width,se.height);var _e;arguments.length==4&&(this.x=se,this.y=Ce,this.width=De,this.height=Le),(_e=this).x==null&&(_e.x=0,_e.y=0,_e.width=0,_e.height=0),_e.w=_e.width,_e.h=_e.height,_e.x2=_e.x+_e.width,_e.y2=_e.y+_e.height,_e.cx=_e.x+_e.width/2,_e.cy=_e.y+_e.height/2}}),h.BBox=h.invent({create:function(se){if(h.Box.apply(this,[].slice.call(arguments)),se instanceof h.Element){var Ce;try{if(!p.documentElement.contains){for(var De=se.node;De.parentNode;)De=De.parentNode;if(De!=p)throw new Error("Element not in the dom")}Ce=se.node.getBBox()}catch{if(se instanceof h.Shape){h.parser.draw||h.prepare();var Le=se.clone(h.parser.draw.instance).show();Le&&Le.node&&typeof Le.node.getBBox=="function"&&(Ce=Le.node.getBBox()),Le&&typeof Le.remove=="function"&&Le.remove()}else Ce={x:se.node.clientLeft,y:se.node.clientTop,width:se.node.clientWidth,height:se.node.clientHeight}}h.Box.call(this,Ce)}},inherit:h.Box,parent:h.Element,construct:{bbox:function(){return new h.BBox(this)}}}),h.BBox.prototype.constructor=h.BBox,h.Matrix=h.invent({create:function(se){var Ce=ke([1,0,0,1,0,0]);se=se===null?Ce:se instanceof h.Element?se.matrixify():typeof se=="string"?ke(se.split(h.regex.delimiter).map(parseFloat)):arguments.length==6?ke([].slice.call(arguments)):Array.isArray(se)?ke(se):se&&P(se)==="object"?se:Ce;for(var De=Fe.length-1;De>=0;--De)this[Fe[De]]=se[Fe[De]]!=null?se[Fe[De]]:Ce[Fe[De]]},extend:{extract:function(){var se=we(this,0,1);we(this,1,0);var Ce=180/Math.PI*Math.atan2(se.y,se.x)-90;return{x:this.e,y:this.f,transformedX:(this.e*Math.cos(Ce*Math.PI/180)+this.f*Math.sin(Ce*Math.PI/180))/Math.sqrt(this.a*this.a+this.b*this.b),transformedY:(this.f*Math.cos(Ce*Math.PI/180)+this.e*Math.sin(-Ce*Math.PI/180))/Math.sqrt(this.c*this.c+this.d*this.d),rotation:Ce,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,matrix:new h.Matrix(this)}},clone:function(){return new h.Matrix(this)},morph:function(se){return this.destination=new h.Matrix(se),this},multiply:function(se){return new h.Matrix(this.native().multiply(function(Ce){return Ce instanceof h.Matrix||(Ce=new h.Matrix(Ce)),Ce}(se).native()))},inverse:function(){return new h.Matrix(this.native().inverse())},translate:function(se,Ce){return new h.Matrix(this.native().translate(se||0,Ce||0))},native:function(){for(var se=h.parser.native.createSVGMatrix(),Ce=Fe.length-1;Ce>=0;Ce--)se[Fe[Ce]]=this[Fe[Ce]];return se},toString:function(){return"matrix("+Ye(this.a)+","+Ye(this.b)+","+Ye(this.c)+","+Ye(this.d)+","+Ye(this.e)+","+Ye(this.f)+")"}},parent:h.Element,construct:{ctm:function(){return new h.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof h.Nested){var se=this.rect(1,1),Ce=se.node.getScreenCTM();return se.remove(),new h.Matrix(Ce)}return new h.Matrix(this.node.getScreenCTM())}}}),h.Point=h.invent({create:function(se,Ce){var De;De=Array.isArray(se)?{x:se[0],y:se[1]}:P(se)==="object"?{x:se.x,y:se.y}:se!=null?{x:se,y:Ce??se}:{x:0,y:0},this.x=De.x,this.y=De.y},extend:{clone:function(){return new h.Point(this)},morph:function(se,Ce){return this.destination=new h.Point(se,Ce),this}}}),h.extend(h.Element,{point:function(se,Ce){return new h.Point(se,Ce).transform(this.screenCTM().inverse())}}),h.extend(h.Element,{attr:function(se,Ce,De){if(se==null){for(se={},De=(Ce=this.node.attributes).length-1;De>=0;De--)se[Ce[De].nodeName]=h.regex.isNumber.test(Ce[De].nodeValue)?parseFloat(Ce[De].nodeValue):Ce[De].nodeValue;return se}if(P(se)==="object")for(var Le in se)this.attr(Le,se[Le]);else if(Ce===null)this.node.removeAttribute(se);else{if(Ce==null)return(Ce=this.node.getAttribute(se))==null?h.defaults.attrs[se]:h.regex.isNumber.test(Ce)?parseFloat(Ce):Ce;se=="stroke-width"?this.attr("stroke",parseFloat(Ce)>0?this._stroke:null):se=="stroke"&&(this._stroke=Ce),se!="fill"&&se!="stroke"||(h.regex.isImage.test(Ce)&&(Ce=this.doc().defs().image(Ce,0,0)),Ce instanceof h.Image&&(Ce=this.doc().defs().pattern(0,0,function(){this.add(Ce)}))),typeof Ce=="number"?Ce=new h.Number(Ce):h.Color.isColor(Ce)?Ce=new h.Color(Ce):Array.isArray(Ce)&&(Ce=new h.Array(Ce)),se=="leading"?this.leading&&this.leading(Ce):typeof De=="string"?this.node.setAttributeNS(De,se,Ce.toString()):this.node.setAttribute(se,Ce.toString()),!this.rebuild||se!="font-size"&&se!="x"||this.rebuild(se,Ce)}return this}}),h.extend(h.Element,{transform:function(se,Ce){var De;return P(se)!=="object"?(De=new h.Matrix(this).extract(),typeof se=="string"?De[se]:De):(De=new h.Matrix(this),Ce=!!Ce||!!se.relative,se.a!=null&&(De=Ce?De.multiply(new h.Matrix(se)):new h.Matrix(se)),this.attr("transform",De))}}),h.extend(h.Element,{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(h.regex.transforms).slice(0,-1).map(function(se){var Ce=se.trim().split("(");return[Ce[0],Ce[1].split(h.regex.delimiter).map(function(De){return parseFloat(De)})]}).reduce(function(se,Ce){return Ce[0]=="matrix"?se.multiply(ke(Ce[1])):se[Ce[0]].apply(se,Ce[1])},new h.Matrix)},toParent:function(se){if(this==se)return this;var Ce=this.screenCTM(),De=se.screenCTM().inverse();return this.addTo(se).untransform().transform(De.multiply(Ce)),this},toDoc:function(){return this.toParent(this.doc())}}),h.Transformation=h.invent({create:function(se,Ce){if(arguments.length>1&&typeof Ce!="boolean")return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(se))for(var De=0,Le=this.arguments.length;De<Le;++De)this[this.arguments[De]]=se[De];else if(se&&P(se)==="object")for(De=0,Le=this.arguments.length;De<Le;++De)this[this.arguments[De]]=se[this.arguments[De]];this.inversed=!1,Ce===!0&&(this.inversed=!0)}}),h.Translate=h.invent({parent:h.Matrix,inherit:h.Transformation,create:function(se,Ce){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["transformedX","transformedY"],method:"translate"}}),h.extend(h.Element,{style:function(se,Ce){if(arguments.length==0)return this.node.style.cssText||"";if(arguments.length<2)if(P(se)==="object")for(var De in se)this.style(De,se[De]);else{if(!h.regex.isCss.test(se))return this.node.style[te(se)];for(se=se.split(/\s*;\s*/).filter(function(Le){return!!Le}).map(function(Le){return Le.split(/\s*:\s*/)});Ce=se.pop();)this.style(Ce[0],Ce[1])}else this.node.style[te(se)]=Ce===null||h.regex.isBlank.test(Ce)?"":Ce;return this}}),h.Parent=h.invent({create:function(se){this.constructor.call(this,se)},inherit:h.Element,extend:{children:function(){return h.utils.map(h.utils.filterSVGElements(this.node.childNodes),function(se){return h.adopt(se)})},add:function(se,Ce){return Ce==null?this.node.appendChild(se.node):se.node!=this.node.childNodes[Ce]&&this.node.insertBefore(se.node,this.node.childNodes[Ce]),this},put:function(se,Ce){return this.add(se,Ce),se},has:function(se){return this.index(se)>=0},index:function(se){return[].slice.call(this.node.childNodes).indexOf(se.node)},get:function(se){return h.adopt(this.node.childNodes[se])},first:function(){return this.get(0)},last:function(){return this.get(this.node.childNodes.length-1)},each:function(se,Ce){for(var De=this.children(),Le=0,_e=De.length;Le<_e;Le++)De[Le]instanceof h.Element&&se.apply(De[Le],[Le,De]),Ce&&De[Le]instanceof h.Container&&De[Le].each(se,Ce);return this},removeElement:function(se){return this.node.removeChild(se.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,this},defs:function(){return this.doc().defs()}}}),h.extend(h.Parent,{ungroup:function(se,Ce){return Ce===0||this instanceof h.Defs||this.node==h.parser.draw||(se=se||(this instanceof h.Doc?this:this.parent(h.Parent)),Ce=Ce||1/0,this.each(function(){return this instanceof h.Defs?this:this instanceof h.Parent?this.ungroup(se,Ce-1):this.toParent(se)}),this.node.firstChild||this.remove()),this},flatten:function(se,Ce){return this.ungroup(se,Ce)}}),h.Container=h.invent({create:function(se){this.constructor.call(this,se)},inherit:h.Parent}),h.ViewBox=h.invent({parent:h.Container,construct:{}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach(function(se){h.Element.prototype[se]=function(Ce){return h.on(this.node,se,Ce),this}}),h.listeners=[],h.handlerMap=[],h.listenerId=0,h.on=function(se,Ce,De,Le,_e){var nt=De.bind(Le||se.instance||se),ot=(h.handlerMap.indexOf(se)+1||h.handlerMap.push(se))-1,gt=Ce.split(".")[0],Jt=Ce.split(".")[1]||"*";h.listeners[ot]=h.listeners[ot]||{},h.listeners[ot][gt]=h.listeners[ot][gt]||{},h.listeners[ot][gt][Jt]=h.listeners[ot][gt][Jt]||{},De._svgjsListenerId||(De._svgjsListenerId=++h.listenerId),h.listeners[ot][gt][Jt][De._svgjsListenerId]=nt,se.addEventListener(gt,nt,_e||{passive:!1})},h.off=function(se,Ce,De){var Le=h.handlerMap.indexOf(se),_e=Ce&&Ce.split(".")[0],nt=Ce&&Ce.split(".")[1],ot="";if(Le!=-1)if(De){if(typeof De=="function"&&(De=De._svgjsListenerId),!De)return;h.listeners[Le][_e]&&h.listeners[Le][_e][nt||"*"]&&(se.removeEventListener(_e,h.listeners[Le][_e][nt||"*"][De],!1),delete h.listeners[Le][_e][nt||"*"][De])}else if(nt&&_e){if(h.listeners[Le][_e]&&h.listeners[Le][_e][nt]){for(var gt in h.listeners[Le][_e][nt])h.off(se,[_e,nt].join("."),gt);delete h.listeners[Le][_e][nt]}}else if(nt)for(var Jt in h.listeners[Le])for(var ot in h.listeners[Le][Jt])nt===ot&&h.off(se,[Jt,nt].join("."));else if(_e){if(h.listeners[Le][_e]){for(var ot in h.listeners[Le][_e])h.off(se,[_e,ot].join("."));delete h.listeners[Le][_e]}}else{for(var Jt in h.listeners[Le])h.off(se,Jt);delete h.listeners[Le],delete h.handlerMap[Le]}},h.extend(h.Element,{on:function(se,Ce,De,Le){return h.on(this.node,se,Ce,De,Le),this},off:function(se,Ce){return h.off(this.node,se,Ce),this},fire:function(se,Ce){return se instanceof Ee.Event?this.node.dispatchEvent(se):this.node.dispatchEvent(se=new h.CustomEvent(se,{detail:Ce,cancelable:!0})),this._event=se,this},event:function(){return this._event}}),h.Defs=h.invent({create:"defs",inherit:h.Container}),h.G=h.invent({create:"g",inherit:h.Container,extend:{x:function(se){return se==null?this.transform("x"):this.transform({x:se-this.x()},!0)}},construct:{group:function(){return this.put(new h.G)}}}),h.Doc=h.invent({create:function(se){se&&((se=typeof se=="string"?p.getElementById(se):se).nodeName=="svg"?this.constructor.call(this,se):(this.constructor.call(this,h.create("svg")),se.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:h.Container,extend:{namespace:function(){return this.attr({xmlns:h.ns,version:"1.1"}).attr("xmlns:xlink",h.xlink,h.xmlns).attr("xmlns:svgjs",h.svgjs,h.xmlns)},defs:function(){var se;return this._defs||((se=this.node.getElementsByTagName("defs")[0])?this._defs=h.adopt(se):this._defs=new h.Defs,this.node.appendChild(this._defs.node)),this._defs},parent:function(){return this.node.parentNode&&this.node.parentNode.nodeName!="#document"?this.node.parentNode:null},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,h.parser.draw&&!h.parser.draw.parentNode&&this.node.appendChild(h.parser.draw),this},clone:function(se){this.writeDataToDom();var Ce=this.node,De=Me(Ce.cloneNode(!0));return se?(se.node||se).appendChild(De.node):Ce.parentNode.insertBefore(De.node,Ce.nextSibling),De}}}),h.extend(h.Element,{}),h.Gradient=h.invent({create:function(se){this.constructor.call(this,h.create(se+"Gradient")),this.type=se},inherit:h.Container,extend:{at:function(se,Ce,De){return this.put(new h.Stop).update(se,Ce,De)},update:function(se){return this.clear(),typeof se=="function"&&se.call(this,this),this},fill:function(){return"url(#"+this.id()+")"},toString:function(){return this.fill()},attr:function(se,Ce,De){return se=="transform"&&(se="gradientTransform"),h.Container.prototype.attr.call(this,se,Ce,De)}},construct:{gradient:function(se,Ce){return this.defs().gradient(se,Ce)}}}),h.extend(h.Gradient,h.FX,{from:function(se,Ce){return(this._target||this).type=="radial"?this.attr({fx:new h.Number(se),fy:new h.Number(Ce)}):this.attr({x1:new h.Number(se),y1:new h.Number(Ce)})},to:function(se,Ce){return(this._target||this).type=="radial"?this.attr({cx:new h.Number(se),cy:new h.Number(Ce)}):this.attr({x2:new h.Number(se),y2:new h.Number(Ce)})}}),h.extend(h.Defs,{gradient:function(se,Ce){return this.put(new h.Gradient(se)).update(Ce)}}),h.Stop=h.invent({create:"stop",inherit:h.Element,extend:{update:function(se){return(typeof se=="number"||se instanceof h.Number)&&(se={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),se.opacity!=null&&this.attr("stop-opacity",se.opacity),se.color!=null&&this.attr("stop-color",se.color),se.offset!=null&&this.attr("offset",new h.Number(se.offset)),this}}}),h.Pattern=h.invent({create:"pattern",inherit:h.Container,extend:{fill:function(){return"url(#"+this.id()+")"},update:function(se){return this.clear(),typeof se=="function"&&se.call(this,this),this},toString:function(){return this.fill()},attr:function(se,Ce,De){return se=="transform"&&(se="patternTransform"),h.Container.prototype.attr.call(this,se,Ce,De)}},construct:{pattern:function(se,Ce,De){return this.defs().pattern(se,Ce,De)}}}),h.extend(h.Defs,{pattern:function(se,Ce,De){return this.put(new h.Pattern).update(De).attr({x:0,y:0,width:se,height:Ce,patternUnits:"userSpaceOnUse"})}}),h.Shape=h.invent({create:function(se){this.constructor.call(this,se)},inherit:h.Element}),h.Symbol=h.invent({create:"symbol",inherit:h.Container,construct:{symbol:function(){return this.put(new h.Symbol)}}}),h.Use=h.invent({create:"use",inherit:h.Shape,extend:{element:function(se,Ce){return this.attr("href",(Ce||"")+"#"+se,h.xlink)}},construct:{use:function(se,Ce){return this.put(new h.Use).element(se,Ce)}}}),h.Rect=h.invent({create:"rect",inherit:h.Shape,construct:{rect:function(se,Ce){return this.put(new h.Rect).size(se,Ce)}}}),h.Circle=h.invent({create:"circle",inherit:h.Shape,construct:{circle:function(se){return this.put(new h.Circle).rx(new h.Number(se).divide(2)).move(0,0)}}}),h.extend(h.Circle,h.FX,{rx:function(se){return this.attr("r",se)},ry:function(se){return this.rx(se)}}),h.Ellipse=h.invent({create:"ellipse",inherit:h.Shape,construct:{ellipse:function(se,Ce){return this.put(new h.Ellipse).size(se,Ce).move(0,0)}}}),h.extend(h.Ellipse,h.Rect,h.FX,{rx:function(se){return this.attr("rx",se)},ry:function(se){return this.attr("ry",se)}}),h.extend(h.Circle,h.Ellipse,{x:function(se){return se==null?this.cx()-this.rx():this.cx(se+this.rx())},y:function(se){return se==null?this.cy()-this.ry():this.cy(se+this.ry())},cx:function(se){return se==null?this.attr("cx"):this.attr("cx",se)},cy:function(se){return se==null?this.attr("cy"):this.attr("cy",se)},width:function(se){return se==null?2*this.rx():this.rx(new h.Number(se).divide(2))},height:function(se){return se==null?2*this.ry():this.ry(new h.Number(se).divide(2))},size:function(se,Ce){var De=xe(this,se,Ce);return this.rx(new h.Number(De.width).divide(2)).ry(new h.Number(De.height).divide(2))}}),h.Line=h.invent({create:"line",inherit:h.Shape,extend:{array:function(){return new h.PointArray([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])},plot:function(se,Ce,De,Le){return se==null?this.array():(se=Ce!==void 0?{x1:se,y1:Ce,x2:De,y2:Le}:new h.PointArray(se).toLine(),this.attr(se))},move:function(se,Ce){return this.attr(this.array().move(se,Ce).toLine())},size:function(se,Ce){var De=xe(this,se,Ce);return this.attr(this.array().size(De.width,De.height).toLine())}},construct:{line:function(se,Ce,De,Le){return h.Line.prototype.plot.apply(this.put(new h.Line),se!=null?[se,Ce,De,Le]:[0,0,0,0])}}}),h.Polyline=h.invent({create:"polyline",inherit:h.Shape,construct:{polyline:function(se){return this.put(new h.Polyline).plot(se||new h.PointArray)}}}),h.Polygon=h.invent({create:"polygon",inherit:h.Shape,construct:{polygon:function(se){return this.put(new h.Polygon).plot(se||new h.PointArray)}}}),h.extend(h.Polyline,h.Polygon,{array:function(){return this._array||(this._array=new h.PointArray(this.attr("points")))},plot:function(se){return se==null?this.array():this.clear().attr("points",typeof se=="string"?se:this._array=new h.PointArray(se))},clear:function(){return delete this._array,this},move:function(se,Ce){return this.attr("points",this.array().move(se,Ce))},size:function(se,Ce){var De=xe(this,se,Ce);return this.attr("points",this.array().size(De.width,De.height))}}),h.extend(h.Line,h.Polyline,h.Polygon,{morphArray:h.PointArray,x:function(se){return se==null?this.bbox().x:this.move(se,this.bbox().y)},y:function(se){return se==null?this.bbox().y:this.move(this.bbox().x,se)},width:function(se){var Ce=this.bbox();return se==null?Ce.width:this.size(se,Ce.height)},height:function(se){var Ce=this.bbox();return se==null?Ce.height:this.size(Ce.width,se)}}),h.Path=h.invent({create:"path",inherit:h.Shape,extend:{morphArray:h.PathArray,array:function(){return this._array||(this._array=new h.PathArray(this.attr("d")))},plot:function(se){return se==null?this.array():this.clear().attr("d",typeof se=="string"?se:this._array=new h.PathArray(se))},clear:function(){return delete this._array,this}},construct:{path:function(se){return this.put(new h.Path).plot(se||new h.PathArray)}}}),h.Image=h.invent({create:"image",inherit:h.Shape,extend:{load:function(se){if(!se)return this;var Ce=this,De=new Ee.Image;return h.on(De,"load",function(){h.off(De);var Le=Ce.parent(h.Pattern);Le!==null&&(Ce.width()==0&&Ce.height()==0&&Ce.size(De.width,De.height),Le&&Le.width()==0&&Le.height()==0&&Le.size(Ce.width(),Ce.height()),typeof Ce._loaded=="function"&&Ce._loaded.call(Ce,{width:De.width,height:De.height,ratio:De.width/De.height,url:se}))}),h.on(De,"error",function(Le){h.off(De),typeof Ce._error=="function"&&Ce._error.call(Ce,Le)}),this.attr("href",De.src=this.src=se,h.xlink)},loaded:function(se){return this._loaded=se,this},error:function(se){return this._error=se,this}},construct:{image:function(se,Ce,De){return this.put(new h.Image).load(se).size(Ce||0,De||Ce||0)}}}),h.Text=h.invent({create:function(){this.constructor.call(this,h.create("text")),this.dom.leading=new h.Number(1.3),this._rebuild=!0,this._build=!1,this.attr("font-family",h.defaults.attrs["font-family"])},inherit:h.Shape,extend:{x:function(se){return se==null?this.attr("x"):this.attr("x",se)},text:function(se){if(se===void 0){se="";for(var Ce=this.node.childNodes,De=0,Le=Ce.length;De<Le;++De)De!=0&&Ce[De].nodeType!=3&&h.adopt(Ce[De]).dom.newLined==1&&(se+=`
`),se+=Ce[De].textContent;return se}if(this.clear().build(!0),typeof se=="function")se.call(this,this);else{De=0;for(var _e=(se=se.split(`
`)).length;De<_e;De++)this.tspan(se[De]).newLine()}return this.build(!1).rebuild()},size:function(se){return this.attr("font-size",se).rebuild()},leading:function(se){return se==null?this.dom.leading:(this.dom.leading=new h.Number(se),this.rebuild())},lines:function(){var se=(this.textPath&&this.textPath()||this).node,Ce=h.utils.map(h.utils.filterSVGElements(se.childNodes),function(De){return h.adopt(De)});return new h.Set(Ce)},rebuild:function(se){if(typeof se=="boolean"&&(this._rebuild=se),this._rebuild){var Ce=this,De=0,Le=this.dom.leading*new h.Number(this.attr("font-size"));this.lines().each(function(){this.dom.newLined&&(Ce.textPath()||this.attr("x",Ce.attr("x")),this.text()==`
`?De+=Le:(this.attr("dy",Le+De),De=0))}),this.fire("rebuild")}return this},build:function(se){return this._build=!!se,this},setData:function(se){return this.dom=se,this.dom.leading=new h.Number(se.leading||1.3),this}},construct:{text:function(se){return this.put(new h.Text).text(se)},plain:function(se){return this.put(new h.Text).plain(se)}}}),h.Tspan=h.invent({create:"tspan",inherit:h.Shape,extend:{text:function(se){return se==null?this.node.textContent+(this.dom.newLined?`
`:""):(typeof se=="function"?se.call(this,this):this.plain(se),this)},dx:function(se){return this.attr("dx",se)},dy:function(se){return this.attr("dy",se)},newLine:function(){var se=this.parent(h.Text);return this.dom.newLined=!0,this.dy(se.dom.leading*se.attr("font-size")).attr("x",se.x())}}}),h.extend(h.Text,h.Tspan,{plain:function(se){return this._build===!1&&this.clear(),this.node.appendChild(p.createTextNode(se)),this},tspan:function(se){var Ce=(this.textPath&&this.textPath()||this).node,De=new h.Tspan;return this._build===!1&&this.clear(),Ce.appendChild(De.node),De.text(se)},clear:function(){for(var se=(this.textPath&&this.textPath()||this).node;se.hasChildNodes();)se.removeChild(se.lastChild);return this},length:function(){return this.node.getComputedTextLength()}}),h.TextPath=h.invent({create:"textPath",inherit:h.Parent,parent:h.Text,construct:{morphArray:h.PathArray,array:function(){var se=this.track();return se?se.array():null},plot:function(se){var Ce=this.track(),De=null;return Ce&&(De=Ce.plot(se)),se==null?De:this},track:function(){var se=this.textPath();if(se)return se.reference("href")},textPath:function(){if(this.node.firstChild&&this.node.firstChild.nodeName=="textPath")return h.adopt(this.node.firstChild)}}}),h.Nested=h.invent({create:function(){this.constructor.call(this,h.create("svg")),this.style("overflow","visible")},inherit:h.Container,construct:{nested:function(){return this.put(new h.Nested)}}});var B={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(se,Ce){return Ce=="color"?se:se+"-"+Ce}};function q(se,Ce,De,Le){return De+Le.replace(h.regex.dots," .")}function te(se){return se.toLowerCase().replace(/-(.)/g,function(Ce,De){return De.toUpperCase()})}function ue(se){return se.charAt(0).toUpperCase()+se.slice(1)}function de(se){var Ce=se.toString(16);return Ce.length==1?"0"+Ce:Ce}function xe(se,Ce,De){if(Ce==null||De==null){var Le=se.bbox();Ce==null?Ce=Le.width/Le.height*De:De==null&&(De=Le.height/Le.width*Ce)}return{width:Ce,height:De}}function we(se,Ce,De){return{x:Ce*se.a+De*se.c+0,y:Ce*se.b+De*se.d+0}}function ke(se){return{a:se[0],b:se[1],c:se[2],d:se[3],e:se[4],f:se[5]}}function Me(se){for(var Ce=se.childNodes.length-1;Ce>=0;Ce--)se.childNodes[Ce]instanceof Ee.SVGElement&&Me(se.childNodes[Ce]);return h.adopt(se).id(h.eid(se.nodeName))}function Ye(se){return Math.abs(se)>1e-37?se:0}["fill","stroke"].forEach(function(se){var Ce={};Ce[se]=function(De){if(De===void 0)return this;if(typeof De=="string"||h.Color.isRgb(De)||De&&typeof De.fill=="function")this.attr(se,De);else for(var Le=B[se].length-1;Le>=0;Le--)De[B[se][Le]]!=null&&this.attr(B.prefix(se,B[se][Le]),De[B[se][Le]]);return this},h.extend(h.Element,h.FX,Ce)}),h.extend(h.Element,h.FX,{translate:function(se,Ce){return this.transform({x:se,y:Ce})},matrix:function(se){return this.attr("transform",new h.Matrix(arguments.length==6?[].slice.call(arguments):se))},opacity:function(se){return this.attr("opacity",se)},dx:function(se){return this.x(new h.Number(se).plus(this instanceof h.FX?0:this.x()),!0)},dy:function(se){return this.y(new h.Number(se).plus(this instanceof h.FX?0:this.y()),!0)}}),h.extend(h.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(se){return this.node.getPointAtLength(se)}}),h.Set=h.invent({create:function(se){Array.isArray(se)?this.members=se:this.clear()},extend:{add:function(){for(var se=[].slice.call(arguments),Ce=0,De=se.length;Ce<De;Ce++)this.members.push(se[Ce]);return this},remove:function(se){var Ce=this.index(se);return Ce>-1&&this.members.splice(Ce,1),this},each:function(se){for(var Ce=0,De=this.members.length;Ce<De;Ce++)se.apply(this.members[Ce],[Ce,this.members]);return this},clear:function(){return this.members=[],this},length:function(){return this.members.length},has:function(se){return this.index(se)>=0},index:function(se){return this.members.indexOf(se)},get:function(se){return this.members[se]},first:function(){return this.get(0)},last:function(){return this.get(this.members.length-1)},valueOf:function(){return this.members}},construct:{set:function(se){return new h.Set(se)}}}),h.FX.Set=h.invent({create:function(se){this.set=se}}),h.Set.inherit=function(){var se=[];for(var Ce in h.Shape.prototype)typeof h.Shape.prototype[Ce]=="function"&&typeof h.Set.prototype[Ce]!="function"&&se.push(Ce);for(var Ce in se.forEach(function(Le){h.Set.prototype[Le]=function(){for(var _e=0,nt=this.members.length;_e<nt;_e++)this.members[_e]&&typeof this.members[_e][Le]=="function"&&this.members[_e][Le].apply(this.members[_e],arguments);return Le=="animate"?this.fx||(this.fx=new h.FX.Set(this)):this}}),se=[],h.FX.prototype)typeof h.FX.prototype[Ce]=="function"&&typeof h.FX.Set.prototype[Ce]!="function"&&se.push(Ce);se.forEach(function(De){h.FX.Set.prototype[De]=function(){for(var Le=0,_e=this.set.members.length;Le<_e;Le++)this.set.members[Le].fx[De].apply(this.set.members[Le].fx,arguments);return this}})},h.extend(h.Element,{}),h.extend(h.Element,{remember:function(se,Ce){if(P(arguments[0])==="object")for(var De in se)this.remember(De,se[De]);else{if(arguments.length==1)return this.memory()[se];this.memory()[se]=Ce}return this},forget:function(){if(arguments.length==0)this._memory={};else for(var se=arguments.length-1;se>=0;se--)delete this.memory()[arguments[se]];return this},memory:function(){return this._memory||(this._memory={})}}),h.get=function(se){var Ce=p.getElementById(function(De){var Le=(De||"").toString().match(h.regex.reference);if(Le)return Le[1]}(se)||se);return h.adopt(Ce)},h.select=function(se,Ce){return new h.Set(h.utils.map((Ce||p).querySelectorAll(se),function(De){return h.adopt(De)}))},h.extend(h.Parent,{select:function(se){return h.select(se,this.node)}});var Fe="abcdef".split("");if(typeof Ee.CustomEvent!="function"){var rt=function(se,Ce){Ce=Ce||{bubbles:!1,cancelable:!1,detail:void 0};var De=p.createEvent("CustomEvent");return De.initCustomEvent(se,Ce.bubbles,Ce.cancelable,Ce.detail),De};rt.prototype=Ee.Event.prototype,h.CustomEvent=rt}else h.CustomEvent=Ee.CustomEvent;return h},P(t)==="object"?e.exports=Cn.document?Bt(Cn,Cn.document):function(Ee){return Bt(Ee,Ee.document)}:Cn.SVG=Bt(Cn,Cn.document),(function(){SVG.Filter=SVG.invent({create:"filter",inherit:SVG.Parent,extend:{source:"SourceGraphic",sourceAlpha:"SourceAlpha",background:"BackgroundImage",backgroundAlpha:"BackgroundAlpha",fill:"FillPaint",stroke:"StrokePaint",autoSetIn:!0,put:function(T,B){return this.add(T,B),!T.attr("in")&&this.autoSetIn&&T.attr("in",this.source),T.attr("result")||T.attr("result",T),T},blend:function(T,B,q){return this.put(new SVG.BlendEffect(T,B,q))},colorMatrix:function(T,B){return this.put(new SVG.ColorMatrixEffect(T,B))},convolveMatrix:function(T){return this.put(new SVG.ConvolveMatrixEffect(T))},componentTransfer:function(T){return this.put(new SVG.ComponentTransferEffect(T))},composite:function(T,B,q){return this.put(new SVG.CompositeEffect(T,B,q))},flood:function(T,B){return this.put(new SVG.FloodEffect(T,B))},offset:function(T,B){return this.put(new SVG.OffsetEffect(T,B))},image:function(T){return this.put(new SVG.ImageEffect(T))},merge:function(){var T=[void 0];for(var B in arguments)T.push(arguments[B]);return this.put(new(SVG.MergeEffect.bind.apply(SVG.MergeEffect,T)))},gaussianBlur:function(T,B){return this.put(new SVG.GaussianBlurEffect(T,B))},morphology:function(T,B){return this.put(new SVG.MorphologyEffect(T,B))},diffuseLighting:function(T,B,q){return this.put(new SVG.DiffuseLightingEffect(T,B,q))},displacementMap:function(T,B,q,te,ue){return this.put(new SVG.DisplacementMapEffect(T,B,q,te,ue))},specularLighting:function(T,B,q,te){return this.put(new SVG.SpecularLightingEffect(T,B,q,te))},tile:function(){return this.put(new SVG.TileEffect)},turbulence:function(T,B,q,te,ue){return this.put(new SVG.TurbulenceEffect(T,B,q,te,ue))},toString:function(){return"url(#"+this.attr("id")+")"}}}),SVG.extend(SVG.Defs,{filter:function(T){var B=this.put(new SVG.Filter);return typeof T=="function"&&T.call(B,B),B}}),SVG.extend(SVG.Container,{filter:function(T){return this.defs().filter(T)}}),SVG.extend(SVG.Element,SVG.G,SVG.Nested,{filter:function(T){return this.filterer=T instanceof SVG.Element?T:this.doc().filter(T),this.doc()&&this.filterer.doc()!==this.doc()&&this.doc().defs().add(this.filterer),this.attr("filter",this.filterer),this.filterer},unfilter:function(T){return this.filterer&&T===!0&&this.filterer.remove(),delete this.filterer,this.attr("filter",null)}}),SVG.Effect=SVG.invent({create:function(){this.constructor.call(this)},inherit:SVG.Element,extend:{in:function(T){return T==null?this.parent()&&this.parent().select('[result="'+this.attr("in")+'"]').get(0)||this.attr("in"):this.attr("in",T)},result:function(T){return T==null?this.attr("result"):this.attr("result",T)},toString:function(){return this.result()}}}),SVG.ParentEffect=SVG.invent({create:function(){this.constructor.call(this)},inherit:SVG.Parent,extend:{in:function(T){return T==null?this.parent()&&this.parent().select('[result="'+this.attr("in")+'"]').get(0)||this.attr("in"):this.attr("in",T)},result:function(T){return T==null?this.attr("result"):this.attr("result",T)},toString:function(){return this.result()}}});var Ee={blend:function(T,B){return this.parent()&&this.parent().blend(this,T,B)},colorMatrix:function(T,B){return this.parent()&&this.parent().colorMatrix(T,B).in(this)},convolveMatrix:function(T){return this.parent()&&this.parent().convolveMatrix(T).in(this)},componentTransfer:function(T){return this.parent()&&this.parent().componentTransfer(T).in(this)},composite:function(T,B){return this.parent()&&this.parent().composite(this,T,B)},flood:function(T,B){return this.parent()&&this.parent().flood(T,B)},offset:function(T,B){return this.parent()&&this.parent().offset(T,B).in(this)},image:function(T){return this.parent()&&this.parent().image(T)},merge:function(){return this.parent()&&this.parent().merge.apply(this.parent(),[this].concat(arguments))},gaussianBlur:function(T,B){return this.parent()&&this.parent().gaussianBlur(T,B).in(this)},morphology:function(T,B){return this.parent()&&this.parent().morphology(T,B).in(this)},diffuseLighting:function(T,B,q){return this.parent()&&this.parent().diffuseLighting(T,B,q).in(this)},displacementMap:function(T,B,q,te){return this.parent()&&this.parent().displacementMap(this,T,B,q,te)},specularLighting:function(T,B,q,te){return this.parent()&&this.parent().specularLighting(T,B,q,te).in(this)},tile:function(){return this.parent()&&this.parent().tile().in(this)},turbulence:function(T,B,q,te,ue){return this.parent()&&this.parent().turbulence(T,B,q,te,ue).in(this)}};SVG.extend(SVG.Effect,Ee),SVG.extend(SVG.ParentEffect,Ee),SVG.ChildEffect=SVG.invent({create:function(){this.constructor.call(this)},inherit:SVG.Element,extend:{in:function(T){this.attr("in",T)}}});var p={blend:function(T,B,q){this.attr({in:T,in2:B,mode:q||"normal"})},colorMatrix:function(T,B){T=="matrix"&&(B=_(B)),this.attr({type:T,values:B===void 0?null:B})},convolveMatrix:function(T){T=_(T),this.attr({order:Math.sqrt(T.split(" ").length),kernelMatrix:T})},composite:function(T,B,q){this.attr({in:T,in2:B,operator:q})},flood:function(T,B){this.attr("flood-color",T),B!=null&&this.attr("flood-opacity",B)},offset:function(T,B){this.attr({dx:T,dy:B})},image:function(T){this.attr("href",T,SVG.xlink)},displacementMap:function(T,B,q,te,ue){this.attr({in:T,in2:B,scale:q,xChannelSelector:te,yChannelSelector:ue})},gaussianBlur:function(T,B){T!=null||B!=null?this.attr("stdDeviation",function(q){if(!Array.isArray(q))return q;for(var te=0,ue=q.length,de=[];te<ue;te++)de.push(q[te]);return de.join(" ")}(Array.prototype.slice.call(arguments))):this.attr("stdDeviation","0 0")},morphology:function(T,B){this.attr({operator:T,radius:B})},tile:function(){},turbulence:function(T,B,q,te,ue){this.attr({numOctaves:B,seed:q,stitchTiles:te,baseFrequency:T,type:ue})}},h={merge:function(){var T;if(arguments[0]instanceof SVG.Set){var B=this;arguments[0].each(function(te){this instanceof SVG.MergeNode?B.put(this):(this instanceof SVG.Effect||this instanceof SVG.ParentEffect)&&B.put(new SVG.MergeNode(this))})}else{T=Array.isArray(arguments[0])?arguments[0]:arguments;for(var q=0;q<T.length;q++)T[q]instanceof SVG.MergeNode?this.put(T[q]):this.put(new SVG.MergeNode(T[q]))}},componentTransfer:function(T){if(this.rgb=new SVG.Set,["r","g","b","a"].forEach((function(q){this[q]=new SVG["Func"+q.toUpperCase()]("identity"),this.rgb.add(this[q]),this.node.appendChild(this[q].node)}).bind(this)),T)for(var B in T.rgb&&(["r","g","b"].forEach((function(q){this[q].attr(T.rgb)}).bind(this)),delete T.rgb),T)this[B].attr(T[B])},diffuseLighting:function(T,B,q){this.attr({surfaceScale:T,diffuseConstant:B,kernelUnitLength:q})},specularLighting:function(T,B,q,te){this.attr({surfaceScale:T,diffuseConstant:B,specularExponent:q,kernelUnitLength:te})}},S={distantLight:function(T,B){this.attr({azimuth:T,elevation:B})},pointLight:function(T,B,q){this.attr({x:T,y:B,z:q})},spotLight:function(T,B,q,te,ue,de){this.attr({x:T,y:B,z:q,pointsAtX:te,pointsAtY:ue,pointsAtZ:de})},mergeNode:function(T){this.attr("in",T)}};function _(T){return Array.isArray(T)&&(T=new SVG.Array(T)),T.toString().replace(/^\s+/,"").replace(/\s+$/,"").replace(/\s+/g," ")}function k(){var T=function(){};for(var B in typeof arguments[arguments.length-1]=="function"&&(T=arguments[arguments.length-1],Array.prototype.splice.call(arguments,arguments.length-1,1)),arguments)for(var q in arguments[B])T(arguments[B][q],q,arguments[B])}["r","g","b","a"].forEach(function(T){S["Func"+T.toUpperCase()]=function(B){switch(this.attr("type",B),B){case"table":this.attr("tableValues",arguments[1]);break;case"linear":this.attr("slope",arguments[1]),this.attr("intercept",arguments[2]);break;case"gamma":this.attr("amplitude",arguments[1]),this.attr("exponent",arguments[2]),this.attr("offset",arguments[2])}}}),k(p,function(T,B){var q=B.charAt(0).toUpperCase()+B.slice(1);SVG[q+"Effect"]=SVG.invent({create:function(){this.constructor.call(this,SVG.create("fe"+q)),T.apply(this,arguments),this.result(this.attr("id")+"Out")},inherit:SVG.Effect,extend:{}})}),k(h,function(T,B){var q=B.charAt(0).toUpperCase()+B.slice(1);SVG[q+"Effect"]=SVG.invent({create:function(){this.constructor.call(this,SVG.create("fe"+q)),T.apply(this,arguments),this.result(this.attr("id")+"Out")},inherit:SVG.ParentEffect,extend:{}})}),k(S,function(T,B){var q=B.charAt(0).toUpperCase()+B.slice(1);SVG[q]=SVG.invent({create:function(){this.constructor.call(this,SVG.create("fe"+q)),T.apply(this,arguments)},inherit:SVG.ChildEffect,extend:{}})}),SVG.extend(SVG.MergeEffect,{in:function(T){return T instanceof SVG.MergeNode?this.add(T,0):this.add(new SVG.MergeNode(T),0),this}}),SVG.extend(SVG.CompositeEffect,SVG.BlendEffect,SVG.DisplacementMapEffect,{in2:function(T){return T==null?this.parent()&&this.parent().select('[result="'+this.attr("in2")+'"]').get(0)||this.attr("in2"):this.attr("in2",T)}}),SVG.filter={sepiatone:[.343,.669,.119,0,0,.249,.626,.13,0,0,.172,.334,.111,0,0,0,0,0,1,0]}}).call(void 0),function(){function Ee(k,T,B,q,te,ue,de){for(var xe=k.slice(T,B||de),we=q.slice(te,ue||de),ke=0,Me={pos:[0,0],start:[0,0]},Ye={pos:[0,0],start:[0,0]};xe[ke]=p.call(Me,xe[ke]),we[ke]=p.call(Ye,we[ke]),xe[ke][0]!=we[ke][0]||xe[ke][0]=="M"||xe[ke][0]=="A"&&(xe[ke][4]!=we[ke][4]||xe[ke][5]!=we[ke][5])?(Array.prototype.splice.apply(xe,[ke,1].concat(S.call(Me,xe[ke]))),Array.prototype.splice.apply(we,[ke,1].concat(S.call(Ye,we[ke])))):(xe[ke]=h.call(Me,xe[ke]),we[ke]=h.call(Ye,we[ke])),!(++ke==xe.length&&ke==we.length);)ke==xe.length&&xe.push(["C",Me.pos[0],Me.pos[1],Me.pos[0],Me.pos[1],Me.pos[0],Me.pos[1]]),ke==we.length&&we.push(["C",Ye.pos[0],Ye.pos[1],Ye.pos[0],Ye.pos[1],Ye.pos[0],Ye.pos[1]]);return{start:xe,dest:we}}function p(k){switch(k[0]){case"z":case"Z":k[0]="L",k[1]=this.start[0],k[2]=this.start[1];break;case"H":k[0]="L",k[2]=this.pos[1];break;case"V":k[0]="L",k[2]=k[1],k[1]=this.pos[0];break;case"T":k[0]="Q",k[3]=k[1],k[4]=k[2],k[1]=this.reflection[1],k[2]=this.reflection[0];break;case"S":k[0]="C",k[6]=k[4],k[5]=k[3],k[4]=k[2],k[3]=k[1],k[2]=this.reflection[1],k[1]=this.reflection[0]}return k}function h(k){var T=k.length;return this.pos=[k[T-2],k[T-1]],"SCQT".indexOf(k[0])!=-1&&(this.reflection=[2*this.pos[0]-k[T-4],2*this.pos[1]-k[T-3]]),k}function S(k){var T=[k];switch(k[0]){case"M":return this.pos=this.start=[k[1],k[2]],T;case"L":k[5]=k[3]=k[1],k[6]=k[4]=k[2],k[1]=this.pos[0],k[2]=this.pos[1];break;case"Q":k[6]=k[4],k[5]=k[3],k[4]=1*k[4]/3+2*k[2]/3,k[3]=1*k[3]/3+2*k[1]/3,k[2]=1*this.pos[1]/3+2*k[2]/3,k[1]=1*this.pos[0]/3+2*k[1]/3;break;case"A":T=function(B,q){var te,ue,de,xe,we,ke,Me,Ye,Fe,rt,se,Ce,De,Le,_e,nt,ot,gt,Jt,Ge,et,We,wt,St,Kt,gn,yn=Math.abs(q[1]),hn=Math.abs(q[2]),br=q[3]%360,pt=q[4],Wt=q[5],Zt=q[6],vt=q[7],Ot=new SVG.Point(B),wn=new SVG.Point(Zt,vt),Gn=[];if(yn===0||hn===0||Ot.x===wn.x&&Ot.y===wn.y)return[["C",Ot.x,Ot.y,wn.x,wn.y,wn.x,wn.y]];for(te=new SVG.Point((Ot.x-wn.x)/2,(Ot.y-wn.y)/2).transform(new SVG.Matrix().rotate(br)),(ue=te.x*te.x/(yn*yn)+te.y*te.y/(hn*hn))>1&&(yn*=ue=Math.sqrt(ue),hn*=ue),de=new SVG.Matrix().rotate(br).scale(1/yn,1/hn).rotate(-br),Ot=Ot.transform(de),wn=wn.transform(de),xe=[wn.x-Ot.x,wn.y-Ot.y],ke=xe[0]*xe[0]+xe[1]*xe[1],we=Math.sqrt(ke),xe[0]/=we,xe[1]/=we,Me=ke<4?Math.sqrt(1-ke/4):0,pt===Wt&&(Me*=-1),Ye=new SVG.Point((wn.x+Ot.x)/2+Me*-xe[1],(wn.y+Ot.y)/2+Me*xe[0]),Fe=new SVG.Point(Ot.x-Ye.x,Ot.y-Ye.y),rt=new SVG.Point(wn.x-Ye.x,wn.y-Ye.y),se=Math.acos(Fe.x/Math.sqrt(Fe.x*Fe.x+Fe.y*Fe.y)),Fe.y<0&&(se*=-1),Ce=Math.acos(rt.x/Math.sqrt(rt.x*rt.x+rt.y*rt.y)),rt.y<0&&(Ce*=-1),Wt&&se>Ce&&(Ce+=2*Math.PI),!Wt&&se<Ce&&(Ce-=2*Math.PI),Le=Math.ceil(2*Math.abs(se-Ce)/Math.PI),nt=[],ot=se,De=(Ce-se)/Le,_e=4*Math.tan(De/4)/3,et=0;et<=Le;et++)Jt=Math.cos(ot),gt=Math.sin(ot),Ge=new SVG.Point(Ye.x+Jt,Ye.y+gt),nt[et]=[new SVG.Point(Ge.x+_e*gt,Ge.y-_e*Jt),Ge,new SVG.Point(Ge.x-_e*gt,Ge.y+_e*Jt)],ot+=De;for(nt[0][0]=nt[0][1].clone(),nt[nt.length-1][2]=nt[nt.length-1][1].clone(),de=new SVG.Matrix().rotate(br).scale(yn,hn).rotate(-br),et=0,We=nt.length;et<We;et++)nt[et][0]=nt[et][0].transform(de),nt[et][1]=nt[et][1].transform(de),nt[et][2]=nt[et][2].transform(de);for(et=1,We=nt.length;et<We;et++)wt=(Ge=nt[et-1][2]).x,St=Ge.y,Kt=(Ge=nt[et][0]).x,gn=Ge.y,Zt=(Ge=nt[et][1]).x,vt=Ge.y,Gn.push(["C",wt,St,Kt,gn,Zt,vt]);return Gn}(this.pos,k),k=T[0]}return k[0]="C",this.pos=[k[5],k[6]],this.reflection=[2*k[5]-k[3],2*k[6]-k[4]],T}function _(k,T){if(T===!1)return!1;for(var B=T,q=k.length;B<q;++B)if(k[B][0]=="M")return B;return!1}SVG.extend(SVG.PathArray,{morph:function(k){for(var T=this.value,B=this.parse(k),q=0,te=0,ue=!1,de=!1;q!==!1||te!==!1;){var xe;ue=_(T,q!==!1&&q+1),de=_(B,te!==!1&&te+1),q===!1&&(q=(xe=new SVG.PathArray(we.start).bbox()).height==0||xe.width==0?T.push(T[0])-1:T.push(["M",xe.x+xe.width/2,xe.y+xe.height/2])-1),te===!1&&(te=(xe=new SVG.PathArray(we.dest).bbox()).height==0||xe.width==0?B.push(B[0])-1:B.push(["M",xe.x+xe.width/2,xe.y+xe.height/2])-1);var we=Ee(T,q,ue,B,te,de);T=T.slice(0,q).concat(we.start,ue===!1?[]:T.slice(ue)),B=B.slice(0,te).concat(we.dest,de===!1?[]:B.slice(de)),q=ue!==!1&&q+we.start.length,te=de!==!1&&te+we.dest.length}return this.value=T,this.destination=new SVG.PathArray,this.destination.value=B,this}})}(),(function(){function Ee(p){p.remember("_draggable",this),this.el=p}Ee.prototype.init=function(p,h){var S=this;this.constraint=p,this.value=h,this.el.on("mousedown.drag",function(_){S.start(_)}),this.el.on("touchstart.drag",function(_){S.start(_)})},Ee.prototype.transformPoint=function(p,h){var S=(p=p||window.event).changedTouches&&p.changedTouches[0]||p;return this.p.x=S.clientX-(h||0),this.p.y=S.clientY,this.p.matrixTransform(this.m)},Ee.prototype.getBBox=function(){var p=this.el.bbox();return this.el instanceof SVG.Nested&&(p=this.el.rbox()),(this.el instanceof SVG.G||this.el instanceof SVG.Use||this.el instanceof SVG.Nested)&&(p.x=this.el.x(),p.y=this.el.y()),p},Ee.prototype.start=function(p){if(p.type!="click"&&p.type!="mousedown"&&p.type!="mousemove"||(p.which||p.buttons)==1){var h=this;if(this.el.fire("beforedrag",{event:p,handler:this}),!this.el.event().defaultPrevented){p.preventDefault(),p.stopPropagation(),this.parent=this.parent||this.el.parent(SVG.Nested)||this.el.parent(SVG.Doc),this.p=this.parent.node.createSVGPoint(),this.m=this.el.node.getScreenCTM().inverse();var S,_=this.getBBox();if(this.el instanceof SVG.Text)switch(S=this.el.node.getComputedTextLength(),this.el.attr("text-anchor")){case"middle":S/=2;break;case"start":S=0}this.startPoints={point:this.transformPoint(p,S),box:_,transform:this.el.transform()},SVG.on(window,"mousemove.drag",function(k){h.drag(k)}),SVG.on(window,"touchmove.drag",function(k){h.drag(k)}),SVG.on(window,"mouseup.drag",function(k){h.end(k)}),SVG.on(window,"touchend.drag",function(k){h.end(k)}),this.el.fire("dragstart",{event:p,p:this.startPoints.point,m:this.m,handler:this})}}},Ee.prototype.drag=function(p){var h=this.getBBox(),S=this.transformPoint(p),_=this.startPoints.box.x+S.x-this.startPoints.point.x,k=this.startPoints.box.y+S.y-this.startPoints.point.y,T=this.constraint,B=S.x-this.startPoints.point.x,q=S.y-this.startPoints.point.y;if(this.el.fire("dragmove",{event:p,p:S,m:this.m,handler:this}),this.el.event().defaultPrevented)return S;if(typeof T=="function"){var te=T.call(this.el,_,k,this.m);typeof te=="boolean"&&(te={x:te,y:te}),te.x===!0?this.el.x(_):te.x!==!1&&this.el.x(te.x),te.y===!0?this.el.y(k):te.y!==!1&&this.el.y(te.y)}else typeof T=="object"&&(T.minX!=null&&_<T.minX?B=(_=T.minX)-this.startPoints.box.x:T.maxX!=null&&_>T.maxX-h.width&&(B=(_=T.maxX-h.width)-this.startPoints.box.x),T.minY!=null&&k<T.minY?q=(k=T.minY)-this.startPoints.box.y:T.maxY!=null&&k>T.maxY-h.height&&(q=(k=T.maxY-h.height)-this.startPoints.box.y),T.snapToGrid!=null&&(_-=_%T.snapToGrid,k-=k%T.snapToGrid,B-=B%T.snapToGrid,q-=q%T.snapToGrid),this.el instanceof SVG.G?this.el.matrix(this.startPoints.transform).transform({x:B,y:q},!0):this.el.move(_,k));return S},Ee.prototype.end=function(p){var h=this.drag(p);this.el.fire("dragend",{event:p,p:h,m:this.m,handler:this}),SVG.off(window,"mousemove.drag"),SVG.off(window,"touchmove.drag"),SVG.off(window,"mouseup.drag"),SVG.off(window,"touchend.drag")},SVG.extend(SVG.Element,{draggable:function(p,h){typeof p!="function"&&typeof p!="object"||(h=p,p=!0);var S=this.remember("_draggable")||new Ee(this);return(p=p===void 0||p)?S.init(h||{},p):(this.off("mousedown.drag"),this.off("touchstart.drag")),this}})}).call(void 0),function(){function Ee(p){this.el=p,p.remember("_selectHandler",this),this.pointSelection={isSelected:!1},this.rectSelection={isSelected:!1},this.pointsList={lt:[0,0],rt:["width",0],rb:["width","height"],lb:[0,"height"],t:["width",0],r:["width","height"],b:["width","height"],l:[0,"height"]},this.pointCoord=function(h,S,_){var k=typeof h!="string"?h:S[h];return _?k/2:k},this.pointCoords=function(h,S){var _=this.pointsList[h];return{x:this.pointCoord(_[0],S,h==="t"||h==="b"),y:this.pointCoord(_[1],S,h==="r"||h==="l")}}}Ee.prototype.init=function(p,h){var S=this.el.bbox();this.options={};var _=this.el.selectize.defaults.points;for(var k in this.el.selectize.defaults)this.options[k]=this.el.selectize.defaults[k],h[k]!==void 0&&(this.options[k]=h[k]);var T=["points","pointsExclude"];for(var k in T){var B=this.options[T[k]];typeof B=="string"?B=B.length>0?B.split(/\s*,\s*/i):[]:typeof B=="boolean"&&T[k]==="points"&&(B=B?_:[]),this.options[T[k]]=B}this.options.points=[_,this.options.points].reduce(function(q,te){return q.filter(function(ue){return te.indexOf(ue)>-1})}),this.options.points=[this.options.points,this.options.pointsExclude].reduce(function(q,te){return q.filter(function(ue){return te.indexOf(ue)<0})}),this.parent=this.el.parent(),this.nested=this.nested||this.parent.group(),this.nested.matrix(new SVG.Matrix(this.el).translate(S.x,S.y)),this.options.deepSelect&&["line","polyline","polygon"].indexOf(this.el.type)!==-1?this.selectPoints(p):this.selectRect(p),this.observe(),this.cleanup()},Ee.prototype.selectPoints=function(p){return this.pointSelection.isSelected=p,this.pointSelection.set||(this.pointSelection.set=this.parent.set(),this.drawPoints()),this},Ee.prototype.getPointArray=function(){var p=this.el.bbox();return this.el.array().valueOf().map(function(h){return[h[0]-p.x,h[1]-p.y]})},Ee.prototype.drawPoints=function(){for(var p=this,h=this.getPointArray(),S=0,_=h.length;S<_;++S){var k=function(B){return function(q){(q=q||window.event).preventDefault?q.preventDefault():q.returnValue=!1,q.stopPropagation();var te=q.pageX||q.touches[0].pageX,ue=q.pageY||q.touches[0].pageY;p.el.fire("point",{x:te,y:ue,i:B,event:q})}}(S),T=this.drawPoint(h[S][0],h[S][1]).addClass(this.options.classPoints).addClass(this.options.classPoints+"_point").on("touchstart",k).on("mousedown",k);this.pointSelection.set.add(T)}},Ee.prototype.drawPoint=function(p,h){var S=this.options.pointType;switch(S){case"circle":return this.drawCircle(p,h);case"rect":return this.drawRect(p,h);default:if(typeof S=="function")return S.call(this,p,h);throw new Error("Unknown "+S+" point type!")}},Ee.prototype.drawCircle=function(p,h){return this.nested.circle(this.options.pointSize).center(p,h)},Ee.prototype.drawRect=function(p,h){return this.nested.rect(this.options.pointSize,this.options.pointSize).center(p,h)},Ee.prototype.updatePointSelection=function(){var p=this.getPointArray();this.pointSelection.set.each(function(h){this.cx()===p[h][0]&&this.cy()===p[h][1]||this.center(p[h][0],p[h][1])})},Ee.prototype.updateRectSelection=function(){var p=this,h=this.el.bbox();if(this.rectSelection.set.get(0).attr({width:h.width,height:h.height}),this.options.points.length&&this.options.points.map(function(_,k){var T=p.pointCoords(_,h);p.rectSelection.set.get(k+1).center(T.x,T.y)}),this.options.rotationPoint){var S=this.rectSelection.set.length();this.rectSelection.set.get(S-1).center(h.width/2,20)}},Ee.prototype.selectRect=function(p){var h=this,S=this.el.bbox();function _(B){return function(q){(q=q||window.event).preventDefault?q.preventDefault():q.returnValue=!1,q.stopPropagation();var te=q.pageX||q.touches[0].pageX,ue=q.pageY||q.touches[0].pageY;h.el.fire(B,{x:te,y:ue,event:q})}}if(this.rectSelection.isSelected=p,this.rectSelection.set=this.rectSelection.set||this.parent.set(),this.rectSelection.set.get(0)||this.rectSelection.set.add(this.nested.rect(S.width,S.height).addClass(this.options.classRect)),this.options.points.length&&this.rectSelection.set.length()<2&&(this.options.points.map(function(B,q){var te=h.pointCoords(B,S),ue=h.drawPoint(te.x,te.y).attr("class",h.options.classPoints+"_"+B).on("mousedown",_(B)).on("touchstart",_(B));h.rectSelection.set.add(ue)}),this.rectSelection.set.each(function(){this.addClass(h.options.classPoints)})),this.options.rotationPoint&&(this.options.points&&!this.rectSelection.set.get(9)||!this.options.points&&!this.rectSelection.set.get(1))){var k=function(B){(B=B||window.event).preventDefault?B.preventDefault():B.returnValue=!1,B.stopPropagation();var q=B.pageX||B.touches[0].pageX,te=B.pageY||B.touches[0].pageY;h.el.fire("rot",{x:q,y:te,event:B})},T=this.drawPoint(S.width/2,20).attr("class",this.options.classPoints+"_rot").on("touchstart",k).on("mousedown",k);this.rectSelection.set.add(T)}},Ee.prototype.handler=function(){var p=this.el.bbox();this.nested.matrix(new SVG.Matrix(this.el).translate(p.x,p.y)),this.rectSelection.isSelected&&this.updateRectSelection(),this.pointSelection.isSelected&&this.updatePointSelection()},Ee.prototype.observe=function(){var p=this;if(MutationObserver)if(this.rectSelection.isSelected||this.pointSelection.isSelected)this.observerInst=this.observerInst||new MutationObserver(function(){p.handler()}),this.observerInst.observe(this.el.node,{attributes:!0});else try{this.observerInst.disconnect(),delete this.observerInst}catch{}else this.el.off("DOMAttrModified.select"),(this.rectSelection.isSelected||this.pointSelection.isSelected)&&this.el.on("DOMAttrModified.select",function(){p.handler()})},Ee.prototype.cleanup=function(){!this.rectSelection.isSelected&&this.rectSelection.set&&(this.rectSelection.set.each(function(){this.remove()}),this.rectSelection.set.clear(),delete this.rectSelection.set),!this.pointSelection.isSelected&&this.pointSelection.set&&(this.pointSelection.set.each(function(){this.remove()}),this.pointSelection.set.clear(),delete this.pointSelection.set),this.pointSelection.isSelected||this.rectSelection.isSelected||(this.nested.remove(),delete this.nested)},SVG.extend(SVG.Element,{selectize:function(p,h){return typeof p=="object"&&(h=p,p=!0),(this.remember("_selectHandler")||new Ee(this)).init(p===void 0||p,h||{}),this}}),SVG.Element.prototype.selectize.defaults={points:["lt","rt","rb","lb","t","r","b","l"],pointsExclude:[],classRect:"svg_select_boundingRect",classPoints:"svg_select_points",pointSize:7,rotationPoint:!0,deepSelect:!1,pointType:"circle"}}(),function(){(function(){function Ee(p){p.remember("_resizeHandler",this),this.el=p,this.parameters={},this.lastUpdateCall=null,this.p=p.doc().node.createSVGPoint()}Ee.prototype.transformPoint=function(p,h,S){return this.p.x=p-(this.offset.x-window.pageXOffset),this.p.y=h-(this.offset.y-window.pageYOffset),this.p.matrixTransform(S||this.m)},Ee.prototype._extractPosition=function(p){return{x:p.clientX!=null?p.clientX:p.touches[0].clientX,y:p.clientY!=null?p.clientY:p.touches[0].clientY}},Ee.prototype.init=function(p){var h=this;if(this.stop(),p!=="stop"){for(var S in this.options={},this.el.resize.defaults)this.options[S]=this.el.resize.defaults[S],p[S]!==void 0&&(this.options[S]=p[S]);this.el.on("lt.resize",function(_){h.resize(_||window.event)}),this.el.on("rt.resize",function(_){h.resize(_||window.event)}),this.el.on("rb.resize",function(_){h.resize(_||window.event)}),this.el.on("lb.resize",function(_){h.resize(_||window.event)}),this.el.on("t.resize",function(_){h.resize(_||window.event)}),this.el.on("r.resize",function(_){h.resize(_||window.event)}),this.el.on("b.resize",function(_){h.resize(_||window.event)}),this.el.on("l.resize",function(_){h.resize(_||window.event)}),this.el.on("rot.resize",function(_){h.resize(_||window.event)}),this.el.on("point.resize",function(_){h.resize(_||window.event)}),this.update()}},Ee.prototype.stop=function(){return this.el.off("lt.resize"),this.el.off("rt.resize"),this.el.off("rb.resize"),this.el.off("lb.resize"),this.el.off("t.resize"),this.el.off("r.resize"),this.el.off("b.resize"),this.el.off("l.resize"),this.el.off("rot.resize"),this.el.off("point.resize"),this},Ee.prototype.resize=function(p){var h=this;this.m=this.el.node.getScreenCTM().inverse(),this.offset={x:window.pageXOffset,y:window.pageYOffset};var S=this._extractPosition(p.detail.event);if(this.parameters={type:this.el.type,p:this.transformPoint(S.x,S.y),x:p.detail.x,y:p.detail.y,box:this.el.bbox(),rotation:this.el.transform().rotation},this.el.type==="text"&&(this.parameters.fontSize=this.el.attr()["font-size"]),p.detail.i!==void 0){var _=this.el.array().valueOf();this.parameters.i=p.detail.i,this.parameters.pointCoords=[_[p.detail.i][0],_[p.detail.i][1]]}switch(p.type){case"lt":this.calc=function(k,T){var B=this.snapToGrid(k,T);if(this.parameters.box.width-B[0]>0&&this.parameters.box.height-B[1]>0){if(this.parameters.type==="text")return this.el.move(this.parameters.box.x+B[0],this.parameters.box.y),void this.el.attr("font-size",this.parameters.fontSize-B[0]);B=this.checkAspectRatio(B),this.el.move(this.parameters.box.x+B[0],this.parameters.box.y+B[1]).size(this.parameters.box.width-B[0],this.parameters.box.height-B[1])}};break;case"rt":this.calc=function(k,T){var B=this.snapToGrid(k,T,2);if(this.parameters.box.width+B[0]>0&&this.parameters.box.height-B[1]>0){if(this.parameters.type==="text")return this.el.move(this.parameters.box.x-B[0],this.parameters.box.y),void this.el.attr("font-size",this.parameters.fontSize+B[0]);B=this.checkAspectRatio(B,!0),this.el.move(this.parameters.box.x,this.parameters.box.y+B[1]).size(this.parameters.box.width+B[0],this.parameters.box.height-B[1])}};break;case"rb":this.calc=function(k,T){var B=this.snapToGrid(k,T,0);if(this.parameters.box.width+B[0]>0&&this.parameters.box.height+B[1]>0){if(this.parameters.type==="text")return this.el.move(this.parameters.box.x-B[0],this.parameters.box.y),void this.el.attr("font-size",this.parameters.fontSize+B[0]);B=this.checkAspectRatio(B),this.el.move(this.parameters.box.x,this.parameters.box.y).size(this.parameters.box.width+B[0],this.parameters.box.height+B[1])}};break;case"lb":this.calc=function(k,T){var B=this.snapToGrid(k,T,1);if(this.parameters.box.width-B[0]>0&&this.parameters.box.height+B[1]>0){if(this.parameters.type==="text")return this.el.move(this.parameters.box.x+B[0],this.parameters.box.y),void this.el.attr("font-size",this.parameters.fontSize-B[0]);B=this.checkAspectRatio(B,!0),this.el.move(this.parameters.box.x+B[0],this.parameters.box.y).size(this.parameters.box.width-B[0],this.parameters.box.height+B[1])}};break;case"t":this.calc=function(k,T){var B=this.snapToGrid(k,T,2);if(this.parameters.box.height-B[1]>0){if(this.parameters.type==="text")return;this.el.move(this.parameters.box.x,this.parameters.box.y+B[1]).height(this.parameters.box.height-B[1])}};break;case"r":this.calc=function(k,T){var B=this.snapToGrid(k,T,0);if(this.parameters.box.width+B[0]>0){if(this.parameters.type==="text")return;this.el.move(this.parameters.box.x,this.parameters.box.y).width(this.parameters.box.width+B[0])}};break;case"b":this.calc=function(k,T){var B=this.snapToGrid(k,T,0);if(this.parameters.box.height+B[1]>0){if(this.parameters.type==="text")return;this.el.move(this.parameters.box.x,this.parameters.box.y).height(this.parameters.box.height+B[1])}};break;case"l":this.calc=function(k,T){var B=this.snapToGrid(k,T,1);if(this.parameters.box.width-B[0]>0){if(this.parameters.type==="text")return;this.el.move(this.parameters.box.x+B[0],this.parameters.box.y).width(this.parameters.box.width-B[0])}};break;case"rot":this.calc=function(k,T){var B=k+this.parameters.p.x,q=T+this.parameters.p.y,te=Math.atan2(this.parameters.p.y-this.parameters.box.y-this.parameters.box.height/2,this.parameters.p.x-this.parameters.box.x-this.parameters.box.width/2),ue=Math.atan2(q-this.parameters.box.y-this.parameters.box.height/2,B-this.parameters.box.x-this.parameters.box.width/2),de=this.parameters.rotation+180*(ue-te)/Math.PI+this.options.snapToAngle/2;this.el.center(this.parameters.box.cx,this.parameters.box.cy).rotate(de-de%this.options.snapToAngle,this.parameters.box.cx,this.parameters.box.cy)};break;case"point":this.calc=function(k,T){var B=this.snapToGrid(k,T,this.parameters.pointCoords[0],this.parameters.pointCoords[1]),q=this.el.array().valueOf();q[this.parameters.i][0]=this.parameters.pointCoords[0]+B[0],q[this.parameters.i][1]=this.parameters.pointCoords[1]+B[1],this.el.plot(q)}}this.el.fire("resizestart",{dx:this.parameters.x,dy:this.parameters.y,event:p}),SVG.on(window,"touchmove.resize",function(k){h.update(k||window.event)}),SVG.on(window,"touchend.resize",function(){h.done()}),SVG.on(window,"mousemove.resize",function(k){h.update(k||window.event)}),SVG.on(window,"mouseup.resize",function(){h.done()})},Ee.prototype.update=function(p){if(p){var h=this._extractPosition(p),S=this.transformPoint(h.x,h.y),_=S.x-this.parameters.p.x,k=S.y-this.parameters.p.y;this.lastUpdateCall=[_,k],this.calc(_,k),this.el.fire("resizing",{dx:_,dy:k,event:p})}else this.lastUpdateCall&&this.calc(this.lastUpdateCall[0],this.lastUpdateCall[1])},Ee.prototype.done=function(){this.lastUpdateCall=null,SVG.off(window,"mousemove.resize"),SVG.off(window,"mouseup.resize"),SVG.off(window,"touchmove.resize"),SVG.off(window,"touchend.resize"),this.el.fire("resizedone")},Ee.prototype.snapToGrid=function(p,h,S,_){var k;return _!==void 0?k=[(S+p)%this.options.snapToGrid,(_+h)%this.options.snapToGrid]:(S=S??3,k=[(this.parameters.box.x+p+(1&S?0:this.parameters.box.width))%this.options.snapToGrid,(this.parameters.box.y+h+(2&S?0:this.parameters.box.height))%this.options.snapToGrid]),p<0&&(k[0]-=this.options.snapToGrid),h<0&&(k[1]-=this.options.snapToGrid),p-=Math.abs(k[0])<this.options.snapToGrid/2?k[0]:k[0]-(p<0?-this.options.snapToGrid:this.options.snapToGrid),h-=Math.abs(k[1])<this.options.snapToGrid/2?k[1]:k[1]-(h<0?-this.options.snapToGrid:this.options.snapToGrid),this.constraintToBox(p,h,S,_)},Ee.prototype.constraintToBox=function(p,h,S,_){var k,T,B=this.options.constraint||{};return _!==void 0?(k=S,T=_):(k=this.parameters.box.x+(1&S?0:this.parameters.box.width),T=this.parameters.box.y+(2&S?0:this.parameters.box.height)),B.minX!==void 0&&k+p<B.minX&&(p=B.minX-k),B.maxX!==void 0&&k+p>B.maxX&&(p=B.maxX-k),B.minY!==void 0&&T+h<B.minY&&(h=B.minY-T),B.maxY!==void 0&&T+h>B.maxY&&(h=B.maxY-T),[p,h]},Ee.prototype.checkAspectRatio=function(p,h){if(!this.options.saveAspectRatio)return p;var S=p.slice(),_=this.parameters.box.width/this.parameters.box.height,k=this.parameters.box.width+p[0],T=this.parameters.box.height-p[1],B=k/T;return B<_?(S[1]=k/_-this.parameters.box.height,h&&(S[1]=-S[1])):B>_&&(S[0]=this.parameters.box.width-T*_,h&&(S[0]=-S[0])),S},SVG.extend(SVG.Element,{resize:function(p){return(this.remember("_resizeHandler")||new Ee(this)).init(p||{}),this}}),SVG.Element.prototype.resize.defaults={snapToAngle:.1,snapToGrid:1,constraint:{},saveAspectRatio:!1}}).call(this)}(),window.Apex===void 0&&(window.Apex={});var zn=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"initModules",value:function(){this.ctx.publicMethods=["updateOptions","updateSeries","appendData","appendSeries","isSeriesHidden","highlightSeries","toggleSeries","showSeries","hideSeries","setLocale","resetSeries","zoomX","toggleDataPointSelection","dataURI","exportToCSV","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","paper","destroy"],this.ctx.eventList=["click","mousedown","mousemove","mouseleave","touchstart","touchmove","touchleave","mouseup","touchend"],this.ctx.animations=new U(this.ctx),this.ctx.axes=new tn(this.ctx),this.ctx.core=new tr(this.ctx.el,this.ctx),this.ctx.config=new Ae({}),this.ctx.data=new Qe(this.ctx),this.ctx.grid=new tt(this.ctx),this.ctx.graphics=new z(this.ctx),this.ctx.coreUtils=new X(this.ctx),this.ctx.crosshairs=new jt(this.ctx),this.ctx.events=new Ut(this.ctx),this.ctx.exports=new Be(this.ctx),this.ctx.fill=new Ne(this.ctx),this.ctx.localization=new kt(this.ctx),this.ctx.options=new G,this.ctx.responsive=new un(this.ctx),this.ctx.series=new Re(this.ctx),this.ctx.theme=new cn(this.ctx),this.ctx.formatters=new re(this.ctx),this.ctx.titleSubtitle=new Pt(this.ctx),this.ctx.legend=new en(this.ctx),this.ctx.toolbar=new Dt(this.ctx),this.ctx.tooltip=new Nt(this.ctx),this.ctx.dimensions=new Ke(this.ctx),this.ctx.updateHelpers=new Qt(this.ctx),this.ctx.zoomPanSelection=new At(this.ctx),this.ctx.w.globals.tooltip=new Nt(this.ctx)}}]),Ee}(),Yn=function(){function Ee(p){s(this,Ee),this.ctx=p,this.w=p.w}return o(Ee,[{key:"clear",value:function(p){var h=p.isUpdating;this.ctx.zoomPanSelection&&this.ctx.zoomPanSelection.destroy(),this.ctx.toolbar&&this.ctx.toolbar.destroy(),this.ctx.animations=null,this.ctx.axes=null,this.ctx.annotations=null,this.ctx.core=null,this.ctx.data=null,this.ctx.grid=null,this.ctx.series=null,this.ctx.responsive=null,this.ctx.theme=null,this.ctx.formatters=null,this.ctx.titleSubtitle=null,this.ctx.legend=null,this.ctx.dimensions=null,this.ctx.options=null,this.ctx.crosshairs=null,this.ctx.zoomPanSelection=null,this.ctx.updateHelpers=null,this.ctx.toolbar=null,this.ctx.localization=null,this.ctx.w.globals.tooltip=null,this.clearDomElements({isUpdating:h})}},{key:"killSVG",value:function(p){p.each(function(){this.removeClass("*"),this.off(),this.stop()},!0),p.ungroup(),p.clear()}},{key:"clearDomElements",value:function(p){var h=this,S=p.isUpdating,_=this.w.globals.dom.Paper.node;_.parentNode&&_.parentNode.parentNode&&!S&&(_.parentNode.parentNode.style.minHeight="unset");var k=this.w.globals.dom.baseEl;k&&this.ctx.eventList.forEach(function(B){k.removeEventListener(B,h.ctx.events.documentEvent)});var T=this.w.globals.dom;if(this.ctx.el!==null)for(;this.ctx.el.firstChild;)this.ctx.el.removeChild(this.ctx.el.firstChild);this.killSVG(T.Paper),T.Paper.remove(),T.elWrap=null,T.elGraphical=null,T.elLegendWrap=null,T.elLegendForeign=null,T.baseEl=null,T.elGridRect=null,T.elGridRectMask=null,T.elGridRectBarMask=null,T.elGridRectMarkerMask=null,T.elForecastMask=null,T.elNonForecastMask=null,T.elDefs=null}}]),Ee}(),Lt=new WeakMap,Fn=function(){function Ee(p,h){s(this,Ee),this.opts=h,this.ctx=this,this.w=new ye(h).init(),this.el=p,this.w.globals.cuid=F.randomId(),this.w.globals.chartID=this.w.config.chart.id?F.escapeString(this.w.config.chart.id):this.w.globals.cuid,new zn(this).initModules(),this.create=F.bind(this.create,this),this.windowResizeHandler=this._windowResizeHandler.bind(this),this.parentResizeHandler=this._parentResizeCallback.bind(this)}return o(Ee,[{key:"render",value:function(){var p=this;return new Promise(function(h,S){if(p.el!==null){Apex._chartInstances===void 0&&(Apex._chartInstances=[]),p.w.config.chart.id&&Apex._chartInstances.push({id:p.w.globals.chartID,group:p.w.config.chart.group,chart:p}),p.setLocale(p.w.config.chart.defaultLocale);var _=p.w.config.chart.events.beforeMount;typeof _=="function"&&_(p,p.w),p.events.fireEvent("beforeMount",[p,p.w]),window.addEventListener("resize",p.windowResizeHandler),function(xe,we){var ke=!1;if(xe.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){var Me=xe.getBoundingClientRect();xe.style.display!=="none"&&Me.width!==0||(ke=!0)}var Ye=new ResizeObserver(function(Fe){ke&&we.call(xe,Fe),ke=!0});xe.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Array.from(xe.children).forEach(function(Fe){return Ye.observe(Fe)}):Ye.observe(xe),Lt.set(we,Ye)}(p.el.parentNode,p.parentResizeHandler);var k=p.el.getRootNode&&p.el.getRootNode(),T=F.is("ShadowRoot",k),B=p.el.ownerDocument,q=T?k.getElementById("apexcharts-css"):B.getElementById("apexcharts-css");if(!q){var te;(q=document.createElement("style")).id="apexcharts-css",q.textContent=`@keyframes opaque {
  0% {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes resizeanim {

  0%,
  to {
    opacity: 0
  }
}

.apexcharts-canvas {
  position: relative;
  direction: ltr !important;
  user-select: none
}

.apexcharts-canvas ::-webkit-scrollbar {
  -webkit-appearance: none;
  width: 6px
}

.apexcharts-canvas ::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background-color: rgba(0, 0, 0, .5);
  box-shadow: 0 0 1px rgba(255, 255, 255, .5);
  -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5)
}

.apexcharts-inner {
  position: relative
}

.apexcharts-text tspan {
  font-family: inherit
}

rect.legend-mouseover-inactive,
.legend-mouseover-inactive rect,
.legend-mouseover-inactive path,
.legend-mouseover-inactive circle,
.legend-mouseover-inactive line,
.legend-mouseover-inactive text.apexcharts-yaxis-title-text,
.legend-mouseover-inactive text.apexcharts-yaxis-label {
  transition: .15s ease all;
  opacity: .2
}

.apexcharts-legend-text {
  padding-left: 15px;
  margin-left: -15px;
}

.apexcharts-series-collapsed {
  opacity: 0
}

.apexcharts-tooltip {
  border-radius: 5px;
  box-shadow: 2px 2px 6px -4px #999;
  cursor: default;
  font-size: 14px;
  left: 62px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
  z-index: 12;
  transition: .15s ease all
}

.apexcharts-tooltip.apexcharts-active {
  opacity: 1;
  transition: .15s ease all
}

.apexcharts-tooltip.apexcharts-theme-light {
  border: 1px solid #e3e3e3;
  background: rgba(255, 255, 255, .96)
}

.apexcharts-tooltip.apexcharts-theme-dark {
  color: #fff;
  background: rgba(30, 30, 30, .8)
}

.apexcharts-tooltip * {
  font-family: inherit
}

.apexcharts-tooltip-title {
  padding: 6px;
  font-size: 15px;
  margin-bottom: 4px
}

.apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title {
  background: #eceff1;
  border-bottom: 1px solid #ddd
}

.apexcharts-tooltip.apexcharts-theme-dark .apexcharts-tooltip-title {
  background: rgba(0, 0, 0, .7);
  border-bottom: 1px solid #333
}

.apexcharts-tooltip-text-goals-value,
.apexcharts-tooltip-text-y-value,
.apexcharts-tooltip-text-z-value {
  display: inline-block;
  margin-left: 5px;
  font-weight: 600
}

.apexcharts-tooltip-text-goals-label:empty,
.apexcharts-tooltip-text-goals-value:empty,
.apexcharts-tooltip-text-y-label:empty,
.apexcharts-tooltip-text-y-value:empty,
.apexcharts-tooltip-text-z-value:empty,
.apexcharts-tooltip-title:empty {
  display: none
}

.apexcharts-tooltip-text-goals-label,
.apexcharts-tooltip-text-goals-value {
  padding: 6px 0 5px
}

.apexcharts-tooltip-goals-group,
.apexcharts-tooltip-text-goals-label,
.apexcharts-tooltip-text-goals-value {
  display: flex
}

.apexcharts-tooltip-text-goals-label:not(:empty),
.apexcharts-tooltip-text-goals-value:not(:empty) {
  margin-top: -6px
}

.apexcharts-tooltip-marker {
  width: 12px;
  height: 12px;
  position: relative;
  top: 0;
  margin-right: 10px;
  border-radius: 50%
}

.apexcharts-tooltip-series-group {
  padding: 0 10px;
  display: none;
  text-align: left;
  justify-content: left;
  align-items: center
}

.apexcharts-tooltip-series-group.apexcharts-active .apexcharts-tooltip-marker {
  opacity: 1
}

.apexcharts-tooltip-series-group.apexcharts-active,
.apexcharts-tooltip-series-group:last-child {
  padding-bottom: 4px
}

.apexcharts-tooltip-y-group {
  padding: 6px 0 5px
}

.apexcharts-custom-tooltip,
.apexcharts-tooltip-box {
  padding: 4px 8px
}

.apexcharts-tooltip-boxPlot {
  display: flex;
  flex-direction: column-reverse
}

.apexcharts-tooltip-box>div {
  margin: 4px 0
}

.apexcharts-tooltip-box span.value {
  font-weight: 700
}

.apexcharts-tooltip-rangebar {
  padding: 5px 8px
}

.apexcharts-tooltip-rangebar .category {
  font-weight: 600;
  color: #777
}

.apexcharts-tooltip-rangebar .series-name {
  font-weight: 700;
  display: block;
  margin-bottom: 5px
}

.apexcharts-xaxistooltip,
.apexcharts-yaxistooltip {
  opacity: 0;
  pointer-events: none;
  color: #373d3f;
  font-size: 13px;
  text-align: center;
  border-radius: 2px;
  position: absolute;
  z-index: 10;
  background: #eceff1;
  border: 1px solid #90a4ae
}

.apexcharts-xaxistooltip {
  padding: 9px 10px;
  transition: .15s ease all
}

.apexcharts-xaxistooltip.apexcharts-theme-dark {
  background: rgba(0, 0, 0, .7);
  border: 1px solid rgba(0, 0, 0, .5);
  color: #fff
}

.apexcharts-xaxistooltip:after,
.apexcharts-xaxistooltip:before {
  left: 50%;
  border: solid transparent;
  content: " ";
  height: 0;
  width: 0;
  position: absolute;
  pointer-events: none
}

.apexcharts-xaxistooltip:after {
  border-color: transparent;
  border-width: 6px;
  margin-left: -6px
}

.apexcharts-xaxistooltip:before {
  border-color: transparent;
  border-width: 7px;
  margin-left: -7px
}

.apexcharts-xaxistooltip-bottom:after,
.apexcharts-xaxistooltip-bottom:before {
  bottom: 100%
}

.apexcharts-xaxistooltip-top:after,
.apexcharts-xaxistooltip-top:before {
  top: 100%
}

.apexcharts-xaxistooltip-bottom:after {
  border-bottom-color: #eceff1
}

.apexcharts-xaxistooltip-bottom:before {
  border-bottom-color: #90a4ae
}

.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:after,
.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:before {
  border-bottom-color: rgba(0, 0, 0, .5)
}

.apexcharts-xaxistooltip-top:after {
  border-top-color: #eceff1
}

.apexcharts-xaxistooltip-top:before {
  border-top-color: #90a4ae
}

.apexcharts-xaxistooltip-top.apexcharts-theme-dark:after,
.apexcharts-xaxistooltip-top.apexcharts-theme-dark:before {
  border-top-color: rgba(0, 0, 0, .5)
}

.apexcharts-xaxistooltip.apexcharts-active {
  opacity: 1;
  transition: .15s ease all
}

.apexcharts-yaxistooltip {
  padding: 4px 10px
}

.apexcharts-yaxistooltip.apexcharts-theme-dark {
  background: rgba(0, 0, 0, .7);
  border: 1px solid rgba(0, 0, 0, .5);
  color: #fff
}

.apexcharts-yaxistooltip:after,
.apexcharts-yaxistooltip:before {
  top: 50%;
  border: solid transparent;
  content: " ";
  height: 0;
  width: 0;
  position: absolute;
  pointer-events: none
}

.apexcharts-yaxistooltip:after {
  border-color: transparent;
  border-width: 6px;
  margin-top: -6px
}

.apexcharts-yaxistooltip:before {
  border-color: transparent;
  border-width: 7px;
  margin-top: -7px
}

.apexcharts-yaxistooltip-left:after,
.apexcharts-yaxistooltip-left:before {
  left: 100%
}

.apexcharts-yaxistooltip-right:after,
.apexcharts-yaxistooltip-right:before {
  right: 100%
}

.apexcharts-yaxistooltip-left:after {
  border-left-color: #eceff1
}

.apexcharts-yaxistooltip-left:before {
  border-left-color: #90a4ae
}

.apexcharts-yaxistooltip-left.apexcharts-theme-dark:after,
.apexcharts-yaxistooltip-left.apexcharts-theme-dark:before {
  border-left-color: rgba(0, 0, 0, .5)
}

.apexcharts-yaxistooltip-right:after {
  border-right-color: #eceff1
}

.apexcharts-yaxistooltip-right:before {
  border-right-color: #90a4ae
}

.apexcharts-yaxistooltip-right.apexcharts-theme-dark:after,
.apexcharts-yaxistooltip-right.apexcharts-theme-dark:before {
  border-right-color: rgba(0, 0, 0, .5)
}

.apexcharts-yaxistooltip.apexcharts-active {
  opacity: 1
}

.apexcharts-yaxistooltip-hidden {
  display: none
}

.apexcharts-xcrosshairs,
.apexcharts-ycrosshairs {
  pointer-events: none;
  opacity: 0;
  transition: .15s ease all
}

.apexcharts-xcrosshairs.apexcharts-active,
.apexcharts-ycrosshairs.apexcharts-active {
  opacity: 1;
  transition: .15s ease all
}

.apexcharts-ycrosshairs-hidden {
  opacity: 0
}

.apexcharts-selection-rect {
  cursor: move
}

.svg_select_boundingRect,
.svg_select_points_rot {
  pointer-events: none;
  opacity: 0;
  visibility: hidden
}

.apexcharts-selection-rect+g .svg_select_boundingRect,
.apexcharts-selection-rect+g .svg_select_points_rot {
  opacity: 0;
  visibility: hidden
}

.apexcharts-selection-rect+g .svg_select_points_l,
.apexcharts-selection-rect+g .svg_select_points_r {
  cursor: ew-resize;
  opacity: 1;
  visibility: visible
}

.svg_select_points {
  fill: #efefef;
  stroke: #333;
  rx: 2
}

.apexcharts-svg.apexcharts-zoomable.hovering-zoom {
  cursor: crosshair
}

.apexcharts-svg.apexcharts-zoomable.hovering-pan {
  cursor: move
}

.apexcharts-menu-icon,
.apexcharts-pan-icon,
.apexcharts-reset-icon,
.apexcharts-selection-icon,
.apexcharts-toolbar-custom-icon,
.apexcharts-zoom-icon,
.apexcharts-zoomin-icon,
.apexcharts-zoomout-icon {
  cursor: pointer;
  width: 20px;
  height: 20px;
  line-height: 24px;
  color: #6e8192;
  text-align: center
}

.apexcharts-menu-icon svg,
.apexcharts-reset-icon svg,
.apexcharts-zoom-icon svg,
.apexcharts-zoomin-icon svg,
.apexcharts-zoomout-icon svg {
  fill: #6e8192
}

.apexcharts-selection-icon svg {
  fill: #444;
  transform: scale(.76)
}

.apexcharts-theme-dark .apexcharts-menu-icon svg,
.apexcharts-theme-dark .apexcharts-pan-icon svg,
.apexcharts-theme-dark .apexcharts-reset-icon svg,
.apexcharts-theme-dark .apexcharts-selection-icon svg,
.apexcharts-theme-dark .apexcharts-toolbar-custom-icon svg,
.apexcharts-theme-dark .apexcharts-zoom-icon svg,
.apexcharts-theme-dark .apexcharts-zoomin-icon svg,
.apexcharts-theme-dark .apexcharts-zoomout-icon svg {
  fill: #f3f4f5
}

.apexcharts-canvas .apexcharts-reset-zoom-icon.apexcharts-selected svg,
.apexcharts-canvas .apexcharts-selection-icon.apexcharts-selected svg,
.apexcharts-canvas .apexcharts-zoom-icon.apexcharts-selected svg {
  fill: #008ffb
}

.apexcharts-theme-light .apexcharts-menu-icon:hover svg,
.apexcharts-theme-light .apexcharts-reset-icon:hover svg,
.apexcharts-theme-light .apexcharts-selection-icon:not(.apexcharts-selected):hover svg,
.apexcharts-theme-light .apexcharts-zoom-icon:not(.apexcharts-selected):hover svg,
.apexcharts-theme-light .apexcharts-zoomin-icon:hover svg,
.apexcharts-theme-light .apexcharts-zoomout-icon:hover svg {
  fill: #333
}

.apexcharts-menu-icon,
.apexcharts-selection-icon {
  position: relative
}

.apexcharts-reset-icon {
  margin-left: 5px
}

.apexcharts-menu-icon,
.apexcharts-reset-icon,
.apexcharts-zoom-icon {
  transform: scale(.85)
}

.apexcharts-zoomin-icon,
.apexcharts-zoomout-icon {
  transform: scale(.7)
}

.apexcharts-zoomout-icon {
  margin-right: 3px
}

.apexcharts-pan-icon {
  transform: scale(.62);
  position: relative;
  left: 1px;
  top: 0
}

.apexcharts-pan-icon svg {
  fill: #fff;
  stroke: #6e8192;
  stroke-width: 2
}

.apexcharts-pan-icon.apexcharts-selected svg {
  stroke: #008ffb
}

.apexcharts-pan-icon:not(.apexcharts-selected):hover svg {
  stroke: #333
}

.apexcharts-toolbar {
  position: absolute;
  z-index: 11;
  max-width: 176px;
  text-align: right;
  border-radius: 3px;
  padding: 0 6px 2px;
  display: flex;
  justify-content: space-between;
  align-items: center
}

.apexcharts-menu {
  background: #fff;
  position: absolute;
  top: 100%;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 3px;
  right: 10px;
  opacity: 0;
  min-width: 110px;
  transition: .15s ease all;
  pointer-events: none
}

.apexcharts-menu.apexcharts-menu-open {
  opacity: 1;
  pointer-events: all;
  transition: .15s ease all
}

.apexcharts-menu-item {
  padding: 6px 7px;
  font-size: 12px;
  cursor: pointer
}

.apexcharts-theme-light .apexcharts-menu-item:hover {
  background: #eee
}

.apexcharts-theme-dark .apexcharts-menu {
  background: rgba(0, 0, 0, .7);
  color: #fff
}

@media screen and (min-width:768px) {
  .apexcharts-canvas:hover .apexcharts-toolbar {
    opacity: 1
  }
}

.apexcharts-canvas .apexcharts-element-hidden,
.apexcharts-datalabel.apexcharts-element-hidden,
.apexcharts-hide .apexcharts-series-points {
  opacity: 0;
}

.apexcharts-hidden-element-shown {
  opacity: 1;
  transition: 0.25s ease all;
}

.apexcharts-datalabel,
.apexcharts-datalabel-label,
.apexcharts-datalabel-value,
.apexcharts-datalabels,
.apexcharts-pie-label {
  cursor: default;
  pointer-events: none
}

.apexcharts-pie-label-delay {
  opacity: 0;
  animation-name: opaque;
  animation-duration: .3s;
  animation-fill-mode: forwards;
  animation-timing-function: ease
}

.apexcharts-radialbar-label {
  cursor: pointer;
}

.apexcharts-annotation-rect,
.apexcharts-area-series .apexcharts-area,
.apexcharts-area-series .apexcharts-series-markers .apexcharts-marker.no-pointer-events,
.apexcharts-gridline,
.apexcharts-line,
.apexcharts-line-series .apexcharts-series-markers .apexcharts-marker.no-pointer-events,
.apexcharts-point-annotation-label,
.apexcharts-radar-series path:not(.apexcharts-marker),
.apexcharts-radar-series polygon,
.apexcharts-toolbar svg,
.apexcharts-tooltip .apexcharts-marker,
.apexcharts-xaxis-annotation-label,
.apexcharts-yaxis-annotation-label,
.apexcharts-zoom-rect {
  pointer-events: none
}

.apexcharts-tooltip-active .apexcharts-marker {
  transition: .15s ease all
}

.resize-triggers {
  animation: 1ms resizeanim;
  visibility: hidden;
  opacity: 0;
  height: 100%;
  width: 100%;
  overflow: hidden
}

.contract-trigger:before,
.resize-triggers,
.resize-triggers>div {
  content: " ";
  display: block;
  position: absolute;
  top: 0;
  left: 0
}

.resize-triggers>div {
  height: 100%;
  width: 100%;
  background: #eee;
  overflow: auto
}

.contract-trigger:before {
  overflow: hidden;
  width: 200%;
  height: 200%
}

.apexcharts-bar-goals-markers {
  pointer-events: none
}

.apexcharts-bar-shadows {
  pointer-events: none
}

.apexcharts-rangebar-goals-markers {
  pointer-events: none
}
`;var ue=((te=p.opts.chart)===null||te===void 0?void 0:te.nonce)||p.w.config.chart.nonce;ue&&q.setAttribute("nonce",ue),T?k.prepend(q):B.head.appendChild(q)}var de=p.create(p.w.config.series,{});if(!de)return h(p);p.mount(de).then(function(){typeof p.w.config.chart.events.mounted=="function"&&p.w.config.chart.events.mounted(p,p.w),p.events.fireEvent("mounted",[p,p.w]),h(de)}).catch(function(xe){S(xe)})}else S(new Error("Element not found"))})}},{key:"create",value:function(p,h){var S=this,_=this.w;new zn(this).initModules();var k=this.w.globals;if(k.noData=!1,k.animationEnded=!1,this.responsive.checkResponsiveConfig(h),_.config.xaxis.convertedCatToNumeric&&new fe(_.config).convertCatToNumericXaxis(_.config,this.ctx),this.el===null||(this.core.setupElements(),_.config.chart.type==="treemap"&&(_.config.grid.show=!1,_.config.yaxis[0].show=!1),k.svgWidth===0))return k.animationEnded=!0,null;var T=p;p.forEach(function(xe,we){xe.hidden&&(T=S.legend.legendHelpers.getSeriesAfterCollapsing({realIndex:we}))});var B=X.checkComboSeries(T,_.config.chart.type);k.comboCharts=B.comboCharts,k.comboBarCount=B.comboBarCount;var q=T.every(function(xe){return xe.data&&xe.data.length===0});(T.length===0||q&&k.collapsedSeries.length<1)&&this.series.handleNoData(),this.events.setupEventHandlers(),this.data.parseData(T),this.theme.init(),new be(this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),k.noData&&k.collapsedSeries.length!==k.series.length&&!_.config.legend.showForSingleSeries||this.legend.init(),this.series.hasAllSeriesEqualX(),k.axisCharts&&(this.core.coreCalculations(),_.config.xaxis.type!=="category"&&this.formatters.setLabelFormatters(),this.ctx.toolbar.minX=_.globals.minX,this.ctx.toolbar.maxX=_.globals.maxX),this.formatters.heatmapLabelFormatters(),new X(this).getLargestMarkerSize(),this.dimensions.plotCoords();var te=this.core.xySettings();this.grid.createGridMask();var ue=this.core.plotChartType(T,te),de=new Ie(this);return de.bringForward(),_.config.dataLabels.background.enabled&&de.dataLabelsBackground(),this.core.shiftGraphPosition(),{elGraph:ue,xyRatios:te,dimensions:{plot:{left:_.globals.translateX,top:_.globals.translateY,width:_.globals.gridWidth,height:_.globals.gridHeight}}}}},{key:"mount",value:function(){var p=this,h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,S=this,_=S.w;return new Promise(function(k,T){if(S.el===null)return T(new Error("Not enough data to display or target element not found"));(h===null||_.globals.allSeriesCollapsed)&&S.series.handleNoData(),S.grid=new tt(S);var B,q,te=S.grid.drawGrid();if(S.annotations=new V(S),S.annotations.drawImageAnnos(),S.annotations.drawTextAnnos(),_.config.grid.position==="back"&&(te&&_.globals.dom.elGraphical.add(te.el),te!=null&&(B=te.elGridBorders)!==null&&B!==void 0&&B.node&&_.globals.dom.elGraphical.add(te.elGridBorders)),Array.isArray(h.elGraph))for(var ue=0;ue<h.elGraph.length;ue++)_.globals.dom.elGraphical.add(h.elGraph[ue]);else _.globals.dom.elGraphical.add(h.elGraph);_.config.grid.position==="front"&&(te&&_.globals.dom.elGraphical.add(te.el),te!=null&&(q=te.elGridBorders)!==null&&q!==void 0&&q.node&&_.globals.dom.elGraphical.add(te.elGridBorders)),_.config.xaxis.crosshairs.position==="front"&&S.crosshairs.drawXCrosshairs(),_.config.yaxis[0].crosshairs.position==="front"&&S.crosshairs.drawYCrosshairs(),_.config.chart.type!=="treemap"&&S.axes.drawAxis(_.config.chart.type,te);var de=new it(p.ctx,te),xe=new ct(p.ctx,te);if(te!==null&&(de.xAxisLabelCorrections(te.xAxisTickWidth),xe.setYAxisTextAlignments(),_.config.yaxis.map(function(ke,Me){_.globals.ignoreYAxisIndexes.indexOf(Me)===-1&&xe.yAxisTitleRotate(Me,ke.opposite)})),S.annotations.drawAxesAnnotations(),!_.globals.noData){if(_.config.tooltip.enabled&&!_.globals.noData&&S.w.globals.tooltip.drawTooltip(h.xyRatios),_.globals.axisCharts&&(_.globals.isXNumeric||_.config.xaxis.convertedCatToNumeric||_.globals.isRangeBar))(_.config.chart.zoom.enabled||_.config.chart.selection&&_.config.chart.selection.enabled||_.config.chart.pan&&_.config.chart.pan.enabled)&&S.zoomPanSelection.init({xyRatios:h.xyRatios});else{var we=_.config.chart.toolbar.tools;["zoom","zoomin","zoomout","selection","pan","reset"].forEach(function(ke){we[ke]=!1})}_.config.chart.toolbar.show&&!_.globals.allSeriesCollapsed&&S.toolbar.createToolbar()}_.globals.memory.methodsToExec.length>0&&_.globals.memory.methodsToExec.forEach(function(ke){ke.method(ke.params,!1,ke.context)}),_.globals.axisCharts||_.globals.noData||S.core.resizeNonAxisCharts(),k(S)})}},{key:"destroy",value:function(){var p,h;window.removeEventListener("resize",this.windowResizeHandler),this.el.parentNode,p=this.parentResizeHandler,(h=Lt.get(p))&&(h.disconnect(),Lt.delete(p));var S=this.w.config.chart.id;S&&Apex._chartInstances.forEach(function(_,k){_.id===F.escapeString(S)&&Apex._chartInstances.splice(k,1)}),new Yn(this.ctx).clear({isUpdating:!1})}},{key:"updateOptions",value:function(p){var h=this,S=arguments.length>1&&arguments[1]!==void 0&&arguments[1],_=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],k=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],T=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],B=this.w;return B.globals.selection=void 0,p.series&&(this.series.resetSeries(!1,!0,!1),p.series.length&&p.series[0].data&&(p.series=p.series.map(function(q,te){return h.updateHelpers._extendSeries(q,te)})),this.updateHelpers.revertDefaultAxisMinMax()),p.xaxis&&(p=this.updateHelpers.forceXAxisUpdate(p)),p.yaxis&&(p=this.updateHelpers.forceYAxisUpdate(p)),B.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),p.theme&&(p=this.theme.updateThemeOptions(p)),this.updateHelpers._updateOptions(p,S,_,k,T)}},{key:"updateSeries",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],h=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(p,h,S)}},{key:"appendSeries",value:function(p){var h=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],_=this.w.config.series.slice();return _.push(p),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(_,h,S)}},{key:"appendData",value:function(p){var h=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=this;S.w.globals.dataChanged=!0,S.series.getPreviousPaths();for(var _=S.w.config.series.slice(),k=0;k<_.length;k++)if(p[k]!==null&&p[k]!==void 0)for(var T=0;T<p[k].data.length;T++)_[k].data.push(p[k].data[T]);return S.w.config.series=_,h&&(S.w.globals.initialSeries=F.clone(S.w.config.series)),this.update()}},{key:"update",value:function(p){var h=this;return new Promise(function(S,_){new Yn(h.ctx).clear({isUpdating:!0});var k=h.create(h.w.config.series,p);if(!k)return S(h);h.mount(k).then(function(){typeof h.w.config.chart.events.updated=="function"&&h.w.config.chart.events.updated(h,h.w),h.events.fireEvent("updated",[h,h.w]),h.w.globals.isDirty=!0,S(h)}).catch(function(T){_(T)})})}},{key:"getSyncedCharts",value:function(){var p=this.getGroupedCharts(),h=[this];return p.length&&(h=[],p.forEach(function(S){h.push(S)})),h}},{key:"getGroupedCharts",value:function(){var p=this;return Apex._chartInstances.filter(function(h){if(h.group)return!0}).map(function(h){return p.w.config.chart.group===h.group?h.chart:p})}},{key:"toggleSeries",value:function(p){return this.series.toggleSeries(p)}},{key:"highlightSeriesOnLegendHover",value:function(p,h){return this.series.toggleSeriesOnHover(p,h)}},{key:"showSeries",value:function(p){this.series.showSeries(p)}},{key:"hideSeries",value:function(p){this.series.hideSeries(p)}},{key:"highlightSeries",value:function(p){this.series.highlightSeries(p)}},{key:"isSeriesHidden",value:function(p){this.series.isSeriesHidden(p)}},{key:"resetSeries",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],h=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.series.resetSeries(p,h)}},{key:"addEventListener",value:function(p,h){this.events.addEventListener(p,h)}},{key:"removeEventListener",value:function(p,h){this.events.removeEventListener(p,h)}},{key:"addXaxisAnnotation",value:function(p){var h=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,_=this;S&&(_=S),_.annotations.addXaxisAnnotationExternal(p,h,_)}},{key:"addYaxisAnnotation",value:function(p){var h=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,_=this;S&&(_=S),_.annotations.addYaxisAnnotationExternal(p,h,_)}},{key:"addPointAnnotation",value:function(p){var h=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,_=this;S&&(_=S),_.annotations.addPointAnnotationExternal(p,h,_)}},{key:"clearAnnotations",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,h=this;p&&(h=p),h.annotations.clearAnnotations(h)}},{key:"removeAnnotation",value:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,S=this;h&&(S=h),S.annotations.removeAnnotation(S,p)}},{key:"getChartArea",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner")}},{key:"getSeriesTotalXRange",value:function(p,h){return this.coreUtils.getSeriesTotalsXRange(p,h)}},{key:"getHighestValueInSeries",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new dt(this.ctx).getMinYMaxY(p).highestY}},{key:"getLowestValueInSeries",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new dt(this.ctx).getMinYMaxY(p).lowestY}},{key:"getSeriesTotal",value:function(){return this.w.globals.seriesTotals}},{key:"toggleDataPointSelection",value:function(p,h){return this.updateHelpers.toggleDataPointSelection(p,h)}},{key:"zoomX",value:function(p,h){this.ctx.toolbar.zoomUpdateOptions(p,h)}},{key:"setLocale",value:function(p){this.localization.setCurrentLocaleValues(p)}},{key:"dataURI",value:function(p){return new Be(this.ctx).dataURI(p)}},{key:"exportToCSV",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new Be(this.ctx).exportToCSV(p)}},{key:"paper",value:function(){return this.w.globals.dom.Paper}},{key:"_parentResizeCallback",value:function(){this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}},{key:"_windowResize",value:function(){var p=this;clearTimeout(this.w.globals.resizeTimer),this.w.globals.resizeTimer=window.setTimeout(function(){p.w.globals.resized=!0,p.w.globals.dataChanged=!1,p.ctx.update()},150)}},{key:"_windowResizeHandler",value:function(){var p=this.w.config.chart.redrawOnWindowResize;typeof p=="function"&&(p=p()),p&&this._windowResize()}}],[{key:"getChartByID",value:function(p){var h=F.escapeString(p);if(Apex._chartInstances){var S=Apex._chartInstances.filter(function(_){return _.id===h})[0];return S&&S.chart}}},{key:"initOnLoad",value:function(){for(var p=document.querySelectorAll("[data-apexcharts]"),h=0;h<p.length;h++)new Ee(p[h],JSON.parse(p[h].getAttribute("data-options"))).render()}},{key:"exec",value:function(p,h){var S=this.getChartByID(p);if(S){S.w.globals.isExecCalled=!0;var _=null;if(S.publicMethods.indexOf(h)!==-1){for(var k=arguments.length,T=new Array(k>2?k-2:0),B=2;B<k;B++)T[B-2]=arguments[B];_=S[h].apply(S,T)}return _}}},{key:"merge",value:function(p,h){return F.extend(p,h)}}]),Ee}();e.exports=Fn}(DP,DP.exports)),DP.exports}var uCe;function Ksn(){if(uCe)return LP;uCe=1,Object.defineProperty(LP,"__esModule",{value:!0});var e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},t=Object.assign||function(C){for(var N=1;N<arguments.length;N++){var I,P=arguments[N];for(I in P)Object.prototype.hasOwnProperty.call(P,I)&&(C[I]=P[I])}return C},n=function(){function C(N,I){for(var P=0;P<I.length;P++){var R=I[P];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(N,R.key,R)}}return function(N,I,P){return I&&C(N.prototype,I),P&&C(N,P),N}}(),r=Gsn(),s=u(r),a=tx(),o=u(a),l=E$(),c=u(l);function u(C){return C&&C.__esModule?C:{default:C}}function d(C,N,I){return N in C?Object.defineProperty(C,N,{value:I,enumerable:!0,configurable:!0,writable:!0}):C[N]=I,C}function f(C,N){var I,P={};for(I in C)0<=N.indexOf(I)||Object.prototype.hasOwnProperty.call(C,I)&&(P[I]=C[I]);return P}function x(C,N){if(!(C instanceof N))throw new TypeError("Cannot call a class as a function")}function g(C,N){if(C)return!N||typeof N!="object"&&typeof N!="function"?C:N;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function v(C,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);C.prototype=Object.create(N&&N.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(C,N):C.__proto__=N)}window.ApexCharts=s.default;var w=function(){function C(N){x(this,C);var I=g(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,N));return o.default.createRef?I.chartRef=o.default.createRef():I.setRef=function(P){return I.chartRef=P},I.chart=null,I}return v(C,a.Component),n(C,[{key:"render",value:function(){var N=f(this.props,[]);return o.default.createElement("div",t({ref:o.default.createRef?this.chartRef:this.setRef},N))}},{key:"componentDidMount",value:function(){var N=o.default.createRef?this.chartRef.current:this.chartRef;this.chart=new s.default(N,this.getConfig()),this.chart.render()}},{key:"getConfig",value:function(){var F=this.props,N=F.type,I=F.height,P=F.width,R=F.series,F=F.options;return this.extend(F,{chart:{type:N,height:I,width:P},series:R})}},{key:"isObject",value:function(N){return N&&(N===void 0?"undefined":e(N))==="object"&&!Array.isArray(N)&&N!=null}},{key:"extend",value:function(N,I){var P=this,R=(typeof Object.assign!="function"&&(Object.assign=function(F){if(F==null)throw new TypeError("Cannot convert undefined or null to object");for(var U=Object(F),L=1;L<arguments.length;L++){var z=arguments[L];if(z!=null)for(var X in z)z.hasOwnProperty(X)&&(U[X]=z[X])}return U}),Object.assign({},N));return this.isObject(N)&&this.isObject(I)&&Object.keys(I).forEach(function(F){P.isObject(I[F])&&F in N?R[F]=P.extend(N[F],I[F]):Object.assign(R,d({},F,I[F]))}),R}},{key:"componentDidUpdate",value:function(N){if(!this.chart)return null;var R=this.props,L=R.options,I=R.series,P=R.height,R=R.width,F=JSON.stringify(N.options),U=JSON.stringify(N.series),L=JSON.stringify(L),z=JSON.stringify(I);F===L&&U===z&&P===N.height&&R===N.width||(U!==z&&F===L&&P===N.height&&R===N.width?this.chart.updateSeries(I):this.chart.updateOptions(this.getConfig()))}},{key:"componentWillUnmount",value:function(){this.chart&&typeof this.chart.destroy=="function"&&this.chart.destroy()}}]),C}();return(LP.default=w).propTypes={type:c.default.string.isRequired,width:c.default.oneOfType([c.default.string,c.default.number]),height:c.default.oneOfType([c.default.string,c.default.number]),series:c.default.array.isRequired,options:c.default.object.isRequired},w.defaultProps={type:"line",width:"100%",height:"auto"},LP}var Ysn=Ksn();const HL=ji(Ysn),Xsn=()=>{const[e,t]=m.useState([]),[n,r]=m.useState(localStorage.getItem("discover_period")==0?"day":localStorage.getItem("discover_period")==1?"week":localStorage.getItem("discover_period")==2?"month":localStorage.getItem("discover_period")==3?"threeMonth":"allTime"),[s,a]=m.useState("pnlHistory"),[o,l]=m.useState("perp only"),c=Z3(),u=(c==null?void 0:c.walletAddress)||"",d=n==="day",{setLatestPnL:f}=m.useContext(Gr);m.useEffect(()=>{const v=async()=>{var N,I,P,R,F,U,L,z,X,ne,J,Z,re,he,Y,ie,oe,G,V,ee,ae,fe,Ae;const C=o==="combined"?n:`perp${n.charAt(0).toUpperCase()+n.slice(1)}`;try{const ye=(await ls.post("https://api-ui.hyperliquid.xyz/info",{type:"portfolio",user:u},{headers:{Accept:"*/*","Content-Type":"application/json"}})).data,be=Date.now()-90*24*60*60*1e3,je=(ft,en=!1)=>{const Dt=(ft==null?void 0:ft.filter(([At])=>Number(At)>=be))||[];if(en&&Dt.length>0){const At=parseFloat(Dt[0][1]);return Dt.map(([Je,He])=>[Je,(parseFloat(He)-At).toString()])}return Dt},Ie=ye.find(ft=>ft[0]==="allTime"),Re=ye.find(ft=>ft[0]==="perpAllTime"),Qe={accountValueHistory:je((N=Ie==null?void 0:Ie[1])==null?void 0:N.accountValueHistory,!1),pnlHistory:je((I=Ie==null?void 0:Ie[1])==null?void 0:I.pnlHistory,!0),vlm:(P=Ie==null?void 0:Ie[1])==null?void 0:P.vlm},Be={accountValueHistory:je((R=Re==null?void 0:Re[1])==null?void 0:R.accountValueHistory,!1),pnlHistory:je((F=Re==null?void 0:Re[1])==null?void 0:F.pnlHistory,!0),vlm:(U=Re==null?void 0:Re[1])==null?void 0:U.vlm},it=[...ye,["threeMonth",Qe],["perpThreeMonth",Be]],tt=((z=(L=it.find(ft=>ft[0]===C))==null?void 0:L[1])==null?void 0:z[s])||[];t(tt);const at=o==="combined"?"day":"perpDay",dt=o==="combined"?"week":"perpWeek",ct=o==="combined"?"month":"perpMonth",Ut=o==="combined"?"allTime":"perpAllTime",kt=o==="combined"?"threeMonth":"perpThreeMonth",tn=((ne=(X=it.find(ft=>ft[0]===at))==null?void 0:X[1])==null?void 0:ne.pnlHistory)||[],jt=((Z=(J=it.find(ft=>ft[0]===dt))==null?void 0:J[1])==null?void 0:Z.pnlHistory)||[],un=((he=(re=it.find(ft=>ft[0]===ct))==null?void 0:re[1])==null?void 0:he.pnlHistory)||[],cn=((ie=(Y=it.find(ft=>ft[0]===Ut))==null?void 0:Y[1])==null?void 0:ie.pnlHistory)||[],Pt=((G=(oe=it.find(ft=>ft[0]===kt))==null?void 0:oe[1])==null?void 0:G.pnlHistory)||[],Xe=((V=tn[tn.length-1])==null?void 0:V[1])??0,Vt=((ee=jt[jt.length-1])==null?void 0:ee[1])??0,Yt=((ae=un[un.length-1])==null?void 0:ae[1])??0,Ve=((fe=Pt[Pt.length-1])==null?void 0:fe[1])??0,Ke=((Ae=cn[cn.length-1])==null?void 0:Ae[1])??0;f({activeRange:n,day:Xe,week:Vt,month:Yt,threeMonth:Ve,all:Ke})}catch(ce){console.error("Error fetching data:",ce)}};v();const w=setInterval(v,3e4);return()=>clearInterval(w)},[n,s,o,u]);const x=m.useMemo(()=>({colors:["#67FFBD"],stroke:{width:3,curve:"smooth"},chart:{type:"area",stacked:!1,background:"transparent",foreColor:"#ffffff",height:"100%",zoom:{type:"x",enabled:!0,autoScaleYaxis:!0},toolbar:{autoSelected:"zoom",show:!1}},theme:{mode:"dark"},grid:{borderColor:"#2E2E2E",strokeDashArray:5,xaxis:{lines:{show:!0}},yaxis:{lines:{show:!0}}},dataLabels:{enabled:!1},markers:{size:0,colors:["#3CAD7C"]},fill:{type:"gradient",gradient:{shadeIntensity:1,inverseColors:!1,opacityFrom:.5,opacityTo:0,stops:[0,90,100],gradientToColors:["#67FFBD52"]}},yaxis:{labels:{formatter:v=>`$${Er(v)}.00`,style:{colors:"#909090",fontSize:"14px",fontWeight:500,fontFamily:"Manrope",letterSpacing:"0.72px"}}},xaxis:{type:"datetime",labels:{style:{colors:"#FFFFFF",fontSize:"12px",fontWeight:500,fontFamily:"Manrope",letterSpacing:"0.72px"},formatter:function(v,w){const C=new Date(w);if(d)return C.toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit"});const N=`'${C.getFullYear().toString().slice(-2)}`;return`${C.toLocaleDateString("en-US",{month:"short",day:"2-digit"}).toUpperCase()} ${N}`}}},tooltip:{custom:function({series:v,seriesIndex:w,dataPointIndex:C,w:N}){var U,L;const I=v[w][C],P=(L=(U=N.globals.seriesX)==null?void 0:U[w])==null?void 0:L[C],R=N.globals.seriesNames[w];return`
            <div class="p-2 rounded-2xl">
              <p class="text-[12px] font-medium text-[#909090]">${P?new Date(P).toLocaleDateString("en-GB",{month:"short",day:"2-digit"}).toUpperCase():"-"}</p>
              <div class="text-[14px] font-semibold flex items-center">
              <span class="inline-block w-[10px] h-[10px] bg-[#67FFBD] rounded-full mr-1"></span>
              <span class="text-[#67FFBD] mr-2">${R}</span>
              <span>$${Er(I)}</span>
              </div>
            </div>`},followCursor:!0,intersect:!1,shared:!0}}),[n]),g=[{name:s==="pnlHistory"?"PnL":"Account Value",data:e.map(([v,w])=>[parseInt(v),parseFloat(w)])}];return i.jsxs("div",{className:"p-0 lg:p-[16px] pb-0 bg-[#1B1B1B] rounded-2xl ml-0 lg:ml-2 mt-2 lg:mt-0 mb-2 lg:mb-0",children:[i.jsxs("div",{className:"flex flex-col lg:flex-row justify-start items-center px-2 lg:px-0",children:[i.jsx("div",{className:"flex justify-center w-full lg:flex-none lg:w-auto bg-[#202020] rounded-2xl p-1 text-[12px] font-semibold mt-2 lg:mt-0",children:["24H","1W","1M","3M","All"].map(v=>i.jsx("button",{className:`flex-1 rounded-2xl hover:border-[#67FFBD] hover:rounded-2xl  ${n==={"24H":"day","1W":"week","1M":"month","3M":"threeMonth",All:"allTime"}[v]?"text-white bg-[#353535] rounded-2xl":"text-white bg-transparent"}`,onClick:()=>{r({"24H":"day","1W":"week","1M":"month","3M":"threeMonth",All:"allTime"}[v]),localStorage.setItem("discover_period",{"24H":0,"1W":1,"1M":2,"3M":3,All:4}[v])},children:v},v))}),i.jsx("div",{className:"flex justify-center w-full lg:flex-none lg:w-auto ml-0 lg:ml-auto bg-[#202020] rounded-2xl p-1 text-[12px] font-semibold mr-0 lg:mr-8 mt-2 lg:mt-0",children:["Combined","Perp Only"].map(v=>i.jsx("button",{className:`rounded-2xl hover:border-[#67FFBD] hover:rounded-2xl ${o===v.toLowerCase()?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)] rounded-2xl":"text-white bg-transparent"}`,onClick:()=>l(v.toLowerCase()),children:v},v))}),i.jsx("div",{className:"flex justify-center w-full lg:flex-none lg:w-auto bg-[#202020] rounded-2xl p-1 text-[12px] font-semibold mt-2 lg:mt-0",children:["PnL","Account Value"].map(v=>i.jsx("button",{className:`rounded-2xl hover:border-[#67FFBD] hover:rounded-2xl ${s===(v==="PnL"?"pnlHistory":"accountValueHistory")?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)] rounded-2xl":"text-white bg-transparent"}`,onClick:()=>a(v==="PnL"?"pnlHistory":"accountValueHistory"),children:v},v))})]}),i.jsxs("div",{className:" text-white relative",children:[i.jsxs("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none ",children:[i.jsx("h1",{className:"sr-only",children:"Hyperliquid Wallet Overview & Trade History"}),i.jsx("span",{className:"text-[70px] sm:text-[100px] md:text-[140px] lg:text-[100px]  xl:text-[140px] text-gray-600 opacity-20 font-bold font-manrope",children:"dextrabot"})]}),i.jsx(HL,{options:x,series:g,type:"area",height:410})]})]})};var Vx={},V7={},dCe;function $Ue(){if(dCe)return V7;dCe=1,Object.defineProperty(V7,"__esModule",{value:!0}),V7.parseLengthAndUnit=t,V7.cssValue=n;var e={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function t(r){if(typeof r=="number")return{value:r,unit:"px"};var s,a=(r.match(/^[0-9.]*/)||"").toString();a.includes(".")?s=parseFloat(a):s=parseInt(a,10);var o=(r.match(/[^0-9]*$/)||"").toString();return e[o]?{value:s,unit:o}:(console.warn("React Spinners: ".concat(r," is not a valid css value. Defaulting to ").concat(s,"px.")),{value:s,unit:"px"})}function n(r){var s=t(r);return"".concat(s.value).concat(s.unit)}return V7}var W7={},fCe;function UUe(){if(fCe)return W7;fCe=1,Object.defineProperty(W7,"__esModule",{value:!0}),W7.createAnimation=void 0;var e=function(t,n,r){var s="react-spinners-".concat(t,"-").concat(r);if(typeof window>"u"||!window.document)return s;var a=document.createElement("style");document.head.appendChild(a);var o=a.sheet,l=`
    @keyframes `.concat(s,` {
      `).concat(n,`
    }
  `);return o&&o.insertRule(l,0),s};return W7.createAnimation=e,W7}var hCe;function Qsn(){if(hCe)return Vx;hCe=1;var e=Vx.__assign||function(){return e=Object.assign||function(d){for(var f,x=1,g=arguments.length;x<g;x++){f=arguments[x];for(var v in f)Object.prototype.hasOwnProperty.call(f,v)&&(d[v]=f[v])}return d},e.apply(this,arguments)},t=Vx.__createBinding||(Object.create?function(d,f,x,g){g===void 0&&(g=x);var v=Object.getOwnPropertyDescriptor(f,x);(!v||("get"in v?!f.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return f[x]}}),Object.defineProperty(d,g,v)}:function(d,f,x,g){g===void 0&&(g=x),d[g]=f[x]}),n=Vx.__setModuleDefault||(Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f}),r=Vx.__importStar||function(){var d=function(f){return d=Object.getOwnPropertyNames||function(x){var g=[];for(var v in x)Object.prototype.hasOwnProperty.call(x,v)&&(g[g.length]=v);return g},d(f)};return function(f){if(f&&f.__esModule)return f;var x={};if(f!=null)for(var g=d(f),v=0;v<g.length;v++)g[v]!=="default"&&t(x,f,g[v]);return n(x,f),x}}(),s=Vx.__rest||function(d,f){var x={};for(var g in d)Object.prototype.hasOwnProperty.call(d,g)&&f.indexOf(g)<0&&(x[g]=d[g]);if(d!=null&&typeof Object.getOwnPropertySymbols=="function")for(var v=0,g=Object.getOwnPropertySymbols(d);v<g.length;v++)f.indexOf(g[v])<0&&Object.prototype.propertyIsEnumerable.call(d,g[v])&&(x[g[v]]=d[g[v]]);return x};Object.defineProperty(Vx,"__esModule",{value:!0});var a=r(tx()),o=$Ue(),l=UUe(),c=(0,l.createAnimation)("ClipLoader","0% {transform: rotate(0deg) scale(1)} 50% {transform: rotate(180deg) scale(0.8)} 100% {transform: rotate(360deg) scale(1)}","clip");function u(d){var f=d.loading,x=f===void 0?!0:f,g=d.color,v=g===void 0?"#000000":g,w=d.speedMultiplier,C=w===void 0?1:w,N=d.cssOverride,I=N===void 0?{}:N,P=d.size,R=P===void 0?35:P,F=s(d,["loading","color","speedMultiplier","cssOverride","size"]),U=e({background:"transparent !important",width:(0,o.cssValue)(R),height:(0,o.cssValue)(R),borderRadius:"100%",border:"2px solid",borderTopColor:v,borderBottomColor:"transparent",borderLeftColor:v,borderRightColor:v,display:"inline-block",animation:"".concat(c," ").concat(.75/C,"s 0s infinite linear"),animationFillMode:"both"},I);return x?a.createElement("span",e({style:U},F)):null}return Vx.default=u,Vx}var Zsn=Qsn();const Wy=ji(Zsn),Eg=e=>Number(e).toLocaleString("en-US",{maximumFractionDigits:2}),kj=e=>!isFinite(e)||isNaN(e)?"-":`${Math.floor(e)}h ${Math.round((e-Math.floor(e))*60)}m`,Fce=({className:e="h-5"})=>i.jsx("div",{className:`w-full bg-gray-700/40 rounded animate-pulse ${e}`}),Jsn=e=>{var n;const t={totalTrades:e.length,totalPnL:0,totalFees:0,longPnL:0,shortPnL:0,wins:0,durSum:0,minDur:1/0,maxDur:-1/0,medianDur:0,perfByAsset:{},bestTrades:[],liquidations:{}};for(const r of e){t.totalPnL+=r.total_pnl||0,t.totalFees+=Math.abs(r.total_fee),r.position_side==="Long"?t.longPnL+=r.total_pnl||0:t.shortPnL+=r.total_pnl||0,r.total_pnl>0&&t.wins++,t.durSum+=r.duration_hours||0,t.minDur=Math.min(t.minDur,r.duration_hours||0),t.maxDur=Math.max(t.maxDur,r.duration_hours||0);const s=t.perfByAsset[r.coin]??(t.perfByAsset[r.coin]={coin:r.coin,pnl:0,fee:0,count:0});if(s.pnl+=r.total_pnl,s.fee+=r.total_fee,s.count++,r.isLiquidated){const a=r.coin,o=((n=t.liquidations)==null?void 0:n[a])??{coin:a,count:0,totalPrice:0,totalPnL:0};o.count+=r.liquidationCount||1,o.totalPrice+=r.isLiqudationPrice||0,o.totalPnL+=r.total_pnl||0,t.liquidations[a]=o}t.bestTrades.length<6?(t.bestTrades.push(r),t.bestTrades.sort((a,o)=>o.total_pnl-a.total_pnl)):r.total_pnl>t.bestTrades[5].total_pnl&&(t.bestTrades[5]=r,t.bestTrades.sort((a,o)=>o.total_pnl-a.total_pnl))}return t.grossPnL=t.totalPnL-t.totalFees,t.longPct=t.longPnL/(t.longPnL+t.shortPnL||1)*100,t.shortPct=100-t.longPct,t.winRate=t.totalTrades?t.wins/t.totalTrades*100:0,t.avgDur=t.totalTrades?t.durSum/t.totalTrades:0,t.medianDur=(t.minDur+t.maxDur)/2,t.perfByAsset=Object.values(t.perfByAsset).sort((r,s)=>s.pnl-r.pnl),t.liquidations=Object.values(t.liquidations).sort((r,s)=>s.count-r.count),t};function ein({trades:e}){const[t,n]=m.useState(!1),r=m.useMemo(()=>e?Jsn(e):null,[e]),s=m.useMemo(()=>{var c;return(c=r==null?void 0:r.perfByAsset)!=null&&c.length?Math.max(...r.perfByAsset.map(u=>Math.abs(u.pnl))):1},[r]),a=!r,o=r?new Date(Math.min(...e.map(c=>c.open_time))).toLocaleDateString():"-",l=r?new Date(Math.max(...e.map(c=>c.close_time??Date.now()))).toLocaleDateString():"-";return i.jsxs(i.Fragment,{children:[i.jsx("button",{onClick:()=>n(!0),className:"bg-[rgba(255,255,255,0.16)] text-[#ffffff] h-6 sm:h-8 px-1 sm:px-3 py-[1px] sm:py-[5px] rounded-[256px] inline-flex items-center gap-2 text-[14px] font-semibold",children:"Trade Details"}),i.jsxs(rp,{isOpen:t,onClose:()=>n(!1),children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h1",{className:"text-lg font-semibold text-white",children:"Trade Details"}),a&&i.jsx(Wy,{color:"#fff",size:20})]}),i.jsxs("div",{className:"mb-4 text-xs text-white",children:[o," – ",l]}),!a&&(!r||r.totalTrades===0)?i.jsx(tin,{}):i.jsx(nin,{stats:r,maxCoinPnl:s,loading:a})]})]})}function tin(){return i.jsxs("div",{className:"w-full h-[60vh] flex flex-col items-center justify-center text-white text-sm",children:[i.jsx(S6t,{className:"w-14 h-14 mb-4"}),i.jsx("p",{children:"No Trade Details"}),i.jsx("p",{className:"opacity-70",children:"Not enough trading activity detected to generate statistics."})]})}function nin({stats:e,maxCoinPnl:t,loading:n}){return i.jsxs("div",{className:"flex flex-col sm:flex-row w-[90vw] gap-6 max-h-[80vh] h-[80vh] font-manrope",children:[i.jsxs("div",{className:"space-y-6 w-full sm:w-3/2 overflow-y-auto",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[i.jsx(q7,{title:"Total PnL",loading:n,children:e&&i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:`text-xl font-semibold ${e.totalPnL-e.totalFees>=0?"text-[#67FFBD]":"text-[#FF7173]"}`,children:["$",Eg(e.totalPnL-e.totalFees)]}),i.jsx(db,{label:"Gross:",value:`$${Eg(e.grossPnL+e.totalFees)}`}),i.jsx(db,{label:"Fees:",value:`$${Eg(e.totalFees)}`,red:!0})]})}),i.jsx(q7,{title:"Position Split",loading:n,children:e&&i.jsxs(i.Fragment,{children:[i.jsx(db,{label:"Long PnL",value:`$${Eg(Math.abs(e.longPnL))}`,green:!0}),i.jsx(db,{label:"Short PnL",value:`$${Eg(Math.abs(e.shortPnL))}`,green:!0}),i.jsx("div",{className:"h-2 bg-gray-700 rounded mt-2 overflow-hidden",children:i.jsx("div",{className:"h-2 bg-[#67FFBD]",style:{width:`${e.longPct}%`}})})]})}),i.jsx(q7,{title:"Performance",loading:n,children:e&&i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"text-xl font-semibold text-white",children:[e.winRate.toFixed(2),"%"]}),i.jsx(db,{label:"Winning:",value:e.wins}),i.jsx(db,{label:"Total:",value:e.totalTrades})]})}),i.jsx(q7,{title:"Trade Duration",loading:n,children:e&&i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-xl font-semibold text-white",children:kj(e.avgDur)}),i.jsx(db,{label:"Range:",value:`${kj(e.minDur)} – ${kj(e.maxDur)}`}),i.jsx(db,{label:"Median:",value:kj(e.medianDur)})]})})]}),i.jsx(sin,{stats:e,loading:n})]}),i.jsxs("div",{className:"rounded-2xl w-full sm:w-1/3 h-full flex flex-col gap-4",children:[i.jsx(iin,{stats:e,loading:n,maxCoinPnl:t}),i.jsx(q7,{title:"Liquidations",loading:n,children:e&&e.liquidations.length>0?i.jsx(rin,{data:e.liquidations}):i.jsx("p",{className:"text-white text-lg text-center font-bold",children:"No liquidations"})})]})]})}function q7({title:e,loading:t,children:n}){return i.jsxs("div",{className:"bg-[#161616] p-4 rounded-2xl flex flex-col justify-between min-h-[140px]",children:[i.jsx("h2",{className:"text-sm uppercase tracking-wider text-white font-bold mb-3",children:e}),t?i.jsx(Fce,{className:"h-10"}):n]})}function rin({data:e}){return i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full text-sm font-bold text-white",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"border-b border-gray-600 text-sm font-bold",children:[i.jsx("th",{className:"py-1 text-left",children:"Coin"}),i.jsx("th",{className:"py-1 text-right",children:"Total Loss"}),i.jsx("th",{className:"py-1 text-right",children:"Total Liqs"})]})}),i.jsx("tbody",{children:e.map(t=>i.jsxs("tr",{className:"border-b border-gray-700 last:border-0",children:[i.jsx("td",{className:"py-1",children:i.jsxs("a",{href:`/terminal/${t.coin}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center text-white hover:text-gray-400",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${t.coin}.svg`,alt:t.coin,className:"w-5 h-5 mr-2",loading:"lazy",onError:n=>replaceBrokenImgSrc(n)}),t.coin]})}),i.jsxs("td",{className:"py-1 text-right text-[#FF7173]",children:["$",Eg(Math.abs(t.totalPnL))]}),i.jsx("td",{className:"py-1 text-right",children:t.count})]},t.coin))})]})})}function db({label:e,value:t,red:n,green:r}){return i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{className:"text-white font-semibold",children:e}),i.jsx("span",{className:n?"text-[#FF7173] font-semibold":r?"text-[#67FFBD] font-semibold":"font-semibold text-white",children:t})]})}function sin({stats:e,loading:t}){return i.jsxs("div",{className:"bg-[#161616] p-4 rounded-2xl",children:[i.jsx("h2",{className:"text-sm uppercase tracking-wider text-white mb-4 font-bold",children:"Best Trades"}),t?i.jsx("div",{className:"grid grid-cols-2 gap-4",children:Array.from({length:6}).map((n,r)=>i.jsx(Fce,{className:"h-20"},r))}):i.jsx("div",{className:"grid grid-cols-2 gap-4",children:e.bestTrades.map(n=>i.jsxs("div",{className:"bg-[#111] p-3 rounded-2xl space-y-1 text-sm",children:[i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"font-semibold text-white",children:n.coin}),i.jsx("span",{className:n.position_side==="Long"?"text-[#67FFBD]":"text-[#FF7173]",children:i.jsxs("span",{className:"text-lg font-bold",children:["$",Eg(Math.abs(n.total_pnl))]})})]}),i.jsx("span",{className:`px-2 py-[1px] rounded text-[11px] font-semibold ${n.position_side==="Long"?"bg-[#67FFBD]/20 text-[#67FFBD]":"bg-[#FF7173]/30 text-[#FF7173]"}`,children:n.position_side}),i.jsxs("div",{className:"text-white font-semibold",children:["Duration: ",kj(n.duration_hours)]}),i.jsx("div",{className:"text-white text-xs font-semibold",children:new Date(n.close_time).toLocaleDateString()})]},n.id??`${n.coin}-${n.close_time}`))})]})}function iin({stats:e,loading:t,maxCoinPnl:n}){return i.jsxs("div",{className:"bg-[#161616] p-4 overflow-y-auto",children:[i.jsx("h2",{className:"text-sm uppercase tracking-wider text-white mb-4 font-bold",children:"Performance by Asset"}),t?i.jsx("div",{className:"space-y-3",children:Array.from({length:10}).map((r,s)=>i.jsx(Fce,{className:"h-6"},s))}):e.perfByAsset.map(r=>{const s=`${Math.abs(r.pnl)/n*100}%`;return i.jsxs("div",{className:"mb-4 space-y-1",children:[i.jsxs("div",{className:"flex justify-between text-sm font-semibold",children:[i.jsxs("span",{className:"text-white",children:[r.coin,i.jsxs("span",{className:"text-white text-xs ml-2",children:[r.count," trades"]})]}),i.jsxs("span",{className:"text-[#67FFBD]",children:["$",Eg(Math.abs(r.pnl))]})]}),i.jsxs("div",{className:"text-[11px] text-white font-semibold",children:["Fees: $",Eg(Math.abs(r.fee))]}),i.jsx("div",{className:"relative h-1 bg-gray-700 rounded overflow-hidden",children:i.jsx("div",{className:"absolute h-1 left-0 top-0 bg-[#67FFBD]",style:{width:s}})})]},r.coin)})]})}const zUe="https://api.hyperliquid.xyz/info",kne=2e3,HUe=365*24*60*60*1e3*2;async function VUe(e,t){const{data:n}=await ls.post(zUe,{type:"userFillsByTime",user:e,startTime:t,aggregateByTime:!0},{headers:{"Content-Type":"application/json"},timeout:1e4});return n}async function Oce(e){let t=Date.now()-HUe;const n=[],r=new Set;for(;;){const s=await VUe(e,t);if(!(s!=null&&s.length))break;for(const a of s)r.has(a.tid)||(r.add(a.tid),n.push(a));if(s.length<kne)break;t=Math.max(...s.map(a=>a.time))+1}return n.sort((s,a)=>s.time-a.time)}async function Mce(e){const{data:t}=await ls.post(zUe,{type:"userTwapSliceFills",user:e},{headers:{"Content-Type":"application/json"},timeout:1e4});return t}async function ain(e,t){let n=Date.now()-HUe;const r=[],s=new Set;let a=0;for(;;){const c=await VUe(e,n);if(!(c!=null&&c.length))break;for(const f of c)s.has(f.tid)||(s.add(f.tid),r.push(f));a++;let u=0,d=0;if(r.forEach(f=>{f.fee&&(u+=parseFloat(f.fee)),f.builderFee&&(d+=parseFloat(f.builderFee))}),t({totalFee:u,totalBuilderFee:d,totalFills:r.length,requestCount:a,hasMoreData:c.length>=kne,fills:r.slice(0,10),isComplete:!1}),c.length<kne)break;n=Math.max(...c.map(f=>f.time))+1}let o=0,l=0;return r.forEach(c=>{c.fee&&(o+=parseFloat(c.fee)),c.builderFee&&(l+=parseFloat(c.builderFee))}),t({totalFee:o,totalBuilderFee:l,totalFills:r.length,requestCount:a,hasMoreData:!1,fills:r.slice(0,10),isComplete:!0}),r.sort((c,u)=>c.time-u.time)}function pCe(e,t,n=1e-9,r=0){if(n<0||r<0)throw new RangeError("tolerances must be non-negative");if(e===t)return!0;if(!Number.isFinite(e)||!Number.isFinite(t))return!1;const s=Math.abs(t-e);return s<=Math.abs(n*t)||s<=Math.abs(n*e)||s<=r}function Rce(e){const t=[],n={},r=e.slice().sort((s,a)=>s.time-a.time);for(const s of r)try{const a=s.coin,o=s.dir,l=Math.abs(+s.sz),c=+s.px,u=Math.abs(+s.startPosition),d=+s.builderFee||0,f=+s.fee||0,x=+s.closedPnl||0,g=+s.time,v=s.twapId??null,w=o.startsWith("Open"),C=o.startsWith("Close"),N=o.includes(">"),I=!!s.liquidation;if(w){if(pCe(u,0))n[a]={coin:a,open_time:g,last_fill_time:g,position_side:o.includes("Long")?"Long":"Short",total_size:l,close_size:0,entry_price_wma:c,close_px:c,total_fee:f,total_pnl:0,transaction_count:1,isClosed:!1,oids:[s.oid],has_builder_fee:d!==0,builder_fee:d,twapId:v};else{const P=n[a]??(n[a]={}),R=(P.total_size||0)+l;P.oids=(P.oids||[]).concat(s.oid),P.entry_price_wma=((P.entry_price_wma||0)*(P.total_size||0)+c*l)/R,P.total_size=R,P.last_fill_time=g,P.transaction_count=(P.transaction_count||0)+1,P.total_fee=(P.total_fee||0)+f,P.has_builder_fee=P.has_builder_fee||d!==0,P.builder_fee=(P.builder_fee||0)+d,P.twapId=v}continue}if(N){const P=n[a];P&&(P.close_size+=l,P.total_pnl+=x,P.total_fee+=f,P.last_fill_time=g,P.close_px=c,P.transaction_count++,P.oids.push(s.oid),P.has_builder_fee=P.has_builder_fee||d!==0,P.builder_fee=(P.builder_fee||0)+d,P.twapId=v,P.isClosed=!0,P.close_time=g,P.duration_hours=(g-P.open_time)/36e5,t.push(P),delete n[a]);const R=Math.max(Math.abs(l)-Math.abs(u),0);R>0&&(n[a]={coin:a,open_time:g,last_fill_time:g,position_side:o.includes("Long")?"Long":"Short",total_size:R,close_size:0,entry_price_wma:c,close_px:c,total_fee:f,total_pnl:0,transaction_count:1,isClosed:!1,isLiquidated:!1,oids:[s.oid],has_builder_fee:d!==0,builder_fee:d,twapId:v});continue}if(C||I){const P=n[a];if(!P)continue;P.close_size+=l,P.total_pnl+=x,P.total_fee+=f,P.last_fill_time=g,P.close_px=c,P.transaction_count++,P.oids.push(s.oid),P.has_builder_fee=P.has_builder_fee||d!==0,P.builder_fee=(P.builder_fee||0)+d,P.twapId=v,I&&(P.isLiquidated=!0,P.liquidation_px_sum=(P.liquidation_px_sum||0)+c,P.liquidationCount=(P.liquidationCount||0)+1),pCe(Math.abs(l),Math.abs(u),1e-6)&&(P.isClosed=!0,P.close_time=g,P.duration_hours=(g-P.open_time)/36e5,t.push(P),delete n[a])}}catch{}return{closed_positions:t,current_positions:n,min_open_time:t.length?Math.min(...t.map(s=>s.open_time)):null,end_time:Date.now()}}const Ff=({className:e})=>i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[i.jsx("path",{d:"M15.1668 11.6665C15.1668 11.9398 14.9402 12.1665 14.6668 12.1665H10.0002V12.3332C10.0002 13.3332 9.40016 13.6665 8.66683 13.6665H4.66683C3.9335 13.6665 3.3335 13.3332 3.3335 12.3332V12.1665H1.3335C1.06016 12.1665 0.833496 11.9398 0.833496 11.6665C0.833496 11.3932 1.06016 11.1665 1.3335 11.1665H3.3335V10.9998C3.3335 9.99984 3.9335 9.6665 4.66683 9.6665H8.66683C9.40016 9.6665 10.0002 9.99984 10.0002 10.9998V11.1665H14.6668C14.9402 11.1665 15.1668 11.3932 15.1668 11.6665Z",fill:"currentColor"}),i.jsx("path",{d:"M15.1668 4.3335C15.1668 4.60683 14.9402 4.8335 14.6668 4.8335H12.6668V5.00016C12.6668 6.00016 12.0668 6.3335 11.3335 6.3335H7.3335C6.60016 6.3335 6.00016 6.00016 6.00016 5.00016V4.8335H1.3335C1.06016 4.8335 0.833496 4.60683 0.833496 4.3335C0.833496 4.06016 1.06016 3.8335 1.3335 3.8335H6.00016V3.66683C6.00016 2.66683 6.60016 2.3335 7.3335 2.3335H11.3335C12.0668 2.3335 12.6668 2.66683 12.6668 3.66683V3.8335H14.6668C14.9402 3.8335 15.1668 4.06016 15.1668 4.3335Z",fill:"currentColor"})]});function hT({open:e,setOpen:t,data:n,setTradeInfo:r,pnlTitle:s="UNREALIZED PNL",showPnl:a=!0}){const o=m.useRef(null),l=async()=>{if(o.current)try{await document.fonts.ready,await new Promise(C=>setTimeout(C,500));const v=await j1(o.current,{cacheBust:!0,backgroundColor:null,useCORS:!1,style:{transform:"scale(1)",transformOrigin:"top left"}}),w=document.createElement("a");w.href=v,w.download="dextrabot.png",document.body.appendChild(w),w.click(),document.body.removeChild(w),on.success("PNG successfully downloaded!")}catch(v){console.error("Error generating PNG:",v),on.error("Failed to download PNG.")}},[c,u]=m.useState(),[d,f]=m.useState(!0),x=async v=>{f(!0);try{const C=await(await fetch(`https://api.cors.lol/?url=${encodeURIComponent(v)}`)).blob();return new Promise((N,I)=>{const P=new FileReader;P.onloadend=()=>N(P.result),P.onerror=I,P.readAsDataURL(C)})}catch(w){throw console.error("Image conversion failed:",w),w}finally{f(!1)}},g={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return m.useEffect(()=>{var v;n!=null&&n.coin&&x(`https://app.hyperliquid.xyz/coins/${g[n==null?void 0:n.coin]||((v=n==null?void 0:n.coin)==null?void 0:v.split("/")[0])}.svg`).then(w=>u(w)).catch(()=>u(Ua))},[n==null?void 0:n.coin]),i.jsxs(ga,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 scale-75",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-max relative bg-[#1b1b1b] rounded-2xl",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),setTimeout(()=>{r(v=>({...v,coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,positionDistribution:0,pnl:0,closePx:0}))},300)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Oa})})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4 w-full",children:[i.jsx("div",{className:"flex justify-start items-center w-full pt-6 pl-6 text-white text-base font-semibold font-manrope leading-[8px]",children:"Share PnL"}),i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 px-2 pb-2.5",children:[i.jsx("div",{ref:o,style:{overflow:"visible",position:"relative"},className:"w-[858px] h-[608px] rounded-2xl border border-dashed border-[#353535] justify-center items-center inline-flex overflow-hidden",children:i.jsxs("div",{className:"w-[850px] h-[600px] rounded-xl flex justify-start items-center bg-[#0F1211]",children:[i.jsx("div",{className:"flex justify-start items-center w-[502px] max-h-[600px] bg-[#0F1211] rounded-xl share-pnl-background",children:i.jsxs("div",{className:"flex flex-col items-start gap-4 px-[22px] py-[40px] h-full w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-4 relative",children:[i.jsx("img",{src:jA,alt:"",className:"w-12 h-12 max-w-12 min-h-12"}),i.jsx("p",{className:"flex justify-center items-center text-white text-2xl font-semibold font-manrope",children:"Dextrabot - Copy Trade"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start ",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2 relative mt-6",children:[i.jsx("div",{className:"w-8 h-8 rounded-full flex justify-center items-center",children:i.jsx("div",{className:"w-8 h-8 rounded-full flex justify-center items-center",children:d?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[34px] px-0.5 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("img",{src:c||Ua,alt:"",className:"rounded-full w-8 h-8",loading:"lazy",onError:v=>ea(v)})})}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope flex items-center",children:n!=null&&n.coin?n==null?void 0:n.coin.replace("xyz:",""):"--"}),i.jsx("div",{className:`${(n==null?void 0:n.type)=="Long"?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff787b]"} h-9 w-20 min-w-[80px] w-auto px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope uppercase tracking-wide`,children:n!=null&&n.type?n==null?void 0:n.type:"--"}),i.jsxs("div",{className:`${(n==null?void 0:n.type)=="Long"?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff787b]"} h-9 w-16 min-w-[64px] px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope tracking-wide`,children:[n!=null&&n.leverage?n==null?void 0:n.leverage:"--","x"]})]}),i.jsxs("div",{className:`${(n==null?void 0:n.roe)>=0?"text-[#67ffbd]":"text-[#ff6767]"} text-[86px] font-semibold font-manrope leading-[92px] inline-flex justify-center items-center min-w-max`,children:[(n==null?void 0:n.roe)>=0?"+":"-",ro(Math.abs(n==null?void 0:n.roe)),"%"]})]}),i.jsxs("div",{className:"flex justify-start items-start gap-[45px] pt-[12px]",children:[s&&i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:s}),i.jsx("div",{className:`${(n==null?void 0:n.pnl)>=0?"text-[#67ffbd]":"text-[#ff787b]"} text-[32px] font-semibold font-manrope leading-none flex`,children:n!=null&&n.pnl?`$${ro(Math.abs(n==null?void 0:n.pnl).toFixed(2))}`:ro(Math.abs(n==null?void 0:n.pnl))})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"ENTRY PRICE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.entryPrice?`$${Er(n==null?void 0:n.entryPrice)}`:Er(n==null?void 0:n.entryPrice)})]})]}),i.jsx("div",{className:"flex justify-start items-start gap-[45px] pt-[12px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"MARK PRICE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.markPrice?`$${Er(n==null?void 0:n.markPrice)}`:Er(n==null?void 0:n.markPrice)})]})}),(n==null?void 0:n.referral)&&(n==null?void 0:n.referral)!="--"&&i.jsx("div",{className:"flex justify-start items-start gap-[65px] pt-[20px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope leading-loose tracking-wider flex",children:"REFERRAL"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.referral&&(n==null?void 0:n.referral)!="--"?n==null?void 0:n.referral:"--"})]})}),i.jsx("div",{className:`${n!=null&&n.referral&&(n==null?void 0:n.referral)!="--"?"pt-[8px]":"pt-[90px]"} flex justify-start items-start`,children:i.jsx("div",{className:"text-[#828483] text-lg font-medium font-manrope leading-loose tracking-wide",children:n!=null&&n.referral&&(n==null?void 0:n.referral)!="--"?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"})})]})}),i.jsx("div",{className:"flex justify-center items-center h-[600px] max-h-[600px] bg-[#0F1211] rounded-tr-xl rounded-br-xl max-w-[378px] overflow-hidden",children:(n==null?void 0:n.roe)>=0?i.jsx("img",{src:NA,alt:"",className:"h-full"}):i.jsx("img",{src:AA,alt:"",className:"h-full"})})]})}),i.jsxs("div",{className:"flex flex-col items-start justify-between gap-4 w-[400px] h-[600px] bg-[#232323] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start w-full gap-4",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[21px]",children:"Customization"}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Referral Code"}),i.jsxs("div",{className:"flex justify-start items-center gap-2 px-2.5 w-full h-8 bg-[#1b1b1b] rounded-md border border-[#303030]",children:[i.jsx("div",{className:"text-[#7b7b7b] text-sm font-medium font-inter leading-[8px]",children:"#"}),i.jsx("div",{className:"text-white text-sm font-medium font-inter leading-[8px]",children:n!=null&&n.referral&&(n==null?void 0:n.referral)!="--"?n==null?void 0:n.referral:"--"})]}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Comment"}),i.jsx("div",{className:"flex justify-start items-center gap-2 p-2 w-full h-max bg-[#1b1b1b] rounded-lg border border-[#303030]",children:i.jsx("div",{className:"w-max text-[#909090] text-sm font-normal font-inter leading-[18px]",children:n!=null&&n.referral&&(n==null?void 0:n.referral)!="--"?i.jsxs("span",{children:["Profit like the pros! 🤑 Copy top traders automatically with Dextrabot. Use my referral"," ",n==null?void 0:n.referral," & save 4% on fees! @Dextrabot 🚀"]}):i.jsx("span",{children:"Profit like the pros! 🤑 Copy top traders automatically with @Dextrabot 🚀"})})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2.5 w-full",children:[i.jsx("div",{onClick:v=>{v.stopPropagation(),navigator.clipboard.writeText(n!=null&&n.referral&&(n==null?void 0:n.referral)!="--"?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Copy URL"})}),i.jsx("div",{onClick:v=>{v.preventDefault(),d||l()},className:`${d?"cursor-not-allowed":"cursor-pointer"} w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex has-tooltip relative`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:d?"Hang tight! Your image is on the way... 🚀":"Download PNG"})}),i.jsx("a",{href:`https://x.com/intent/post?url=${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"}&text=Profit%20like%20the%20pros!%20🤑%20Copy%20top%20traders%20automatically${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`%20with%20Dextrabot.%20Use%20my%20referral%20${n==null?void 0:n.referral}%20and%20save%204%25%20on%20fees!`:"%20with%20%40Dextrabot"}%20🚀%0A`,target:"_blank",className:"w-full h-8 px-6 py-3 bg-white rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#363636] text-[13px] font-medium font-inter leading-[8px]",children:"Share on X"})})]})]})]})]})]})})})})})]})}function oin({open:e,setOpen:t,data:n,setTradeInfo:r}){var o,l;const s=m.useRef(null),a=async()=>{if(s.current)try{await document.fonts.ready,await new Promise(d=>setTimeout(d,500));const c=await j1(s.current,{cacheBust:!0,backgroundColor:null,useCORS:!0,style:{transform:"scale(1)",transformOrigin:"top left"}}),u=document.createElement("a");u.href=c,u.download="dextrabot.png",document.body.appendChild(u),u.click(),document.body.removeChild(u),on.success("PNG successfully downloaded!")}catch(c){console.error("Error generating PNG:",c),on.error("Failed to download PNG.")}};return i.jsxs(ga,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 scale-75",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-max relative bg-[#1b1b1b] rounded-2xl",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),setTimeout(()=>{r(c=>({...c,coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,positionDistribution:0,pnl:0,closePx:0}))},300)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Oa})})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4 w-full",children:[i.jsx("div",{className:"flex justify-start items-center w-full pt-6 pl-6 text-white text-base font-semibold font-manrope leading-[8px]",children:"Share PnL"}),i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 px-2 pb-2.5",children:[i.jsx("div",{ref:s,style:{overflow:"visible",position:"relative"},className:"w-[878px] h-[608px] rounded-2xl border border-dashed border-[#353535] justify-center items-center inline-flex overflow-hidden",children:i.jsxs("div",{className:"w-[870px] h-[600px] rounded-xl flex justify-start items-center bg-[#0F1211]",children:[i.jsx("div",{className:"flex justify-start items-center w-[522px] max-h-[600px] bg-[#0F1211] rounded-xl share-pnl-background",children:i.jsxs("div",{className:"flex flex-col items-start gap-4 px-[20px] py-[30px] h-full w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-4 relative",children:[i.jsx("img",{src:jA,alt:"",className:"w-12 h-12 max-w-12 min-h-12"}),i.jsx("p",{className:"flex justify-center items-center text-white text-2xl font-semibold font-manrope",children:"Dextrabot - Copy Trade"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2 relative mt-[30px]",children:[i.jsx("div",{className:`${(n==null?void 0:n.type)=="LONG"?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff787b]"} h-9 min-w-[80px] px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope uppercase tracking-wide`,children:n!=null&&n.type?n==null?void 0:n.type:"--"}),i.jsx("div",{className:`${(n==null?void 0:n.type)=="LONG"?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff787b]"} h-9 min-w-[64px] px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope tracking-wide`,children:n!=null&&n.leverage?(n==null?void 0:n.leverage)==null||isNaN(parseFloat(n==null?void 0:n.leverage))?"--":parseFloat(n==null?void 0:n.leverage).toFixed(2)+"x":"--"})]}),i.jsxs("div",{className:`${n!=null&&n.roe&&(n==null?void 0:n.roe)>=0?"text-[#67ffbd]":"text-[#ff6767]"} text-[86px] font-semibold font-manrope leading-[92px] inline-flex justify-center items-center`,children:[n!=null&&n.roe&&(n==null?void 0:n.roe)>=0?"+":"-",(n==null?void 0:n.roe)==null||isNaN(parseFloat(n==null?void 0:n.roe))?"":_s(Math.abs(n==null?void 0:n.roe))+"%"]})]}),i.jsxs("div",{className:"flex justify-start items-start gap-[30px] pt-[18px]",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"UNREALIZED PNL"}),i.jsx("div",{className:`${(n==null?void 0:n.entryPrice)>=0?"text-[#67ffbd]":"text-[#ff6767]"}  text-[32px] font-semibold font-manrope leading-none flex min-w-[180px]`,children:n!=null&&n.entryPrice?`$${Er(Math.abs(n==null?void 0:n.entryPrice))}`:"--"})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex min-w-max",children:"POSITION DISTRIBUTION"}),i.jsx("div",{className:"text-white text-[24px] font-semibold font-manrope leading-none flex min-w-max pt-1",children:n!=null&&n.positionDistribution?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-[#67ffbd]",children:n==null?void 0:n.positionDistribution.split("/")[0].trim()}),i.jsx("span",{className:"text-white mx-1",children:"/"}),i.jsx("span",{className:"text-[#ff6767]",children:(o=n==null?void 0:n.positionDistribution.split("/")[1])==null?void 0:o.trim()})]}):i.jsx("span",{className:"text-white",children:"--"})})]})]}),i.jsx("div",{className:"flex justify-start items-start gap-[65px] pt-[8px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope leading-loose tracking-wider flex",children:"CURRENT WIN RATE"}),i.jsx("div",{className:"text-[24px] font-semibold font-manrope leading-none flex min-w-max",children:n!=null&&n.markPrice?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-[#67ffbd]",children:n==null?void 0:n.markPrice.split("/")[0].trim()}),i.jsx("span",{className:"text-white mx-1",children:"/"}),i.jsx("span",{className:"text-white",children:(l=n==null?void 0:n.markPrice.split("/")[1])==null?void 0:l.trim()})]}):i.jsx("span",{className:"text-white",children:"--"})})]})}),(n==null?void 0:n.referral)&&i.jsx("div",{className:"flex justify-start items-start gap-[65px] pt-[16px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope leading-loose tracking-wider flex",children:"REFERRAL"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]})}),i.jsx("div",{className:`${n!=null&&n.referral?"pt-[1px]":"pt-[90px]"} flex justify-start items-start`,children:i.jsx("div",{className:"text-[#828483] text-lg font-medium font-manrope leading-loose tracking-wide",children:n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"})})]})}),i.jsx("div",{className:"flex justify-center items-center h-[600px] max-h-[600px] bg-[#0F1211] rounded-tr-xl rounded-br-xl max-w-[398px] overflow-hidden",children:n!=null&&n.entryPrice&&(n==null?void 0:n.entryPrice)>=0?i.jsx("img",{src:NA,alt:"",className:"h-full"}):i.jsx("img",{src:AA,alt:"",className:"h-full"})})]})}),i.jsxs("div",{className:"flex flex-col items-start justify-between gap-4 w-[400px] h-[600px] bg-[#232323] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start w-full gap-4",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[21px]",children:"Customization"}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Referral Code"}),i.jsxs("div",{className:"flex justify-start items-center gap-2 px-2.5 w-full h-8 bg-[#1b1b1b] rounded-md border border-[#303030]",children:[i.jsx("div",{className:"text-[#7b7b7b] text-sm font-medium font-inter leading-[8px]",children:"#"}),i.jsx("div",{className:"text-white text-sm font-medium font-inter leading-[8px]",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Comment"}),i.jsx("div",{className:"flex justify-start items-center gap-2 p-2 w-full h-max bg-[#1b1b1b] rounded-lg border border-[#303030]",children:i.jsx("div",{className:"w-max text-[#909090] text-sm font-normal font-inter leading-[18px]",children:n!=null&&n.referral?i.jsxs("span",{children:["Profit like the pros! 🤑 Copy top traders automatically with Dextrabot. Use my referral"," ",n==null?void 0:n.referral," & save 4% on fees! @Dextrabot 🚀"]}):i.jsx("span",{children:"Profit like the pros! 🤑 Copy top traders automatically with @Dextrabot 🚀"})})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2.5 w-full",children:[i.jsx("div",{onClick:c=>{c.stopPropagation(),navigator.clipboard.writeText(n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Copy URL"})}),i.jsx("div",{onClick:()=>{a()},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex has-tooltip relative cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Download PNG"})}),i.jsx("a",{href:`https://x.com/intent/post?url=${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"}&text=Profit%20like%20the%20pros!%20🤑%20Copy%20top%20traders%20automatically${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`%20with%20Dextrabot.%20Use%20my%20referral%20${n==null?void 0:n.referral}%20and%20save%204%25%20on%20fees!`:"%20with%20%40Dextrabot"}%20🚀%0A`,target:"_blank",className:"w-full h-8 px-6 py-3 bg-white rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#363636] text-[13px] font-medium font-inter leading-[8px]",children:"Share on X"})})]})]})]})]})]})})})})})]})}function lin({open:e,setOpen:t,data:n,setShare:r,setTradeInfo:s}){var x;const a=m.useRef(null),o=async()=>{if(a.current)try{await document.fonts.ready,await new Promise(w=>setTimeout(w,500));const g=await j1(a.current,{cacheBust:!0,backgroundColor:null,useCORS:!0,style:{transform:"scale(1)",transformOrigin:"top left"}}),v=document.createElement("a");v.href=g,v.download="dextrabot.png",document.body.appendChild(v),v.click(),document.body.removeChild(v),on.success("PNG successfully downloaded!")}catch(g){console.error("Error generating PNG:",g),on.error("Failed to download PNG.")}},[l,c]=m.useState(),[u,d]=m.useState(!0),f=async g=>{d(!0);try{const w=await(await fetch(`https://api.allorigins.win/raw?url=${encodeURIComponent(g)}`)).blob();return new Promise((C,N)=>{const I=new FileReader;I.onloadend=()=>C(I.result),I.onerror=N,I.readAsDataURL(w)})}catch(v){throw console.error("Image conversion failed:",v),v}finally{d(!1)}};return m.useEffect(()=>{n!=null&&n.coin&&f(`https://app.hyperliquid.xyz/coins/${n==null?void 0:n.coin}.svg`).then(g=>c(g)).catch(()=>c(Ua))},[n==null?void 0:n.coin]),i.jsxs(ga,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 scale-75",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-max relative bg-[#1b1b1b] rounded-2xl",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),r(!1),setTimeout(()=>{s(g=>({...g,coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,positionDistribution:0,pnl:0,closePx:0}))},300)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Oa})})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4 w-full",children:[i.jsx("div",{className:"flex justify-start items-center w-full pt-6 pl-6 text-white text-base font-semibold font-manrope leading-[8px]",children:"Share PnL"}),i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 px-2 pb-2.5",children:[i.jsx("div",{ref:a,style:{overflow:"visible",position:"relative"},className:"w-[858px] h-[608px] rounded-2xl border border-dashed border-[#353535] justify-center items-center inline-flex overflow-hidden",children:i.jsxs("div",{className:"w-[850px] h-[600px] rounded-xl flex justify-start items-center bg-[#0F1211]",children:[i.jsx("div",{className:"flex justify-start items-center w-[502px] max-h-[600px] bg-[#0F1211] rounded-xl share-pnl-background",children:i.jsxs("div",{className:"flex flex-col items-start gap-4 px-[22px] py-[40px] h-full w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-4 relative",children:[i.jsx("img",{src:jA,alt:"",className:"w-12 h-12 max-w-12 min-h-12"}),i.jsx("p",{className:"flex justify-center items-center text-white text-2xl font-semibold font-manrope",children:"Dextrabot - Copy Trade"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start ",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2 relative mt-6",children:[i.jsx("div",{className:"w-8 h-8 rounded-full flex justify-center items-center",children:i.jsx("div",{className:"w-8 h-8 rounded-full flex justify-center items-center",children:u?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[34px] px-0.5 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",class:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{class:"sr-only",children:"Loading..."})]}):i.jsx("img",{src:l||Ua,alt:"",className:"rounded-full w-8 h-8",loading:"lazy",onError:g=>ea(g)})})}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope flex items-center",children:n!=null&&n.coin?n==null?void 0:n.coin:"--"}),i.jsx("div",{className:`${(x=n==null?void 0:n.type)!=null&&x.includes("Long")?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff787b]"} h-9 w-auto px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope uppercase tracking-wide`,children:n!=null&&n.type?n==null?void 0:n.type:"-"})]}),i.jsxs("div",{className:`${(n==null?void 0:n.pnl)>=0?"text-[#67ffbd]":"text-[#ff6767]"} text-[86px] font-semibold font-manrope leading-[92px] inline-flex justify-center items-center min-w-max`,children:[(n==null?void 0:n.pnl)>=0?"+":"-","$",ro(Math.abs((n==null?void 0:n.pnl)-(n!=null&&n.builderFee?n.builderFee:0)))]})]}),i.jsxs("div",{className:"flex justify-start items-start gap-[45px] pt-[12px]",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"ENTRY PRICE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.entryPrice?`$${ly(n==null?void 0:n.entryPrice)}`:ly(n==null?void 0:n.entryPrice)})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"MARK PRICE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.markPrice?`$${ly(n==null?void 0:n.markPrice)}`:ly(n==null?void 0:n.markPrice)})]})]}),i.jsx("div",{className:"flex justify-start items-start gap-[65px] pt-[20px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope leading-loose tracking-wider flex",children:"REFERRAL"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]})}),i.jsx("div",{className:"flex justify-start items-start pt-[8px]",children:i.jsx("div",{className:"text-[#828483] text-lg font-medium font-manrope leading-loose tracking-wide",children:n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"})})]})}),i.jsx("div",{className:"flex justify-center items-center h-[600px] max-h-[600px] bg-[#0F1211] rounded-tr-xl rounded-br-xl max-w-[378px] overflow-hidden",children:(n==null?void 0:n.roe)>=0?i.jsx("img",{src:NA,alt:"",className:"h-full"}):i.jsx("img",{src:AA,alt:"",className:"h-full"})})]})}),i.jsxs("div",{className:"flex flex-col items-start justify-between gap-4 w-[400px] h-[600px] bg-[#232323] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start w-full gap-4",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[21px]",children:"Customization"}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Referral Code"}),i.jsxs("div",{className:"flex justify-start items-center gap-2 px-2.5 w-full h-8 bg-[#1b1b1b] rounded-md border border-[#303030]",children:[i.jsx("div",{className:"text-[#7b7b7b] text-sm font-medium font-inter leading-[8px]",children:"#"}),i.jsx("div",{className:"text-white text-sm font-medium font-inter leading-[8px]",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Comment"}),i.jsx("div",{className:"flex justify-start items-center gap-2 p-2 w-full h-max bg-[#1b1b1b] rounded-lg border border-[#303030]",children:i.jsx("div",{className:"w-max text-[#909090] text-sm font-normal font-inter leading-[18px]",children:n!=null&&n.referral?i.jsxs("span",{children:["Profit like the pros! 🤑 Copy top traders automatically with Dextrabot. Use my referral"," ",n==null?void 0:n.referral," & save 4% on fees! @Dextrabot 🚀"]}):i.jsx("span",{children:"Profit like the pros! 🤑 Copy top traders automatically with @Dextrabot 🚀"})})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2.5 w-full",children:[i.jsx("div",{onClick:g=>{g.stopPropagation(),navigator.clipboard.writeText(n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Copy URL"})}),i.jsx("div",{onClick:g=>{g.preventDefault(),u||o()},className:`${u?"cursor-not-allowed":"cursor-pointer"} w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex has-tooltip relative`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:u?"Hang tight! Your image is on the way... 🚀":"Download PNG"})}),i.jsx("a",{href:`https://x.com/intent/post?url=${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"}&text=Profit%20like%20the%20pros!%20🤑%20Copy%20top%20traders%20automatically${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`%20with%20Dextrabot.%20Use%20my%20referral%20${n==null?void 0:n.referral}%20and%20save%204%25%20on%20fees!`:"%20with%20%40Dextrabot"}%20🚀%0A`,target:"_blank",className:"w-full h-8 px-6 py-3 bg-white rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#363636] text-[13px] font-medium font-inter leading-[8px]",children:"Share on X"})})]})]})]})]})]})})})})})]})}const cin=({wallet:e,wallets:t})=>{const[n,r]=m.useState([]),[s,a]=m.useState(!0),[o,l]=m.useState("oid"),[c,u]=m.useState(""),[d,f]=m.useState(!1),x=m.useRef(null),g=m.useRef(null),[v,w]=m.useState(!1),[C,N]=m.useState(null);m.useContext(Gr);const[I,P]=m.useState({key:null,direction:null});m.useEffect(()=>{function he(Y){g.current&&!g.current.contains(Y.target)&&setIsDropdownOpen(!1),x.current&&!x.current.contains(Y.target)&&f(!1)}return document.addEventListener("mousedown",he),()=>document.removeEventListener("mousedown",he)},[]);const R=he=>`${he.time}_${he.coin}_${he.dir}_${he.px}_${he.sz}`;m.useEffect(()=>{if(!t||t.length===0)return;const he=t.map(ie=>ie.wallet_address.toLowerCase());if(he.length===0)return;let Y=!0;return(async()=>{try{const ie=(await Promise.all(he.map(G=>ls.post("https://api-ui.hyperliquid.xyz/info",{aggregateByTime:!0,type:"userFills",user:G})))).flatMap(G=>G.data??[]);if(!Y)return;const oe=new Map;ie.forEach(G=>{const V=R(G);oe.has(V)||oe.set(V,G)}),r(Array.from(oe.values()).sort((G,V)=>V.time-G.time))}catch(ie){console.error("Multi-wallet trade fetch error:",ie)}finally{Y&&a(!1)}})(),()=>{Y=!1}},[t]),m.useEffect(()=>{const he=new WebSocket("wss://api-ui.hyperliquid.xyz/ws");return he.onopen=()=>{he.send(JSON.stringify({method:"subscribe",subscription:{type:"userFills",user:e,aggregateByTime:!0}}))},he.onmessage=Y=>{const ie=JSON.parse(Y.data);ie&&ie.data&&Array.isArray(ie.data.fills)&&r(oe=>{const G=[...oe];return ie.data.fills.forEach(V=>{const ee=R(V);G.some(ae=>R(ae)===ee)||G.push(V)}),G.sort((V,ee)=>ee.time-V.time)})},()=>he.close()},[]),m.useEffect(()=>{(async()=>{try{const Y=await ls.post("https://api-ui.hyperliquid.xyz/info",{aggregateByTime:!0,type:"userFills",user:e});r(Y.data||[])}catch(Y){console.error("Error fetching trade data:",Y)}finally{a(!1)}})()},[e]);const F=he=>{let Y="asc";I.key===he&&(I.direction==="asc"?Y="desc":I.direction==="desc"&&(Y=null)),P({key:he,direction:Y})};let U=[...n];c&&(U=U.filter(he=>String(he.oid).includes(c)));const L=U.sort((he,Y)=>{if(!I.key||!I.direction)return 0;const ie=(V,ee)=>{switch(ee){case"sz":return parseFloat(V.sz);case"closedPnl":return parseFloat(V.closedPnl||0)-parseFloat(V.fee||0);case"fee":return parseFloat(V.fee);case"tradeValue":return parseFloat(V.px)*parseFloat(V.sz);default:return V[ee]}},oe=ie(he,I.key),G=ie(Y,I.key);return oe<G?I.direction==="asc"?-1:1:oe>G?I.direction==="asc"?1:-1:0}),z=he=>{if(I.key===he){if(I.direction==="asc")return i.jsx(k3,{className:"inline ml-2 text-white"});if(I.direction==="desc")return i.jsx(_3,{className:"inline ml-2 text-white"})}return i.jsx(T3,{className:"inline ml-2 text-white"})},ne=localStorage.getItem("isDateTradeHistoryFormat")||"date",[J,Z]=m.useState(ne);m.useEffect(()=>{localStorage.setItem("isDateTradeHistoryFormat",J)},[J]);function re({date:he}){const[Y,ie]=m.useState(To(he));return m.useEffect(()=>{const oe=setInterval(()=>{ie(To(he))},1e3);return()=>clearInterval(oe)},[he]),i.jsx("span",{className:"text-white leading-[13px] tracking-[0.26px] text-[13px] font-semibold font-manrope",children:Y.dateTime})}return i.jsxs("div",{className:"relative w-full text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx(lin,{open:v,setOpen:w,data:C,setShare:()=>{},setTradeInfo:()=>{}}),i.jsx("div",{className:"w-full overflow-x-auto min-h-[60vh] max-h-[60vh] h-full flex-grow mt-1 mb-3 bg-[#161616] border-collapse rounded-lg pb-24",children:i.jsxs("table",{className:"w-max sm:w-full relative border-separate border-spacing-y-1",children:[i.jsx("thead",{className:"sticky top-0 z-[3] whitespace-nowrap bg-[#161616]",children:i.jsxs("tr",{className:"w-full z-[4] font-semibold leading-[13px] tracking-[0.26px] text-[13px] font-manrope relative h-[32px] max-h-[32px] text-white",children:[i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("time"),children:["Time ",z("time")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("coin"),children:["Coin ",z("coin")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("dir"),children:["Direction ",z("dir")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("px"),children:["Price ",z("px")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("sz"),children:["Size ",z("sz")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("tradeValue"),children:["Trade Value ",z("tradeValue")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("fee"),children:["Fee (USDC) ",z("fee")]}),i.jsxs("th",{className:" text-left cursor-pointer",onClick:()=>F("closedPnl"),children:["Closed PNL ",z("closedPnl")]}),i.jsx("th",{children:i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx(ci,{title:"Order ID",sortKey:"oid",sortOption:o,setSortOption:l,isFilterIcon:!0}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>f(!d),className:`${c?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx(Ff,{className:`w-4 h-4 ${c?"text-blue-500":"text-white"}`})}),d&&i.jsxs("div",{ref:x,className:`absolute right-[30px] mt-32 w-[208px]
                               bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>u(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"number",value:c,onChange:he=>u(he.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2  placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Order ID"})]})]})]})})]})}),i.jsx("tbody",{children:s?i.jsx("tr",{children:i.jsx("td",{colSpan:"8",className:"text-center p-4",children:"Loading..."})}):L.map((he,Y)=>{var ie,oe;return i.jsxs("tr",{className:"relative group bg-[#1b1b1b] hover:bg-[#222222] h-[32px] max-h-[32px] text-white rounded-2xl",children:[i.jsx("td",{onClick:()=>{Z(J=="time"?"date":"time")},className:"text-left rounded-l-2xl cursor-pointer",children:J=="time"?i.jsx(re,{date:he.time}):eu(he.time)}),i.jsx("td",{className:"text-left",children:i.jsx("a",{href:`/terminal/${he.coin}`,target:"_blank",rel:"noopener noreferrer",className:"text-white hover:text-gray-400",children:he.coin})}),i.jsx("td",{className:`text-left ${he!=null&&he.liquidation?"text-[#ff787b]":(ie=he.dir)!=null&&ie.includes("Short")?"text-[#ff6b6b]":(oe=he.dir)!=null&&oe.includes("Long")?"text-[#4ae3b5]":"text-white"}`,children:he!=null&&he.liquidation?`Market Liquidation: ${(he==null?void 0:he.dir)=="Sell"?"Sell":(he==null?void 0:he.dir)=="Buy"?"Buy":(he==null?void 0:he.dir)=="Close Short"?"Close Short":(he==null?void 0:he.dir)=="Close Long"?"Close Long":(he==null?void 0:he.dir)=="Open Short"?"Close Short":(he==null?void 0:he.dir)=="Open Long"?"Close Long":"Close "+(he==null?void 0:he.dir)}`:he==null?void 0:he.dir}),i.jsxs("td",{className:"text-left",children:["$",parseFloat(he.px).toFixed(2)]}),i.jsx("td",{className:"text-left",children:Er(parseFloat(he.sz))}),i.jsxs("td",{className:"text-left",children:["$",Er(parseFloat(he.px)*parseFloat(he.sz))]}),i.jsxs("td",{className:"text-left",children:[Er(parseFloat(he.fee)),he.builderFee&&i.jsxs("span",{className:"text-xs",children:["(",Er(parseFloat(he.builderFee))," ","builder fee)"]})]}),i.jsxs("td",{className:`text-left ${parseFloat(he.closedPnl)-parseFloat(he.fee)>0?"text-[#4ae3b5]":parseFloat(he.closedPnl)-parseFloat(he.fee)<0?"text-[#ff6b6b]":"text-white"}`,children:["$",Er(parseFloat(he.closedPnl)-parseFloat(he.fee))]}),i.jsx("td",{className:"rounded-r-2xl ",children:he.oid})]},Y)})})]})})]})};var Tj={exports:{}};/**
 * @license
 * Lodash <https://lodash.com/>
 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
 * Released under MIT license <https://lodash.com/license>
 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 */var uin=Tj.exports,mCe;function din(){return mCe||(mCe=1,function(e,t){(function(){var n,r="4.17.21",s=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",l="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",f=1,x=2,g=4,v=1,w=2,C=1,N=2,I=4,P=8,R=16,F=32,U=64,L=128,z=256,X=512,ne=30,J="...",Z=800,re=16,he=1,Y=2,ie=3,oe=1/0,G=9007199254740991,V=17976931348623157e292,ee=NaN,ae=4294967295,fe=ae-1,Ae=ae>>>1,ce=[["ary",L],["bind",C],["bindKey",N],["curry",P],["curryRight",R],["flip",X],["partial",F],["partialRight",U],["rearg",z]],ye="[object Arguments]",Ne="[object Array]",be="[object AsyncFunction]",je="[object Boolean]",Ie="[object Date]",Re="[object DOMException]",Qe="[object Error]",Be="[object Function]",it="[object GeneratorFunction]",tt="[object Map]",at="[object Number]",dt="[object Null]",ct="[object Object]",Ut="[object Promise]",kt="[object Proxy]",tn="[object RegExp]",jt="[object Set]",un="[object String]",cn="[object Symbol]",Pt="[object Undefined]",Xe="[object WeakMap]",Vt="[object WeakSet]",Yt="[object ArrayBuffer]",Ve="[object DataView]",Ke="[object Float32Array]",ft="[object Float64Array]",en="[object Int8Array]",Dt="[object Int16Array]",At="[object Int32Array]",Je="[object Uint8Array]",He="[object Uint8ClampedArray]",Rt="[object Uint16Array]",qe="[object Uint32Array]",lt=/\b__p \+= '';/g,xt=/\b(__p \+=) '' \+/g,Nt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,It=/&(?:amp|lt|gt|quot|#39);/g,xn=/[&<>"']/g,dn=RegExp(It.source),Mn=RegExp(xn.source),_n=/<%-([\s\S]+?)%>/g,kn=/<%([\s\S]+?)%>/g,vn=/<%=([\s\S]+?)%>/g,Qn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Hn=/^\w*$/,$n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jn=/[\\^$.*+?()[\]{}|]/g,Nn=RegExp(Jn.source),ln=/^\s+/,Oe=/\s/,sn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,fn=/\{\n\/\* \[wrapped with (.+)\] \*/,Et=/,? & /,Kn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Cn=/[()=,{}\[\]\/\s]/,Bt=/\\(\\)?/g,an=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Pn=/\w*$/,qn=/^[-+]0x[0-9a-f]+$/i,nr=/^0b[01]+$/i,tr=/^\[object .+?Constructor\]$/,Qt=/^0o[0-7]+$/i,zn=/^(?:0|[1-9]\d*)$/,Yn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Lt=/($^)/,Fn=/['\n\r\u2028\u2029\\]/g,Ee="\\ud800-\\udfff",p="\\u0300-\\u036f",h="\\ufe20-\\ufe2f",S="\\u20d0-\\u20ff",_=p+h+S,k="\\u2700-\\u27bf",T="a-z\\xdf-\\xf6\\xf8-\\xff",B="\\xac\\xb1\\xd7\\xf7",q="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",te="\\u2000-\\u206f",ue=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",de="A-Z\\xc0-\\xd6\\xd8-\\xde",xe="\\ufe0e\\ufe0f",we=B+q+te+ue,ke="['’]",Me="["+Ee+"]",Ye="["+we+"]",Fe="["+_+"]",rt="\\d+",se="["+k+"]",Ce="["+T+"]",De="[^"+Ee+we+rt+k+T+de+"]",Le="\\ud83c[\\udffb-\\udfff]",_e="(?:"+Fe+"|"+Le+")",nt="[^"+Ee+"]",ot="(?:\\ud83c[\\udde6-\\uddff]){2}",gt="[\\ud800-\\udbff][\\udc00-\\udfff]",Jt="["+de+"]",Ge="\\u200d",et="(?:"+Ce+"|"+De+")",We="(?:"+Jt+"|"+De+")",wt="(?:"+ke+"(?:d|ll|m|re|s|t|ve))?",St="(?:"+ke+"(?:D|LL|M|RE|S|T|VE))?",Kt=_e+"?",gn="["+xe+"]?",yn="(?:"+Ge+"(?:"+[nt,ot,gt].join("|")+")"+gn+Kt+")*",hn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",br="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",pt=gn+Kt+yn,Wt="(?:"+[se,ot,gt].join("|")+")"+pt,Zt="(?:"+[nt+Fe+"?",Fe,ot,gt,Me].join("|")+")",vt=RegExp(ke,"g"),Ot=RegExp(Fe,"g"),wn=RegExp(Le+"(?="+Le+")|"+Zt+pt,"g"),Gn=RegExp([Jt+"?"+Ce+"+"+wt+"(?="+[Ye,Jt,"$"].join("|")+")",We+"+"+St+"(?="+[Ye,Jt+et,"$"].join("|")+")",Jt+"?"+et+"+"+wt,Jt+"+"+St,br,hn,rt,Wt].join("|"),"g"),fr=RegExp("["+Ge+Ee+_+xe+"]"),ur=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,$t=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],nn=-1,Vn={};Vn[Ke]=Vn[ft]=Vn[en]=Vn[Dt]=Vn[At]=Vn[Je]=Vn[He]=Vn[Rt]=Vn[qe]=!0,Vn[ye]=Vn[Ne]=Vn[Yt]=Vn[je]=Vn[Ve]=Vn[Ie]=Vn[Qe]=Vn[Be]=Vn[tt]=Vn[at]=Vn[ct]=Vn[tn]=Vn[jt]=Vn[un]=Vn[Xe]=!1;var lr={};lr[ye]=lr[Ne]=lr[Yt]=lr[Ve]=lr[je]=lr[Ie]=lr[Ke]=lr[ft]=lr[en]=lr[Dt]=lr[At]=lr[tt]=lr[at]=lr[ct]=lr[tn]=lr[jt]=lr[un]=lr[cn]=lr[Je]=lr[He]=lr[Rt]=lr[qe]=!0,lr[Qe]=lr[Be]=lr[Xe]=!1;var er={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},gr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},dr={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Fs={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},us=parseFloat,xr=parseInt,vr=typeof ju=="object"&&ju&&ju.Object===Object&&ju,rs=typeof self=="object"&&self&&self.Object===Object&&self,Zr=vr||rs||Function("return this")(),gi=t&&!t.nodeType&&t,oi=gi&&!0&&e&&!e.nodeType&&e,la=oi&&oi.exports===gi,jr=la&&vr.process,Xt=function(){try{var bt=oi&&oi.require&&oi.require("util").types;return bt||jr&&jr.binding&&jr.binding("util")}catch{}}(),pe=Xt&&Xt.isArrayBuffer,st=Xt&&Xt.isDate,Ft=Xt&&Xt.isMap,yt=Xt&&Xt.isRegExp,pn=Xt&&Xt.isSet,An=Xt&&Xt.isTypedArray;function or(bt,zt,qt){switch(qt.length){case 0:return bt.call(zt);case 1:return bt.call(zt,qt[0]);case 2:return bt.call(zt,qt[0],qt[1]);case 3:return bt.call(zt,qt[0],qt[1],qt[2])}return bt.apply(zt,qt)}function _r(bt,zt,qt,Tn){for(var ir=-1,Cr=bt==null?0:bt.length;++ir<Cr;){var Ar=bt[ir];zt(Tn,Ar,qt(Ar),bt)}return Tn}function wr(bt,zt){for(var qt=-1,Tn=bt==null?0:bt.length;++qt<Tn&&zt(bt[qt],qt,bt)!==!1;);return bt}function pr(bt,zt){for(var qt=bt==null?0:bt.length;qt--&&zt(bt[qt],qt,bt)!==!1;);return bt}function es(bt,zt){for(var qt=-1,Tn=bt==null?0:bt.length;++qt<Tn;)if(!zt(bt[qt],qt,bt))return!1;return!0}function ts(bt,zt){for(var qt=-1,Tn=bt==null?0:bt.length,ir=0,Cr=[];++qt<Tn;){var Ar=bt[qt];zt(Ar,qt,bt)&&(Cr[ir++]=Ar)}return Cr}function Lr(bt,zt){var qt=bt==null?0:bt.length;return!!qt&&cr(bt,zt,0)>-1}function Qr(bt,zt,qt){for(var Tn=-1,ir=bt==null?0:bt.length;++Tn<ir;)if(qt(zt,bt[Tn]))return!0;return!1}function Ir(bt,zt){for(var qt=-1,Tn=bt==null?0:bt.length,ir=Array(Tn);++qt<Tn;)ir[qt]=zt(bt[qt],qt,bt);return ir}function Ss(bt,zt){for(var qt=-1,Tn=zt.length,ir=bt.length;++qt<Tn;)bt[ir+qt]=zt[qt];return bt}function hi(bt,zt,qt,Tn){var ir=-1,Cr=bt==null?0:bt.length;for(Tn&&Cr&&(qt=bt[++ir]);++ir<Cr;)qt=zt(qt,bt[ir],ir,bt);return qt}function li(bt,zt,qt,Tn){var ir=bt==null?0:bt.length;for(Tn&&ir&&(qt=bt[--ir]);ir--;)qt=zt(qt,bt[ir],ir,bt);return qt}function Pr(bt,zt){for(var qt=-1,Tn=bt==null?0:bt.length;++qt<Tn;)if(zt(bt[qt],qt,bt))return!0;return!1}var En=ei("length");function Rn(bt){return bt.split("")}function Dn(bt){return bt.match(Kn)||[]}function Nr(bt,zt,qt){var Tn;return qt(bt,function(ir,Cr,Ar){if(zt(ir,Cr,Ar))return Tn=Cr,!1}),Tn}function Mr(bt,zt,qt,Tn){for(var ir=bt.length,Cr=qt+(Tn?1:-1);Tn?Cr--:++Cr<ir;)if(zt(bt[Cr],Cr,bt))return Cr;return-1}function cr(bt,zt,qt){return zt===zt?O(bt,zt,qt):Mr(bt,Kr,qt)}function bs(bt,zt,qt,Tn){for(var ir=qt-1,Cr=bt.length;++ir<Cr;)if(Tn(bt[ir],zt))return ir;return-1}function Kr(bt){return bt!==bt}function Ms(bt,zt){var qt=bt==null?0:bt.length;return qt?Vr(bt,zt)/qt:ee}function ei(bt){return function(zt){return zt==null?n:zt[bt]}}function Tt(bt){return function(zt){return bt==null?n:bt[zt]}}function sr(bt,zt,qt,Tn,ir){return ir(bt,function(Cr,Ar,ps){qt=Tn?(Tn=!1,Cr):zt(qt,Cr,Ar,ps)}),qt}function mr(bt,zt){var qt=bt.length;for(bt.sort(zt);qt--;)bt[qt]=bt[qt].value;return bt}function Vr(bt,zt){for(var qt,Tn=-1,ir=bt.length;++Tn<ir;){var Cr=zt(bt[Tn]);Cr!==n&&(qt=qt===n?Cr:qt+Cr)}return qt}function as(bt,zt){for(var qt=-1,Tn=Array(bt);++qt<bt;)Tn[qt]=zt(qt);return Tn}function ns(bt,zt){return Ir(zt,function(qt){return[qt,bt[qt]]})}function ys(bt){return bt&&bt.slice(0,le(bt)+1).replace(ln,"")}function Ns(bt){return function(zt){return bt(zt)}}function ca(bt,zt){return Ir(zt,function(qt){return bt[qt]})}function Hs(bt,zt){return bt.has(zt)}function vs(bt,zt){for(var qt=-1,Tn=bt.length;++qt<Tn&&cr(zt,bt[qt],0)>-1;);return qt}function sc(bt,zt){for(var qt=bt.length;qt--&&cr(zt,bt[qt],0)>-1;);return qt}function j5(bt,zt){for(var qt=bt.length,Tn=0;qt--;)bt[qt]===zt&&++Tn;return Tn}var E1=Tt(er),E5=Tt(gr);function y2(bt){return"\\"+Fs[bt]}function Bl(bt,zt){return bt==null?n:bt[zt]}function vm(bt){return fr.test(bt)}function v2(bt){return ur.test(bt)}function cx(bt){for(var zt,qt=[];!(zt=bt.next()).done;)qt.push(zt.value);return qt}function Ii(bt){var zt=-1,qt=Array(bt.size);return bt.forEach(function(Tn,ir){qt[++zt]=[ir,Tn]}),qt}function wm(bt,zt){return function(qt){return bt(zt(qt))}}function ut(bt,zt){for(var qt=-1,Tn=bt.length,ir=0,Cr=[];++qt<Tn;){var Ar=bt[qt];(Ar===zt||Ar===d)&&(bt[qt]=d,Cr[ir++]=qt)}return Cr}function y(bt){var zt=-1,qt=Array(bt.size);return bt.forEach(function(Tn){qt[++zt]=Tn}),qt}function E(bt){var zt=-1,qt=Array(bt.size);return bt.forEach(function(Tn){qt[++zt]=[Tn,Tn]}),qt}function O(bt,zt,qt){for(var Tn=qt-1,ir=bt.length;++Tn<ir;)if(bt[Tn]===zt)return Tn;return-1}function $(bt,zt,qt){for(var Tn=qt+1;Tn--;)if(bt[Tn]===zt)return Tn;return Tn}function H(bt){return vm(bt)?Te(bt):En(bt)}function K(bt){return vm(bt)?Ze(bt):Rn(bt)}function le(bt){for(var zt=bt.length;zt--&&Oe.test(bt.charAt(zt)););return zt}var ve=Tt(dr);function Te(bt){for(var zt=wn.lastIndex=0;wn.test(bt);)++zt;return zt}function Ze(bt){return bt.match(wn)||[]}function ht(bt){return bt.match(Gn)||[]}var _t=function bt(zt){zt=zt==null?Zr:rn.defaults(Zr.Object(),zt,rn.pick(Zr,$t));var qt=zt.Array,Tn=zt.Date,ir=zt.Error,Cr=zt.Function,Ar=zt.Math,ps=zt.Object,Ws=zt.RegExp,ic=zt.String,Ya=zt.TypeError,Xa=qt.prototype,ua=Cr.prototype,Sa=ps.prototype,Uo=zt["__core-js_shared__"],hd=ua.toString,_i=Sa.hasOwnProperty,Cm=0,_1=function(){var D=/[^.]+$/.exec(Uo&&Uo.keys&&Uo.keys.IE_PROTO||"");return D?"Symbol(src)_1."+D:""}(),w2=Sa.toString,_5=hd.call(ps),NT=Zr._,AT=Ws("^"+hd.call(_i).replace(Jn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C2=la?zt.Buffer:n,lp=zt.Symbol,S2=zt.Uint8Array,u8=C2?C2.allocUnsafe:n,af=wm(ps.getPrototypeOf,ps),k5=ps.create,T5=Sa.propertyIsEnumerable,I5=Xa.splice,jT=lp?lp.isConcatSpreadable:n,cp=lp?lp.iterator:n,ux=lp?lp.toStringTag:n,N2=function(){try{var D=Fm(ps,"defineProperty");return D({},"",{}),D}catch{}}(),ET=zt.clearTimeout!==Zr.clearTimeout&&zt.clearTimeout,za=Tn&&Tn.now!==Zr.Date.now&&Tn.now,d8=zt.setTimeout!==Zr.setTimeout&&zt.setTimeout,dx=Ar.ceil,Sm=Ar.floor,P5=ps.getOwnPropertySymbols,f8=C2?C2.isBuffer:n,k1=zt.isFinite,F5=Xa.join,T1=wm(ps.keys,ps),zo=Ar.max,ac=Ar.min,kU=Tn.now,_T=zt.parseInt,A2=Ar.random,O5=Xa.reverse,j2=Fm(zt,"DataView"),fx=Fm(zt,"Map"),E2=Fm(zt,"Promise"),Nm=Fm(zt,"Set"),_2=Fm(zt,"WeakMap"),I1=Fm(ps,"create"),M5=_2&&new _2,P1={},h8=Om(j2),Am=Om(fx),kT=Om(E2),F1=Om(Nm),Gf=Om(_2),jm=lp?lp.prototype:n,Mu=jm?jm.valueOf:n,R5=jm?jm.toString:n;function Mt(D){if(Vo(D)&&!yi(D)&&!(D instanceof bi)){if(D instanceof oc)return D;if(_i.call(D,"__wrapped__"))return rI(D)}return new oc(D)}var O1=function(){function D(){}return function(W){if(!Fo(W))return{};if(k5)return k5(W);D.prototype=W;var ge=new D;return D.prototype=n,ge}}();function Kf(){}function oc(D,W){this.__wrapped__=D,this.__actions__=[],this.__chain__=!!W,this.__index__=0,this.__values__=n}Mt.templateSettings={escape:_n,evaluate:kn,interpolate:vn,variable:"",imports:{_:Mt}},Mt.prototype=Kf.prototype,Mt.prototype.constructor=Mt,oc.prototype=O1(Kf.prototype),oc.prototype.constructor=oc;function bi(D){this.__wrapped__=D,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ae,this.__views__=[]}function L5(){var D=new bi(this.__wrapped__);return D.__actions__=Mc(this.__actions__),D.__dir__=this.__dir__,D.__filtered__=this.__filtered__,D.__iteratees__=Mc(this.__iteratees__),D.__takeCount__=this.__takeCount__,D.__views__=Mc(this.__views__),D}function p8(){if(this.__filtered__){var D=new bi(this);D.__dir__=-1,D.__filtered__=!0}else D=this.clone(),D.__dir__*=-1;return D}function M1(){var D=this.__wrapped__.value(),W=this.__dir__,ge=yi(D),ze=W<0,mt=ge?D.length:0,Gt=z8(0,mt,this.__views__),bn=Gt.start,On=Gt.end,Wn=On-bn,kr=ze?On:bn-1,Tr=this.__iteratees__,Br=Tr.length,ss=0,Ts=ac(Wn,this.__takeCount__);if(!ge||!ze&&mt==Wn&&Ts==Wn)return H1(D,this.__actions__);var qs=[];e:for(;Wn--&&ss<Ts;){kr+=W;for(var Pi=-1,Gs=D[kr];++Pi<Br;){var zi=Tr[Pi],Gi=zi.iteratee,xf=zi.type,$u=Gi(Gs);if(xf==Y)Gs=$u;else if(!$u){if(xf==he)continue e;break e}}qs[ss++]=Gs}return qs}bi.prototype=O1(Kf.prototype),bi.prototype.constructor=bi;function su(D){var W=-1,ge=D==null?0:D.length;for(this.clear();++W<ge;){var ze=D[W];this.set(ze[0],ze[1])}}function Ha(){this.__data__=I1?I1(null):{},this.size=0}function Ra(D){var W=this.has(D)&&delete this.__data__[D];return this.size-=W?1:0,W}function Em(D){var W=this.__data__;if(I1){var ge=W[D];return ge===c?n:ge}return _i.call(W,D)?W[D]:n}function lc(D){var W=this.__data__;return I1?W[D]!==n:_i.call(W,D)}function iu(D,W){var ge=this.__data__;return this.size+=this.has(D)?0:1,ge[D]=I1&&W===n?c:W,this}su.prototype.clear=Ha,su.prototype.delete=Ra,su.prototype.get=Em,su.prototype.has=lc,su.prototype.set=iu;function Oc(D){var W=-1,ge=D==null?0:D.length;for(this.clear();++W<ge;){var ze=D[W];this.set(ze[0],ze[1])}}function R1(){this.__data__=[],this.size=0}function au(D){var W=this.__data__,ge=uc(W,D);if(ge<0)return!1;var ze=W.length-1;return ge==ze?W.pop():I5.call(W,ge,1),--this.size,!0}function D5(D){var W=this.__data__,ge=uc(W,D);return ge<0?n:W[ge][1]}function TT(D){return uc(this.__data__,D)>-1}function IT(D,W){var ge=this.__data__,ze=uc(ge,D);return ze<0?(++this.size,ge.push([D,W])):ge[ze][1]=W,this}Oc.prototype.clear=R1,Oc.prototype.delete=au,Oc.prototype.get=D5,Oc.prototype.has=TT,Oc.prototype.set=IT;function pd(D){var W=-1,ge=D==null?0:D.length;for(this.clear();++W<ge;){var ze=D[W];this.set(ze[0],ze[1])}}function PT(){this.size=0,this.__data__={hash:new su,map:new(fx||Oc),string:new su}}function up(D){var W=V2(this,D).delete(D);return this.size-=W?1:0,W}function B5(D){return V2(this,D).get(D)}function m8(D){return V2(this,D).has(D)}function FT(D,W){var ge=V2(this,D),ze=ge.size;return ge.set(D,W),this.size+=ge.size==ze?0:1,this}pd.prototype.clear=PT,pd.prototype.delete=up,pd.prototype.get=B5,pd.prototype.has=m8,pd.prototype.set=FT;function hx(D){var W=-1,ge=D==null?0:D.length;for(this.__data__=new pd;++W<ge;)this.add(D[W])}function _m(D){return this.__data__.set(D,c),this}function L1(D){return this.__data__.has(D)}hx.prototype.add=hx.prototype.push=_m,hx.prototype.has=L1;function cc(D){var W=this.__data__=new Oc(D);this.size=W.size}function $5(){this.__data__=new Oc,this.size=0}function U5(D){var W=this.__data__,ge=W.delete(D);return this.size=W.size,ge}function md(D){return this.__data__.get(D)}function xd(D){return this.__data__.has(D)}function px(D,W){var ge=this.__data__;if(ge instanceof Oc){var ze=ge.__data__;if(!fx||ze.length<s-1)return ze.push([D,W]),this.size=++ge.size,this;ge=this.__data__=new pd(ze)}return ge.set(D,W),this.size=ge.size,this}cc.prototype.clear=$5,cc.prototype.delete=U5,cc.prototype.get=md,cc.prototype.has=xd,cc.prototype.set=px;function Yf(D,W){var ge=yi(D),ze=!ge&&nv(D),mt=!ge&&!ze&&J1(D),Gt=!ge&&!ze&&!mt&&P6(D),bn=ge||ze||mt||Gt,On=bn?as(D.length,ic):[],Wn=On.length;for(var kr in D)(W||_i.call(D,kr))&&!(bn&&(kr=="length"||mt&&(kr=="offset"||kr=="parent")||Gt&&(kr=="buffer"||kr=="byteLength"||kr=="byteOffset")||Za(kr,Wn)))&&On.push(kr);return On}function Xf(D){var W=D.length;return W?D[U1(0,W-1)]:n}function mx(D,W){return h6(Mc(D),dp(W,0,D.length))}function OT(D){return h6(Mc(D))}function k2(D,W,ge){(ge!==n&&!wp(D[W],ge)||ge===n&&!(W in D))&&Qf(D,W,ge)}function xx(D,W,ge){var ze=D[W];(!(_i.call(D,W)&&wp(ze,ge))||ge===n&&!(W in D))&&Qf(D,W,ge)}function uc(D,W){for(var ge=D.length;ge--;)if(wp(D[ge][0],W))return ge;return-1}function Ru(D,W,ge,ze){return Jf(D,function(mt,Gt,bn){W(ze,mt,ge(mt),bn)}),ze}function Va(D,W){return D&&lf(W,hc(W),D)}function of(D,W){return D&&lf(W,Ad(W),D)}function Qf(D,W,ge){W=="__proto__"&&N2?N2(D,W,{configurable:!0,enumerable:!0,value:ge,writable:!0}):D[W]=ge}function z5(D,W){for(var ge=-1,ze=W.length,mt=qt(ze),Gt=D==null;++ge<ze;)mt[ge]=Gt?n:QU(D,W[ge]);return mt}function dp(D,W,ge){return D===D&&(ge!==n&&(D=D<=ge?D:ge),W!==n&&(D=D>=W?D:W)),D}function ou(D,W,ge,ze,mt,Gt){var bn,On=W&f,Wn=W&x,kr=W&g;if(ge&&(bn=mt?ge(D,ze,mt,Gt):ge(D)),bn!==n)return bn;if(!Fo(D))return D;var Tr=yi(D);if(Tr){if(bn=q2(D),!On)return Mc(D,bn)}else{var Br=zl(D),ss=Br==Be||Br==it;if(J1(D))return T8(D,On);if(Br==ct||Br==ye||ss&&!mt){if(bn=Wn||ss?{}:Hl(D),!On)return Wn?IU(D,of(bn,D)):t6(D,Va(bn,D))}else{if(!lr[Br])return mt?D:{};bn=PU(D,Br,On)}}Gt||(Gt=new cc);var Ts=Gt.get(D);if(Ts)return Ts;Gt.set(D,bn),Zue(D)?D.forEach(function(Gs){bn.add(ou(Gs,W,ge,Gs,D,Gt))}):Xue(D)&&D.forEach(function(Gs,zi){bn.set(zi,ou(Gs,W,ge,zi,D,Gt))});var qs=kr?Wn?H2:z2:Wn?Ad:hc,Pi=Tr?n:qs(D);return wr(Pi||D,function(Gs,zi){Pi&&(zi=Gs,Gs=D[zi]),xx(bn,zi,ou(Gs,W,ge,zi,D,Gt))}),bn}function MT(D){var W=hc(D);return function(ge){return T2(ge,D,W)}}function T2(D,W,ge){var ze=ge.length;if(D==null)return!ze;for(D=ps(D);ze--;){var mt=ge[ze],Gt=W[mt],bn=D[mt];if(bn===n&&!(mt in D)||!Gt(bn))return!1}return!0}function x8(D,W,ge){if(typeof D!="function")throw new Ya(o);return X1(function(){D.apply(n,ge)},W)}function Zf(D,W,ge,ze){var mt=-1,Gt=Lr,bn=!0,On=D.length,Wn=[],kr=W.length;if(!On)return Wn;ge&&(W=Ir(W,Ns(ge))),ze?(Gt=Qr,bn=!1):W.length>=s&&(Gt=Hs,bn=!1,W=new hx(W));e:for(;++mt<On;){var Tr=D[mt],Br=ge==null?Tr:ge(Tr);if(Tr=ze||Tr!==0?Tr:0,bn&&Br===Br){for(var ss=kr;ss--;)if(W[ss]===Br)continue e;Wn.push(Tr)}else Gt(W,Br,ze)||Wn.push(Tr)}return Wn}var Jf=wd(Lu),RT=wd(km,!0);function I2(D,W){var ge=!0;return Jf(D,function(ze,mt,Gt){return ge=!!W(ze,mt,Gt),ge}),ge}function gx(D,W,ge){for(var ze=-1,mt=D.length;++ze<mt;){var Gt=D[ze],bn=W(Gt);if(bn!=null&&(On===n?bn===bn&&!mf(bn):ge(bn,On)))var On=bn,Wn=Gt}return Wn}function LT(D,W,ge,ze){var mt=D.length;for(ge=Ti(ge),ge<0&&(ge=-ge>mt?0:mt+ge),ze=ze===n||ze>mt?mt:Ti(ze),ze<0&&(ze+=mt),ze=ge>ze?0:ede(ze);ge<ze;)D[ge++]=W;return D}function g8(D,W){var ge=[];return Jf(D,function(ze,mt,Gt){W(ze,mt,Gt)&&ge.push(ze)}),ge}function vo(D,W,ge,ze,mt){var Gt=-1,bn=D.length;for(ge||(ge=u6),mt||(mt=[]);++Gt<bn;){var On=D[Gt];W>0&&ge(On)?W>1?vo(On,W-1,ge,ze,mt):Ss(mt,On):ze||(mt[mt.length]=On)}return mt}var H5=r6(),P2=r6(!0);function Lu(D,W){return D&&H5(D,W,hc)}function km(D,W){return D&&P2(D,W,hc)}function D1(D,W){return ts(W,function(ge){return kx(D[ge])})}function fp(D,W){W=nh(W,D);for(var ge=0,ze=W.length;D!=null&&ge<ze;)D=D[ff(W[ge++])];return ge&&ge==ze?D:n}function V5(D,W,ge){var ze=W(D);return yi(D)?ze:Ss(ze,ge(D))}function $l(D){return D==null?D===n?Pt:dt:ux&&ux in ps(D)?c6(D):V8(D)}function Tm(D,W){return D>W}function gd(D,W){return D!=null&&_i.call(D,W)}function bx(D,W){return D!=null&&W in ps(D)}function b8(D,W,ge){return D>=ac(W,ge)&&D<zo(W,ge)}function W5(D,W,ge){for(var ze=ge?Qr:Lr,mt=D[0].length,Gt=D.length,bn=Gt,On=qt(Gt),Wn=1/0,kr=[];bn--;){var Tr=D[bn];bn&&W&&(Tr=Ir(Tr,Ns(W))),Wn=ac(Tr.length,Wn),On[bn]=!ge&&(W||mt>=120&&Tr.length>=120)?new hx(bn&&Tr):n}Tr=D[0];var Br=-1,ss=On[0];e:for(;++Br<mt&&kr.length<Wn;){var Ts=Tr[Br],qs=W?W(Ts):Ts;if(Ts=ge||Ts!==0?Ts:0,!(ss?Hs(ss,qs):ze(kr,qs,ge))){for(bn=Gt;--bn;){var Pi=On[bn];if(!(Pi?Hs(Pi,qs):ze(D[bn],qs,ge)))continue e}ss&&ss.push(qs),kr.push(Ts)}}return kr}function hp(D,W,ge,ze){return Lu(D,function(mt,Gt,bn){W(ze,ge(mt),Gt,bn)}),ze}function bd(D,W,ge){W=nh(W,D),D=Sl(D,W);var ze=D==null?D:D[ff(Dc(W))];return ze==null?n:or(ze,D,ge)}function q5(D){return Vo(D)&&$l(D)==ye}function DT(D){return Vo(D)&&$l(D)==Yt}function pp(D){return Vo(D)&&$l(D)==Ie}function yd(D,W,ge,ze,mt){return D===W?!0:D==null||W==null||!Vo(D)&&!Vo(W)?D!==D&&W!==W:G5(D,W,ge,ze,yd,mt)}function G5(D,W,ge,ze,mt,Gt){var bn=yi(D),On=yi(W),Wn=bn?Ne:zl(D),kr=On?Ne:zl(W);Wn=Wn==ye?ct:Wn,kr=kr==ye?ct:kr;var Tr=Wn==ct,Br=kr==ct,ss=Wn==kr;if(ss&&J1(D)){if(!J1(W))return!1;bn=!0,Tr=!1}if(ss&&!Tr)return Gt||(Gt=new cc),bn||P6(D)?$8(D,W,ge,ze,mt,Gt):U8(D,W,Wn,ge,ze,mt,Gt);if(!(ge&v)){var Ts=Tr&&_i.call(D,"__wrapped__"),qs=Br&&_i.call(W,"__wrapped__");if(Ts||qs){var Pi=Ts?D.value():D,Gs=qs?W.value():W;return Gt||(Gt=new cc),mt(Pi,Gs,ge,ze,Gt)}}return ss?(Gt||(Gt=new cc),YT(D,W,ge,ze,mt,Gt)):!1}function BT(D){return Vo(D)&&zl(D)==tt}function B1(D,W,ge,ze){var mt=ge.length,Gt=mt,bn=!ze;if(D==null)return!Gt;for(D=ps(D);mt--;){var On=ge[mt];if(bn&&On[2]?On[1]!==D[On[0]]:!(On[0]in D))return!1}for(;++mt<Gt;){On=ge[mt];var Wn=On[0],kr=D[Wn],Tr=On[1];if(bn&&On[2]){if(kr===n&&!(Wn in D))return!1}else{var Br=new cc;if(ze)var ss=ze(kr,Tr,Wn,D,W,Br);if(!(ss===n?yd(Tr,kr,v|w,ze,Br):ss))return!1}}return!0}function y8(D){if(!Fo(D)||ZT(D))return!1;var W=kx(D)?AT:tr;return W.test(Om(D))}function F2(D){return Vo(D)&&$l(D)==tn}function eh(D){return Vo(D)&&zl(D)==jt}function O2(D){return Vo(D)&&gI(D.length)&&!!Vn[$l(D)]}function $1(D){return typeof D=="function"?D:D==null?jd:typeof D=="object"?yi(D)?Qa(D[0],D[1]):K5(D):dde(D)}function mp(D){if(!yp(D))return T1(D);var W=[];for(var ge in ps(D))_i.call(D,ge)&&ge!="constructor"&&W.push(ge);return W}function v8(D){if(!Fo(D))return tI(D);var W=yp(D),ge=[];for(var ze in D)ze=="constructor"&&(W||!_i.call(D,ze))||ge.push(ze);return ge}function Im(D,W){return D<W}function w8(D,W){var ge=-1,ze=Nd(D)?qt(D.length):[];return Jf(D,function(mt,Gt,bn){ze[++ge]=W(mt,Gt,bn)}),ze}function K5(D){var W=W2(D);return W.length==1&&W[0][2]?d6(W[0][0],W[0][1]):function(ge){return ge===D||B1(ge,D,W)}}function Qa(D,W){return ds(D)&&K2(W)?d6(ff(D),W):function(ge){var ze=QU(ge,D);return ze===n&&ze===W?ZU(ge,D):yd(W,ze,v|w)}}function yx(D,W,ge,ze,mt){D!==W&&H5(W,function(Gt,bn){if(mt||(mt=new cc),Fo(Gt))C8(D,W,bn,ge,yx,ze,mt);else{var On=ze?ze(ih(D,bn),Gt,bn+"",D,W,mt):n;On===n&&(On=Gt),k2(D,bn,On)}},Ad)}function C8(D,W,ge,ze,mt,Gt,bn){var On=ih(D,ge),Wn=ih(W,ge),kr=bn.get(Wn);if(kr){k2(D,ge,kr);return}var Tr=Gt?Gt(On,Wn,ge+"",D,W,bn):n,Br=Tr===n;if(Br){var ss=yi(Wn),Ts=!ss&&J1(Wn),qs=!ss&&!Ts&&P6(Wn);Tr=Wn,ss||Ts||qs?yi(On)?Tr=On:ll(On)?Tr=Mc(On):Ts?(Br=!1,Tr=T8(Wn,!0)):qs?(Br=!1,Tr=VT(Wn,!0)):Tr=[]:l7(Wn)||nv(Wn)?(Tr=On,nv(On)?Tr=tde(On):(!Fo(On)||kx(On))&&(Tr=Hl(Wn))):Br=!1}Br&&(bn.set(Wn,Tr),mt(Tr,Wn,ze,Gt,bn),bn.delete(Wn)),k2(D,ge,Tr)}function Y5(D,W){var ge=D.length;if(ge)return W+=W<0?ge:0,Za(W,ge)?D[W]:n}function M2(D,W,ge){W.length?W=Ir(W,function(Gt){return yi(Gt)?function(bn){return fp(bn,Gt.length===1?Gt[0]:Gt)}:Gt}):W=[jd];var ze=-1;W=Ir(W,Ns($s()));var mt=w8(D,function(Gt,bn,On){var Wn=Ir(W,function(kr){return kr(Gt)});return{criteria:Wn,index:++ze,value:Gt}});return mr(mt,function(Gt,bn){return TU(Gt,bn,ge)})}function S8(D,W){return Pm(D,W,function(ge,ze){return ZU(D,ze)})}function Pm(D,W,ge){for(var ze=-1,mt=W.length,Gt={};++ze<mt;){var bn=W[ze],On=fp(D,bn);ge(On,bn)&&wx(Gt,nh(bn,D),On)}return Gt}function lo(D){return function(W){return fp(W,D)}}function Po(D,W,ge,ze){var mt=ze?bs:cr,Gt=-1,bn=W.length,On=D;for(D===W&&(W=Mc(W)),ge&&(On=Ir(D,Ns(ge)));++Gt<bn;)for(var Wn=0,kr=W[Gt],Tr=ge?ge(kr):kr;(Wn=mt(On,Tr,Wn,ze))>-1;)On!==D&&I5.call(On,Wn,1),I5.call(D,Wn,1);return D}function il(D,W){for(var ge=D?W.length:0,ze=ge-1;ge--;){var mt=W[ge];if(ge==ze||mt!==Gt){var Gt=mt;Za(mt)?I5.call(D,mt,1):Z5(D,mt)}}return D}function U1(D,W){return D+Sm(A2()*(W-D+1))}function R2(D,W,ge,ze){for(var mt=-1,Gt=zo(dx((W-D)/(ge||1)),0),bn=qt(Gt);Gt--;)bn[ze?Gt:++mt]=D,D+=ge;return bn}function vx(D,W){var ge="";if(!D||W<1||W>G)return ge;do W%2&&(ge+=D),W=Sm(W/2),W&&(D+=D);while(W);return ge}function ki(D,W){return Du(f6(D,W,jd),D+"")}function dc(D){return Xf(F6(D))}function N8(D,W){var ge=F6(D);return h6(ge,dp(W,0,ge.length))}function wx(D,W,ge,ze){if(!Fo(D))return D;W=nh(W,D);for(var mt=-1,Gt=W.length,bn=Gt-1,On=D;On!=null&&++mt<Gt;){var Wn=ff(W[mt]),kr=ge;if(Wn==="__proto__"||Wn==="constructor"||Wn==="prototype")return D;if(mt!=bn){var Tr=On[Wn];kr=ze?ze(Tr,Wn,On):n,kr===n&&(kr=Fo(Tr)?Tr:Za(W[mt+1])?[]:{})}xx(On,Wn,kr),On=On[Wn]}return D}var X5=M5?function(D,W){return M5.set(D,W),D}:jd,th=N2?function(D,W){return N2(D,"toString",{configurable:!0,enumerable:!1,value:ez(W),writable:!0})}:jd;function vd(D){return h6(F6(D))}function fc(D,W,ge){var ze=-1,mt=D.length;W<0&&(W=-W>mt?0:mt+W),ge=ge>mt?mt:ge,ge<0&&(ge+=mt),mt=W>ge?0:ge-W>>>0,W>>>=0;for(var Gt=qt(mt);++ze<mt;)Gt[ze]=D[ze+W];return Gt}function A8(D,W){var ge;return Jf(D,function(ze,mt,Gt){return ge=W(ze,mt,Gt),!ge}),!!ge}function z1(D,W,ge){var ze=0,mt=D==null?ze:D.length;if(typeof W=="number"&&W===W&&mt<=Ae){for(;ze<mt;){var Gt=ze+mt>>>1,bn=D[Gt];bn!==null&&!mf(bn)&&(ge?bn<=W:bn<W)?ze=Gt+1:mt=Gt}return mt}return Q5(D,W,jd,ge)}function Q5(D,W,ge,ze){var mt=0,Gt=D==null?0:D.length;if(Gt===0)return 0;W=ge(W);for(var bn=W!==W,On=W===null,Wn=mf(W),kr=W===n;mt<Gt;){var Tr=Sm((mt+Gt)/2),Br=ge(D[Tr]),ss=Br!==n,Ts=Br===null,qs=Br===Br,Pi=mf(Br);if(bn)var Gs=ze||qs;else kr?Gs=qs&&(ze||ss):On?Gs=qs&&ss&&(ze||!Ts):Wn?Gs=qs&&ss&&!Ts&&(ze||!Pi):Ts||Pi?Gs=!1:Gs=ze?Br<=W:Br<W;Gs?mt=Tr+1:Gt=Tr}return ac(Gt,fe)}function j8(D,W){for(var ge=-1,ze=D.length,mt=0,Gt=[];++ge<ze;){var bn=D[ge],On=W?W(bn):bn;if(!ge||!wp(On,Wn)){var Wn=On;Gt[mt++]=bn===0?0:bn}}return Gt}function E8(D){return typeof D=="number"?D:mf(D)?ee:+D}function lu(D){if(typeof D=="string")return D;if(yi(D))return Ir(D,lu)+"";if(mf(D))return R5?R5.call(D):"";var W=D+"";return W=="0"&&1/D==-1/0?"-0":W}function xp(D,W,ge){var ze=-1,mt=Lr,Gt=D.length,bn=!0,On=[],Wn=On;if(ge)bn=!1,mt=Qr;else if(Gt>=s){var kr=W?null:KT(D);if(kr)return y(kr);bn=!1,mt=Hs,Wn=new hx}else Wn=W?[]:On;e:for(;++ze<Gt;){var Tr=D[ze],Br=W?W(Tr):Tr;if(Tr=ge||Tr!==0?Tr:0,bn&&Br===Br){for(var ss=Wn.length;ss--;)if(Wn[ss]===Br)continue e;W&&Wn.push(Br),On.push(Tr)}else mt(Wn,Br,ge)||(Wn!==On&&Wn.push(Br),On.push(Tr))}return On}function Z5(D,W){return W=nh(W,D),D=Sl(D,W),D==null||delete D[ff(Dc(W))]}function _8(D,W,ge,ze){return wx(D,W,ge(fp(D,W)),ze)}function L2(D,W,ge,ze){for(var mt=D.length,Gt=ze?mt:-1;(ze?Gt--:++Gt<mt)&&W(D[Gt],Gt,D););return ge?fc(D,ze?0:Gt,ze?Gt+1:mt):fc(D,ze?Gt+1:0,ze?mt:Gt)}function H1(D,W){var ge=D;return ge instanceof bi&&(ge=ge.value()),hi(W,function(ze,mt){return mt.func.apply(mt.thisArg,Ss([ze],mt.args))},ge)}function J5(D,W,ge){var ze=D.length;if(ze<2)return ze?xp(D[0]):[];for(var mt=-1,Gt=qt(ze);++mt<ze;)for(var bn=D[mt],On=-1;++On<ze;)On!=mt&&(Gt[mt]=Zf(Gt[mt]||bn,D[On],W,ge));return xp(vo(Gt,1),W,ge)}function D2(D,W,ge){for(var ze=-1,mt=D.length,Gt=W.length,bn={};++ze<mt;){var On=ze<Gt?W[ze]:n;ge(bn,D[ze],On)}return bn}function V1(D){return ll(D)?D:[]}function e6(D){return typeof D=="function"?D:jd}function nh(D,W){return yi(D)?D:ds(D,W)?[D]:G8(Na(D))}var $T=ki;function gp(D,W,ge){var ze=D.length;return ge=ge===n?ze:ge,!W&&ge>=ze?D:fc(D,W,ge)}var k8=ET||function(D){return Zr.clearTimeout(D)};function T8(D,W){if(W)return D.slice();var ge=D.length,ze=u8?u8(ge):new D.constructor(ge);return D.copy(ze),ze}function B2(D){var W=new D.constructor(D.byteLength);return new S2(W).set(new S2(D)),W}function UT(D,W){var ge=W?B2(D.buffer):D.buffer;return new D.constructor(ge,D.byteOffset,D.byteLength)}function zT(D){var W=new D.constructor(D.source,Pn.exec(D));return W.lastIndex=D.lastIndex,W}function HT(D){return Mu?ps(Mu.call(D)):{}}function VT(D,W){var ge=W?B2(D.buffer):D.buffer;return new D.constructor(ge,D.byteOffset,D.length)}function I8(D,W){if(D!==W){var ge=D!==n,ze=D===null,mt=D===D,Gt=mf(D),bn=W!==n,On=W===null,Wn=W===W,kr=mf(W);if(!On&&!kr&&!Gt&&D>W||Gt&&bn&&Wn&&!On&&!kr||ze&&bn&&Wn||!ge&&Wn||!mt)return 1;if(!ze&&!Gt&&!kr&&D<W||kr&&ge&&mt&&!ze&&!Gt||On&&ge&&mt||!bn&&mt||!Wn)return-1}return 0}function TU(D,W,ge){for(var ze=-1,mt=D.criteria,Gt=W.criteria,bn=mt.length,On=ge.length;++ze<bn;){var Wn=I8(mt[ze],Gt[ze]);if(Wn){if(ze>=On)return Wn;var kr=ge[ze];return Wn*(kr=="desc"?-1:1)}}return D.index-W.index}function WT(D,W,ge,ze){for(var mt=-1,Gt=D.length,bn=ge.length,On=-1,Wn=W.length,kr=zo(Gt-bn,0),Tr=qt(Wn+kr),Br=!ze;++On<Wn;)Tr[On]=W[On];for(;++mt<bn;)(Br||mt<Gt)&&(Tr[ge[mt]]=D[mt]);for(;kr--;)Tr[On++]=D[mt++];return Tr}function P8(D,W,ge,ze){for(var mt=-1,Gt=D.length,bn=-1,On=ge.length,Wn=-1,kr=W.length,Tr=zo(Gt-On,0),Br=qt(Tr+kr),ss=!ze;++mt<Tr;)Br[mt]=D[mt];for(var Ts=mt;++Wn<kr;)Br[Ts+Wn]=W[Wn];for(;++bn<On;)(ss||mt<Gt)&&(Br[Ts+ge[bn]]=D[mt++]);return Br}function Mc(D,W){var ge=-1,ze=D.length;for(W||(W=qt(ze));++ge<ze;)W[ge]=D[ge];return W}function lf(D,W,ge,ze){var mt=!ge;ge||(ge={});for(var Gt=-1,bn=W.length;++Gt<bn;){var On=W[Gt],Wn=ze?ze(ge[On],D[On],On,ge,D):n;Wn===n&&(Wn=D[On]),mt?Qf(ge,On,Wn):xx(ge,On,Wn)}return ge}function t6(D,W){return lf(D,cf(D),W)}function IU(D,W){return lf(D,XT(D),W)}function n6(D,W){return function(ge,ze){var mt=yi(ge)?_r:Ru,Gt=W?W():{};return mt(ge,D,$s(ze,2),Gt)}}function W1(D){return ki(function(W,ge){var ze=-1,mt=ge.length,Gt=mt>1?ge[mt-1]:n,bn=mt>2?ge[2]:n;for(Gt=D.length>3&&typeof Gt=="function"?(mt--,Gt):n,bn&&Lc(ge[0],ge[1],bn)&&(Gt=mt<3?n:Gt,mt=1),W=ps(W);++ze<mt;){var On=ge[ze];On&&D(W,On,ze,Gt)}return W})}function wd(D,W){return function(ge,ze){if(ge==null)return ge;if(!Nd(ge))return D(ge,ze);for(var mt=ge.length,Gt=W?mt:-1,bn=ps(ge);(W?Gt--:++Gt<mt)&&ze(bn[Gt],Gt,bn)!==!1;);return ge}}function r6(D){return function(W,ge,ze){for(var mt=-1,Gt=ps(W),bn=ze(W),On=bn.length;On--;){var Wn=bn[D?On:++mt];if(ge(Gt[Wn],Wn,Gt)===!1)break}return W}}function s6(D,W,ge){var ze=W&C,mt=q1(D);function Gt(){var bn=this&&this!==Zr&&this instanceof Gt?mt:D;return bn.apply(ze?ge:this,arguments)}return Gt}function F8(D){return function(W){W=Na(W);var ge=vm(W)?K(W):n,ze=ge?ge[0]:W.charAt(0),mt=ge?gp(ge,1).join(""):W.slice(1);return ze[D]()+mt}}function Cx(D){return function(W){return hi(cde(lde(W).replace(vt,"")),D,"")}}function q1(D){return function(){var W=arguments;switch(W.length){case 0:return new D;case 1:return new D(W[0]);case 2:return new D(W[0],W[1]);case 3:return new D(W[0],W[1],W[2]);case 4:return new D(W[0],W[1],W[2],W[3]);case 5:return new D(W[0],W[1],W[2],W[3],W[4]);case 6:return new D(W[0],W[1],W[2],W[3],W[4],W[5]);case 7:return new D(W[0],W[1],W[2],W[3],W[4],W[5],W[6])}var ge=O1(D.prototype),ze=D.apply(ge,W);return Fo(ze)?ze:ge}}function O8(D,W,ge){var ze=q1(D);function mt(){for(var Gt=arguments.length,bn=qt(Gt),On=Gt,Wn=bp(mt);On--;)bn[On]=arguments[On];var kr=Gt<3&&bn[0]!==Wn&&bn[Gt-1]!==Wn?[]:ut(bn,Wn);if(Gt-=kr.length,Gt<ge)return Rc(D,W,G1,mt.placeholder,n,bn,kr,n,n,ge-Gt);var Tr=this&&this!==Zr&&this instanceof mt?ze:D;return or(Tr,this,bn)}return mt}function Sx(D){return function(W,ge,ze){var mt=ps(W);if(!Nd(W)){var Gt=$s(ge,3);W=hc(W),ge=function(On){return Gt(mt[On],On,mt)}}var bn=D(W,ge,ze);return bn>-1?mt[Gt?W[bn]:bn]:n}}function i6(D){return sh(function(W){var ge=W.length,ze=ge,mt=oc.prototype.thru;for(D&&W.reverse();ze--;){var Gt=W[ze];if(typeof Gt!="function")throw new Ya(o);if(mt&&!bn&&K1(Gt)=="wrapper")var bn=new oc([],!0)}for(ze=bn?ze:ge;++ze<ge;){Gt=W[ze];var On=K1(Gt),Wn=On=="wrapper"?l6(Gt):n;Wn&&G2(Wn[0])&&Wn[1]==(L|P|F|z)&&!Wn[4].length&&Wn[9]==1?bn=bn[K1(Wn[0])].apply(bn,Wn[3]):bn=Gt.length==1&&G2(Gt)?bn[On]():bn.thru(Gt)}return function(){var kr=arguments,Tr=kr[0];if(bn&&kr.length==1&&yi(Tr))return bn.plant(Tr).value();for(var Br=0,ss=ge?W[Br].apply(this,kr):Tr;++Br<ge;)ss=W[Br].call(this,ss);return ss}})}function G1(D,W,ge,ze,mt,Gt,bn,On,Wn,kr){var Tr=W&L,Br=W&C,ss=W&N,Ts=W&(P|R),qs=W&X,Pi=ss?n:q1(D);function Gs(){for(var zi=arguments.length,Gi=qt(zi),xf=zi;xf--;)Gi[xf]=arguments[xf];if(Ts)var $u=bp(Gs),gf=j5(Gi,$u);if(ze&&(Gi=WT(Gi,ze,mt,Ts)),Gt&&(Gi=P8(Gi,Gt,bn,Ts)),zi-=gf,Ts&&zi<kr){var cl=ut(Gi,$u);return Rc(D,W,G1,Gs.placeholder,ge,Gi,cl,On,Wn,kr-zi)}var Cp=Br?ge:this,Ix=ss?Cp[D]:D;return zi=Gi.length,On?Gi=uf(Gi,On):qs&&zi>1&&Gi.reverse(),Tr&&Wn<zi&&(Gi.length=Wn),this&&this!==Zr&&this instanceof Gs&&(Ix=Pi||q1(Ix)),Ix.apply(Cp,Gi)}return Gs}function qT(D,W){return function(ge,ze){return hp(ge,D,W(ze),{})}}function $2(D,W){return function(ge,ze){var mt;if(ge===n&&ze===n)return W;if(ge!==n&&(mt=ge),ze!==n){if(mt===n)return ze;typeof ge=="string"||typeof ze=="string"?(ge=lu(ge),ze=lu(ze)):(ge=E8(ge),ze=E8(ze)),mt=D(ge,ze)}return mt}}function a6(D){return sh(function(W){return W=Ir(W,Ns($s())),ki(function(ge){var ze=this;return D(W,function(mt){return or(mt,ze,ge)})})})}function U2(D,W){W=W===n?" ":lu(W);var ge=W.length;if(ge<2)return ge?vx(W,D):W;var ze=vx(W,dx(D/H(W)));return vm(W)?gp(K(ze),0,D).join(""):ze.slice(0,D)}function GT(D,W,ge,ze){var mt=W&C,Gt=q1(D);function bn(){for(var On=-1,Wn=arguments.length,kr=-1,Tr=ze.length,Br=qt(Tr+Wn),ss=this&&this!==Zr&&this instanceof bn?Gt:D;++kr<Tr;)Br[kr]=ze[kr];for(;Wn--;)Br[kr++]=arguments[++On];return or(ss,mt?ge:this,Br)}return bn}function M8(D){return function(W,ge,ze){return ze&&typeof ze!="number"&&Lc(W,ge,ze)&&(ge=ze=n),W=Tx(W),ge===n?(ge=W,W=0):ge=Tx(ge),ze=ze===n?W<ge?1:-1:Tx(ze),R2(W,ge,ze,D)}}function o6(D){return function(W,ge){return typeof W=="string"&&typeof ge=="string"||(W=ah(W),ge=ah(ge)),D(W,ge)}}function Rc(D,W,ge,ze,mt,Gt,bn,On,Wn,kr){var Tr=W&P,Br=Tr?bn:n,ss=Tr?n:bn,Ts=Tr?Gt:n,qs=Tr?n:Gt;W|=Tr?F:U,W&=~(Tr?U:F),W&I||(W&=-4);var Pi=[D,W,mt,Ts,Br,qs,ss,On,Wn,kr],Gs=ge.apply(n,Pi);return G2(D)&&W8(Gs,Pi),Gs.placeholder=ze,q8(Gs,D,W)}function Ul(D){var W=Ar[D];return function(ge,ze){if(ge=ah(ge),ze=ze==null?0:ac(Ti(ze),292),ze&&k1(ge)){var mt=(Na(ge)+"e").split("e"),Gt=W(mt[0]+"e"+(+mt[1]+ze));return mt=(Na(Gt)+"e").split("e"),+(mt[0]+"e"+(+mt[1]-ze))}return W(ge)}}var KT=Nm&&1/y(new Nm([,-0]))[1]==oe?function(D){return new Nm(D)}:rz;function R8(D){return function(W){var ge=zl(W);return ge==tt?Ii(W):ge==jt?E(W):ns(W,D(W))}}function rh(D,W,ge,ze,mt,Gt,bn,On){var Wn=W&N;if(!Wn&&typeof D!="function")throw new Ya(o);var kr=ze?ze.length:0;if(kr||(W&=-97,ze=mt=n),bn=bn===n?bn:zo(Ti(bn),0),On=On===n?On:Ti(On),kr-=mt?mt.length:0,W&U){var Tr=ze,Br=mt;ze=mt=n}var ss=Wn?n:l6(D),Ts=[D,W,ge,ze,mt,Tr,Br,Gt,bn,On];if(ss&&eI(Ts,ss),D=Ts[0],W=Ts[1],ge=Ts[2],ze=Ts[3],mt=Ts[4],On=Ts[9]=Ts[9]===n?Wn?0:D.length:zo(Ts[9]-kr,0),!On&&W&(P|R)&&(W&=-25),!W||W==C)var qs=s6(D,W,ge);else W==P||W==R?qs=O8(D,W,On):(W==F||W==(C|F))&&!mt.length?qs=GT(D,W,ge,ze):qs=G1.apply(n,Ts);var Pi=ss?X5:W8;return q8(Pi(qs,Ts),D,W)}function L8(D,W,ge,ze){return D===n||wp(D,Sa[ge])&&!_i.call(ze,ge)?W:D}function D8(D,W,ge,ze,mt,Gt){return Fo(D)&&Fo(W)&&(Gt.set(W,D),yx(D,W,n,D8,Gt),Gt.delete(W)),D}function B8(D){return l7(D)?n:D}function $8(D,W,ge,ze,mt,Gt){var bn=ge&v,On=D.length,Wn=W.length;if(On!=Wn&&!(bn&&Wn>On))return!1;var kr=Gt.get(D),Tr=Gt.get(W);if(kr&&Tr)return kr==W&&Tr==D;var Br=-1,ss=!0,Ts=ge&w?new hx:n;for(Gt.set(D,W),Gt.set(W,D);++Br<On;){var qs=D[Br],Pi=W[Br];if(ze)var Gs=bn?ze(Pi,qs,Br,W,D,Gt):ze(qs,Pi,Br,D,W,Gt);if(Gs!==n){if(Gs)continue;ss=!1;break}if(Ts){if(!Pr(W,function(zi,Gi){if(!Hs(Ts,Gi)&&(qs===zi||mt(qs,zi,ge,ze,Gt)))return Ts.push(Gi)})){ss=!1;break}}else if(!(qs===Pi||mt(qs,Pi,ge,ze,Gt))){ss=!1;break}}return Gt.delete(D),Gt.delete(W),ss}function U8(D,W,ge,ze,mt,Gt,bn){switch(ge){case Ve:if(D.byteLength!=W.byteLength||D.byteOffset!=W.byteOffset)return!1;D=D.buffer,W=W.buffer;case Yt:return!(D.byteLength!=W.byteLength||!Gt(new S2(D),new S2(W)));case je:case Ie:case at:return wp(+D,+W);case Qe:return D.name==W.name&&D.message==W.message;case tn:case un:return D==W+"";case tt:var On=Ii;case jt:var Wn=ze&v;if(On||(On=y),D.size!=W.size&&!Wn)return!1;var kr=bn.get(D);if(kr)return kr==W;ze|=w,bn.set(D,W);var Tr=$8(On(D),On(W),ze,mt,Gt,bn);return bn.delete(D),Tr;case cn:if(Mu)return Mu.call(D)==Mu.call(W)}return!1}function YT(D,W,ge,ze,mt,Gt){var bn=ge&v,On=z2(D),Wn=On.length,kr=z2(W),Tr=kr.length;if(Wn!=Tr&&!bn)return!1;for(var Br=Wn;Br--;){var ss=On[Br];if(!(bn?ss in W:_i.call(W,ss)))return!1}var Ts=Gt.get(D),qs=Gt.get(W);if(Ts&&qs)return Ts==W&&qs==D;var Pi=!0;Gt.set(D,W),Gt.set(W,D);for(var Gs=bn;++Br<Wn;){ss=On[Br];var zi=D[ss],Gi=W[ss];if(ze)var xf=bn?ze(Gi,zi,ss,W,D,Gt):ze(zi,Gi,ss,D,W,Gt);if(!(xf===n?zi===Gi||mt(zi,Gi,ge,ze,Gt):xf)){Pi=!1;break}Gs||(Gs=ss=="constructor")}if(Pi&&!Gs){var $u=D.constructor,gf=W.constructor;$u!=gf&&"constructor"in D&&"constructor"in W&&!(typeof $u=="function"&&$u instanceof $u&&typeof gf=="function"&&gf instanceof gf)&&(Pi=!1)}return Gt.delete(D),Gt.delete(W),Pi}function sh(D){return Du(f6(D,n,m6),D+"")}function z2(D){return V5(D,hc,cf)}function H2(D){return V5(D,Ad,XT)}var l6=M5?function(D){return M5.get(D)}:rz;function K1(D){for(var W=D.name+"",ge=P1[W],ze=_i.call(P1,W)?ge.length:0;ze--;){var mt=ge[ze],Gt=mt.func;if(Gt==null||Gt==D)return mt.name}return W}function bp(D){var W=_i.call(Mt,"placeholder")?Mt:D;return W.placeholder}function $s(){var D=Mt.iteratee||tz;return D=D===tz?$1:D,arguments.length?D(arguments[0],arguments[1]):D}function V2(D,W){var ge=D.__data__;return Y1(W)?ge[typeof W=="string"?"string":"hash"]:ge.map}function W2(D){for(var W=hc(D),ge=W.length;ge--;){var ze=W[ge],mt=D[ze];W[ge]=[ze,mt,K2(mt)]}return W}function Fm(D,W){var ge=Bl(D,W);return y8(ge)?ge:n}function c6(D){var W=_i.call(D,ux),ge=D[ux];try{D[ux]=n;var ze=!0}catch{}var mt=w2.call(D);return ze&&(W?D[ux]=ge:delete D[ux]),mt}var cf=P5?function(D){return D==null?[]:(D=ps(D),ts(P5(D),function(W){return T5.call(D,W)}))}:sz,XT=P5?function(D){for(var W=[];D;)Ss(W,cf(D)),D=af(D);return W}:sz,zl=$l;(j2&&zl(new j2(new ArrayBuffer(1)))!=Ve||fx&&zl(new fx)!=tt||E2&&zl(E2.resolve())!=Ut||Nm&&zl(new Nm)!=jt||_2&&zl(new _2)!=Xe)&&(zl=function(D){var W=$l(D),ge=W==ct?D.constructor:n,ze=ge?Om(ge):"";if(ze)switch(ze){case h8:return Ve;case Am:return tt;case kT:return Ut;case F1:return jt;case Gf:return Xe}return W});function z8(D,W,ge){for(var ze=-1,mt=ge.length;++ze<mt;){var Gt=ge[ze],bn=Gt.size;switch(Gt.type){case"drop":D+=bn;break;case"dropRight":W-=bn;break;case"take":W=ac(W,D+bn);break;case"takeRight":D=zo(D,W-bn);break}}return{start:D,end:W}}function QT(D){var W=D.match(fn);return W?W[1].split(Et):[]}function H8(D,W,ge){W=nh(W,D);for(var ze=-1,mt=W.length,Gt=!1;++ze<mt;){var bn=ff(W[ze]);if(!(Gt=D!=null&&ge(D,bn)))break;D=D[bn]}return Gt||++ze!=mt?Gt:(mt=D==null?0:D.length,!!mt&&gI(mt)&&Za(bn,mt)&&(yi(D)||nv(D)))}function q2(D){var W=D.length,ge=new D.constructor(W);return W&&typeof D[0]=="string"&&_i.call(D,"index")&&(ge.index=D.index,ge.input=D.input),ge}function Hl(D){return typeof D.constructor=="function"&&!yp(D)?O1(af(D)):{}}function PU(D,W,ge){var ze=D.constructor;switch(W){case Yt:return B2(D);case je:case Ie:return new ze(+D);case Ve:return UT(D,ge);case Ke:case ft:case en:case Dt:case At:case Je:case He:case Rt:case qe:return VT(D,ge);case tt:return new ze;case at:case un:return new ze(D);case tn:return zT(D);case jt:return new ze;case cn:return HT(D)}}function FU(D,W){var ge=W.length;if(!ge)return D;var ze=ge-1;return W[ze]=(ge>1?"& ":"")+W[ze],W=W.join(ge>2?", ":" "),D.replace(sn,`{
/* [wrapped with `+W+`] */
`)}function u6(D){return yi(D)||nv(D)||!!(jT&&D&&D[jT])}function Za(D,W){var ge=typeof D;return W=W??G,!!W&&(ge=="number"||ge!="symbol"&&zn.test(D))&&D>-1&&D%1==0&&D<W}function Lc(D,W,ge){if(!Fo(ge))return!1;var ze=typeof W;return(ze=="number"?Nd(ge)&&Za(W,ge.length):ze=="string"&&W in ge)?wp(ge[W],D):!1}function ds(D,W){if(yi(D))return!1;var ge=typeof D;return ge=="number"||ge=="symbol"||ge=="boolean"||D==null||mf(D)?!0:Hn.test(D)||!Qn.test(D)||W!=null&&D in ps(W)}function Y1(D){var W=typeof D;return W=="string"||W=="number"||W=="symbol"||W=="boolean"?D!=="__proto__":D===null}function G2(D){var W=K1(D),ge=Mt[W];if(typeof ge!="function"||!(W in bi.prototype))return!1;if(D===ge)return!0;var ze=l6(ge);return!!ze&&D===ze[0]}function ZT(D){return!!_1&&_1 in D}var OU=Uo?kx:iz;function yp(D){var W=D&&D.constructor,ge=typeof W=="function"&&W.prototype||Sa;return D===ge}function K2(D){return D===D&&!Fo(D)}function d6(D,W){return function(ge){return ge==null?!1:ge[D]===W&&(W!==n||D in ps(ge))}}function JT(D){var W=Wr(D,function(ze){return ge.size===u&&ge.clear(),ze}),ge=W.cache;return W}function eI(D,W){var ge=D[1],ze=W[1],mt=ge|ze,Gt=mt<(C|N|L),bn=ze==L&&ge==P||ze==L&&ge==z&&D[7].length<=W[8]||ze==(L|z)&&W[7].length<=W[8]&&ge==P;if(!(Gt||bn))return D;ze&C&&(D[2]=W[2],mt|=ge&C?0:I);var On=W[3];if(On){var Wn=D[3];D[3]=Wn?WT(Wn,On,W[4]):On,D[4]=Wn?ut(D[3],d):W[4]}return On=W[5],On&&(Wn=D[5],D[5]=Wn?P8(Wn,On,W[6]):On,D[6]=Wn?ut(D[5],d):W[6]),On=W[7],On&&(D[7]=On),ze&L&&(D[8]=D[8]==null?W[8]:ac(D[8],W[8])),D[9]==null&&(D[9]=W[9]),D[0]=W[0],D[1]=mt,D}function tI(D){var W=[];if(D!=null)for(var ge in ps(D))W.push(ge);return W}function V8(D){return w2.call(D)}function f6(D,W,ge){return W=zo(W===n?D.length-1:W,0),function(){for(var ze=arguments,mt=-1,Gt=zo(ze.length-W,0),bn=qt(Gt);++mt<Gt;)bn[mt]=ze[W+mt];mt=-1;for(var On=qt(W+1);++mt<W;)On[mt]=ze[mt];return On[W]=ge(bn),or(D,this,On)}}function Sl(D,W){return W.length<2?D:fp(D,fc(W,0,-1))}function uf(D,W){for(var ge=D.length,ze=ac(W.length,ge),mt=Mc(D);ze--;){var Gt=W[ze];D[ze]=Za(Gt,ge)?mt[Gt]:n}return D}function ih(D,W){if(!(W==="constructor"&&typeof D[W]=="function")&&W!="__proto__")return D[W]}var W8=df(X5),X1=d8||function(D,W){return Zr.setTimeout(D,W)},Du=df(th);function q8(D,W,ge){var ze=W+"";return Du(D,FU(ze,nI(QT(ze),ge)))}function df(D){var W=0,ge=0;return function(){var ze=kU(),mt=re-(ze-ge);if(ge=ze,mt>0){if(++W>=Z)return arguments[0]}else W=0;return D.apply(n,arguments)}}function h6(D,W){var ge=-1,ze=D.length,mt=ze-1;for(W=W===n?ze:W;++ge<W;){var Gt=U1(ge,mt),bn=D[Gt];D[Gt]=D[ge],D[ge]=bn}return D.length=W,D}var G8=JT(function(D){var W=[];return D.charCodeAt(0)===46&&W.push(""),D.replace($n,function(ge,ze,mt,Gt){W.push(mt?Gt.replace(Bt,"$1"):ze||ge)}),W});function ff(D){if(typeof D=="string"||mf(D))return D;var W=D+"";return W=="0"&&1/D==-1/0?"-0":W}function Om(D){if(D!=null){try{return hd.call(D)}catch{}try{return D+""}catch{}}return""}function nI(D,W){return wr(ce,function(ge){var ze="_."+ge[0];W&ge[1]&&!Lr(D,ze)&&D.push(ze)}),D.sort()}function rI(D){if(D instanceof bi)return D.clone();var W=new oc(D.__wrapped__,D.__chain__);return W.__actions__=Mc(D.__actions__),W.__index__=D.__index__,W.__values__=D.__values__,W}function p6(D,W,ge){(ge?Lc(D,W,ge):W===n)?W=1:W=zo(Ti(W),0);var ze=D==null?0:D.length;if(!ze||W<1)return[];for(var mt=0,Gt=0,bn=qt(dx(ze/W));mt<ze;)bn[Gt++]=fc(D,mt,mt+=W);return bn}function K8(D){for(var W=-1,ge=D==null?0:D.length,ze=0,mt=[];++W<ge;){var Gt=D[W];Gt&&(mt[ze++]=Gt)}return mt}function Cd(){var D=arguments.length;if(!D)return[];for(var W=qt(D-1),ge=arguments[0],ze=D;ze--;)W[ze-1]=arguments[ze];return Ss(yi(ge)?Mc(ge):[ge],vo(W,1))}var qi=ki(function(D,W){return ll(D)?Zf(D,vo(W,1,ll,!0)):[]}),Nl=ki(function(D,W){var ge=Dc(W);return ll(ge)&&(ge=n),ll(D)?Zf(D,vo(W,1,ll,!0),$s(ge,2)):[]}),Ho=ki(function(D,W){var ge=Dc(W);return ll(ge)&&(ge=n),ll(D)?Zf(D,vo(W,1,ll,!0),n,ge):[]});function Vl(D,W,ge){var ze=D==null?0:D.length;return ze?(W=ge||W===n?1:Ti(W),fc(D,W<0?0:W,ze)):[]}function Bu(D,W,ge){var ze=D==null?0:D.length;return ze?(W=ge||W===n?1:Ti(W),W=ze-W,fc(D,0,W<0?0:W)):[]}function Q1(D,W){return D&&D.length?L2(D,$s(W,3),!0,!0):[]}function al(D,W){return D&&D.length?L2(D,$s(W,3),!0):[]}function Y2(D,W,ge,ze){var mt=D==null?0:D.length;return mt?(ge&&typeof ge!="number"&&Lc(D,W,ge)&&(ge=0,ze=mt),LT(D,W,ge,ze)):[]}function Mm(D,W,ge){var ze=D==null?0:D.length;if(!ze)return-1;var mt=ge==null?0:Ti(ge);return mt<0&&(mt=zo(ze+mt,0)),Mr(D,$s(W,3),mt)}function X2(D,W,ge){var ze=D==null?0:D.length;if(!ze)return-1;var mt=ze-1;return ge!==n&&(mt=Ti(ge),mt=ge<0?zo(ze+mt,0):ac(mt,ze-1)),Mr(D,$s(W,3),mt,!0)}function m6(D){var W=D==null?0:D.length;return W?vo(D,1):[]}function Q2(D){var W=D==null?0:D.length;return W?vo(D,oe):[]}function cu(D,W){var ge=D==null?0:D.length;return ge?(W=W===n?1:Ti(W),vo(D,W)):[]}function Y8(D){for(var W=-1,ge=D==null?0:D.length,ze={};++W<ge;){var mt=D[W];ze[mt[0]]=mt[1]}return ze}function Nx(D){return D&&D.length?D[0]:n}function vp(D,W,ge){var ze=D==null?0:D.length;if(!ze)return-1;var mt=ge==null?0:Ti(ge);return mt<0&&(mt=zo(ze+mt,0)),cr(D,W,mt)}function x6(D){var W=D==null?0:D.length;return W?fc(D,0,-1):[]}var X8=ki(function(D){var W=Ir(D,V1);return W.length&&W[0]===D[0]?W5(W):[]}),Rm=ki(function(D){var W=Dc(D),ge=Ir(D,V1);return W===Dc(ge)?W=n:ge.pop(),ge.length&&ge[0]===D[0]?W5(ge,$s(W,2)):[]}),g6=ki(function(D){var W=Dc(D),ge=Ir(D,V1);return W=typeof W=="function"?W:n,W&&ge.pop(),ge.length&&ge[0]===D[0]?W5(ge,n,W):[]});function Lm(D,W){return D==null?"":F5.call(D,W)}function Dc(D){var W=D==null?0:D.length;return W?D[W-1]:n}function Z2(D,W,ge){var ze=D==null?0:D.length;if(!ze)return-1;var mt=ze;return ge!==n&&(mt=Ti(ge),mt=mt<0?zo(ze+mt,0):ac(mt,ze-1)),W===W?$(D,W,mt):Mr(D,Kr,mt,!0)}function Q8(D,W){return D&&D.length?Y5(D,Ti(W)):n}var b6=ki(J2);function J2(D,W){return D&&D.length&&W&&W.length?Po(D,W):D}function Bc(D,W,ge){return D&&D.length&&W&&W.length?Po(D,W,$s(ge,2)):D}function Dm(D,W,ge){return D&&D.length&&W&&W.length?Po(D,W,n,ge):D}var hf=sh(function(D,W){var ge=D==null?0:D.length,ze=z5(D,W);return il(D,Ir(W,function(mt){return Za(mt,ge)?+mt:mt}).sort(I8)),ze});function uu(D,W){var ge=[];if(!(D&&D.length))return ge;var ze=-1,mt=[],Gt=D.length;for(W=$s(W,3);++ze<Gt;){var bn=D[ze];W(bn,ze,D)&&(ge.push(bn),mt.push(ze))}return il(D,mt),ge}function y6(D){return D==null?D:O5.call(D)}function Z8(D,W,ge){var ze=D==null?0:D.length;return ze?(ge&&typeof ge!="number"&&Lc(D,W,ge)?(W=0,ge=ze):(W=W==null?0:Ti(W),ge=ge===n?ze:Ti(ge)),fc(D,W,ge)):[]}function J8(D,W){return z1(D,W)}function MU(D,W,ge){return Q5(D,W,$s(ge,2))}function Bm(D,W){var ge=D==null?0:D.length;if(ge){var ze=z1(D,W);if(ze<ge&&wp(D[ze],W))return ze}return-1}function sI(D,W){return z1(D,W,!0)}function e7(D,W,ge){return Q5(D,W,$s(ge,2),!0)}function Ax(D,W){var ge=D==null?0:D.length;if(ge){var ze=z1(D,W,!0)-1;if(wp(D[ze],W))return ze}return-1}function t7(D){return D&&D.length?j8(D):[]}function jx(D,W){return D&&D.length?j8(D,$s(W,2)):[]}function iI(D){var W=D==null?0:D.length;return W?fc(D,1,W):[]}function aI(D,W,ge){return D&&D.length?(W=ge||W===n?1:Ti(W),fc(D,0,W<0?0:W)):[]}function n7(D,W,ge){var ze=D==null?0:D.length;return ze?(W=ge||W===n?1:Ti(W),W=ze-W,fc(D,W<0?0:W,ze)):[]}function v6(D,W){return D&&D.length?L2(D,$s(W,3),!1,!0):[]}function RU(D,W){return D&&D.length?L2(D,$s(W,3)):[]}var LU=ki(function(D){return xp(vo(D,1,ll,!0))}),oI=ki(function(D){var W=Dc(D);return ll(W)&&(W=n),xp(vo(D,1,ll,!0),$s(W,2))}),lI=ki(function(D){var W=Dc(D);return W=typeof W=="function"?W:n,xp(vo(D,1,ll,!0),n,W)});function Ex(D){return D&&D.length?xp(D):[]}function DU(D,W){return D&&D.length?xp(D,$s(W,2)):[]}function Z1(D,W){return W=typeof W=="function"?W:n,D&&D.length?xp(D,n,W):[]}function w6(D){if(!(D&&D.length))return[];var W=0;return D=ts(D,function(ge){if(ll(ge))return W=zo(ge.length,W),!0}),as(W,function(ge){return Ir(D,ei(ge))})}function co(D,W){if(!(D&&D.length))return[];var ge=w6(D);return W==null?ge:Ir(ge,function(ze){return or(W,n,ze)})}var BU=ki(function(D,W){return ll(D)?Zf(D,W):[]}),cI=ki(function(D){return J5(ts(D,ll))}),$U=ki(function(D){var W=Dc(D);return ll(W)&&(W=n),J5(ts(D,ll),$s(W,2))}),UU=ki(function(D){var W=Dc(D);return W=typeof W=="function"?W:n,J5(ts(D,ll),n,W)}),uI=ki(w6);function dI(D,W){return D2(D||[],W||[],xx)}function zU(D,W){return D2(D||[],W||[],wx)}var Sd=ki(function(D){var W=D.length,ge=W>1?D[W-1]:n;return ge=typeof ge=="function"?(D.pop(),ge):n,co(D,ge)});function C6(D){var W=Mt(D);return W.__chain__=!0,W}function HU(D,W){return W(D),D}function pf(D,W){return W(D)}var S6=sh(function(D){var W=D.length,ge=W?D[0]:0,ze=this.__wrapped__,mt=function(Gt){return z5(Gt,D)};return W>1||this.__actions__.length||!(ze instanceof bi)||!Za(ge)?this.thru(mt):(ze=ze.slice(ge,+ge+(W?1:0)),ze.__actions__.push({func:pf,args:[mt],thisArg:n}),new oc(ze,this.__chain__).thru(function(Gt){return W&&!Gt.length&&Gt.push(n),Gt}))});function _x(){return C6(this)}function N6(){return new oc(this.value(),this.__chain__)}function r7(){this.__values__===n&&(this.__values__=Jue(this.value()));var D=this.__index__>=this.__values__.length,W=D?n:this.__values__[this.__index__++];return{done:D,value:W}}function s7(){return this}function VU(D){for(var W,ge=this;ge instanceof Kf;){var ze=rI(ge);ze.__index__=0,ze.__values__=n,W?mt.__wrapped__=ze:W=ze;var mt=ze;ge=ge.__wrapped__}return mt.__wrapped__=D,W}function i7(){var D=this.__wrapped__;if(D instanceof bi){var W=D;return this.__actions__.length&&(W=new bi(this)),W=W.reverse(),W.__actions__.push({func:pf,args:[y6],thisArg:n}),new oc(W,this.__chain__)}return this.thru(y6)}function WU(){return H1(this.__wrapped__,this.__actions__)}var fI=n6(function(D,W,ge){_i.call(D,ge)?++D[ge]:Qf(D,ge,1)});function hI(D,W,ge){var ze=yi(D)?es:I2;return ge&&Lc(D,W,ge)&&(W=n),ze(D,$s(W,3))}function A6(D,W){var ge=yi(D)?ts:g8;return ge(D,$s(W,3))}var j6=Sx(Mm),pI=Sx(X2);function a7(D,W){return vo(T6(D,W),1)}function mI(D,W){return vo(T6(D,W),oe)}function o7(D,W,ge){return ge=ge===n?1:Ti(ge),vo(T6(D,W),ge)}function ev(D,W){var ge=yi(D)?wr:Jf;return ge(D,$s(W,3))}function E6(D,W){var ge=yi(D)?pr:RT;return ge(D,$s(W,3))}var _6=n6(function(D,W,ge){_i.call(D,ge)?D[ge].push(W):Qf(D,ge,[W])});function xI(D,W,ge,ze){D=Nd(D)?D:F6(D),ge=ge&&!ze?Ti(ge):0;var mt=D.length;return ge<0&&(ge=zo(mt+ge,0)),bI(D)?ge<=mt&&D.indexOf(W,ge)>-1:!!mt&&cr(D,W,ge)>-1}var qU=ki(function(D,W,ge){var ze=-1,mt=typeof W=="function",Gt=Nd(D)?qt(D.length):[];return Jf(D,function(bn){Gt[++ze]=mt?or(W,bn,ge):bd(bn,W,ge)}),Gt}),k6=n6(function(D,W,ge){Qf(D,ge,W)});function T6(D,W){var ge=yi(D)?Ir:w8;return ge(D,$s(W,3))}function tv(D,W,ge,ze){return D==null?[]:(yi(W)||(W=W==null?[]:[W]),ge=ze?n:ge,yi(ge)||(ge=ge==null?[]:[ge]),M2(D,W,ge))}var GU=n6(function(D,W,ge){D[ge?0:1].push(W)},function(){return[[],[]]});function I6(D,W,ge){var ze=yi(D)?hi:sr,mt=arguments.length<3;return ze(D,$s(W,4),ge,mt,Jf)}function A(D,W,ge){var ze=yi(D)?li:sr,mt=arguments.length<3;return ze(D,$s(W,4),ge,mt,RT)}function M(D,W){var ge=yi(D)?ts:g8;return ge(D,js($s(W,3)))}function Q(D){var W=yi(D)?Xf:dc;return W(D)}function me(D,W,ge){(ge?Lc(D,W,ge):W===n)?W=1:W=Ti(W);var ze=yi(D)?mx:N8;return ze(D,W)}function Pe(D){var W=yi(D)?OT:vd;return W(D)}function Ue(D){if(D==null)return 0;if(Nd(D))return bI(D)?H(D):D.length;var W=zl(D);return W==tt||W==jt?D.size:mp(D).length}function Ct(D,W,ge){var ze=yi(D)?Pr:A8;return ge&&Lc(D,W,ge)&&(W=n),ze(D,$s(W,3))}var mn=ki(function(D,W){if(D==null)return[];var ge=W.length;return ge>1&&Lc(D,W[0],W[1])?W=[]:ge>2&&Lc(W[0],W[1],W[2])&&(W=[W[0]]),M2(D,vo(W,1),[])}),In=za||function(){return Zr.Date.now()};function rr(D,W){if(typeof W!="function")throw new Ya(o);return D=Ti(D),function(){if(--D<1)return W.apply(this,arguments)}}function Dr(D,W,ge){return W=ge?n:W,W=D&&W==null?D.length:W,rh(D,L,n,n,n,n,W)}function $r(D,W){var ge;if(typeof W!="function")throw new Ya(o);return D=Ti(D),function(){return--D>0&&(ge=W.apply(this,arguments)),D<=1&&(W=n),ge}}var Rr=ki(function(D,W,ge){var ze=C;if(ge.length){var mt=ut(ge,bp(Rr));ze|=F}return rh(D,ze,W,ge,mt)}),os=ki(function(D,W,ge){var ze=C|N;if(ge.length){var mt=ut(ge,bp(os));ze|=F}return rh(W,ze,D,ge,mt)});function ms(D,W,ge){W=ge?n:W;var ze=rh(D,P,n,n,n,n,n,W);return ze.placeholder=ms.placeholder,ze}function As(D,W,ge){W=ge?n:W;var ze=rh(D,R,n,n,n,n,n,W);return ze.placeholder=As.placeholder,ze}function wo(D,W,ge){var ze,mt,Gt,bn,On,Wn,kr=0,Tr=!1,Br=!1,ss=!0;if(typeof D!="function")throw new Ya(o);W=ah(W)||0,Fo(ge)&&(Tr=!!ge.leading,Br="maxWait"in ge,Gt=Br?zo(ah(ge.maxWait)||0,W):Gt,ss="trailing"in ge?!!ge.trailing:ss);function Ts(cl){var Cp=ze,Ix=mt;return ze=mt=n,kr=cl,bn=D.apply(Ix,Cp),bn}function qs(cl){return kr=cl,On=X1(zi,W),Tr?Ts(cl):bn}function Pi(cl){var Cp=cl-Wn,Ix=cl-kr,fde=W-Cp;return Br?ac(fde,Gt-Ix):fde}function Gs(cl){var Cp=cl-Wn,Ix=cl-kr;return Wn===n||Cp>=W||Cp<0||Br&&Ix>=Gt}function zi(){var cl=In();if(Gs(cl))return Gi(cl);On=X1(zi,Pi(cl))}function Gi(cl){return On=n,ss&&ze?Ts(cl):(ze=mt=n,bn)}function xf(){On!==n&&k8(On),kr=0,ze=Wn=mt=On=n}function $u(){return On===n?bn:Gi(In())}function gf(){var cl=In(),Cp=Gs(cl);if(ze=arguments,mt=this,Wn=cl,Cp){if(On===n)return qs(Wn);if(Br)return k8(On),On=X1(zi,W),Ts(Wn)}return On===n&&(On=X1(zi,W)),bn}return gf.cancel=xf,gf.flush=$u,gf}var Xn=ki(function(D,W){return x8(D,1,W)}),Bn=ki(function(D,W,ge){return x8(D,ah(W)||0,ge)});function Zn(D){return rh(D,X)}function Wr(D,W){if(typeof D!="function"||W!=null&&typeof W!="function")throw new Ya(o);var ge=function(){var ze=arguments,mt=W?W.apply(this,ze):ze[0],Gt=ge.cache;if(Gt.has(mt))return Gt.get(mt);var bn=D.apply(this,ze);return ge.cache=Gt.set(mt,bn)||Gt,bn};return ge.cache=new(Wr.Cache||pd),ge}Wr.Cache=pd;function js(D){if(typeof D!="function")throw new Ya(o);return function(){var W=arguments;switch(W.length){case 0:return!D.call(this);case 1:return!D.call(this,W[0]);case 2:return!D.call(this,W[0],W[1]);case 3:return!D.call(this,W[0],W[1],W[2])}return!D.apply(this,W)}}function Ls(D){return $r(2,D)}var Ds=$T(function(D,W){W=W.length==1&&yi(W[0])?Ir(W[0],Ns($s())):Ir(vo(W,1),Ns($s()));var ge=W.length;return ki(function(ze){for(var mt=-1,Gt=ac(ze.length,ge);++mt<Gt;)ze[mt]=W[mt].call(this,ze[mt]);return or(D,this,ze)})}),Vs=ki(function(D,W){var ge=ut(W,bp(Vs));return rh(D,F,n,W,ge)}),ol=ki(function(D,W){var ge=ut(W,bp(ol));return rh(D,U,n,W,ge)}),na=sh(function(D,W){return rh(D,z,n,n,n,W)});function $m(D,W){if(typeof D!="function")throw new Ya(o);return W=W===n?W:Ti(W),ki(D,W)}function KU(D,W){if(typeof D!="function")throw new Ya(o);return W=W==null?0:zo(Ti(W),0),ki(function(ge){var ze=ge[W],mt=gp(ge,0,W);return ze&&Ss(mt,ze),or(D,this,mt)})}function vWe(D,W,ge){var ze=!0,mt=!0;if(typeof D!="function")throw new Ya(o);return Fo(ge)&&(ze="leading"in ge?!!ge.leading:ze,mt="trailing"in ge?!!ge.trailing:mt),wo(D,W,{leading:ze,maxWait:W,trailing:mt})}function wWe(D){return Dr(D,1)}function CWe(D,W){return Vs(e6(W),D)}function SWe(){if(!arguments.length)return[];var D=arguments[0];return yi(D)?D:[D]}function NWe(D){return ou(D,g)}function AWe(D,W){return W=typeof W=="function"?W:n,ou(D,g,W)}function jWe(D){return ou(D,f|g)}function EWe(D,W){return W=typeof W=="function"?W:n,ou(D,f|g,W)}function _We(D,W){return W==null||T2(D,W,hc(W))}function wp(D,W){return D===W||D!==D&&W!==W}var kWe=o6(Tm),TWe=o6(function(D,W){return D>=W}),nv=q5(function(){return arguments}())?q5:function(D){return Vo(D)&&_i.call(D,"callee")&&!T5.call(D,"callee")},yi=qt.isArray,IWe=pe?Ns(pe):DT;function Nd(D){return D!=null&&gI(D.length)&&!kx(D)}function ll(D){return Vo(D)&&Nd(D)}function PWe(D){return D===!0||D===!1||Vo(D)&&$l(D)==je}var J1=f8||iz,FWe=st?Ns(st):pp;function OWe(D){return Vo(D)&&D.nodeType===1&&!l7(D)}function MWe(D){if(D==null)return!0;if(Nd(D)&&(yi(D)||typeof D=="string"||typeof D.splice=="function"||J1(D)||P6(D)||nv(D)))return!D.length;var W=zl(D);if(W==tt||W==jt)return!D.size;if(yp(D))return!mp(D).length;for(var ge in D)if(_i.call(D,ge))return!1;return!0}function RWe(D,W){return yd(D,W)}function LWe(D,W,ge){ge=typeof ge=="function"?ge:n;var ze=ge?ge(D,W):n;return ze===n?yd(D,W,n,ge):!!ze}function YU(D){if(!Vo(D))return!1;var W=$l(D);return W==Qe||W==Re||typeof D.message=="string"&&typeof D.name=="string"&&!l7(D)}function DWe(D){return typeof D=="number"&&k1(D)}function kx(D){if(!Fo(D))return!1;var W=$l(D);return W==Be||W==it||W==be||W==kt}function Yue(D){return typeof D=="number"&&D==Ti(D)}function gI(D){return typeof D=="number"&&D>-1&&D%1==0&&D<=G}function Fo(D){var W=typeof D;return D!=null&&(W=="object"||W=="function")}function Vo(D){return D!=null&&typeof D=="object"}var Xue=Ft?Ns(Ft):BT;function BWe(D,W){return D===W||B1(D,W,W2(W))}function $We(D,W,ge){return ge=typeof ge=="function"?ge:n,B1(D,W,W2(W),ge)}function UWe(D){return Que(D)&&D!=+D}function zWe(D){if(OU(D))throw new ir(a);return y8(D)}function HWe(D){return D===null}function VWe(D){return D==null}function Que(D){return typeof D=="number"||Vo(D)&&$l(D)==at}function l7(D){if(!Vo(D)||$l(D)!=ct)return!1;var W=af(D);if(W===null)return!0;var ge=_i.call(W,"constructor")&&W.constructor;return typeof ge=="function"&&ge instanceof ge&&hd.call(ge)==_5}var XU=yt?Ns(yt):F2;function WWe(D){return Yue(D)&&D>=-9007199254740991&&D<=G}var Zue=pn?Ns(pn):eh;function bI(D){return typeof D=="string"||!yi(D)&&Vo(D)&&$l(D)==un}function mf(D){return typeof D=="symbol"||Vo(D)&&$l(D)==cn}var P6=An?Ns(An):O2;function qWe(D){return D===n}function GWe(D){return Vo(D)&&zl(D)==Xe}function KWe(D){return Vo(D)&&$l(D)==Vt}var YWe=o6(Im),XWe=o6(function(D,W){return D<=W});function Jue(D){if(!D)return[];if(Nd(D))return bI(D)?K(D):Mc(D);if(cp&&D[cp])return cx(D[cp]());var W=zl(D),ge=W==tt?Ii:W==jt?y:F6;return ge(D)}function Tx(D){if(!D)return D===0?D:0;if(D=ah(D),D===oe||D===-1/0){var W=D<0?-1:1;return W*V}return D===D?D:0}function Ti(D){var W=Tx(D),ge=W%1;return W===W?ge?W-ge:W:0}function ede(D){return D?dp(Ti(D),0,ae):0}function ah(D){if(typeof D=="number")return D;if(mf(D))return ee;if(Fo(D)){var W=typeof D.valueOf=="function"?D.valueOf():D;D=Fo(W)?W+"":W}if(typeof D!="string")return D===0?D:+D;D=ys(D);var ge=nr.test(D);return ge||Qt.test(D)?xr(D.slice(2),ge?2:8):qn.test(D)?ee:+D}function tde(D){return lf(D,Ad(D))}function QWe(D){return D?dp(Ti(D),-9007199254740991,G):D===0?D:0}function Na(D){return D==null?"":lu(D)}var ZWe=W1(function(D,W){if(yp(W)||Nd(W)){lf(W,hc(W),D);return}for(var ge in W)_i.call(W,ge)&&xx(D,ge,W[ge])}),nde=W1(function(D,W){lf(W,Ad(W),D)}),yI=W1(function(D,W,ge,ze){lf(W,Ad(W),D,ze)}),JWe=W1(function(D,W,ge,ze){lf(W,hc(W),D,ze)}),eqe=sh(z5);function tqe(D,W){var ge=O1(D);return W==null?ge:Va(ge,W)}var nqe=ki(function(D,W){D=ps(D);var ge=-1,ze=W.length,mt=ze>2?W[2]:n;for(mt&&Lc(W[0],W[1],mt)&&(ze=1);++ge<ze;)for(var Gt=W[ge],bn=Ad(Gt),On=-1,Wn=bn.length;++On<Wn;){var kr=bn[On],Tr=D[kr];(Tr===n||wp(Tr,Sa[kr])&&!_i.call(D,kr))&&(D[kr]=Gt[kr])}return D}),rqe=ki(function(D){return D.push(n,D8),or(rde,n,D)});function sqe(D,W){return Nr(D,$s(W,3),Lu)}function iqe(D,W){return Nr(D,$s(W,3),km)}function aqe(D,W){return D==null?D:H5(D,$s(W,3),Ad)}function oqe(D,W){return D==null?D:P2(D,$s(W,3),Ad)}function lqe(D,W){return D&&Lu(D,$s(W,3))}function cqe(D,W){return D&&km(D,$s(W,3))}function uqe(D){return D==null?[]:D1(D,hc(D))}function dqe(D){return D==null?[]:D1(D,Ad(D))}function QU(D,W,ge){var ze=D==null?n:fp(D,W);return ze===n?ge:ze}function fqe(D,W){return D!=null&&H8(D,W,gd)}function ZU(D,W){return D!=null&&H8(D,W,bx)}var hqe=qT(function(D,W,ge){W!=null&&typeof W.toString!="function"&&(W=w2.call(W)),D[W]=ge},ez(jd)),pqe=qT(function(D,W,ge){W!=null&&typeof W.toString!="function"&&(W=w2.call(W)),_i.call(D,W)?D[W].push(ge):D[W]=[ge]},$s),mqe=ki(bd);function hc(D){return Nd(D)?Yf(D):mp(D)}function Ad(D){return Nd(D)?Yf(D,!0):v8(D)}function xqe(D,W){var ge={};return W=$s(W,3),Lu(D,function(ze,mt,Gt){Qf(ge,W(ze,mt,Gt),ze)}),ge}function gqe(D,W){var ge={};return W=$s(W,3),Lu(D,function(ze,mt,Gt){Qf(ge,mt,W(ze,mt,Gt))}),ge}var bqe=W1(function(D,W,ge){yx(D,W,ge)}),rde=W1(function(D,W,ge,ze){yx(D,W,ge,ze)}),yqe=sh(function(D,W){var ge={};if(D==null)return ge;var ze=!1;W=Ir(W,function(Gt){return Gt=nh(Gt,D),ze||(ze=Gt.length>1),Gt}),lf(D,H2(D),ge),ze&&(ge=ou(ge,f|x|g,B8));for(var mt=W.length;mt--;)Z5(ge,W[mt]);return ge});function vqe(D,W){return sde(D,js($s(W)))}var wqe=sh(function(D,W){return D==null?{}:S8(D,W)});function sde(D,W){if(D==null)return{};var ge=Ir(H2(D),function(ze){return[ze]});return W=$s(W),Pm(D,ge,function(ze,mt){return W(ze,mt[0])})}function Cqe(D,W,ge){W=nh(W,D);var ze=-1,mt=W.length;for(mt||(mt=1,D=n);++ze<mt;){var Gt=D==null?n:D[ff(W[ze])];Gt===n&&(ze=mt,Gt=ge),D=kx(Gt)?Gt.call(D):Gt}return D}function Sqe(D,W,ge){return D==null?D:wx(D,W,ge)}function Nqe(D,W,ge,ze){return ze=typeof ze=="function"?ze:n,D==null?D:wx(D,W,ge,ze)}var ide=R8(hc),ade=R8(Ad);function Aqe(D,W,ge){var ze=yi(D),mt=ze||J1(D)||P6(D);if(W=$s(W,4),ge==null){var Gt=D&&D.constructor;mt?ge=ze?new Gt:[]:Fo(D)?ge=kx(Gt)?O1(af(D)):{}:ge={}}return(mt?wr:Lu)(D,function(bn,On,Wn){return W(ge,bn,On,Wn)}),ge}function jqe(D,W){return D==null?!0:Z5(D,W)}function Eqe(D,W,ge){return D==null?D:_8(D,W,e6(ge))}function _qe(D,W,ge,ze){return ze=typeof ze=="function"?ze:n,D==null?D:_8(D,W,e6(ge),ze)}function F6(D){return D==null?[]:ca(D,hc(D))}function kqe(D){return D==null?[]:ca(D,Ad(D))}function Tqe(D,W,ge){return ge===n&&(ge=W,W=n),ge!==n&&(ge=ah(ge),ge=ge===ge?ge:0),W!==n&&(W=ah(W),W=W===W?W:0),dp(ah(D),W,ge)}function Iqe(D,W,ge){return W=Tx(W),ge===n?(ge=W,W=0):ge=Tx(ge),D=ah(D),b8(D,W,ge)}function Pqe(D,W,ge){if(ge&&typeof ge!="boolean"&&Lc(D,W,ge)&&(W=ge=n),ge===n&&(typeof W=="boolean"?(ge=W,W=n):typeof D=="boolean"&&(ge=D,D=n)),D===n&&W===n?(D=0,W=1):(D=Tx(D),W===n?(W=D,D=0):W=Tx(W)),D>W){var ze=D;D=W,W=ze}if(ge||D%1||W%1){var mt=A2();return ac(D+mt*(W-D+us("1e-"+((mt+"").length-1))),W)}return U1(D,W)}var Fqe=Cx(function(D,W,ge){return W=W.toLowerCase(),D+(ge?ode(W):W)});function ode(D){return JU(Na(D).toLowerCase())}function lde(D){return D=Na(D),D&&D.replace(Yn,E1).replace(Ot,"")}function Oqe(D,W,ge){D=Na(D),W=lu(W);var ze=D.length;ge=ge===n?ze:dp(Ti(ge),0,ze);var mt=ge;return ge-=W.length,ge>=0&&D.slice(ge,mt)==W}function Mqe(D){return D=Na(D),D&&Mn.test(D)?D.replace(xn,E5):D}function Rqe(D){return D=Na(D),D&&Nn.test(D)?D.replace(Jn,"\\$&"):D}var Lqe=Cx(function(D,W,ge){return D+(ge?"-":"")+W.toLowerCase()}),Dqe=Cx(function(D,W,ge){return D+(ge?" ":"")+W.toLowerCase()}),Bqe=F8("toLowerCase");function $qe(D,W,ge){D=Na(D),W=Ti(W);var ze=W?H(D):0;if(!W||ze>=W)return D;var mt=(W-ze)/2;return U2(Sm(mt),ge)+D+U2(dx(mt),ge)}function Uqe(D,W,ge){D=Na(D),W=Ti(W);var ze=W?H(D):0;return W&&ze<W?D+U2(W-ze,ge):D}function zqe(D,W,ge){D=Na(D),W=Ti(W);var ze=W?H(D):0;return W&&ze<W?U2(W-ze,ge)+D:D}function Hqe(D,W,ge){return ge||W==null?W=0:W&&(W=+W),_T(Na(D).replace(ln,""),W||0)}function Vqe(D,W,ge){return(ge?Lc(D,W,ge):W===n)?W=1:W=Ti(W),vx(Na(D),W)}function Wqe(){var D=arguments,W=Na(D[0]);return D.length<3?W:W.replace(D[1],D[2])}var qqe=Cx(function(D,W,ge){return D+(ge?"_":"")+W.toLowerCase()});function Gqe(D,W,ge){return ge&&typeof ge!="number"&&Lc(D,W,ge)&&(W=ge=n),ge=ge===n?ae:ge>>>0,ge?(D=Na(D),D&&(typeof W=="string"||W!=null&&!XU(W))&&(W=lu(W),!W&&vm(D))?gp(K(D),0,ge):D.split(W,ge)):[]}var Kqe=Cx(function(D,W,ge){return D+(ge?" ":"")+JU(W)});function Yqe(D,W,ge){return D=Na(D),ge=ge==null?0:dp(Ti(ge),0,D.length),W=lu(W),D.slice(ge,ge+W.length)==W}function Xqe(D,W,ge){var ze=Mt.templateSettings;ge&&Lc(D,W,ge)&&(W=n),D=Na(D),W=yI({},W,ze,L8);var mt=yI({},W.imports,ze.imports,L8),Gt=hc(mt),bn=ca(mt,Gt),On,Wn,kr=0,Tr=W.interpolate||Lt,Br="__p += '",ss=Ws((W.escape||Lt).source+"|"+Tr.source+"|"+(Tr===vn?an:Lt).source+"|"+(W.evaluate||Lt).source+"|$","g"),Ts="//# sourceURL="+(_i.call(W,"sourceURL")?(W.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++nn+"]")+`
`;D.replace(ss,function(Gs,zi,Gi,xf,$u,gf){return Gi||(Gi=xf),Br+=D.slice(kr,gf).replace(Fn,y2),zi&&(On=!0,Br+=`' +
__e(`+zi+`) +
'`),$u&&(Wn=!0,Br+=`';
`+$u+`;
__p += '`),Gi&&(Br+=`' +
((__t = (`+Gi+`)) == null ? '' : __t) +
'`),kr=gf+Gs.length,Gs}),Br+=`';
`;var qs=_i.call(W,"variable")&&W.variable;if(!qs)Br=`with (obj) {
`+Br+`
}
`;else if(Cn.test(qs))throw new ir(l);Br=(Wn?Br.replace(lt,""):Br).replace(xt,"$1").replace(Nt,"$1;"),Br="function("+(qs||"obj")+`) {
`+(qs?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(On?", __e = _.escape":"")+(Wn?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+Br+`return __p
}`;var Pi=ude(function(){return Cr(Gt,Ts+"return "+Br).apply(n,bn)});if(Pi.source=Br,YU(Pi))throw Pi;return Pi}function Qqe(D){return Na(D).toLowerCase()}function Zqe(D){return Na(D).toUpperCase()}function Jqe(D,W,ge){if(D=Na(D),D&&(ge||W===n))return ys(D);if(!D||!(W=lu(W)))return D;var ze=K(D),mt=K(W),Gt=vs(ze,mt),bn=sc(ze,mt)+1;return gp(ze,Gt,bn).join("")}function eGe(D,W,ge){if(D=Na(D),D&&(ge||W===n))return D.slice(0,le(D)+1);if(!D||!(W=lu(W)))return D;var ze=K(D),mt=sc(ze,K(W))+1;return gp(ze,0,mt).join("")}function tGe(D,W,ge){if(D=Na(D),D&&(ge||W===n))return D.replace(ln,"");if(!D||!(W=lu(W)))return D;var ze=K(D),mt=vs(ze,K(W));return gp(ze,mt).join("")}function nGe(D,W){var ge=ne,ze=J;if(Fo(W)){var mt="separator"in W?W.separator:mt;ge="length"in W?Ti(W.length):ge,ze="omission"in W?lu(W.omission):ze}D=Na(D);var Gt=D.length;if(vm(D)){var bn=K(D);Gt=bn.length}if(ge>=Gt)return D;var On=ge-H(ze);if(On<1)return ze;var Wn=bn?gp(bn,0,On).join(""):D.slice(0,On);if(mt===n)return Wn+ze;if(bn&&(On+=Wn.length-On),XU(mt)){if(D.slice(On).search(mt)){var kr,Tr=Wn;for(mt.global||(mt=Ws(mt.source,Na(Pn.exec(mt))+"g")),mt.lastIndex=0;kr=mt.exec(Tr);)var Br=kr.index;Wn=Wn.slice(0,Br===n?On:Br)}}else if(D.indexOf(lu(mt),On)!=On){var ss=Wn.lastIndexOf(mt);ss>-1&&(Wn=Wn.slice(0,ss))}return Wn+ze}function rGe(D){return D=Na(D),D&&dn.test(D)?D.replace(It,ve):D}var sGe=Cx(function(D,W,ge){return D+(ge?" ":"")+W.toUpperCase()}),JU=F8("toUpperCase");function cde(D,W,ge){return D=Na(D),W=ge?n:W,W===n?v2(D)?ht(D):Dn(D):D.match(W)||[]}var ude=ki(function(D,W){try{return or(D,n,W)}catch(ge){return YU(ge)?ge:new ir(ge)}}),iGe=sh(function(D,W){return wr(W,function(ge){ge=ff(ge),Qf(D,ge,Rr(D[ge],D))}),D});function aGe(D){var W=D==null?0:D.length,ge=$s();return D=W?Ir(D,function(ze){if(typeof ze[1]!="function")throw new Ya(o);return[ge(ze[0]),ze[1]]}):[],ki(function(ze){for(var mt=-1;++mt<W;){var Gt=D[mt];if(or(Gt[0],this,ze))return or(Gt[1],this,ze)}})}function oGe(D){return MT(ou(D,f))}function ez(D){return function(){return D}}function lGe(D,W){return D==null||D!==D?W:D}var cGe=i6(),uGe=i6(!0);function jd(D){return D}function tz(D){return $1(typeof D=="function"?D:ou(D,f))}function dGe(D){return K5(ou(D,f))}function fGe(D,W){return Qa(D,ou(W,f))}var hGe=ki(function(D,W){return function(ge){return bd(ge,D,W)}}),pGe=ki(function(D,W){return function(ge){return bd(D,ge,W)}});function nz(D,W,ge){var ze=hc(W),mt=D1(W,ze);ge==null&&!(Fo(W)&&(mt.length||!ze.length))&&(ge=W,W=D,D=this,mt=D1(W,hc(W)));var Gt=!(Fo(ge)&&"chain"in ge)||!!ge.chain,bn=kx(D);return wr(mt,function(On){var Wn=W[On];D[On]=Wn,bn&&(D.prototype[On]=function(){var kr=this.__chain__;if(Gt||kr){var Tr=D(this.__wrapped__),Br=Tr.__actions__=Mc(this.__actions__);return Br.push({func:Wn,args:arguments,thisArg:D}),Tr.__chain__=kr,Tr}return Wn.apply(D,Ss([this.value()],arguments))})}),D}function mGe(){return Zr._===this&&(Zr._=NT),this}function rz(){}function xGe(D){return D=Ti(D),ki(function(W){return Y5(W,D)})}var gGe=a6(Ir),bGe=a6(es),yGe=a6(Pr);function dde(D){return ds(D)?ei(ff(D)):lo(D)}function vGe(D){return function(W){return D==null?n:fp(D,W)}}var wGe=M8(),CGe=M8(!0);function sz(){return[]}function iz(){return!1}function SGe(){return{}}function NGe(){return""}function AGe(){return!0}function jGe(D,W){if(D=Ti(D),D<1||D>G)return[];var ge=ae,ze=ac(D,ae);W=$s(W),D-=ae;for(var mt=as(ze,W);++ge<D;)W(ge);return mt}function EGe(D){return yi(D)?Ir(D,ff):mf(D)?[D]:Mc(G8(Na(D)))}function _Ge(D){var W=++Cm;return Na(D)+W}var kGe=$2(function(D,W){return D+W},0),TGe=Ul("ceil"),IGe=$2(function(D,W){return D/W},1),PGe=Ul("floor");function FGe(D){return D&&D.length?gx(D,jd,Tm):n}function OGe(D,W){return D&&D.length?gx(D,$s(W,2),Tm):n}function MGe(D){return Ms(D,jd)}function RGe(D,W){return Ms(D,$s(W,2))}function LGe(D){return D&&D.length?gx(D,jd,Im):n}function DGe(D,W){return D&&D.length?gx(D,$s(W,2),Im):n}var BGe=$2(function(D,W){return D*W},1),$Ge=Ul("round"),UGe=$2(function(D,W){return D-W},0);function zGe(D){return D&&D.length?Vr(D,jd):0}function HGe(D,W){return D&&D.length?Vr(D,$s(W,2)):0}return Mt.after=rr,Mt.ary=Dr,Mt.assign=ZWe,Mt.assignIn=nde,Mt.assignInWith=yI,Mt.assignWith=JWe,Mt.at=eqe,Mt.before=$r,Mt.bind=Rr,Mt.bindAll=iGe,Mt.bindKey=os,Mt.castArray=SWe,Mt.chain=C6,Mt.chunk=p6,Mt.compact=K8,Mt.concat=Cd,Mt.cond=aGe,Mt.conforms=oGe,Mt.constant=ez,Mt.countBy=fI,Mt.create=tqe,Mt.curry=ms,Mt.curryRight=As,Mt.debounce=wo,Mt.defaults=nqe,Mt.defaultsDeep=rqe,Mt.defer=Xn,Mt.delay=Bn,Mt.difference=qi,Mt.differenceBy=Nl,Mt.differenceWith=Ho,Mt.drop=Vl,Mt.dropRight=Bu,Mt.dropRightWhile=Q1,Mt.dropWhile=al,Mt.fill=Y2,Mt.filter=A6,Mt.flatMap=a7,Mt.flatMapDeep=mI,Mt.flatMapDepth=o7,Mt.flatten=m6,Mt.flattenDeep=Q2,Mt.flattenDepth=cu,Mt.flip=Zn,Mt.flow=cGe,Mt.flowRight=uGe,Mt.fromPairs=Y8,Mt.functions=uqe,Mt.functionsIn=dqe,Mt.groupBy=_6,Mt.initial=x6,Mt.intersection=X8,Mt.intersectionBy=Rm,Mt.intersectionWith=g6,Mt.invert=hqe,Mt.invertBy=pqe,Mt.invokeMap=qU,Mt.iteratee=tz,Mt.keyBy=k6,Mt.keys=hc,Mt.keysIn=Ad,Mt.map=T6,Mt.mapKeys=xqe,Mt.mapValues=gqe,Mt.matches=dGe,Mt.matchesProperty=fGe,Mt.memoize=Wr,Mt.merge=bqe,Mt.mergeWith=rde,Mt.method=hGe,Mt.methodOf=pGe,Mt.mixin=nz,Mt.negate=js,Mt.nthArg=xGe,Mt.omit=yqe,Mt.omitBy=vqe,Mt.once=Ls,Mt.orderBy=tv,Mt.over=gGe,Mt.overArgs=Ds,Mt.overEvery=bGe,Mt.overSome=yGe,Mt.partial=Vs,Mt.partialRight=ol,Mt.partition=GU,Mt.pick=wqe,Mt.pickBy=sde,Mt.property=dde,Mt.propertyOf=vGe,Mt.pull=b6,Mt.pullAll=J2,Mt.pullAllBy=Bc,Mt.pullAllWith=Dm,Mt.pullAt=hf,Mt.range=wGe,Mt.rangeRight=CGe,Mt.rearg=na,Mt.reject=M,Mt.remove=uu,Mt.rest=$m,Mt.reverse=y6,Mt.sampleSize=me,Mt.set=Sqe,Mt.setWith=Nqe,Mt.shuffle=Pe,Mt.slice=Z8,Mt.sortBy=mn,Mt.sortedUniq=t7,Mt.sortedUniqBy=jx,Mt.split=Gqe,Mt.spread=KU,Mt.tail=iI,Mt.take=aI,Mt.takeRight=n7,Mt.takeRightWhile=v6,Mt.takeWhile=RU,Mt.tap=HU,Mt.throttle=vWe,Mt.thru=pf,Mt.toArray=Jue,Mt.toPairs=ide,Mt.toPairsIn=ade,Mt.toPath=EGe,Mt.toPlainObject=tde,Mt.transform=Aqe,Mt.unary=wWe,Mt.union=LU,Mt.unionBy=oI,Mt.unionWith=lI,Mt.uniq=Ex,Mt.uniqBy=DU,Mt.uniqWith=Z1,Mt.unset=jqe,Mt.unzip=w6,Mt.unzipWith=co,Mt.update=Eqe,Mt.updateWith=_qe,Mt.values=F6,Mt.valuesIn=kqe,Mt.without=BU,Mt.words=cde,Mt.wrap=CWe,Mt.xor=cI,Mt.xorBy=$U,Mt.xorWith=UU,Mt.zip=uI,Mt.zipObject=dI,Mt.zipObjectDeep=zU,Mt.zipWith=Sd,Mt.entries=ide,Mt.entriesIn=ade,Mt.extend=nde,Mt.extendWith=yI,nz(Mt,Mt),Mt.add=kGe,Mt.attempt=ude,Mt.camelCase=Fqe,Mt.capitalize=ode,Mt.ceil=TGe,Mt.clamp=Tqe,Mt.clone=NWe,Mt.cloneDeep=jWe,Mt.cloneDeepWith=EWe,Mt.cloneWith=AWe,Mt.conformsTo=_We,Mt.deburr=lde,Mt.defaultTo=lGe,Mt.divide=IGe,Mt.endsWith=Oqe,Mt.eq=wp,Mt.escape=Mqe,Mt.escapeRegExp=Rqe,Mt.every=hI,Mt.find=j6,Mt.findIndex=Mm,Mt.findKey=sqe,Mt.findLast=pI,Mt.findLastIndex=X2,Mt.findLastKey=iqe,Mt.floor=PGe,Mt.forEach=ev,Mt.forEachRight=E6,Mt.forIn=aqe,Mt.forInRight=oqe,Mt.forOwn=lqe,Mt.forOwnRight=cqe,Mt.get=QU,Mt.gt=kWe,Mt.gte=TWe,Mt.has=fqe,Mt.hasIn=ZU,Mt.head=Nx,Mt.identity=jd,Mt.includes=xI,Mt.indexOf=vp,Mt.inRange=Iqe,Mt.invoke=mqe,Mt.isArguments=nv,Mt.isArray=yi,Mt.isArrayBuffer=IWe,Mt.isArrayLike=Nd,Mt.isArrayLikeObject=ll,Mt.isBoolean=PWe,Mt.isBuffer=J1,Mt.isDate=FWe,Mt.isElement=OWe,Mt.isEmpty=MWe,Mt.isEqual=RWe,Mt.isEqualWith=LWe,Mt.isError=YU,Mt.isFinite=DWe,Mt.isFunction=kx,Mt.isInteger=Yue,Mt.isLength=gI,Mt.isMap=Xue,Mt.isMatch=BWe,Mt.isMatchWith=$We,Mt.isNaN=UWe,Mt.isNative=zWe,Mt.isNil=VWe,Mt.isNull=HWe,Mt.isNumber=Que,Mt.isObject=Fo,Mt.isObjectLike=Vo,Mt.isPlainObject=l7,Mt.isRegExp=XU,Mt.isSafeInteger=WWe,Mt.isSet=Zue,Mt.isString=bI,Mt.isSymbol=mf,Mt.isTypedArray=P6,Mt.isUndefined=qWe,Mt.isWeakMap=GWe,Mt.isWeakSet=KWe,Mt.join=Lm,Mt.kebabCase=Lqe,Mt.last=Dc,Mt.lastIndexOf=Z2,Mt.lowerCase=Dqe,Mt.lowerFirst=Bqe,Mt.lt=YWe,Mt.lte=XWe,Mt.max=FGe,Mt.maxBy=OGe,Mt.mean=MGe,Mt.meanBy=RGe,Mt.min=LGe,Mt.minBy=DGe,Mt.stubArray=sz,Mt.stubFalse=iz,Mt.stubObject=SGe,Mt.stubString=NGe,Mt.stubTrue=AGe,Mt.multiply=BGe,Mt.nth=Q8,Mt.noConflict=mGe,Mt.noop=rz,Mt.now=In,Mt.pad=$qe,Mt.padEnd=Uqe,Mt.padStart=zqe,Mt.parseInt=Hqe,Mt.random=Pqe,Mt.reduce=I6,Mt.reduceRight=A,Mt.repeat=Vqe,Mt.replace=Wqe,Mt.result=Cqe,Mt.round=$Ge,Mt.runInContext=bt,Mt.sample=Q,Mt.size=Ue,Mt.snakeCase=qqe,Mt.some=Ct,Mt.sortedIndex=J8,Mt.sortedIndexBy=MU,Mt.sortedIndexOf=Bm,Mt.sortedLastIndex=sI,Mt.sortedLastIndexBy=e7,Mt.sortedLastIndexOf=Ax,Mt.startCase=Kqe,Mt.startsWith=Yqe,Mt.subtract=UGe,Mt.sum=zGe,Mt.sumBy=HGe,Mt.template=Xqe,Mt.times=jGe,Mt.toFinite=Tx,Mt.toInteger=Ti,Mt.toLength=ede,Mt.toLower=Qqe,Mt.toNumber=ah,Mt.toSafeInteger=QWe,Mt.toString=Na,Mt.toUpper=Zqe,Mt.trim=Jqe,Mt.trimEnd=eGe,Mt.trimStart=tGe,Mt.truncate=nGe,Mt.unescape=rGe,Mt.uniqueId=_Ge,Mt.upperCase=sGe,Mt.upperFirst=JU,Mt.each=ev,Mt.eachRight=E6,Mt.first=Nx,nz(Mt,function(){var D={};return Lu(Mt,function(W,ge){_i.call(Mt.prototype,ge)||(D[ge]=W)}),D}(),{chain:!1}),Mt.VERSION=r,wr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(D){Mt[D].placeholder=Mt}),wr(["drop","take"],function(D,W){bi.prototype[D]=function(ge){ge=ge===n?1:zo(Ti(ge),0);var ze=this.__filtered__&&!W?new bi(this):this.clone();return ze.__filtered__?ze.__takeCount__=ac(ge,ze.__takeCount__):ze.__views__.push({size:ac(ge,ae),type:D+(ze.__dir__<0?"Right":"")}),ze},bi.prototype[D+"Right"]=function(ge){return this.reverse()[D](ge).reverse()}}),wr(["filter","map","takeWhile"],function(D,W){var ge=W+1,ze=ge==he||ge==ie;bi.prototype[D]=function(mt){var Gt=this.clone();return Gt.__iteratees__.push({iteratee:$s(mt,3),type:ge}),Gt.__filtered__=Gt.__filtered__||ze,Gt}}),wr(["head","last"],function(D,W){var ge="take"+(W?"Right":"");bi.prototype[D]=function(){return this[ge](1).value()[0]}}),wr(["initial","tail"],function(D,W){var ge="drop"+(W?"":"Right");bi.prototype[D]=function(){return this.__filtered__?new bi(this):this[ge](1)}}),bi.prototype.compact=function(){return this.filter(jd)},bi.prototype.find=function(D){return this.filter(D).head()},bi.prototype.findLast=function(D){return this.reverse().find(D)},bi.prototype.invokeMap=ki(function(D,W){return typeof D=="function"?new bi(this):this.map(function(ge){return bd(ge,D,W)})}),bi.prototype.reject=function(D){return this.filter(js($s(D)))},bi.prototype.slice=function(D,W){D=Ti(D);var ge=this;return ge.__filtered__&&(D>0||W<0)?new bi(ge):(D<0?ge=ge.takeRight(-D):D&&(ge=ge.drop(D)),W!==n&&(W=Ti(W),ge=W<0?ge.dropRight(-W):ge.take(W-D)),ge)},bi.prototype.takeRightWhile=function(D){return this.reverse().takeWhile(D).reverse()},bi.prototype.toArray=function(){return this.take(ae)},Lu(bi.prototype,function(D,W){var ge=/^(?:filter|find|map|reject)|While$/.test(W),ze=/^(?:head|last)$/.test(W),mt=Mt[ze?"take"+(W=="last"?"Right":""):W],Gt=ze||/^find/.test(W);mt&&(Mt.prototype[W]=function(){var bn=this.__wrapped__,On=ze?[1]:arguments,Wn=bn instanceof bi,kr=On[0],Tr=Wn||yi(bn),Br=function(zi){var Gi=mt.apply(Mt,Ss([zi],On));return ze&&ss?Gi[0]:Gi};Tr&&ge&&typeof kr=="function"&&kr.length!=1&&(Wn=Tr=!1);var ss=this.__chain__,Ts=!!this.__actions__.length,qs=Gt&&!ss,Pi=Wn&&!Ts;if(!Gt&&Tr){bn=Pi?bn:new bi(this);var Gs=D.apply(bn,On);return Gs.__actions__.push({func:pf,args:[Br],thisArg:n}),new oc(Gs,ss)}return qs&&Pi?D.apply(this,On):(Gs=this.thru(Br),qs?ze?Gs.value()[0]:Gs.value():Gs)})}),wr(["pop","push","shift","sort","splice","unshift"],function(D){var W=Xa[D],ge=/^(?:push|sort|unshift)$/.test(D)?"tap":"thru",ze=/^(?:pop|shift)$/.test(D);Mt.prototype[D]=function(){var mt=arguments;if(ze&&!this.__chain__){var Gt=this.value();return W.apply(yi(Gt)?Gt:[],mt)}return this[ge](function(bn){return W.apply(yi(bn)?bn:[],mt)})}}),Lu(bi.prototype,function(D,W){var ge=Mt[W];if(ge){var ze=ge.name+"";_i.call(P1,ze)||(P1[ze]=[]),P1[ze].push({name:W,func:ge})}}),P1[G1(n,N).name]=[{name:"wrapper",func:n}],bi.prototype.clone=L5,bi.prototype.reverse=p8,bi.prototype.value=M1,Mt.prototype.at=S6,Mt.prototype.chain=_x,Mt.prototype.commit=N6,Mt.prototype.next=r7,Mt.prototype.plant=VU,Mt.prototype.reverse=i7,Mt.prototype.toJSON=Mt.prototype.valueOf=Mt.prototype.value=WU,Mt.prototype.first=Mt.prototype.head,cp&&(Mt.prototype[cp]=s7),Mt},rn=_t();oi?((oi.exports=rn)._=rn,gi._=rn):Zr._=rn}).call(uin)}(Tj,Tj.exports)),Tj.exports}var fin=din();const xCe=ji(fin),hin=({wallet:e="",wallets:t=[]})=>{const[n,r]=m.useState([]),[s,a]=m.useState(!0),[o,l]=m.useState({key:null,direction:null}),c=C=>C.filter(Boolean).map(N=>{var I,P;return typeof N=="string"?N.toLowerCase():((P=(I=N==null?void 0:N.wallet_address)==null?void 0:I.toLowerCase)==null?void 0:P.call(I))||""}).filter(Boolean);m.useEffect(()=>{(async()=>{a(!0);const N=t&&t.length?c(t):[e];if(!N[0]){r([]),a(!1);return}const I=Date.now()-30*24*60*60*1e3;try{const R=(await Promise.all(N.map(F=>ls.post("https://api-ui.hyperliquid.xyz/info",{type:"userNonFundingLedgerUpdates",user:F,startTime:I})))).flatMap(F=>F.data||[]).sort((F,U)=>U.time-F.time);r(R)}catch(P){console.error("Error fetching transaction data:",P)}finally{a(!1)}})()},[e,JSON.stringify(t)]);const u=C=>{let N="asc";o.key===C&&(o.direction==="asc"?N="desc":o.direction==="desc"&&(N=null)),l({key:C,direction:N})},d=[...n].sort((C,N)=>{if(!o.key||!o.direction)return 0;const I=xCe.get(C,o.key),P=xCe.get(N,o.key);return I<P?o.direction==="asc"?-1:1:I>P?o.direction==="asc"?1:-1:0}),f=C=>{if(o.key===C){if(o.direction==="asc")return i.jsx(k3,{className:"inline ml-2 text-white"});if(o.direction==="desc")return i.jsx(_3,{className:"inline ml-2 text-white"})}return i.jsx(T3,{className:"inline ml-2 text-white"})},x=localStorage.getItem("isDateDepositWithdrawFormat")||"date",[g,v]=m.useState(x);m.useEffect(()=>{localStorage.setItem("isDateDepositWithdrawFormat",g)},[g]);const w=({date:C})=>{const[N,I]=m.useState(To(C));return m.useEffect(()=>{const P=setInterval(()=>I(To(C)),1e3);return()=>clearInterval(P)},[C]),i.jsx("span",{className:"text-white text-[13px] font-semibold font-manrope",children:N.dateTime})};return i.jsx("div",{className:"relative w-full text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:i.jsx("div",{className:"w-full overflow-scroll min-h-[60vh] max-h-[60vh] h-full mt-1 mb-3 bg-[#161616] rounded-lg pb-24",children:i.jsxs("table",{className:"w-full table-auto relative border-separate border-spacing-y-1",children:[i.jsx("thead",{className:"sticky top-0 bg-[#161616]",children:i.jsxs("tr",{className:"text-[#9b9b9b] text-left",children:[i.jsxs("th",{onClick:()=>u("time"),className:"cursor-pointer",children:["Time ",f("time")]}),i.jsxs("th",{onClick:()=>u("delta.type"),className:"cursor-pointer",children:["Type ",f("delta.type")]}),i.jsxs("th",{onClick:()=>u("asset"),className:"cursor-pointer",children:["Asset ",f("asset")]}),i.jsxs("th",{onClick:()=>u("delta.usdc"),className:"cursor-pointer",children:["Amount ",f("delta.usdc")]}),i.jsx("th",{children:"Transaction"})]})}),i.jsx("tbody",{children:s?i.jsx("tr",{children:i.jsx("td",{colSpan:5,className:"text-center p-4",children:"Loading…"})}):d.length===0?i.jsx("tr",{children:i.jsx("td",{colSpan:5,className:"text-center p-4",children:"No transactions available"})}):d.map((C,N)=>i.jsxs("tr",{className:"bg-[#1b1b1b] hover:bg-[#222222] h-[32px] text-white",children:[i.jsx("td",{className:"cursor-pointer",onClick:()=>v(g==="time"?"date":"time"),children:g==="time"?i.jsx(w,{date:C.time}):eu(C.time)}),i.jsx("td",{className:C.delta.type==="deposit"?"text-[#4ae3b5]":C.delta.type==="withdraw"?"text-[#ff6b6b]":"",children:C.delta.type?C.delta.type[0].toUpperCase()+C.delta.type.slice(1):"Unknown"}),i.jsx("td",{children:"-"}),i.jsxs("td",{children:["$",Er(+C.delta.usdc)]}),i.jsx("td",{className:"break-all",children:GD(C.hash)})]},N))})]})})})};function Tne(){return Tne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tne.apply(null,arguments)}function gCe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ine(e,t){return Ine=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Ine(e,t)}function pin(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ine(e,t)}var bCe=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function min(e,t){return!!(e===t||bCe(e)&&bCe(t))}function xin(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!min(e[n],t[n]))return!1;return!0}function zY(e,t){t===void 0&&(t=xin);var n,r=[],s,a=!1;function o(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];return a&&n===this&&t(l,r)||(s=e.apply(this,l),a=!0,n=this,r=l),s}return o}var gin=typeof performance=="object"&&typeof performance.now=="function",yCe=gin?function(){return performance.now()}:function(){return Date.now()};function vCe(e){cancelAnimationFrame(e.id)}function bin(e,t){var n=yCe();function r(){yCe()-n>=t?e.call(null):s.id=requestAnimationFrame(r)}var s={id:requestAnimationFrame(r)};return s}var HY=-1;function wCe(e){if(e===void 0&&(e=!1),HY===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),HY=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return HY}var iC=null;function CCe(e){if(e===void 0&&(e=!1),iC===null||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),s=r.style;return s.width="100px",s.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?iC="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?iC="negative":iC="positive-ascending"),document.body.removeChild(t),iC}return iC}var yin=150,vin=function(t,n){return t};function win(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,s=e.getItemSize,a=e.getOffsetForIndexAndAlignment,o=e.getStartIndexForOffset,l=e.getStopIndexForStartIndex,c=e.initInstanceProps,u=e.shouldResetStyleCacheOnItemSizeChange,d=e.validateProps;return t=function(f){pin(x,f);function x(v){var w;return w=f.call(this,v)||this,w._instanceProps=c(w.props,gCe(w)),w._outerRef=void 0,w._resetIsScrollingTimeoutId=null,w.state={instance:gCe(w),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof w.props.initialScrollOffset=="number"?w.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},w._callOnItemsRendered=void 0,w._callOnItemsRendered=zY(function(C,N,I,P){return w.props.onItemsRendered({overscanStartIndex:C,overscanStopIndex:N,visibleStartIndex:I,visibleStopIndex:P})}),w._callOnScroll=void 0,w._callOnScroll=zY(function(C,N,I){return w.props.onScroll({scrollDirection:C,scrollOffset:N,scrollUpdateWasRequested:I})}),w._getItemStyle=void 0,w._getItemStyle=function(C){var N=w.props,I=N.direction,P=N.itemSize,R=N.layout,F=w._getItemStyleCache(u&&P,u&&R,u&&I),U;if(F.hasOwnProperty(C))U=F[C];else{var L=n(w.props,C,w._instanceProps),z=s(w.props,C,w._instanceProps),X=I==="horizontal"||R==="horizontal",ne=I==="rtl",J=X?L:0;F[C]=U={position:"absolute",left:ne?void 0:J,right:ne?J:void 0,top:X?0:L,height:X?"100%":z,width:X?z:"100%"}}return U},w._getItemStyleCache=void 0,w._getItemStyleCache=zY(function(C,N,I){return{}}),w._onScrollHorizontal=function(C){var N=C.currentTarget,I=N.clientWidth,P=N.scrollLeft,R=N.scrollWidth;w.setState(function(F){if(F.scrollOffset===P)return null;var U=w.props.direction,L=P;if(U==="rtl")switch(CCe()){case"negative":L=-P;break;case"positive-descending":L=R-I-P;break}return L=Math.max(0,Math.min(L,R-I)),{isScrolling:!0,scrollDirection:F.scrollOffset<L?"forward":"backward",scrollOffset:L,scrollUpdateWasRequested:!1}},w._resetIsScrollingDebounced)},w._onScrollVertical=function(C){var N=C.currentTarget,I=N.clientHeight,P=N.scrollHeight,R=N.scrollTop;w.setState(function(F){if(F.scrollOffset===R)return null;var U=Math.max(0,Math.min(R,P-I));return{isScrolling:!0,scrollDirection:F.scrollOffset<U?"forward":"backward",scrollOffset:U,scrollUpdateWasRequested:!1}},w._resetIsScrollingDebounced)},w._outerRefSetter=function(C){var N=w.props.outerRef;w._outerRef=C,typeof N=="function"?N(C):N!=null&&typeof N=="object"&&N.hasOwnProperty("current")&&(N.current=C)},w._resetIsScrollingDebounced=function(){w._resetIsScrollingTimeoutId!==null&&vCe(w._resetIsScrollingTimeoutId),w._resetIsScrollingTimeoutId=bin(w._resetIsScrolling,yin)},w._resetIsScrolling=function(){w._resetIsScrollingTimeoutId=null,w.setState({isScrolling:!1},function(){w._getItemStyleCache(-1,null)})},w}x.getDerivedStateFromProps=function(w,C){return Cin(w,C),d(w),null};var g=x.prototype;return g.scrollTo=function(w){w=Math.max(0,w),this.setState(function(C){return C.scrollOffset===w?null:{scrollDirection:C.scrollOffset<w?"forward":"backward",scrollOffset:w,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},g.scrollToItem=function(w,C){C===void 0&&(C="auto");var N=this.props,I=N.itemCount,P=N.layout,R=this.state.scrollOffset;w=Math.max(0,Math.min(w,I-1));var F=0;if(this._outerRef){var U=this._outerRef;P==="vertical"?F=U.scrollWidth>U.clientWidth?wCe():0:F=U.scrollHeight>U.clientHeight?wCe():0}this.scrollTo(a(this.props,w,C,R,this._instanceProps,F))},g.componentDidMount=function(){var w=this.props,C=w.direction,N=w.initialScrollOffset,I=w.layout;if(typeof N=="number"&&this._outerRef!=null){var P=this._outerRef;C==="horizontal"||I==="horizontal"?P.scrollLeft=N:P.scrollTop=N}this._callPropsCallbacks()},g.componentDidUpdate=function(){var w=this.props,C=w.direction,N=w.layout,I=this.state,P=I.scrollOffset,R=I.scrollUpdateWasRequested;if(R&&this._outerRef!=null){var F=this._outerRef;if(C==="horizontal"||N==="horizontal")if(C==="rtl")switch(CCe()){case"negative":F.scrollLeft=-P;break;case"positive-ascending":F.scrollLeft=P;break;default:var U=F.clientWidth,L=F.scrollWidth;F.scrollLeft=L-U-P;break}else F.scrollLeft=P;else F.scrollTop=P}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&vCe(this._resetIsScrollingTimeoutId)},g.render=function(){var w=this.props,C=w.children,N=w.className,I=w.direction,P=w.height,R=w.innerRef,F=w.innerElementType,U=w.innerTagName,L=w.itemCount,z=w.itemData,X=w.itemKey,ne=X===void 0?vin:X,J=w.layout,Z=w.outerElementType,re=w.outerTagName,he=w.style,Y=w.useIsScrolling,ie=w.width,oe=this.state.isScrolling,G=I==="horizontal"||J==="horizontal",V=G?this._onScrollHorizontal:this._onScrollVertical,ee=this._getRangeToRender(),ae=ee[0],fe=ee[1],Ae=[];if(L>0)for(var ce=ae;ce<=fe;ce++)Ae.push(m.createElement(C,{data:z,key:ne(ce,z),index:ce,isScrolling:Y?oe:void 0,style:this._getItemStyle(ce)}));var ye=r(this.props,this._instanceProps);return m.createElement(Z||re||"div",{className:N,onScroll:V,ref:this._outerRefSetter,style:Tne({position:"relative",height:P,width:ie,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:I},he)},m.createElement(F||U||"div",{children:Ae,ref:R,style:{height:G?"100%":ye,pointerEvents:oe?"none":void 0,width:G?ye:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var w=this.props.itemCount;if(w>0){var C=this._getRangeToRender(),N=C[0],I=C[1],P=C[2],R=C[3];this._callOnItemsRendered(N,I,P,R)}}if(typeof this.props.onScroll=="function"){var F=this.state,U=F.scrollDirection,L=F.scrollOffset,z=F.scrollUpdateWasRequested;this._callOnScroll(U,L,z)}},g._getRangeToRender=function(){var w=this.props,C=w.itemCount,N=w.overscanCount,I=this.state,P=I.isScrolling,R=I.scrollDirection,F=I.scrollOffset;if(C===0)return[0,0,0,0];var U=o(this.props,F,this._instanceProps),L=l(this.props,U,F,this._instanceProps),z=!P||R==="backward"?Math.max(1,N):1,X=!P||R==="forward"?Math.max(1,N):1;return[Math.max(0,U-z),Math.max(0,Math.min(C-1,L+X)),U,L]},x}(m.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Cin=function(t,n){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,n.instance},Sin=win({getItemOffset:function(t,n){var r=t.itemSize;return n*r},getItemSize:function(t,n){var r=t.itemSize;return r},getEstimatedTotalSize:function(t){var n=t.itemCount,r=t.itemSize;return r*n},getOffsetForIndexAndAlignment:function(t,n,r,s,a,o){var l=t.direction,c=t.height,u=t.itemCount,d=t.itemSize,f=t.layout,x=t.width,g=l==="horizontal"||f==="horizontal",v=g?x:c,w=Math.max(0,u*d-v),C=Math.min(w,n*d),N=Math.max(0,n*d-v+d+o);switch(r==="smart"&&(s>=N-v&&s<=C+v?r="auto":r="center"),r){case"start":return C;case"end":return N;case"center":{var I=Math.round(N+(C-N)/2);return I<Math.ceil(v/2)?0:I>w+Math.floor(v/2)?w:I}case"auto":default:return s>=N&&s<=C?s:s<N?N:C}},getStartIndexForOffset:function(t,n){var r=t.itemCount,s=t.itemSize;return Math.max(0,Math.min(r-1,Math.floor(n/s)))},getStopIndexForStartIndex:function(t,n,r){var s=t.direction,a=t.height,o=t.itemCount,l=t.itemSize,c=t.layout,u=t.width,d=s==="horizontal"||c==="horizontal",f=n*l,x=d?u:a,g=Math.ceil((x+r-f)/l);return Math.max(0,Math.min(o-1,n+g-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}}),vO={exports:{}},Nin=vO.exports,SCe;function Ain(){return SCe||(SCe=1,function(e,t){(function(n,r){e.exports=r()})(Nin,function(){var n=1e3,r=6e4,s=36e5,a="millisecond",o="second",l="minute",c="hour",u="day",d="week",f="month",x="quarter",g="year",v="date",w="Invalid Date",C=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,N=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,I={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(he){var Y=["th","st","nd","rd"],ie=he%100;return"["+he+(Y[(ie-20)%10]||Y[ie]||Y[0])+"]"}},P=function(he,Y,ie){var oe=String(he);return!oe||oe.length>=Y?he:""+Array(Y+1-oe.length).join(ie)+he},R={s:P,z:function(he){var Y=-he.utcOffset(),ie=Math.abs(Y),oe=Math.floor(ie/60),G=ie%60;return(Y<=0?"+":"-")+P(oe,2,"0")+":"+P(G,2,"0")},m:function he(Y,ie){if(Y.date()<ie.date())return-he(ie,Y);var oe=12*(ie.year()-Y.year())+(ie.month()-Y.month()),G=Y.clone().add(oe,f),V=ie-G<0,ee=Y.clone().add(oe+(V?-1:1),f);return+(-(oe+(ie-G)/(V?G-ee:ee-G))||0)},a:function(he){return he<0?Math.ceil(he)||0:Math.floor(he)},p:function(he){return{M:f,y:g,w:d,d:u,D:v,h:c,m:l,s:o,ms:a,Q:x}[he]||String(he||"").toLowerCase().replace(/s$/,"")},u:function(he){return he===void 0}},F="en",U={};U[F]=I;var L="$isDayjsObject",z=function(he){return he instanceof Z||!(!he||!he[L])},X=function he(Y,ie,oe){var G;if(!Y)return F;if(typeof Y=="string"){var V=Y.toLowerCase();U[V]&&(G=V),ie&&(U[V]=ie,G=V);var ee=Y.split("-");if(!G&&ee.length>1)return he(ee[0])}else{var ae=Y.name;U[ae]=Y,G=ae}return!oe&&G&&(F=G),G||!oe&&F},ne=function(he,Y){if(z(he))return he.clone();var ie=typeof Y=="object"?Y:{};return ie.date=he,ie.args=arguments,new Z(ie)},J=R;J.l=X,J.i=z,J.w=function(he,Y){return ne(he,{locale:Y.$L,utc:Y.$u,x:Y.$x,$offset:Y.$offset})};var Z=function(){function he(ie){this.$L=X(ie.locale,null,!0),this.parse(ie),this.$x=this.$x||ie.x||{},this[L]=!0}var Y=he.prototype;return Y.parse=function(ie){this.$d=function(oe){var G=oe.date,V=oe.utc;if(G===null)return new Date(NaN);if(J.u(G))return new Date;if(G instanceof Date)return new Date(G);if(typeof G=="string"&&!/Z$/i.test(G)){var ee=G.match(C);if(ee){var ae=ee[2]-1||0,fe=(ee[7]||"0").substring(0,3);return V?new Date(Date.UTC(ee[1],ae,ee[3]||1,ee[4]||0,ee[5]||0,ee[6]||0,fe)):new Date(ee[1],ae,ee[3]||1,ee[4]||0,ee[5]||0,ee[6]||0,fe)}}return new Date(G)}(ie),this.init()},Y.init=function(){var ie=this.$d;this.$y=ie.getFullYear(),this.$M=ie.getMonth(),this.$D=ie.getDate(),this.$W=ie.getDay(),this.$H=ie.getHours(),this.$m=ie.getMinutes(),this.$s=ie.getSeconds(),this.$ms=ie.getMilliseconds()},Y.$utils=function(){return J},Y.isValid=function(){return this.$d.toString()!==w},Y.isSame=function(ie,oe){var G=ne(ie);return this.startOf(oe)<=G&&G<=this.endOf(oe)},Y.isAfter=function(ie,oe){return ne(ie)<this.startOf(oe)},Y.isBefore=function(ie,oe){return this.endOf(oe)<ne(ie)},Y.$g=function(ie,oe,G){return J.u(ie)?this[oe]:this.set(G,ie)},Y.unix=function(){return Math.floor(this.valueOf()/1e3)},Y.valueOf=function(){return this.$d.getTime()},Y.startOf=function(ie,oe){var G=this,V=!!J.u(oe)||oe,ee=J.p(ie),ae=function(Ie,Re){var Qe=J.w(G.$u?Date.UTC(G.$y,Re,Ie):new Date(G.$y,Re,Ie),G);return V?Qe:Qe.endOf(u)},fe=function(Ie,Re){return J.w(G.toDate()[Ie].apply(G.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(Re)),G)},Ae=this.$W,ce=this.$M,ye=this.$D,Ne="set"+(this.$u?"UTC":"");switch(ee){case g:return V?ae(1,0):ae(31,11);case f:return V?ae(1,ce):ae(0,ce+1);case d:var be=this.$locale().weekStart||0,je=(Ae<be?Ae+7:Ae)-be;return ae(V?ye-je:ye+(6-je),ce);case u:case v:return fe(Ne+"Hours",0);case c:return fe(Ne+"Minutes",1);case l:return fe(Ne+"Seconds",2);case o:return fe(Ne+"Milliseconds",3);default:return this.clone()}},Y.endOf=function(ie){return this.startOf(ie,!1)},Y.$set=function(ie,oe){var G,V=J.p(ie),ee="set"+(this.$u?"UTC":""),ae=(G={},G[u]=ee+"Date",G[v]=ee+"Date",G[f]=ee+"Month",G[g]=ee+"FullYear",G[c]=ee+"Hours",G[l]=ee+"Minutes",G[o]=ee+"Seconds",G[a]=ee+"Milliseconds",G)[V],fe=V===u?this.$D+(oe-this.$W):oe;if(V===f||V===g){var Ae=this.clone().set(v,1);Ae.$d[ae](fe),Ae.init(),this.$d=Ae.set(v,Math.min(this.$D,Ae.daysInMonth())).$d}else ae&&this.$d[ae](fe);return this.init(),this},Y.set=function(ie,oe){return this.clone().$set(ie,oe)},Y.get=function(ie){return this[J.p(ie)]()},Y.add=function(ie,oe){var G,V=this;ie=Number(ie);var ee=J.p(oe),ae=function(ce){var ye=ne(V);return J.w(ye.date(ye.date()+Math.round(ce*ie)),V)};if(ee===f)return this.set(f,this.$M+ie);if(ee===g)return this.set(g,this.$y+ie);if(ee===u)return ae(1);if(ee===d)return ae(7);var fe=(G={},G[l]=r,G[c]=s,G[o]=n,G)[ee]||1,Ae=this.$d.getTime()+ie*fe;return J.w(Ae,this)},Y.subtract=function(ie,oe){return this.add(-1*ie,oe)},Y.format=function(ie){var oe=this,G=this.$locale();if(!this.isValid())return G.invalidDate||w;var V=ie||"YYYY-MM-DDTHH:mm:ssZ",ee=J.z(this),ae=this.$H,fe=this.$m,Ae=this.$M,ce=G.weekdays,ye=G.months,Ne=G.meridiem,be=function(Re,Qe,Be,it){return Re&&(Re[Qe]||Re(oe,V))||Be[Qe].slice(0,it)},je=function(Re){return J.s(ae%12||12,Re,"0")},Ie=Ne||function(Re,Qe,Be){var it=Re<12?"AM":"PM";return Be?it.toLowerCase():it};return V.replace(N,function(Re,Qe){return Qe||function(Be){switch(Be){case"YY":return String(oe.$y).slice(-2);case"YYYY":return J.s(oe.$y,4,"0");case"M":return Ae+1;case"MM":return J.s(Ae+1,2,"0");case"MMM":return be(G.monthsShort,Ae,ye,3);case"MMMM":return be(ye,Ae);case"D":return oe.$D;case"DD":return J.s(oe.$D,2,"0");case"d":return String(oe.$W);case"dd":return be(G.weekdaysMin,oe.$W,ce,2);case"ddd":return be(G.weekdaysShort,oe.$W,ce,3);case"dddd":return ce[oe.$W];case"H":return String(ae);case"HH":return J.s(ae,2,"0");case"h":return je(1);case"hh":return je(2);case"a":return Ie(ae,fe,!0);case"A":return Ie(ae,fe,!1);case"m":return String(fe);case"mm":return J.s(fe,2,"0");case"s":return String(oe.$s);case"ss":return J.s(oe.$s,2,"0");case"SSS":return J.s(oe.$ms,3,"0");case"Z":return ee}return null}(Re)||ee.replace(":","")})},Y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Y.diff=function(ie,oe,G){var V,ee=this,ae=J.p(oe),fe=ne(ie),Ae=(fe.utcOffset()-this.utcOffset())*r,ce=this-fe,ye=function(){return J.m(ee,fe)};switch(ae){case g:V=ye()/12;break;case f:V=ye();break;case x:V=ye()/3;break;case d:V=(ce-Ae)/6048e5;break;case u:V=(ce-Ae)/864e5;break;case c:V=ce/s;break;case l:V=ce/r;break;case o:V=ce/n;break;default:V=ce}return G?V:J.a(V)},Y.daysInMonth=function(){return this.endOf(f).$D},Y.$locale=function(){return U[this.$L]},Y.locale=function(ie,oe){if(!ie)return this.$L;var G=this.clone(),V=X(ie,oe,!0);return V&&(G.$L=V),G},Y.clone=function(){return J.w(this.$d,this)},Y.toDate=function(){return new Date(this.valueOf())},Y.toJSON=function(){return this.isValid()?this.toISOString():null},Y.toISOString=function(){return this.$d.toISOString()},Y.toString=function(){return this.$d.toUTCString()},he}(),re=Z.prototype;return ne.prototype=re,[["$ms",a],["$s",o],["$m",l],["$H",c],["$W",u],["$M",f],["$y",g],["$D",v]].forEach(function(he){re[he[1]]=function(Y){return this.$g(Y,he[0],he[1])}}),ne.extend=function(he,Y){return he.$i||(he(Y,Z,ne),he.$i=!0),ne},ne.locale=X,ne.isDayjs=z,ne.unix=function(he){return ne(1e3*he)},ne.en=U[F],ne.Ls=U,ne.p={},ne})}(vO)),vO.exports}var jin=Ain();const VY=ji(jin),Ein=Se.forwardRef(function({style:t,...n},r){const s=t&&t.pointerEvents==="none"?{...t,pointerEvents:"auto"}:t;return i.jsx("div",{ref:r,style:s,...n})}),Pu=({data:e,columns:t,tableClassName:n,theadClassName:r,tbodyClassName:s,rowClassName:a,cellClassName:o,rowHeight:l=36,listHeight:c=500,rowKey:u,onVisibleRows:d,onRowClick:f,loading:x=!1,skeletonRowCount:g=10,skeletonRenderer:v,emptyState:w=null,loadingState:C=null})=>{const[N,I]=m.useState({key:null,direction:null}),[P,R]=m.useState({}),[F,U]=m.useState(null),[L,z]=m.useState(null),[X,ne]=m.useState({top:0,left:0}),J=m.useRef(null),Z=m.useRef(null);m.useEffect(()=>{function tt(at){J.current&&!J.current.contains(at.target)&&(U(null),z(null))}return document.addEventListener("mousedown",tt),()=>document.removeEventListener("mousedown",tt)},[]),m.useEffect(()=>{F&&(L==null?void 0:L.filterType)==="text"&&setTimeout(()=>{var tt;return(tt=Z.current)==null?void 0:tt.focus()},0)},[F,L]);function re(tt,at,dt){return tt.filter(ct=>at.every(Ut=>{const kt=dt[Ut.key];if(!Ut.filterType||!kt)return!0;const tn=ct[Ut.key];if(kt.filterType==="text"){const jt=kt.value||"";return tn==null?void 0:tn.toString().toLowerCase().includes(jt.toLowerCase())}if(kt.filterType==="select")return!kt.values||kt.values.length===0?!0:kt.values.includes(tn);if(kt.filterType==="dateRange"){if(!tn)return!1;const jt=VY(tn);return!(kt.start&&jt.isBefore(VY(kt.start))||kt.end&&jt.isAfter(VY(kt.end)))}if(kt.filterType==="numberRange"){const jt=parseFloat(kt.min),un=parseFloat(kt.max),cn=parseFloat(tn);return!(!isNaN(jt)&&cn<jt||!isNaN(un)&&cn>un)}return!0}))}function he(tt,at){if(!at.key||!at.direction)return tt;const dt=t.find(ct=>ct.key===at.key);return dt?[...tt].sort((ct,Ut)=>{const kt=dt.sortValue?dt.sortValue(ct):ct[at.key],tn=dt.sortValue?dt.sortValue(Ut):Ut[at.key],jt=kt==null||kt==="-",un=tn==null||tn==="-";return jt&&un?0:jt?1:un?-1:typeof kt=="number"&&typeof tn=="number"?at.direction==="asc"?kt-tn:tn-kt:typeof kt=="string"&&typeof tn=="string"?at.direction==="asc"?kt.localeCompare(tn):tn.localeCompare(kt):kt<tn?at.direction==="asc"?-1:1:kt>tn?at.direction==="asc"?1:-1:0}):tt}function Y(tt){I(at=>at.key===tt?at.direction==="asc"?{key:tt,direction:"desc"}:at.direction==="desc"?{key:null,direction:null}:{key:tt,direction:"asc"}:{key:tt,direction:"asc"})}function ie(tt){if(N.key===tt){if(N.direction==="asc")return i.jsx(k3,{className:"inline ml-1"});if(N.direction==="desc")return i.jsx(_3,{className:"inline ml-1"})}return i.jsx(T3,{className:"inline ml-1"})}function oe(tt,at){R(dt=>{const ct=dt[tt]||{};return{...dt,[tt]:{...ct,...at}}})}function G(tt){R(at=>{const dt={...at};return delete dt[tt],dt})}function V(tt,at){const dt=tt.currentTarget.getBoundingClientRect(),ct=dt.left+dt.width/2-192/2+window.scrollX,Ut=dt.bottom+window.scrollY;if(ne({top:Ut,left:ct}),F===at.key)U(null),z(null);else{U(at.key);const kt=P[at.key]||{};z({filterType:at.filterType,value:kt.value||"",values:kt.values||[],start:kt.start||"",end:kt.end||"",min:kt.min||"",max:kt.max||""})}}function ee(tt){L&&oe(tt,L),U(null),z(null)}function ae(tt){if(!L)return null;const at=L.filterType;return yre.createPortal(i.jsxs("div",{ref:J,style:{position:"absolute",top:X.top,left:X.left,zIndex:9999},children:[at==="text"&&i.jsxs("div",{className:"bg-black/10 border border-gray-400 text-white p-2 font-inter font-semibold shadow-xl w-48 rounded-2xl backdrop-blur-lg",children:[i.jsx("input",{ref:Z,type:"text",value:L.value,onChange:dt=>z(ct=>({...ct,value:dt.target.value})),className:"p-1 mb-2 border border-gray-600 bg-gray-600 text-white rounded w-full h-6"}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("button",{onClick:()=>{G(tt.key),U(null),z(null)},className:"text-xs px-2 py-1 bg-black/10 border border-[#FF797C] text-[#FF797C] font-semibold hover:bg-black/50",children:"Clear"}),i.jsx("button",{onClick:()=>ee(tt.key),className:"text-xs px-2 py-1 bg-[rgba(103,255,189,0.16)] text-[#67FFBD] font-semibold",children:"Apply"})]})]}),at==="select"&&i.jsxs("div",{className:"bg-black/10 border border-gray-400 text-white p-2 font-inter font-semibold shadow-xl w-48 max-h-48 overflow-y-auto rounded-2xl backdrop-blur-lg",children:[(tt.options||[]).map(dt=>{const ct=L.values,Ut=ct.includes(dt);return i.jsxs("label",{className:"block cursor-pointer hover:bg-gray-700 p-1 rounded",children:[i.jsx("input",{type:"checkbox",className:"mr-2",checked:Ut,onChange:()=>{z(Ut?kt=>({...kt,values:ct.filter(tn=>tn!==dt)}):kt=>({...kt,values:[...ct,dt]}))}}),dt]},dt)}),i.jsxs("div",{className:"flex justify-between mt-2",children:[i.jsx("button",{onClick:()=>{G(tt.key),U(null),z(null)},className:"text-xs px-2 py-1 bg-black/10 border border-[#FF797C] text-[#FF797C] font-semibold hover:bg-black/50",children:"Clear"}),i.jsx("button",{onClick:()=>ee(tt.key),className:"text-xs px-2 py-1 bg-[rgba(103,255,189,0.16)] text-[#67FFBD] font-semibold",children:"Apply"})]})]}),at==="dateRange"&&i.jsxs("div",{className:"bg-black/10 border border-gray-400 text-white p-2 font-inter font-semibold shadow-xl w-52 rounded-2xl backdrop-blur-lg",children:[i.jsxs("div",{className:"mb-2",children:[i.jsx("label",{className:"block text-xs mb-1",children:"Start"}),i.jsx("input",{type:"date",className:"p-1 mb-2 border border-gray-600 bg-gray-700 text-white rounded w-full h-6 text-xs",value:L.start,onChange:dt=>z(ct=>({...ct,start:dt.target.value}))})]}),i.jsxs("div",{className:"mb-2",children:[i.jsx("label",{className:"block text-xs mb-1",children:"End"}),i.jsx("input",{type:"date",className:"p-1 border border-gray-600 bg-gray-700 text-white rounded w-full h-6 text-xs",value:L.end,onChange:dt=>z(ct=>({...ct,end:dt.target.value}))})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("button",{onClick:()=>{G(tt.key),U(null),z(null)},className:"text-xs px-2 py-1 bg-black/10 border border-[#FF797C] text-[#FF797C] font-semibold hover:bg-black/50",children:"Clear"}),i.jsx("button",{onClick:()=>ee(tt.key),className:"text-xs px-2 py-1 bg-[rgba(103,255,189,0.16)] text-[#67FFBD] font-semibold",children:"Apply"})]})]}),at==="numberRange"&&i.jsxs("div",{className:"bg-black/10 border-2 border-gray-700 text-white p-2 font-inter font-semibold shadow-xl w-48 rounded-2xl backdrop-blur-lg",children:[i.jsxs("div",{className:"mb-2",children:[i.jsx("label",{className:"block text-xs mb-1",children:"Min"}),i.jsx("input",{type:"number",step:"any",className:"p-1 mb-2 border border-gray-600 bg-gray-700 text-white rounded w-full h-6",value:L.min,onChange:dt=>z(ct=>({...ct,min:dt.target.value}))})]}),i.jsxs("div",{className:"mb-2",children:[i.jsx("label",{className:"block text-xs mb-1",children:"Max"}),i.jsx("input",{type:"number",step:"any",className:"p-1 border border-gray-600 bg-gray-700 text-white rounded w-full h-6",value:L.max,onChange:dt=>z(ct=>({...ct,max:dt.target.value}))})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("button",{onClick:()=>{G(tt.key),U(null),z(null)},className:"text-xs px-2 py-1 bg-black/10 border border-[#FF797C] text-[#FF797C] font-semibold hover:bg-black/50",children:"Clear"}),i.jsx("button",{onClick:()=>ee(tt.key),className:"text-xs px-2 py-1 bg-[rgba(103,255,189,0.16)] text-[#67FFBD] font-semibold",children:"Apply"})]})]})]}),document.body)}const fe=Array.isArray(e)?e:[],Ae=x?[]:he(re(fe,t,P),N),ce=t.map(tt=>tt.width||"minmax(0, 100%)").join(" "),ye=t.map((tt,at)=>typeof tt.skeletonWidth=="number"?tt.skeletonWidth:60+at*23%80),Ne=Object.keys(P).length>0,be=!x&&Ae.length===0;function je({w:tt}){return i.jsx("span",{className:"block h-[14px] rounded bg-[#242424] animate-pulse",style:{width:tt}})}function Ie({index:tt,style:at}){return i.jsx("div",{style:{...at,display:"grid",gridTemplateColumns:ce,alignItems:"center"},className:`relative bg-[#1b1b1b] text-white rounded-xl my-[1px] h-[32px] max-h-[32px] leading-[32px] font-inter text-sm font-semibold ${typeof a=="function"?a({},tt)||"":a||""}`,children:t.map((dt,ct)=>i.jsx("div",{className:`px-4 ${typeof o=="function"?o(dt,{},tt)||"":o||""}`,children:v?v({column:dt,index:tt,width:ye[ct]}):i.jsx(je,{w:ye[ct]})},`sk-${dt.key}-${ct}`))})}function Re({index:tt,style:at}){if(tt<0||tt>=Ae.length)return null;const dt=Ae[tt];return i.jsx("div",{onClick:()=>f&&f(dt),style:{...at,display:"grid",gridTemplateColumns:ce,alignItems:"center"},className:`relative group bg-[#1b1b1b] hover:bg-[#222222] text-white rounded-xl my-[1px] h-[32px] max-h-[32px] leading-[32px] font-inter text-sm font-semibold ${typeof a=="function"?a(dt,tt)||"":a||""}`,children:t.map(ct=>{const Ut=ct.render?ct.render(dt[ct.key],dt,tt):dt[ct.key];return i.jsx("div",{className:`px-4 overflow-hidden whitespace-nowrap ${typeof o=="function"?o(ct,dt,tt)||"":o||""}`,children:Ut},ct.key)})})}const Qe=x?g:Ae.length,Be=x?void 0:u?tt=>u(Ae[tt]):void 0,it=tt=>tt.headerTooltip?i.jsx(fi,{content:tt.headerTooltip,align:tt.headerTooltipAlign||"center",children:i.jsx("span",{className:"inline-flex underline decoration-dotted underline-offset-2 cursor-help pointer-events-auto",children:tt.label})}):tt.label;return i.jsx("div",{className:`w-full relative ${n||""}`,children:i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("div",{className:"min-w-max",children:[i.jsx("div",{className:`sticky top-0 z-10 bg-[#161616] font-inter text-sm font-bold text-white ${r||""}`,style:{display:"grid",gridTemplateColumns:ce},children:t.map(tt=>i.jsxs("div",{className:"px-3 py-1 text-left inline-flex items-center w-fit hover:bg-[#262626] hover:rounded-[6px] hover:text-white cursor-pointer transition-all",onClick:()=>!x&&tt.sortable&&Y(tt.key),children:[it(tt),tt.sortable&&i.jsx("span",{className:"ml-1",children:ie(tt.key)}),tt.filterType&&i.jsx("span",{className:"ml-2 cursor-pointer",onClick:at=>{at.stopPropagation(),x||V(at,tt)},children:i.jsx(N6t,{className:"w-3 h-3"})}),F===tt.key&&ae(tt)]},tt.key))}),x&&C?i.jsx("div",{className:`${s||""} min-w-max`,children:typeof C=="function"?C({hasFilters:Ne}):C}):be?i.jsx("div",{className:`${s||""} min-w-max text-xs text-center text-[#9B9B9B]`,children:typeof w=="function"?w({hasFilters:Ne}):w}):i.jsx(Sin,{className:`${s||""} min-w-max`,height:c,itemCount:Qe,itemSize:l,itemKey:Be,innerElementType:Ein,width:"100%",onItemsRendered:({visibleStartIndex:tt,visibleStopIndex:at})=>!x&&d&&d(Ae.slice(tt,at+1)),children:x?Ie:Re})]})})})},BP=e=>Number(e).toLocaleString("en-US",{maximumFractionDigits:2}),_in=e=>!isFinite(e)||isNaN(e)?"-":`${Math.floor(e)}h ${Math.round((e-Math.floor(e))*60)}m`,kin=(e,t,n,r)=>{const s=e*t/n;return r/s*100};function Tin({trades:e,generatedWallets:t,wallet:n,wallets:r}){const[s,a]=m.useState(!1),[o,l]=m.useState(null),[c,u]=m.useState(()=>new Map),[d,f]=m.useState(new Map),[x,g]=m.useState(new Map),[v,w]=m.useState([]),[C,N]=m.useState(!0),I=m.useRef(new Set),P=m.useRef(new Set),{isReferralCodeName:R}=m.useContext(Gr),F=m.useCallback(G=>{const V=G==null?void 0:G.toLowerCase();return V?(r==null?void 0:r.length)>0?r.some(ee=>{var ae;return((ae=ee.wallet_address)==null?void 0:ae.toLowerCase())===V}):(n==null?void 0:n.toLowerCase())===V:!1},[r,n]),U=m.useMemo(()=>r&&r.length?v:Array.isArray(e)?e:[],[r,v,e]),L=m.useCallback(async G=>{const V=localStorage.getItem("hyperAddress"),ee=localStorage.getItem("hyperToken");if(!(!V||!ee||G.length===0))try{const{data:ae}=await ls.post("https://dextrabothypev2.nftinit.io/api/hyper/order/get_leverage_with_oids/",{address:V,token:ee,position_oids:G},{headers:{"Content-Type":"application/json"}});if(ae&&ae.success){const fe=parseFloat(ae.leverage);f(Ae=>{const ce=new Map(Ae);return G.forEach(ye=>ce.set(String(ye),fe)),ce})}}catch(ae){console.error("leverage fetch error:",ae)}},[]),z=m.useCallback(async G=>{const V=localStorage.getItem("hyperAddress"),ee=localStorage.getItem("hyperToken");if(!(!V||!ee||G.length===0))try{const{data:ae}=await ls.post("https://dextrabothypev2.nftinit.io/api/hyper/order/get_position_details_with_oids/",{address:V,token:ee,position_oids:G},{headers:{"Content-Type":"application/json"}});ae&&ae.success&&g(fe=>{const Ae=new Map(fe);return ae.data.forEach(ce=>Ae.set(String(ce.oid),ce)),Ae})}catch(ae){console.error("source details fetch error:",ae)}},[]),X=m.useMemo(()=>(r??[]).map(G=>{var V;return(V=G.wallet_address)==null?void 0:V.toLowerCase()}).sort().join(","),[r]);m.useEffect(()=>{if(X===""){N(!1),w([]);return}let G=!1;return N(!0),a(!1),I.current.clear(),P.current.clear(),f(new Map),g(new Map),u(new Map),(async()=>{try{const V=X.split(","),ee=(await Promise.all(V.map(async fe=>{const[Ae,ce]=await Promise.all([Oce(fe),Mce(fe)]),ye=[...Ae,...ce.map(({fill:Ne,twapId:be})=>({...Ne,twapId:be}))];return Rce(ye).closed_positions||[]}))).flat();if(G)return;const ae=ee.sort((fe,Ae)=>(Ae.close_time||0)-(fe.close_time||0));w(ae),l(null)}catch(V){console.error("multi-wallet completed-trades fetch:",V)}finally{G||N(!1)}})(),()=>{G=!0}},[X]);const ne=m.useCallback(G=>{const V=new Set,ee=new Set;G.forEach(ae=>{((t==null?void 0:t.some(Ae=>F(Ae.wallet_address)))||!1)&&ae.has_builder_fee&&(ae.oids||[]).forEach(Ae=>{I.current.has(Ae)||V.add(Ae),P.current.has(Ae)||ee.add(Ae)})}),V.size>0&&(V.forEach(ae=>I.current.add(ae)),L([...V])),ee.size>0&&(ee.forEach(ae=>P.current.add(ae)),z([...ee]))},[t,F,L,z]);function J({date:G}){const[V,ee]=m.useState(To(G));return m.useEffect(()=>{const ae=setInterval(()=>{ee(To(G))},1e3);return()=>clearInterval(ae)},[G]),i.jsx("span",{className:"text-white text-sm font-bold font-manrope leading-[13px] tracking-[0.18px] min-w-max",children:V.dateTime})}const Z=G=>u(V=>new Map(V).set(G,!V.get(G))),re=(G,V)=>c.get(V)?i.jsx(J,{date:G}):eu(G),he=m.useMemo(()=>[...new Set(U.map(G=>G.coin))],[U]),Y=m.useMemo(()=>U.map(G=>({...G,uid:G.trade_id||G.oid||`${G.open_time}_${G.close_time}`,liqStatus:G.isLiquidated?"Liquidated":"Not Liquidated"})).sort((G,V)=>(V.close_time||0)-(G.close_time||0)),[U]),ie=async G=>{var ye;const V=localStorage.getItem("hyperAddress"),ee=localStorage.getItem("hyperToken"),ae=G.oids??[];let fe=G.leverage??G.positionDistribution??0;if(V&&ee&&ae.length>0)try{fe=((ye=(await ls.post("https://dextrabothypev2.nftinit.io/api/hyper/order/get_leverage_with_oids/",{address:V,token:ee,position_oids:ae},{headers:{"Content-Type":"application/json"}})).data)==null?void 0:ye.leverage)??fe}catch(Ne){console.error("Leverage fetch failed:",Ne)}const Ae=kin(G.entry_price_wma,G.total_size,fe,G.total_pnl),ce=Ne=>Math.abs(Ne)<1?Ne.toFixed(4):Ne.toFixed(2);l({coin:G.coin,type:G.position_side,leverage:fe,roe:ce(Ae),entryPrice:G.entry_price_wma,markPrice:G.close_px,positionDistribution:G.total_size,pnl:G.total_pnl-G.total_fee,closePx:G.close_px,referral:R??"--"}),a(!0)},oe=m.useMemo(()=>[{key:"coin",label:"Coin",sortable:!0,filterType:"text",render:(G,V)=>i.jsxs("a",{href:`/terminal/${V.coin}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center text-white hover:text-gray-400",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${V.coin}.svg`,alt:V.coin,className:"w-5 h-5 mr-2",loading:"lazy",onError:ea}),V.coin]})},{key:"source_tag",label:"Source Tag",sortable:!0,filterType:"text",render:(G,V)=>{const ee=x.get(V.oids&&String(V.oids[0]));return ee?i.jsx("a",{href:`/wallet-details/${ee.copy_trader_wallet}`,className:"text-white hover:text-white",children:ee.source_tag||"--"}):"--"}},{key:"position_side",label:"Direction",sortable:!0,filterType:"text",render:(G,V)=>{const ae={Sell:"Sell",Buy:"Buy","Close Short":"Short","Close Long":"Long","Open Short":"Short","Open Long":"Long"}[G]??G??"--",fe=["buy","long"].includes(ae.toLowerCase()),Ae=["sell","short"].includes(ae.toLowerCase()),ce=(()=>{if(!(((t==null?void 0:t.some(be=>F(be.wallet_address)))||!1)&&V.has_builder_fee))return"";const Ne=d.get(V.oids&&String(V.oids[0]));return Ne?` - ${Ne}x`:""})();return i.jsxs("div",{className:`h-5 pl-1 pr-1.5 py-1 rounded-md inline-flex items-center gap-0.5 ${fe?"text-[#67ffbd] bg-[#67ffbd]/20":Ae?"text-[#ff787b] bg-[#ff797c]/20":"text-white"}`,children:[i.jsx(Es,{className:`w-3 h-3 ${fe?"fill-[#67ffbd] rotate-180":Ae?"fill-[#ff787b]":""}`}),i.jsxs("span",{className:"text-[11px] font-semibold uppercase",children:[ae,ce," "]})]})}},{key:"total_size",label:"Size",sortable:!0,filterType:"numberRange",render:BP},{key:"entry_price_wma",label:"Entry Price",sortable:!0,filterType:"numberRange",render:BP},{key:"close_px",label:"Close Price",sortable:!0,filterType:"numberRange",render:BP},{key:"total_pnl",label:"PnL",sortable:!0,filterType:"numberRange",sortValue:G=>G.total_pnl-G.total_fee,render:(G,V)=>{const ee=(t==null?void 0:t.some(ae=>F(ae.wallet_address)))||!1;return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:V.total_pnl-V.total_fee>0?"text-[#4ae3b5]":V.total_pnl-V.total_fee<0?"text-[#ff6b6b]":"text-white",children:["$",BP(Math.abs(V.total_pnl-V.total_fee))]}),ee&&V.has_builder_fee&&i.jsx("img",{src:cm,alt:"share",className:"w-4 h-4 cursor-pointer",onClick:ae=>{ae.stopPropagation(),ie(V)}})]})}},{key:"total_fee",label:"Fee (USDC)",sortable:!0,filterType:"numberRange",width:"240px",render:(G,V)=>i.jsxs("span",{children:[Er(parseFloat(V.total_fee))," ",V.builder_fee?i.jsxs("span",{className:"text-xs",children:["(",Er(parseFloat(V.builder_fee))," builder fee)"]}):""]})},{key:"duration_hours",label:"Duration",sortable:!0,filterType:"numberRange",render:_in},{key:"open_time",label:"Opened",sortable:!0,filterType:"dateRange",render:(G,V)=>i.jsx("div",{onClick:()=>Z(V.uid),className:"cursor-pointer",children:re(V.open_time,V.uid)}),width:"200px"},{key:"close_time",label:"Closed",sortable:!0,filterType:"dateRange",render:(G,V)=>i.jsx("div",{onClick:()=>Z(V.uid),className:"cursor-pointer",children:re(V.close_time,V.uid)}),width:"200px"}],[he,c,d,x,t,F]);return i.jsxs(i.Fragment,{children:[C?i.jsx("div",{className:"py-4 text-center text-white font-bold",children:"Loading…"}):U.length===0?i.jsx("div",{className:"py-4 text-center text-white font-bold",children:"No completed trades"}):i.jsx(Pu,{data:Y,columns:oe,tableClassName:"min-w-full border-separate border-spacing-y-1",theadClassName:"sticky top-0 bg-[#161616]",rowClassName:"bg-[#1b1b1b] hover:bg-[#222222] text-white",rowKey:G=>G.uid,onVisibleRows:ne}),s&&i.jsx(hT,{open:s,setOpen:a,data:o,setShare:()=>{},setTradeInfo:()=>{},pnlTitle:"REALIZED PNL"})]})}const Iin=({data:e,setData:t,wallet:n,coinNameData:r})=>{var G;const[s,a]=m.useState(!1),[o,l]=m.useState(!1),[c,u]=m.useState(!1),[d,f]=m.useState(""),[x,g]=m.useState(""),v=m.useRef(null),w=m.useRef(null),N=localStorage.getItem("isDateTwapFillsFormat")||"date",[I,P]=m.useState(N);m.useEffect(()=>{localStorage.setItem("isDateTwapFillsFormat",I)},[I]);const R="-time",[F,U]=m.useState(R),L=V=>{const ee=r.find(ae=>ae.label===V);return ee?ee.value.toUpperCase():V==null?void 0:V.toUpperCase()},z=e==null?void 0:e.filter(V=>d?L(V.coin).includes(d.toUpperCase()):!0).filter(V=>{var ee,ae;return x?(ae=(ee=V==null?void 0:V.oid)==null?void 0:ee.toString())==null?void 0:ae.includes(x):!0}),X=V=>z==null?void 0:z.sort((ee,ae)=>{const fe=ee.coin?ee.coin.toUpperCase():"",Ae=ae.coin?ae.coin.toUpperCase():"",ce=je=>parseFloat(je.closedPnl||0)-parseFloat(je.fee||0),ye=(je="")=>{const Ie=je.toLowerCase(),Re=Ie.includes("long")||Ie==="buy",Qe=Ie.includes("short")||Ie==="sell";return Re&&!Qe?3:Re&&Qe?2:Qe&&!Re?1:0},Ne=parseFloat(ee.sz)*parseFloat(ee.px),be=parseFloat(ae.sz)*parseFloat(ae.px);return V==="-price"?ae.px-ee.px:V==="price"?ee.px-ae.px:V==="-size"?ae.sz-ee.sz:V==="size"?ee.sz-ae.sz:V==="-fee"?ae.fee-ee.fee:V==="fee"?ee.fee-ae.fee:V==="-closedPnl"?ce(ae)-ce(ee):V==="closedPnl"?ce(ee)-ce(ae):V==="-oid"?ae.oid-ee.oid:V==="oid"?ee.oid-ae.oid:V==="-coin"?fe<Ae?-1:fe>Ae?1:0:V==="coin"?fe>Ae?-1:fe<Ae?1:0:V==="-time"?new Date(ae.time)-new Date(ee.time):V==="time"?new Date(ee.time)-new Date(ae.time):V==="-dir"?ye(ae.dir)-ye(ee.dir):V==="dir"?ye(ee.dir)-ye(ae.dir):V==="-tradeValue"?be-Ne:V==="tradeValue"?Ne-be:0});m.useEffect(()=>{(async()=>{try{a(!0);const ee=await ls.post("https://api-ui.hyperliquid.xyz/info",{type:"userTwapSliceFills",user:n}),fe=((ee==null?void 0:ee.data)||[]).map(Ae=>({...Ae.fill,twapId:Ae.twapId||null}));t(fe==null?void 0:fe.sort((Ae,ce)=>ce.time-Ae.time))}catch(ee){console.error("Error fetching twap data:",ee)}finally{a(!1)}})()},[n]),m.useEffect(()=>{function V(ee){v.current&&!v.current.contains(ee.target)&&l(!1),w.current&&!w.current.contains(ee.target)&&u(!1)}return document.addEventListener("mousedown",V),()=>document.removeEventListener("mousedown",V)},[]);const ne=m.useRef(null),J=()=>{ne.current&&(ne.current.scrollLeft-=200)},Z=()=>{ne.current&&(ne.current.scrollLeft+=200)},re=()=>{ne.current&&(ne.current.scrollTop+=200)},he=()=>{ne.current&&(ne.current.scrollTop-=200)},Y=V=>V>=640&&V<1024?5:V>=1024&&V<1240?8:V>=1240&&V<1540||V>=1540?9:4;function ie({date:V}){const[ee,ae]=m.useState(To(V));return m.useEffect(()=>{const fe=setInterval(()=>{ae(To(V))},1e3);return()=>clearInterval(fe)},[V]),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[13px] tracking-[0.18px] min-w-max",children:ee.dateTime})}const oe={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return i.jsxs("div",{className:"relative w-full ",children:[i.jsxs("div",{className:"absolute -top-6 right-2 z-10 justify-start items-center gap-2 hidden lg:flex",children:[i.jsx("button",{onClick:J,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Pl,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:Z,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Pl,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:he,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Pl,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:re,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Pl,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{ref:ne,className:"w-full  overflow-scroll min-h-[60vh] max-h-[60vh] h-full flex-grow mt-1 mb-3 bg-[#161616] rounded-lg pb-24",children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] font-semibold leading-[13px] tracking-[0.26px] text-[#9b9b9b] text-[13px] font-manrope mr-3",children:[i.jsx(NCe,{className:"bg-[#161616] h-10 pl-2 sm:pl-6 min-w-[180px] sm:min-w-[220px] z-[8]",title:"Time",sortKey:"time",sortOption:F,setSortOption:U}),i.jsx("th",{scope:"col",className:"pl-4 min-w-[120px] max-w-[120px] sm:min-w-[150px] sm:max-w-[150px] px-1",children:i.jsxs("div",{className:"flex justify-start items-center gap-2 relative",children:[i.jsx(ci,{title:"Coin",sortKey:"coin",sortOption:F,setSortOption:U,isFilterIcon:!1}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>l(!o),className:`${d?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx(Ff,{className:`w-4 h-4 ${d?"text-blue-500":"text-white"}`})}),o&&i.jsxs("div",{ref:v,className:`absolute left-[58px] mt-32 w-[208px]
                               bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>f(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"text",value:d,onChange:V=>f(V.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2  placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Coin"})]})]})]})}),i.jsx(NCe,{className:"pl-4 min-w-[120px] max-w-[120px] sm:min-w-[130px] sm:max-w-[130px] px-1",title:"Direction",sortKey:"dir",sortOption:F,setSortOption:U}),i.jsx(G7,{className:"min-w-[70px] max-w-[70px] sm:min-w-[100px] sm:max-w-[100px] px-1",title:"Price",sortKey:"price",sortOption:F,setSortOption:U}),i.jsx(G7,{className:"min-w-[90px] max-w-[90px] sm:min-w-[130px] sm:max-w-[130px] px-1",title:"Size",sortKey:"size",sortOption:F,setSortOption:U}),i.jsx(G7,{className:"min-w-[130px] max-w-[130px] sm:min-w-[150px] sm:max-w-[150px] px-1",title:"Trade Value",sortKey:"tradeValue",sortOption:F,setSortOption:U}),i.jsx(G7,{className:"min-w-[90px] max-w-[90px] sm:min-w-[120px] sm:max-w-[120px] px-1",title:"Fee",sortKey:"fee",sortOption:F,setSortOption:U}),i.jsx(G7,{className:"min-w-[120px] max-w-[120px] sm:min-w-[150px] sm:max-w-[150px] px-1",title:"Closed PnL",sortKey:"closedPnl",sortOption:F,setSortOption:U}),i.jsx("th",{scope:"col",className:"min-w-[160px] max-w-[160px] sm:min-w-[200px] sm:max-w-[200px] pl-1 pr-8",children:i.jsxs("div",{className:"flex justify-end items-center gap-2",children:[i.jsx(ci,{title:"Order ID",sortKey:"oid",sortOption:F,setSortOption:U,isFilterIcon:!0}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>u(!c),className:`${x?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx(Ff,{className:`w-4 h-4 ${x?"text-blue-500":"text-white"}`})}),c&&i.jsxs("div",{ref:w,className:`absolute right-[30px] mt-32 w-[208px]
                               bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>g(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"number",value:x,onChange:V=>g(V.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2  placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Order ID"})]})]})]})})]})}),i.jsx("tbody",{children:s||X(F).length==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:Y(window.innerWidth),className:"h-[36vh]",children:i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-[100%] sm:w-[75%] max-w-[300px] sm:max-w-[700px] justify-center items-center text-center",children:s?i.jsx(Ma,{}):i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ec,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No TWAP fills available at the moment."}),i.jsx("div",{className:"text-center -mt-2",children:i.jsx("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"Your TWAP orders will appear here once they start executing."})})]})]})})})})}):(G=X(F))==null?void 0:G.map((V,ee)=>{var ae,fe,Ae,ce,ye,Ne;return i.jsxs(Se.Fragment,{children:[i.jsxs("tr",{className:"relative group bg-[#1b1b1b] hover:bg-[#222222] h-[32px] max-h-[32px] text-white rounded-2xl",style:{margin:"2px"},children:[i.jsx("td",{scope:"row",onClick:()=>{P(I=="time"?"date":"time")},className:"bg-[#1b1b1b] group-hover:bg-[#222222] sm:rounded-l-2xl cursor-pointer",children:i.jsx("div",{className:"pl-2 sm:pl-5 flex flex-col items-start gap-2 font-manrope min-w-max text-white text-sm font-normal leading-[13px] tracking-[0.18px]",children:I=="time"?i.jsx(ie,{date:V.time}):eu(V.time)})}),i.jsx("td",{className:"text-left cursor-pointer",children:i.jsx("div",{onClick:()=>{var be;window.open(`/terminal/${((be=r==null?void 0:r.find(je=>je.label===V.coin))==null?void 0:be.value)||V.coin}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-4 h-8 max-h-14 rounded-2xl cursor-pointer",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"w-5 h-5 rounded-full",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${((ae=r==null?void 0:r.find(be=>be.label===V.coin))==null?void 0:ae.value)||oe[V.coin]||((fe=V.coin)==null?void 0:fe.split("/")[0])}.svg`||Ua,alt:V==null?void 0:V.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:be=>ea(be)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:(()=>{const be=r.find(je=>je.label===V.coin);return be?be.value:V.coin})()})]})})}),i.jsx("td",{scope:"row",className:"z-[2] pl-3 bg-[#1b1b1b] group-hover:bg-[#222222]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-8 max-h-8",children:i.jsx("div",{className:"text-white h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex",children:i.jsx("div",{className:`text-left ${V!=null&&V.liquidation?"text-white":(Ae=V.dir)!=null&&Ae.includes("Short")||(ce=V.dir)!=null&&ce.includes("Sell")?"text-[#ff6b6b]":(ye=V.dir)!=null&&ye.includes("Long")||(Ne=V.dir)!=null&&Ne.includes("Buy")?"text-[#4ae3b5]":"text-white"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:V!=null&&V.liquidation?"Liquidation":V.dir?V.dir:"--"})})})}),i.jsx("td",{scope:"row",className:"z-[2] pl-4 bg-[#1b1b1b] group-hover:bg-[#222222]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-end items-center gap-2 h-8 max-h-8",children:i.jsx("div",{className:"text-white h-5 pl-1 pr-1.5 py-1 rounded-md justify-end items-center gap-0.5 inline-flex",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:V.px!=null&&!isNaN(parseFloat(V.px))?`$${parseFloat(V.px).toFixed(2)}`:"--"})})})}),i.jsx("td",{children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:V.sz!=null&&!isNaN(parseFloat(V.sz))?Er(parseFloat(V.sz)):"--"})})}),i.jsx("td",{children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:V.px!=null&&V.sz!=null&&!isNaN(parseFloat(V.px))&&!isNaN(parseFloat(V.sz))?i.jsxs(i.Fragment,{children:["$",Er(parseFloat(V.px)*parseFloat(V.sz))]}):"--"})})}),i.jsx("td",{children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:V.fee!=null&&!isNaN(parseFloat(V.fee))?Er(parseFloat(V.fee)):"--"})})}),i.jsx("td",{children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:`text-left ${parseFloat(V.closedPnl)-parseFloat(V.fee)>0?"text-[#4ae3b5]":parseFloat(V.closedPnl)-parseFloat(V.fee)<0?"text-[#ff6b6b]":"text-white"} text-sm font-normal font-manrope leading-[13px] tracking-[0.18px]`,children:V.closedPnl!=null&&V.fee!=null&&!isNaN(parseFloat(V.closedPnl))&&!isNaN(parseFloat(V.fee))?i.jsxs(i.Fragment,{children:["$",Er(Math.abs(parseFloat(V.closedPnl)-parseFloat(V.fee)))]}):"--"})})}),i.jsx("td",{className:"sm:rounded-r-2xl mr-3",children:i.jsx("div",{className:"pl-1 pr-8 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-left  text-[#979797] text-sm font-normal font-manrope leading-[13px] tracking-[0.18px]",children:V!=null&&V.oid?V==null?void 0:V.oid:"--"})})})]},ee),i.jsx("tr",{children:i.jsx("td",{colSpan:"100",style:{height:"2px"}})})]},ee)})})]})})]})},G7=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(ci,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!0})}),NCe=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(ci,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!1})}),aC="https://api-ui.hyperliquid.xyz/info",Pin="wss://api.hyperliquid.xyz/ws",WUe=({initialAddress:e="",wallets:t})=>{var la,jr,Xt;m.useState(e);const[n,r]=m.useState([]),[s,a]=m.useState([]),o=m.useRef({}),[l,c]=m.useState(!1),[u,d]=m.useState(!0),[f,x]=m.useState(1),[g,v]=m.useState(null),[w,C]=m.useState(!1),[N,I]=m.useState("positions"),P=m.useRef(null),R=nl(),F=m.useRef(e),U=m.useRef(null),L=m.useRef(null),[z,X]=m.useState({});m.useState(!1),m.useState("");const[ne,J]=m.useState(null),{getTrackedWatchList:Z,hyperToken:re,copyTradeWatchList:he,getCopyTradeWatchList:Y,setTelegramChatId:ie,setSubscriberRole:oe,setSubsExpireDay:G,setMushboomerETH:V,setMushboomerSOL:ee,setIsReferralCode:ae,isReferralCodeName:fe,setIsReferralCodeName:Ae,setIsWhitelist:ce,setHyperToken:ye,setHyperAddress:Ne,setSignModalOpen:be,latestPnL:je}=m.useContext(Gr),{isConnected:Ie,address:Re}=Yr();m.useState(!1),m.useState(!1),m.useState(null),m.useState("");const[Qe,Be]=m.useState(!1);m.useState(!1);const[it,tt]=m.useState({}),[at,dt]=m.useState(!1),[ct,Ut]=m.useState([]),[kt,tn]=m.useState(null);kt||je.activeRange;const jt=Ic(),un=jt.pathname.includes("/wallet-management");m.useEffect(()=>{tn(null)},[je.activeRange]);const cn=[{label:"@10",value:"GMEOW"},{label:"@112",value:"MEOW"},{label:"@115",value:"HOLD"},{label:"@117",value:"BERA"},{label:"@12",value:"XULIAN"},{label:"@123",value:"FARM"},{label:"@131",value:"ORA"},{label:"@132",value:"LIQD"},{label:"@134",value:"STAR"},{label:"@135",value:"SENT"},{label:"@136",value:"SOLV"},{label:"@16",value:"CZ"},{label:"@18",value:"ANSEM"},{label:"@21",value:"KOBE"},{label:"@22",value:"HAPPY"},{label:"@25",value:"BIGBEN"},{label:"@3",value:"MANLET"},{label:"@30",value:"FARMED"},{label:"@31",value:"GPT"},{label:"@32",value:"PURRPS"},{label:"@33",value:"BID"},{label:"@34",value:"HODL"},{label:"@1",value:"HFUN"},{label:"@100",value:"UP"},{label:"@101",value:"NIGGO"},{label:"@102",value:"HOP"},{label:"@103",value:"LUCKY"},{label:"@104",value:"COPE"},{label:"@105",value:"HPYH"},{label:"@106",value:"YAP"},{label:"@107",value:"HYPE"},{label:"@108",value:"CHEF"},{label:"@109",value:"WOW"},{label:"@11",value:"PEPE"},{label:"@110",value:"STEEL"},{label:"@111",value:"RETARD"},{label:"@113",value:"NEIRO"},{label:"@114",value:"PEAR"},{label:"@116",value:"MUNCH"},{label:"@118",value:"GENESY"},{label:"@119",value:"BUBZ"},{label:"@120",value:"PICKL"},{label:"@121",value:"SHEEP"},{label:"@122",value:"LAUNCH"},{label:"@124",value:"FLASK"},{label:"@125",value:"VAULT"},{label:"@126",value:"CAT"},{label:"@127",value:"HYENA"},{label:"@128",value:"DEPIN"},{label:"@129",value:"MON"},{label:"@13",value:"RUG"},{label:"@130",value:"BEATS"},{label:"@133",value:"H"},{label:"@137",value:"FLY"},{label:"@138",value:"TIME"},{label:"@139",value:"SOVRN"},{label:"@14",value:"ILIENS"},{label:"@15",value:"FUCKY"},{label:"@17",value:"BAGS"},{label:"@19",value:"TATE"},{label:"@2",value:"LICK"},{label:"@20",value:"PUMP"},{label:"@23",value:"SCHIZO"},{label:"@24",value:"SELL"},{label:"@26",value:"CATNIP"},{label:"@27",value:"HBOOST"},{label:"@28",value:"SUCKY"},{label:"@29",value:"GUP"},{label:"@35",value:"VEGAS"},{label:"@37",value:"VAPOR"},{label:"@38",value:"PANDA"},{label:"@39",value:"PILL"},{label:"@40",value:"ADHD"},{label:"@41",value:"FUN"},{label:"@42",value:"LADY"},{label:"@46",value:"DROP"},{label:"@47",value:"MBAPPE"},{label:"@48",value:"TEST"},{label:"@49",value:"RAGE"},{label:"@5",value:"SIX"},{label:"@50",value:"FRAC"},{label:"@51",value:"ATEHUN"},{label:"@52",value:"COZY"},{label:"@53",value:"ARI"},{label:"@54",value:"WASH"},{label:"@55",value:"ANT"},{label:"@59",value:"CATBAL"},{label:"@60",value:"TJIF"},{label:"@61",value:"GUESS"},{label:"@62",value:"MAXI"},{label:"@63",value:"NMTD"},{label:"@66",value:"RISE"},{label:"@67",value:"CINDY"},{label:"@70",value:"FRIED"},{label:"@73",value:"RANK"},{label:"@74",value:"OMNIX"},{label:"@75",value:"RIP"},{label:"@76",value:"G"},{label:"@77",value:"BOZO"},{label:"@78",value:"SPH"},{label:"@82",value:"BUSSY"},{label:"@83",value:"FATCAT"},{label:"@84",value:"SHREK"},{label:"@85",value:"PIP"},{label:"@86",value:"LQNA"},{label:"@87",value:"NASDAQ"},{label:"@88",value:"YEETI"},{label:"@9",value:"TRUMP"},{label:"@90",value:"FEIT"},{label:"@92",value:"VIZN"},{label:"@93",value:"STRICT"},{label:"@94",value:"AUTIST"},{label:"@96",value:"HGOD"},{label:"@97",value:"LIQUID"},{label:"@36",value:"ASI"},{label:"@4",value:"JEFF"},{label:"@43",value:"MOG"},{label:"@44",value:"HPEPE"},{label:"@45",value:"JEET"},{label:"@57",value:"RICH"},{label:"@58",value:"LORA"},{label:"@6",value:"WAGMI"},{label:"@65",value:"PIGEON"},{label:"@64",value:"HPUMP"},{label:"@69",value:"STACK"},{label:"@7",value:"CAPPY"},{label:"@72",value:"NOCEX"},{label:"@79",value:"SHOE"},{label:"@80",value:"MONAD"},{label:"@81",value:"HOPE"},{label:"@89",value:"SYLVI"},{label:"@91",value:"FRUDO"},{label:"@95",value:"MAGA"},{label:"@99",value:"EARTH"},{label:"@56",value:"NFT"},{label:"@8",value:"POINTS"},{label:"@68",value:"CHINA"},{label:"@141",value:"GOD"}];function Pt(pe,st){const Ft=st.map(({fill:yt,twapId:pn})=>({...yt,twapId:pn}));return[...pe,...Ft]}const Xe=(pe,st)=>{const Ft=At(st,pe);o.current={...o.current,[pe]:Ft},a(Object.values(o.current).flat()),d(!1)};m.useEffect(()=>{e&&(async()=>{const pe=await Oce(e),st=await Mce(e),Ft=Pt(pe,st),{closed_positions:yt}=Rce(Ft);J(yt)})()},[e]);const Vt=(t??[]).map(pe=>{var st;return(st=pe.wallet_address)==null?void 0:st.toLowerCase()}).filter(Boolean),Yt=m.useMemo(()=>[...new Set(Vt)].sort().join("|"),[Vt.join("|")]);m.useEffect(()=>{if(!t||t.length===0)return;const pe=t.map(Ft=>Ft.wallet_address.toLowerCase());if(pe.length===0)return;let st=!0;return c(!0),d(!0),(async()=>{try{const Ft=await Promise.all(pe.map(async _r=>{const[wr,pr]=await Promise.all([ls.post(aC,{aggregateByTime:!0,type:"userFills",user:_r}),ls.post(aC,{type:"clearinghouseState",user:_r})]);return{addr:_r,fills:wr.data??[],state:pr.data}}));if(!st)return;const yt=Ft.flatMap(_r=>_r.fills),pn=ft(yt);r(pn);const An=Ft.flatMap(_r=>{var wr;return(wr=_r.state)!=null&&wr.assetPositions?_r.state.assetPositions.map(pr=>({...pr,_wallet:_r.addr})):[]}),or=At({assetPositions:An});a(or),Ve(pe)}catch(Ft){console.error("Multi-wallet fetch error:",Ft)}finally{st&&c(!1)}})(),()=>{st=!1}},[Yt]),m.useEffect(()=>(e&&(F.current=e,Ke(e)),()=>{P.current&&(P.current.close(),P.current=null),U.current&&(clearTimeout(U.current),U.current=null),L.current&&(clearInterval(L.current),L.current=null)}),[e]),m.useEffect(()=>{const pe=async()=>{var st;document.visibilityState==="visible"&&(((st=P.current)==null?void 0:st.readyState)!==WebSocket.OPEN&&Ve(F.current.split("|")),F.current.split("|").forEach(Ft=>{ls.post(aC,{type:"clearinghouseState",user:Ft}).then(yt=>Xe(Ft,yt.data))}))};return document.addEventListener("visibilitychange",pe),()=>document.removeEventListener("visibilitychange",pe)},[]),m.useEffect(()=>{const pe=localStorage.getItem("favoriteAddresses");pe&&X(JSON.parse(pe))},[]);const Ve=pe=>{var Ft;const st=Array.isArray(pe)?pe:[pe];o.current={},a([]),!(((Ft=P.current)==null?void 0:Ft.readyState)===WebSocket.OPEN&&F.current===Re)&&(L.current&&(clearInterval(L.current),L.current=null),U.current&&(clearTimeout(U.current),U.current=null),P.current&&(P.current.close(),P.current=null),F.current=st.join("|"),P.current=new WebSocket(Pin),P.current.onopen=()=>{console.log("WebSocket Connected"),C(!0);const yt=[];st.forEach(pn=>{yt.push({method:"subscribe",subscription:{aggregateByTime:!0,type:"userFills",user:pn}},{method:"subscribe",subscription:{type:"user",user:pn}},{method:"subscribe",subscription:{type:"webData2",user:pn}},{method:"subscribe",subscription:{type:"userTwapSliceFills",user:pn}})}),yt.forEach(pn=>{P.current.send(JSON.stringify(pn))}),L.current=setInterval(()=>{var pn;if(((pn=P.current)==null?void 0:pn.readyState)===WebSocket.OPEN){const An={id:99,method:"ping"};P.current.send(JSON.stringify(An))}},3e4)},P.current.onclose=yt=>{C(!1),L.current&&(clearInterval(L.current),L.current=null),yt.code!==1e3&&(U.current||(U.current=setTimeout(()=>{U.current=null,F.current===Re&&Ve([Re])},5e3)))},P.current.onerror=yt=>{console.error("WebSocket Error:",yt),C(!1)},P.current.onmessage=yt=>{var pn,An,or,_r;try{const wr=JSON.parse(yt.data);if(wr.method==="pong"||wr.result==="success")return;if(wr.channel==="userFills"&&((pn=wr.data)!=null&&pn.fills)&&F.current.toLowerCase()===wr.data.user.toLowerCase()&&r(pr=>{const es=pr.flatMap(Ir=>Ir.fills),ts=new Map;es.forEach(Ir=>{ts.set(Ir.hash,!0)});const Lr=wr.data.fills.filter(Ir=>!ts.has(Ir.hash));if(Lr.length===0)return pr;const Qr=[...Lr,...es];return ft(Qr)}),wr.channel==="webData2"&&((An=wr.data)!=null&&An.clearinghouseState)&&(v(wr.data.clearinghouseState),Xe(wr.data.user.toLowerCase(),wr.data.clearinghouseState)),wr.channel==="user"&&((or=wr.data)!=null&&or.fills&&r(pr=>{const es=pr.flatMap(Ir=>Ir.fills),ts=new Map;es.forEach(Ir=>{ts.set(Ir.hash,!0)});const Lr=wr.data.fills.filter(Ir=>!ts.has(Ir.hash));if(Lr.length===0)return pr;const Qr=[...Lr,...es];return ft(Qr)}),(_r=wr.data)!=null&&_r.state)){v(wr.data.state);const pr=At(wr.data.state);a(pr)}if(wr.channel==="userTwapSliceFills"){const pr=wr==null?void 0:wr.data;if(!ct||ct.length===0||!pr||pr.length===0)return;const es=pr==null?void 0:pr.map(Lr=>({...Lr.fill,twapId:Lr.twapId||null})),ts=[...ct];es.forEach(Lr=>{const Qr=ts==null?void 0:ts.findIndex(Ir=>Ir.oid===Lr.oid);Qr!==-1?ts[Qr]={...ts[Qr],...Lr}:ts.unshift(Lr)}),Ut(ts)}}catch(wr){console.error("Error processing WebSocket message:",wr),console.error("Raw message that caused error:",yt.data)}})},Ke=async pe=>{const[st,Ft]=await Promise.all([ls.post(aC,{aggregateByTime:!0,type:"userFills",user:pe}),ls.post(aC,{type:"clearinghouseState",user:pe})]);if(Ft.data&&Xe(pe.toLowerCase(),Ft.data),!pe){on.error("Please enter a wallet address");return}if(!pe.match(/^0x[a-fA-F0-9]{40}$/)){on.error("Please enter a valid Ethereum address");return}c(!0),d(!0);try{pe!==e&&R(`/wallet-details/${pe}`),Ve(pe);const yt=await ls.post(aC,{aggregateByTime:!0,type:"userFills",user:pe});if(yt.data&&Array.isArray(yt.data)){const pn=ft(yt.data);r(pn),x(1)}else console.error("Invalid response format:",yt.data)}catch(yt){console.error("Error fetching data:",yt)}finally{c(!1)}},ft=pe=>{const st=[...pe].sort((yt,pn)=>pn.time-yt.time),Ft=new Map;return st.forEach(yt=>{var An;const pn=yt.oid;if(!Ft.has(pn)){const or=st.filter(Qr=>Qr.oid===yt.oid),_r=or.reduce((Qr,Ir)=>Qr+parseFloat(Ir.sz),0),wr=or.map(Qr=>parseFloat(Qr.startPosition));let pr;wr.includes(0)?pr=0:wr.every(Qr=>Qr>0)?pr=Math.max(...wr):wr.every(Qr=>Qr<0)?pr=Math.min(...wr):pr=or.reduce((Qr,Ir)=>Qr+parseFloat(Ir.startPosition),0);const es=or.reduce((Qr,Ir)=>Qr+parseFloat(Ir.sz)*parseFloat(Ir.px),0),ts=or.reduce((Qr,Ir)=>Qr+parseFloat(Ir.closedPnl||0),0),Lr=((An=or.find(Qr=>Qr.dir==="Long > Short"||Qr.dir==="Short > Long"))==null?void 0:An.dir)||"";Ft.set(pn,{oid:yt.oid,asset:yt.coin,direction:Lr==""?yt.dir:Lr,fills:or,totalSize:_r,totalStartPositions:pr,totalValue:es,pnl:ts,latestFill:yt.time,isLiquidation:!!yt.liquidation})}}),Array.from(Ft.values()).sort((yt,pn)=>pn.latestFill-yt.latestFill)},en=pe=>{const st=new Date(pe),Ft=st.toLocaleString("en-US",{month:"short"}),yt=st.getDate(),pn=st.getFullYear(),An=st.getHours().toString().padStart(2,"0"),or=st.getMinutes().toString().padStart(2,"0"),_r=st.getHours()>=12?" PM":" AM";return`${Ft} ${yt}, ${pn}, ${An}:${or}  ${_r}`},Dt=n,At=(pe,st="")=>{if(!(pe!=null&&pe.assetPositions))return[];const Ft=new Map;return n.forEach(yt=>{yt.fills.forEach(pn=>{let An="";pn.dir.includes("Open")?An=pn.dir.includes("Long")?"Long":"Short":pn.side==="B"?An="Long":pn.side==="S"&&(An="Short");const or=`${pn.coin}-${An}`;(!Ft.has(or)||pn.time<Ft.get(or))&&Ft.set(or,pn.time)})}),pe.assetPositions.filter(yt=>{if(!yt.position||!yt.position.szi)return!1;const pn=parseFloat(yt.position.szi);return!isNaN(pn)&&pn!==0}).map(yt=>{const pn=yt._wallet||st||(e==null?void 0:e.toLowerCase()),An=yt.position,or=parseFloat(An.szi),_r=parseFloat(An.entryPx),wr=parseFloat(An.positionValue),pr=parseFloat(An.unrealizedPnl),es=parseFloat(An.returnOnEquity)*100,ts=parseFloat(An.marginUsed),Lr=An.leverage.value,Qr=An.leverage.type,Ir=parseFloat(An.cumFunding.sinceOpen),Ss=or>0?"Long":"Short",hi=Ft.get(`${An.coin}-${Ss}`);return{wallet:pn,asset:An.coin,type:Ss,size:or,entryPrice:_r.toFixed(4),currentPrice:(wr/Math.abs(or)).toFixed(4),leverage:Lr,marginMode:Qr,positionValue:wr.toFixed(2),marginUsed:ts.toFixed(2),unrealizedPnl:pr.toFixed(2),roe:es.toFixed(2),funding:Ir.toFixed(4),startTime:hi?en(hi):"N/A",liquidationPrice:An.liquidationPx?parseFloat(An.liquidationPx).toFixed(2):"N/A"}})};m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&(Z(),Y())},[]);const Je=m.useRef(null),He=()=>{Je.current&&(Je.current.scrollLeft-=200)},Rt=()=>{Je.current&&(Je.current.scrollLeft+=200)},qe=()=>{Je.current&&(Je.current.scrollTop+=200)},lt=()=>{Je.current&&(Je.current.scrollTop-=200)};m.useRef(null);const xt=m.useRef(null),Nt=()=>{xt.current&&(xt.current.scrollLeft-=200)},It=()=>{xt.current&&(xt.current.scrollLeft+=200)},xn=()=>{xt.current&&(xt.current.scrollTop+=200)},dn=()=>{xt.current&&(xt.current.scrollTop-=200)};m.useRef(null),m.useEffect(()=>{(async()=>{var yt,pn;const st=window.localStorage.getItem("hyperToken"),Ft=window.localStorage.getItem("hyperAddress");if(!(!st||!Ft))try{const An=await Si(Ft.toLowerCase(),st);An!=null&&An.success?(ie(An==null?void 0:An.telegram_chat_id),oe(An==null?void 0:An.subscriber_role),G(An==null?void 0:An.subs_expire_day),V((yt=An==null?void 0:An.mushboomer_counts)==null?void 0:yt.eth),ee((pn=An==null?void 0:An.mushboomer_counts)==null?void 0:pn.sol),ae(An==null?void 0:An.referral_code),Ae(An==null?void 0:An.refcode),ce(An==null?void 0:An.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),ye(""),Ne(""))}catch(An){console.error("Token verification error:",An),console.error(An.message||"An unknown error occurred.")}})()},[]);const Mn=["Open Position","Increase","Decrease","Changed Position","Position Closed","Spot","Liquidation"],_n="-latestFill",[kn,vn]=m.useState(_n),[Qn,Hn]=m.useState([]),[$n,Jn]=m.useState(""),[Nn,ln]=m.useState(""),[Oe,sn]=m.useState(""),[fn,Et]=m.useState(!1),[Kn,Cn]=m.useState(!1),[Bt,an]=m.useState(!1),[Pn,qn]=m.useState(!1),nr=m.useRef(null),tr=m.useRef(null),Qt=m.useRef(null),zn=m.useRef(null),Yn=pe=>{Hn(st=>st.includes(pe)?st.filter(Ft=>Ft!==pe):[...st,pe])};m.useEffect(()=>{function pe(st){nr.current&&!nr.current.contains(st.target)&&Et(!1),tr.current&&!tr.current.contains(st.target)&&Cn(!1),Qt.current&&!Qt.current.contains(st.target)&&an(!1),zn.current&&!zn.current.contains(st.target)&&qn(!1)}return document.addEventListener("mousedown",pe),()=>document.removeEventListener("mousedown",pe)},[]);const Lt=Dt.map(pe=>{let st=pe.isLiquidation?"Liquidation":pe.totalStartPositions==0?"Open Position":pe.direction!="Short > Long"&&pe.direction!="Long > Short"?(pe==null?void 0:pe.totalSize)-Math.abs(pe==null?void 0:pe.totalStartPositions)==0&&(pe.direction=="Close Long"||pe.direction=="Close Short")?"Position Closed":pe.direction=="Open Short"||pe.direction=="Open Long"?"Increase":pe.direction=="Close Long"||pe.direction=="Close Short"?"Decrease":pe.direction=="Sell"||pe.direction=="Buy"?"Spot":"Changed Position":pe.direction=="Short > Long"||pe.direction=="Long > Short"?"Changed Position":"Open Position";return{...pe,computedType:st}}),Fn=pe=>{const st=cn.find(Ft=>Ft.label===pe);return st?st.value.toUpperCase():pe==null?void 0:pe.toUpperCase()},Ee=Lt.filter(pe=>Qn.length?Qn.includes(pe.computedType):!0).filter(pe=>{var st,Ft;return $n?(Ft=(st=pe==null?void 0:pe.oid)==null?void 0:st.toString())==null?void 0:Ft.includes($n):!0}).filter(pe=>Nn?Fn(pe.asset).includes(Nn.toUpperCase()):!0),p=pe=>Ee==null?void 0:Ee.sort((st,Ft)=>{var ts,Lr,Qr,Ir;const yt=st.totalSize?st.totalValue/st.totalSize:0,pn=Ft.totalSize?Ft.totalValue/Ft.totalSize:0,An=Ss=>{const hi=cn.find(li=>li.label===Ss);return hi?hi.value.toUpperCase():Ss==null?void 0:Ss.toUpperCase()},or=An(st.asset),_r=An(Ft.asset),wr=Ss=>{if(!Ss)return"";const hi=Ss.toLowerCase();return hi.includes("short")?"Short":hi.includes("long")?"Long":hi==="buy"?"Buy":hi==="sell"?"Sell":Ss},pr=wr(st.direction),es=wr(Ft.direction);if(pe==="-totalSize")return Ft.totalSize-st.totalSize;if(pe==="totalSize")return st.totalSize-Ft.totalSize;if(pe==="-pnl")return Ft.pnl-st.pnl;if(pe==="pnl")return st.pnl-Ft.pnl;if(pe==="-fills")return(((ts=Ft.fills)==null?void 0:ts.length)||0)-(((Lr=st.fills)==null?void 0:Lr.length)||0);if(pe==="fills")return(((Qr=st.fills)==null?void 0:Qr.length)||0)-(((Ir=Ft.fills)==null?void 0:Ir.length)||0);if(pe==="-latestFill")return new Date(Ft.latestFill)-new Date(st.latestFill);if(pe==="latestFill")return new Date(st.latestFill)-new Date(Ft.latestFill);if(pe==="-avgPrice")return pn-yt;if(pe==="avgPrice")return yt-pn;if(pe==="-oid")return Ft.oid-st.oid;if(pe==="oid")return st.oid-Ft.oid;if(pe==="direction"){const Ss={Short:1,Sell:2,Long:3,Buy:4};return(Ss[pr]||99)-(Ss[es]||99)}else if(pe==="-direction"){const Ss={Long:1,Buy:2,Short:3,Sell:4};return(Ss[pr]||99)-(Ss[es]||99)}else{if(pe==="-coin")return or<_r?-1:or>_r?1:0;if(pe==="coin")return or>_r?-1:or<_r?1:0}return 0}),h=p(kn).filter(pe=>(pe.totalStartPositions==0?"Open Position":pe.direction!="Short > Long"&&pe.direction!="Long > Short"?(pe==null?void 0:pe.totalSize)-Math.abs(pe==null?void 0:pe.totalStartPositions)==0&&(pe.direction=="Close Long"||pe.direction=="Close Short")?"Position Closed":pe.direction=="Open Short"||pe.direction=="Open Long"?"Increase":pe.direction=="Close Long"||pe.direction=="Close Short"?"Decrease":pe.direction=="Sell"||pe.direction=="Buy"?"Spot":"Changed Position":pe.direction=="Short > Long"||pe.direction=="Long > Short"?"Changed Position":"Open Position")==="Open Position"),S={};h.forEach(pe=>{var yt;const st=pe==null?void 0:pe.asset,Ft=new Date(pe==null?void 0:pe.latestFill).getTime();if(!S[st])S[st]=pe;else{const pn=new Date((yt=S[st])==null?void 0:yt.latestFill).getTime();Ft>pn&&(S[st]=pe)}});const _=Object.values(S),[k,T]=m.useState([]),B=s==null?void 0:s.filter(pe=>{var st;return Oe?(st=pe.asset)==null?void 0:st.toLowerCase().includes(Oe.toLowerCase()):!0}).map(pe=>{const st=_.find(yt=>(yt==null?void 0:yt.asset)===(pe==null?void 0:pe.asset)),Ft=k.find(yt=>yt.coin===pe.asset&&(yt.wallet||"").toLowerCase()===(pe.wallet||"").toLowerCase());return{...pe,latestFill:(st==null?void 0:st.latestFill)||null,tagName:(Ft==null?void 0:Ft.tag)||null,tagWallet:(Ft==null?void 0:Ft.cp_wallet)||null}}),q="-unrealizedPnl",[te,ue]=m.useState(q),de=pe=>B==null?void 0:B.sort((st,Ft)=>{const yt=st.tagName?st.tagName.toUpperCase():"",pn=Ft.tagName?Ft.tagName.toUpperCase():"",An=st.asset?st.asset.toUpperCase():"",or=Ft.asset?Ft.asset.toUpperCase():"",_r=st.type==="Long"?1:0,wr=Ft.type==="Long"?1:0,pr=st.type==="Short"?1:0,es=Ft.type==="Short"?1:0;return pe==="-unrealizedPnl"?Ft.unrealizedPnl-st.unrealizedPnl:pe==="unrealizedPnl"?st.unrealizedPnl-Ft.unrealizedPnl:pe==="-roe"?Ft.roe-st.roe:pe==="roe"?st.roe-Ft.roe:pe==="-size"?Ft.size-st.size:pe==="size"?st.size-Ft.size:pe==="-entryPrice"?Ft.entryPrice-st.entryPrice:pe==="entryPrice"?st.entryPrice-Ft.entryPrice:pe==="-currentPrice"?Ft.currentPrice-st.currentPrice:pe==="currentPrice"?st.currentPrice-Ft.currentPrice:pe==="-leverage"?Ft.leverage-st.leverage:pe==="leverage"?st.leverage-Ft.leverage:pe==="-positionValue"?Ft.positionValue-st.positionValue:pe==="positionValue"?st.positionValue-Ft.positionValue:pe==="-marginUsed"?Ft.marginUsed-st.marginUsed:pe==="marginUsed"?st.marginUsed-Ft.marginUsed:pe==="funding"?Ft.funding-st.funding:pe==="-funding"?st.funding-Ft.funding:pe==="-liquidationPrice"?Ft.liquidationPrice-st.liquidationPrice:pe==="liquidationPrice"?st.liquidationPrice-Ft.liquidationPrice:pe==="-entryTime"?new Date(Ft.latestFill)-new Date(st.latestFill):pe==="entryTime"?new Date(st.latestFill)-new Date(Ft.latestFill):pe==="-source_tag"?yt<pn?-1:yt>pn?1:0:pe==="source_tag"?yt>pn?-1:yt<pn?1:0:pe==="-type_leverage"?_r!==wr?wr-_r:Ft.leverage-st.leverage:pe==="type_leverage"?pr!==es?es-pr:Ft.leverage-st.leverage:pe==="-asset"?An<or?-1:An>or?1:0:pe==="asset"?An>or?-1:An<or?1:0:0}),[xe,we]=m.useState([]),[ke,Me]=m.useState(!0),[Ye,Fe]=m.useState(null),[rt,se]=m.useState([]),[Ce,De]=m.useState(!0),[Le,_e]=m.useState(null),[nt,ot]=m.useState([]),[gt,Jt]=m.useState(!0),[Ge,et]=m.useState(null);async function We(){try{Me(!0);const pe=await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=1&order=-perp_pnl&offset=0&limit=50&user_token=${e}`);if(!pe.ok)throw new Error(`HTTP error! status: ${pe.status}`);const st=await pe.json();we(st.results)}catch(pe){console.error("Error resetting filters:",pe),Fe(pe.message)}finally{Me(!1)}}async function wt(){try{De(!0);const pe=await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=7&order=-perp_pnl&offset=0&limit=50&user_token=${e}`);if(!pe.ok)throw new Error(`HTTP error! status: ${pe.status}`);const st=await pe.json();se(st.results)}catch(pe){console.error("Error resetting filters:",pe),_e(pe.message)}finally{De(!1)}}async function St(){try{Jt(!0);const pe=await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=30&order=-perp_pnl&offset=0&limit=50&user_token=${e}`);if(!pe.ok)throw new Error(`HTTP error! status: ${pe.status}`);const st=await pe.json();ot(st.results)}catch(pe){console.error("Error resetting filters:",pe),et(pe.message)}finally{Jt(!1)}}m.useEffect(()=>{We(),wt(),St()},[]),m.useState("7D"),m.useState("7D"),s.length,s.filter(pe=>pe.unrealizedPnl>=0).length;const[Kt,gn]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",positionDistribution:0,pnl:0,closePx:0});((la=de(te))==null?void 0:la.reduce((pe,st)=>pe+((st==null?void 0:st.leverage)||0),0))/(((jr=de(te))==null?void 0:jr.length)||1),(Xt=de(te))==null||Xt.reduce((pe,st)=>{const Ft=parseFloat(st==null?void 0:st.funding)||0;return pe+Ft},0);const br=localStorage.getItem("isDateOpenPositionsFormat")||"date",[pt,Wt]=m.useState(br);m.useEffect(()=>{localStorage.setItem("isDateOpenPositionsFormat",pt)},[pt]);const vt=localStorage.getItem("isDateFillsFormat")||"date",[Ot,wn]=m.useState(vt);m.useEffect(()=>{localStorage.setItem("isDateFillsFormat",Ot)},[Ot]);function Gn({date:pe}){const[st,Ft]=m.useState(To(pe));return m.useEffect(()=>{const yt=setInterval(()=>{Ft(To(pe))},1e3);return()=>clearInterval(yt)},[pe]),i.jsx("span",{className:"text-white text-sm font-normal font-manrope leading-[13px] tracking-[0.18px] min-w-max",children:st.dateTime})}const[fr,ur]=m.useState([]),$t=async()=>{try{const pe=window.localStorage.getItem("hyperToken");if(!pe){be(!0);return}const st="https://dextrabothypev2.nftinit.io/api/wallet/list",Ft=window.localStorage.getItem("hyperAddress"),pn=await(await fetch(st,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Re?Re.toLowerCase():Ft,token:pe,balance:"false"})})).json();pn!=null&&pn.success?(ur(pn.data||[]),Fs(pn.data)):console.log(pn.error_message)}catch(pe){console.error("Error fetching generate wallet list:",pe)}};m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&$t()},[re]);const[nn,Vn]=m.useState([]),[lr,er]=m.useState(!0),[gr,dr]=m.useState(!1);m.useEffect(()=>{B&&B.length>0&&(us(),fr.length>0&&lr&&Fs())},[B]);const Fs=()=>{nn.length!==0&&(xr(nn),lr&&er(!1))};m.useEffect(()=>{const pe=window.localStorage.getItem("hyperToken");nn.length&&pe&&xr(nn)},[nn]);const us=()=>{const pe=window.localStorage.getItem("hyperToken");let st=!1;const Ft=[...nn];B.forEach(yt=>{var _r;const pn=yt.asset,An=(_r=yt.wallet||e)==null?void 0:_r.toLowerCase();Ft.some(wr=>wr.coin===pn&&(wr.wallet||"").toLowerCase()===An)||(Ft.push({coin:pn,wallet:An}),st=!0)}),st&&(Vn(Ft),fr.some(pn=>pn.wallet_address===(e==null?void 0:e.toLowerCase()))&&pe&&xr(Ft))},xr=async pe=>{if(!gr)try{dr(!0);const st=window.localStorage.getItem("hyperToken"),Ft="https://dextrabothypev2.nftinit.io/api/hyper/following/position_info/";if(!st||!pe){dr(!1);return}st||be(!0);const yt=window.localStorage.getItem("hyperAddress"),An=await(await fetch(Ft,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Re?Re.toLowerCase():yt,token:st,positions:pe})})).json();An.success?T(An==null?void 0:An.data):(console.log(An.error_message),on.error(An.error_message))}catch(st){console.error("Error tag request",st),on.error(st.message)}finally{dr(!1)}},vr=(t==null?void 0:t.length)>1||fr.some(pe=>pe.wallet_address===(e==null?void 0:e.toLowerCase())),rs=async(pe,st,Ft,yt,pn)=>{if(!pe||!Ft||!yt||!pn){console.error("Close order called with invalid parameters"),on.error("Close order called with invalid parameters");return}const An=`${yt}_${Ft}_${pn}`;try{tt(ts=>({...ts,[An]:!0}));const or=window.localStorage.getItem("hyperToken"),_r="https://dextrabothypev2.nftinit.io/api/hyper/order/close_order_new/";if(!or){be(!0),tt(ts=>({...ts,[An]:!1}));return}const wr=window.localStorage.getItem("hyperAddress"),pr=await fetch(_r,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Re?Re.toLowerCase():wr,token:or,coin:Ft,wallet_id:pe.toString(),leverage:yt,size:pn})});if(!pr.ok)throw new Error(`Server responded with status ${pr.status}`);const es=await pr.json();es.success?(tt(ts=>({...ts,[An]:!1})),on.success("Close order operation successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):es.status=="ok"?(tt(ts=>({...ts,[An]:!1})),on.success("Close order operation successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):(console.error("Something went wrong!"),on.error("Something went wrong!"),tt(ts=>({...ts,[An]:!1})))}catch{console.error("Something went wrong!"),on.error("Something went wrong!"),tt(_r=>({..._r,[An]:!1}))}},Zr=async(pe=[])=>{if(pe.length!==0){dt(!0);try{await Promise.all(pe.map(st=>gi(st)))}finally{dt(!1)}}},gi=async pe=>{if((B==null?void 0:B.length)===0){on.success("There are no open positions to closes.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}if(!pe){console.error("Close order called with invalid parameters"),on.error("Close order called with invalid parameters");return}try{dt(!0);const st=window.localStorage.getItem("hyperToken"),Ft="https://dextrabothypev2.nftinit.io/api/hyper/order/close_order_all_new/";if(!st){be(!0),dt(!1);return}const yt=window.localStorage.getItem("hyperAddress"),pn=await fetch(Ft,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Re?Re.toLowerCase():yt,token:st,wallet_id:pe.toString()})});if(!pn.ok)throw new Error(`Server responded with status ${pn.status}`);const An=await pn.json();An.status=="ok"?(dt(!1),on.success("Close order operation successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px",width:"400px",minWidth:"400px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):An.success?(dt(!1),on.success("There are no open positions to close.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})):(console.log("Close order operation failed."),on.error("Close order operation failed."),dt(!1))}catch(st){throw console.error("Something went wrong!"),on.error("Something went wrong!"),dt(!1),st}},oi={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return i.jsxs("div",{className:"w-full",children:[i.jsx(hT,{open:Qe,setOpen:Be,data:Kt,setTradeInfo:gn}),i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 mb-2 mx-4 mt-4 relative overflow-x-auto whitespace-nowrap scrollbar-hide [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[i.jsx("div",{className:"absolute bottom-0 left-0 w-[80%] h-[1px] bg-[#2A2A2A]"}),i.jsx("div",{onClick:()=>I("positions"),className:`${N==="positions"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} h-6 px-2 py-3 flex justify-center items-center gap-2.5 cursor-pointer  font-manrope font-semibold pb-4 hover:text-[#67FFBD]`,children:i.jsxs("div",{className:"flex items-center text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none min-w-max",children:[i.jsx("span",{className:"mr-2",children:"Open Positions"}),i.jsx("span",{className:"flex w-[22px] h-[22px] px-3 justify-center items-center gap-[2px] flex-shrink-0 rounded-md bg-[rgba(103,255,189,0.16)] text-[14px] font-semibold font-manrope",children:s.length})]})}),i.jsx("div",{onClick:()=>I("fills"),className:`${N==="fills"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} h-6 px-2 py-3 flex justify-center items-center gap-2.5 cursor-pointer  font-manrope font-semibold pb-4 hover:text-[#67FFBD]`,children:i.jsx("div",{className:"text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Fills"})}),i.jsx("div",{onClick:()=>I("trade-history"),className:`${N==="trade-history"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} h-6 px-2 py-3 flex justify-center items-center gap-2.5 cursor-pointer  font-manrope font-semibold pb-4 hover:text-[#67FFBD]`,children:i.jsx("div",{className:" text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Trade History"})}),i.jsx("div",{onClick:()=>I("twap-history"),className:`${N==="twap-history"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} ${jt.pathname.startsWith("/wallet-details")?"":"hidden"} h-6 px-2 py-3 flex justify-center items-center gap-2.5 cursor-pointer  font-manrope font-semibold pb-4 hover:text-[#67FFBD]`,children:i.jsx("div",{className:" text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Twap History"})}),i.jsx("div",{onClick:()=>I("completed-trades"),className:`${N==="completed-trades"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} h-6 px-2 py-3 flex justify-center items-center gap-2.5 cursor-pointer  font-manrope font-semibold pb-4 hover:text-[#67FFBD]`,children:i.jsx("div",{className:" text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Completed Trades"})}),i.jsx("div",{onClick:()=>I("deposit-withdraw"),className:`${N==="deposit-withdraw"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} h-6 px-2 py-3 flex justify-center items-center gap-2.5 cursor-pointer  font-manrope font-semibold pb-4 hover:text-[#67FFBD]`,children:i.jsx("div",{className:" text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Deposits & Withdrawals"})}),!un&&i.jsxs("div",{onClick:()=>window.open(`https://hypurrscan.io/address/${e}`,"_blank"),className:"h-6 px-2 py-3 justify-center items-center gap-2.5 inline-flex cursor-pointer",children:[i.jsx("img",{src:Ybt,className:"w-[19px] h-[18px]"}),i.jsx("div",{className:"text-[#C1C1C1] text-[13px] font-semibold font-manrope leading-[8px] hover:text-[#67FFBD]",children:"HypurrScan"})]})]}),N==="fills"?i.jsxs("div",{className:"relative w-full ",children:[i.jsxs("div",{className:"absolute -top-6 right-2 z-10 justify-start items-center gap-2 hidden lg:flex",children:[i.jsx("button",{onClick:Nt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Pl,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:It,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Pl,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:dn,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Pl,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:xn,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Pl,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{ref:xt,className:"w-full  overflow-scroll min-h-[60vh] max-h-[60vh] h-full flex-grow mt-1 mb-3 bg-[#161616] rounded-lg pb-24",children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] font-semibold leading-[13px] tracking-[0.26px] text-[#9b9b9b] text-[13px] font-manrope mr-3",children:[i.jsx("th",{scope:"col",className:"sticky bg-[#161616] left-0 h-10 pl-2 sm:pl-6 min-w-[130px] max-w-[130px] sm:min-w-[150px] sm:max-w-[150px] z-[8]",children:i.jsxs("div",{className:"flex justify-start items-center gap-2 relative",children:[i.jsx(ci,{title:"Coin",sortKey:"coin",sortOption:kn,setSortOption:vn,isFilterIcon:!1}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>an(!Bt),className:`${Nn?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx(Ff,{className:`w-4 h-4 ${Nn?"text-blue-500":"text-white"}`})}),Bt&&i.jsxs("div",{ref:Qt,className:`absolute left-[58px] mt-32 w-[208px]
                               bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>ln(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"text",value:Nn,onChange:pe=>ln(pe.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2  placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Coin"})]})]})]})}),i.jsx(WY,{className:"pl-4 min-w-[120px] max-w-[120px] sm:min-w-[144px] sm:max-w-[144px] px-1",title:"Direction",sortKey:"direction",sortOption:kn,setSortOption:vn}),i.jsx("th",{scope:"col",className:"pl-4 min-w-[150px] max-w-[150px] px-1 relative",children:i.jsxs("div",{className:"flex items-center justify-start w-full gap-1 min-w-max max-w-max",children:[i.jsx("div",{className:"flex items-center justify-start group",children:"Type"}),i.jsx("button",{onClick:()=>Et(!fn),className:`${Qn.length>0?"bg-gray-900":"bg-[#555555]"} ml-2 inline-flex items-center p-1 rounded  hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx(Ff,{className:`w-4 h-4 ${Qn.length>0?"text-blue-500":"text-white"}`})}),fn&&i.jsxs("div",{ref:nr,className:"absolute left-[60px] mt-60 w-48 bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10",children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>Hn([]),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),Mn.map(pe=>i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-6 relative rounded hover:bg-[#464646] cursor-pointer text-white text-[13px] font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",checked:Qn.includes(pe),onChange:()=>Yn(pe),className:"mr-2 bg-[#3b3b3b] hidden "}),i.jsx("div",{className:`w-4 h-4 max-w-4 max-h-4 flex items-center justify-center border ${Qn.includes(pe)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:Qn.includes(pe)&&i.jsx("img",{src:Wc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[1px]"})}),pe]},pe))]})]})}),i.jsx(_d,{className:"min-w-[80px] max-w-[80px] px-1",title:"Size",sortKey:"totalSize",sortOption:kn,setSortOption:vn}),i.jsx(_d,{className:"min-w-[110px] max-w-[110px] sm:min-w-[130px] sm:max-w-[130px] px-1",title:"Avg. Price",sortKey:"avgPrice",sortOption:kn,setSortOption:vn}),i.jsx(_d,{className:"min-w-[100px] max-w-[100px] sm:min-w-[120px] sm:max-w-[120px] px-1",title:"PnL",sortKey:"pnl",sortOption:kn,setSortOption:vn}),i.jsx(_d,{className:"min-w-[100px] max-w-[100px] sm:min-w-[120px] sm:max-w-[120px] px-1",title:"Fill Count",sortKey:"fills",sortOption:kn,setSortOption:vn}),i.jsx(_d,{className:"min-w-[200px] max-w-[200px] px-1",title:"Latest Fill",sortKey:"latestFill",sortOption:kn,setSortOption:vn}),i.jsx("th",{scope:"col",className:"min-w-[160px] max-w-[160px] pl-1 pr-8 relative",children:i.jsxs("div",{className:"flex justify-end items-center gap-2",children:[i.jsx(ci,{title:"Order ID",sortKey:"oid",sortOption:kn,setSortOption:vn,isFilterIcon:!0}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>Cn(!Kn),className:`${$n?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx(Ff,{className:`w-4 h-4 ${$n?"text-blue-500":"text-white"}`})}),Kn&&i.jsxs("div",{ref:tr,className:`absolute right-[30px] mt-32 w-[208px]
                               bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>Jn(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"number",value:$n,onChange:pe=>Jn(pe.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2  placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Order ID"})]})]})]})})]})}),i.jsx("tbody",{children:p(kn).length==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:window.innerWidth>=640&&window.innerWidth<768?5:window.innerWidth>=768&&window.innerWidth<1024?6:window.innerWidth>=1024&&window.innerWidth<1240?8:window.innerWidth>=1240&&window.innerWidth<1540?10:window.innerWidth>=1540?12:4,className:"h-[36vh]",children:i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-[100%] sm:w-[75%] max-w-[300px] sm:max-w-[700px] justify-center items-center text-center",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ec,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No fills are currently available"}),i.jsx("div",{className:"text-center -mt-2",children:i.jsx("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"To view completed trades, please check your order history"})})]})]})})})})}):p(kn).map((pe,st)=>{var yt,pn,An,or,_r,wr;const Ft=pe.totalValue/pe.totalSize;return(yt=pe==null?void 0:pe.direction)==null||yt.includes("Long"),i.jsxs(Se.Fragment,{children:[i.jsxs("tr",{className:"relative group bg-[#1b1b1b] hover:bg-[#222222] h-[32px] max-h-[32px] text-white rounded-2xl",style:{margin:"2px"},children:[i.jsx("td",{scope:"row",className:"sticky left-0 z-[2] bg-[#1b1b1b] group-hover:bg-[#222222] sm:rounded-l-2xl",children:i.jsx("div",{onClick:()=>{var pr;window.open(`/terminal/${((pr=cn.find(es=>es.label===pe.asset))==null?void 0:pr.value)||pe.asset}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 sm:pl-6 h-8 max-h-14 rounded-2xl cursor-pointer",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"w-5 h-5 rounded-full",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${((pn=cn.find(pr=>pr.label===pe.asset))==null?void 0:pn.value)||oi[pe.asset]||((An=pe.asset)==null?void 0:An.split("/")[0])}.svg`||Ua,alt:pe==null?void 0:pe.asset,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:pr=>ea(pr)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:(()=>{const pr=cn.find(es=>es.label===pe.asset);return pr?pr.value:pe.asset})()})]})})}),i.jsx("td",{scope:"row",className:"z-[2] pl-4 bg-[#1b1b1b] group-hover:bg-[#222222]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-8 max-h-8",children:i.jsxs("div",{className:`${(or=pe.direction)!=null&&or.includes("Long")?pe.direction==="Short > Long"?"text-[#67ffbd] bg-[#67ffbd]/20":pe.direction==="Long > Short"?"text-[#ff787b] bg-[#ff797c]/20":"text-[#67ffbd] bg-[#67ffbd]/20":pe.direction=="Buy"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-5 pl-1 pr-1.5 py-1  rounded-md justify-start items-center gap-0.5 inline-flex`,children:[i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx("div",{className:"w-3 h-3 relative",children:(_r=pe.direction)!=null&&_r.includes("Long")?pe.direction==="Short > Long"?i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):pe.direction==="Long > Short"?i.jsx(Es,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):pe.direction=="Buy"?i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Es,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsx("div",{className:" text-[11px] font-semibold font-manrope leading-[8px] tracking-wide",children:pe.direction=="Sell"?"Sell":pe.direction=="Buy"?"Buy":pe.direction=="Close Short"?"Short":pe.direction=="Close Long"?"Long":pe.direction=="Open Short"?"Short":pe.direction=="Open Long"?"Long":pe.direction})]})})}),i.jsx("td",{scope:"row",className:"z-[2] pl-4 bg-[#1b1b1b] group-hover:bg-[#222222]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-8 max-h-8",children:i.jsx("div",{className:"text-white h-5 pl-1 pr-1.5 py-1  rounded-md justify-start items-center gap-0.5 inline-flex",children:i.jsx("div",{className:`${pe!=null&&pe.isLiquidation?"text-[#ff787b]":"text-white"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px] min-w-max`,children:pe!=null&&pe.isLiquidation?`Market Liquidation: ${pe.direction=="Sell"?"Sell":pe.direction=="Buy"?"Buy":pe.direction=="Close Short"?"Close Short":pe.direction=="Close Long"?"Close Long":pe.direction=="Open Short"?"Close Short":pe.direction=="Open Long"?"Close Long":"Close "+pe.direction} `:pe.totalStartPositions==0?"Open Position":pe.direction!="Short > Long"&&pe.direction!="Long > Short"?(pe==null?void 0:pe.totalSize)-Math.abs(pe==null?void 0:pe.totalStartPositions)==0&&(pe.direction=="Close Long"||pe.direction=="Close Short")?"Position Closed":pe.direction=="Open Short"||pe.direction=="Open Long"?"Increase":pe.direction=="Close Long"||pe.direction=="Close Short"?"Decrease":pe.direction=="Sell"||pe.direction=="Buy"?"Spot":"Changed Position":pe.direction=="Short > Long"||pe.direction=="Long > Short"?"Changed Position":"Open Position"})})})}),i.jsx("td",{children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:ro(pe.totalSize)})})}),i.jsx("td",{children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:Ft?`$${vv(Ft)}`:vv(Ft)})})}),i.jsx("td",{children:i.jsx("div",{className:`${pe.pnl,""} px-1 flex justify-end gap-2 font-manrope  min-w-max`,children:i.jsx("div",{className:`${pe.pnl>=0?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:pe.pnl?`$${vv(Math.abs(pe.pnl))}`:vv(Math.abs(pe.pnl))})})}),i.jsx("td",{children:i.jsx("div",{className:"px-1 flex flex-col items-end gap-2 font-manrope",children:i.jsxs("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:[(wr=pe==null?void 0:pe.fills)==null?void 0:wr.length," Fills"]})})}),i.jsx("td",{children:i.jsx("div",{onClick:()=>{wn(Ot=="time"?"date":"time")},className:"px-1 flex flex-col items-end gap-2 font-manrope cursor-pointer",children:i.jsx("div",{className:"text-white text-sm font-normal font-manrope leading-[13px] tracking-[0.18px]",children:Ot=="time"?i.jsx(Gn,{date:pe.latestFill}):eu(pe.latestFill)})})}),i.jsx("td",{className:"sm:rounded-r-2xl mr-3",children:i.jsx("div",{className:"pl-1 pr-8 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-[#979797] text-sm font-normal font-manrope leading-[13px] tracking-[0.18px]",children:pe==null?void 0:pe.oid})})})]},st),i.jsx("tr",{children:i.jsx("td",{colSpan:"100",style:{height:"2px"}})})]},st)})})]})})]}):N==="positions"?i.jsxs("div",{className:"relative w-full ",children:[i.jsxs("div",{className:"absolute -top-6 right-2 z-10 hidden lg:flex justify-start items-center gap-2",children:[i.jsx("button",{onClick:He,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Pl,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:Rt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Pl,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:lt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Pl,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:qe,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Pl,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{ref:Je,className:"w-full overflow-scroll min-h-[60vh] max-h-[60vh] h-full flex-grow mt-1 mb-3 bg-[#161616] border-collapse rounded-lg pb-24",children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] font-semibold leading-[13px] tracking-[0.26px] text-[#9b9b9b] text-[13px] font-manrope mr-3",children:[i.jsx("th",{scope:"col",className:"sticky bg-[#161616] left-0 h-10 pl-2 sm:pl-6 min-w-[130px] sm:min-w-[145px] z-[8]",children:i.jsxs("div",{className:"flex justify-start items-center gap-2 relative",children:[i.jsx(ci,{title:"Coin",sortKey:"asset",sortOption:te,setSortOption:ue,isFilterIcon:!1}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>qn(!Pn),className:`${Oe?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx(Ff,{className:`w-4 h-4 ${Oe?"text-blue-500":"text-white"}`})}),Pn&&i.jsxs("div",{ref:zn,className:`absolute left-[58px] mt-32 w-[208px]
                               bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>sn(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"text",value:Oe,onChange:pe=>sn(pe.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2  placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Coin"})]})]})]})}),vr&&i.jsx(WY,{className:"min-w-[130px] sm:min-w-[130px] px-1",title:"Source Tag",sortKey:"source_tag",sortOption:te,setSortOption:ue}),i.jsx(WY,{className:"min-w-[100px] sm:min-w-[120px] px-1",title:"Type",sortKey:"type_leverage",sortOption:te,setSortOption:ue}),i.jsx(_d,{className:"min-w-[80px] sm:min-w-[80px] px-1",title:"Size",sortKey:"size",sortOption:te,setSortOption:ue}),i.jsx(_d,{className:"min-w-[130px] sm:min-w-[145px] px-1",title:"Position Value",sortKey:"positionValue",sortOption:te,setSortOption:ue}),i.jsx(_d,{className:"min-w-[120px] sm:min-w-[120px] px-1",title:"Entry Price",sortKey:"entryPrice",sortOption:te,setSortOption:ue}),i.jsx(_d,{className:"min-w-[120px]  sm:min-w-[120px] px-1",title:"Mark Price",sortKey:"currentPrice",sortOption:te,setSortOption:ue}),i.jsx(_d,{className:"min-w-[100px] sm:min-w-[160px] px-1",title:"PnL(ROE%)",sortKey:"unrealizedPnl",sortOption:te,setSortOption:ue}),i.jsx(_d,{className:"min-w-[120px] sm:min-w-[120px] px-1",title:"Liq. Price",sortKey:"liquidationPrice",sortOption:te,setSortOption:ue}),i.jsx(_d,{className:"min-w-[120px] sm:min-w-[130px] px-1",title:"Margin",sortKey:"marginUsed",sortOption:te,setSortOption:ue}),i.jsx(_d,{className:"min-w-[110px] sm:min-w-[130px] px-1",title:"Funding",sortKey:"funding",sortOption:te,setSortOption:ue}),i.jsx(_d,{className:`${vr?"pr-0":"pr-8"} min-w-[185px] sm:min-w-[185px] pl-1`,title:"Entry Time",sortKey:"entryTime",sortOption:te,setSortOption:ue}),vr&&i.jsx("th",{scope:"col",className:"min-w-[130px] sm:min-w-[150px] pl-1 pr-5",children:i.jsx("div",{className:"flex items-center justify-end w-full gap-1 min-w-max",children:i.jsx("div",{className:"flex items-center justify-end group",children:i.jsxs("div",{onClick:pe=>{if(pe.preventDefault(),at)return;const Ft=(t!=null&&t.length?t.map(yt=>yt.wallet_address.toLowerCase()):[e==null?void 0:e.toLowerCase()]).map(yt=>{var pn;return(pn=fr.find(An=>An.wallet_address===yt))==null?void 0:pn.wallet_id}).filter(Boolean);Zr(Ft)},className:"h-[26px] pl-1 pr-2 py-1.5 bg-[#67ffbd]/20 hover:bg-[#67ffbd]/30 rounded-md inline-flex justify-start items-center gap-2 cursor-pointer",children:[i.jsx("div",{className:"",children:i.jsx("img",{src:tae,alt:"",className:"w-4 h-4"})}),at?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[66px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{className:"justify-start text-[#67ffbd] text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Fast Close All"})]})})})})]})}),i.jsx("tbody",{children:!s||s.length==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:window.innerWidth>=640&&window.innerWidth<768?5:window.innerWidth>=768&&window.innerWidth<1024?6:window.innerWidth>=1024&&window.innerWidth<1240?8:window.innerWidth>=1240&&window.innerWidth<1540?10:window.innerWidth>=1540?12:4,className:"h-[36vh]",children:i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-[100%] sm:w-[75%] max-w-[300px] sm:max-w-[700px] justify-center items-center text-center",children:u?i.jsx(Ma,{}):i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ec,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No open positions are currently available"}),i.jsxs("div",{className:"text-center -mt-2",children:[i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["To discover a different wallet, you can use the"," "]}),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"'Discover Wallets'"}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:[" ","tab above."]})]})]})]})})})})}):B==null?void 0:B.map((pe,st)=>{var Ft,yt,pn,An,or;return i.jsxs(Se.Fragment,{children:[i.jsxs("tr",{className:"relative group bg-[#1b1b1b] hover:bg-[#222222] h-[32px] max-h-[32px] text-white rounded-2xl",style:{margin:"2px"},children:[i.jsx("td",{scope:"row",className:"sticky left-0 z-[2] bg-[#1b1b1b] group-hover:bg-[#222222] sm:rounded-l-2xl",children:i.jsx("div",{onClick:()=>{window.open(`/terminal/${pe==null?void 0:pe.asset}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 sm:pl-6 h-8 max-h-14 rounded-2xl cursor-pointer",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"w-5 h-5 rounded-full",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${oi[pe.asset]||((Ft=pe.asset)==null?void 0:Ft.split("/")[0])}.svg`||Ua,alt:pe==null?void 0:pe.asset,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:_r=>ea(_r)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:pe.asset})]})})}),vr&&i.jsx("td",{children:i.jsx("div",{onClick:_r=>{_r.preventDefault(),pe!=null&&pe.tagWallet&&(pe==null?void 0:pe.tagWallet)!=null&&window.open(`/wallet-details/${pe==null?void 0:pe.tagWallet}`,"_blank")},className:`${pe!=null&&pe.tagWallet&&(pe==null?void 0:pe.tagWallet)!=null?"cursor-pointer":""} pl-1 pr-2 flex flex-col items-start gap-2 font-manrope`,children:i.jsxs("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px] has-tooltip relative",children:[(pe==null?void 0:pe.tagName)==null||(pe==null?void 0:pe.tagName)==""?"--":((yt=pe==null?void 0:pe.tagName)==null?void 0:yt.length)>10?((pn=pe==null?void 0:pe.tagName)==null?void 0:pn.slice(0,10))+"...":pe==null?void 0:pe.tagName,(pe==null?void 0:pe.tagName)&&(pe==null?void 0:pe.tagName.length)>10&&i.jsx("span",{children:i.jsx(_a,{content:`${pe==null?void 0:pe.tagName}`,positionTop:!0,alignRight:!1})})]})})}),i.jsx("td",{scope:"row",className:"z-[2] bg-[#1b1b1b] group-hover:bg-[#222222]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-8 max-h-8",children:i.jsxs("div",{className:`${pe.type==="Long"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-5 pl-1 pr-1.5 py-1  rounded-md justify-start items-center gap-0.5 inline-flex`,children:[i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx("div",{className:"w-3 h-3 relative",children:pe.type==="Long"?i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Es,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsxs("div",{className:" text-[11px] font-semibold font-manrope leading-[8px] tracking-wide uppercase",children:[pe.type," - ",pe==null?void 0:pe.leverage,"x"]})]})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:ro(Math.abs(pe.size))})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:pe.positionValue?`$${ro(pe.positionValue)}`:ro(pe.positionValue)})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:pe.entryPrice?`$${Er(pe.entryPrice)}`:Er(pe.entryPrice)})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:pe.currentPrice?`$${Er(pe.currentPrice)}`:Er(pe.currentPrice)})})}),i.jsx("td",{children:i.jsxs("div",{onClick:()=>{gn(_r=>({..._r,coin:pe.asset,type:pe.type,leverage:pe.leverage,roe:pe.roe,entryPrice:pe.entryPrice,markPrice:pe.currentPrice,pnl:pe.unrealizedPnl,referral:window.localStorage.getItem("hyperToken")?fe:null})),Be(!0)},className:"pl-1 pr-2 flex justify-end gap-2 font-manrope cursor-pointer min-w-max",children:[i.jsxs("div",{className:`${pe.unrealizedPnl>=0?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:[pe.unrealizedPnl?`$${ro(Math.abs(pe.unrealizedPnl))}`:ro(Math.abs(pe.unrealizedPnl)),` (${ro(Math.abs(pe==null?void 0:pe.roe))}%)`]}),i.jsx("div",{className:"flex justify-center items-center rounded",children:i.jsx("img",{src:cm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:pe.liquidationPrice!=null&&pe.liquidationPrice!==""&&!isNaN(pe.liquidationPrice)?`$${ro(pe.liquidationPrice)}`:ro(pe.liquidationPrice)})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsxs("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px] min-w-max",children:[pe.marginUsed?`$${ro(pe.marginUsed)}`:ro(pe.marginUsed),"  (",((An=pe==null?void 0:pe.marginMode)==null?void 0:An.charAt(0).toUpperCase())+((or=pe==null?void 0:pe.marginMode)==null?void 0:or.slice(1)),")"]})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:`${pe.funding<=0?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:pe.funding?`$${vv(Math.abs(pe.funding))}`:vv(Math.abs(pe.funding))})})}),i.jsx("td",{className:`${vr?"":"pr-8 sm:rounded-r-2xl"}`,children:i.jsx("div",{onClick:()=>{Wt(pt=="time"?"date":"time")},className:"pl-1 flex flex-col items-end gap-2 font-manrope cursor-pointer",children:i.jsx("div",{className:"text-white text-sm font-normal font-manrope leading-[13px] tracking-[0.18px] min-w-max",children:pe!=null&&pe.latestFill?pt=="time"?i.jsx(Gn,{date:pe==null?void 0:pe.latestFill}):eu(pe==null?void 0:pe.latestFill):i.jsx("span",{className:"text-[#979797]",children:"--"})})})}),vr&&i.jsx("td",{className:"pr-5 sm:rounded-r-2xl",children:i.jsx("div",{className:"pl-1 flex flex-col items-end gap-2 font-manrope",children:it[`${pe==null?void 0:pe.leverage}_${pe==null?void 0:pe.asset}_${pe==null?void 0:pe.size}`]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[54px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{onClick:()=>{const _r=fr.find(es=>{var ts;return es.wallet_address===((ts=pe.wallet||e)==null?void 0:ts.toLowerCase())}),wr=_r==null?void 0:_r.wallet_id,pr=_r==null?void 0:_r.wallet_address;wr&&rs(wr,pr,pe==null?void 0:pe.asset,pe==null?void 0:pe.leverage,pe==null?void 0:pe.size)},className:"h-5 px-2 py-1.5 rounded-md border border-white justify-start items-center gap-2 inline-flex",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight cursor-pointer",children:"Market"})})})})]}),i.jsx("tr",{children:i.jsx("td",{colSpan:"100",style:{height:"2px"}})})]},st)})})]})})]}):N==="twap-history"&&jt.pathname.startsWith("/wallet-details")?i.jsx(Iin,{data:ct,setData:Ut,wallet:e,coinNameData:cn}):N==="trade-history"?i.jsx(cin,{wallet:e,wallets:t}):N==="completed-trades"?i.jsx(Tin,{trades:ne,generatedWallets:fr,wallet:e,wallets:t}):N==="deposit-withdraw"?i.jsx(hin,{wallet:e,wallets:t}):""]})},_d=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(ci,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!0})}),WY=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(ci,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!1})});function qY({walletAddress:e}){const[t,n]=m.useState(!1),[r,s]=m.useState(0),[a,o]=m.useState([]),[l,c]=m.useState({}),[u,d]=m.useState(null),[f,x]=m.useState(""),[g,v]=m.useState(""),w=()=>{ls.post("https://dextrabothypev2.nftinit.io/api/hyper/wallet/getwalletreportsdetail/",{wallet_address:e}).then(I=>{s(I.data.report_count||0);const P=I.data.report_detail.reduce((R,F)=>(R[F.report_type_id]=(R[F.report_type_id]||0)+1,R),{});c(P)})};m.useEffect(()=>{w()},[e]),m.useEffect(()=>{const I=P=>{P.key==="Escape"&&n(!1)};return t&&window.addEventListener("keydown",I),()=>{window.removeEventListener("keydown",I)}},[t]);const C=()=>{a.length||ls.get("https://dextrabothypev2.nftinit.io/api/hyper/wallet/getreporttypes/").then(I=>{var P;return o(((P=I.data)==null?void 0:P.data)||[])})},N=()=>{if(!u){v("Please select a report type");return}const I=localStorage.getItem("hyperAddress"),P=localStorage.getItem("hyperToken");ls.post("https://dextrabothypev2.nftinit.io/api/hyper/wallet/walletreport/",{address:I,token:P,reported_wallet_address:e,report_type_id:u,message:f}).then(()=>{n(!1),d(null),x(""),w()})};return i.jsxs(i.Fragment,{children:[i.jsxs("button",{onClick:()=>{n(!0),C()},className:"relative flex items-center gap-2 px-5 py-2 rounded-full bg-[#2d2d2d] hover:bg-[#3b3b3b] text-sm font-semibold text-white font-manrope",children:["Report",r>0&&i.jsx("span",{className:"bg-red-600 text-white text-xs font-bold rounded-full px-1 font-manrope w-5 h-5 flex justify-center items-center",children:r})]}),t&&i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",onClick:()=>n(!1),children:i.jsxs("div",{className:"w-full max-w-md rounded-2xl bg-[#1b1b1b] p-6 text-white shadow-lg relative border border-[#3B3B3B]",onClick:I=>I.stopPropagation(),children:[i.jsx("div",{className:"absolute top-4 right-4 w-7 h-7 rounded-[8px] bg-[#3D3D3D] flex items-center justify-center text-sm cursor-pointer hover:bg-[#565656]",onClick:()=>n(!1),children:i.jsx(DIe,{className:"text-[#CECECE] mt-[1px]"})}),i.jsx("h2",{className:"text-lg font-bold mb-1 font-manrope",children:"Report Trader"}),i.jsx("p",{className:"text-xs mb-6 text-[#a1a1a1] font-manrope",children:"You can report this wallet to help determine if it is Delta Neutral or Bot."}),i.jsx("div",{className:"flex justify-center w-full gap-4 mb-6",children:a.map(I=>i.jsxs("button",{onClick:()=>{d(I.id),v("")},className:`flex items-center gap-2 px-3 py-3 rounded-full text-[13px] font-semibold transition-all hover:bg-white hover:text-[#161616] ${u===I.id?"bg-white text-[#161616]":"bg-[#1f1f1f] border border-[#353535]"}`,children:[I.name,i.jsx("span",{className:"bg-[#FFC940] text-[#30260E] text-13px font-bold rounded-[6px] px-2",children:l[I.id]||0})]},I.id))}),i.jsx("label",{className:"block text-xs mb-1",children:"Comment (Optional)"}),i.jsx("textarea",{value:f,onChange:I=>x(I.target.value),placeholder:"Describe the behavior or issue you're reporting...",className:"w-full h-24 rounded-lg bg-[#111] border border-[#2d2d2d] p-3 text-sm outline-none placeholder-[#555] resize-none mb-6"}),g&&i.jsx("p",{className:"text-red-500 text-xs font-semibold mb-4 text-center",children:g}),i.jsx("div",{className:"w-full flex justify-center",children:i.jsx("button",{onClick:N,className:"flex bg-[#1f1f1f] w-[128px] h-[32px] px-[16px] py-[12px] justify-center items-center gap-[10px] shrink-0 rounded-[12px] border border-[#353535] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] text-white font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px] hover:bg-white hover:text-[#161616]",disabled:!localStorage.getItem("hyperAddress"),children:"Report"})})]})})]})}const ACe="https://api-ui.hyperliquid.xyz/info",Fin="wss://api.hyperliquid.xyz/ws",Oin=({initialAddress:e=""})=>{var la,jr,Xt;const[t,n]=m.useState(e),[r,s]=m.useState([]),[a,o]=m.useState([]),[l,c]=m.useState(!1),[u,d]=m.useState(1),[f,x]=m.useState(null),[g,v]=m.useState(!1),w=m.useRef(null),C=nl(),N=m.useRef(e),I=m.useRef(null),P=m.useRef(null),R=m.useRef(null),[F,U]=m.useState({}),[L,z]=m.useState(!1),[X,ne]=m.useState(""),[J,Z]=m.useState(null),{trackedWatchList:re,getTrackedWatchList:he,hyperToken:Y,copyTradeWatchList:ie,getCopyTradeWatchList:oe,setTelegramChatId:G,setSubscriberRole:V,setSubsExpireDay:ee,setMushboomerETH:ae,setMushboomerSOL:fe,setIsReferralCode:Ae,isReferralCodeName:ce,setIsReferralCodeName:ye,setIsWhitelist:Ne,setHyperToken:be,setHyperAddress:je,setSignModalOpen:Ie,latestPnL:Re}=m.useContext(Gr),{isConnected:Qe,address:Be}=Yr(),[it,tt]=m.useState(!1),[at,dt]=m.useState(!1),[ct,Ut]=m.useState(null),[kt,tn]=m.useState(null),[jt,un]=m.useState(""),[cn,Pt]=m.useState(!1),[Xe,Vt]=m.useState(localStorage.getItem("discover_period")==0?"day":localStorage.getItem("discover_period")==1?"week":localStorage.getItem("discover_period")==2?"month":localStorage.getItem("discover_period")==3?"threeMonth":null),Yt=Xe||Re.activeRange;m.useEffect(()=>{Vt(null)},[Re.activeRange]);const Ve=[{label:"@10",value:"GMEOW"},{label:"@112",value:"MEOW"},{label:"@115",value:"HOLD"},{label:"@117",value:"BERA"},{label:"@12",value:"XULIAN"},{label:"@123",value:"FARM"},{label:"@131",value:"ORA"},{label:"@132",value:"LIQD"},{label:"@134",value:"STAR"},{label:"@135",value:"SENT"},{label:"@136",value:"SOLV"},{label:"@16",value:"CZ"},{label:"@18",value:"ANSEM"},{label:"@21",value:"KOBE"},{label:"@22",value:"HAPPY"},{label:"@25",value:"BIGBEN"},{label:"@3",value:"MANLET"},{label:"@30",value:"FARMED"},{label:"@31",value:"GPT"},{label:"@32",value:"PURRPS"},{label:"@33",value:"BID"},{label:"@34",value:"HODL"},{label:"@1",value:"HFUN"},{label:"@100",value:"UP"},{label:"@101",value:"NIGGO"},{label:"@102",value:"HOP"},{label:"@103",value:"LUCKY"},{label:"@104",value:"COPE"},{label:"@105",value:"HPYH"},{label:"@106",value:"YAP"},{label:"@107",value:"HYPE"},{label:"@108",value:"CHEF"},{label:"@109",value:"WOW"},{label:"@11",value:"PEPE"},{label:"@110",value:"STEEL"},{label:"@111",value:"RETARD"},{label:"@113",value:"NEIRO"},{label:"@114",value:"PEAR"},{label:"@116",value:"MUNCH"},{label:"@118",value:"GENESY"},{label:"@119",value:"BUBZ"},{label:"@120",value:"PICKL"},{label:"@121",value:"SHEEP"},{label:"@122",value:"LAUNCH"},{label:"@124",value:"FLASK"},{label:"@125",value:"VAULT"},{label:"@126",value:"CAT"},{label:"@127",value:"HYENA"},{label:"@128",value:"DEPIN"},{label:"@129",value:"MON"},{label:"@13",value:"RUG"},{label:"@130",value:"BEATS"},{label:"@133",value:"H"},{label:"@137",value:"FLY"},{label:"@138",value:"TIME"},{label:"@139",value:"SOVRN"},{label:"@14",value:"ILIENS"},{label:"@15",value:"FUCKY"},{label:"@17",value:"BAGS"},{label:"@19",value:"TATE"},{label:"@2",value:"LICK"},{label:"@20",value:"PUMP"},{label:"@23",value:"SCHIZO"},{label:"@24",value:"SELL"},{label:"@26",value:"CATNIP"},{label:"@27",value:"HBOOST"},{label:"@28",value:"SUCKY"},{label:"@29",value:"GUP"},{label:"@35",value:"VEGAS"},{label:"@37",value:"VAPOR"},{label:"@38",value:"PANDA"},{label:"@39",value:"PILL"},{label:"@40",value:"ADHD"},{label:"@41",value:"FUN"},{label:"@42",value:"LADY"},{label:"@46",value:"DROP"},{label:"@47",value:"MBAPPE"},{label:"@48",value:"TEST"},{label:"@49",value:"RAGE"},{label:"@5",value:"SIX"},{label:"@50",value:"FRAC"},{label:"@51",value:"ATEHUN"},{label:"@52",value:"COZY"},{label:"@53",value:"ARI"},{label:"@54",value:"WASH"},{label:"@55",value:"ANT"},{label:"@59",value:"CATBAL"},{label:"@60",value:"TJIF"},{label:"@61",value:"GUESS"},{label:"@62",value:"MAXI"},{label:"@63",value:"NMTD"},{label:"@66",value:"RISE"},{label:"@67",value:"CINDY"},{label:"@70",value:"FRIED"},{label:"@73",value:"RANK"},{label:"@74",value:"OMNIX"},{label:"@75",value:"RIP"},{label:"@76",value:"G"},{label:"@77",value:"BOZO"},{label:"@78",value:"SPH"},{label:"@82",value:"BUSSY"},{label:"@83",value:"FATCAT"},{label:"@84",value:"SHREK"},{label:"@85",value:"PIP"},{label:"@86",value:"LQNA"},{label:"@87",value:"NASDAQ"},{label:"@88",value:"YEETI"},{label:"@9",value:"TRUMP"},{label:"@90",value:"FEIT"},{label:"@92",value:"VIZN"},{label:"@93",value:"STRICT"},{label:"@94",value:"AUTIST"},{label:"@96",value:"HGOD"},{label:"@97",value:"LIQUID"},{label:"@36",value:"ASI"},{label:"@4",value:"JEFF"},{label:"@43",value:"MOG"},{label:"@44",value:"HPEPE"},{label:"@45",value:"JEET"},{label:"@57",value:"RICH"},{label:"@58",value:"LORA"},{label:"@6",value:"WAGMI"},{label:"@65",value:"PIGEON"},{label:"@64",value:"HPUMP"},{label:"@69",value:"STACK"},{label:"@7",value:"CAPPY"},{label:"@72",value:"NOCEX"},{label:"@79",value:"SHOE"},{label:"@80",value:"MONAD"},{label:"@81",value:"HOPE"},{label:"@89",value:"SYLVI"},{label:"@91",value:"FRUDO"},{label:"@95",value:"MAGA"},{label:"@99",value:"EARTH"},{label:"@56",value:"NFT"},{label:"@8",value:"POINTS"},{label:"@68",value:"CHINA"},{label:"@141",value:"GOD"}];function Ke(pe,st){const Ft=st.map(({fill:yt,twapId:pn})=>({...yt,twapId:pn}));return[...pe,...Ft]}m.useEffect(()=>{e&&(async()=>{const pe=await Oce(e),st=await Mce(e),Ft=Ke(pe,st),{closed_positions:yt}=Rce(Ft);Z(yt)})()},[e]),m.useEffect(()=>(e&&(N.current=e,Dt(e),qe(e)),()=>{w.current&&(w.current.close(),w.current=null),I.current&&(clearTimeout(I.current),I.current=null),P.current&&(clearInterval(P.current),P.current=null),R.current&&(clearInterval(R.current),R.current=null)}),[e]),m.useEffect(()=>{const pe=localStorage.getItem("favoriteAddresses");pe&&U(JSON.parse(pe))},[]),m.useCallback(()=>{if(F[t]){const pe={...F};delete pe[t],U(pe),localStorage.setItem("favoriteAddresses",JSON.stringify(pe))}else z(!0),ne("")},[t,F]),m.useCallback(()=>{if(!X.trim())return;const pe={...F,[t]:{name:X,address:t}};U(pe),localStorage.setItem("favoriteAddresses",JSON.stringify(pe)),z(!1)},[X,t,F]),m.useCallback(pe=>{pe&&(n(pe),Dt(pe),C(`/wallet-details/${pe}`))},[]);const ft=pe=>{var st;((st=w.current)==null?void 0:st.readyState)===WebSocket.OPEN&&N.current===pe||(P.current&&(clearInterval(P.current),P.current=null),I.current&&(clearTimeout(I.current),I.current=null),w.current&&(w.current.close(),w.current=null),N.current=pe,w.current=new WebSocket(Fin),w.current.onopen=()=>{console.log("WebSocket Connected"),v(!0),[{method:"subscribe",subscription:{aggregateByTime:!0,type:"userFills",user:pe}},{method:"subscribe",subscription:{type:"user",user:pe}}].forEach(yt=>{w.current.send(JSON.stringify(yt))}),P.current=setInterval(()=>{var yt;if(((yt=w.current)==null?void 0:yt.readyState)===WebSocket.OPEN){const pn={id:99,method:"ping"};w.current.send(JSON.stringify(pn))}},3e4)},w.current.onclose=Ft=>{v(!1),P.current&&(clearInterval(P.current),P.current=null),Ft.code!==1e3&&(I.current||(I.current=setTimeout(()=>{I.current=null,N.current===pe&&ft(pe)},5e3)))},w.current.onerror=Ft=>{console.error("WebSocket Error:",Ft),v(!1)},w.current.onmessage=Ft=>{var yt,pn,An;try{const or=JSON.parse(Ft.data);if(or.method==="pong"||or.result==="success")return;if(or.channel==="userFills"&&((yt=or.data)!=null&&yt.fills)&&N.current.toLowerCase()===or.data.user.toLowerCase()&&(s(_r=>{const wr=_r.flatMap(Lr=>Lr.fills),pr=new Map;wr.forEach(Lr=>{pr.set(Lr.hash,!0)});const es=or.data.fills.filter(Lr=>!pr.has(Lr.hash));if(es.length===0)return _r;const ts=[...es,...wr];return At(ts)}),R.current||qe(N.current)),or.channel==="user"&&((pn=or.data)!=null&&pn.fills&&s(_r=>{const wr=_r.flatMap(Lr=>Lr.fills),pr=new Map;wr.forEach(Lr=>{pr.set(Lr.hash,!0)});const es=or.data.fills.filter(Lr=>!pr.has(Lr.hash));if(es.length===0)return _r;const ts=[...es,...wr];return At(ts)}),(An=or.data)!=null&&An.state)){x(or.data.state);const _r=Rt(or.data.state);o(_r)}}catch(or){console.error("Error processing WebSocket message:",or),console.error("Raw message that caused error:",Ft.data)}})},en=async pe=>{try{tt(!0);const st=await ls.post(ACe,{type:"clearinghouseState",user:pe});if(st.data){x(st.data);const Ft=Rt(st.data);o(Ft),tt(!1),Ft.length>0&&!R.current?qe(pe):Ft.length===0&&R.current&&(clearInterval(R.current),R.current=null)}}catch(st){console.error("Error fetching user state:",st),tt(!1)}},Dt=async pe=>{if(!pe){on.error("Please enter a wallet address");return}if(!pe.match(/^0x[a-fA-F0-9]{40}$/)){on.error("Please enter a valid Ethereum address");return}c(!0);try{pe!==e&&C(`/wallet-details/${pe}`),ft(pe);const[st]=await Promise.all([ls.post(ACe,{aggregateByTime:!0,type:"userFills",user:pe}),en(pe)]);if(st.data&&Array.isArray(st.data)){const Ft=At(st.data);s(Ft),d(1)}else console.error("Invalid response format:",st.data)}catch(st){console.error("Error fetching data:",st)}finally{c(!1)}},At=pe=>{const st=[...pe].sort((yt,pn)=>pn.time-yt.time),Ft=new Map;return st.forEach(yt=>{var An;const pn=yt.oid;if(!Ft.has(pn)){const or=st.filter(Qr=>Qr.oid===yt.oid),_r=or.reduce((Qr,Ir)=>Qr+parseFloat(Ir.sz),0),wr=or.map(Qr=>parseFloat(Qr.startPosition));let pr;wr.includes(0)?pr=0:wr.every(Qr=>Qr>0)?pr=Math.max(...wr):wr.every(Qr=>Qr<0)?pr=Math.min(...wr):pr=or.reduce((Qr,Ir)=>Qr+parseFloat(Ir.startPosition),0);const es=or.reduce((Qr,Ir)=>Qr+parseFloat(Ir.sz)*parseFloat(Ir.px),0),ts=or.reduce((Qr,Ir)=>Qr+parseFloat(Ir.closedPnl||0),0),Lr=((An=or.find(Qr=>Qr.dir==="Long > Short"||Qr.dir==="Short > Long"))==null?void 0:An.dir)||"";Ft.set(pn,{oid:yt.oid,asset:yt.coin,direction:Lr==""?yt.dir:Lr,fills:or,totalSize:_r,totalStartPositions:pr,totalValue:es,pnl:ts,latestFill:yt.time})}}),Array.from(Ft.values()).sort((yt,pn)=>pn.latestFill-yt.latestFill)},Je=pe=>{const st=new Date(pe),Ft=st.toLocaleString("en-US",{month:"short"}),yt=st.getDate(),pn=st.getFullYear(),An=st.getHours().toString().padStart(2,"0"),or=st.getMinutes().toString().padStart(2,"0"),_r=st.getHours()>=12?" PM":" AM";return`${Ft} ${yt}, ${pn}, ${An}:${or}  ${_r}`},He=r,Rt=pe=>{if(!(pe!=null&&pe.assetPositions))return[];const st=new Map;return r.forEach(Ft=>{Ft.fills.forEach(yt=>{let pn="";yt.dir.includes("Open")?pn=yt.dir.includes("Long")?"Long":"Short":yt.side==="B"?pn="Long":yt.side==="S"&&(pn="Short");const An=`${yt.coin}-${pn}`;(!st.has(An)||yt.time<st.get(An))&&st.set(An,yt.time)})}),pe.assetPositions.filter(Ft=>{if(!Ft.position||!Ft.position.szi)return!1;const yt=parseFloat(Ft.position.szi);return!isNaN(yt)&&yt!==0}).map(Ft=>{const yt=Ft.position,pn=parseFloat(yt.szi),An=parseFloat(yt.entryPx),or=parseFloat(yt.positionValue),_r=parseFloat(yt.unrealizedPnl),wr=parseFloat(yt.returnOnEquity)*100,pr=parseFloat(yt.marginUsed),es=yt.leverage.value,ts=yt.leverage.type,Lr=parseFloat(yt.cumFunding.sinceOpen),Qr=pn>0?"Long":"Short",Ir=st.get(`${yt.coin}-${Qr}`);return{asset:yt.coin,type:Qr,size:pn,entryPrice:An.toFixed(4),currentPrice:(or/Math.abs(pn)).toFixed(4),leverage:es,marginMode:ts,positionValue:or.toFixed(2),marginUsed:pr.toFixed(2),unrealizedPnl:_r.toFixed(2),roe:wr.toFixed(2),funding:Lr.toFixed(4),startTime:Ir?Je(Ir):"N/A",liquidationPrice:yt.liquidationPx?parseFloat(yt.liquidationPx).toFixed(2):"N/A"}})},qe=pe=>{R.current&&(clearInterval(R.current),R.current=null),R.current=setInterval(()=>{en(pe)},7e3)},lt=pe=>pe>=1e6?`${(pe/1e6).toFixed(2)}M`:pe>=1e3?`${(pe/1e3).toFixed(2)}K`:pe.toFixed(2);m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&(he(),oe())},[]);const xt=m.useRef(null),Nt=()=>{xt.current&&(xt.current.scrollLeft-=200)},It=()=>{xt.current&&(xt.current.scrollLeft+=200)};m.useEffect(()=>{(async()=>{var yt,pn;const st=window.localStorage.getItem("hyperToken"),Ft=window.localStorage.getItem("hyperAddress");if(!(!st||!Ft))try{const An=await Si(Ft.toLowerCase(),st);An!=null&&An.success?(G(An==null?void 0:An.telegram_chat_id),V(An==null?void 0:An.subscriber_role),ee(An==null?void 0:An.subs_expire_day),ae((yt=An==null?void 0:An.mushboomer_counts)==null?void 0:yt.eth),fe((pn=An==null?void 0:An.mushboomer_counts)==null?void 0:pn.sol),Ae(An==null?void 0:An.referral_code),ye(An==null?void 0:An.refcode),Ne(An==null?void 0:An.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),be(""),je(""))}catch(An){console.error("Token verification error:",An),console.error(An.message||"An unknown error occurred.")}})()},[]);const xn=async({walletAddress:pe,isFollow:st,isScalper:Ft})=>{try{un(pe);const yt=window.localStorage.getItem("hyperToken"),pn=window.localStorage.getItem("hyperAddress");if(!yt){Ie(!0);return}const An=st?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",or=st?{address:Be?Be.toLowerCase():pn,token:yt,follow_address:pe.toLowerCase()}:{address:Be?Be.toLowerCase():pn,token:yt},_r=await fetch(An,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(or)});if(!_r.ok)throw new Error(`Server responded with status ${_r.status}`);const wr=await _r.json();wr.success?(Ut(Array.isArray(wr==null?void 0:wr.data)?[...wr.data].sort((pr,es)=>new Date(es.created_at||0)-new Date(pr.created_at||0)):wr==null?void 0:wr.data),tn(Ft),dt(!0)):(console.log(wr.error_message),on.error(wr.error_message))}catch(yt){console.error("Error in like function:",yt),on.error(yt.message||"Something went wrong!")}},dn="-latestFill",[Mn,_n]=m.useState(dn),[kn,vn]=m.useState([]),[Qn,Hn]=m.useState(""),[$n,Jn]=m.useState(""),[Nn,ln]=m.useState(""),[Oe,sn]=m.useState(!1),[fn,Et]=m.useState(!1),[Kn,Cn]=m.useState(!1),[Bt,an]=m.useState(!1),Pn=m.useRef(null),qn=m.useRef(null),nr=m.useRef(null),tr=m.useRef(null);m.useEffect(()=>{function pe(st){Pn.current&&!Pn.current.contains(st.target)&&sn(!1),qn.current&&!qn.current.contains(st.target)&&Et(!1),nr.current&&!nr.current.contains(st.target)&&Cn(!1),tr.current&&!tr.current.contains(st.target)&&an(!1)}return document.addEventListener("mousedown",pe),()=>document.removeEventListener("mousedown",pe)},[]);const Qt=He.map(pe=>{let st=pe.totalStartPositions==0?"Open Position":pe.direction!="Short > Long"&&pe.direction!="Long > Short"?(pe==null?void 0:pe.totalSize)-Math.abs(pe==null?void 0:pe.totalStartPositions)==0&&(pe.direction=="Close Long"||pe.direction=="Close Short")?"Position Closed":pe.direction=="Open Short"||pe.direction=="Open Long"?"Increase":pe.direction=="Close Long"||pe.direction=="Close Short"?"Decrease":pe.direction=="Sell"||pe.direction=="Buy"?"Spot":"Changed Position":pe.direction=="Short > Long"||pe.direction=="Long > Short"?"Changed Position":"Open Position";return{...pe,computedType:st}}),zn=pe=>{const st=Ve.find(Ft=>Ft.label===pe);return st?st.value.toUpperCase():pe==null?void 0:pe.toUpperCase()},Yn=Qt.filter(pe=>kn.length?kn.includes(pe.computedType):!0).filter(pe=>{var st,Ft;return Qn?(Ft=(st=pe==null?void 0:pe.oid)==null?void 0:st.toString())==null?void 0:Ft.includes(Qn):!0}).filter(pe=>$n?zn(pe.asset).includes($n.toUpperCase()):!0),Fn=(pe=>Yn==null?void 0:Yn.sort((st,Ft)=>{var ts,Lr,Qr,Ir;const yt=st.totalSize?st.totalValue/st.totalSize:0,pn=Ft.totalSize?Ft.totalValue/Ft.totalSize:0,An=Ss=>{const hi=Ve.find(li=>li.label===Ss);return hi?hi.value.toUpperCase():Ss==null?void 0:Ss.toUpperCase()},or=An(st.asset),_r=An(Ft.asset),wr=Ss=>{if(!Ss)return"";const hi=Ss.toLowerCase();return hi.includes("short")?"Short":hi.includes("long")?"Long":hi==="buy"?"Buy":hi==="sell"?"Sell":Ss},pr=wr(st.direction),es=wr(Ft.direction);if(pe==="-totalSize")return Ft.totalSize-st.totalSize;if(pe==="totalSize")return st.totalSize-Ft.totalSize;if(pe==="-pnl")return Ft.pnl-st.pnl;if(pe==="pnl")return st.pnl-Ft.pnl;if(pe==="-fills")return(((ts=Ft.fills)==null?void 0:ts.length)||0)-(((Lr=st.fills)==null?void 0:Lr.length)||0);if(pe==="fills")return(((Qr=st.fills)==null?void 0:Qr.length)||0)-(((Ir=Ft.fills)==null?void 0:Ir.length)||0);if(pe==="-latestFill")return new Date(Ft.latestFill)-new Date(st.latestFill);if(pe==="latestFill")return new Date(st.latestFill)-new Date(Ft.latestFill);if(pe==="-avgPrice")return pn-yt;if(pe==="avgPrice")return yt-pn;if(pe==="-oid")return Ft.oid-st.oid;if(pe==="oid")return st.oid-Ft.oid;if(pe==="direction"){const Ss={Short:1,Sell:2,Long:3,Buy:4};return(Ss[pr]||99)-(Ss[es]||99)}else if(pe==="-direction"){const Ss={Long:1,Buy:2,Short:3,Sell:4};return(Ss[pr]||99)-(Ss[es]||99)}else{if(pe==="-coin")return or<_r?-1:or>_r?1:0;if(pe==="coin")return or>_r?-1:or<_r?1:0}return 0}))(Mn).filter(pe=>(pe.totalStartPositions==0?"Open Position":pe.direction!="Short > Long"&&pe.direction!="Long > Short"?(pe==null?void 0:pe.totalSize)-Math.abs(pe==null?void 0:pe.totalStartPositions)==0&&(pe.direction=="Close Long"||pe.direction=="Close Short")?"Position Closed":pe.direction=="Open Short"||pe.direction=="Open Long"?"Increase":pe.direction=="Close Long"||pe.direction=="Close Short"?"Decrease":pe.direction=="Sell"||pe.direction=="Buy"?"Spot":"Changed Position":pe.direction=="Short > Long"||pe.direction=="Long > Short"?"Changed Position":"Open Position")==="Open Position"),Ee={};Fn.forEach(pe=>{var yt;const st=pe==null?void 0:pe.asset,Ft=new Date(pe==null?void 0:pe.latestFill).getTime();if(!Ee[st])Ee[st]=pe;else{const pn=new Date((yt=Ee[st])==null?void 0:yt.latestFill).getTime();Ft>pn&&(Ee[st]=pe)}});const p=Object.values(Ee),[h,S]=m.useState([]),_=a==null?void 0:a.filter(pe=>{var st;return Nn?(st=pe.asset)==null?void 0:st.toLowerCase().includes(Nn.toLowerCase()):!0}).map(pe=>{const st=p.find(yt=>(yt==null?void 0:yt.asset)===(pe==null?void 0:pe.asset)),Ft=h.find(yt=>(yt==null?void 0:yt.coin)===(pe==null?void 0:pe.asset));return{...pe,latestFill:(st==null?void 0:st.latestFill)||null,tagName:(Ft==null?void 0:Ft.tag)||null,tagWallet:(Ft==null?void 0:Ft.cp_wallet)||null}}),k="-unrealizedPnl",[T,B]=m.useState(k),q=pe=>_==null?void 0:_.sort((st,Ft)=>{const yt=st.tagName?st.tagName.toUpperCase():"",pn=Ft.tagName?Ft.tagName.toUpperCase():"",An=st.asset?st.asset.toUpperCase():"",or=Ft.asset?Ft.asset.toUpperCase():"",_r=st.type==="Long"?1:0,wr=Ft.type==="Long"?1:0,pr=st.type==="Short"?1:0,es=Ft.type==="Short"?1:0;return pe==="-unrealizedPnl"?Ft.unrealizedPnl-st.unrealizedPnl:pe==="unrealizedPnl"?st.unrealizedPnl-Ft.unrealizedPnl:pe==="-roe"?Ft.roe-st.roe:pe==="roe"?st.roe-Ft.roe:pe==="-size"?Ft.size-st.size:pe==="size"?st.size-Ft.size:pe==="-entryPrice"?Ft.entryPrice-st.entryPrice:pe==="entryPrice"?st.entryPrice-Ft.entryPrice:pe==="-currentPrice"?Ft.currentPrice-st.currentPrice:pe==="currentPrice"?st.currentPrice-Ft.currentPrice:pe==="-leverage"?Ft.leverage-st.leverage:pe==="leverage"?st.leverage-Ft.leverage:pe==="-positionValue"?Ft.positionValue-st.positionValue:pe==="positionValue"?st.positionValue-Ft.positionValue:pe==="-marginUsed"?Ft.marginUsed-st.marginUsed:pe==="marginUsed"?st.marginUsed-Ft.marginUsed:pe==="funding"?Ft.funding-st.funding:pe==="-funding"?st.funding-Ft.funding:pe==="-liquidationPrice"?Ft.liquidationPrice-st.liquidationPrice:pe==="liquidationPrice"?st.liquidationPrice-Ft.liquidationPrice:pe==="-entryTime"?new Date(Ft.latestFill)-new Date(st.latestFill):pe==="entryTime"?new Date(st.latestFill)-new Date(Ft.latestFill):pe==="-source_tag"?yt<pn?-1:yt>pn?1:0:pe==="source_tag"?yt>pn?-1:yt<pn?1:0:pe==="-type_leverage"?_r!==wr?wr-_r:Ft.leverage-st.leverage:pe==="type_leverage"?pr!==es?es-pr:Ft.leverage-st.leverage:pe==="-asset"?An<or?-1:An>or?1:0:pe==="asset"?An>or?-1:An<or?1:0:0}),[te,ue]=m.useState([]),[de,xe]=m.useState([]),[we,ke]=m.useState([]),[Me,Ye]=m.useState([]),[Fe,rt]=m.useState([]);async function se(){try{const pe=await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=1&order=-perp_pnl&offset=0&limit=50&user_token=${e}`);if(!pe.ok)throw new Error(`HTTP error! status: ${pe.status}`);const st=await pe.json();ue(st.results)}catch(pe){console.error("Error resetting filters:",pe)}}async function Ce(){try{const pe=await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=7&order=-perp_pnl&offset=0&limit=50&user_token=${e}`);if(!pe.ok)throw new Error(`HTTP error! status: ${pe.status}`);const st=await pe.json();xe(st.results)}catch(pe){console.error("Error resetting filters:",pe)}}async function De(){try{const pe=await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=30&order=-perp_pnl&offset=0&limit=50&user_token=${e}`);if(!pe.ok)throw new Error(`HTTP error! status: ${pe.status}`);const st=await pe.json();ke(st.results)}catch(pe){console.error("Error resetting filters:",pe)}}async function Le(){try{const pe=await fetch(`https://dextradata.nftinit.io/api/hyper/get_wallets_profit_new/?period=90&order=-perp_pnl&offset=0&limit=50&user_token=${e}`);if(!pe.ok)throw new Error(`HTTP error! status: ${pe.status}`);const st=await pe.json();Ye(st.results)}catch(pe){console.error("Error resetting filters:",pe)}}async function _e(){try{const pe=await fetch(`https://dextradata.nftinit.io/api/hyper/wallet/details/?user_token=${e}`);if(!pe.ok)throw new Error(`HTTP error! status: ${pe.status}`);const st=await pe.json();rt(st)}catch(pe){console.error("Error pnlSharpeRateData:",pe)}}m.useEffect(()=>{se(),Ce(),De(),Le(),_e()},[]);const[nt,ot]=m.useState(localStorage.getItem("discover_period")==0?"1D":localStorage.getItem("discover_period")==1?"7D":localStorage.getItem("discover_period")==2?"30D":localStorage.getItem("discover_period")==3||localStorage.getItem("discover_period")==4?"90D":"7D"),[gt,Jt]=m.useState(localStorage.getItem("discover_period")==0?"1D":localStorage.getItem("discover_period")==1?"7D":localStorage.getItem("discover_period")==2?"30D":localStorage.getItem("discover_period")==3||localStorage.getItem("discover_period")==4?"90D":"7D"),[Ge,et]=m.useState(localStorage.getItem("discover_period")==1?"7D":localStorage.getItem("discover_period")==2?"30D":localStorage.getItem("discover_period")==3||localStorage.getItem("discover_period")==4?"90D":"7D"),We=nt==="1D"?te:nt==="7D"?de:nt==="30D"?we:Me,wt=gt==="1D"?te:gt==="7D"?de:gt==="30D"?we:Me,St=a.length,Kt=a.filter(pe=>pe.unrealizedPnl>=0).length,gn=St>0?Kt/St*100:0,[yn,hn]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",positionDistribution:0,pnl:0,closePx:0}),pt=((la=q(T))==null?void 0:la.reduce((pe,st)=>pe+((st==null?void 0:st.leverage)||0),0))/(((jr=q(T))==null?void 0:jr.length)||1),Wt=(Xt=q(T))==null?void 0:Xt.reduce((pe,st)=>{const Ft=parseFloat(st==null?void 0:st.funding)||0;return pe+Ft},0),vt=localStorage.getItem("isDateOpenPositionsFormat")||"date",[Ot,wn]=m.useState(vt);m.useEffect(()=>{localStorage.setItem("isDateOpenPositionsFormat",Ot)},[Ot]);const fr=localStorage.getItem("isDateFillsFormat")||"date",[ur,$t]=m.useState(fr);m.useEffect(()=>{localStorage.setItem("isDateFillsFormat",ur)},[ur]);const[nn,Vn]=m.useState([]),lr=async()=>{try{const pe=window.localStorage.getItem("hyperToken");if(!pe){Ie(!0);return}const st="https://dextrabothypev2.nftinit.io/api/wallet/list",Ft=window.localStorage.getItem("hyperAddress"),pn=await(await fetch(st,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Be?Be.toLowerCase():Ft,token:pe,balance:"false"})})).json();pn!=null&&pn.success?(Vn(pn.data||[]),Zr(pn.data)):console.log(pn.error_message)}catch(pe){console.error("Error fetching generate wallet list:",pe)}};m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&lr()},[Y]);const er=nn==null?void 0:nn.find(pe=>(pe==null?void 0:pe.wallet_address)===(e==null?void 0:e.toLowerCase())),gr=ie==null?void 0:ie.find(pe=>(pe==null?void 0:pe.wallet_address)===(e==null?void 0:e.toLowerCase())),[dr,Fs]=m.useState([]),[us,xr]=m.useState(!0),[vr,rs]=m.useState(!1);m.useEffect(()=>{_&&_.length>0&&(gi(),nn.length>0&&us&&Zr())},[_]);const Zr=pe=>{const st=[...dr];st.length>0&&((pe==null?void 0:pe.some(yt=>(yt==null?void 0:yt.wallet_address)===(e==null?void 0:e.toLowerCase())))?oi(st):us&&(oi(st),xr(!1)))},gi=()=>{const pe=window.localStorage.getItem("hyperToken");let st=!1;const Ft=[...dr];_==null||_.forEach(yt=>{const pn=yt.asset;(Ft==null?void 0:Ft.some(or=>or.coin===pn))||(Ft==null||Ft.push({coin:pn,wallet:e}),st=!0)}),st&&(Fs(Ft),nn!=null&&nn.some(pn=>(pn==null?void 0:pn.wallet_address)===(e==null?void 0:e.toLowerCase()))&&pe&&oi(Ft))},oi=async pe=>{if(!vr)try{rs(!0);const st=window.localStorage.getItem("hyperToken"),Ft="https://dextrabothypev2.nftinit.io/api/hyper/following/position_info/";if(!st||!pe){rs(!1);return}st||Ie(!0);const yt=window.localStorage.getItem("hyperAddress"),An=await(await fetch(Ft,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Be?Be.toLowerCase():yt,token:st,positions:pe})})).json();An.success?S(An==null?void 0:An.data):(console.log(An.error_message),on.error(An.error_message))}catch(st){console.error("Error tag request",st),on.error(st.message)}finally{rs(!1)}};return i.jsxs(i.Fragment,{children:[i.jsx(PUe,{}),i.jsx(g5,{open:at,setOpen:dt,copyTradeData:ct,copyTradeWallet:jt,setCopyTradeWallet:un,isScalper:kt,setCopyTradeData:Ut}),i.jsx(oin,{open:cn,setOpen:Pt,data:yn,setTradeInfo:hn}),i.jsxs("div",{className:"min-h-max flex flex-col items-center justify-start text-white bg-[#161616] dark:bg-inherit w-full gap-1 overflow-hidden font-manrope",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-4 w-full mt-1 sm-mt-0",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1 h-max min-h-[45px] sm:min-h-max relative w-full",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row items-start justify-start sm:items-center gap-1",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx(eDe,{wallet:e,className:"w-10 h-10 rounded-full"}),i.jsxs("div",{className:`${nn.some(pe=>(pe==null?void 0:pe.wallet_address)==(e==null?void 0:e.toLowerCase()))?"bg-[#67ffbd]/20 rounded-xl p-[7px]":""} flex justify-start items-center gap-1 ml-1`,children:[i.jsx("div",{className:"flex flex-col items-start justify-center gap-1",children:i.jsx("div",{className:`${nn.some(pe=>(pe==null?void 0:pe.wallet_address)==(e==null?void 0:e.toLowerCase()))?"text-[#67ffbd]":"text-white"} text-base sm:text-[24px] font-semibold font-manrope leading-none tracking-wide`,children:e&&e.slice(0,6)+"..."+e.slice(-4)})}),i.jsxs("svg",{onClick:pe=>{pe.stopPropagation(),navigator.clipboard.writeText(e),on.success("Successfully copied.")},className:"cursor-pointer",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M12 9.675V12.825C12 15.45 10.95 16.5 8.325 16.5H5.175C2.55 16.5 1.5 15.45 1.5 12.825V9.675C1.5 7.05 2.55 6 5.175 6H8.325C10.95 6 12 7.05 12 9.675Z",stroke:`${nn.some(pe=>(pe==null?void 0:pe.wallet_address)==(e==null?void 0:e.toLowerCase()))?"#67FFBD":"#909090"}`,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M16.5 5.175V8.325C16.5 10.95 15.45 12 12.825 12H12V9.675C12 7.05 10.95 6 8.325 6H6V5.175C6 2.55 7.05 1.5 9.675 1.5H12.825C15.45 1.5 16.5 2.55 16.5 5.175Z",stroke:`${nn.some(pe=>(pe==null?void 0:pe.wallet_address)==(e==null?void 0:e.toLowerCase()))?"#67FFBD":"#909090"}`,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),i.jsxs("div",{className:`${nn.some(pe=>(pe==null?void 0:pe.wallet_address)==(e==null?void 0:e.toLowerCase()))?"ml-1 p-1":""} flex justify-start items-center h-6  bg-[#67ffbd]/20 rounded-md gap-0.5 has-tooltip relative min-w-max`,children:[er&&i.jsx("div",{className:"text-[#67ffbd] text-sm font-semibold font-manrope leading-[8px]",children:er.wallet_name.length>13?er.wallet_name.slice(0,13)+"...":er.wallet_name}),er&&er.wallet_name.length>13&&i.jsx("span",{className:"",children:i.jsx(_a,{content:`${er==null?void 0:er.wallet_name}`,positionTop:!1,alignRight:!1})})]}),i.jsxs("div",{className:`${ie.some(pe=>pe.wallet_address===e)?er?"ml-1 p-1":"ml-0.5 mr-2 p-1":""} flex justify-start items-center h-6  bg-[#67ffbd]/20 rounded-md gap-0.5 has-tooltip relative min-w-max`,children:[gr&&i.jsx("div",{className:"text-[#67ffbd] text-sm font-semibold font-manrope leading-[8px]",children:(gr==null?void 0:gr.tag.length)>13?(gr==null?void 0:gr.tag.slice(0,13))+"...":gr==null?void 0:gr.tag}),gr&&gr.tag.length>13&&i.jsx("span",{className:"",children:i.jsx(_a,{content:`${gr==null?void 0:gr.tag}`,positionTop:!1,alignRight:!1})})]})]}),i.jsx(x5,{walletAddress:e,children:i.jsx("div",{className:`${re.some(pe=>pe.wallet_address===e),"bg-[rgba(255,217,121,0.16)]"}  w-6 h-6sm:w-8 sm:h-8 px-2 sm:px-4 py-1 rounded-full justify-center items-center inline-flex cursor-pointer`,children:i.jsx("div",{className:"w-[18px] h-[18px] justify-center items-center flex",children:re.some(pe=>pe.wallet_address===e)?i.jsx("img",{src:r5,alt:"",className:"w-4 h-4 min-w-4 min-h-4"}):i.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-4 h-4",children:i.jsx("path",{d:"M10.2967 2.6325L11.6167 5.2725C11.7967 5.64 12.2767 5.9925 12.6817 6.06L15.0742 6.4575C16.6042 6.7125 16.9642 7.8225 15.8617 8.9175L14.0017 10.7775C13.6867 11.0925 13.5142 11.7 13.6117 12.135L14.1442 14.4375C14.5642 16.26 13.5967 16.965 11.9842 16.0125L9.7417 14.685C9.3367 14.445 8.6692 14.445 8.2567 14.685L6.0142 16.0125C4.4092 16.965 3.4342 16.2525 3.8542 14.4375L4.3867 12.135C4.4842 11.7 4.3117 11.0925 3.9967 10.7775L2.1367 8.9175C1.0417 7.8225 1.3942 6.7125 2.9242 6.4575L5.3167 6.06C5.7142 5.9925 6.1942 5.64 6.3742 5.2725L7.6942 2.6325C8.4142 1.2 9.5842 1.2 10.2967 2.6325Z",stroke:"#FFD979",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})})})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("div",{onClick:pe=>{var yt;pe.preventDefault();const st=ie==null?void 0:ie.some(pn=>pn.wallet_address===e),Ft=(de==null?void 0:de.length)>0?(yt=de[0])==null?void 0:yt.is_scalper:!1;xn({walletAddress:e,isFollow:st,isScalper:Ft})},className:`${ie.some(pe=>pe.wallet_address===e)?"bg-[#ffd979]/60 text-white/80":"bg-[rgba(103,255,189,0.16)] text-[#67FFBD]"} h-6 sm:h-8 px-2 sm:px-3 py-[1px] sm:py-[5px] rounded-[256px] justify-start items-center gap-2 inline-flex cursor-pointer min-w-max has-tooltip relative  ml-8 sm:ml-2`,children:i.jsx("div",{className:"text-[14px] font-semibold font-manrope leading-[8px]min-w-max",children:ie.some(pe=>pe.wallet_address===e)?"Edit Copy Trade":"Copy Trade"})}),i.jsx("div",{className:"sm:hidden h-6 flex justify-end",children:Y&&i.jsx(qY,{walletAddress:e})})]}),i.jsx(ein,{traderWallet:e,trades:J})]}),i.jsxs("div",{className:"absolute right-0 flex justify-end",children:[Y&&i.jsx(qY,{walletAddress:e}),i.jsx("div",{className:"absolute right-0 hidden sm:flex",children:Y&&i.jsx(qY,{walletAddress:e})})]})]}),i.jsxs("div",{className:"flex w-full flex-wrap",children:[i.jsxs("div",{className:"w-full lg:w-4/12 order-2 lg:order-1",children:[i.jsx("div",{ref:xt,className:"flex w-full justify-start items-center",children:i.jsxs("div",{className:"grid grid-cols-2 gap-2 w-full",children:[i.jsxs("div",{className:"flex flex-col justify-between items-start w-full h-32 bg-[#1c1c1c] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Perp Equity"}),i.jsxs("div",{className:"text-white font-semibold font-manrope leading-[13px] tracking-[0.18px] text-[18px]",children:["$",f?Er(f==null?void 0:f.marginSummary.accountValue):"-"]})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-3 w-full",children:[i.jsxs("div",{className:"flex items-center justify-between gap-1 w-full",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px] tracking-[0.18px]",children:"Margin Usage"}),i.jsxs("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px] tracking-[0.18px]",children:[f?(parseFloat(f.marginSummary.totalMarginUsed)/parseFloat(f.marginSummary.accountValue)*100).toFixed(2):"-","%"]})]}),i.jsx("div",{className:"w-full h-1 bg-[#414141] rounded-[256px]",children:i.jsx("div",{style:f?{width:`${parseFloat(f.marginSummary.totalMarginUsed)/parseFloat(f.marginSummary.accountValue)*100}%`}:{width:"0%"},className:"h-1 bg-white rounded-[256px]"})})]})]}),i.jsxs("div",{className:"flex flex-col justify-between items-start w-full h-32 bg-[#1c1c1c] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsxs("div",{onClick:()=>{hn(pe=>({...pe,coin:"--",type:f?parseFloat(f.marginSummary.totalNtlPos)===0?"NEUTRAL":a.reduce((st,Ft)=>st+(Ft.type==="Long"?parseFloat(Ft.positionValue):-parseFloat(Ft.positionValue)),0)>0?"LONG":"SHORT":"--",leverage:pt&&pt!=0?`${parseFloat(pt).toFixed(2)}x`:"--",roe:wt.length>0?wt.map(st=>st==null?void 0:st.margin_roi).join(", "):"--",entryPrice:f?a.reduce((st,Ft)=>st+parseFloat(Ft.unrealizedPnl||0),0):"-",markPrice:St>0?`${Kt} / ${St} (${Kt/St*100===0||Kt/St*100===100?Kt/St*100:(Kt/St*100).toFixed(2)}%)`:"--",positionDistribution:f?`${isNaN(a.reduce((st,Ft)=>Ft.type==="Long"?st+parseFloat(Ft.positionValue):st,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?0:a.reduce((st,Ft)=>Ft.type==="Long"?st+parseFloat(Ft.positionValue):st,0)/parseFloat(f.marginSummary.totalNtlPos)*100===0||a.reduce((st,Ft)=>Ft.type==="Long"?st+parseFloat(Ft.positionValue):st,0)/parseFloat(f.marginSummary.totalNtlPos)*100===100?a.reduce((st,Ft)=>Ft.type==="Long"?st+parseFloat(Ft.positionValue):st,0)/parseFloat(f.marginSummary.totalNtlPos)*100:(a.reduce((st,Ft)=>Ft.type==="Long"?st+parseFloat(Ft.positionValue):st,0)/parseFloat(f.marginSummary.totalNtlPos)*100).toFixed(2)}% / ${isNaN(a.reduce((st,Ft)=>Ft.type==="Short"?st+parseFloat(Ft.positionValue):st,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?0:a.reduce((st,Ft)=>Ft.type==="Short"?st+parseFloat(Ft.positionValue):st,0)/parseFloat(f.marginSummary.totalNtlPos)*100===0||a.reduce((st,Ft)=>Ft.type==="Short"?st+parseFloat(Ft.positionValue):st,0)/parseFloat(f.marginSummary.totalNtlPos)*100===100?a.reduce((st,Ft)=>Ft.type==="Short"?st+parseFloat(Ft.positionValue):st,0)/parseFloat(f.marginSummary.totalNtlPos)*100:(a.reduce((st,Ft)=>Ft.type==="Short"?st+parseFloat(Ft.positionValue):st,0)/parseFloat(f.marginSummary.totalNtlPos)*100).toFixed(2)}%`:"-",referral:window.localStorage.getItem("hyperToken")?ce:null})),Pt(!0)},className:"flex justify-start items-center gap-2.5 cursor-pointer",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"uPnL"}),i.jsxs("div",{className:"flex justify-center items-center rounded-[8px] bg-[rgba(103,255,189,0.16)] gap-1 py-1 px-2",children:[i.jsx("span",{children:i.jsx("img",{src:nyt,alt:"Dextrabot"})}),i.jsx("span",{className:"text-[#67FFBD] font-manrope text-[11px] not-italic font-semibold leading-[8px] tracking-[0.11px]",children:"Share"})]})]}),i.jsxs("div",{className:`${f&&a.reduce((pe,st)=>pe+parseFloat(st.unrealizedPnl),0)>=0?"text-[#67FFBD]":"text-[#FF7173]"} font-semibold font-manrope leading-[13px] tracking-[0.18px] text-[18px]`,children:["$",f?Er(Math.abs(a.reduce((pe,st)=>pe+parseFloat(st.unrealizedPnl||0),0))):"-"]})]}),i.jsx("div",{className:"flex flex-col justify-start items-start",children:i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Current Win Rate"}),i.jsxs("div",{className:"text-white font-semibold font-manrope leading-[13px] tracking-[0.18px] text-[18px] min-w-max",children:[i.jsx("span",{className:"text-[#67FFBD]",children:Kt})," ","/ ",St," (",gn==0?"0":gn!=0&&gn!=100?gn.toFixed(2):gn,"%)"]})]})})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start w-full h-32 bg-[#1c1c1c] rounded-2xl p-4 relative",children:[i.jsxs("div",{className:"flex justify-end items-center gap-1 w-auto absolute right-1.5 top-1.5 bg-[#272727] rounded-2xl",children:[i.jsx("div",{onClick:()=>{ot("1D"),localStorage.setItem("discover_period",0)},className:`${nt==="1D"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"1D"})}),i.jsx("div",{onClick:()=>{ot("7D"),localStorage.setItem("discover_period",1)},className:`${nt==="7D"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"7D"})}),i.jsx("div",{onClick:()=>{ot("30D"),localStorage.setItem("discover_period",2)},className:`${nt==="30D"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"30D"})}),i.jsx("div",{onClick:()=>{ot("90D"),localStorage.setItem("discover_period",3)},className:`${nt==="90D"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"90D"})})]}),(We==null?void 0:We.length)>0?We==null?void 0:We.map((pe,st)=>i.jsxs("div",{className:"flex flex-col space-y-4 sm:space-y-6 mt-4 sm:mt-0 lg:space-y-4 lg:mt-4 xl:space-y-6 xl:mt-0 justify-center items-start",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Win Rate"}),i.jsx("div",{className:"text-white text-lg font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:(pe==null?void 0:pe.win_complated_rate)==null||isNaN(parseFloat(pe==null?void 0:pe.win_complated_rate))?"--":(pe==null?void 0:pe.win_complated_rate)+"%"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Tx Count"}),i.jsx("div",{className:"text-white text-lg font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:(pe==null?void 0:pe.rtx_count)==null||isNaN(parseFloat(pe==null?void 0:pe.rtx_count))?"--":_s(pe==null?void 0:pe.rtx_count)})]})]},st)):i.jsxs("div",{className:"flex flex-col justify-start items-start",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center mt-4 sm:mt-0 lg:mt-4 xl:mt-0 gap-1 sm:gap-2 lg:gap-1 xl:gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Win Rate"}),i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:"No trades in this period"}),i.jsx("div",{className:"w-36 h-px mt-2 sm:mt-[6px] xl:mt-[8px] mb-[8px] sm:mb-[14px] lg:mb-[8px] xl:mb-[14px] bg-[#353535]"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Trade Count"}),i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:"No trades in this period"})]})]})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start w-full h-32 bg-[#1c1c1c] rounded-2xl p-4 relative",children:[i.jsxs("div",{className:"flex justify-end items-center gap-0.5 absolute right-1.5 top-1.5 bg-[#272727] w-auto rounded-2xl",children:[i.jsx("div",{onClick:()=>{Vt("day"),Jt("1D"),localStorage.setItem("discover_period",0)},className:`${Yt==="day"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"1D"})}),i.jsx("div",{onClick:()=>{Vt("week"),Jt("7D"),localStorage.setItem("discover_period",1)},className:`${Yt==="week"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"7D"})}),i.jsx("div",{onClick:()=>{Vt("month"),Jt("30D"),localStorage.setItem("discover_period",2)},className:`${Yt==="month"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"30D"})}),i.jsx("div",{onClick:()=>{Vt("threeMonth"),Jt("90D"),localStorage.setItem("discover_period",3)},className:`${Yt==="threeMonth"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"90D"})}),i.jsx("div",{onClick:()=>{Vt("allTime"),Jt("90D"),localStorage.setItem("discover_period",4)},className:`${Yt==="allTime"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"All"})})]}),i.jsxs("div",{className:`${!(wt!=null&&wt.length)>0?"space-y-1.5 sm:space-y-3.5 lg:space-y-1.5 xl:space-y-3.5":"space-y-4 sm:space-y-6 lg:space-y-4 xl:space-y-6"} flex flex-col justify-center items-start mt-4 sm:mt-0 lg:mt-4 xl:mt-0`,children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"PnL"}),Re?i.jsx("div",{className:`${Re.day===0||Re.week===0||Re.month===0||Re.threeMonth===0||Re.all===0?"text-white":Yt==="day"?Re.day>0?"text-[#67FFBD]":Re.day<0?"text-[#FF7173]":"text-white":Yt==="week"?Re.week>0?"text-[#67FFBD]":Re.week<0?"text-[#FF7173]":"text-white":Yt==="month"?Re.month>0?"text-[#67FFBD]":Re.month<0?"text-[#FF7173]":"text-white":Yt==="threeMonth"?Re.threeMonth>0?"text-[#67FFBD]":Re.threeMonth<0?"text-[#FF7173]":"text-white":Yt==="allTime"?Re.all>0?"text-[#67FFBD]":Re.all<0?"text-[#FF7173]":"text-white":"text-white"} text-lg font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:(()=>{const pe={day:Re.day,week:Re.week,month:Re.month,threeMonth:Re.threeMonth,allTime:Re.all}[Yt];return`$${_s(Math.abs(pe))}`})()}):i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:"No trades in this period"})]}),!(wt!=null&&wt.length)>0&&i.jsx("div",{className:"w-36 h-px bg-[#353535]"}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"ROE"}),(wt==null?void 0:wt.length)>0?wt==null?void 0:wt.map((pe,st)=>i.jsx("div",{className:`${(pe==null?void 0:pe.margin_roi)==null||isNaN(parseFloat(pe==null?void 0:pe.margin_roi))||(pe==null?void 0:pe.margin_roi)==0?"text-white":(pe==null?void 0:pe.margin_roi)>0?"text-[#67FFBD]":"text-[#FF7173]"} text-lg font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:(pe==null?void 0:pe.margin_roi)==null||isNaN(parseFloat(pe==null?void 0:pe.margin_roi))?"--":_s(Math.abs(pe==null?void 0:pe.margin_roi))+"%"})):i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:"No trades in this period"})]})]})]}),i.jsxs("div",{className:"flex flex-col justify-between items-start w-full h-32 bg-[#1c1c1c] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Direction Bias"}),i.jsx("div",{className:"text-white font-semibold font-manrope leading-[13px] tracking-[0.18px] text-[18px]",children:f?parseFloat(f.marginSummary.totalNtlPos)===0?i.jsx("span",{children:"NEUTRAL"}):a.reduce((pe,st)=>pe+(st.type==="Long"?parseFloat(st.positionValue):-parseFloat(st.positionValue)),0)>0?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"direction-icon text-[#67FFBD]",children:"↗"}),i.jsx("span",{className:"text-[#67FFBD]",children:"LONG"})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"direction-icon text-[#FF7173]",children:"↘"}),i.jsx("span",{className:"text-[#FF7173]",children:"SHORT"})]}):"-"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-3 w-full",children:[i.jsxs("div",{className:"flex items-center justify-between gap-1 w-full",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px] tracking-[0.18px]",children:"Long Exposure"}),i.jsxs("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px] tracking-[0.18px]",children:[f?(a.reduce((pe,st)=>st.type==="Long"?pe+parseFloat(st.positionValue):pe,0)/parseFloat(f.marginSummary.totalNtlPos)*100).toFixed(2):"-","%"]})]}),i.jsx("div",{className:"w-full h-1 bg-[#414141] rounded-[256px]",children:i.jsx("div",{style:f?{width:`${a.reduce((pe,st)=>st.type==="Long"?pe+parseFloat(st.positionValue):pe,0)/parseFloat(f.marginSummary.totalNtlPos)*100}%`}:{width:"0%"},className:"h-1 bg-white rounded-[256px]"})})]})]}),i.jsxs("div",{className:"flex flex-col justify-between items-start w-full h-32 bg-[#1c1c1c] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[13px] font-manrope leading-[13px] font-medium tracking-[0.18px]",children:"Position Distribution"}),i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[13px] tracking-[0.18px] text-[18px]",children:i.jsxs("span",{className:"float-right flex gap-3",children:[i.jsxs("span",{className:"text-[#67FFBD]",children:[f?isNaN(a.reduce((pe,st)=>st.type==="Long"?pe+parseFloat(st.positionValue):pe,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?0:(a.reduce((pe,st)=>st.type==="Long"?pe+parseFloat(st.positionValue):pe,0)/parseFloat(f.marginSummary.totalNtlPos)*100).toFixed(2):"-","%"]}),i.jsxs("span",{className:"text-[#FF7173]",children:[f?isNaN(a.reduce((pe,st)=>st.type==="Short"?pe+parseFloat(st.positionValue):pe,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?0:(a.reduce((pe,st)=>st.type==="Short"?pe+parseFloat(st.positionValue):pe,0)/parseFloat(f.marginSummary.totalNtlPos)*100).toFixed(2):"-","%"]})]})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2 w-full",children:[i.jsx("div",{className:"text-white bg-transparent text-xs font-medium font-inter leading-[8px] tracking-[0.18px] w-full",children:i.jsxs("span",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-[#67ffbd]",children:f?lt(a.reduce((pe,st)=>st.type==="Long"?pe+parseFloat(st.positionValue):pe,0)):"-"}),i.jsx("span",{className:"text-[#ff787b]",children:f?lt(a.reduce((pe,st)=>st.type==="Short"?pe+parseFloat(st.positionValue):pe,0)):"-"})]})}),i.jsxs("div",{className:"h-1 w-full bg-[#161616] rounded-[256px] flex gap-[2px] overflow-hidden",children:[i.jsx("div",{style:f?isNaN(a.reduce((pe,st)=>st.type==="Long"?pe+parseFloat(st.positionValue):pe,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?{width:"0%"}:{width:`${a.reduce((pe,st)=>st.type==="Long"?pe+parseFloat(st.positionValue):pe,0)/parseFloat(f.marginSummary.totalNtlPos)*100}%`}:{width:"0%"},className:"flex justify-center items-center h-1 bg-[#67FFBD] rounded-[256px] text-[#67ffbd] text-[11px] font-bold font-inter leading-[8px] tracking-[0.18px]"}),i.jsx("div",{style:f?isNaN(a.reduce((pe,st)=>st.type==="Short"?pe+parseFloat(st.positionValue):pe,0)/parseFloat(f.marginSummary.totalNtlPos)*100)?{width:"0%"}:{width:`${a.reduce((pe,st)=>st.type==="Short"?pe+parseFloat(st.positionValue):pe,0)/parseFloat(f.marginSummary.totalNtlPos)*100}%`}:{width:"0%"},className:"bg-[#FF797C] h-1 rounded-[256px] flex justify-center items-center text-[#67ffbd] text-[11px] font-bold font-inter leading-[8px] tracking-[0.18px]"})]})]})]}),i.jsxs("div",{className:"col-span-2 flex gap-2 w-full",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start flex-[0.7] h-[92px] bg-[#1c1c1c] rounded-2xl p-[11px] relative gap-[14px]",children:[i.jsx("div",{className:"flex flex-col justify-start items-start",children:i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px]",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[10px] font-semibold font-['Manrope'] leading-[13px] tracking-wide uppercase",children:"Avg Leverage"}),i.jsx("div",{className:"text-white text-sm font-semibold font-['Manrope'] leading-[13px] tracking-tight",children:pt&&pt!=0?`${parseFloat(pt).toFixed(2)}x`:"--"})]})}),i.jsx("div",{className:"flex flex-col justify-start items-start",children:i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px]",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[10px] font-semibold font-['Manrope'] leading-[13px] tracking-wide uppercase",children:"Funding"}),i.jsx("div",{className:`${Wt<=0?"text-[#67FFBD]":"text-[#FF7173]"} text-sm font-semibold font-['Manrope'] leading-[13px] tracking-tight`,children:Wt&&Wt!=0?`$${vv(Math.abs(Wt))}`:"--"})]})})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start flex-[2] h-[92px] bg-[#1c1c1c] rounded-2xl p-1 relative w-full",children:[i.jsx("div",{className:"absolute left-2.5 top-[11px] text-[#9b9b9b] text-[13px] font-medium font-['Manrope'] leading-none tracking-tight",children:"Performance"}),i.jsxs("div",{className:"flex justify-end items-center gap-1 w-auto absolute right-[9px] top-[9px] bg-[#272727] rounded-2xl",children:[i.jsx("div",{onClick:()=>{et("7D"),localStorage.setItem("discover_period",1)},className:`${Ge==="7D"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"7D"})}),i.jsx("div",{onClick:()=>{et("30D"),localStorage.setItem("discover_period",2)},className:`${Ge==="30D"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"30D"})}),i.jsx("div",{onClick:()=>{et("90D"),localStorage.setItem("discover_period",3)},className:`${Ge==="90D"?"text-[#67FFBD] bg-[rgba(103,255,189,0.16)]":"bg-[#272727] text-[#959595]"} h-[18px] px-1.5 py-[5px] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px]",children:"90D"})})]}),Fe?i.jsxs("div",{className:"flex justify-between items-start gap-1 w-full mt-[43px]",children:[i.jsxs("div",{className:"flex-[0.6] p-1.5 h-[41px] bg-[#2e2e2e] rounded-[10px] flex flex-col items-start justify-center gap-[2px]",children:[i.jsxs("div",{className:"text-[#9b9b9b] text-[10px] font-semibold font-['Manrope'] leading-[13px] tracking-wide uppercase flex justify-start items-center gap-0.5",children:["Sharpe",i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"flex justify-end items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-3 min-w-3 min-h-3 h-3"}),i.jsx("span",{className:"",children:i.jsx(eo,{content:"Sharpe_tooltip",positionTop:!1,alignRight:!1,tooltipCss:"max-w-[80px] min-w-[80px] leading-[16px] -mb-12"})})]})})]}),i.jsx("div",{className:`${(Ge==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_sharpe:Ge==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_sharpe:Fe==null?void 0:Fe.portfolio_perp_3month_sharpe)>=1&&(Ge==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_sharpe:Ge==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_sharpe:Fe==null?void 0:Fe.portfolio_perp_3month_sharpe)<=2?"text-[#E5BB18]":(Ge==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_sharp:Ge==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_sharpe:Fe==null?void 0:Fe.portfolio_perp_3month_sharpe)>2?"text-[#1DE6A3]":"text-[#FF7173]"} text-base font-semibold font-['Manrope'] leading-[13px] tracking-tight`,children:Ge==="7D"?(Fe==null?void 0:Fe.portfolio_perp_week_sharpe)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_week_sharpe))?"--":Er(Fe==null?void 0:Fe.portfolio_perp_week_sharpe):Ge==="30D"?(Fe==null?void 0:Fe.portfolio_perp_month_sharpe)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_month_sharpe))?"--":Er(Fe==null?void 0:Fe.portfolio_perp_month_sharpe):(Fe==null?void 0:Fe.portfolio_perp_3month_sharpe)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_3month_sharpe))?"--":Er(Fe==null?void 0:Fe.portfolio_perp_3month_sharpe)})]}),i.jsxs("div",{className:"flex-1 p-1.5 h-[41px] bg-[#2e2e2e] rounded-[10px] flex flex-col items-start justify-center gap-[2px]",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[10px] font-semibold font-['Manrope'] leading-[13px] tracking-wide min-w-max uppercase",children:"Growth Rate"}),i.jsx("div",{className:`${(Ge==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_growth_rate:Ge==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_growth_rate:Fe==null?void 0:Fe.portfolio_perp_3month_growth_rate)==0?"text-white":(Ge==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_growth_rate:Ge==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_growth_rate:Fe==null?void 0:Fe.portfolio_perp_3month_growth_rate)>0?"text-[#67FFBD]":"text-[#FF7173]"} text-base font-semibold font-['Manrope'] leading-[13px] tracking-tight`,children:Ge==="7D"?(Fe==null?void 0:Fe.portfolio_perp_week_growth_rate)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_week_growth_rate))?"--":_s(Fe==null?void 0:Fe.portfolio_perp_week_growth_rate)+"%":Ge==="30D"?(Fe==null?void 0:Fe.portfolio_perp_month_growth_rate)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_month_growth_rate))?"--":_s(Fe==null?void 0:Fe.portfolio_perp_month_growth_rate)+"%":(Fe==null?void 0:Fe.portfolio_perp_3month_growth_rate)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_3month_growth_rate))?"--":_s(Fe==null?void 0:Fe.portfolio_perp_3month_growth_rate)+"%"})]}),i.jsxs("div",{className:"flex-[0.9] p-1.5 h-[41px] bg-[#2e2e2e] rounded-[10px] flex flex-col items-start justify-center gap-[2px]",children:[i.jsx("div",{className:"text-[#9b9b9b] text-[10px] font-semibold font-['Manrope'] leading-[13px] tracking-wide uppercase",children:"Drawdown"}),i.jsx("div",{className:`${(Ge==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_dd:Ge==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_dd:Fe==null?void 0:Fe.portfolio_perp_3month_dd)==0?"text-white":(Ge==="7D"?Fe==null?void 0:Fe.portfolio_perp_week_dd:Ge==="30D"?Fe==null?void 0:Fe.portfolio_perp_month_dd:Fe==null?void 0:Fe.portfolio_perp_3month_dd)>0?"text-[#67FFBD]":"text-[#FF7173]"} text-base font-semibold font-['Manrope'] leading-[13px] tracking-tight`,children:Ge==="7D"?(Fe==null?void 0:Fe.portfolio_perp_week_dd)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_week_dd))?"--":_s(Math.abs(Fe==null?void 0:Fe.portfolio_perp_week_dd))+"%":Ge==="30D"?(Fe==null?void 0:Fe.portfolio_perp_month_dd)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_month_dd))?"--":_s(Math.abs(Fe==null?void 0:Fe.portfolio_perp_month_dd))+"%":(Fe==null?void 0:Fe.portfolio_perp_3month_dd)==null||isNaN(parseFloat(Fe==null?void 0:Fe.portfolio_perp_3month_dd))?"--":_s(Math.abs(Fe==null?void 0:Fe.portfolio_perp_3month_dd))+"%"})]})]}):i.jsx("div",{className:"flex flex-col justify-start items-start mt-[43px] mx-auto",children:i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:"No trades in this period"})})]})]})]})}),i.jsxs("div",{className:"absolute sm:hidden -bottom-8 right-2 z-10 flex justify-start items-center gap-2",children:[i.jsx("button",{onClick:Nt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Pl,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:It,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Pl,{className:"text-gray-300 w-4 h-4 -rotate-90"})})})]})]}),i.jsx("div",{className:"w-full lg:w-8/12 h-full order-1 lg:order-2",children:i.jsx(Xsn,{})})]})]}),i.jsx(WUe,{initialAddress:e})]})]})},Min=()=>{const e=Z3(),t=(e==null?void 0:e.walletAddress.toLowerCase())||"";return i.jsxs(i.Fragment,{children:[i.jsx(Io,{children:i.jsxs($o,{children:[i.jsxs("title",{children:["Explore ",`${t}`," - Hyperliquid Wallet Overview & History - Dextrabot"]}),i.jsx("meta",{name:"description",content:`Explore real-time transactions, holdings, and insights for ${t} on HyperLiquid. Track wallet activity and make data-driven trading decisions.`}),i.jsx("meta",{name:"og:title",content:`Explore ${t} - Hyperliquid Wallet Overview & History - Dextrabot`}),i.jsx("meta",{name:"og:description",content:`Explore real-time transactions, holdings, and insights for ${t} on HyperLiquid. Track wallet activity and make data-driven trading decisions.`}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:`https://app.dextrabot.com/wallet-details/${t}`})]})}),i.jsx("div",{className:"flex justify-center items-start w-full h-screen min-h-max px-2 pt-3 sm:px-6 sm:pt-4 bg-[#161616]",children:i.jsx(Oin,{initialAddress:t})})]})},Rin=({isOpen:e,onClose:t,children:n,zIndex:r=9999,closeOnBackdropClick:s=!0})=>(m.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),e?yre.createPortal(i.jsxs("div",{className:"fixed inset-0 flex justify-center items-center pointer-events-auto",style:{zIndex:r},children:[i.jsx("div",{onClick:s?t:void 0,className:"absolute inset-0 bg-black bg-opacity-50 backdrop-blur-sm transition-opacity duration-300"}),i.jsx("div",{className:"relative bg-[#252525] rounded-3xl shadow-lg w-[400px] max-w-full pointer-events-auto",children:n})]}),document.body):null);function Lin(){const{signModalOpen:e,setSignModalOpen:t,signIn:n,hyperToken:r,walletLogin:s}=m.useContext(Gr),{isConnected:a}=Yr(),{openConnectModal:o}=m5(),l=typeof window<"u"&&window.matchMedia("(max-width:640px)").matches,c=()=>{window.localStorage.getItem("hyperToken")&&r?s():(n(1),t(!1))};return i.jsx(Rin,{isOpen:e,onClose:()=>t(!1),children:i.jsxs("div",{className:"flex flex-col items-center gap-8 w-[400px] bg-[#252525] rounded-3xl py-4 relative pointer-events-auto",children:[i.jsx("span",{onClick:()=>t(!1),className:"absolute top-2 right-2 w-9 h-9 rounded-full flex items-center justify-center hover:bg-[#7535FE] cursor-pointer",children:i.jsx("img",{src:Oa,alt:"close",className:"p-1"})}),i.jsx("img",{src:Hi,alt:"dextrabot",className:"w-[86px] h-[86px] mt-4"}),i.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i.jsx("div",{className:"text-white text-[32px] leading-none",children:"Welcome Dextrabot"}),i.jsx("div",{className:"text-white/60 text-sm leading-none",children:l?"Scan the QR code to continue":"Connect your wallet to continue"})]}),i.jsx("div",{className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl cursor-pointer text-center",children:a?l?i.jsx(e_,{}):i.jsx("div",{onClick:c,className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl cursor-pointer",children:i.jsx("span",{className:"text-white text-sm leading-none",children:"Wallet Sign‑in"})}):l?i.jsx("div",{className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl",children:i.jsx("span",{className:"text-white text-sm leading-none",children:i.jsx(e_,{})})}):i.jsx("div",{onClick:o,className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl cursor-pointer",children:i.jsx("div",{className:"text-center text-white text-sm font-manrope leading-none",children:"Connect Wallet"})})}),i.jsxs("div",{className:"text-center pt-2",children:[i.jsx("span",{className:"text-white/60 text-xs",children:"Do you need support? "}),i.jsx("span",{onClick:()=>window.open("https://discord.gg/dextrabot","_blank"),className:"text-[#b593ff] text-xs cursor-pointer",children:"Join Discord"})]})]})})}const Ml=()=>i.jsxs("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:[i.jsx("div",{className:"p-4 bg-[#ff356629] rounded-full",children:i.jsx("img",{src:Bbt,alt:"",className:"w-8 h-8"})}),i.jsxs("div",{className:"flex flex-col items-center justify-center gap-1",children:[i.jsx("div",{className:"text-[#FF3566]",children:"Error"}),i.jsxs("div",{className:"text-[#767676]",children:["We encountered a problem"," ",i.jsxs("span",{children:["wait a",i.jsx("br",{})," moment before try again"]})]})]})]}),Din=({data:e,loading:t,error:n,trackerData:r,isRequest:s,setIsRequest:a})=>{var Ne;const{trackedWatchList:o,getTrackedWatchList:l,setSignModalOpen:c}=m.useContext(Gr),{isConnected:u,address:d}=Yr(),[f,x]=m.useState(!1),[g,v]=m.useState(null),[w,C]=m.useState(null),[N,I]=m.useState(""),[P,R]=m.useState([]),[F,U]=m.useState(!1),[L,z]=m.useState({}),X="-tag",[ne,J]=m.useState(X),Z=be=>r.sort((je,Ie)=>{const Re=P.find(Ut=>Ut.wallet_address===je.wallet_address)||{},Qe=P.find(Ut=>Ut.wallet_address===Ie.wallet_address)||{},Be=Re.data?Re.data.reduce((Ut,kt)=>Ut+parseFloat(kt.unrealizedPnl||0),0):Re.unrealizedPnl||0,it=Qe.data?Qe.data.reduce((Ut,kt)=>Ut+parseFloat(kt.unrealizedPnl||0),0):Qe.unrealizedPnl||0,tt=je.tag?je.tag.toUpperCase():"",at=Ie.tag?Ie.tag.toUpperCase():"",dt=je.wallet_address?je.wallet_address.toLowerCase():"",ct=Ie.wallet_address?Ie.wallet_address.toLowerCase():"";return be==="tag"?tt<at?-1:tt>at?1:0:be==="-tag"?tt>at?-1:tt<at?1:0:be==="-wallet_address"?dt<ct?-1:dt>ct?1:0:be==="wallet_address"?dt>ct?-1:dt<ct?1:0:be==="perp_equity"?(Re.perp_equity||0)-(Qe.perp_equity||0):be==="-perp_equity"?(Qe.perp_equity||0)-(Re.perp_equity||0):be==="margin_usage"?(Re.margin_usage||0)-(Qe.margin_usage||0):be==="-margin_usage"?(Qe.margin_usage||0)-(Re.margin_usage||0):be==="unrealizedPnl"?Be-it:be==="-unrealizedPnl"?it-Be:be==="-expire_date"?new Date(Ie.expire_date)-new Date(je.expire_date):be==="expire_date"?new Date(je.expire_date)-new Date(Ie.expire_date):0}),re=async({walletAddress:be,isFollow:je,isScalper:Ie})=>{try{I(be);const Re=window.localStorage.getItem("hyperToken"),Qe=window.localStorage.getItem("hyperAddress");if(!Re){c(!0);return}const Be=je?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",it=je?{address:d?d.toLowerCase():Qe,token:Re,follow_address:be.toLowerCase()}:{address:d?d.toLowerCase():Qe,token:Re},tt=await fetch(Be,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(it)});if(!tt.ok)throw new Ml(`Server responded with status ${tt.status}`);const at=await tt.json();at.success?(v(Array.isArray(at==null?void 0:at.data)?[...at.data].sort((dt,ct)=>new Date(ct.created_at||0)-new Date(dt.created_at||0)):at==null?void 0:at.data),C(Ie),x(!0)):(console.log(at.error_message),on.error(at.error_message))}catch(Re){console.error("Error in like function:",Re),on.error(Re.message||"Something went wrong!")}},he=be=>be!=null&&be.assetPositions?be.assetPositions.filter(je=>{if(!je.position||!je.position.szi)return!1;const Ie=parseFloat(je.position.szi);return!isNaN(Ie)&&Ie!==0}).map(je=>{const Ie=je.position,Re=parseFloat(Ie.szi),Qe=parseFloat(Ie.entryPx),Be=parseFloat(Ie.positionValue),it=parseFloat(Ie.unrealizedPnl),tt=parseFloat(Ie.returnOnEquity)*100,at=parseFloat(Ie.marginUsed),dt=Ie.leverage.value,ct=parseFloat(Ie.cumFunding.sinceOpen),Ut=Re>0?"Long":"Short";return{asset:Ie.coin,type:Ut,size:Math.abs(Re),entryPrice:Qe.toFixed(2),currentPrice:(Be/Math.abs(Re)).toFixed(2),leverage:dt,positionValue:Be.toFixed(2),marginUsed:at.toFixed(2),unrealizedPnl:it.toFixed(2),roe:tt.toFixed(2),funding:ct.toFixed(4),liquidationPrice:Ie.liquidationPx?parseFloat(Ie.liquidationPx).toFixed(2):"N/A"}}):[],Y=async be=>{try{const Ie=await ls.post("https://api-ui.hyperliquid.xyz/info",{type:"clearinghouseState",user:be});if(Ie.data){const Re=he(Ie.data);R(Qe=>{var Be,it,tt,at;return[...Qe,{wallet_address:be,perp_equity:(it=(Be=Ie==null?void 0:Ie.data)==null?void 0:Be.marginSummary)==null?void 0:it.accountValue,margin_usage:parseFloat((tt=Ie==null?void 0:Ie.data)==null?void 0:tt.marginSummary.totalMarginUsed)/parseFloat((at=Ie==null?void 0:Ie.data)==null?void 0:at.marginSummary.accountValue),data:Re}]})}}catch(je){console.error("Error fetching user state from HyperState:",je)}},ie=async be=>{try{const je=window.localStorage.getItem("hyperToken"),Ie="https://dextrabothypev2.nftinit.io/api/hyper/tracker/getclearinghousestate/",Re=window.localStorage.getItem("hyperAddress"),Qe=await fetch(Ie,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:d?d.toLowerCase():Re,token:je,follow_address:be})});if(Qe.ok){const Be=await Qe.json();if(Be.success){const it=he(Be==null?void 0:Be.data);R(tt=>{var at;return[...tt,{wallet_address:be,perp_equity:(at=Be==null?void 0:Be.data.marginSummary)==null?void 0:at.accountValue,margin_usage:parseFloat(Be==null?void 0:Be.data.marginSummary.totalMarginUsed)/parseFloat(Be==null?void 0:Be.data.marginSummary.accountValue),data:it}]})}}else if(Qe.status===500)console.warn(`Received 500 error for ${be}, retrying with getUserHyperState`),await Y(be);else throw new Ml(`Request failed with status ${Qe.status}`)}catch(je){console.error("Error fetching user state:",je)}},oe=m.useRef(!1);m.useEffect(()=>{!t&&s&&!oe.current&&(oe.current=!0,(async()=>{for(let je=0;je<r.length;je++){const Ie=r[je];ie(Ie==null?void 0:Ie.wallet_address.toLowerCase()).catch(Re=>{console.error(`Error fetching user state for wallet ${Ie.wallet_address}:`,Re)}),await new Promise(Re=>setTimeout(Re,500))}})())},[s,t,r]);const G=async(be,je)=>{try{const Ie=window.localStorage.getItem("hyperToken"),Re="https://dextrabothypev2.nftinit.io/api/hyper/tracker/extend_tracker_expiry/";if(!Ie||!be||!je)return;z(tt=>({...tt,[je]:!0}));const Qe=window.localStorage.getItem("hyperAddress"),Be=await fetch(Re,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:d?d==null?void 0:d.toLowerCase():Qe,token:Ie,tracker_id:be})});if(!Be.ok)throw new Ml(`Failed to unlike: ${Be.status} ${Be.statusText}`);const it=await Be.json();it.success?(z(tt=>({...tt,[je]:!1})),l(),on.success(`${je.slice(0,5)}...${je.slice(-3)} Tracker successfully renewed`,{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px",minWidth:"400px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):(on.error(it.error_message),z(tt=>({...tt,[je]:!1})))}catch(Ie){on.error(Ie.message||"Something went wrong!"),z(Re=>({...Re,[je]:!1}))}},V=m.useRef(null),ee=()=>{V.current&&(V.current.scrollLeft-=100)},ae=()=>{V.current&&(V.current.scrollLeft+=100)},fe=()=>{V.current&&(V.current.scrollTop+=200)},Ae=()=>{V.current&&(V.current.scrollTop-=200)},ce=be=>{const je=new Date(be),Ie=new Date,Re=new Date(je.getFullYear(),je.getMonth(),je.getDate()),Qe=new Date(Ie.getFullYear(),Ie.getMonth(),Ie.getDate());return(Re-Qe)/(1e3*60*60*24)<=3},ye=be=>be>=640&&be<1024?5:be>=1024&&be<1240?6:be>=1240&&be<1540||be>=1540?7:3;return i.jsxs(i.Fragment,{children:[i.jsx(g5,{open:f,setOpen:x,copyTradeData:g,copyTradeWallet:N,setCopyTradeWallet:I,isScalper:w,setCopyTradeData:v}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full font-manrope",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2 font-manrope max-w-full w-full bg-[#161616] pl-2 sm:pl-0 pt-4",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px]",children:"Tracked Wallets"})})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"absolute hidden -top-6 right-4 z-10 lg:flex justify-start items-center gap-2",children:[i.jsx("button",{onClick:ee,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:ae,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:Ae,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:fe,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{className:"w-full max-w-[1260px] h-full overflow-x-scroll relative overflow-y-scroll flex-grow",ref:V,children:i.jsxs("table",{className:"w-full relative mb-20",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] sm:left-0 h-8 pl-3 min-w-[130px] sm:min-w-[130px] z-[8]",children:i.jsx("div",{className:"flex items-center justify-start w-full min-w-max sticky left-0 h-8",children:i.jsx("div",{className:"flex items-center justify-start",children:"Actions"})})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] sm:left-[130px] h-10 px-1 min-w-[130px] sm:min-w-[150px] z-[8]",children:i.jsx(ci,{title:"Tag",sortKey:"tag",sortOption:ne,setSortOption:J,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] left-[260px] sm:left-[280px] h-10 px-1 min-w-[135px] sm:min-w-[195px] z-[8]",children:i.jsx(ci,{title:"Wallet",sortKey:"wallet_address",sortOption:ne,setSortOption:J,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[140px] sm:min-w-[130px] px-1",children:i.jsx(ci,{title:"Perp Equity",sortKey:"perp_equity",sortOption:ne,setSortOption:J,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[130px] sm:min-w-[144px] px-1",children:i.jsx(ci,{title:"Margin Usage",sortKey:"margin_usage",sortOption:ne,setSortOption:J,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[120px] sm:min-w-[150px] px-1",children:i.jsx(ci,{title:"uPnL",sortKey:"unrealizedPnl",sortOption:ne,setSortOption:J,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-max pl-6 sm:pl-12 pr-1",children:i.jsxs("div",{className:"flex justify-end items-center w-full gap-1",children:[i.jsx("div",{className:"flex justify-end items-center gap-1 w-full",children:i.jsxs("div",{className:"flex justify-end items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(eo,{content:"Trackers stay active for 15 days. If not renewed, they will automatically stop after that period.",positionTop:!1,alignRight:!1,tooltipCss:"max-w-[200px] min-w-[200px] leading-[16px] -mb-[52px]"})})]})}),i.jsx(ci,{title:"Expire Date",sortKey:"expire_date",sortOption:ne,setSortOption:J,isFilterIcon:!0})]})}),i.jsx("th",{scope:"col",className:"min-w-max pl-1 pr-4",children:i.jsx("div",{className:"flex justify-end items-center w-full gap-1"})})]})}),i.jsx("tbody",{children:!r||t?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:ye(window.innerWidth),className:"h-[30vh]",children:i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center -mt-16 ml-[45%] w-max",children:i.jsx(Ma,{})})})}):n&&!r?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:ye(window.innerWidth),className:"h-[30vh]",children:i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center ml-[33%] w-max",children:i.jsx(Ml,{})})})}):(r==null?void 0:r.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:ye(window.innerWidth),className:"h-[30vh]",children:i.jsx("div",{className:"flex min-h-[44vh] h-66 flex-col justify-center items-center  ml-[33%] w-max",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 -ml-16",children:[i.jsx("img",{src:ec,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"You have not yet added a wallet to your follow list."}),i.jsxs("div",{className:"text-center -mt-2",children:[i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["Please visit the"," "]}),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"'Discover Wallets'"}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:[" ","page to follow wallets."]})]})]})]})})})})}):(Ne=Z(ne))==null?void 0:Ne.map((be,je)=>{var Re,Qe;const Ie=P.find(Be=>Be.wallet_address===be.wallet_address);return i.jsxs("tr",{className:`${je%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[56px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${je%2==0,"bg-[#161616]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 h-14 max-h-14",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{onClick:Be=>{Be.preventDefault();const it=e==null?void 0:e.some(tt=>tt.wallet_address===(be==null?void 0:be.wallet_address));re({walletAddress:be==null?void 0:be.wallet_address,isFollow:it,isScalper:be==null?void 0:be.is_scalper})},className:`${e!=null&&e.some(Be=>Be.wallet_address===(be==null?void 0:be.wallet_address))?"bg-[#67ffbd] text-[#161616] font-semibold":"border border-[#67ffbd] bg-[#161616] text-[#67ffbd] hover:bg-[#67ffbd] hover:text-[#161616] font-bold"} h-[22px] rounded-[256px] justify-center items-center gap-1 inline-flex cursor-pointer text-xs font-['Manrope'] leading-[8px] tracking-tight px-2 min-w-max`,children:"Copy Trade"}),i.jsx(x5,{walletAddress:be==null?void 0:be.wallet_address,children:i.jsx("div",{className:"w-[18px] h-[18px] justify-center items-center flex cursor-pointer",children:o.some(Be=>Be.wallet_address===(be==null?void 0:be.wallet_address))?i.jsx("img",{src:r5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:SA,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})})]})})}),i.jsx("td",{scope:"row",className:`${je%2===0,"bg-[#161616]"} sm:sticky sm:left-[130px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4  min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5 has-tooltip relative",children:[i.jsx(ra,{info1:be!=null&&be.tag?(be==null?void 0:be.tag.length)>=13?(be==null?void 0:be.tag).slice(0,13)+"...":be==null?void 0:be.tag:"--",info1_Color:"text-white",rowTwo:!1}),(be==null?void 0:be.tag)&&(be==null?void 0:be.tag.length)>=13&&i.jsx("span",{className:"-ml-[9px]",children:i.jsx(_a,{content:`${be==null?void 0:be.tag}`,positionTop:!0,alignRight:!1})})]})})})}),i.jsx("td",{scope:"row",className:`${je%2===0,"bg-[#161616]"} sm:sticky sm:left-[280px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4  min-h-[56px]",children:i.jsxs("div",{onClick:()=>{window.open(`/wallet-details/${be==null?void 0:be.wallet_address}`,"_blank")},className:"cursor-pointer group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:[i.jsx("div",{className:"fle justify-center items-center",children:i.jsx("div",{className:"w-4 h-4 sm:w-8 sm:h-8 bg-[#4a4a4a] rounded-full",children:i.jsx("img",{src:Hi,alt:"dextra",className:"w-4 h-4 sm:w-8 sm:h-8",loading:"lazy",onError:Be=>{Be.target.onerror=null,Be.target.src="https://app.dextrabot.com/dextrabotIcon.png"}})})}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx(ra,{info1:`${(be==null?void 0:be.wallet_address).slice(0,5)+"..."+(be==null?void 0:be.wallet_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:Be=>{Be.stopPropagation(),navigator.clipboard.writeText(be==null?void 0:be.wallet_address),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:bo,alt:"",className:"cursor-pointer"})]})]})})}),i.jsx("td",{className:"pr-1",children:F?i.jsx(Gm,{info:"Loading...",textColor:"text-white"}):Ie?i.jsx(Gm,{info:(Ie==null?void 0:Ie.perp_equity)!=0?`$${Er(Ie==null?void 0:Ie.perp_equity)}`:"$0",textColor:"text-white"}):i.jsx(Gm,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{className:"pr-1",children:F?i.jsx(Gm,{info:"Loading...",textColor:"text-white"}):Ie?i.jsx(Gm,{info:isNaN(Ie==null?void 0:Ie.margin_usage)?"0%":`${((Ie==null?void 0:Ie.margin_usage)*100).toFixed(2)}%`,textColor:"text-white"}):i.jsx(Gm,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{className:"pr-1",children:F?i.jsx(Gm,{info:"Loading...",textColor:"text-white"}):Ie?i.jsx(Gm,{info:(Ie==null?void 0:Ie.data)!=0?`$${Er(Math.abs((Re=Ie==null?void 0:Ie.data)==null?void 0:Re.reduce((Be,it)=>Be+parseFloat(it.unrealizedPnl||0),0)))}`:"$0",textColor:`${((Qe=Ie==null?void 0:Ie.data)==null?void 0:Qe.reduce((Be,it)=>Be+parseFloat(it.unrealizedPnl),0))>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"}`}):i.jsx(Gm,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{className:"pr-1 min-w-max pl-6 sm:pl-12",children:i.jsxs("div",{className:"flex justify-end items-center gap-0.5 min-w-max",children:[ce(be==null?void 0:be.expire_date)&&i.jsxs("div",{className:"flex justify-end items-center has-tooltip relative min-w-max",children:[i.jsx("img",{src:Nyt,alt:"",className:"w-[14px] min-w-[14px] min-h-[14px] h-[14px]"}),i.jsx("span",{className:"",children:i.jsx(eo,{content:`This tracker will expire on ${d3(be==null?void 0:be.expire_date)}. Click ‘Renew’ to keep it active.`,positionTop:!1,alignRight:!1,tooltipCss:"max-w-[210px] min-w-[210px] leading-[16px] -mb-[36px]"})})]}),i.jsx(Gm,{info:be!=null&&be.expire_date?d3(be==null?void 0:be.expire_date):"--",textColor:"text-white"})]})}),i.jsx("td",{className:"pr-4 min-w-max pl-1",children:i.jsx("div",{className:"flex justify-end items-center gap-0.5 min-w-max",children:ce(be==null?void 0:be.expire_date)&&(L[be==null?void 0:be.wallet_address]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[67px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-[14px] h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsxs("div",{onClick:()=>{G(be==null?void 0:be.id,be==null?void 0:be.wallet_address)},className:"h-[21px] px-1 py-1.5 bg-[#ffaa47]/20 hover:bg-[#ffaa47]/30 rounded-md flex justify-start items-center gap-1 cursor-pointer ml-[6px]",children:[i.jsx("img",{src:Ayt,alt:""}),i.jsx("div",{className:"justify-start text-[#ffaa46] text-[11px] font-semibold font-['Manrope'] leading-[8px]",children:"Renew"})]}))})})]},je)})})]})})]})]})]})},Gm=({info:e,textColor:t})=>i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:`${t} text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5`,children:e})}),dU=()=>{const{isConnected:e}=Yr(),{openConnectModal:t}=m5(),{walletLogin:n,signIn:r}=m.useContext(Gr),s=typeof window<"u"&&window.matchMedia("(max-width: 640px)").matches,a=()=>{window.localStorage.getItem("hyperToken")?n():r(1)};return i.jsxs("div",{className:"flex flex-col justify-center items-center gap-8 w-[400px] h-max bg-[#252525] rounded-3xl py-4 font-manrope",children:[i.jsx("img",{src:Hi,alt:"",className:"w-[86px] h-[86px] mt-4"}),i.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i.jsx("div",{className:"text-white text-[32px] leading-none",children:"Welcome Dextrabot"}),i.jsx("div",{className:"text-white/60 text-sm leading-none",children:s?"Scan the QR code to continue":"Connect your wallet to continue"})]}),i.jsx("div",{className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl cursor-pointer my-10 text-center",children:e?s?i.jsx(e_,{}):i.jsx("div",{onClick:a,className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl cursor-pointer",children:i.jsx("span",{className:"text-white text-sm leading-none",children:"Wallet Sign‑in"})}):i.jsx("div",{onClick:()=>s?null:t(),className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl cursor-pointer",children:i.jsx("span",{className:"text-white text-sm leading-none",children:s?i.jsx(e_,{}):"Connect Wallet"})})}),i.jsxs("div",{className:"text-center pt-2",children:[i.jsx("span",{className:"text-white/60 text-xs",children:"Do you need support? "}),i.jsx("span",{className:"text-[#b593ff] text-xs cursor-not-allowed",children:"Join Discord"})]})]})},Bin=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState(!1);Yr();const{hyperToken:s,copyTradeWatchList:a,getCopyTradeWatchList:o,trackedWatchList:l,setTrackedWatchList:c,getTrackedWatchList:u,trackedWatchListLoading:d,trackedWatchListError:f,setTelegramChatId:x,setSubscriberRole:g,setSubsExpireDay:v,setMushboomerETH:w,setMushboomerSOL:C,setIsReferralCode:N,setIsReferralCodeName:I,setIsWhitelist:P,setHyperToken:R,setHyperAddress:F}=m.useContext(Gr);return m.useEffect(()=>{!n&&window.localStorage.getItem("hyperToken")&&(o(),u(),t(!0),r(!0))},[n,s]),m.useEffect(()=>{(async()=>{var X,ne;const L=window.localStorage.getItem("hyperToken"),z=window.localStorage.getItem("hyperAddress");if(!(!L||!z))try{const J=await Si(z,L);J!=null&&J.success?(x(J==null?void 0:J.telegram_chat_id),g(J==null?void 0:J.subscriber_role),v(J==null?void 0:J.subs_expire_day),w((X=J==null?void 0:J.mushboomer_counts)==null?void 0:X.eth),C((ne=J==null?void 0:J.mushboomer_counts)==null?void 0:ne.sol),N(J==null?void 0:J.referral_code),I(J==null?void 0:J.refcode),P(J==null?void 0:J.whitelist),R(L),F(z)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),R(""),F(""))}catch(J){console.error("Token verification error:",J),console.error(J.message||"An unknown error occurred.")}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(Io,{children:i.jsxs($o,{children:[i.jsx("title",{children:"Track & Follow Your Favorite Hyperliquids Wallets - Dextrabot"}),i.jsx("meta",{name:"description",content:"Track and follow your favorite HyperLiquid wallets with DextraBot. Get real-time updates on their transactions and trading activity to make smarter moves."}),i.jsx("meta",{name:"og:title",content:"Track & Follow Your Favorite Hyperliquids Wallets - Dextrabot"}),i.jsx("meta",{name:"og:description",content:"Track and follow your favorite HyperLiquid wallets with DextraBot. Get real-time updates on their transactions and trading activity to make smarter moves."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/tracked-wallets"})]})}),i.jsx("div",{style:{height:"calc(100vh - 5rem)"},className:"flex justify-center items-center w-full h-full px-1 pt-1 sm:px-6 sm:pt-6 bg-[#161616] overflow-hidden",children:i.jsx("div",{className:"flex flex-col items-stretch justify-center h-full gap-[26px] w-full xl:w-max flex-grow xl:flex-grow-0",children:window.localStorage.getItem("hyperToken")?i.jsx(Din,{data:a,loading:d,error:f,trackerData:l,isRequest:e,setIsRequest:t}):i.jsx("div",{className:"flex justify-center items-center w-full",children:i.jsx(dU,{})})})})]})},$in=()=>{m.useRef([]);const e=m.useRef(null),{isConnected:t,address:n}=Yr(),{setSignModalOpen:r,trackedWatchList:s,hyperToken:a}=m.useContext(Gr),o=m.useRef(a),[l,c]=m.useState(!1),d=localStorage.getItem("isDateTrackedWalletsFormat")||"date",[f,x]=m.useState(d);m.useEffect(()=>{localStorage.setItem("isDateTrackedWalletsFormat",f)},[f]);const[g,v]=m.useState([]);function w(L){const z={};return L.forEach(ne=>{const{oid:J,px:Z,dir:re,side:he,crossed:Y,feeToken:ie,listen_user:oe,cloid:G,coin:V,subs_address:ee,sz:ae,closedPnl:fe,fee:Ae,time:ce,startPosition:ye,insert_date:Ne,hash:be}=ne;z[J]||(z[J]={oid:J,px:Z,dir:re,side:he,crossed:Y,feeToken:ie,listen_user:oe,cloid:G,coin:V,subs_address:ee,totalSize:0,totalStartPositions:0,totalClosedPnl:0,totalFee:0,closestTime:ce,earliestStartPosition:ye,insertDate:Ne,hashes:[],hasZeroStartPosition:!1}),parseFloat(ye)===0&&(z[J].hasZeroStartPosition=!0),z[J].hasZeroStartPosition?z[J].totalStartPositions=0:z[J].totalStartPositions+=parseFloat(ye),z[J].totalSize+=parseFloat(ae),z[J].totalClosedPnl+=parseFloat(fe),z[J].totalFee+=parseFloat(Ae),new Date(ce)>new Date(z[J].closestTime)&&(z[J].closestTime=ce),new Date(ce)>new Date(z[J].insertDate)&&(z[J].insertDate=Ne),new Date(ce)<new Date(z[J].closestTime)&&(z[J].earliestStartPosition=ye),z[J].hashes.push(be)}),Object.keys(z).map(ne=>({oid:ne,...z[ne]}))}async function C(){const L=window.localStorage.getItem("hyperToken");try{c(!0);const z="https://dextrabothypev2.nftinit.io/api/hyper/feed/",X=window.localStorage.getItem("hyperAddress");L||r(!0);const ne=await fetch(z,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():X,token:L,offset:0})});if(!ne.ok)throw new Error(`Server responded with status ${ne.status}`);const J=await ne.json();if(J.success){const Z=w(J==null?void 0:J.data);v(Z)}else console.log(J.error_message)}catch(z){console.log("Error :>> ",z),c(!1)}finally{c(!1)}}m.useEffect(()=>{C()},[window.localStorage.getItem("hyperToken")]);function N(L,z){const X={};return L.forEach(ne=>{X[ne.oid]={...ne}}),z.forEach(ne=>{const{oid:J,px:Z,dir:re,side:he,crossed:Y,feeToken:ie,listen_user:oe,cloid:G,coin:V,subs_address:ee,sz:ae,closedPnl:fe,fee:Ae,time:ce,startPosition:ye,insert_date:Ne,hash:be}=ne;X[J]||(X[J]={oid:J,px:Z,dir:re,side:he,crossed:Y,feeToken:ie,listen_user:oe,cloid:G,coin:V,subs_address:ee,totalSize:0,totalStartPositions:0,totalClosedPnl:0,totalFee:0,closestTime:ce,earliestStartPosition:ye,insertDate:Ne,hashes:[],hasZeroStartPosition:!1}),parseFloat(ye)===0&&(X[J].hasZeroStartPosition=!0),X[J].hasZeroStartPosition?X[J].totalStartPositions=0:X[J].totalStartPositions+=parseFloat(ye),X[J].totalSize+=parseFloat(ae),X[J].totalClosedPnl+=parseFloat(fe),X[J].totalFee+=parseFloat(Ae),new Date(ce)>new Date(X[J].closestTime)&&(X[J].closestTime=ce),new Date(ce)>new Date(X[J].insertDate)&&(X[J].insertDate=Ne),new Date(ce)<new Date(X[J].closestTime)&&(X[J].earliestStartPosition=ye),X[J].hashes.push(be)}),Object.values(X).sort((ne,J)=>new Date(J.closestTime)-new Date(ne.closestTime))}const I=m.useRef(!1),P=m.useRef(n),R=m.useRef(s);m.useEffect(()=>{P.current=n},[n]),m.useEffect(()=>{o.current=a},[a]),m.useEffect(()=>{R.current=s},[s]);const F="hyper_get_message";m.useEffect(()=>{if(!a||I.current)return;const L=vy("https://dextrabothypesocketv2.nftinit.io/");return e.current=L,I.current=!0,e.current.on("connect",()=>{console.log("Socket connected");const z=()=>{var J;const X=(J=P.current)==null?void 0:J.toLowerCase(),ne=o.current;X&&ne?L.emit("subscribe",{login:X,token:ne}):setTimeout(z,300)};z()}),e.current.on(F,function(z){if(z){const X=Array.isArray(z)?z:[z];v(ne=>{const J=N([],X);let Z=ne.filter(Y=>X.some(ie=>ie.oid===Y.oid)),re=[];Z.length>0?re=N(J,Z):re=J;const he=ne.filter(Y=>!X.some(ie=>ie.oid===Y.oid));return[...re,...he]})}}),e.current.io.on("reconnect_attempt",z=>{console.log("reconnect_attempt",z)}),e.current.io.on("reconnect",z=>{console.log("reconnect",z),e.current.emit("room",F)}),e.current.io.on("reconnect_failed",()=>{console.log("reconnect_failed")}),e.current.io.on("reconnect_error",z=>{console.log("reconnect_error",z)}),e.current.io.on("error",z=>{console.log("error",z)}),e.current.on("disconnect",()=>{console.log("Socket disconnected"),I.current=!1}),()=>{e.current.disconnect(),console.log("Socket cleanup on unmount")}},[a]);function U({date:L}){const[z,X]=m.useState(To(L));return m.useEffect(()=>{const ne=setInterval(()=>{X(To(L))},1e3);return()=>clearInterval(ne)},[L]),i.jsx("span",{className:"text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight",children:z.dateTime})}return i.jsx("div",{className:"flex flex-col items-start justify-start mt-4 overflow-scroll max-h-full",children:!g||g.length==0?i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-[100%] sm:w-[75%] min-w-[880px] max-w-[700px] justify-center items-center text-center mt-44",children:l?i.jsx(Ma,{}):i.jsx("div",{className:"flex justify-center items-center min-w-[480px]",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 min-w-max overflow-x-hidden",children:[i.jsx("img",{src:ec,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"The activities of the favorited wallets will be displayed on this page."}),i.jsx("div",{className:"text-center -mt-2",children:i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["Feed page includes the activities occur after a wallet is favorited."," "]})})]})]})})})}):i.jsx("ul",{className:"flex flex-col items-start justify-start gap-1",children:Array.isArray(g)&&g.slice(0,250).map(L=>{var z,X,ne,J,Z,re,he;return i.jsx("li",{children:i.jsxs("div",{className:"flex justify-start items-start gap-[11px]",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start h-full",children:[i.jsx("div",{className:`${(z=L==null?void 0:L.dir)!=null&&z.includes("Long")?(L==null?void 0:L.dir)==="Short > Long"?"bg-[#67ffbd]/20":(L==null?void 0:L.dir)==="Long > Short"?"bg-[#ff797c]/20":"bg-[#67ffbd]/20":(L==null?void 0:L.dir)=="Buy"?"bg-[#67ffbd]/20":"bg-[#ff797c]/20"} flex justify-center items-center w-6 h-6  rounded-full`,children:i.jsx("div",{className:"w-3 h-3 relative",children:(X=L==null?void 0:L.dir)!=null&&X.includes("Long")?(L==null?void 0:L.dir)==="Short > Long"?i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(L==null?void 0:L.dir)==="Long > Short"?i.jsx(Es,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(L==null?void 0:L.dir)=="Buy"?i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Es,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsx("div",{className:"flex justify-center w-6",children:i.jsx("div",{className:"w-[1px] min-h-[123px] h-full border border-[#242424]"})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-[6px] min-w-[640px] w-full h-[138px] min-h-[138px] rounded-[18px] border border-[#232323] p-2",children:[i.jsxs("div",{className:"flex justify-between items-center gap-2 w-full px-1",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"w-8 h-8 bg-[#6ed8ff] rounded-full",children:i.jsx("img",{src:Hi,alt:"",className:"w-8 h-8"})}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px] ",children:[i.jsxs("div",{onClick:()=>{window.open(`/wallet-details/${L==null?void 0:L.listen_user}`,"_blank")},className:"flex justify-start items-center gap-1.5 cursor-pointer",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-none",children:(L==null?void 0:L.listen_user)&&((ne=L==null?void 0:L.listen_user)==null?void 0:ne.slice(0,5))+"..."+((J=L==null?void 0:L.listen_user)==null?void 0:J.slice(-4))}),i.jsx("img",{onClick:Y=>{Y.stopPropagation(),navigator.clipboard.writeText(L==null?void 0:L.listen_user),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:bo,alt:"",className:"cursor-pointer"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight",children:[i.jsxs("span",{className:"text-white text-[11px] font-normal font-['Manrope'] leading-[13px] tracking-tight min-w-max ml-[1px]",children:["Order ID:"," ",i.jsx("span",{className:"text-[#a5a5a5]",children:(L==null?void 0:L.oid)&&(L==null?void 0:L.oid)})]}),i.jsx("span",{onClick:Y=>{Y.stopPropagation(),navigator.clipboard.writeText(L==null?void 0:L.oid),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"cursor-pointer pr-0.5",children:i.jsx("img",{src:bo,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})]})]})]}),i.jsxs("div",{className:"flex flex-col items-end justify-start gap-[2px] w-full pl-2 pt-2",children:[i.jsx("div",{onClick:()=>{x(f=="time"?"date":"time")},className:"text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight cursor-pointer",children:f=="time"?i.jsx(U,{date:L==null?void 0:L.closestTime}):eu(L==null?void 0:L.closestTime)}),i.jsxs("div",{className:"flex justify-start items-center gap-2 -m-[2px]",children:[i.jsxs("div",{children:[i.jsxs("span",{className:"text-[#9b9b9b] text-[13px] font-normal font-manrope leading-[21px] tracking-tight",children:["opened a new"," ",(L==null?void 0:L.dir)=="Sell"?"spot sell":(L==null?void 0:L.dir)=="Buy"?"spot buy":(Z=L==null?void 0:L.dir)==null?void 0:Z.toLowerCase()," ","position for"," "]}),i.jsxs("span",{className:"pl-1 text-white text-[13px] font-normal font-manrope leading-[21px] tracking-tight",children:[L==null?void 0:L.coin,"/",L==null?void 0:L.feeToken]})]}),i.jsx("div",{className:"w-5 h-5 bg-transparent rounded-[256px]",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${L==null?void 0:L.coin}.svg`||Ua,alt:L==null?void 0:L.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:Y=>ea(Y)})})]})]})]}),i.jsx("div",{className:"w-full min-w-[850px] h-[72px] min-h-[72px] bg-[#232323] rounded-xl border border-[#353535] pt-4 pl-4",children:i.jsxs("div",{className:"flex justify-start items-center gap-4 overflow-x-scroll scroll-smooth",children:[i.jsxs("div",{className:"sticky left-0 z-[8] bg-[#232323] flex justify-start items-center gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-1",children:[i.jsx("div",{className:"text-[#9b9b9b] text-xs font-normal font-manrope leading-[13px] tracking-wide",children:"Asset"}),i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("div",{className:"w-5 h-5 bg-transparent rounded-[256px]",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${L==null?void 0:L.coin}.svg`||Ua,alt:L==null?void 0:L.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:Y=>ea(Y)})}),i.jsxs("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:[L==null?void 0:L.coin,"/",L==null?void 0:L.feeToken]})]})]}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-1",children:[i.jsx("div",{className:"text-[#9b9b9b] text-xs font-normal font-manrope leading-[13px] tracking-wide",children:"Direction"}),i.jsx("div",{className:"flex justify-start items-center",children:i.jsxs("div",{className:`${(re=L==null?void 0:L.dir)!=null&&re.includes("Long")?(L==null?void 0:L.dir)==="Short > Long"?"text-[#67ffbd] bg-[#67ffbd]/20":(L==null?void 0:L.dir)==="Long > Short"?"text-[#ff787b] bg-[#ff797c]/20":"text-[#67ffbd] bg-[#67ffbd]/20":(L==null?void 0:L.dir)=="Buy"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex min-w-max`,children:[i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx("div",{className:"w-3 h-3 relative",children:(he=L==null?void 0:L.dir)!=null&&he.includes("Long")?(L==null?void 0:L.dir)==="Short > Long"?i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(L==null?void 0:L.dir)==="Long > Short"?i.jsx(Es,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(L==null?void 0:L.dir)=="Buy"?i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Es,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-wide",children:(L==null?void 0:L.dir)=="Sell"?"Sell":(L==null?void 0:L.dir)=="Buy"?"Buy":(L==null?void 0:L.dir)=="Close Short"?"Short":(L==null?void 0:L.dir)=="Close Long"?"Long":(L==null?void 0:L.dir)=="Open Short"?"Short":(L==null?void 0:L.dir)=="Open Long"?"Long":L==null?void 0:L.dir})]})})]}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(oC,{title:"Type",value:(L==null?void 0:L.totalStartPositions)==0?"Open Position":(L==null?void 0:L.dir)!="Short > Long"&&(L==null?void 0:L.dir)!="Long > Short"?(L==null?void 0:L.totalSize)-Math.abs(L==null?void 0:L.totalStartPositions)==0&&((L==null?void 0:L.dir)=="Close Long"||(L==null?void 0:L.dir)=="Close Short")?"Position Closed":(L==null?void 0:L.dir)=="Open Short"||(L==null?void 0:L.dir)=="Open Long"?"Increase":(L==null?void 0:L.dir)=="Close Long"||(L==null?void 0:L.dir)=="Close Short"?"Decrease":(L==null?void 0:L.dir)=="Sell"||(L==null?void 0:L.dir)=="Buy"?"Spot":"Changed Position":(L==null?void 0:L.dir)=="Short > Long"||(L==null?void 0:L.dir)=="Long > Short"?"Changed Position":"Open Position",color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(oC,{title:"Price",value:Er(L==null?void 0:L.px),color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(oC,{title:"Size",value:Er(L==null?void 0:L.totalSize),color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(oC,{title:"PnL",value:L!=null&&L.totalClosedPnl?`$${Er(Math.abs(L==null?void 0:L.totalClosedPnl))}`:Er(Math.abs(L==null?void 0:L.totalClosedPnl)),color:`${(L==null?void 0:L.totalClosedPnl)>=0?"text-[#67ffbd]":"text-[#ff787b]"}`}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(oC,{title:"Fee",value:L!=null&&L.totalFee?`$${Er(Math.abs(L==null?void 0:L.totalFee))}`:Er(Math.abs(L==null?void 0:L.totalFee)),color:`${(L==null?void 0:L.totalFee)>=0?"text-[#67ffbd]":"text-[#ff787b]"}`}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(oC,{title:"Margin Mode",value:L!=null&&L.crossed?"Cross":"Isolated",color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-transparent"})]})]})})]})]})},L.oid)})})})},oC=({title:e,value:t,color:n})=>i.jsxs("div",{className:"flex flex-col justify-start items-start gap-1 min-w-max",children:[i.jsx("div",{className:"text-[#9b9b9b] text-xs font-normal font-manrope leading-[13px] tracking-wide min-w-max",children:e}),i.jsx("div",{className:"flex justify-start items-center min-w-max",children:i.jsx("div",{className:`${n} text-sm font-semibold font-manrope leading-[13px] tracking-tight min-w-max`,children:t})})]}),Uin="https://dextrabothypesocketv2.nftinit.io/";function zin(){var X,ne;const{isConnected:e,address:t}=Yr(),{setSignModalOpen:n,trackedWatchList:r,hyperToken:s}=m.useContext(Gr),a=m.useRef(null),[o,l]=m.useState([]),[c,u]=m.useState(!1),f=localStorage.getItem("isDateTrackedWalletsFormat")||"date",[x,g]=m.useState(f),[v,w]=m.useState(null);function C({date:J}){const[Z,re]=m.useState(To(J));return m.useEffect(()=>{const he=setInterval(()=>re(To(J)),1e3);return()=>clearInterval(he)},[J]),i.jsx("span",{className:"text-[11px] text-[#a5a5a5] font-normal",children:Z.dateTime})}m.useEffect(()=>{localStorage.setItem("isDateTrackedWalletsFormat",x)},[x]);function N(J){const Z={};return J.forEach(re=>{const{oid:he,px:Y,dir:ie,side:oe,crossed:G,feeToken:V,listen_user:ee,cloid:ae,coin:fe,subs_address:Ae,sz:ce,closedPnl:ye,fee:Ne,time:be,startPosition:je,insert_date:Ie,hash:Re}=re;Z[he]||(Z[he]={oid:he,px:Y,dir:ie,side:oe,crossed:G,feeToken:V,listen_user:ee,cloid:ae,coin:fe,subs_address:Ae,totalSize:0,totalClosedPnl:0,totalFee:0,earliestStartPosition:je,hasZeroStartPosition:!1,closestTime:be,insertDate:Ie,hashes:[]}),parseFloat(je)===0&&(Z[he].hasZeroStartPosition=!0),Z[he].totalSize+=parseFloat(ce),Z[he].totalClosedPnl+=parseFloat(ye),Z[he].totalFee+=parseFloat(Ne),new Date(be)>new Date(Z[he].closestTime)&&(Z[he].closestTime=be),new Date(be)>new Date(Z[he].insertDate)&&(Z[he].insertDate=Ie),Z[he].hashes.push(Re)}),Object.keys(Z).map(re=>({oid:re,...Z[re]}))}async function I(){const J=window.localStorage.getItem("hyperToken");try{u(!0),J||n(!0);const Z=await fetch("https://dextrabothypev2.nftinit.io/api/hyper/feed/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t.toLowerCase(),token:J,offset:0})});if(!Z.ok)throw new Error(`Server responded with status ${Z.status}`);const re=await Z.json();if(re.success){const he=N(re==null?void 0:re.data);l(he)}}catch(Z){console.log("Error :>> ",Z)}finally{u(!1)}}function P(J,Z){const re={};return J.forEach(he=>{re[he.oid]={...he}}),Z.forEach(he=>{const{oid:Y,px:ie,dir:oe,side:G,crossed:V,feeToken:ee,listen_user:ae,cloid:fe,coin:Ae,subs_address:ce,sz:ye,closedPnl:Ne,fee:be,time:je,startPosition:Ie,insert_date:Re,hash:Qe}=he;re[Y]||(re[Y]={oid:Y,px:ie,dir:oe,side:G,crossed:V,feeToken:ee,listen_user:ae,cloid:fe,coin:Ae,subs_address:ce,totalSize:0,totalClosedPnl:0,totalFee:0,hasZeroStartPosition:!1,earliestStartPosition:Ie,closestTime:je,insertDate:Re,hashes:[]}),parseFloat(Ie)===0&&(re[Y].hasZeroStartPosition=!0),re[Y].totalSize+=parseFloat(ye),re[Y].totalClosedPnl+=parseFloat(Ne),re[Y].totalFee+=parseFloat(be),new Date(je)>new Date(re[Y].closestTime)&&(re[Y].closestTime=je),new Date(je)>new Date(re[Y].insertDate)&&(re[Y].insertDate=Re),re[Y].hashes.push(Qe)}),Object.values(re).sort((he,Y)=>new Date(Y.closestTime)-new Date(he.closestTime))}m.useEffect(()=>{I()},[window.localStorage.getItem("hyperToken")]),m.useEffect(()=>{a.current=vy(Uin);const J=window.localStorage.getItem("hyperToken");return a.current.on("connect",()=>{r==null||r.map(Z=>Z.wallet_address),a.current.emit("subscribe",{login:t.toLowerCase(),token:J})}),a.current.on("hyper_get_message",Z=>{if(Z){const re=Array.isArray(Z)?Z:[Z];l(he=>{const Y=P([],re);let ie=he.filter(V=>re.some(ee=>ee.oid===V.oid)),oe=[];ie.length>0?oe=P(Y,ie):oe=Y;const G=he.filter(V=>!re.some(ee=>ee.oid===V.oid));return[...oe,...G]})}}),()=>{a.current.disconnect()}},[s]);const R=J=>J?J.includes("Long")?J==="Short > Long"?"bg-[#67ffbd]/20 text-[#67ffbd]":J==="Long > Short"?"bg-[#ff797c]/20 text-[#ff797c]":"bg-[#67ffbd]/20 text-[#67ffbd]":J==="Buy"?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff797c]":"bg-[#767676]/20 text-[#cccccc]",F=J=>J?J.includes("Long")?J==="Short > Long"?i.jsx(Es,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):J==="Long > Short"?i.jsx(Es,{className:"text-[#ff797c] w-3 h-3"}):i.jsx(Es,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):J==="Buy"?i.jsx(Es,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):i.jsx(Es,{className:"text-[#ff797c] w-3 h-3"}):i.jsx(Es,{className:"text-[#767676] w-3 h-3"}),U=J=>{const Z=J==null?void 0:J.hasZeroStartPosition,re=J.dir==="Close Short"||J.dir==="Close Long"||J.dir==="Short > Long"||J.dir==="Long > Short";return Z||re?{text:"Closed",icon:hM}:{text:"Open",icon:pM}},L=J=>w(J),z=()=>w(null);return i.jsxs("div",{className:"flex flex-col w-full pb-2",children:[!o||o.length===0?i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-full sm:w-[75%] max-w-[700px] justify-center items-center text-center mt-44",children:c?i.jsx(Ma,{}):i.jsx("div",{className:"flex justify-center items-center min-w-[320px]",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 min-w-max overflow-x-hidden",children:[i.jsx("img",{src:ec,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"The activities of the favorited wallets will be displayed on this page."}),i.jsx("div",{className:"text-center -mt-2",children:i.jsx("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"Feed page includes the activities occur after a wallet is favorited."})})]})]})})})}):i.jsx("div",{className:"flex flex-col gap-3 w-full mt-3",children:o.slice(0,250).map(J=>(U(J),i.jsxs("div",{className:"border-2 border-[#232323] rounded-xl p-3 flex items-start gap-3 cursor-pointer",onClick:()=>L(J),children:[i.jsx("div",{className:"w-8 h-8 bg-[#6ed8ff] rounded-full flex items-center justify-center",children:i.jsx("img",{src:Hi,alt:"",className:"w-6 h-6"})}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 text-white text-sm font-semibold",children:[J!=null&&J.listen_user?J.listen_user.slice(0,5)+"..."+J.listen_user.slice(-4):"-",i.jsx("img",{src:bo,alt:"",className:"w-4 h-4 cursor-pointer",onClick:Z=>{Z.stopPropagation(),navigator.clipboard.writeText((J==null?void 0:J.listen_user)||""),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})}})]}),i.jsxs("div",{className:"flex flex-col text-xs text-[#a5a5a5]",children:[i.jsx("span",{children:eu(J==null?void 0:J.closestTime)}),i.jsx(C,{date:J==null?void 0:J.closestTime})]}),i.jsxs("div",{className:"text-xs font-semibold",children:[i.jsx("span",{className:"text-white",children:"Size:"})," ",J!=null&&J.totalSize?Er(J==null?void 0:J.totalSize):"-"]}),i.jsxs("div",{className:"text-xs font-semibold",children:[i.jsx("span",{className:"text-white",children:"Price:"})," ",J!=null&&J.px?"$"+Er(J==null?void 0:J.px):"-"]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("div",{className:"w-5 h-5 bg-transparent rounded-[256px]",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${J==null?void 0:J.coin}.svg`||Ua,alt:J==null?void 0:J.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:Z=>ea(Z)})}),i.jsxs("div",{className:"text-[13px] text-white font-bold font-manrope leading-[13px] tracking-tight",children:[J==null?void 0:J.coin,"/",J==null?void 0:J.feeToken]})]}),i.jsxs("div",{className:`${R(J==null?void 0:J.dir)} h-5 pl-2 pr-2 py-1 rounded-md flex items-center gap-1 w-max mt-1`,children:[i.jsx("div",{className:"w-3 h-3",children:F(J==null?void 0:J.dir)}),i.jsx("div",{className:"text-[11px] font-semibold",children:(J==null?void 0:J.dir)||"-"})]})]})]})]},J.oid)))}),v&&i.jsx(rp,{isOpen:!!v,onClose:()=>z(),children:i.jsxs("div",{className:"flex flex-col gap-4 p-2",children:[i.jsxs("div",{className:"flex gap-2 items-center",children:[i.jsx("div",{className:"w-8 h-8 bg-[#6ed8ff] rounded-full flex items-center justify-center",children:i.jsx("img",{src:Hi,alt:"",className:"w-6 h-6"})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsxs("div",{className:"flex gap-2",children:[i.jsx("div",{className:"text-white text-sm font-semibold",children:v!=null&&v.listen_user?v.listen_user.slice(0,5)+"..."+v.listen_user.slice(-4):"-"}),i.jsx("img",{src:bo,alt:"",className:"w-4 h-4 cursor-pointer",onClick:J=>{J.stopPropagation(),navigator.clipboard.writeText((v==null?void 0:v.listen_user)||"")}})]}),i.jsx("div",{className:"flex flex-col text-[11px] text-[#a5a5a5]",children:x==="time"?i.jsx(C,{date:v==null?void 0:v.closestTime}):eu(v==null?void 0:v.closestTime)})]})]}),i.jsxs("div",{className:"flex flex-col gap-2 text-sm text-[#9b9b9b]",children:[i.jsxs("div",{className:"text-white flex items-center gap-2",children:[i.jsx("img",{src:U(v).icon,alt:"",className:"w-4 h-4"}),"Status: ",U(v).text]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Order ID:"})," ",(v==null?void 0:v.oid)||"-"]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"text-white",children:"Direction:"}),i.jsxs("div",{className:`${R(v==null?void 0:v.dir)} h-5 pl-2 pr-2 py-1 rounded-md flex items-center gap-1`,children:[i.jsx("div",{className:"w-3 h-3",children:F(v==null?void 0:v.dir)}),i.jsx("div",{className:"text-[11px] font-semibold",children:(v==null?void 0:v.dir)||"-"})]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Price:"})," ",v!=null&&v.px?"$"+Er(v==null?void 0:v.px):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Size:"})," ",v!=null&&v.totalSize?Er(v==null?void 0:v.totalSize):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"PnL:"})," ",v!=null&&v.totalClosedPnl?"$"+Er(Math.abs(v==null?void 0:v.totalClosedPnl)):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Fee:"})," ",v!=null&&v.totalFee?"$"+Er(Math.abs(v==null?void 0:v.totalFee)):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Margin Mode:"})," ",v!=null&&v.crossed?"Cross":"Isolated"]}),i.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${v==null?void 0:v.coin}.svg`||Ua,onError:J=>ea(J),alt:"",className:"w-5 h-5"}),i.jsxs("span",{className:"font-bold text-white",children:[v==null?void 0:v.coin,"/",(v==null?void 0:v.feeToken)||"USDC"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Fills:"})," ",(X=v==null?void 0:v.hashes)!=null&&X.length?((ne=v==null?void 0:v.hashes)==null?void 0:ne.length)+" fill(s)":"0"]})]})]})})]})}const Hin=({open:e,setOpen:t,handleTelegramClick:n})=>(m.useContext(Gr),Yr(),m5(),i.jsxs(ga,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-8",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Oa})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Hi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-2",children:[i.jsx("div",{className:"text-center text-white text-[32px] font-manrope leading-none",children:"Welcome Dextrabot"}),i.jsx("div",{className:"text-center text-white/60 text-sm font-manrope leading-none",children:"You can connect to Telegram here."})]}),i.jsx("div",{onClick:()=>{n(),t(!1)},className:"flex justify-center items-center w-[348px] h-12 bg-[#7536ff] rounded-2xl cursor-pointer",children:i.jsx("div",{className:"text-center font-semibold text-white text-sm font-manrope leading-3",children:"Join Telegram"})})]})})})})})]})),Vin=({open:e,setOpen:t,setIsfilterModal:n,handleTelegramClick:r})=>{const[s,a]=m.useState(!1),o=()=>{a(!1),n(!1),t(!1)};return i.jsxs(ga,{open:e,onClose:o,className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-center justify-center p-4 text-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[310px]  sm:w-[400px] h-max relative bg-white rounded-3xl pt-4 pb-8",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:l=>{l.preventDefault(),s?(t(!1),n(!1),a(!1)):t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:`${s?"bg-[#1DE674] hover:bg-[#16c765]":"bg-[#e3e3e3] hover:bg-[#d4d4d4]"} absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center  `,children:i.jsx(SLe,{className:"w-4 h-4 text-black"})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:_yt,alt:"",className:""})}),i.jsx("div",{className:"flex flex-col justify-start items-center gap-2 -mt-5",children:i.jsx("div",{className:"text-[#232323] text-[21px] font-semibold font-['Manrope']",children:"Telegram Setup"})}),i.jsx("div",{onClick:l=>{l.preventDefault(),s||r(),setTimeout(()=>{a(!0)},500)},className:`${s?"bg-[#1DE674] cursor-text":"bg-[#e3e3e3] hover:bg-[#d4d4d4] cursor-pointer"} w-60 h-8 px-6 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] inline-flex justify-center items-center gap-2.5 mb-2 select-none`,children:i.jsx("div",{className:"justify-start text-[#0a321c] text-[13px] font-semibold font-['Inter'] leading-[8px] min-w-max",children:s?"Successful":"Join Telegram"})})]})})})})})]})},Win=({open:e,setOpen:t,handleTelegramClick:n})=>{const{setSignModalOpen:r}=m.useContext(Gr),{address:s}=Yr(),[a,o]=m.useState([]),[l,c]=m.useState([]),[u,d]=m.useState(null),[f,x]=m.useState(!1),[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,I]=m.useState(""),[P,R]=m.useState(!1),[F]=m.useState(["Open Position","Increase","Decrease","Changed Position","Position Closed","Twaps"]),[U,L]=m.useState([]),[z,X]=m.useState(!1),ne=async()=>{var Ne;const ce=window.localStorage.getItem("hyperToken"),ye=window.localStorage.getItem("hyperAddress");if(!ce){r(!0);return}try{x(!0);const je=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed/tag_list/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:s?s==null?void 0:s.toLowerCase():ye,token:ce})})).json();if(je.success){const Ie=(je==null?void 0:je.data)||[],Re=u?((Ne=u==null?void 0:u.message_filters)==null?void 0:Ne.source)||[]:[],Qe=[...Ie].sort((Be,it)=>{const tt=Re==null?void 0:Re.includes(Be.wallet_address),at=Re==null?void 0:Re.includes(it.wallet_address);return Number(at)-Number(tt)});o(Qe),await J(Qe)}else I((je==null?void 0:je.error_message)||"Failed to fetch source wallets"),console.error("API Error:",je==null?void 0:je.error_message)}catch(be){console.error("Fetch Error:",be),I("Failed to fetch source wallets")}finally{setTimeout(()=>{x(!1)},200)}},J=async ce=>{var be;const ye=window.localStorage.getItem("hyperToken"),Ne=window.localStorage.getItem("hyperAddress");if(!ye){r(!0);return}try{v(!0);const Ie=await(await fetch("https://dextrabothypev2.nftinit.io/api/subscriber/get_telegram_filter/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:s?s==null?void 0:s.toLowerCase():Ne,token:ye})})).json();if(Ie.success){const Re=Ie==null?void 0:Ie.filters;if(d(Re),Re===null){const Qe=ce==null?void 0:ce.map(Be=>`${Be.wallet_address}::${Be.tag}`);c(Qe),L([...F])}else{const Qe=((be=Re==null?void 0:Re.message_filters)==null?void 0:be.source)||[],Be=[...ce].sort((it,tt)=>{const at=Qe==null?void 0:Qe.includes(it.wallet_address),dt=Qe==null?void 0:Qe.includes(tt.wallet_address);return Number(dt)-Number(at)});o(Be)}}else I((Ie==null?void 0:Ie.error_message)||"Failed to fetch filter info"),console.error("API telegram filter info error:",Ie==null?void 0:Ie.error_message)}catch(je){console.error("Fetch Error:",je),I("Failed to fetch filter info")}finally{v(!1)}},Z=async()=>{const ce=window.localStorage.getItem("hyperToken"),ye=window.localStorage.getItem("hyperAddress");if(!ce){r(!0);return}const Ne=[...new Set(l==null?void 0:l.map(Re=>Re.split("::")[0]))];let be={};Ne.length>0&&(be.source=Ne);const je=U.filter(Re=>!Re.includes("Spot"));je.length>0&&(be.type=je),Ne.length===0&&U.length===0&&(be={});const Ie={address:s?s==null?void 0:s.toLowerCase():ye,token:ce,filters:be};try{C(!0);const Re=await fetch("https://dextrabothypev2.nftinit.io/api/subscriber/telegram_filter_save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(Ie)}),Qe=await Re.json();Re.ok&&Qe.success?(d(Qe.filters),fe(Qe.filters),R(!0),on.success("Filter saved successfully",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"40px",width:"340px",minWidth:"340px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):(I((Qe==null?void 0:Qe.error_message)||"Failed to save filter"),console.error("API telegram filter save error:",Qe==null?void 0:Qe.error_message))}catch(Re){console.error("Fetch Error:",Re),I("Failed to save filter")}finally{C(!1)}};m.useEffect(()=>{a.length>0&&u&&fe(u)},[a,u]),m.useEffect(()=>{e&&ne()},[e]);const re=ce=>{const{value:ye,checked:Ne}=ce.target;if(ye==="all"){const be=a.map(je=>`${je.wallet_address}::${je.tag}`);c(Ne?be:[])}else c(be=>Ne?[...be,ye]:be.filter(je=>je!==ye))},he=a==null?void 0:a.map(ce=>`${ce.wallet_address}::${ce.tag}`),Y=a.length>0&&(he==null?void 0:he.every(ce=>l==null?void 0:l.includes(ce))),ie=ce=>{const{value:ye,checked:Ne}=ce.target;if(ye==="all")if(Ne){const be=F==null?void 0:F.filter(je=>!(je!=null&&je.includes("Spot")));L(be)}else L([]);else L(be=>Ne?[...be,ye]:be.filter(je=>je!==ye))},G=(F==null?void 0:F.filter(ce=>!ce.includes("Spot"))).length,ee=U.filter(ce=>!ce.includes("Spot")).length,ae=ee===G&&G>0,fe=ce=>{const ye=ce==null?void 0:ce.message_filters;if(ye&&(Array.isArray(ye.type)&&L(ye.type.filter(Ne=>!Ne.includes("Spot"))),Array.isArray(ye.source))){const Ne=a.filter(be=>{var je;return(je=ye.source)==null?void 0:je.includes(be.wallet_address)}).map(be=>`${be.wallet_address}::${be.tag}`);c(Ne)}},Ae=()=>{t(!1),X(!1),o([]),L([]),c([])};return i.jsxs(i.Fragment,{children:[i.jsx(Vin,{open:P,setOpen:R,handleTelegramClick:n,setIsfilterModal:t}),i.jsxs(ga,{open:e,onClose:Ae,className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full justify-center p-4 text-center items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative transform overflow-hidden bg-[#242424] text-left shadow-xl transition-all rounded-3xl",children:i.jsxs("div",{style:{boxShadow:"0px 4px 24px 0px rgba(0, 0, 0, 0.32)",backdropFilter:"blur(16px)"},className:"flex flex-col items-center gap-6 w-[300px] sm:w-[411px] bg-[#242424] rounded-3xl pt-[33px] pb-8",children:[i.jsx("div",{onClick:()=>Ae(),className:`${l.length===0&&U.length===0?"hover:bg-[rgba(103,255,189,0.16)]":"hover:bg-[#787070]"} cursor-pointer absolute top-2 right-2 sm:top-8 sm:right-6 w-9 h-9 rounded-full flex justify-center items-center `,children:i.jsx("img",{className:"p-1",src:Oa,alt:"close"})}),i.jsx("div",{className:"flex justify-start items-center gap-3 w-full px-6 sm:px-10",children:i.jsx("div",{className:"text-white text-[21px] font-semibold font-['Manrope']",children:"Telegram Notifications"})}),i.jsxs("div",{className:"w-full pl-6 sm:pl-8 pr-2",children:[i.jsx("div",{className:"flex justify-between items-center mb-2 pr-6 max-w-[244px] sm:max-w-full",children:i.jsxs("div",{className:"flex justify-start items-center gap-2 pl-2",children:[i.jsx("span",{className:"text-white text-xs sm:text-sm font-manrope font-semibold leading-[8px]",children:"Source Wallet"}),i.jsx("span",{className:"text-[10px] sm:text-sm text-white font-semibold",children:(l==null?void 0:l.length)>0?`(${l==null?void 0:l.length} of ${a==null?void 0:a.length} selected)`:""})]})}),i.jsx("div",{className:"relative max-w-[244px] sm:max-w-full",children:i.jsx("div",{className:"w-full bg-transparent rounded-md mt-[2px] transition-all duration-200",children:i.jsx("div",{className:"max-h-[186px] overflow-y-auto scrollbar-custom-scrollbar-dark  pr-0 sm:pr-[17px]",children:f?i.jsx("div",{className:"flex w-full h-full justify-center items-center min-h-[160px]",children:i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 w-[32px] px-0.5 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-10 h-10 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]})}):i.jsxs(i.Fragment,{children:[(a==null?void 0:a.length)>0?i.jsxs(i.Fragment,{children:[i.jsxs("label",{className:"flex sticky top-0 z-10 bg-[#242424] justify-between items-center gap-2 cursor-pointer text-white font-semibold pt-1 pb-2 px-2 text-[13px] font-manrope leading-[8px]",children:[i.jsx("span",{className:`${Y?"text-white":"text-[#7C7C7C]"}`,children:"All"}),i.jsx("input",{type:"checkbox",value:"all",checked:Y,onChange:re,className:"hidden"}),i.jsx("div",{className:`w-[32px] h-[18px] flex items-center px-[2px] rounded-full transition-colors duration-200 ${Y?"bg-[#1DE674]":"bg-white/10"}`,children:i.jsx("div",{className:`w-[14px] h-[14px] bg-white rounded-full shadow transform transition-transform duration-200 ${Y?"translate-x-[14px]":"translate-x-0"}`})})]}),i.jsx("div",{className:"h-[1px] w-full bg-[#353535]"})]}):i.jsx("div",{className:"py-2 text-center text-[#7c7c7c] text-sm font-semibold",children:"No source wallet"}),a==null?void 0:a.map((ce,ye)=>{var je,Ie,Re,Qe,Be;const Ne=`${ce==null?void 0:ce.wallet_address}::${ce==null?void 0:ce.tag}`,be=l==null?void 0:l.includes(Ne);return i.jsxs("label",{className:"flex justify-between items-center gap-2 h-8 px-2 cursor-pointer text-white text-sm font-semibold rounded-md bg-[#353535] my-1 hover:bg-[#464646]",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("div",{className:`${be?"text-white":"text-[#7C7C7C]"} text-[13px] font-semibold min-w-[88px]`,children:((je=ce.wallet_address)==null?void 0:je.slice(0,5))+"..."+((Ie=ce.wallet_address)==null?void 0:Ie.slice(-4))}),i.jsx("span",{className:`${be?"text-white":"text-[#7C7C7C]"} sm:hidden h-[18px] bg-[#424242] rounded-[256px] px-1.5 text-[13px] font-medium font-['Manrope'] leading-[8px] tracking-tight flex justify-center items-center`,children:((Re=ce.tag)==null?void 0:Re.length)>10?`${(Qe=ce==null?void 0:ce.tag)==null?void 0:Qe.slice(0,10)}...`:`${ce==null?void 0:ce.tag}`}),i.jsx("span",{className:`${be?"text-white":"text-[#7C7C7C]"} hidden sm:flex h-[18px] bg-[#424242] rounded-[256px] px-1.5 text-[13px] font-medium font-['Manrope'] leading-[8px]  tracking-tight  justify-center items-center`,children:((Be=ce.tag)==null?void 0:Be.length)>24?`${ce==null?void 0:ce.tag.slice(0,24)}...`:`${ce==null?void 0:ce.tag}`})]}),i.jsx("input",{type:"checkbox",value:`${ce==null?void 0:ce.wallet_address}::${ce==null?void 0:ce.tag}`,checked:be,onChange:re,className:"hidden"}),i.jsx("div",{className:`w-[32px] h-[18px] flex items-center px-[2px] rounded-full transition-colors duration-200 ${be?"bg-[#1DE674]":"bg-white/10"}`,children:i.jsx("div",{className:`w-[14px] h-[14px] bg-white rounded-full shadow transform transition-transform duration-200 ${be?"translate-x-[14px]":"translate-x-0"}`})})]},ye)})]})})})})]}),i.jsxs("div",{className:`${(a==null?void 0:a.length)>4?"pr-[36px] sm:pr-[30px]":"pr-6"} w-full pl-6  sm:pl-8`,children:[i.jsx("div",{className:"flex justify-between items-center mb-2 mt-4 max-w-[244px] sm:max-w-full",children:i.jsxs("div",{className:"flex justify-start items-center gap-2 pl-2",children:[i.jsx("span",{className:"text-white text-xs sm:text-sm font-manrope font-semibold leading-[8px]",children:"Source Wallet Type"}),i.jsx("span",{className:"text-[10px] sm:text-sm text-white font-semibold",children:ee>0?`(${ee} of ${G} selected)`:""})]})}),i.jsx("div",{className:"relative max-w-[244px] sm:max-w-full",children:i.jsx("div",{className:"w-full rounded-md mt-[2px] transition-all duration-200",children:i.jsxs("div",{className:"max-h-[296px] overflow-y-auto scrollbar-custom-scrollbar-dark",children:[i.jsxs("label",{className:"flex sticky top-0 z-10 justify-between items-center gap-2 cursor-pointer text-white font-semibold py-1 px-2 text-[13px] font-manrope leading-[8px]",children:[i.jsx("span",{className:`${ae?"text-white":"text-[#7C7C7C]"}`,children:"All"}),i.jsx("input",{type:"checkbox",value:"all",checked:ae,onChange:ie,className:"hidden"}),i.jsx("div",{className:`w-[32px] h-[18px] flex items-center px-[2px] rounded-full transition-colors duration-200 ${ae?"bg-[#1DE674]":"bg-white/10"}`,children:i.jsx("div",{className:`w-[14px] h-[14px] bg-white rounded-full shadow transform transition-transform duration-200 ${ae?"translate-x-[14px]":"translate-x-0"}`})})]}),i.jsx("div",{className:"h-[1px] w-full bg-[#353535] my-1"}),F==null?void 0:F.map((ce,ye)=>{const Ne=U==null?void 0:U.includes(ce);return i.jsxs("label",{className:"flex justify-between items-center gap-2 h-8 hover:bg-[#464646] cursor-pointer text-white text-[13px] font-semibold rounded-md px-2 leading-[8px] bg-[#353535] my-1",children:[i.jsx("span",{className:`${Ne?"text-white":"text-[#7C7C7C]"}`,children:ce}),i.jsx("input",{type:"checkbox",value:ce,checked:Ne,onChange:ie,className:"hidden"}),i.jsx("div",{className:`w-[32px] h-[18px] flex items-center px-[2px] rounded-full transition-colors duration-200 ${Ne?"bg-[#1DE674]":"bg-white/10"}`,children:i.jsx("div",{className:`w-[14px] h-[14px] bg-white rounded-full shadow transform transition-transform duration-200 ${Ne?"translate-x-[14px]":"translate-x-0"}`})})]},ye)})]})})})]}),i.jsx("div",{onClick:ce=>{if(ce.preventDefault(),!f&&!g&&!w)if((l==null?void 0:l.length)===0||(U==null?void 0:U.length)===0){on.success(i.jsx(i.Fragment,{children:i.jsx("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:"Select at least one wallet or type."})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"350px",minWidth:"350px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}else Z()},className:`${!f&&!g&&!w&&(l==null?void 0:l.length)>0&&(U==null?void 0:U.length)>0?"cursor-pointer bg-[rgba(103,255,189,0.16)] text-[#67FFBD] hover:bg-[rgba(103,255,189,0.26)]":"cursor-pointer bg-[#787070] text-[#A6A6A6] border border-[#787070]"} w-full max-w-[230px] sm:max-w-[341px] mr-2 sm:mr-0 sm:ml-2 h-8 px-6 py-3 rounded-[10px] flex justify-center items-center gap-2.5`,children:i.jsx("div",{className:"pointer-events-none text-[13px] font-semibold font-['Inter'] leading-[8px]",children:f||g||w?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[32px] px-0.5 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):"Next"})}),N&&i.jsx("p",{className:"mt-2 text-sm text-red-500",children:N})]})})})})]})]})},qin=({isMenu:e})=>{const[t,n]=m.useState(!1),[r,s]=m.useState(!1),{setSignModalOpen:a,setTelegramChatId:o,setSubscriberRole:l,setIsReferralCode:c,setIsReferralCodeName:u,setMushboomerETH:d,setIsWhitelist:f,setMushboomerSOL:x,telegramChatId:g}=m.useContext(Gr);Yr();const v=async()=>{var C,N;let w="";try{const I=window.localStorage.getItem("hyperToken"),P=window.localStorage.getItem("hyperAddress");if(!I){a(!0);return}if(P&&I){const R=await Si(P,I);if(!R.success){console.error("Account check failed:",R.message);return}if(o(R==null?void 0:R.telegram_chat_id),l(R==null?void 0:R.subscriber_role),d((C=R==null?void 0:R.mushboomer_counts)==null?void 0:C.eth),x((N=R==null?void 0:R.mushboomer_counts)==null?void 0:N.sol),c(R==null?void 0:R.referral_code),u(R==null?void 0:R.refcode),f(R==null?void 0:R.whitelist),R.telegram_chat_id==null||R.telegram_chat_id==""||R.telegram_chat_id=="0"){const F=await Ibt(P,I);if(!F.success){console.error("Telegram-ID kunne ikke hentes:",R.message),on.error(F.message);return}F.success&&(w=e=="My Activities"?`https://t.me/DextraCopyTraderBot?start=${F.telegram_temp_password}`:`https://t.me/DextraTraderBot?start=${F.telegram_temp_password}`)}else w=e=="My Activities"?"https://t.me/DextraCopyTraderBot":"https://t.me/DextraTraderBot"}w?window.open(w,"_blank"):(console.error("Failed to generate Telegram URL"),on.error("Failed to generate Telegram URL"))}catch(I){console.error("Error during Telegram handling:",I),on.error(I.message)}};return i.jsxs(i.Fragment,{children:[i.jsx(Hin,{open:t,setOpen:n,handleTelegramClick:v}),i.jsx(Win,{open:r,setOpen:s,handleTelegramClick:v}),i.jsx("div",{className:"flex justify-center items-center",children:g==null||g==""||g=="0"?i.jsx("div",{onClick:w=>{w.preventDefault(),window.localStorage.getItem("hyperToken")?e=="My Activities"?s(!0):n(!0):a(!0)},className:`${e=="My Activities"?"bg-[#7445ff] hover:bg-[#7445ff]/80":"bg-white/40 hover:bg-white/50"} h-8 min-h-8 px-3 py-[5px]  rounded-[256px] flex justify-start items-center gap-2 cursor-pointer`,children:i.jsx("div",{className:"min-w-max text-white text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none",children:e=="My Activities"?"My Activities - Telegram":"Tracked Wallets - Telegram"})}):i.jsx("div",{onClick:w=>{w.preventDefault(),e=="My Activities"?s(!0):v()},className:`${e=="My Activities"?"bg-[#7445ff] hover:bg-[#7445ff]/80":"bg-white/40 hover:bg-white/50"} h-8 min-h-8 px-3 py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer`,children:i.jsx("div",{className:"min-w-max text-white text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none",children:e=="My Activities"?"My Activities - Telegram":"Tracked Wallets - Telegram"})})})]})};function Gin(e){var Pt,Xe,Vt,Yt,Ve,Ke,ft,en,Dt,At,Je,He,Rt,qe,lt,xt,Nt,It,xn,dn,Mn,_n,kn,vn,Qn,Hn,$n,Jn,Nn,ln,Oe,sn,fn,Et,Kn,Cn,Bt,an,Pn,qn,nr,tr;const[t,n]=m.useState(!1),r=m.useRef(null),{isConnected:s,address:a}=Yr(),[o,l]=m.useState([]);m.useEffect(()=>{var zn,Yn;const Qt=(zn=e.advancedFilters)==null?void 0:zn.coinFeed;if(Qt&&((Yn=e.dataCoin)==null?void 0:Yn.length)>0){const Lt=Qt.map(Fn=>e.dataCoin.find(Ee=>Ee.value===Fn)).filter(Boolean);e.setSelectedCoins(Lt)}},[e.dataCoin]);const c=Qt=>{if(!Qt)return;const Yn=Array.isArray(Qt)?Qt:[Qt],Lt=e.selectedCoins||[],Fn=[...Lt,...Yn.filter(p=>!Lt.some(h=>h.value===p.value))],Ee=Fn.map(p=>p.value);Ee.join(","),e.setSelectedCoins(Fn),e.setAdvancedFilters(p=>({...p,coinFeed:Ee}))},[u,d]=m.useState(!1),[f,x]=m.useState(!1),[g,v]=m.useState(!1),[w,C]=m.useState(!1),[N,I]=m.useState(!1),[P,R]=m.useState(!1),F=()=>{d(Qt=>!Qt)},U=()=>{x(Qt=>!Qt)},L=()=>{v(Qt=>!Qt)},z=()=>{C(Qt=>!Qt)},X=()=>{I(Qt=>!Qt)},ne=()=>{R(Qt=>!Qt)},J=Qt=>{const{value:zn,checked:Yn}=Qt.target;e.setAdvancedFilters(Lt=>{let Fn=[...Lt.positionFeed];return zn==="all"?Fn=Yn?[...je]:[]:Yn?Fn.push(zn):Fn=Fn.filter(Ee=>Ee!==zn),localStorage.setItem("positionFeed",JSON.stringify(Fn)),{...Lt,positionFeed:Fn}})},Z=()=>{localStorage.setItem("positionFeed",JSON.stringify([])),e.setAdvancedFilters(Qt=>({...Qt,positionFeed:[]}))},re=Qt=>{const{value:zn,checked:Yn}=Qt.target;e.setAdvancedFilters(Lt=>{let Fn=[...Lt.typeFeed];return zn==="all"?Fn=Yn?[...Qe]:[]:Yn?Fn.push(zn):Fn=Fn.filter(Ee=>Ee!==zn),{...Lt,typeFeed:Fn}})},he=()=>{e.setAdvancedFilters(Qt=>({...Qt,typeFeed:[]}))},Y=Qt=>{const{value:zn,checked:Yn}=Qt.target;e.setAdvancedFilters(Lt=>{let Fn=[...Lt.dexMarket];return zn==="all"?Fn=Yn?[...Be]:[]:Yn?Fn.push(zn):Fn=Fn.filter(Ee=>Ee!==zn),{...Lt,dexMarket:Fn}})},ie=()=>{e.setAdvancedFilters(Qt=>({...Qt,dexMarket:[]}))},oe=()=>{e.setSearchTagSellect([])},G=((Pt=e.selectTradeWalletData)==null?void 0:Pt.length)>0?o:e.walletTags,V=Qt=>{const{value:zn,checked:Yn}=Qt.target;e.setSearchTagSellect(Lt=>{let Fn=[...Lt];return zn==="all"?Fn=Yn?G==null?void 0:G.map(Ee=>Ee.tag):[]:Yn?Fn==null||Fn.push(zn):Fn=Fn==null?void 0:Fn.filter(Ee=>Ee!==zn),Fn})},ee=Qt=>{e.setAdvancedFilters(zn=>({...zn,directionFeed:Qt})),R(!1)},ae=()=>{e.setAdvancedFilters(Qt=>({...Qt,directionFeed:""})),R(!1)},fe=()=>{e.setSelectTradeWalletData([])},[Ae,ce]=m.useState(!1),ye=async Qt=>{const{value:zn,checked:Yn}=Qt.target;let Lt;e.setSelectTradeWalletData(Fn=>{var Ee;return zn==="all"?Lt=Yn?(Ee=e.tradeWalletData)==null?void 0:Ee.map(p=>p.wallet):[]:(Lt=Yn?[...Fn,zn]:Fn==null?void 0:Fn.filter(p=>p!==zn),!Yn&&Fn.includes("all")&&(Lt=Lt==null?void 0:Lt.filter(p=>p!=="all"))),Lt}),e.setSearchTagSellect([]),setTimeout(async()=>{var Fn;if((Lt==null?void 0:Lt.length)!==0)try{ce(!0);const Ee=window.localStorage.getItem("hyperToken");if(!Ee){setSignModalOpen(!0);return}const h=await fetch("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed/tag_list/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:a,token:Ee,trader_wallets:Lt})});if(!h.ok)throw new Error(`Server responded with status ${h.status}`);const S=await h.json();if(S.success){const _=(Fn=S==null?void 0:S.data)==null?void 0:Fn.map(k=>({tag:k==null?void 0:k.tag,wallet:k==null?void 0:k.wallet_address}));l(_),ce(!1)}else console.log(S.error_message),ce(!1)}catch(Ee){console.log("Error :>> ",Ee),ce(!1)}},0)},Ne={control:(Qt,{isFocused:zn})=>{var Yn,Lt,Fn,Ee;return{...Qt,display:"flex",alignItems:"center",paddingLeft:"21px",backgroundColor:"#353535",minHeight:"32px",maxHeight:"32px",minWidth:"244px",maxWidth:"244px",border:((Lt=(Yn=e.advancedFilters)==null?void 0:Yn.coinFeed)==null?void 0:Lt.length)>0?"1px solid #8d67ff":"none",boxShadow:"none",borderRadius:"6px",":hover":{border:((Ee=(Fn=e.advancedFilters)==null?void 0:Fn.coinFeed)==null?void 0:Ee.length)>0?"1px solid #8d67ff":"none"}}},menu:Qt=>({...Qt,backgroundColor:"#353535",maxWidth:"244px"}),menuList:Qt=>({...Qt,backgroundColor:"#353535",maxHeight:"180px",zIndex:4}),clearIndicator:Qt=>({...Qt,color:"#b3b3b3",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",padding:"0px",paddingRight:"5px",":hover":{color:"white"}}),dropdownIndicator:Qt=>({...Qt,color:"#b3b3b3",cursor:"pointer",alignItems:"center",justifyContent:"center",width:"25px",height:"25px",minWidth:"25px",minHeight:"25px",padding:"0px",paddingRight:"5px",paddingLeft:"5px",display:"none",":hover":{color:"white"}}),indicatorSeparator:()=>({display:"none"}),option:(Qt,{data:zn,isDisabled:Yn,isFocused:Lt,isSelected:Fn})=>{const Ee=di(zn.color);return{...Qt,fontSize:"14px",fontWeight:"600",backgroundColor:Yn?void 0:Fn?zn.color:Lt?Ee.alpha(.1).css():void 0,color:"white",cursor:Yn?"not-allowed":"pointer",":active":{...Qt[":active"],backgroundColor:Yn?void 0:Fn?zn.color:Ee.alpha(.9).css()}}},multiValue:(Qt,{data:zn})=>{const Yn=di(zn.color);return{...Qt,backgroundColor:Yn.alpha(.4).css()}},multiValueLabel:(Qt,{data:zn})=>({...Qt,color:"white"}),multiValueRemove:(Qt,{data:zn})=>({...Qt,color:"white",":hover":{backgroundColor:"rgba(255, 255, 255, 0.3)",color:"white"}}),input:Qt=>({...Qt,color:"white"}),valueContainer:Qt=>({...Qt,paddingTop:"0px",fontSize:"14px",fontWeight:"600"})},be=(Qt,zn)=>{var Lt;const Yn=(Lt=zn.selectedCoins)==null?void 0:Lt.filter(Fn=>Fn.value!==Qt.value);Yn.map(Fn=>Fn.value).join(","),zn.setSelectedCoins(Yn),zn.setAdvancedFilters(Fn=>({...Fn,coinFeed:Yn==null?void 0:Yn.map(Ee=>Ee.value)}))};m.useEffect(()=>{const Qt=zn=>{r.current&&!r.current.contains(zn.target)&&n(!1)};return document.addEventListener("mousedown",Qt),()=>{document.removeEventListener("mousedown",Qt)}},[]);const je=["Open Position","Increase","Decrease","Changed Position","Position Closed","Other"],Ie=(Xe=e.advancedFilters.positionFeed)==null?void 0:Xe.length,Re=je.length,Qe=["Open Position","Increase","Decrease","Changed Position","Position Closed","Spot","Twaps"],Be=["HyperLiquid","Lighter"],it=(Vt=e.advancedFilters.typeFeed)==null?void 0:Vt.length,tt=Qe.length,at=(Yt=e.advancedFilters.dexMarket)==null?void 0:Yt.length,dt=Be.length,ct=(Ve=e.searchTagSellect)==null?void 0:Ve.length,Ut=G==null?void 0:G.length,kt=(Ke=e.selectTradeWalletData)==null?void 0:Ke.length,tn=(ft=e.tradeWalletData)==null?void 0:ft.length,jt=["Long","Short"],un=({src:Qt,alt:zn})=>{const[Yn,Lt]=Se.useState(!1);return Yn?i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 mr-1 bg-[#4F4F4F] flex items-center justify-center",children:i.jsx("span",{className:"text-white text-xs"})}):i.jsx("img",{src:Qt,alt:zn,className:"rounded-full w-4 h-4 min-w-4 min-h-4 mr-1",loading:"lazy",onError:()=>Lt(!0)})},cn=Qt=>{const{data:zn,innerRef:Yn,innerProps:Lt,selectProps:Fn}=Qt,Ee=Fn.styles.option({},Qt);return i.jsxs("div",{ref:Yn,...Lt,style:Ee,className:"flex items-center p-2",children:[i.jsx(un,{src:zn.icon,alt:zn.label}),zn.label]})};return i.jsxs("div",{className:"text-white flex flex-wrap justify-center font-manrope gap-4 pt-2",children:[i.jsxs("div",{className:"col-span-1 flex flex-col gap-[13px] justify-start w-full max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"DEX"}),i.jsx("div",{onClick:ie,className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"relative w-full max-w-[244px]",children:[i.jsxs("div",{className:`${at>0?"border border-[#8d67ff]":""} flex justify-between items-center bg-[#353535] text-white rounded-md py-3 px-2.5 cursor-pointer select-none h-8`,onClick:L,children:[i.jsx("span",{className:`${at>0?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:at>0?`${at} of ${dt} selected`:"Select Dex"}),i.jsx(zh,{className:`w-3.5 h-3.5 transition ${g?"rotate-180":""}`})]}),g&&i.jsx("div",{className:"w-full bg-[#353535] rounded-md mt-[2px] p-1 transition-all duration-200",children:i.jsxs("div",{className:"max-h-[260px] overflow-y-auto",children:[i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:"all",checked:((Dt=(en=e.advancedFilters)==null?void 0:en.dexMarket)==null?void 0:Dt.length)===Be.length,onChange:Y,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${((Je=(At=e.advancedFilters)==null?void 0:At.dexMarket)==null?void 0:Je.length)===Be.length?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((Rt=(He=e.advancedFilters)==null?void 0:He.dexMarket)==null?void 0:Rt.length)===(Be==null?void 0:Be.length)&&i.jsx("img",{src:Wc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),"All"]}),i.jsx("div",{className:"h-[2px] w-full bg-[#404040]"}),Be==null?void 0:Be.map((Qt,zn)=>{var Yn,Lt,Fn,Ee,p,h;return i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:Qt,checked:(Lt=(Yn=e.advancedFilters)==null?void 0:Yn.dexMarket)==null?void 0:Lt.includes(Qt),onChange:Y,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${(Ee=(Fn=e.advancedFilters)==null?void 0:Fn.dexMarket)!=null&&Ee.includes(Qt)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((h=(p=e.advancedFilters)==null?void 0:p.dexMarket)==null?void 0:h.includes(Qt))&&i.jsx("img",{src:Wc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),Qt==="HyperLiquid"?i.jsx("img",{src:ax,alt:"hyper",className:"w-4 h-4 rounded-sm"}):Qt==="Lighter"?i.jsx(Hf,{className:"w-4 h-4 text-[#fff]"}):null,Qt]},zn)})]})})]})]}),i.jsxs("div",{className:"col-span-1 flex flex-col gap-[13px] justify-start w-full max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Follower Wallet"}),i.jsx("div",{onClick:fe,className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"relative w-full max-w-[244px]",children:[i.jsxs("div",{className:`${kt>0?"border border-[#8d67ff]":""} flex justify-between items-center bg-[#353535] text-white rounded-md py-3 px-2.5 cursor-pointer select-none h-8`,onClick:X,children:[i.jsx("span",{className:`${kt>0?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:kt>0?`${kt} of ${tn} selected`:"Select Wallet"}),i.jsx(zh,{className:`w-3.5 h-3.5 transition ${N?"rotate-180":""}`})]}),N&&i.jsx("div",{className:"w-full bg-[#353535] rounded-md mt-[2px] p-1 transition-all duration-200",children:i.jsxs("div",{className:"max-h-40 overflow-y-auto scrollbar-custom-scrollbar-dark",children:[i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:"all",checked:((qe=e.selectTradeWalletData)==null?void 0:qe.length)===((lt=e.tradeWalletData)==null?void 0:lt.length),onChange:ye,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${((xt=e.selectTradeWalletData)==null?void 0:xt.length)===((Nt=e.tradeWalletData)==null?void 0:Nt.length)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((It=e.selectTradeWalletData)==null?void 0:It.length)===((xn=e.tradeWalletData)==null?void 0:xn.length)&&i.jsx("img",{src:Wc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),"All"]}),i.jsx("div",{className:"h-[2px] w-full bg-[#404040]"}),e.isWalletLoading?i.jsx("span",{className:"text-[#7c7c7c] text-center py-2 text-sm font-semibold font-manrope leading-[8px]",children:'"Loading..."'}):(dn=e.tradeWalletData)==null?void 0:dn.map((Qt,zn)=>{var Yn,Lt,Fn,Ee,p,h,S;return i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:Qt==null?void 0:Qt.wallet,checked:(Yn=e.selectTradeWalletData)==null?void 0:Yn.includes(Qt==null?void 0:Qt.wallet),onChange:ye,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${(Lt=e.selectTradeWalletData)!=null&&Lt.includes(Qt==null?void 0:Qt.wallet)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((Fn=e.selectTradeWalletData)==null?void 0:Fn.includes(Qt==null?void 0:Qt.wallet))&&i.jsx("img",{src:Wc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),((Ee=Qt==null?void 0:Qt.wallet)==null?void 0:Ee.slice(0,5))+"..."+((p=Qt==null?void 0:Qt.wallet)==null?void 0:p.slice(-4)),` (${((h=Qt==null?void 0:Qt.name)==null?void 0:h.length)>10?((S=Qt==null?void 0:Qt.name)==null?void 0:S.slice(0,10))+"...":Qt==null?void 0:Qt.name})`]},zn)})]})})]})]}),i.jsxs("div",{className:"col-span-1 flex flex-col gap-[13px] justify-start w-full max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Source Wallet"}),i.jsx("div",{onClick:oe,className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"relative w-full max-w-[244px]",children:[i.jsxs("div",{className:`${ct>0?"border border-[#8d67ff]":""} flex justify-between items-center bg-[#353535] text-white rounded-md py-3 px-2.5 cursor-pointer select-none h-8`,onClick:z,children:[i.jsx("span",{className:`${ct>0?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:ct>0?`${ct} of ${Ut} selected`:"Select Wallet"}),i.jsx(zh,{className:`w-3.5 h-3.5 transition ${w?"rotate-180":""}`})]}),w&&i.jsx("div",{className:"w-full bg-[#353535] rounded-md mt-[2px] p-1 transition-all duration-200",children:Ae?i.jsx("p",{className:"text-[#7c7c7c] text-center py-2 text-sm font-semibold font-manrope leading-[8px]",children:"Loading..."}):i.jsxs("div",{className:"max-h-40 overflow-y-auto scrollbar-custom-scrollbar-dark",children:[i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope",children:[i.jsx("input",{type:"checkbox",value:"all",checked:((Mn=e.searchTagSellect)==null?void 0:Mn.length)===(G==null?void 0:G.length),onChange:V,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${((_n=e.searchTagSellect)==null?void 0:_n.length)===(G==null?void 0:G.length)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((kn=e.searchTagSellect)==null?void 0:kn.length)===(G==null?void 0:G.length)&&i.jsx("img",{src:Wc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),"All"]}),i.jsx("div",{className:"h-[2px] w-full bg-[#404040]"}),G==null?void 0:G.map((Qt,zn)=>{var Yn,Lt,Fn,Ee,p,h;return i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope",children:[i.jsx("input",{type:"checkbox",value:Qt==null?void 0:Qt.tag,checked:(Yn=e.searchTagSellect)==null?void 0:Yn.includes(Qt==null?void 0:Qt.tag),onChange:V,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${(Lt=e.searchTagSellect)!=null&&Lt.includes(Qt==null?void 0:Qt.tag)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((Fn=e.searchTagSellect)==null?void 0:Fn.includes(Qt==null?void 0:Qt.tag))&&i.jsx("img",{src:Wc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),(Qt==null?void 0:Qt.wallet)&&((Ee=Qt==null?void 0:Qt.wallet)==null?void 0:Ee.slice(0,5))+"..."+((p=Qt==null?void 0:Qt.wallet)==null?void 0:p.slice(-4))," ",Qt!=null&&Qt.tag&&(Qt==null?void 0:Qt.tag.length)>10?`(${(h=Qt==null?void 0:Qt.tag)==null?void 0:h.slice(0,10)}...)`:`(${Qt==null?void 0:Qt.tag})`]},zn)})]})})]})]}),i.jsxs("div",{className:"col-span-1 flex flex-col gap-[7px] justify-start max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("div",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Search Coin"}),i.jsx("div",{onClick:()=>{e.setSelectedCoins([]),e.setAdvancedFilters(Qt=>({...Qt,coinFeed:""}))},className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear Coins"})})]}),i.jsx("div",{className:"float-left w-full",ref:r,children:i.jsxs("div",{className:"min-w-full relative",children:[i.jsx(Ny,{className:"text-[#646464] absolute left-[6px] top-[6px] z-10"}),i.jsx(Zl,{closeMenuOnSelect:!1,value:[],isMulti:!0,options:e.dataCoin.filter(Qt=>Array.isArray(e.selectedCoins)&&!e.selectedCoins.some(zn=>zn.value===Qt.value)),components:{Option:cn},styles:Ne,onChange:c,menuIsOpen:t,onMenuOpen:()=>n(!0),placeholder:e.isLoadingCoin?i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Loading..."}):i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Search Coin"}),noOptionsMessage:()=>e.isLoadingCoin?i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"Loading..."}):i.jsx("span",{className:"text-[#7e7e7e] text-sm font-medium font-inter leading-[8px]",children:"No data available"})}),i.jsx("div",{className:`absolute top-[220px] z-[4] left-0 w-full max-w-[244px] bg-[#303030] flex flex-wrap gap-1 p-1 border border-[#3a3a3a] mt-1 ${t?"block":"hidden"} ${t&&((vn=e.selectedCoins)==null?void 0:vn.length)>0?"block":"hidden"}`,children:e.selectedCoins&&((Qn=e.selectedCoins)==null?void 0:Qn.map(Qt=>i.jsxs("div",{className:"h-6 pl-1.5 rounded-md border border-[#3a3a3a] justify-start items-center gap-0.5 flex",children:[i.jsx(un,{src:Qt==null?void 0:Qt.icon,alt:Qt==null?void 0:Qt.value}),i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] py-1 min-w-max",children:Qt.label}),i.jsx("div",{onClick:zn=>{zn.stopPropagation(),be(Qt,e)},className:"cursor-pointer group w-full h-full flex justify-center items-center pr-1.5 py-1",children:i.jsx(Jv,{className:"group-hover:text-[#cdcdcd] text-[#7C7C7C] w-[5.66px] h-[5.66px] min-w-[5.66px] min-h-[5.66px]"})})]},Qt.value)))}),i.jsx("div",{className:`${((Hn=e.selectedCoins)==null?void 0:Hn.length)>0?"mt-2.5":""} flex flex-wrap gap-1 max-w-[244px]`,children:e.selectedCoins&&(($n=e.selectedCoins)==null?void 0:$n.map(Qt=>i.jsxs("div",{className:"h-6 pl-1.5 rounded-md border border-[#3a3a3a] justify-start items-center gap-0.5 flex ",children:[i.jsx(un,{src:Qt==null?void 0:Qt.icon,alt:Qt==null?void 0:Qt.value}),i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] py-1 min-w-max",children:Qt.label}),i.jsx("div",{onClick:()=>be(Qt,e),className:"cursor-pointer group  w-full h-full flex justify-center items-center pr-1.5 py-1",children:i.jsx(Jv,{className:"group-hover:text-[#cdcdcd] text-[#7C7C7C] w-[5.66px] h-[5.66px] min-w-[5.66px] min-h-[5.66px]"})})]},Qt.value)))})]})})]}),i.jsxs("div",{className:"col-span-1 flex flex-col gap-[13px] justify-start w-full max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Source Wallet Type"}),i.jsx("div",{onClick:he,className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"relative w-full max-w-[244px]",children:[i.jsxs("div",{className:`${it>0?"border border-[#8d67ff]":""} flex justify-between items-center bg-[#353535] text-white rounded-md py-3 px-2.5 cursor-pointer select-none h-8`,onClick:U,children:[i.jsx("span",{className:`${it>0?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:it>0?`${it} of ${tt} selected`:"Select Type"}),i.jsx(zh,{className:`w-3.5 h-3.5 transition ${f?"rotate-180":""}`})]}),f&&i.jsx("div",{className:"w-full bg-[#353535] rounded-md mt-[2px] p-1 transition-all duration-200",children:i.jsxs("div",{className:"max-h-[260px] overflow-y-auto",children:[i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:"all",checked:((Nn=(Jn=e.advancedFilters)==null?void 0:Jn.typeFeed)==null?void 0:Nn.length)===Qe.length,onChange:re,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${((Oe=(ln=e.advancedFilters)==null?void 0:ln.typeFeed)==null?void 0:Oe.length)===Qe.length?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((fn=(sn=e.advancedFilters)==null?void 0:sn.typeFeed)==null?void 0:fn.length)===(Qe==null?void 0:Qe.length)&&i.jsx("img",{src:Wc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),"All"]}),i.jsx("div",{className:"h-[2px] w-full bg-[#404040]"}),Qe==null?void 0:Qe.map((Qt,zn)=>{var Yn,Lt,Fn,Ee,p,h;return i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:Qt,checked:(Lt=(Yn=e.advancedFilters)==null?void 0:Yn.typeFeed)==null?void 0:Lt.includes(Qt),onChange:re,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${(Ee=(Fn=e.advancedFilters)==null?void 0:Fn.typeFeed)!=null&&Ee.includes(Qt)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((h=(p=e.advancedFilters)==null?void 0:p.typeFeed)==null?void 0:h.includes(Qt))&&i.jsx("img",{src:Wc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),Qt]},zn)})]})})]})]}),i.jsxs("div",{className:"col-span-1 flex flex-col gap-[13px] justify-start w-full max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Follower Wallet Status"}),i.jsx("div",{onClick:Z,className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"relative w-full max-w-[244px]",children:[i.jsxs("div",{className:`${Ie>0?"border border-[#8d67ff]":""} flex justify-between items-center bg-[#353535] text-white rounded-md py-3 px-2.5 cursor-pointer select-none h-8`,onClick:F,children:[i.jsx("span",{className:`${Ie>0?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:Ie>0?`${Ie} of ${Re} selected`:"Select Status"}),i.jsx(zh,{className:`w-3.5 h-3.5 transition ${u?"rotate-180":""}`})]}),u&&i.jsx("div",{className:"w-full bg-[#353535] rounded-md mt-[2px] p-1 transition-all duration-200",children:i.jsxs("div",{className:"max-h-[228px] overflow-y-auto",children:[i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:"all",checked:((Kn=(Et=e.advancedFilters)==null?void 0:Et.positionFeed)==null?void 0:Kn.length)===(je==null?void 0:je.length),onChange:J,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${((Bt=(Cn=e.advancedFilters)==null?void 0:Cn.positionFeed)==null?void 0:Bt.length)===(je==null?void 0:je.length)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((Pn=(an=e.advancedFilters)==null?void 0:an.positionFeed)==null?void 0:Pn.length)===(je==null?void 0:je.length)&&i.jsx("img",{src:Wc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),"All"]}),i.jsx("div",{className:"h-[2px] w-full bg-[#404040]"}),je==null?void 0:je.map((Qt,zn)=>{var Yn,Lt,Fn,Ee,p,h;return i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope leading-[8px]",children:[i.jsx("input",{type:"checkbox",value:Qt,checked:(Lt=(Yn=e.advancedFilters)==null?void 0:Yn.positionFeed)==null?void 0:Lt.includes(Qt),onChange:J,className:"hidden"}),i.jsx("div",{className:`w-4 h-4 flex items-center justify-center border ${(Ee=(Fn=e.advancedFilters)==null?void 0:Fn.positionFeed)!=null&&Ee.includes(Qt)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:((h=(p=e.advancedFilters)==null?void 0:p.positionFeed)==null?void 0:h.includes(Qt))&&i.jsx("img",{src:Wc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),Qt==="Other"?"System Message":Qt]},zn)})]})})]})]}),i.jsxs("div",{className:"col-span-1 flex flex-col gap-[13px] justify-start w-full max-w-full z-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px]",children:"Direction"}),i.jsx("div",{onClick:ae,className:"h-5 px-2 py-1.5 rounded-md border border-[#353535] justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear"})})]}),i.jsxs("div",{className:"relative w-full max-w-[244px]",children:[i.jsxs("div",{className:`${(qn=e.advancedFilters)!=null&&qn.directionFeed?"border border-[#8d67ff]":""} flex justify-between items-center bg-[#353535] text-white rounded-md py-3 px-2.5 cursor-pointer select-none h-8`,onClick:ne,children:[i.jsx("span",{className:`${(nr=e.advancedFilters)!=null&&nr.directionFeed?"text-white":"text-[#7c7c7c]"} text-sm font-semibold font-manrope leading-[8px]`,children:((tr=e.advancedFilters)==null?void 0:tr.directionFeed)||"Select Direction"}),i.jsx(zh,{className:`w-3.5 h-3.5 transition ${P?"rotate-180":""}`})]}),P&&i.jsx("div",{className:"w-full bg-[#353535] rounded-md mt-[2px] p-1 transition-all duration-200",children:i.jsx("div",{className:"max-h-40 overflow-y-auto",children:jt==null?void 0:jt.map((Qt,zn)=>i.jsx("div",{onClick:()=>ee(Qt),className:"flex items-center gap-2 p-[7px] h-8 relative rounded hover:bg-[#464646] cursor-pointer text-white text-sm font-semibold font-manrope",children:Qt},zn))})})]})]})]})}const Kin=({advancedFilters:e,setAdvancedFilters:t,getFeedClearData:n,getFeedData:r,dataCoin:s,selectedCoins:a,setSelectedCoins:o,isLoadingCoin:l,setIsLoadingCoin:c,walletTagData:u,walletTags:d,searchWalletSellect:f,setSearchWalletSellect:x,walletTagLoading:g,tradeWalletData:v,selectTradeWalletData:w,setSelectTradeWalletData:C,searchTagSellect:N,setSearchTagSellect:I,isWalletLoading:P})=>i.jsxs("div",{className:"bg-[#232323] rounded-2xl min-h-[380px] min-w-max lg:min-w-[286px] max-w-[286px] p-1 py-3 font-manrope overflow-hidden relative h-[calc(100vh-236px)] mt-4",children:[i.jsxs("div",{className:"w-full flex justify-between items-center pt-[2px] pl-4 pr-1 pb-[10px]",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[8px]",children:"Filters"}),i.jsx("div",{onClick:()=>{n()},className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex mr-3 cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("div",{className:"h-full w-full overflow-y-scroll font-manrope py-1 pl-4 pr-3",children:i.jsx("div",{className:"font-manrope font-normal pb-[120px] sm:pb-[80px] max-w-[256px]",children:i.jsx(Gin,{advancedFilters:e,setAdvancedFilters:t,dataCoin:s,selectedCoins:a,setSelectedCoins:o,isLoadingCoin:l,setIsLoadingCoin:c,walletTagData:u,searchWalletSellect:f,setSearchWalletSellect:x,walletTagLoading:g,tradeWalletData:v,selectTradeWalletData:w,setSelectTradeWalletData:C,searchTagSellect:N,setSearchTagSellect:I,walletTags:d,isWalletLoading:P})})}),i.jsx("div",{className:"absolute bottom-0 w-full",children:i.jsx("div",{className:"sticky h-12 bg-[#1b1b1b]/30 rounded-bl-2xl rounded-br-2xl border-t border-[#353535] backdrop-blur-[32px] min-h-14 pt-[11px] w-full z-10",children:i.jsx("div",{className:"flex justify-center -ml-3",children:i.jsx("div",{onClick:()=>r(),className:"w-[234px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] pointer-events-none",children:"Apply Filters"})})})})})]});var Yin={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function Xin(e){if(typeof e=="number")return{value:e,unit:"px"};var t,n=(e.match(/^[0-9.]*/)||"").toString();n.includes(".")?t=parseFloat(n):t=parseInt(n,10);var r=(e.match(/[^0-9]*$/)||"").toString();return Yin[r]?{value:t,unit:r}:(console.warn("React Spinners: ".concat(e," is not a valid css value. Defaulting to ").concat(t,"px.")),{value:t,unit:"px"})}function iw(e){var t=Xin(e);return"".concat(t.value).concat(t.unit)}var Pne=function(e,t,n){var r="react-spinners-".concat(e,"-").concat(n);if(typeof window>"u"||!window.document)return r;var s=document.createElement("style");document.head.appendChild(s);var a=s.sheet,o=`
    @keyframes `.concat(r,` {
      `).concat(t,`
    }
  `);return a&&a.insertRule(o,0),r},VL=function(){return VL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},VL.apply(this,arguments)},Qin=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n},Zin=Pne("BeatLoader","50% {transform: scale(0.75);opacity: 0.2} 100% {transform: scale(1);opacity: 1}","beat");function qUe(e){var t=e.loading,n=t===void 0?!0:t,r=e.color,s=r===void 0?"#000000":r,a=e.speedMultiplier,o=a===void 0?1:a,l=e.cssOverride,c=l===void 0?{}:l,u=e.size,d=u===void 0?15:u,f=e.margin,x=f===void 0?2:f,g=Qin(e,["loading","color","speedMultiplier","cssOverride","size","margin"]),v=VL({display:"inherit"},c),w=function(C){return{display:"inline-block",backgroundColor:s,width:iw(d),height:iw(d),margin:iw(x),borderRadius:"100%",animation:"".concat(Zin," ").concat(.7/o,"s ").concat(C%2?"0s":"".concat(.35/o,"s")," infinite linear"),animationFillMode:"both"}};return n?m.createElement("span",VL({style:v},g),m.createElement("span",{style:w(1)}),m.createElement("span",{style:w(2)}),m.createElement("span",{style:w(3)})):null}var WL=function(){return WL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},WL.apply(this,arguments)},Jin=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n},jCe=[Pne("PuffLoader","0% {transform: scale(0)} 100% {transform: scale(1.0)}","puff-1"),Pne("PuffLoader","0% {opacity: 1} 100% {opacity: 0}","puff-2")];function GUe(e){var t=e.loading,n=t===void 0?!0:t,r=e.color,s=r===void 0?"#000000":r,a=e.speedMultiplier,o=a===void 0?1:a,l=e.cssOverride,c=l===void 0?{}:l,u=e.size,d=u===void 0?60:u,f=Jin(e,["loading","color","speedMultiplier","cssOverride","size"]),x=WL({display:"inherit",position:"relative",width:iw(d),height:iw(d)},c),g=function(v){return{position:"absolute",height:iw(d),width:iw(d),border:"thick solid ".concat(s),borderRadius:"50%",opacity:"1",top:"0",left:"0",animationFillMode:"both",animation:"".concat(jCe[0],", ").concat(jCe[1]),animationDuration:"".concat(2/o,"s"),animationIterationCount:"infinite",animationTimingFunction:"cubic-bezier(0.165, 0.84, 0.44, 1), cubic-bezier(0.3, 0.61, 0.355, 1)",animationDelay:v===1?"-1s":"0s"}};return n?m.createElement("span",WL({style:x},f),m.createElement("span",{style:g(1)}),m.createElement("span",{style:g(2)})):null}function ean({feedData:e}){var l,c;const[t,n]=m.useState(null);function r({date:u}){const[d,f]=m.useState(To(u));return m.useEffect(()=>{const x=setInterval(()=>{f(To(u))},1e3);return()=>clearInterval(x)},[u]),i.jsx("span",{className:"text-xs text-[#a5a5a5] font-normal",children:d.dateTime})}const s=u=>n(u),a=()=>n(null),o=u=>u?["Sell","Close Short","Open Short"].includes(u)||u.includes("Short")?"Short":["Buy","Close Long","Open Long"].includes(u)||u.includes("Long")?"Long":u:"-";return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex lg:hidden flex-col gap-3 w-full font-manrope font-semibold pb-2",children:[(!e||e.length===0)&&i.jsx("div",{className:"flex justify-center items-center w-full py-10",children:i.jsx(GUe,{color:"#ffffff",size:40})}),e==null?void 0:e.map((u,d)=>{var f,x,g,v,w,C;return i.jsxs("div",{children:[i.jsxs("div",{className:"w-full border-2 border-[#232323] rounded-tl-xl rounded-tr-xl p-3 flex items-start gap-3 cursor-pointer",onClick:()=>s(u),children:[i.jsxs("div",{className:"w-8 h-8 bg-[#6ed8ff] rounded-full flex items-center justify-center relative",children:[i.jsx("img",{src:Hi,alt:"",className:"w-6 h-6"}),(u==null?void 0:u.target_platform)==="hyper"?i.jsx("div",{className:"absolute top-12 flex justify-start items-center gap-2",children:i.jsx("img",{src:ax,alt:"hyper",className:"w-4 h-4 rounded-sm"})}):(u==null?void 0:u.target_platform)==="lighter"?i.jsx("div",{className:"absolute top-12 flex justify-start items-center gap-2",children:i.jsx(Hf,{className:"w-4 h-4 text-[#fff]"})}):""]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsxs("div",{className:"flex items-center gap-2 text-white text-sm font-semibold",children:[u!=null&&u.listen_user?u.listen_user.slice(0,5)+"..."+u.listen_user.slice(-4):"-",i.jsx("img",{src:bo,alt:"",className:"w-4 h-4 cursor-pointer",onClick:N=>{N.stopPropagation(),navigator.clipboard.writeText((u==null?void 0:u.listen_user)||""),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})}})]}),i.jsxs("div",{className:"flex flex-col text-xs text-[#a5a5a5]",children:[i.jsx("span",{children:eu(u==null?void 0:u.time)}),i.jsx(r,{date:u==null?void 0:u.time})]}),i.jsxs("div",{className:"text-xs font-semibold",children:[i.jsx("span",{className:"text-white",children:"Size:"})," ",u!=null&&u.sz?Er(u==null?void 0:u.sz):"-"]}),i.jsxs("div",{className:"text-xs font-semibold",children:[i.jsx("span",{className:"text-white",children:"Entry Price:"})," ",u!=null&&u.markPrice?"$"+Er(u==null?void 0:u.markPrice):"-"]}),i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${u==null?void 0:u.coin}.svg`||Ua,onError:N=>ea(N),alt:"",className:"w-5 h-5"}),i.jsxs("div",{className:"text-[13px] text-white font-bold",children:[u==null?void 0:u.coin,"/",(u==null?void 0:u.feeToken)||"USDC"]}),i.jsxs("div",{className:`${o(u==null?void 0:u.dir)==="Long"?"bg-[#67ffbd]/20 text-[#67ffbd]":o(u==null?void 0:u.dir)==="Short"?"bg-[#ff797c]/20 text-[#ff797c]":(u==null?void 0:u.dir)==="Buy"?"bg-[#67ffbd]/20 text-[#67ffbd]":(u==null?void 0:u.dir)==="Sell"?"bg-[#ff797c]/20 text-[#ff797c]":"bg-[#767676]/20 text-[#cccccc]"} h-5 pl-2 pr-2 py-1 rounded-md flex items-center gap-1 w-max`,children:[i.jsx("div",{className:"w-3 h-3",children:(f=u==null?void 0:u.dir)!=null&&f.includes("Long")?(u==null?void 0:u.dir)==="Short > Long"?i.jsx(Es,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):(u==null?void 0:u.dir)==="Long > Short"?i.jsx(Es,{className:"text-[#ff797c] w-3 h-3"}):i.jsx(Es,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):(u==null?void 0:u.dir)==="Buy"?i.jsx(Es,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):i.jsx(Es,{className:"text-[#ff797c] w-3 h-3"})}),i.jsxs("div",{className:"text-[11px] font-semibold",children:[(u==null?void 0:u.dir)||"-"," ",u!=null&&u.leverage?`${u.leverage}x`:""]})]})]})]})]}),i.jsx("div",{className:`${u!=null&&u.success?"bg-[#67ffbd]/20 border-[#67ffbd]/25":"bg-[#ff797c]/20 border-[#ff797c]/25"} flex justify-start items-center h-8 max-h-8  rounded-bl-[18px] rounded-br-[18px] border-t w-full py-1.5`,children:i.jsxs("div",{className:"text-white text-sm font-manrope leading-none flex justify-start items-center px-2 gap-2",children:[u!=null&&u.success?i.jsx("img",{src:hM,alt:""}):i.jsx("img",{src:pM,alt:""}),i.jsx("div",{className:`${u!=null&&u.success?"text-[#67ffbd]":"text-[#ff787b]"}  text-xs font-bold font-manrope leading-3 tracking-tight`,children:u!=null&&u.success?"Status:":"System Message:"}),i.jsx("div",{className:"text-white text-xs font-semibold font-manrope leading-3 tracking-tight -ml-1",children:u!=null&&u.success?((x=u==null?void 0:u.message)==null?void 0:x.split("-")[0])||"-":"For details, use web version"}),i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${u==null?void 0:u.trader_wallet}`,"_blank")},className:"h-[18px] px-1.5 py-1 bg-white rounded-[256px] justify-center items-center gap-0.5 inline-flex cursor-pointer -ml-0.5",children:i.jsx("div",{className:"w-14 text-center truncate overflow-hidden whitespace-nowrap text-[#273f35] text-xs font-semibold font-manrope leading-[13px]",children:u!=null&&u.wallet_name?u==null?void 0:u.wallet_name:u!=null&&u.trader_wallet?((g=u==null?void 0:u.trader_wallet)==null?void 0:g.slice(0,5))+"..."+((v=u==null?void 0:u.trader_wallet)==null?void 0:v.slice(-4)):"--"})}),i.jsxs("div",{className:"text-white text-xs font-semibold font-manrope leading-3 tracking-tight -ml-0.5",children:["by"," "]}),i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${u==null?void 0:u.listen_user}`,"_blank")},className:"h-[18px] px-1.5 py-1 bg-[#a5ffd8] rounded-[256px] justify-center items-center gap-0.5 inline-flex -ml-0.5 cursor-pointer",children:i.jsx("div",{className:"w-14 text-center truncate overflow-hidden whitespace-nowrap text-[#1e563e] text-xs font-semibold font-manrope leading-[13px]",children:u!=null&&u.tag?u==null?void 0:u.tag:u!=null&&u.listen_user?((w=u==null?void 0:u.listen_user)==null?void 0:w.slice(0,5))+"..."+((C=u==null?void 0:u.listen_user)==null?void 0:C.slice(-4)):"--"})})]})})]},d)})]}),t&&i.jsx(rp,{isOpen:!!t,onClose:a,children:i.jsxs("div",{className:"flex flex-col gap-4 p-2 font-manrope font-semibold",children:[i.jsxs("div",{className:"flex gap-2 items-center",children:[i.jsx("div",{className:"w-8 h-8 bg-[#6ed8ff] rounded-full flex items-center justify-center",children:i.jsx("img",{src:Hi,alt:"",className:"w-6 h-6"})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsxs("div",{className:"inline-flex items-center gap-2",children:[i.jsx("div",{className:"text-white text-sm font-semibold",children:t!=null&&t.listen_user?t.listen_user.slice(0,5)+"..."+t.listen_user.slice(-4):"-"}),i.jsx("span",{onClick:()=>{navigator.clipboard.writeText((t==null?void 0:t.listen_user)||"")},children:i.jsx("img",{src:bo,alt:"",className:"w-4 h-4 cursor-pointer",onClick:u=>{u.stopPropagation(),navigator.clipboard.writeText((t==null?void 0:t.listen_user)||"")}})})]}),i.jsxs("div",{className:"flex flex-col text-[11px] text-[#a5a5a5]",children:[i.jsx("span",{children:eu(t==null?void 0:t.time)}),i.jsx(r,{date:t==null?void 0:t.time})]})]})]}),i.jsxs("div",{className:"flex flex-col gap-2 text-sm text-[#9b9b9b]",children:[i.jsxs("div",{className:"text-white flex items-center gap-2",children:[i.jsx("img",{src:t!=null&&t.success?hM:pM,alt:"",className:"w-4 h-4"}),"Status: ",t!=null&&t.success?"Success":"Failed"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Order ID:"})," ",(t==null?void 0:t.oid)||"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Type:"})," ",(t==null?void 0:t.fill_direction_type)||"-"]}),i.jsxs("div",{className:"flex items-center gap-1 text-white",children:["Direction:",i.jsxs("div",{className:`${o(t==null?void 0:t.dir)==="Long"?"bg-[#67ffbd]/20 text-[#67ffbd]":o(t==null?void 0:t.dir)==="Short"?"bg-[#ff797c]/20 text-[#ff797c]":(t==null?void 0:t.dir)==="Buy"?"bg-[#67ffbd]/20 text-[#67ffbd]":(t==null?void 0:t.dir)==="Sell"?"bg-[#ff797c]/20 text-[#ff797c]":"bg-[#767676]/20 text-[#cccccc]"} h-5 pl-1 pr-1.5 py-1 rounded-md flex items-center gap-1`,children:[i.jsx("div",{className:"w-3 h-3",children:(l=t==null?void 0:t.dir)!=null&&l.includes("Long")?(t==null?void 0:t.dir)==="Short > Long"?i.jsx(Es,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):(t==null?void 0:t.dir)==="Long > Short"?i.jsx(Es,{className:"text-[#ff797c] w-3 h-3"}):i.jsx(Es,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):(t==null?void 0:t.dir)==="Buy"?i.jsx(Es,{className:"text-[#67ffbd] rotate-180 w-3 h-3"}):i.jsx(Es,{className:"text-[#ff797c] w-3 h-3"})}),i.jsxs("div",{className:"text-[11px] font-semibold",children:[(t==null?void 0:t.dir)||"-"," ",t!=null&&t.leverage?`${t.leverage}x`:""]})]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Price:"})," ",t!=null&&t.px?"$"+Er(t==null?void 0:t.px):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Size:"})," ",t!=null&&t.sz?Er(t==null?void 0:t.sz):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Entry Price:"})," ",t!=null&&t.markPrice?"$"+Er(t==null?void 0:t.markPrice):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"PnL:"})," ",t!=null&&t.closedPnl?"$"+Er(Math.abs(t==null?void 0:t.closedPnl)):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Fee:"})," ",t!=null&&t.fee?"$"+Er(Math.abs(t==null?void 0:t.fee)):"-"]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Margin Mode:"})," ",(t==null?void 0:t.is_cross)==null||t!=null&&t.is_cross?"Cross":"Isolated"]}),i.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${t==null?void 0:t.coin}.svg`||Ua,onError:u=>ea(u),alt:"",className:"w-5 h-5"}),i.jsxs("span",{className:"font-bold text-white",children:[t==null?void 0:t.coin,"/",(t==null?void 0:t.feeToken)||"USDC"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-white",children:"Message: "}),((c=t==null?void 0:t.message)==null?void 0:c.split("-")[0])||"-"]})]})]})})]})}const tan=()=>{var Yt;const{isConnected:e,address:t}=Yr(),{setSignModalOpen:n,copyTradeWatchList:r,hyperToken:s}=m.useContext(Gr),[a,o]=m.useState(!1),[l,c]=m.useState(!1),[u,d]=m.useState([]),f=m.useRef(null),[x,g]=m.useState(0),[v,w]=m.useState(!1),[C,N]=m.useState(!0),[I,P]=m.useState([]),[R,F]=m.useState(!0),[U,L]=m.useState([]),[z,X]=m.useState([]),[ne,J]=m.useState([]),[Z,re]=m.useState([]),[he,Y]=m.useState([]),[ie,oe]=m.useState(!1),[G,V]=m.useState([]),[ee,ae]=m.useState([]),Ae=localStorage.getItem("isDateCopyTradeFormat")||"date",[ce,ye]=m.useState(Ae),[Ne,be]=m.useState(!1);m.useEffect(()=>{localStorage.setItem("isDateCopyTradeFormat",ce)},[ce]),m.useEffect(()=>{(async()=>{var Ke,ft;try{const Dt=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_coins/")).json(),At=()=>di.random().hex(),Je=(ft=(Ke=Dt.coins)==null?void 0:Ke.filter(He=>!He.startsWith("@")&&!He.endsWith("/USDC")))==null?void 0:ft.map(He=>({value:He,label:He.endsWith("/USDC")?He+" (Spot)":He,icon:`https://app.hyperliquid.xyz/coins/${He}.svg`,color:At()}));P(Je),F(!1)}catch(en){console.error("Data extraction error:",en),F(!1)}})()},[]);const[je,Ie]=m.useState({userWalletFeed:"",coinFeed:"",positionFeed:[],directionFeed:"",statusFeed:"",typeFeed:"",dexMarket:[]});m.useEffect(()=>{const Ve=["Open Position","Increase","Decrease","Changed Position","Position Closed","Other"],Ke=localStorage.getItem("positionFeed"),ft=Ke&&Array.isArray(JSON.parse(Ke))?JSON.parse(Ke):Ve;Ie(en=>({...en,positionFeed:ft}))},[]);const Re=m.useRef(je);m.useEffect(()=>{Re.current=je},[je]);const Qe=async(Ve=!1)=>{var ft,en,Dt;g(0),w(!0),N(!0);const Ke=window.localStorage.getItem("hyperToken");try{o(!0),c(!0);const At=window.localStorage.getItem("hyperAddress");if(!Ke){n(!0);return}const Je={};(G==null?void 0:G.length)>0&&(Je.copy_trader=G),(ne==null?void 0:ne.length)>0&&(Je.trader=ne),(ee==null?void 0:ee.length)>0&&(Je.tag=ee),((ft=je==null?void 0:je.coinFeed)==null?void 0:ft.length)>0&&(Je.coin=je.coinFeed.includes(",")?je.coinFeed.split(",").map(_n=>_n.trim()):je.coinFeed);const He=localStorage.getItem("positionFeed"),Rt=Ve?He&&JSON.parse(He)||["Open Position","Increase","Decrease","Changed Position","Position Closed","Other"]:je.positionFeed;(Rt==null?void 0:Rt.length)>0&&(Rt==null?void 0:Rt.length)<6&&(Je.position=Rt),((en=je==null?void 0:je.typeFeed)==null?void 0:en.length)>0&&((Dt=je==null?void 0:je.typeFeed)==null?void 0:Dt.length)<7&&(Je.type=je.typeFeed),je!=null&&je.directionFeed&&(Je.direction=je.directionFeed),je!=null&&je.statusFeed&&(je.statusFeed==="On"?Je.status=!0:je.statusFeed==="Off"?Je.status=!1:je.statusFeed==="All"&&delete Je.status);const qe=((je==null?void 0:je.dexMarket)||[]).map(_n=>_n.toLowerCase()),lt=qe.includes("hyperliquid"),xt=qe.includes("lighter"),Nt=[];lt&&!xt?Nt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/"):xt&&!lt?Nt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/"):Nt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/","https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/");const It=await Promise.all(Nt.map(_n=>fetch(_n,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():At,token:Ke,offset:0,...Object.keys(Je).length&&{filters:Je}})}))),dn=(await Promise.all(It.map(_n=>_n.json()))).filter(_n=>_n.success&&Array.isArray(_n.data)).flatMap(_n=>_n.data).sort((_n,kn)=>new Date(kn.time)-new Date(_n.time));d(dn),g(_n=>_n+50),dn.length<50&&N(!1);const Mn=dn.map(_n=>({wallet:_n.trader_wallet,name:_n.wallet_name}));X(_n=>{const kn=new Map(_n.map(vn=>[vn.wallet,vn.name]));return Mn.forEach(vn=>{kn.has(vn.wallet)||kn.set(vn.wallet,vn.name)}),Array.from(kn,([vn,Qn])=>({wallet:vn,name:Qn}))})}catch(At){console.log("Error :>> ",At)}finally{o(!1),c(!1),w(!1)}},Be=async()=>{const Ve=window.localStorage.getItem("hyperToken");try{oe(!0);const Ke="https://dextrabothypev2.nftinit.io/api/hyper/trade/feed/tag_list/",ft=window.localStorage.getItem("hyperAddress");if(!Ve){n(!0);return}const en=await fetch(Ke,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():ft,token:Ve})});if(!en.ok)throw new Error(`Server responded with status ${en.status}`);const Dt=await en.json();if(Dt.success){re(Dt==null?void 0:Dt.data);const At=Dt==null?void 0:Dt.data.map(Je=>Je.tag?{tag:Je.tag,wallet:Je.wallet_address}:null).filter(Je=>Je!==null);Y(At)}else console.log(Dt.error_message)}catch(Ke){console.log("Error :>> ",Ke)}finally{oe(!1)}};m.useEffect(()=>{Qe(!0),Be()},[s]);const it=async()=>{g(0),w(!0),N(!0);const Ve=window.localStorage.getItem("hyperToken");try{o(!0);const Ke=window.localStorage.getItem("hyperAddress");if(!Ve){n(!0);return}const ft=((je==null?void 0:je.dexMarket)||[]).map(qe=>qe.toLowerCase()),en=ft.includes("hyperliquid"),Dt=ft.includes("lighter"),At=[];en&&!Dt?At.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/"):Dt&&!en?At.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/"):At.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/","https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/");const Je=await Promise.all(At.map(qe=>fetch(qe,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Ke,token:Ve,offset:0})}))),Rt=(await Promise.all(Je.map(qe=>qe.json()))).filter(qe=>qe.success&&Array.isArray(qe.data)).flatMap(qe=>qe.data).sort((qe,lt)=>new Date(lt.time)-new Date(qe.time));d(Rt),g(qe=>qe+50),Rt.length<50&&N(!1),localStorage.setItem("positionFeed",JSON.stringify([])),Ie({userWalletFeed:"",coinFeed:"",positionFeed:[],directionFeed:"",statusFeed:"",typeFeed:[],dexMarket:[]}),L([]),V([]),J([]),ae([])}catch(Ke){console.log("Error :>> ",Ke)}finally{o(!1),w(!1)}},tt=async()=>{var Ke,ft,en,Dt,At;if(v)return;w(!0);const Ve=window.localStorage.getItem("hyperToken");try{const Je=window.localStorage.getItem("hyperAddress");if(!Ve){n(!0);return}const He={};(G==null?void 0:G.length)>0&&(He.copy_trader=G),(ne==null?void 0:ne.length)>0&&(He.trader=ne),(ee==null?void 0:ee.length)>0&&(He.tag=ee),je!=null&&je.coinFeed&&((Ke=je==null?void 0:je.coinFeed)==null?void 0:Ke.length)>0&&(He.coin=je.coinFeed.includes(",")?je.coinFeed.split(",").map(Mn=>Mn.trim()):je.coinFeed),((ft=je==null?void 0:je.positionFeed)==null?void 0:ft.length)>0&&((en=je==null?void 0:je.positionFeed)==null?void 0:en.length)<6&&(He.position=je.positionFeed),((Dt=je==null?void 0:je.typeFeed)==null?void 0:Dt.length)>0&&((At=je==null?void 0:je.typeFeed)==null?void 0:At.length)<7&&(He.type=je.typeFeed),je!=null&&je.directionFeed&&(He.direction=je.directionFeed),je!=null&&je.statusFeed&&(je.statusFeed==="On"?He.status=!0:je.statusFeed==="Off"?He.status=!1:je.statusFeed==="All"&&delete He.status);const Rt=((je==null?void 0:je.dexMarket)||[]).map(Mn=>Mn.toLowerCase()),qe=Rt.includes("hyperliquid"),lt=Rt.includes("lighter"),xt=[];qe&&!lt?xt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/"):lt&&!qe?xt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/"):xt.push("https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new/","https://dextrabothypev2.nftinit.io/api/hyper/trade/feed_new_lg/");const Nt=await Promise.all(xt.map(Mn=>fetch(Mn,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Je,token:Ve,offset:x,...Object.keys(He).length&&{filters:He}})}))),xn=(await Promise.all(Nt.map(Mn=>Mn.json()))).filter(Mn=>Mn.success&&Array.isArray(Mn.data)).flatMap(Mn=>Mn.data).sort((Mn,_n)=>new Date(_n.time)-new Date(Mn.time));d(Mn=>[...Mn,...xn].sort((kn,vn)=>new Date(vn.time)-new Date(kn.time))),g(Mn=>Mn+50),xn.length<50&&N(!1);const dn=xn.map(Mn=>({wallet:Mn.trader_wallet,name:Mn.wallet_name}));X(Mn=>{const _n=new Set(Mn.map(vn=>vn.wallet)),kn=[...Mn];return dn.forEach(vn=>{_n.has(vn.wallet)||(_n.add(vn.wallet),kn.push(vn))}),kn})}catch(Je){console.log("Error :>> ",Je)}finally{w(!1)}},at=(Ve,Ke)=>{let ft;return function(...en){clearTimeout(ft),ft=setTimeout(()=>{Ve.apply(this,en)},Ke)}},dt=()=>{const Ve=f.current;Ve.scrollTop+Ve.clientHeight>=Ve.scrollHeight-10&&C&&!v&&tt()};m.useEffect(()=>{const Ve=at(dt,300),Ke=f.current;return Ke.addEventListener("scroll",Ve),()=>{Ke.removeEventListener("scroll",Ve)}},[x,C,v]);const ct=m.useRef(null),Ut=m.useRef(!1),kt=m.useRef(t),tn=m.useRef(r),jt=m.useRef(s);m.useEffect(()=>{kt.current=t},[t]),m.useEffect(()=>{tn.current=r},[r]),m.useEffect(()=>{jt.current=s},[s]);const un="hyper_get_trade_message";m.useEffect(()=>{if(!s||Ut.current)return;const Ve=vy("https://dextrabothypesocketv2.nftinit.io/");return ct.current=Ve,Ut.current=!0,Ve.on("connect",()=>{console.log("Socket connected");const Ke=()=>{var Dt;const ft=(Dt=kt.current)==null?void 0:Dt.toLowerCase(),en=jt.current;ft&&en?Ve.emit("subscribe",{login:ft,token:en}):setTimeout(Ke,300)};Ke()}),Ve.on(un,function(Ke){var Rt;const ft=Re.current,en=(Rt=(ft==null?void 0:ft.dexMarket)||[])==null?void 0:Rt.map(qe=>qe.toLowerCase()),Dt=en.includes("hyperliquid"),At=en.includes("lighter"),He=(Array.isArray(Ke)?Ke:[Ke]).filter(qe=>qe!=null&&qe.target_platform?Dt&&!At?qe.target_platform==="hyper":At&&!Dt?qe.target_platform==="lighter":!0:!1);d(qe=>{const lt=[...He,...qe],xt=Re.current;return lt==null?void 0:lt.filter(It=>{var xn,dn,Mn,_n,kn,vn,Qn,Hn,$n;if(!It||(G==null?void 0:G.length)>0&&!(G!=null&&G.includes((xn=It==null?void 0:It.listen_user)==null?void 0:xn.toLowerCase()))||(ne==null?void 0:ne.length)>0&&!(ne!=null&&ne.includes((dn=It==null?void 0:It.trader_wallet)==null?void 0:dn.toLowerCase()))||(ee==null?void 0:ee.length)>0&&!(ee!=null&&ee.includes(It==null?void 0:It.tag))||((Mn=xt.coinFeed)==null?void 0:Mn.length)>0&&!((_n=xt.coinFeed)!=null&&_n.includes(It==null?void 0:It.coin)))return!1;if(((kn=xt==null?void 0:xt.typeFeed)==null?void 0:kn.length)>0){const Nn=((vn=xt==null?void 0:xt.typeFeed)==null?void 0:vn.includes("Twaps"))&&(It==null?void 0:It.is_twap)===!0,ln=(It==null?void 0:It.fill_direction_type)&&((Qn=xt==null?void 0:xt.typeFeed)==null?void 0:Qn.includes(It==null?void 0:It.fill_direction_type));if(!(Nn||ln))return!1}if(((Hn=xt==null?void 0:xt.positionFeed)==null?void 0:Hn.length)>0){const Jn=Pt(It);if(!(($n=xt==null?void 0:xt.positionFeed)!=null&&$n.includes(Jn)))return!1}else return!0;return!(xt!=null&&xt.directionFeed&&cn(It)!==(xt==null?void 0:xt.directionFeed))})})}),Ve.io.on("reconnect_attempt",Ke=>{console.log("reconnect_attempt",Ke)}),Ve.io.on("reconnect",Ke=>{console.log("reconnect",Ke),Ve.emit("room",un)}),Ve.io.on("reconnect_failed",()=>{console.log("reconnect_failed")}),Ve.io.on("reconnect_error",Ke=>{console.log("reconnect_error",Ke)}),Ve.io.on("error",Ke=>{console.log("error",Ke)}),Ve.on("disconnect",()=>{console.log("Socket disconnected"),Ut.current=!1}),()=>{Ve.disconnect(),console.log("Socket cleanup on unmount")}},[s]);const cn=Ve=>Ve!=null&&Ve.dir?["Sell","Close Short","Open Short"].includes(Ve==null?void 0:Ve.dir)?"Short":["Buy","Close Long","Open Long"].includes(Ve==null?void 0:Ve.dir)?"Long":(Ve==null?void 0:Ve.dir)||"--":"--",Pt=Ve=>{var en,Dt;const Ke=(Dt=(en=Ve.message)==null?void 0:en.split("-")[0])==null?void 0:Dt.trim();if(!Ke)return"Other";const ft=/^Position Changed \(/;return Ke==="Close Position"?"Position Closed":Ke==="Position Increase"?"Increase":Ke==="Position Decreased"?"Decrease":ft.test(Ke)?"Changed Position":Ke==="Open Position"?"Open Position":"Other"};function Xe({date:Ve}){const[Ke,ft]=m.useState(To(Ve));return m.useEffect(()=>{const en=setInterval(()=>{ft(To(Ve))},1e3);return()=>clearInterval(en)},[Ve]),i.jsx("span",{className:"text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight",children:Ke.dateTime})}const Vt={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"lg:hidden flex flex-col w-full p-2",children:i.jsx("button",{className:"px-2 py-2 text-xs font-medium rounded border border-gray-600 text-white hover:bg-[#1D1D1D] w-full bg-[#171717]",onClick:()=>be(!Ne),children:Ne?"Hide Filters":"Show Filters"})}),i.jsx("div",{className:`${Ne?"block":"hidden"}  lg:block mx-auto`,children:i.jsx(Kin,{advancedFilters:je,setAdvancedFilters:Ie,getFeedData:Qe,getFeedClearData:it,dataCoin:I,selectedCoins:U,setSelectedCoins:L,isLoadingCoin:R,setIsLoadingCoin:F,walletTagData:Z,walletTags:he,searchWalletSellect:G,setSearchWalletSellect:V,walletTagLoading:ie,tradeWalletData:z,selectTradeWalletData:ne,setSelectTradeWalletData:J,searchTagSellect:ee,setSearchTagSellect:ae,isWalletLoading:l})}),i.jsx(ean,{feedData:u}),i.jsx("div",{ref:f,className:"hidden lg:flex flex-col items-start justify-start mt-4 overflow-scroll xl:min-w-max max-h-[calc(100%-50px)]",children:!u||(u==null?void 0:u.length)==0||a?i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[72vh] w-[100%] sm:w-[75%] min-w-[970px] justify-center items-center text-center",children:a?i.jsx(Ma,{}):i.jsx("div",{className:"flex justify-center items-center min-w-[480px]",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 min-w-max overflow-x-hidden",children:[i.jsx("img",{src:ec,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"The activities of the follower wallets will be displayed on this page."}),i.jsx("div",{className:"text-center -mt-2",children:i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["Feed page includes the activities occur after a wallet is favorited."," "]})})]})]})})})}):i.jsx("ul",{className:"flex flex-col items-start justify-start gap-1",children:Array.isArray(u)&&u.length>0&&((Yt=u==null?void 0:u.map)==null?void 0:Yt.call(u,(Ve,Ke)=>{var ft,en,Dt,At,Je,He,Rt,qe,lt,xt,Nt,It,xn,dn,Mn,_n;return i.jsx("li",{children:i.jsxs("div",{className:"flex justify-start items-start gap-[11px]",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start h-full",children:[i.jsx("div",{className:`${(ft=Ve==null?void 0:Ve.dir)!=null&&ft.includes("Long")?(Ve==null?void 0:Ve.dir)==="Short > Long"?"bg-[#67ffbd]/20":(Ve==null?void 0:Ve.dir)==="Long > Short"?"bg-[#ff797c]/20":"bg-[#67ffbd]/20":(Ve==null?void 0:Ve.dir)=="Buy"?"bg-[#67ffbd]/20":"bg-[#ff797c]/20"} flex justify-center items-center w-6 h-6  rounded-full`,children:i.jsx("div",{className:"w-3 h-3 relative",children:(en=Ve==null?void 0:Ve.dir)!=null&&en.includes("Long")?(Ve==null?void 0:Ve.dir)==="Short > Long"?i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(Ve==null?void 0:Ve.dir)==="Long > Short"?i.jsx(Es,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(Ve==null?void 0:Ve.dir)=="Buy"?i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Es,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsx("div",{className:"flex justify-center w-6",children:i.jsx("div",{className:"w-[1px] min-h-[163px] h-full border border-[#242424]"})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-[6px] w-full min-w-max  h-[176px] min-h-[176px] rounded-[18px] border border-[#232323]",children:[i.jsxs("div",{className:"flex justify-between items-center gap-2 w-full px-3 py-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("div",{className:"w-8 h-8 bg-[#6ed8ff] rounded-full relative",children:i.jsx("img",{src:Hi,alt:"",className:"w-8 h-8"})}),(Ve==null?void 0:Ve.target_platform)==="hyper"?i.jsxs("div",{className:"flex justify-start items-center gap-2 min-w-max",children:[i.jsx("img",{src:ax,alt:"hyper",className:"w-4 h-4 rounded-sm"}),i.jsx("span",{className:"text-white text-[13px] font-normal font-['Manrope'] leading-[13px] tracking-tight",children:"Hyperliquid"})]}):(Ve==null?void 0:Ve.target_platform)==="lighter"?i.jsxs("div",{className:"flex justify-start items-center gap-2 min-w-max",children:[i.jsx(Hf,{className:"w-4 h-4 text-[#fff]"}),i.jsx("span",{className:"text-white text-[13px] font-normal font-['Manrope'] leading-[13px] tracking-tight",children:"Lighter"})]}):""]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[2px]",children:[i.jsxs("div",{onClick:()=>{window.open(`/wallet-details/${Ve==null?void 0:Ve.listen_user}`,"_blank")},className:"flex justify-start items-center gap-1.5 cursor-pointer",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-none ",children:(Ve==null?void 0:Ve.listen_user)&&((Dt=Ve==null?void 0:Ve.listen_user)==null?void 0:Dt.slice(0,5))+"..."+((At=Ve==null?void 0:Ve.listen_user)==null?void 0:At.slice(-4))}),i.jsx("img",{onClick:kn=>{kn.stopPropagation(),navigator.clipboard.writeText(Ve==null?void 0:Ve.listen_user),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:bo,alt:"",className:"cursor-pointer"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight",children:[i.jsxs("span",{className:"text-white text-[11px] font-normal font-['Manrope'] leading-[13px] tracking-tight min-w-max ml-[1px]",children:["Order ID:"," ",i.jsx("span",{className:"text-[#a5a5a5]",children:(Ve==null?void 0:Ve.oid)&&(Ve==null?void 0:Ve.oid)})]}),i.jsx("span",{onClick:kn=>{kn.stopPropagation(),navigator.clipboard.writeText(Ve==null?void 0:Ve.oid),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"cursor-pointer pr-0.5",children:i.jsx("img",{src:bo,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})]})]})]}),i.jsxs("div",{className:"flex flex-col items-end justify-start gap-[2px] w-full pl-2 pt-2 relative",children:[i.jsx("div",{onClick:()=>{ye(ce=="time"?"date":"time")},className:"text-[#a5a5a5] text-[11px] font-normal font-manrope leading-[13px] tracking-tight cursor-pointer",children:ce=="time"?i.jsx(Xe,{date:Ve==null?void 0:Ve.time}):eu(Ve==null?void 0:Ve.time)}),i.jsxs("div",{className:"flex justify-start items-center gap-2 -m-[2px]",children:[i.jsxs("div",{children:[i.jsxs("span",{className:"text-[#9b9b9b] text-[13px] font-normal font-manrope leading-[21px] tracking-tight",children:["opened a new"," ",(Ve==null?void 0:Ve.dir)=="Sell"?"spot sell":(Ve==null?void 0:Ve.dir)=="Buy"?"spot buy":(Je=Ve==null?void 0:Ve.dir)==null?void 0:Je.toLowerCase()," ","position for"," "]}),i.jsxs("span",{className:"pl-1 text-white text-[13px] font-normal font-manrope leading-[21px] tracking-tight",children:[Ve==null?void 0:Ve.coin,"/",(Ve==null?void 0:Ve.feeToken)==null?"USDC":Ve==null?void 0:Ve.feeToken]})]}),i.jsx("div",{className:"w-5 h-5 bg-transparent rounded-[256px]",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Vt[Ve==null?void 0:Ve.coin]||((He=Ve==null?void 0:Ve.coin)==null?void 0:He.split("/")[0])}.svg`||Ua,alt:Ve==null?void 0:Ve.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:kn=>ea(kn)})})]})]})]}),i.jsx("div",{className:"px-2",children:i.jsx("div",{className:"w-full min-w-auto min-w-[920px] h-[72px] min-h-[72px] bg-[#232323] rounded-xl border border-[#353535] pt-4 pl-4",children:i.jsxs("div",{className:"flex justify-start items-center gap-4 overflow-x-scroll scroll-smooth",children:[i.jsxs("div",{className:"sticky left-0 z-[8] bg-[#232323] flex justify-start items-center gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-1",children:[i.jsx("div",{className:"text-[#9b9b9b] text-xs font-normal font-manrope leading-[13px] tracking-wide",children:"Asset"}),i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("div",{className:"w-5 h-5 bg-transparent rounded-[256px]",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Vt[Ve==null?void 0:Ve.coin]||((Rt=Ve==null?void 0:Ve.coin)==null?void 0:Rt.split("/")[0])}.svg`||Ua,alt:Ve==null?void 0:Ve.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:kn=>ea(kn)})}),i.jsxs("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:[Ve==null?void 0:Ve.coin,"/",(Ve==null?void 0:Ve.feeToken)==null?"USDC":Ve==null?void 0:Ve.feeToken]})]})]}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-1",children:[i.jsx("div",{className:"text-[#9b9b9b] text-xs font-normal font-manrope leading-[13px] tracking-wide",children:"Direction"}),i.jsx("div",{className:"flex justify-start items-center",children:i.jsxs("div",{className:`${(qe=Ve==null?void 0:Ve.dir)!=null&&qe.includes("Long")?(Ve==null?void 0:Ve.dir)==="Short > Long"?"text-[#67ffbd] bg-[#67ffbd]/20":(Ve==null?void 0:Ve.dir)==="Long > Short"?"text-[#ff787b] bg-[#ff797c]/20":"text-[#67ffbd] bg-[#67ffbd]/20":(Ve==null?void 0:Ve.dir)=="Buy"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md justify-start items-center gap-0.5 inline-flex min-w-max`,children:[i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx("div",{className:"w-3 h-3 relative",children:(lt=Ve==null?void 0:Ve.dir)!=null&&lt.includes("Long")?(Ve==null?void 0:Ve.dir)==="Short > Long"?i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(Ve==null?void 0:Ve.dir)==="Long > Short"?i.jsx(Es,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):(Ve==null?void 0:Ve.dir)=="Buy"?i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Es,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsxs("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-wide",children:[(Ve==null?void 0:Ve.dir)=="Sell"?"Sell":(Ve==null?void 0:Ve.dir)=="Buy"?"Buy":(Ve==null?void 0:Ve.dir)=="Close Short"?"Short":(Ve==null?void 0:Ve.dir)=="Close Long"?"Long":(Ve==null?void 0:Ve.dir)=="Open Short"?"Short":(Ve==null?void 0:Ve.dir)=="Open Long"?"Long":Ve!=null&&Ve.dir?Ve==null?void 0:Ve.dir:"--",Ve!=null&&Ve.leverage?" - "+(Ve==null?void 0:Ve.leverage)+"x":""]})]})})]}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(cv,{title:"Type",value:Ve!=null&&Ve.fill_direction_type?Ve!=null&&Ve.is_twap?`${Ve==null?void 0:Ve.fill_direction_type} - Twap`:Ve==null?void 0:Ve.fill_direction_type:"--",color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(cv,{title:"Price",value:Er(Ve==null?void 0:Ve.px),color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(cv,{title:"Size",value:Er(Ve==null?void 0:Ve.sz),color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(cv,{title:"Entry Price",value:Ve!=null&&Ve.markPrice?`$${Er(Ve==null?void 0:Ve.markPrice)}`:Er(Ve==null?void 0:Ve.markPrice),color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(cv,{title:"PnL",value:Ve!=null&&Ve.closedPnl?`$${Er(Math.abs(Ve==null?void 0:Ve.closedPnl))}`:Er(Math.abs(Ve==null?void 0:Ve.closedPnl)),color:`${(Ve==null?void 0:Ve.closedPnl)>=0?"text-[#67ffbd]":"text-[#ff787b]"}`}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(cv,{title:"Fee",value:Ve!=null&&Ve.fee?`$${Er(Math.abs(Ve==null?void 0:Ve.fee))}`:Er(Math.abs(Ve==null?void 0:Ve.fee)),color:"text-[#ff787b]"}),i.jsx("div",{className:"w-px h-8 bg-[#353535]"})]}),i.jsxs("div",{className:"flex justify-start items-center gap-4",children:[i.jsx(cv,{title:"Margin Mode",value:(Ve==null?void 0:Ve.is_cross)==null||Ve!=null&&Ve.is_cross?"Cross":"Isolated",color:"text-white"}),i.jsx("div",{className:"w-px h-8 bg-transparent"})]})]})})}),i.jsx("div",{className:`${Ve!=null&&Ve.success?"bg-[#67ffbd]/20 border-[#67ffbd]/25":"bg-[#ff797c]/20 border-[#ff797c]/25"} flex justify-start items-center h-8 max-h-8  rounded-bl-[18px] rounded-br-[18px] border-t w-full py-1.5`,children:i.jsxs("div",{className:"text-white text-sm font-manrope leading-none flex justify-start items-center px-2 gap-2",children:[Ve!=null&&Ve.success?i.jsx("img",{src:hM,alt:""}):i.jsx("img",{src:pM,alt:""}),i.jsx("div",{className:`${Ve!=null&&Ve.success?"text-[#67ffbd]":"text-[#ff787b]"}  text-xs font-semibold font-manrope leading-3 tracking-tight`,children:Ve!=null&&Ve.success?"Status:":"System Message:"}),i.jsxs("div",{className:"text-white text-xs font-semibold font-manrope leading-3 tracking-tight -ml-1",children:[Ve!=null&&Ve.message&&((xt=Ve==null?void 0:Ve.message)==null?void 0:xt.length)>100?`${(Nt=Ve==null?void 0:Ve.message)==null?void 0:Nt.slice(0,100)}...`:Ve==null?void 0:Ve.message," ","on"]}),i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${Ve==null?void 0:Ve.trader_wallet}`,"_blank")},className:"h-[18px] px-1.5 py-1 bg-white rounded-[256px] justify-center items-center gap-0.5 inline-flex cursor-pointer -ml-0.5",children:i.jsx("div",{className:"text-[#273f35] text-xs font-semibold font-manrope leading-[13px]",children:Ve!=null&&Ve.wallet_name?Ve==null?void 0:Ve.wallet_name:Ve!=null&&Ve.trader_wallet?((It=Ve==null?void 0:Ve.trader_wallet)==null?void 0:It.slice(0,5))+"..."+((xn=Ve==null?void 0:Ve.trader_wallet)==null?void 0:xn.slice(-4)):"--"})}),i.jsxs("div",{className:"text-white text-xs font-semibold font-manrope leading-3 tracking-tight -ml-0.5",children:["by"," "]}),i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${Ve==null?void 0:Ve.listen_user}`,"_blank")},className:"h-[18px] px-1.5 py-1 bg-[#a5ffd8] rounded-[256px] justify-center items-center gap-0.5 inline-flex -ml-0.5 cursor-pointer",children:i.jsx("div",{className:"text-[#1e563e] text-xs font-semibold font-manrope leading-[13px]",children:Ve!=null&&Ve.tag?Ve==null?void 0:Ve.tag:Ve!=null&&Ve.listen_user?((dn=Ve==null?void 0:Ve.listen_user)==null?void 0:dn.slice(0,5))+"..."+((Mn=Ve==null?void 0:Ve.listen_user)==null?void 0:Mn.slice(-4)):"--"})}),(Ve==null?void 0:Ve.message)&&((_n=Ve==null?void 0:Ve.message)==null?void 0:_n.trim())=="Reverse Direction detected: Action skipped."&&i.jsx("a",{href:"https://docs.dextrabot.com/copy-trade/copytrade/reverse-direction",target:"_blank",rel:"noopener noreferrer",className:"p-1.5 rounded-lg shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-center items-center gap-2.5 cursor-pointer bg-white",children:i.jsx("div",{className:"text-[#1b1b1b] text-[11px] font-medium font-['Inter'] leading-[8px]",children:"Read Details"})})]})})]})]})},Ke)}))})})]})},cv=({title:e,value:t,color:n})=>i.jsxs("div",{className:"flex flex-col justify-start items-start gap-1 min-w-max",children:[i.jsx("div",{className:"text-[#9b9b9b] text-xs font-normal font-manrope leading-[13px] tracking-wide min-w-max",children:e}),i.jsx("div",{className:"flex justify-start items-center min-w-max",children:i.jsx("div",{className:`${n} text-sm font-semibold font-manrope leading-[13px] tracking-tight min-w-max`,children:t})})]}),nan=({isMenu:e,setIsMenu:t,handleMenuChange:n})=>{const{trackedWatchList:r,getTrackedWatchList:s,copyTradeWatchList:a,getCopyTradeWatchList:o}=m.useContext(Gr);return m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&(s(),o())},[e]),i.jsx("div",{className:"flex flex-col items-start gap-4 justify-start text-white w-full h-full font-manrope",children:i.jsxs("div",{className:"flex flex-col items-start justify-start w-full gap-[17px] bg-[#161616] max-w-full font-manrope h-full",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2 font-manrope max-w-full w-full bg-[#161616] ",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px] min-w-max",children:"My Activities"})})]}),i.jsxs("div",{className:"flex justify-center sm:justify-between items-center gap-2 flex-wrap sm:flex-nowrap max-h-max w-full sm:pr-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx(ECe,{title:"My Activities",isMenu:e,setIsMenu:t,handleMenuChange:n,lengthInfo:a?a.length:0}),i.jsx(ECe,{title:"Tracked Wallets",isMenu:e,setIsMenu:t,handleMenuChange:n,lengthInfo:r?r.length:0})]}),i.jsx("div",{className:"flex justify-center w-full sm:justify-end",children:i.jsx(qin,{isMenu:e})})]}),i.jsx("div",{className:"flex items-start justify-start gap-2 w-full lg:w-auto lg:min-w-[860px] lg:max-w-max h-full",children:e==="Tracked Wallets"?i.jsxs("div",{className:"w-full",children:[i.jsx("div",{className:"hidden lg:block",children:i.jsx($in,{})}),i.jsx("div",{className:"block lg:hidden",children:i.jsx(zin,{})})]}):e==="My Activities"?i.jsx("div",{className:"flex flex-col lg:flex-row items-start justify-start gap-2 w-full lg:min-w-[900px] lg:max-w-max h-full",children:i.jsx(tan,{})}):i.jsx("div",{className:"flex items-start justify-start gap-2  w-full min-w-[860px] max-w-[1180px] h-full",children:"An unexpected error occurred."})})]})})},ECe=({title:e,lengthInfo:t,isMenu:n,setIsMenu:r,handleMenuChange:s})=>i.jsxs("div",{onClick:()=>s(e),className:`${n===e?"bg-white text-[#161616]":"bg-[#1b1b1b] text-[#9b9b9b]"} h-8 px-3 py-2 rounded-[256px] justify-center items-center gap-2 inline-flex cursor-pointer`,children:[i.jsx("div",{className:"text-[13px] font-semibold font-manrope leading-[8px] min-w-max",children:e}),i.jsx("div",{className:`${n===e?"text-white bg-[#ff5a5a]":"text-[#9b9b9b] bg-[#282828]"} p-1 rounded-md justify-center items-center gap-0.5 flex`,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-wide min-w-max",children:t})})]}),ran=()=>{const{setTelegramChatId:e,setSubscriberRole:t,setSubsExpireDay:n,setMushboomerETH:r,setMushboomerSOL:s,isReferralCode:a,setIsReferralCode:o,setIsWhitelist:l,setHyperToken:c,setHyperAddress:u,setSignModalOpen:d}=m.useContext(Gr),f=Ic(),[x,g]=m.useState(null);m.useEffect(()=>{const w=f.hash;w==="#tracked-wallets"?g("Tracked Wallets"):(w==="#my-activities"||window.history.replaceState(null,"",`${window.location.pathname}#my-activities`),g("My Activities"))},[f.hash]);const v=w=>{g(w),w==="Tracked Wallets"?window.history.replaceState(null,"",`${window.location.pathname}#tracked-wallets`):w==="My Activities"&&window.history.replaceState(null,"",`${window.location.pathname}#my-activities`)};return m.useEffect(()=>{(async()=>{var I,P;const C=window.localStorage.getItem("hyperToken"),N=window.localStorage.getItem("hyperAddress");if(!(!C||!N))try{const R=await Si(N.toLowerCase(),C);R!=null&&R.success?(e(R==null?void 0:R.telegram_chat_id),t(R==null?void 0:R.subscriber_role),n(R==null?void 0:R.subs_expire_day),r((I=R==null?void 0:R.mushboomer_counts)==null?void 0:I.eth),s((P=R==null?void 0:R.mushboomer_counts)==null?void 0:P.sol),o(R==null?void 0:R.referral_code),l(R==null?void 0:R.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),c(""),u(""))}catch(R){console.error("Token verification error:",R),console.error(R.message||"An unknown error occurred.")}})()},[]),x?i.jsxs(i.Fragment,{children:[i.jsx(Io,{children:i.jsxs($o,{children:[i.jsx("title",{children:"Live Transaction Feed for Your Favorite Hyperliquid Wallets - Dextrabot"}),i.jsx("meta",{name:"description",content:"Stay updated with live transactions from your favorite HyperLiquid wallets. Monitor trades in real time and react instantly with DextraBot’s transaction feed."}),i.jsx("meta",{name:"og:title",content:"Live Transaction Feed for Your Favorite Hyperliquid Wallets - Dextrabot"}),i.jsx("meta",{name:"og:description",content:"Stay updated with live transactions from your favorite HyperLiquid wallets. Monitor trades in real time and react instantly with DextraBot’s transaction feed."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/my-activities"})]})}),i.jsx("div",{className:"flex justify-center items-center w-full h-screen min-h-max px-4 pt-4 bg-[#161616]",children:i.jsx("div",{className:"flex flex-col items-stretch justify-center h-full gap-[26px] w-full xl:w-max flex-grow xl:flex-grow-0",children:i.jsx(nan,{isMenu:x,setIsMenu:g,handleMenuChange:v})})})]}):null},san=({open:e,setOpen:t,handleEnterCode:n,inputValue:r,isEnterLoading:s})=>i.jsxs(ga,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-6 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Hi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-2",children:[i.jsx("div",{className:"text-center text-white text-[24px] font-manrope leading-none",children:"Join now"}),i.jsx("div",{className:"w-[300px] text-center text-white/60 text-sm font-medium font-manrope leading-[18px] tracking-[0.28px] pt-4 pb-2 px-2",children:"Using a referral code will give you a 4% discount on your fees."})]}),i.jsxs("div",{role:"status",className:`${s?"":"hidden"} flex justify-center items-center w-full max-h-8`,children:[i.jsxs("svg",{"aria-hidden":"true",className:"w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-white",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}),i.jsx("div",{onClick:a=>{a.preventDefault(),s||n()},className:`${s?"cursor-not-allowed":"cursor-pointer"} w-[286px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex`,children:i.jsxs("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:["Join with code: ",r]})})]})})})})})]}),ian=({handleEnterCode:e,handleChange:t,error:n,handleGenerateCode:r,handleGenerateChange:s,generateError:a,generateData:o,userReferansCode:l,setInputValue:c,inputValue:u,setGenerateValue:d,generateValue:f,setIsMenu:x,isMenu:g,setGenerateCode:v,generateCode:w,setIsGenerateLoading:C,isGenerateLoading:N,setIsEnterLoading:I,isEnterLoading:P,divRef:R,isEnterModal:F,setIsEnterModal:U})=>{const{mushboomerETH:L,mushboomerSOL:z,isReferralCode:X,isWhitelist:ne}=m.useContext(Gr),J=w?`https://app.dextrabot.com/referral/${w}`:"";return i.jsxs(i.Fragment,{children:[!l&&i.jsx(san,{open:F,setOpen:U,handleEnterCode:e,inputValue:u,isEnterLoading:P}),i.jsxs("div",{ref:R,className:"flex flex-col justify-start items-start gap-[30px] h-max relative bg-[#232323] rounded-2xl overflow-hidden pt-[18px] px-[18px] w-max mx-auto lg:mx-0",children:[i.jsx("div",{className:"text-white text-2xl font-semibold font-manrope leading-[8px]",children:"Referrals"}),i.jsxs("div",{className:"flex flex-col justify-start items-start",children:[i.jsxs("div",{className:"flex justify-start items-center w-full gap-[8px] pt-[2px]",children:[i.jsx("div",{onClick:()=>x("Enter Code"),className:`${g=="Enter Code"?"text-white":"text-[#8b8b8b]"} w-[136px] h-[37px] px-2 py-1.5 justify-center items-center gap-2 inline-flex text-[13px] font-semibold font-manrope leading-[8px] cursor-pointer`,children:"Enter Code"}),i.jsx("div",{onClick:()=>x("Create Code"),className:`${g=="Create Code"?"text-white":"text-[#8b8b8b]"} w-[136px] h-[37px] px-2 py-1.5 justify-center items-center gap-2 inline-flex text-[13px] font-semibold font-manrope leading-[8px] cursor-pointer min-w-max`,children:"Create Code"})]}),i.jsxs("div",{className:"flex justify-start items-center w-full",children:[i.jsx("div",{className:`${g=="Enter Code"?"bg-white":"bg-[#8b8b8b]"} w-[143px] h-0.5 `}),i.jsx("div",{className:`${g=="Create Code"?"bg-white":"bg-[#8b8b8b]"} w-[143px] h-0.5 `})]})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-2 w-full",children:[i.jsxs("div",{className:`${l&&g=="Enter Code"||g=="Create Code"&&w||!(ne||L>0||z>0)||g=="Claim"?"hidden":""} flex justify-start items-center gap-[4px] has-tooltip relative`,children:[i.jsx("div",{className:"text-[#7c7c7c] text-[13px] font-semibold font-manrope leading-[8px] min-w-max",children:g=="Enter Code"?"Referral Code":"Set your Referral Code"}),i.jsx(vi,{className:"text-[#7C7C7C]"}),i.jsx("span",{className:`${g=="Enter Code"?"ml-44":"ml-32"}`,children:i.jsx(_a,{content:"Valid characters: '_', '-', 0-9, A-Z, 4-10 length",positionTop:!0,alignRight:!1})})]}),g=="Enter Code"?i.jsxs(i.Fragment,{children:[i.jsx("input",{type:"text",value:u,onChange:t,placeholder:"Code",className:`${u!=null&&u!=null&&u!=""?"border border-[#8d67ff]":""} ${l?"hidden":""} py-[4px] bg-[#1b1b1b] rounded-md block text-white text-sm font-medium font-inter leading-[8px] w-[286px] min-w-[286px] px-4 focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#7F7F7F] placeholder:font-inter placeholder:text-sm placeholder:font-medium placeholder:leading-[8px] h-[38px]`}),i.jsx("div",{className:`${!l&&n?"block":"hidden"} w-[286px] h-8 px-3 py-2 bg-[#3b2626] rounded-md justify-start items-center gap-2.5 inline-flex`,children:i.jsx("div",{className:"text-[#ff787b] text-xs font-semibold font-manrope leading-none",children:n&&n})}),P?i.jsxs("div",{role:"status",className:"flex justify-center items-center w-full my-[30px]",children:[i.jsxs("svg",{"aria-hidden":"true",className:"w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-white",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{className:`${l?"block":"hidden"} w-[286px] h-8 px-3 py-2 rounded-md justify-start items-center gap-2.5 inline-flex mt-[40px] mb-[60px]`,children:i.jsxs("div",{className:"text-white text-base font-semibold font-manrope leading-[8px] flex flex-col items-center justify-center gap-[18px] w-full",children:[i.jsx("img",{src:Wbt,alt:""}),l&&`'${l}' has been applied.`]})}),i.jsx("div",{onClick:()=>{e()},className:`${l?"hidden":""} w-[286px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex mt-2 cursor-pointer`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Enter Code"})}),i.jsx("div",{className:`${l?"hidden":""} w-[286px] h-14 p-2.5 bg-[#ffd979]/20 rounded-md justify-start items-center gap-2.5 inline-flex`,children:i.jsx("div",{className:"w-[266px] text-[#ffd978] text-[13px] font-semibold font-manrope leading-none",children:"Using a referral code will give you a 4% discount on your fees"})})]}):g=="Claim"?i.jsx(i.Fragment,{children:i.jsx("div",{className:"flex justify-center items-cente w-[286px] mt-[54px] mb-[70px]",children:i.jsx("div",{className:"text-[#7c7c7c] text-[16px] font-semibold font-['Manrope'] leading-[8px] ",children:"Coming soon"})})}):ne||L>0||z>0?i.jsxs(i.Fragment,{children:[i.jsx("input",{type:"text",value:f,onChange:s,placeholder:"Code",className:`${f!=null&&f!=null&&f!=""?"border border-[#8d67ff]":""} ${w?"hidden":""} py-[4px] bg-[#1b1b1b] rounded-md block text-white text-sm font-medium font-inter leading-[8px] w-[286px] min-w-[286px] px-4 focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#7F7F7F] placeholder:font-inter placeholder:text-sm placeholder:font-medium placeholder:leading-[8px] h-[38px]`,disabled:!!w}),i.jsx("div",{className:`${!w&&a?"block":"hidden"} w-[286px] h-8 px-3 py-2 bg-[#3b2626] rounded-md justify-start items-center gap-2.5 inline-flex`,children:i.jsx("div",{className:"text-[#ff787b] text-xs font-semibold font-manrope leading-none",children:a&&a})}),N?i.jsxs("div",{role:"status",className:"flex justify-center items-center w-full my-[30px]",children:[i.jsxs("svg",{"aria-hidden":"true",className:"w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-white",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{className:`${w?"block":"hidden"} w-full h-8 px-3 py-2 rounded-md justify-start items-center gap-2.5 inline-flex mt-[40px] mb-[60px]`,children:i.jsxs("div",{className:"text-white text-base font-semibold font-manrope leading-[8px] flex flex-col items-center justify-center gap-[18px] w-full",children:[i.jsx("img",{src:qbt,alt:""}),w&&`'${w}' created successfully!`]})}),i.jsx("div",{onClick:()=>{r()},className:`${w?"hidden":""} w-[286px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex mt-2 cursor-pointer`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Create Code"})})]}):i.jsxs("div",{className:"flex flex-col items-center justify-center w-[286px] gap-4  px-4 text-white",children:[i.jsx("span",{className:"text-center mb-5 font-bold underline",children:"You need to have at least 1 Mushboomer ETH or 1 Mushboomer SOL, or have entered a referral code to be able to copy trade."}),i.jsx("div",{onClick:()=>{window.open("https://blur.io/collection/mushboomers","_blank")},className:"w-[184px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Mushboomers Eth"})}),i.jsx("div",{onClick:()=>{window.open("https://www.tensor.trade/trade/mushboomers","_blank")},className:"w-[184px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Mushboomers Sol"})}),i.jsx("div",{onClick:()=>{x("Enter Code")},className:"w-[184px] h-8 px-6 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Referral Code"})})]})]}),i.jsx("div",{className:`${w&&g=="Create Code"||l&&g=="Enter Code"||g=="Claim"?"hidden":"block"} w-[286px] h-px bg-[#3e3e3e] -mt-[14px]`}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[25px] -mt-[14px] bg-[#393939] -mx-[18px] px-4 py-4 h-full w-[328px] border-t border-dashed border-neutral-500",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[10px]",children:[i.jsx("div",{className:"text-[#cfcfcf] text-[13px] font-semibold font-manrope leading-[8px]",children:"Your Referral Code"}),i.jsxs("div",{onClick:Z=>{Z.preventDefault(),w&&(navigator.clipboard.writeText(w||""),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}))},className:`${w?"cursor-pointer":"cursor-not-allowed"} flex justify-start items-center gap-1.5`,children:[i.jsx("img",{src:fM,alt:"",className:"text-white w-[18px] h-[18px]"}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[21px]",children:w||"You haven't created a referral code yet"})]})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[10px]",children:[i.jsx("div",{className:"text-[#cfcfcf] text-[13px] font-semibold font-manrope leading-[8px]",children:"Your Referral URL"}),i.jsxs("div",{onClick:Z=>{Z.preventDefault(),(w||o)&&(navigator.clipboard.writeText(w?`https://app.dextrabot.com/referral/${w}`:o&&o),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}))},className:`${w||o?"cursor-pointer":"cursor-not-allowed"} flex justify-start items-center gap-1.5`,children:[i.jsx("img",{src:fM,alt:"",className:"text-white w-[18px] h-[18px]"}),i.jsx("div",{className:`${w||o?"underline":"no-underline"} text-[#82ffc8] text-sm font-medium font-manrope  leading-[21px]`,children:w?J.slice(0,36)+"...":o?o.slice(0,30)+"...":i.jsx("span",{className:"text-white",children:"-"})})]})]})]})]})]})},lC=({title:e,sortKey:t,sortOption:n,setSortOption:r,isFilterIcon:s})=>{const a=()=>{r(n===t?`-${t}`:t)};return i.jsx(i.Fragment,{children:i.jsxs("div",{onClick:()=>a(),className:`${e==="Wallet"?"sm:sticky left-0 h-8":s?"justify-end":"justify-start"} flex items-center gap-1 min-w-max font-manrope`,children:[i.jsx("div",{className:`${n.includes(t)?"text-white":""} cursor-pointer flex items-center justify-end group`,children:e}),i.jsx(cU,{sortKey:t,state:n,className:""})]})})};function aan({open:e,setOpen:t}){return i.jsxs(ga,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Oa})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:eae,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-2",children:[i.jsx("div",{className:"text-center text-white text-[24px] font-manrope leading-none",children:"Your claim is being processed"}),i.jsx("div",{className:"w-[300px] text-center text-white/60 text-sm font-medium font-manrope leading-[18px] tracking-[0.28px] pt-4 pb-8 px-2",children:"Referral Claim process may take 24h to verify and complete your transaction. If anything goes wrong after 24h, you can open a ticket on discord."})]})]})})})})})]})}const oan=({data:e,dataLoading:t,dataError:n,height:r,handleRefTable:s,dataUsage:a,dataUsageLoading:o,dataUsageError:l,setIsOnTableTab:c,isOnTableTab:u})=>{var he,Y,ie,oe;const{isConnected:d,address:f}=Yr(),{setSignModalOpen:x,hyperToken:g}=m.useContext(Gr),[v,w]=m.useState(!1),[C,N]=m.useState(!1),[I,P]=m.useState(!1),R=m.useMemo(()=>{var V;const G=new Map;return(V=e==null?void 0:e.claim_lists)==null||V.forEach(ee=>{var fe;const ae=((fe=ee==null?void 0:ee.subscriber_address)==null?void 0:fe.toLowerCase())||"";if(!G.has(ae))G.set(ae,{...ee,total_ref_claimable:parseFloat(ee==null?void 0:ee.total_ref_claimable)||0});else{const Ae=G.get(ae);G.set(ae,{...Ae,total_ref_claimable:(Ae==null?void 0:Ae.total_ref_claimable)+(parseFloat(ee==null?void 0:ee.total_ref_claimable)||0)})}}),Array.from(G.values())},[e]),F="-total_ref_claimable",[U,L]=m.useState(F),z=G=>R==null?void 0:R.sort((V,ee)=>{const ae=V.subscriber_address?V.subscriber_address.toLowerCase():"",fe=ee.subscriber_address?ee.subscriber_address.toLowerCase():"";return G==="-level"?ee.level-V.level:G==="level"?V.level-ee.level:G==="-subscriber_address"?ae<fe?-1:ae>fe?1:0:G==="subscriber_address"?ae>fe?-1:ae<fe?1:0:G==="-total_ref_claimable"?ee.total_ref_claimable-V.total_ref_claimable:G==="total_ref_claimable"?V.total_ref_claimable-ee.total_ref_claimable:G==="-last_active_date"?new Date(ee.last_active_date)-new Date(V.last_active_date):G==="last_active_date"?new Date(V.last_active_date)-new Date(ee.last_active_date):0}),X="-created_at",[ne,J]=m.useState(X),Z=G=>{var V;return(V=a.claim_lists)==null?void 0:V.sort((ee,ae)=>{const fe=ee.address?ee.address.toLowerCase():"",Ae=ae.address?ae.address.toLowerCase():"";return G==="-level"?ae.level-ee.level:G==="level"?ee.level-ae.level:G==="-address"?fe<Ae?-1:fe>Ae?1:0:G==="address"?fe>Ae?-1:fe<Ae?1:0:G==="-created_at"?new Date(ae.created_at)-new Date(ee.created_at):G==="created_at"?new Date(ee.created_at)-new Date(ae.created_at):0})},re=async()=>{try{w(!0);const G=window.localStorage.getItem("hyperToken"),V="https://dextrabothypev2.nftinit.io/api/subscriber/claim/request/";if(!G){x(!0),w(!1);return}const ee=window.localStorage.getItem("hyperAddress"),fe=await(await fetch(V,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:f?f.toLowerCase():ee,token:G})})).json();fe.success?(s(),P(!0)):(console.log(fe.error_message),N(fe.error_message),on.error(fe.error_message))}catch(G){console.error("Error in like function:",G),N(G.message||"An unknown error occurred.")}finally{w(!1)}};return i.jsxs(i.Fragment,{children:[i.jsx(aan,{open:I,setOpen:P}),i.jsxs("div",{style:r==0?{maxHeight:"450px"}:{maxHeight:r},className:"flex flex-col justify-start items-start text-white font-manrope rounded-2xl h-auto sm:h-full w-full lg:w-max overflow-auto gap-3",children:[i.jsx("div",{className:"flex justify-between items-center w-full px-6 bg-[#232323] p-4 roundend-[16px]",children:i.jsxs("div",{className:"flex flex-col items-start justify-end gap-2",children:[i.jsxs("div",{className:"flex justify-start items-start gap-2",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start w-full h-full gap-2",children:[i.jsx("div",{className:"text-[#7c7c7c] text-[13px] font-semibold font-manrope leading-[8px] min-w-max",children:"Total Earnings"}),i.jsx("div",{className:"text-[#67ffbd] text-[21px] font-semibold font-manrope leading-[21px]",children:e!=null&&e.total_claim_fee?`$${Er(e==null?void 0:e.total_claim_fee)}`:"--"})]}),i.jsx("div",{className:"w-px h-10 bg-[#353535]"}),i.jsxs("div",{className:"flex flex-col items-start justify-start w-full h-full gap-2",children:[i.jsx("div",{className:"text-[#7c7c7c] text-[13px] font-semibold font-manrope leading-[8px] min-w-max",children:"Claimed"}),i.jsx("div",{className:"text-[#67ffbd] text-[21px] font-semibold font-manrope leading-[21px]",children:e!=null&&e.total_claimed_fee?`$${Er(e==null?void 0:e.total_claimed_fee)}`:"--"})]}),i.jsx("div",{className:"w-px h-10 bg-[#353535]"}),i.jsxs("div",{className:"flex flex-col items-start justify-start w-full h-full gap-2",children:[i.jsx("div",{className:"text-[#7c7c7c] text-[13px] font-semibold font-manrope leading-[8px] min-w-max",children:"Pending Earnings"}),i.jsx("div",{className:"text-[#67ffbd] text-[21px] font-semibold font-manrope leading-[21px]",children:e!=null&&e.unexpired_fee?`$${Er(e==null?void 0:e.unexpired_fee)}`:"--"})]}),i.jsx("div",{className:"w-px h-10 bg-[#353535]"}),i.jsxs("div",{className:"flex flex-col items-start justify-start w-full h-full gap-2",children:[i.jsx("div",{className:"text-[#7c7c7c] text-[13px] font-semibold font-manrope leading-[8px] min-w-max",children:"Available to Claim"}),i.jsx("div",{className:"text-[#67ffbd] text-[21px] font-semibold font-manrope leading-[21px]",children:e!=null&&e.total_claimable_fee?`$${Er(e==null?void 0:e.total_claimable_fee)}`:"--"})]}),i.jsx("div",{onClick:G=>{G.preventDefault(),g?v||((e==null?void 0:e.total_claimable_fee)<50?on.success(i.jsxs(i.Fragment,{children:[i.jsx("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:"Minimum claim limit is"}),i.jsx("span",{style:{color:"#ffffff",paddingLeft:"5px"},children:"$50."})]}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"300px",minWidth:"300px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}}):(e==null?void 0:e.total_claimable_fee)>=50&&re()):x(!0)},className:`${v?"cursor-not-allowed":"cursor-pointer"} claim-button-claim-button flex justify-center items-center px-4 rounded-md font-inter font-semibold text-[13px] not-italic h-8 leading-[8px] text-white min-w-[80px] ml-4`,children:v?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[40px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",class:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{class:"sr-only",children:"Loading..."})]}):i.jsx("span",{className:"min-w-max",children:"Claim"})})]}),i.jsxs("div",{className:"flex justify-between items-center w-full h-full gap-1.5",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start",children:[i.jsxs("div",{className:"flex justify-start items-center w-full gap-[8px]",children:[i.jsx("div",{onClick:()=>c("Earnings"),className:`${u=="Earnings"?"text-white":"text-[#8b8b8b]"} w-[116px] px-2 py-1.5 justify-center items-center gap-2 inline-flex text-[13px] font-semibold font-manrope leading-[8px] cursor-pointer`,children:"Earnings"}),i.jsx("div",{onClick:()=>c("Referrals"),className:`${u=="Referrals"?"text-white":"text-[#8b8b8b]"} w-[116px] px-2 py-1.5 justify-center items-center gap-2 inline-flex text-[13px] font-semibold font-manrope leading-[8px] cursor-pointer min-w-max`,children:"Referrals"})]}),i.jsxs("div",{className:"flex justify-start items-center w-full pt-1.5",children:[i.jsx("div",{className:`${u=="Earnings"?"bg-white":"bg-[#8b8b8b]"} w-[123px] h-0.5 `}),i.jsx("div",{className:`${u=="Referrals"?"bg-white":"bg-[#8b8b8b]"} w-[123px] h-0.5 `})]})]}),i.jsx("div",{className:"text-[#aaaaaa] text-xs font-semibold font-manrope leading-none max-w-max mr-2",children:"• Minimum Withdrawal Amount: $50"})]})]})}),i.jsx("div",{className:"w-full min-w-[600px] max-w-[790px] h-full overflow-x-scroll relative overflow-y-scroll flex-grow bg-[#242424]",children:u=="Earnings"?i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#242424] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sticky left-0 h-8 pl-6 min-w-[150px] sm:min-w-[170px] z-[8] bg-[#242424] rounded-tl-2xl",children:i.jsx(lC,{title:"Referred Wallet",sortKey:"subscriber_address",sortOption:U,setSortOption:L,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#242424] h-10 px-1 min-w-[100px] sm:min-w-[120px]",children:i.jsx(lC,{title:"Level",sortKey:"level",sortOption:U,setSortOption:L,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#242424] h-10 min-w-[110px] sm:min-w-[110px] rounded-tr-2xl pl-1 pr-4",children:i.jsx(lC,{title:"Earnings",sortKey:"total_ref_claimable",sortOption:U,setSortOption:L,isFilterIcon:!1})})]})}),i.jsx("tbody",{children:!e||t?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:3,children:i.jsx("div",{className:"flex min-h-[25vh] flex-col justify-center items-center ml-[45%] w-max",children:i.jsx(Ma,{})})})}):n&&!(e!=null&&e.claim_lists)?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:3,children:i.jsx("div",{className:"flex min-h-[25vh] flex-col justify-center items-center ml-[27%] w-max",children:i.jsx(Ml,{})})})}):(e==null?void 0:e.length)==0||((he=e==null?void 0:e.claim_lists)==null?void 0:he.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:3,children:i.jsx("div",{className:"flex min-h-[25vh] flex-col justify-center items-center  ml-[30%] w-max",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 -ml-16",children:[i.jsx("img",{src:ec,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No referral earnings yet."}),i.jsxs("div",{className:"flex flex-col items-center justify-start text-center -mt-1",children:[i.jsx("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"Share your referral link and watch your earnings appear"}),i.jsx("br",{}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide -mt-5",children:[" ","here as users start trading."]})]})]})]})})})})}):(Y=z(U))==null?void 0:Y.map((G,V)=>i.jsxs("tr",{className:`${V%2===0,"bg-[#242424]"} relative group hover:bg-[#353535] h-[32px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${V%2==0,"bg-[#242424]"} sticky left-0 z-[2] group-hover:bg-[#353535]`,children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-2 pl-4 h-[32px] max-h-[32px]",children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-2 h-[32px] max-h-[32px]",children:i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(ra,{info1:`${(G==null?void 0:G.subscriber_address).slice(0,5)+"..."+(G==null?void 0:G.subscriber_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1})})})})}),i.jsx("td",{scope:"row",className:"group-hover:bg-[#353535]",children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-4 min-h-[32px] px-1",children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-2 h-[32px] max-h-[32px]",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5 text-white text-sm font-semibold font-manrope leading-[8px]",children:G!=null&&G.level?`L${G==null?void 0:G.level}`:"--"})})})}),i.jsx("td",{children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-4  min-h-[32px] pl-1 pr-4",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5 text-[#1ce6a2] text-sm font-semibold font-manrope leading-[8px]",children:G!=null&&G.total_ref_claimable?`$${Er(G==null?void 0:G.total_ref_claimable)}`:"--"})})})]},V))})]}):i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#242424] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sticky left-0 h-8 pl-6 min-w-[150px] sm:min-w-[170px] z-[8] bg-[#242424] rounded-tl-2xl",children:i.jsx(lC,{title:"Referred Wallet",sortKey:"address",sortOption:ne,setSortOption:J,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#242424] h-10 px-1 min-w-[100px] sm:min-w-[120px]",children:i.jsx(lC,{title:"Level",sortKey:"level",sortOption:ne,setSortOption:J,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#242424] h-10 min-w-[110px] sm:min-w-[110px] rounded-tr-2xl pl-1 pr-4",children:i.jsx(lC,{title:"Join Date",sortKey:"created_at",sortOption:ne,setSortOption:J,isFilterIcon:!1})})]})}),i.jsx("tbody",{children:!a||o?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:3,children:i.jsx("div",{className:"flex min-h-[25vh] flex-col justify-center items-center ml-[45%] w-max",children:i.jsx(Ma,{})})})}):l&&!(a!=null&&a.claim_lists)?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:3,children:i.jsx("div",{className:"flex min-h-[25vh] flex-col justify-center items-center ml-[27%] w-max",children:i.jsx(Ml,{})})})}):(a==null?void 0:a.length)==0||((ie=a==null?void 0:a.claim_lists)==null?void 0:ie.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:3,children:i.jsx("div",{className:"flex min-h-[25vh] flex-col justify-center items-center  ml-[30%] w-max",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 -ml-16",children:[i.jsx("img",{src:ec,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No referral yet."}),i.jsxs("div",{className:"flex flex-col items-center justify-start text-center -mt-1",children:[i.jsx("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"Share your referral link and watch your referrals appear"}),i.jsx("br",{}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide -mt-5",children:[" ","here as users start trading."]})]})]})]})})})})}):(oe=Z(ne))==null?void 0:oe.map((G,V)=>i.jsxs("tr",{className:`${V%2===0,"bg-[#242424]"} relative group hover:bg-[#353535] h-[32px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${V%2==0,"bg-[#242424]"} sticky left-0 z-[2] group-hover:bg-[#353535]`,children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-2 pl-4 h-[32px] max-h-[32px]",children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-2 h-[32px] max-h-[32px]",children:i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(ra,{info1:`${(G==null?void 0:G.address).slice(0,5)+"..."+(G==null?void 0:G.address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1})})})})}),i.jsx("td",{scope:"row",className:"group-hover:bg-[#353535]",children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-4 min-h-[32px] px-1",children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-2 h-[32px] max-h-[32px]",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5 text-white text-sm font-semibold font-manrope leading-[8px]",children:G!=null&&G.level?`L${G==null?void 0:G.level}`:"--"})})})}),i.jsx("td",{children:i.jsx("div",{className:"group-hover:bg-[#353535] flex justify-start items-center gap-4  min-h-[32px] pl-1 pr-4",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5 text-white text-sm font-semibold font-manrope leading-[8px]",children:G!=null&&G.created_at?Klt(G==null?void 0:G.created_at):"--"})})})]},V))})]})})]})]})},lan=({open:e,setOpen:t})=>i.jsxs(ga,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Oa})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:ike,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-4",children:[i.jsx("div",{className:"text-center text-white text-sm font-medium font-['Inter'] leading-4 tracking-[-0.28px]",children:"Trial activated!"}),i.jsx("div",{className:"w-[200px] text-center text-white text-[13px] font-normal font-['Inter'] leading-4",children:"Enjoy your 2-day premium trial."}),i.jsx("div",{className:"flex flex-col items-center gap-6 mt-[33px]",children:i.jsx("div",{onClick:()=>{window.open("https://app.dextrabot.com/referral#lighter-farming","_blank")},className:"w-[345px] h-10 px-6 py-3 bg-white hover:bg-[#E5E5E5] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] inline-flex justify-center items-center gap-2.5 cursor-pointer",children:i.jsx("div",{className:"justify-start text-black text-sm font-semibold font-['Inter'] leading-none",children:"Try Lighter Farming"})})})]})]})})})})})]}),can=()=>{const{isConnected:e,address:t}=Yr(),{setSignModalOpen:n,hyperToken:r,setTelegramChatId:s,setSubscriberRole:a,setSubsExpireDay:o,setMushboomerETH:l,setMushboomerSOL:c,setIsReferralCode:u,setIsReferralCodeName:d,setIsWhitelist:f,setHyperToken:x,setHyperAddress:g}=m.useContext(Gr),[v,w]=m.useState("Enter Code"),[C,N]=m.useState("Earnings"),I=Z3(),P=(I==null?void 0:I.code)||"",[R,F]=m.useState(""),[U,L]=m.useState(""),[z,X]=m.useState(null),[ne,J]=m.useState(""),[Z,re]=m.useState(""),[he,Y]=m.useState(""),[ie,oe]=m.useState(""),[G,V]=m.useState(!1),[ee,ae]=m.useState(!1),[fe,Ae]=m.useState([]),[ce,ye]=m.useState(!1),[Ne,be]=m.useState(!1),[je,Ie]=m.useState(!1),[Re,Qe]=m.useState([]),[Be,it]=m.useState(!1),[tt,at]=m.useState(!1),[dt,ct]=m.useState(!1),Ut=m.useRef(null),[kt,tn]=m.useState(0);m.useEffect(()=>{P&&(F(P),Ie(!0))},[P]);const jt=ft=>{let en=ft.target.value.toUpperCase();/^[0-9A-Z_-]{0,10}$/.test(en)&&(F(en),L(""))},un=ft=>{let en=ft.target.value.toUpperCase();/^[0-9A-Z_-]{0,10}$/.test(en)&&(J(en),re(""))},cn=async()=>{var ft,en;try{const Dt=window.localStorage.getItem("hyperToken"),At="https://dextrabothypev2.nftinit.io/api/subscriber/refcode/info/";if(!Dt){n(!0);return}const Je=window.localStorage.getItem("hyperAddress"),Rt=await(await fetch(At,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Je,token:Dt})})).json();Rt.success?(X((ft=Rt==null?void 0:Rt.data)==null?void 0:ft.referrer_code),oe((en=Rt==null?void 0:Rt.data)==null?void 0:en.my_refcode)):console.log(Rt.error_message)}catch(Dt){console.error("Error referans request:",Dt)}};m.useEffect(()=>{cn(),Ve(),Ke()},[r]);const Pt=async ft=>{try{V(!0);const en=window.localStorage.getItem("hyperToken"),Dt="https://dextrabothypev2.nftinit.io/api/subscriber/refcode/set/";en||(n(!0),V(!1));const At=window.localStorage.getItem("hyperAddress"),He=await(await fetch(Dt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():At,token:en,refcode:ft})})).json();He.success?(X(ft),V(!1),Ie(!1),on.success("Referral code add successfully",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.32)",width:"380px",minWidth:"380px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}),He!=null&&He.trial_farming&&ct(!0)):(console.log(He.error_message),L(He.error_message),je&&on.success(i.jsx(i.Fragment,{children:i.jsx("span",{children:He.error_message})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"360px",minWidth:"360px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}}),V(!1))}catch(en){console.error("Error in like function:",en),L(en.message),je&&on.error(en.message),V(!1)}},Xe=async ft=>{try{ae(!0);const en=window.localStorage.getItem("hyperToken"),Dt="https://dextrabothypev2.nftinit.io/api/subscriber/refcode/generate/";en||(n(!0),ae(!1));const At=window.localStorage.getItem("hyperAddress"),He=await(await fetch(Dt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():At,token:en,refcode:ft})})).json();He.success?(Y(`https://app.dextrabot.com/referral/${He==null?void 0:He.refcode}`),oe(He==null?void 0:He.refcode),ae(!1)):(console.log(He.error_message),ae(!1),re(He.error_message))}catch(en){console.error("Error in like function:",en),re(en.message),ae(!1)}},Vt=()=>{R.length<4?(L("You must enter at least 4 characters!"),je&&on.error("This refcode is wrong")):(L(""),Pt(R))},Yt=()=>{ne.length<4?re(ie?"You have a generated code, you cannot generate it again.":"You must enter at least 4 characters!"):(re(""),Xe(ne))};m.useEffect(()=>{(async()=>{var At,Je;const en=window.localStorage.getItem("hyperToken"),Dt=window.localStorage.getItem("hyperAddress");if(!(!en||!Dt))try{const He=await Si(Dt.toLowerCase(),en);He!=null&&He.success?(s(He==null?void 0:He.telegram_chat_id),a(He==null?void 0:He.subscriber_role),o(He==null?void 0:He.subs_expire_day),l((At=He==null?void 0:He.mushboomer_counts)==null?void 0:At.eth),c((Je=He==null?void 0:He.mushboomer_counts)==null?void 0:Je.sol),u(He==null?void 0:He.referral_code),d(He==null?void 0:He.refcode),f(He==null?void 0:He.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),x(""),g(""))}catch(He){console.error("Token verification error:",He),console.error(He.message||"An unknown error occurred.")}})()},[z]);const Ve=async()=>{try{ye(!0);const ft=window.localStorage.getItem("hyperToken"),en="https://dextrabothypev2.nftinit.io/api/subscriber/refcode/claims/";if(!ft){n(!0),ye(!1);return}const Dt=window.localStorage.getItem("hyperAddress"),Je=await(await fetch(en,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Dt,token:ft})})).json();Je.success?(Ae(Je==null?void 0:Je.data),ye(!1)):(console.log(Je.error_message),be(Je.error_message),ye(!1))}catch(ft){console.error("Error in like function:",ft),be(ft.message),ye(!1)}},Ke=async()=>{try{it(!0);const ft=window.localStorage.getItem("hyperToken"),en="https://dextrabothypev2.nftinit.io/api/subscriber/refcode/usage/";if(!ft){n(!0),it(!1);return}const Dt=window.localStorage.getItem("hyperAddress"),Je=await(await fetch(en,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():Dt,token:ft})})).json();Je.success?(Qe(Je==null?void 0:Je.data),it(!1)):(console.log(Je.error_message),at(Je.error_message),it(!1))}catch(ft){console.error("Error in like function:",ft),at(ft.message),it(!1)}};return m.useEffect(()=>{const ft=()=>{Ut.current&&tn(Ut.current.clientHeight)},en=new ResizeObserver(ft);return Ut.current&&en.observe(Ut.current),()=>{en.disconnect()}},[]),i.jsxs(i.Fragment,{children:[i.jsx(lan,{open:dt,setOpen:ct}),i.jsx(Io,{children:i.jsxs($o,{children:[i.jsx("title",{children:"Invite & Earn – DextraBot Referral Program"}),i.jsx("link",{rel:"canonical",href:"https://app.dextrabot.com/referral"}),i.jsx("meta",{name:"description",content:"Earn passive income by referring friends to DextraBot! Get a share of the trading fees from every transaction they make. Invite, grow your network, and start earning today!"}),i.jsx("meta",{name:"og:title",content:"Invite & Earn – DextraBot Referral Program"}),i.jsx("meta",{name:"og:description",content:"Earn passive income by referring friends to DextraBot! Get a share of the trading fees from every transaction they make. Invite, grow your network, and start earning today!"}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/referral"})]})}),i.jsx("div",{className:"flex justify-center items-start w-full h-[calc(100vh-5rem)] min-h-max px-4 pt-4 pb-10 bg-[#161616]",children:i.jsx("div",{className:"flex flex-col items-stretch justify-start h-full gap-[26px] w-full lg:w-max flex-grow lg:flex-grow-0",children:i.jsxs("div",{className:"flex flex-col items-stretch justify-start w-full gap-8",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row justify-start items-start gap-8 min-w-full w-full",children:[i.jsx(ian,{handleEnterCode:Vt,handleChange:jt,error:U,handleGenerateCode:Yt,handleGenerateChange:un,generateError:Z,generateData:he,userReferansCode:z,setInputValue:F,setGenerateValue:J,inputValue:R,generateValue:ne,setIsMenu:w,isMenu:v,setGenerateCode:oe,generateCode:ie,setIsGenerateLoading:ae,isGenerateLoading:ee,setIsEnterLoading:V,isEnterLoading:G,divRef:Ut,isEnterModal:je,setIsEnterModal:Ie}),i.jsx(oan,{data:fe,dataLoading:ce,dataError:Ne,height:kt,handleRefTable:Ve,dataUsage:Re,dataUsageLoading:Be,dataUsageError:tt,setIsOnTableTab:N,isOnTableTab:C})]}),i.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 bg-[#232323] rounded-2xl mb-10 p-4",children:[i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/refferal","_blank"),className:"flex justify-center items-center w-max gap-1.5 rounded-[10px] cursor-pointer",children:[i.jsx("div",{className:"text-white text-sm font-medium font-manrope leading-[18px] tracking-tight w-full sm:max-w-[500px] mb-2",children:"See the full Referral System with Bonuses Details"}),i.jsx("img",{src:cm,alt:"Dextrabot - Referral",className:"w-3 h-3 mb-2"})]}),i.jsx("img",{src:Vbt,alt:"",className:"text-center text-xs w-[900px] h-max sm:h-[450px] mb-10 lg:mb-0"})]})]})})})]})};function Lce({open:e,setOpen:t,data:n,walletData:r,withdrawableUsdc:s,setWithdrawableUsdc:a,modalWalletId:o,setModalWalletId:l}){const{setSignModalOpen:c}=m.useContext(Gr),{isConnected:u,address:d}=Yr(),[f,x]=m.useState(""),[g,v]=m.useState(!1),[w,C]=m.useState("");m.useEffect(()=>{const P=n.find(R=>R.wallet_address===r);P&&a(P==null?void 0:P.withdrawableUsdc)},[n]);const N=async()=>{var P,R,F,U,L,z;try{v(!0);const X=window.localStorage.getItem("hyperToken"),ne="https://dextrabothypev2.nftinit.io/api/wallet/request-withdraw";X||(c(!0),v(!1)),C("");const J=window.localStorage.getItem("hyperAddress"),re=await(await fetch(ne,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:d?d.toLowerCase():J,token:X,wallet_id:o??null,amount:f??0,destination:d?d.toLowerCase():J})})).json();re.success?(((R=(P=re==null?void 0:re.result)==null?void 0:P.result)==null?void 0:R.status)=="err"?(v(!1),C((U=(F=re==null?void 0:re.result)==null?void 0:F.result)==null?void 0:U.response)):((z=(L=re==null?void 0:re.result)==null?void 0:L.result)==null?void 0:z.status)=="ok"&&(v(!1),x(""),on.success("The operation was successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px",width:"380px",maxWidth:"none",whiteSpace:"nowrap"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}}),t(!1)),v(!1)):(console.log(re.error_message),v(!1),C("The transaction failed, please try again."))}catch(X){console.error("Error widthdraw amount:",X),v(!1),C(X.message)}},I=P=>{x(P.target.value)};return i.jsx(i.Fragment,{children:i.jsxs(ga,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[440px] h-max relative bg-[#252525] rounded-3xl py-4 text-white",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),x(""),a(null),C("")},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Oa})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Hi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2 text-white",children:[i.jsx("div",{className:"w-[365px] text-center text-white text-xl font-semibold font-manrope leading-7",children:"The withdrawal amount will be sent to your Login wallet on the Arbitrum network."}),i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("span",{className:"text-white/60 text-sm font-medium font-manrope leading-none tracking-tight",children:"Connected(Login) Wallet:"}),i.jsx("span",{className:"text-sm font-medium font-inter leading-none",children:d&&d.slice(0,6)+"..."+d.slice(-4)}),i.jsx("img",{onClick:P=>{P.stopPropagation(),navigator.clipboard.writeText(d),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:bo,alt:"",className:"cursor-pointer"})]}),i.jsx("div",{className:"flex justify-start mt-4 relative",children:i.jsx("input",{type:"text",value:r&&`${r}`,placeholder:"wallet",disabled:!0,className:"shadow-sm py-0.5 bg-[#303030] block sm:text-sm font-semibold font-manrope leading-none rounded-md px-2  outline-[#404040] placeholder:text-[#7F7F7F] cursor-not-allowed text-white/50 h-8 w-[360px]"})}),i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsxs("div",{className:"flex relative",children:[i.jsx("input",{value:f,onChange:P=>{let R=P.target.value;R.includes("-")?R=R.replace("-",""):(R===""||parseFloat(R)>=0)&&I({...P,target:{...P.target,value:R}})},type:"number",name:"widthdrawAmount",placeholder:"Amount",min:0,max:s,className:`shadow-sm py-0.5 bg-[#303030] block sm:text-sm font-semibold font-manrope leading-none rounded-md w-36 min-w-36 pl-2 pr-7 ${f!=null&&f!==""?"border border-[#C5C5C5]":""} outline-[#404040] placeholder:text-[#7F7F7F] h-8 w-[305px]`}),i.jsx("p",{className:`${f!=null&&f!==""?"text-white":"text-[#7F7F7F]"} absolute right-1.5 top-1`,children:"$"})]}),i.jsx("button",{onClick:()=>x(s),className:"bg-[#505050] text-white text-xs px-[11px] py-0.5 rounded-md cursor-pointer hover:bg-[#606060] h-8 focus:outline-none focus:ring-0 border-none",children:"Max"})]}),i.jsx("span",{className:"text-white",children:s!=0&&!isNaN(s)?`$${Er(s)}`:"$0"})]}),g&&i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[34px] px-0.5 rounded-md -my-6",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}),i.jsx("div",{onClick:P=>{P.preventDefault(),f!=null&&f!==""?g||N():on.error("Please enter amount")},className:`${g?"cursor-not-allowed":"cursor-pointer"} h-8 pl-2 pr-3.5 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex w-44 mb-3`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Apply"})}),w&&i.jsx("div",{className:"h-6 p-2 w-[355px] bg-[#ff6f67]/20 rounded-lg justify-start items-center gap-2.5 inline-flex overflow-hidden -mt-7",children:i.jsx("span",{className:"text-[#ff6e67] text-xs font-semibold font-manrope leading-none tracking-tight",children:w})})]})})})})})]})})}const Dce=({handleListRequest:e,handlePageChange:t,isGenWalletModal:n,setIsGenWalletModal:r})=>{const{setSignModalOpen:s}=m.useContext(Gr);return i.jsxs(i.Fragment,{children:[i.jsx(FA,{open:n,setOpen:r,handleListRequest:e,handlePageChange:t}),i.jsx("div",{className:"flex justify-center items-center w-max h-max -mt-[14px] sm:-mt-0",children:i.jsxs("div",{onClick:a=>{a.preventDefault(),window.localStorage.getItem("hyperToken")?r(!0):s(!0)},className:"h-8 pl-2 pr-2 sm:pl-2 sm:pr-3.5 py-3 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer my-2",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Add Account"})]})})]})};function Bce({open:e,setOpen:t,walletAddress:n}){return i.jsxs(ga,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Oa})})}),i.jsxs("div",{className:"flex flex-col items-center justify-start gap-2.5",children:[i.jsx("div",{className:"pt-4",children:i.jsx(nse,{className:"text-[#848484] w-[48px] h-[48px] rotate-180"})}),i.jsx("div",{className:"w-80 text-center text-white text-2xl font-semibold font-manrope leading-7",children:"Deposit Funds"}),i.jsxs("div",{className:"flex justify-start items-start gap-2 pt-[18px]",children:[i.jsx("div",{className:"w-8 h-8 bg-[#67ffbd]/20 rounded-[256px] justify-center items-center inline-flex",children:i.jsx("div",{className:"text-center text-[#67ffbd] text-base font-semibold font-manrope leading-7",children:"1"})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-[9px]",children:[i.jsxs("div",{className:"w-[283px]",children:[i.jsxs("span",{className:"text-white text-sm font-medium font-manrope leading-none",children:["Copy your"," "]}),i.jsx("span",{className:"text-white text-sm font-bold font-manrope leading-none",children:"wallet address"})]}),i.jsxs("div",{className:"w-[283px] flex justify-start items-center gap-1.5",children:[i.jsx("span",{className:"text-white/60 text-[13px] font-light font-inter leading-none",children:n&&n.slice(0,5)+"..."+n.slice(-4)}),i.jsx("img",{onClick:r=>{r.stopPropagation(),navigator.clipboard.writeText(n),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:bo,alt:"",className:"cursor-pointer"})]})]})]}),i.jsxs("div",{className:"flex justify-start items-start gap-2 pt-[10px]",children:[i.jsx("div",{className:"w-8 h-8 bg-[#67ffbd]/20 rounded-[256px] justify-center items-center inline-flex",children:i.jsx("div",{className:"text-center text-[#67ffbd] text-base font-semibold font-manrope leading-7",children:"2"})}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[9px]",children:[i.jsx("div",{className:"w-[217px] text-white text-sm font-medium font-manrope leading-none tracking-tight",children:"Deposit USDC on the Arbitrum Network."}),i.jsxs("div",{className:"w-[283px]",children:[i.jsxs("span",{className:"text-white/60 text-[13px] font-light font-inter leading-none",children:["Minimum Deposit:"," "]}),i.jsx("span",{className:"text-[#67ffbd] text-[13px] font-semibold font-manrope leading-none",children:"15 USDC"})]})]})]}),i.jsxs("div",{className:"flex justify-start items-start gap-2 pt-[10px]",children:[i.jsx("div",{className:"w-8 h-8 bg-[#67ffbd]/20 rounded-[256px] justify-center items-center inline-flex",children:i.jsx("div",{className:"text-center text-[#67ffbd] text-base font-semibold font-manrope leading-7",children:"3"})}),i.jsx("div",{className:"w-[283px] text-white text-sm font-medium font-manrope leading-none tracking-tight",children:i.jsx("div",{className:"w-[250px]",children:"Any deposit from other networks or below the minimum amount will be lost."})})]}),i.jsxs("div",{className:"flex justify-start items-start gap-2 pt-[10px]",children:[i.jsx("div",{className:"w-8 h-8 bg-[#67ffbd]/20 rounded-[256px] justify-center items-center inline-flex",children:i.jsx("div",{className:"text-center text-[#67ffbd] text-base font-semibold font-manrope leading-7",children:"4"})}),i.jsxs("div",{className:"w-[283px] text-white text-sm font-medium font-manrope leading-none",children:["Once funds arrive, you are ready ",i.jsx("br",{}),"for Copy Trade"]})]})]})]})})})})})]})}const $ce=({open:e,setOpen:t,handleDeleteWallet:n,deleteWalleInfo:r,confirmClosePositions:s,setConfirmClosePositions:a,confirmWithdrawEquity:o,setConfirmWithdrawEquity:l})=>{const c=(r==null?void 0:r.unrealizedPnL)!=0&&(r==null?void 0:r.unrealizedPnL)!=null&&(r==null?void 0:r.unrealizedPnL)!=null&&!s||(r==null?void 0:r.perpEquity)!=0&&(r==null?void 0:r.perpEquity)!=null&&(r==null?void 0:r.perpEquity)!=null&&!o;return i.jsx(i.Fragment,{children:i.jsxs(ga,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[490px] h-max relative bg-[#252525] rounded-3xl py-4 text-white",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),a(!1),l(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Oa})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Hi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-2",children:[i.jsx("div",{className:" text-center text-white text-2xl font-semibold font-manrope leading-7",children:(r==null?void 0:r.unrealizedPnL)!=0&&(r==null?void 0:r.unrealizedPnL)!=null&&(r==null?void 0:r.unrealizedPnL)!=null?"Cannot Delete Wallet: Open Positions":(r==null?void 0:r.perpEquity)!=0&&(r==null?void 0:r.perpEquity)!=null&&(r==null?void 0:r.perpEquity)!=null?"Wallet Has Remaining Perp Equity":"Confirm Wallet Deletion"}),i.jsx("div",{className:"w-[398px] text-center text-white/60 text-[16px] font-medium font-manrope leading-5",children:(r==null?void 0:r.unrealizedPnL)!=0&&(r==null?void 0:r.unrealizedPnL)!=null&&(r==null?void 0:r.unrealizedPnL)!=null||(r==null?void 0:r.perpEquity)!=0&&(r==null?void 0:r.perpEquity)!=null&&(r==null?void 0:r.perpEquity)!=null?"":"Are you sure you want to delete this Follower Wallet? This action cannot be undone."}),i.jsxs("div",{className:`${((r==null?void 0:r.unrealizedPnL)==0||(r==null?void 0:r.unrealizedPnL)==null||(r==null?void 0:r.unrealizedPnL)==null)&&(r==null?void 0:r.perpEquity)!=0&&(r==null?void 0:r.perpEquity)!=null&&(r==null?void 0:r.perpEquity)!=null?"ml-32":"ml-4"} flex flex-col gap-3 items-start w-[398px]`,children:[(r==null?void 0:r.unrealizedPnL)!=0&&(r==null?void 0:r.unrealizedPnL)!=null&&(r==null?void 0:r.unrealizedPnL)!=null&&i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[i.jsx("input",{type:"checkbox",checked:s,onChange:u=>a(u.target.checked),className:"hidden peer"}),i.jsx("div",{className:`w-[18px] h-[18px] flex items-center justify-center rounded border transition-all duration-200 ${s?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"}`,children:s&&i.jsx("img",{src:Wc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),i.jsx("span",{className:"text-white/60 text-[16px] font-medium font-manrope leading-5",children:"I have closed all my open positions in this wallet."})]}),(r==null?void 0:r.perpEquity)!=0&&(r==null?void 0:r.perpEquity)!=null&&(r==null?void 0:r.perpEquity)!=null&&i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[i.jsx("input",{type:"checkbox",checked:o,onChange:u=>l(u.target.checked),className:"hidden peer"}),i.jsx("div",{className:`w-[18px] h-[18px] flex items-center justify-center rounded border transition-all duration-200 ${o?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"}`,children:o&&i.jsx("img",{src:Wc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[2px]"})}),i.jsx("span",{className:"text-white/60 text-[16px] font-medium font-manrope leading-5",children:"I've withdrawn all my perp equity."})]})]})]}),i.jsxs("div",{className:"flex  items-center justify-center gap-4 mb-3",children:[i.jsx("div",{onClick:()=>{t(!1)},className:"h-8 px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Cancel"})}),i.jsx("div",{onClick:u=>{u.preventDefault(),c||n(r==null?void 0:r.walletId,r==null?void 0:r.walletName,r==null?void 0:r.wallet)},className:`${c?"bg-gray-500 border-gray-600 cursor-not-allowed":"bg-[#7445ff] border-[#8860ff] cursor-pointer"} h-8 px-2 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] justify-center items-center gap-1.5 inline-flex`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Delete"})})]})]})})})})})]})})},Uce=({rowData:e})=>e?i.jsxs("div",{className:"flex flex-col gap-4 p-4 bg-[#2e2e2e]/40 rounded-2xl",children:[i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs text-[#ababab]",children:"Name"}),i.jsx("span",{className:"text-sm font-semibold text-white",children:e.wallet_name})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs text-[#ababab]",children:"Follower Wallet"}),i.jsx("span",{className:"text-sm font-medium text-white break-all",children:e.wallet_address})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs text-[#ababab]",children:"Creation Date"}),i.jsx("span",{className:"text-sm font-medium text-white",children:d3(e.wallet_created_data)})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs text-[#ababab]",children:"Perp Equity"}),i.jsxs("span",{className:"text-sm font-semibold text-white",children:["$",Er(e.perpEquity)??0]})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs text-[#ababab]",children:"uPnL"}),i.jsxs("span",{className:`text-sm font-semibold ${e.unrealizedPnl>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"}`,children:["$",Er(Math.abs(e.unrealizedPnl))]})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs text-[#ababab]",children:"Margin Used"}),i.jsxs("span",{className:"text-sm font-semibold text-white",children:["$",Er(e.marginUsed)??0]})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs text-[#ababab]",children:"Available Balance"}),i.jsxs("span",{className:"text-sm font-semibold text-white",children:["$",Er(e.withdrawableUsdc)??0]})]})]}):null,uan=({data:e,loading:t,error:n,socketLoading:r,currentPage:s,handlePageChange:a,allWallets:o,lighterWallet:l,extendedWallet:c,handleListRequest:u,isSelectMenu:d,setIsSelectMenu:f})=>{var cn;const[x,g]=m.useState(!1),{setSignModalOpen:v}=m.useContext(Gr),{isConnected:w,address:C}=Yr(),N=5,[I,P]=m.useState(null),[R,F]=m.useState(null),[U,L]=m.useState(!1),[z,X]=m.useState(null),[ne,J]=m.useState(!1),[Z,re]=m.useState("");m.useState({});const[he,Y]=m.useState({}),[ie,oe]=m.useState(!1),[G,V]=m.useState({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),[ee,ae]=m.useState(!1),[fe,Ae]=m.useState(!1),ce="-perpEquity",[ye,Ne]=m.useState(ce),be=Pt=>e.sort((Xe,Vt)=>{if(Xe.version===3&&Vt.version!==3)return-1;if(Vt.version===3&&Xe.version!==3)return 1;const Yt=Xe.wallet_name?Xe.wallet_name.toUpperCase():"",Ve=Vt.wallet_name?Vt.wallet_name.toUpperCase():"",Ke=Xe.wallet_address?Xe.wallet_address.toLowerCase():"",ft=Vt.wallet_address?Vt.wallet_address.toLowerCase():"";return Pt==="wallet_name"?Yt<Ve?-1:Yt>Ve?1:0:Pt==="-wallet_name"?Yt>Ve?-1:Yt<Ve?1:0:Pt==="-wallet_address"?Ke<ft?-1:Ke>ft?1:0:Pt==="wallet_address"?Ke>ft?-1:Ke<ft?1:0:Pt==="-wallet_created_data"?new Date(Vt.wallet_created_data)-new Date(Xe.wallet_created_data):Pt==="wallet_created_data"?new Date(Xe.wallet_created_data)-new Date(Vt.wallet_created_data):Pt==="-perpEquity"?Vt.perpEquity-Xe.perpEquity:Pt==="perpEquity"?Xe.perpEquity-Vt.perpEquity:Pt==="-unrealizedPnl"?Vt.unrealizedPnl-Xe.unrealizedPnl:Pt==="unrealizedPnl"?Xe.unrealizedPnl-Vt.unrealizedPnl:Pt==="-marginUsed"?Vt.marginUsed-Xe.marginUsed:Pt==="marginUsed"?Xe.marginUsed-Vt.marginUsed:Pt==="-withdrawableUsdc"?Vt.withdrawableUsdc-Xe.withdrawableUsdc:Pt==="withdrawableUsdc"?Xe.withdrawableUsdc-Vt.withdrawableUsdc:0}),je=async(Pt,Xe,Vt)=>{if(!Pt||!Xe||!Vt){console.error("Delete order called with invalid parameters"),on.error("Delete order called with invalid parameters");return}const Yt=`${Pt}_${Xe}`;try{Y(At=>({...At,[Yt]:!0}));const Ve=window.localStorage.getItem("hyperToken"),Ke="https://dextrabothypev2.nftinit.io/api/wallet/delete";if(!Ve){v(!0),Y(At=>({...At,[Yt]:!1}));return}const ft=window.localStorage.getItem("hyperAddress"),en=await fetch(Ke,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:C?C.toLowerCase():ft,token:Ve,wallet_id:Pt.toString()})});if(!en.ok)throw new Ml(`Server responded with status ${en.status}`);const Dt=await en.json();Dt.success?(u(),V({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),ae(!1),Ae(!1),oe(!1),Y(At=>({...At,[Yt]:!1})),on.success(i.jsxs(i.Fragment,{children:[i.jsx("span",{children:Vt.slice(0,5)+"..."+Vt.slice(-3)}),i.jsxs("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:[" ","removed from generated wallets"]})]}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"440px",minWidth:"440px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})):(console.log(Dt.error_message),on.error(Dt.error_message),Y(At=>({...At,[Yt]:!1})))}catch(Ve){console.error("Error deleting wallet:",Ve),on.error(Ve.message),Y(Ke=>({...Ke,[Yt]:!1}))}},Ie=m.useRef(null),Re=()=>{Ie.current&&(Ie.current.scrollLeft-=100)},Qe=()=>{Ie.current&&(Ie.current.scrollLeft+=100)},Be=()=>{Ie.current&&(Ie.current.scrollTop+=200)},it=()=>{Ie.current&&(Ie.current.scrollTop-=200)},tt=Pt=>Pt>=640&&Pt<1024?4:Pt>=1024&&Pt<1240?7:Pt>=1240&&Pt<1540||Pt>=1540?8:3,[at,dt]=m.useState(null),[ct,Ut]=m.useState(!1),[kt,tn]=m.useState(!1);m.useEffect(()=>{const Pt=()=>{tn(window.innerWidth<640)};return window.addEventListener("resize",Pt),Pt(),()=>window.removeEventListener("resize",Pt)},[]);const jt=Pt=>{kt&&(dt(Pt),Ut(!0))};m.useEffect(()=>{const Pt=window.location.hash;if(!Pt)return;const Xe=Pt.split("#").filter(Boolean);Xe.includes("add-account")&&(g(!0),Xe[0]==="hyperliquid"&&(f("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")),Xe[0]==="lighter"&&(f("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")),Xe[0]==="extended"&&(f("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED")))},[]);const un=Pt=>{g(!1),Pt==="HYPER"?(window.history.replaceState(null,"",`${window.location.pathname}#hyperliquid`),f("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")):Pt==="LIGHTER"?(window.history.replaceState(null,"",`${window.location.pathname}#lighter`),f("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")):Pt==="EXTENDED"&&(window.history.replaceState(null,"",`${window.location.pathname}#extended`),f("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED"))};return i.jsxs(i.Fragment,{children:[i.jsx(Lce,{open:U,setOpen:L,data:e,walletData:I,withdrawableUsdc:z,setWithdrawableUsdc:X,modalWalletId:R,setModalWalletId:F}),i.jsx(Bce,{open:ne,setOpen:J,walletAddress:Z}),i.jsx($ce,{open:ie,setOpen:oe,handleDeleteWallet:je,deleteWalleInfo:G,confirmClosePositions:ee,setConfirmClosePositions:ae,confirmWithdrawEquity:fe,setConfirmWithdrawEquity:Ae}),i.jsx(rp,{isOpen:ct,onClose:()=>Ut(!1),children:i.jsx(Uce,{rowData:at})}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full sm:min-h-[340px] max-h-max font-manrope relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-10  pl-2 sm:pl-0 pt-4",children:[i.jsxs("div",{className:"hidden sm:flex flex-col items-start justify-start gap-2 font-manrope min-w-max bg-[#161616] ",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px]",children:"Wallet Management"})})]}),i.jsxs("div",{className:"flex flex-col items-start lg:flex-row lg:justify-start lg:items-center gap-1 lg:gap-10",children:[i.jsx(Dce,{handleListRequest:u,handlePageChange:a,isGenWalletModal:x,setIsGenWalletModal:g}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(GY,{title:"HYPER",label:"HYPERLIQUID",walletLength:o,handleSelectMenuChange:un,isSelectMenu:d}),i.jsx(GY,{title:"LIGHTER",label:"LIGHTER",walletLength:l,handleSelectMenuChange:un,isSelectMenu:d}),i.jsx(GY,{title:"EXTENDED",label:"EXTENDED",walletLength:c,handleSelectMenuChange:un,isSelectMenu:d})]})]})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"absolute -top-5 right-4 z-10 hidden justify-start items-center gap-2",children:[i.jsx("button",{onClick:Re,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:Qe,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:it,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:Be,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{className:"w-full h-auto sm:h-max max-w-[100%] overflow-scroll relative flex-grow",ref:Ie,children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] sm:left-0 h-8 pl-3 min-w-[120px] sm:min-w-[140px] z-[8]",children:i.jsx(ci,{title:"Name",sortKey:"wallet_name",sortOption:ye,setSortOption:Ne,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] sm:left-[140px] h-10 px-1 min-w-[160px] sm:min-w-[190px] z-[8]",children:i.jsx(ci,{title:"Follower Wallet",sortKey:"wallet_address",sortOption:ye,setSortOption:Ne,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[110px] sm:min-w-[110px] px-1 hidden sm:table-cell",children:i.jsx(ci,{title:"Creation Date",sortKey:"wallet_created_data",sortOption:ye,setSortOption:Ne,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[120px] sm:min-w-[120px] px-1",children:i.jsx(ci,{title:"Perp Equity",sortKey:"perpEquity",sortOption:ye,setSortOption:Ne,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[134px] sm:min-w-[134px] px-1",children:i.jsx(ci,{title:"uPnL",sortKey:"unrealizedPnl",sortOption:ye,setSortOption:Ne,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[104px] sm:min-w-[104px] px-1 hidden sm:table-cell",children:i.jsx(ci,{title:"Margin",sortKey:"marginUsed",sortOption:ye,setSortOption:Ne,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[130px] sm:min-w-[130px] px-1 hidden sm:table-cell",children:i.jsx(ci,{title:"Avail. Balance",sortKey:"withdrawableUsdc",sortOption:ye,setSortOption:Ne,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[330px] sm:min-w-[330px] pl-1 pr-4 hidden sm:table-cell",children:i.jsx("div",{className:"font-medium flex items-center justify-start w-full min-w-max",children:i.jsx("div",{className:"flex items-center justify-end w-full"})})})]})}),i.jsx("tbody",{children:!e||t?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:tt(window.innerWidth),children:i.jsx("div",{className:"fixed top-1/3 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-10 min-h-[30vh] flex flex-col justify-center items-center",children:i.jsx(Ma,{})})})}):n&&!e?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:tt(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[30vh] flex-col justify-center items-center top-[7%] lg:top-[10%] left-[20%] sm:left-[40%] lg:left-[50%] 2xl:left-[45%] z-10",children:i.jsx(Ml,{})})})}):(e==null?void 0:e.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:tt(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[30vh] flex-col justify-center items-center top-[7%] lg:top-[15%] left-[20%] sm:left-[40%] lg:left-[50%] 2xl:left-[45%] z-10",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3  ml-1 sm:-ml-16",children:[i.jsx("img",{src:ec,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"You have not created a wallet yet."}),i.jsxs("div",{className:"text-center -mt-2",children:[i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["Please use the"," "]}),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"'Add Account'"}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:[" ","button to create a wallet."]})]})]})]})})})})}):(cn=be(ye))==null?void 0:cn.map((Pt,Xe)=>{const Vt=!isNaN(Pt==null?void 0:Pt.perpEquity)&&!isNaN(Pt==null?void 0:Pt.marginUsed)?(Pt==null?void 0:Pt.perpEquity)-(Pt==null?void 0:Pt.marginUsed):0,Yt=kt?{onClick:()=>jt(Pt),className:"cursor-pointer"}:{};return i.jsxs("tr",{...Yt,className:`${Xe%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[44px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${Xe%2==0,"bg-[#161616]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 h-[44px] max-h-[44px] ",children:(Pt==null?void 0:Pt.version)==3?i.jsx(fi,{content:"This is an API wallet created from your login wallet. It enables copy trading without withdrawal permissions, keeping your funds safe.",children:i.jsxs("div",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5 min-w-max",children:(Pt==null?void 0:Pt.wallet_name.length)>=12?(Pt==null?void 0:Pt.wallet_name).slice(0,12)+"... (API-AGENT) Wallet":(Pt==null?void 0:Pt.wallet_name)+"(API-AGENT) Wallet"}),(Pt==null?void 0:Pt.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(_a,{content:`${Pt==null?void 0:Pt.wallet_name}`,positionTop:!0,alignRight:!1})}),i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 ml-1"})]})}):i.jsxs("div",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5",children:(Pt==null?void 0:Pt.wallet_name.length)>=12?(Pt==null?void 0:Pt.wallet_name).slice(0,12)+"...":Pt==null?void 0:Pt.wallet_name}),(Pt==null?void 0:Pt.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(_a,{content:`${Pt==null?void 0:Pt.wallet_name}`,positionTop:!0,alignRight:!1})})]})})}),i.jsx("td",{scope:"row",className:`${Xe%2===0,"bg-[#161616]"} sm:sticky sm:left-[140px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4  min-h-[44px] max-h-[44px]",children:i.jsxs("div",{onClick:()=>{window.open(`/wallet-details/${Pt==null?void 0:Pt.wallet_address}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-[44px] max-h-[44px] cursor-pointer",children:[i.jsx("div",{className:"fle justify-center items-center",children:i.jsx("div",{className:"w-4 h-4 sm:w-6 sm:h-6 bg-[#4a4a4a] rounded-full",children:i.jsx("img",{src:Hi,alt:"",className:"w-4 h-4 sm:w-6 sm:h-6"})})}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx(ra,{info1:`${(Pt==null?void 0:Pt.wallet_address).slice(0,5)+"..."+(Pt==null?void 0:Pt.wallet_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:Ve=>{Ve.stopPropagation(),navigator.clipboard.writeText(Pt==null?void 0:Pt.wallet_address),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:bo,alt:"",className:"cursor-pointer"})]})]})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsx("div",{className:"flex flex-col items-start gap-0.5",children:i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5",children:(Pt==null?void 0:Pt.wallet_created_data)&&d3(Pt==null?void 0:Pt.wallet_created_data)})})}),i.jsx("td",{children:i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5 text-white",children:r?"Loading...":(Pt==null?void 0:Pt.perpEquity)!=0&&!isNaN(Pt==null?void 0:Pt.perpEquity)?`$${Er(Pt==null?void 0:Pt.perpEquity)}`:"$0"})})}),i.jsx("td",{children:i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:`${(Pt==null?void 0:Pt.unrealizedPnl)>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"} text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5`,children:r?i.jsx("span",{className:"text-white",children:"Loading..."}):(Pt==null?void 0:Pt.unrealizedPnl)!=0&&!isNaN(Pt==null?void 0:Pt.unrealizedPnl)?`$${Er(Math.abs(Pt==null?void 0:Pt.unrealizedPnl))}`:"$0"})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5",children:r?i.jsx("span",{className:"text-white",children:"Loading..."}):(Pt==null?void 0:Pt.marginUsed)!=0&&!isNaN(Pt==null?void 0:Pt.marginUsed)?`$${Er(Pt==null?void 0:Pt.marginUsed)}`:"$0"})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:`${!r&&Vt<0?"text-[#ff6b6b]":"text-white"} text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5`,children:r?i.jsx("span",{children:"Loading..."}):isNaN(Vt)?"$0":`$${Er(Math.abs(Vt))}`})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsxs("div",{className:"flex items-center justify-end gap-2 pr-3",children:[(Pt==null?void 0:Pt.version)===3?i.jsx(fi,{content:"Deposits are not available for API wallets. Please fund your login wallet on Hyperliquid to start trading.",children:i.jsxs("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:[i.jsx(fy,{className:"text-[#848484] w-[14px] h-[14px] rotate-180"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Deposit"})]})}):i.jsxs("div",{onClick:()=>{J(!0),re(Pt==null?void 0:Pt.wallet_address)},className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex cursor-pointer",children:[i.jsx(fy,{className:"text-[#848484] w-[14px] h-[14px] rotate-180"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Deposit"})]}),(Pt==null?void 0:Pt.version)===3?i.jsx(fi,{content:"Withdrawals cannot be made with API wallets. Use your login wallet on Hyperliquid for withdrawals.",children:i.jsxs("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:[i.jsx(fy,{className:"text-[#848484] w-[14px] h-[14px]"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Withdraw"})]})}):i.jsxs("div",{onClick:()=>{X(Pt==null?void 0:Pt.withdrawableUsdc),L(!0),P(Pt==null?void 0:Pt.wallet_address),F(Pt==null?void 0:Pt.wallet_id)},className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex cursor-pointer",children:[i.jsx(fy,{className:"text-[#848484] w-[14px] h-[14px]"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Withdraw"})]}),he[`${Pt==null?void 0:Pt.wallet_id}_${Pt==null?void 0:Pt.wallet_name.toLowerCase()}`]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[90px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):(Pt==null?void 0:Pt.version)===3?i.jsx(fi,{content:"API wallets cannot be deleted here. To remove this wallet, please delete it from the Hyperliquid API page.",children:i.jsx("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Delete"})})}):i.jsx("div",{onClick:()=>{V({wallet:Pt==null?void 0:Pt.wallet_address,walletId:Pt==null?void 0:Pt.wallet_id,walletName:Pt==null?void 0:Pt.wallet_name.toLowerCase(),unrealizedPnL:Pt==null?void 0:Pt.unrealizedPnl,perpEquity:Pt==null?void 0:Pt.perpEquity}),oe(!0)},className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Delete"})})]})})]},Xe)})})]})})]}),i.jsxs("div",{className:`flex justify-start items-center gap-2 absolute top-[10px] sm:top-6 right-1 sm:translate-x-0 sm:right-2
`,children:[i.jsx("button",{onClick:()=>a(s-1),disabled:s===1,className:`${s===1?"cursor-not-allowed":"cursor-pointer"} h-8 px-2 sm:px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex bg-transparent`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Previous"})}),i.jsxs("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px] w-20 sm:w-auto text-center",children:["Page ",s," / ",Math.ceil(o.length/N)]}),i.jsx("button",{onClick:()=>a(s+1),disabled:s*N>=o.length,className:`${s*N>=o.length?"cursor-not-allowed":"cursor-pointer"} h-8 px-2 sm:px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex bg-transparent`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Next"})})]})]})]})},GY=({title:e,label:t,handleSelectMenuChange:n,isSelectMenu:r,walletLength:s})=>i.jsxs("div",{onClick:()=>n(e),className:`${r==e?"bg-[#67ffbd]/20 text-[#67FFBD]":"bg-transparent text-[#9b9b9b]"} ${e==="HYPER"?"gap-1":e==="LIGHTER"?"gap-0.5":"gap-1"}  text-[13px] font-medium font-manrope leading-[8px] cursor-pointer flex justify-center items-center min-w-max rounded-md px-[6px] sm:px-[10px] h-[22px]`,children:[e==="HYPER"?i.jsx("img",{src:ax,alt:"hyper",className:"w-4 h-4 rounded-sm"}):e==="LIGHTER"?i.jsx(Hf,{className:"w-4 h-4 text-[#fff]"}):e==="EXTENDED"?i.jsx("img",{src:"https://app.extended.exchange/assets/logo/extended.svg",alt:"Extended",className:"h-[20px] text-white -ml-0.5"}):null,`${t} (${(s==null?void 0:s.length)>0?"⚡"+(s==null?void 0:s.length)+" wallet":"🔌 Not Connected"}) `]});function KUe({open:e,setOpen:t,data:n,setShare:r,setTradeInfo:s}){const a=m.useRef(null),o=async()=>{if(a.current)try{await document.fonts.ready,await new Promise(v=>setTimeout(v,500));const x=await j1(a.current,{cacheBust:!0,backgroundColor:null,useCORS:!0,style:{transform:"scale(1)",transformOrigin:"top left"}}),g=document.createElement("a");g.href=x,g.download="dextrabot.png",document.body.appendChild(g),g.click(),document.body.removeChild(g),on.success("PNG successfully downloaded!")}catch(x){console.error("Error generating PNG:",x),on.error("Failed to download PNG.")}},[l,c]=m.useState(),[u,d]=m.useState(!0),f=async x=>{d(!0);try{const v=await(await fetch(`https://api.allorigins.win/raw?url=${encodeURIComponent(x)}`)).blob();return new Promise((w,C)=>{const N=new FileReader;N.onloadend=()=>w(N.result),N.onerror=C,N.readAsDataURL(v)})}catch(g){throw console.error("Image conversion failed:",g),g}finally{d(!1)}};return m.useEffect(()=>{n!=null&&n.coin&&f(`https://app.hyperliquid.xyz/coins/${n==null?void 0:n.coin}.svg`).then(x=>c(x)).catch(()=>c(Ua))},[n==null?void 0:n.coin]),i.jsxs(ga,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 scale-75",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-max relative bg-[#1b1b1b] rounded-2xl",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1),r(!1),setTimeout(()=>{s(x=>({...x,coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,pnl:0}))},300)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Oa})})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-4 w-full",children:[i.jsx("div",{className:"flex justify-start items-center w-full pt-6 pl-6 text-white text-base font-semibold font-manrope leading-[8px]",children:"Share PnL"}),i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 px-2 pb-2.5",children:[i.jsx("div",{ref:a,style:{overflow:"visible",position:"relative"},className:"w-[858px] h-[608px] rounded-2xl border border-dashed border-[#353535] justify-center items-center inline-flex overflow-hidden",children:i.jsxs("div",{className:"w-[850px] h-[600px] rounded-xl flex justify-start items-center bg-[#0F1211]",children:[i.jsx("div",{className:"flex justify-start items-center w-[502px] max-h-[600px] bg-[#0F1211] rounded-xl share-pnl-background",children:i.jsxs("div",{className:"flex flex-col items-start gap-4 px-[22px] py-[40px] h-full w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-4 relative",children:[i.jsx("img",{src:jA,alt:"",className:"w-12 h-12 max-w-12 min-h-12"}),i.jsx("p",{className:"flex justify-center items-center text-white text-2xl font-semibold font-manrope",children:"Dextrabot - Copy Trade"})]}),i.jsxs("div",{className:"flex flex-col items-start justify-start ",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2 relative mt-6",children:[i.jsx("div",{className:"w-8 h-8 rounded-full flex justify-center items-center",children:i.jsx("div",{className:"w-8 h-8 rounded-full flex justify-center items-center",children:u?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[34px] px-0.5 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("img",{src:l||Ua,alt:"",className:"rounded-full w-8 h-8",loading:"lazy",onError:x=>ea(x)})})}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope flex items-center",children:n!=null&&n.coin?n==null?void 0:n.coin:"--"}),i.jsx("div",{className:`${(n==null?void 0:n.type)=="Long"?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff787b]"} h-9 w-20 min-w-[80px] px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope uppercase tracking-wide`,children:n!=null&&n.type?n==null?void 0:n.type:"--"}),i.jsxs("div",{className:`${(n==null?void 0:n.type)=="Long"?"bg-[#67ffbd]/20 text-[#67ffbd]":"bg-[#ff797c]/20 text-[#ff787b]"} h-9 w-16 min-w-[64px] px-3 flex-shrink-0 rounded-md flex justify-center items-center text-[20px] font-semibold font-manrope tracking-wide`,children:[n!=null&&n.leverage?n==null?void 0:n.leverage:"--","x"]})]}),i.jsxs("div",{className:`${(n==null?void 0:n.roe)>=0?"text-[#67ffbd]":"text-[#ff6767]"} text-[86px] font-semibold font-manrope leading-[92px] inline-flex justify-center items-center min-w-max`,children:[(n==null?void 0:n.roe)>=0?"+":"-",ro(Math.abs(n==null?void 0:n.roe)),"%"]})]}),i.jsxs("div",{className:"flex justify-start items-start gap-[45px] pt-[12px]",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"UNREALIZED PNL"}),i.jsx("div",{className:`${(n==null?void 0:n.pnl)>=0?"text-[#67ffbd]":"text-[#ff787b]"} text-[32px] font-semibold font-manrope leading-none flex`,children:n!=null&&n.pnl?`$${ro(Math.abs(n==null?void 0:n.pnl))}`:ro(Math.abs(n==null?void 0:n.pnl))})]}),i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"ENTRY PRICE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.entryPrice?`$${ly(n==null?void 0:n.entryPrice)}`:ly(n==null?void 0:n.entryPrice)})]})]}),i.jsx("div",{className:"flex justify-start items-start gap-[45px] pt-[12px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope tracking-wider flex",children:"MARK PRICE"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.markPrice?`$${ly(n==null?void 0:n.markPrice)}`:ly(n==null?void 0:n.markPrice)})]})}),i.jsx("div",{className:"flex justify-start items-start gap-[65px] pt-[26px]",children:i.jsxs("div",{className:"flex flex-col justify-start items-start gap-[2px] max-h-max",children:[i.jsx("div",{className:"text-white/50 text-lg font-medium font-manrope leading-loose tracking-wider flex",children:"REFERRAL"}),i.jsx("div",{className:"text-white text-[32px] font-semibold font-manrope leading-none flex",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]})}),i.jsx("div",{className:"flex justify-start items-start pt-[1px]",children:i.jsx("div",{className:"text-[#828483] text-lg font-medium font-manrope leading-loose tracking-wide",children:n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"})})]})}),i.jsx("div",{className:"flex justify-center items-center h-[600px] max-h-[600px] bg-[#0F1211] rounded-tr-xl rounded-br-xl max-w-[378px] overflow-hidden",children:n!=null&&n.roe&&(n==null?void 0:n.roe)>=0?i.jsx("img",{src:NA,alt:"",className:"h-full"}):i.jsx("img",{src:AA,alt:"",className:"h-full"})})]})}),i.jsxs("div",{className:"flex flex-col items-start justify-between gap-4 w-[400px] h-[600px] bg-[#232323] rounded-2xl p-4",children:[i.jsxs("div",{className:"flex flex-col justify-start items-start w-full gap-4",children:[i.jsx("div",{className:"text-white text-base font-semibold font-manrope leading-[21px]",children:"Customization"}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Referral Code"}),i.jsxs("div",{className:"flex justify-start items-center gap-2 px-2.5 w-full h-8 bg-[#1b1b1b] rounded-md border border-[#303030]",children:[i.jsx("div",{className:"text-[#7b7b7b] text-sm font-medium font-inter leading-[8px]",children:"#"}),i.jsx("div",{className:"text-white text-sm font-medium font-inter leading-[8px]",children:n!=null&&n.referral?n==null?void 0:n.referral:"--"})]}),i.jsx("div",{className:"text-[#b1b1b1] text-[13px] font-semibold font-manrope leading-[8px] pt-0.5",children:"Comment"}),i.jsx("div",{className:"flex justify-start items-center gap-2 p-2 w-full h-max bg-[#1b1b1b] rounded-lg border border-[#303030]",children:i.jsx("div",{className:"w-max text-[#909090] text-sm font-normal font-inter leading-[18px]",children:n!=null&&n.referral?i.jsxs("span",{children:["Profit like the pros! 🤑 Copy top traders automatically with Dextrabot. Use my referral"," ",n==null?void 0:n.referral," & save 4% on fees! @Dextrabot 🚀"]}):i.jsx("span",{children:"Profit like the pros! 🤑 Copy top traders automatically with @Dextrabot 🚀"})})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-2.5 w-full",children:[i.jsx("div",{onClick:x=>{x.stopPropagation(),navigator.clipboard.writeText(n!=null&&n.referral?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},className:"w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Copy URL"})}),i.jsx("div",{onClick:x=>{x.preventDefault(),u||o()},className:`${u?"cursor-not-allowed":"cursor-pointer"} w-full h-8 px-4 py-3 rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#353535] justify-center items-center gap-2.5 inline-flex has-tooltip relative`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:u?"Hang tight! Your image is on the way... 🚀":"Download PNG"})}),i.jsx("a",{href:`https://x.com/intent/post?url=${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`https://app.dextrabot.com/referral/${n==null?void 0:n.referral}`:"https://app.dextrabot.com"}&text=Profit%20like%20the%20pros!%20🤑%20Copy%20top%20traders%20automatically${n!=null&&n.referral&&(n==null?void 0:n.referral)!=="--"?`%20with%20Dextrabot.%20Use%20my%20referral%20${n==null?void 0:n.referral}%20and%20save%204%25%20on%20fees!`:"%20with%20%40Dextrabot"}%20🚀%0A`,target:"_blank",className:"w-full h-8 px-6 py-3 bg-white rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#363636] text-[13px] font-medium font-inter leading-[8px]",children:"Share on X"})})]})]})]})]})]})})})})})]})}const dan=({data:e})=>{const{isConnected:t,address:n}=Yr(),{setSignModalOpen:r,hyperToken:s,isReferralCodeName:a}=m.useContext(Gr),[o,l]=m.useState("");m.useState({});const[c,u]=m.useState(!1),[d,f]=m.useState(""),[x,g]=m.useState(!1),v=m.useRef(null),w=m.useRef(null),[C,N]=m.useState(!1),[I,P]=m.useState(!1),[R,F]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",pnl:0}),U="-unrealizedPnl",[L,z]=m.useState(U),[X,ne]=m.useState([]),[J,Z]=m.useState(!1);m.useEffect(()=>{if(e.length===0||J)return;const fe=e.reduce((Ae,ce)=>parseFloat(ce.perpEquity||0)>parseFloat(Ae.perpEquity||0)?ce:Ae);fe.wallet_address&&l(fe.wallet_address)},[e,J]);const re=(fe,Ae,ce)=>{const ye=fe==null?void 0:fe.filter(Ne=>Ne&&Ne.walletAddress&&Ne.asset).filter(Ne=>{var be,je;return ce?(je=(be=Ne==null?void 0:Ne.asset)==null?void 0:be.toString())==null?void 0:je.toUpperCase().includes(ce.toUpperCase()):!0});return ye==null?void 0:ye.sort((Ne,be)=>{const je=Ne.wallet_name?Ne.wallet_name.toUpperCase():"",Ie=be.wallet_name?be.wallet_name.toUpperCase():"",Re=Ne.tag?Ne.tag.toUpperCase():"",Qe=be.tag?be.tag.toUpperCase():"",Be=Ne.asset?Ne.asset.toUpperCase():"",it=be.asset?be.asset.toUpperCase():"",tt=Ne.type==="Long"?1:0,at=be.type==="Long"?1:0,dt=Ne.type==="Short"?1:0,ct=be.type==="Short"?1:0;return Ae==="wallet_name"?je<Ie?-1:je>Ie?1:0:Ae==="-wallet_name"?je>Ie?-1:je<Ie?1:0:Ae==="-unrealizedPnl"?be.unrealizedPnl-Ne.unrealizedPnl:Ae==="unrealizedPnl"?Ne.unrealizedPnl-be.unrealizedPnl:Ae==="-roe"?be.roe-Ne.roe:Ae==="roe"?Ne.roe-be.roe:Ae==="-size"?be.size-Ne.size:Ae==="size"?Ne.size-be.size:Ae==="-entryPrice"?be.entryPrice-Ne.entryPrice:Ae==="entryPrice"?Ne.entryPrice-be.entryPrice:Ae==="-currentPrice"?be.currentPrice-Ne.currentPrice:Ae==="currentPrice"?Ne.currentPrice-be.currentPrice:Ae==="-leverage"?be.leverage-Ne.leverage:Ae==="leverage"?Ne.leverage-be.leverage:Ae==="-positionValue"?be.positionValue-Ne.positionValue:Ae==="positionValue"?Ne.positionValue-be.positionValue:Ae==="-marginUsed"?be.marginUsed-Ne.marginUsed:Ae==="marginUsed"?Ne.marginUsed-be.marginUsed:Ae==="funding"?be.funding-Ne.funding:Ae==="-funding"?Ne.funding-be.funding:Ae==="-liquidationPrice"?be.liquidationPrice-Ne.liquidationPrice:Ae==="liquidationPrice"?Ne.liquidationPrice-be.liquidationPrice:Ae==="-tag"?Re<Qe?-1:Re>Qe?1:0:Ae==="tag"?Re>Qe?-1:Re<Qe?1:0:Ae==="-coin"?Be<it?-1:Be>it?1:0:Ae==="coin"?Be>it?-1:Be<it?1:0:Ae==="-type_leverage"?tt!==at?at-tt:be.leverage-Ne.leverage:Ae==="type_leverage"?dt!==ct?ct-dt:be.leverage-Ne.leverage:0})},he=async fe=>{if(fe===""&&X.filter(Ae=>Ae!==void 0).length===0||fe===""&&re(X,L,d).length===0||re(X,L,d).length===0){on.success("There are no open positions to close.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}if(fe===""&&(e==null?void 0:e.length)>0){const Ae=re(X,L,d),ce=[...new Set(Ae.map(ye=>ye.wallet_id))];if(ce.length===0){on.success("There are no open positions to close.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}try{if(u(!0),!window.localStorage.getItem("hyperToken")){r(!0),u(!1);return}await Promise.all(ce.map(Ne=>Y(Ne,!1))),on.success("All close order operations successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",width:"400px",minWidth:"400px",height:"60px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})}catch(ye){console.error("Error closing all orders:",ye)}finally{u(!1)}return}await Y(fe)},Y=async(fe,Ae=!0)=>{if(X.filter(ce=>ce!==void 0).length===0){on.success("There are no open positions to closes.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}if(!fe){console.error("Close order called with invalid parameters"),on.error("Close order called with invalid parameters");return}try{u(!0);const ce=window.localStorage.getItem("hyperToken"),ye="https://dextrabothypev2.nftinit.io/api/hyper/order/close_order_all_new/";if(!ce){r(!0),u(!1);return}const Ne=window.localStorage.getItem("hyperAddress"),be=await fetch(ye,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():Ne,token:ce,wallet_id:fe.toString()})});if(!be.ok)throw new Error(`Server responded with status ${be.status}`);const je=await be.json();je.status=="ok"?(u(!1),Ae&&on.success("Close order operation successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px",width:"400px",minWidth:"400px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):je.success?(u(!1),Ae&&on.success("There are no open positions to close.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})):(console.log("Close order operation failed."),on.error("Close order operation failed."),u(!1))}catch(ce){throw console.error("Something went wrong!"),on.error("Something went wrong!"),u(!1),ce}},[ie,oe]=m.useState(!1);m.useEffect(()=>{const fe=()=>{(localStorage.getItem("walletManagementInfo")!==void 0||localStorage.getItem("walletManagementInfo")!==null)&&Date.now()-Number(localStorage.getItem("walletManagementInfo"))>=864e5&&oe(!0)};fe();const Ae=setInterval(()=>{fe()},1e3*60*30);return()=>{clearInterval(Ae)}},[]);const G=async fe=>{try{const Ae=window.localStorage.getItem("hyperToken"),ce="https://dextrabothypev2.nftinit.io/api/hyper/following/position_info/";if(!Ae){r(!0);return}const ye=fe==null?void 0:fe.filter(Ie=>Ie&&Ie.walletAddress&&Ie.asset).map(Ie=>({wallet:Ie.walletAddress,coin:Ie.asset})),Ne=window.localStorage.getItem("hyperAddress"),je=await(await fetch(ce,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():Ne,token:Ae,positions:ye})})).json();je.success?ne(Ie=>Ie.map(Re=>{const Qe=je==null?void 0:je.data.find(Be=>(Be==null?void 0:Be.wallet)===(Re==null?void 0:Re.walletAddress)&&(Be==null?void 0:Be.coin)===(Re==null?void 0:Re.asset));return{...Re,tag:Qe==null?void 0:Qe.tag,tagWallet:Qe==null?void 0:Qe.cp_wallet}})):(console.log(je.error_message),on.error(je.error_message))}catch(Ae){console.error("Error tag request",Ae),on.error(Ae.message)}},V=m.useRef(X==null?void 0:X.filter(fe=>(fe==null?void 0:fe.walletAddress)&&(fe==null?void 0:fe.asset)).length),ee=m.useRef(),ae=m.useRef(!0);return m.useEffect(()=>{const fe=X==null?void 0:X.filter(ce=>ce!==void 0&&(ce==null?void 0:ce.walletAddress)&&(ce==null?void 0:ce.asset)),Ae=fe==null?void 0:fe.length;if(Ae>0&&Ae>V.current){const ce=o===""?X:X.filter(ye=>(ye==null?void 0:ye.wallet_id)==o);ae.current?(G(ce),ae.current=!1):(ee.current&&clearTimeout(ee.current),ee.current=setTimeout(()=>{G(ce)},5e3))}V.current=Ae},[X]),m.useEffect(()=>{if((X==null?void 0:X.filter(fe=>fe!==void 0&&(fe==null?void 0:fe.walletAddress)&&(fe==null?void 0:fe.asset)).length)>0){const fe=o==""?X:X==null?void 0:X.filter(Ae=>(Ae==null?void 0:Ae.wallet_id)==o);(fe==null?void 0:fe.length)>0&&G(fe)}},[o]),m.useEffect(()=>{function fe(Ae){v.current&&!v.current.contains(Ae.target)&&setIsDropdownOpen(!1),w.current&&!w.current.contains(Ae.target)&&g(!1)}return document.addEventListener("mousedown",fe),()=>document.removeEventListener("mousedown",fe)},[]),i.jsx(i.Fragment,{children:i.jsxs(i.Fragment,{children:[i.jsx(KUe,{open:C,setOpen:N,data:R,setShare:P,setTradeInfo:F}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full min-h-[500px] max-h-max font-manrope relative sm:pt-10",children:[i.jsxs("div",{className:"flex items-center justify-start gap-4",children:[i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px] w-full",children:"Manage Positions"}),i.jsx("div",{className:"flex sm:hidden items-center justify-end w-full gap-1 min-w-max",children:i.jsx("div",{className:"flex items-center justify-end group",children:i.jsxs("div",{onClick:fe=>{fe.preventDefault(),c||he(o)},className:"h-[26px] pl-1 pr-2 py-1.5 bg-[#67ffbd]/20 hover:bg-[#67ffbd]/30 rounded-md inline-flex justify-start items-center gap-2 cursor-pointer",children:[i.jsx("div",{className:"",children:i.jsx("img",{src:tae,alt:"",className:"w-4 h-4"})}),c?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[66px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{className:"justify-start text-[#67ffbd] text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Fast Close All"})]})})})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("span",{className:"font-bold min-w-[200px] lg:min-w-max text-xs sm:text-[14px]",children:"Select wallet to see your current positions:"}),i.jsxs("select",{className:"rounded-md py-0.5 bg-[#303030] text-white text-md outline-none w-full h-8 min-w-[150px] px-2",onChange:fe=>{l(fe.target.value),Z(!0)},value:o,children:[i.jsx("option",{value:"",children:"All"}),e==null?void 0:e.map(fe=>i.jsx("option",{value:fe==null?void 0:fe.wallet_address,children:`${fe==null?void 0:fe.wallet_name} - (${(fe==null?void 0:fe.wallet_address).slice(0,5)+"..."+(fe==null?void 0:fe.wallet_address).slice(-4)})`},fe==null?void 0:fe.wallet_id))]})]}),ie&&i.jsxs("div",{className:"hidden sm:flex justify-center items-center ml-10 h-16 pl-3 py-4 pr-5 bg-[#ff9800]/20 rounded-lg gap-3 w-max min-w-max relative",children:[i.jsx("div",{onClick:fe=>{fe.stopPropagation(),localStorage.setItem("walletManagementInfo",`${Date.now()}`),oe(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute -top-0.5 -right-1.5 w-7 h-7 rounded-full p-0.5 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Oa})})}),i.jsx("img",{src:Kbt,alt:""}),i.jsx("div",{className:"font-semibold flex justify-start items-center  text-white text-md outline-none max-w-[600px]",children:"Make sure you are performing all the actions on Dextrabot for the Copy Trade account. Don't close or open positions manually on Hyperliquid."})]})]}),i.jsx("div",{className:"w-full h-max max-w-[100%] min-h-[60vh] sm:min-h-[36vh] overflow-scroll relative flex-grow",children:i.jsx(WUe,{initialAddress:o,wallets:o===""?e:void 0})})]})]})]})})},fan=({data:e,loading:t,error:n,socketLoading:r,currentPage:s,handlePageChange:a,allWallets:o,handleListRequest:l,isSelectMenu:c,setIsSelectMenu:u,hyperWallet:d,lighterWallet:f,extendedWallet:x})=>{var Pt;const[g,v]=m.useState(!1),{setSignModalOpen:w}=m.useContext(Gr),{isConnected:C,address:N}=Yr(),I=5,[P,R]=m.useState(null),[F,U]=m.useState(null),[L,z]=m.useState(!1),[X,ne]=m.useState(null),[J,Z]=m.useState(!1),[re,he]=m.useState("");m.useState({});const[Y,ie]=m.useState({}),[oe,G]=m.useState(!1),[V,ee]=m.useState({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),[ae,fe]=m.useState(!1),[Ae,ce]=m.useState(!1),ye="-perpEquity",[Ne,be]=m.useState(ye),je=Xe=>e.sort((Vt,Yt)=>{if(Vt.version===3&&Yt.version!==3)return-1;if(Yt.version===3&&Vt.version!==3)return 1;const Ve=Vt.wallet_name?Vt.wallet_name.toUpperCase():"",Ke=Yt.wallet_name?Yt.wallet_name.toUpperCase():"",ft=Vt.wallet_address?Vt.wallet_address.toLowerCase():"",en=Yt.wallet_address?Yt.wallet_address.toLowerCase():"";return Xe==="wallet_name"?Ve<Ke?-1:Ve>Ke?1:0:Xe==="-wallet_name"?Ve>Ke?-1:Ve<Ke?1:0:Xe==="-wallet_address"?ft<en?-1:ft>en?1:0:Xe==="wallet_address"?ft>en?-1:ft<en?1:0:Xe==="-wallet_created_data"?new Date(Yt.wallet_created_data)-new Date(Vt.wallet_created_data):Xe==="wallet_created_data"?new Date(Vt.wallet_created_data)-new Date(Yt.wallet_created_data):Xe==="-perpEquity"?Yt.perpEquity-Vt.perpEquity:Xe==="perpEquity"?Vt.perpEquity-Yt.perpEquity:Xe==="-unrealizedPnl"?Yt.unrealizedPnl-Vt.unrealizedPnl:Xe==="unrealizedPnl"?Vt.unrealizedPnl-Yt.unrealizedPnl:Xe==="-marginUsed"?Yt.marginUsed-Vt.marginUsed:Xe==="marginUsed"?Vt.marginUsed-Yt.marginUsed:Xe==="-withdrawableUsdc"?Yt.withdrawableUsdc-Vt.withdrawableUsdc:Xe==="withdrawableUsdc"?Vt.withdrawableUsdc-Yt.withdrawableUsdc:0}),Ie=async(Xe,Vt,Yt)=>{if(!Xe||!Vt||!Yt){console.error("Delete order called with invalid parameters"),on.error("Delete order called with invalid parameters");return}const Ve=`${Xe}_${Vt}`;try{ie(Je=>({...Je,[Ve]:!0}));const Ke=window.localStorage.getItem("hyperToken"),ft="https://dextrabothypev2.nftinit.io/api/wallet/delete-lighter";if(!Ke){w(!0),ie(Je=>({...Je,[Ve]:!1}));return}const en=window.localStorage.getItem("hyperAddress"),Dt=await fetch(ft,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:N?N.toLowerCase():en,token:Ke,wallet_id:Xe})});if(!Dt.ok)throw new Ml(`Server responded with status ${Dt.status}`);const At=await Dt.json();At.success?(l(),ee({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),fe(!1),ce(!1),G(!1),ie(Je=>({...Je,[Ve]:!1})),on.success(i.jsxs(i.Fragment,{children:[i.jsx("span",{children:Yt.slice(0,5)+"..."+Yt.slice(-3)}),i.jsxs("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:[" ","removed from generated wallets"]})]}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"440px",minWidth:"440px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})):(console.log(At.error_message),on.error(At.error_message),ie(Je=>({...Je,[Ve]:!1})))}catch(Ke){console.error("Error deleting wallet:",Ke),on.error(Ke.message),ie(ft=>({...ft,[Ve]:!1}))}},Re=m.useRef(null),Qe=()=>{Re.current&&(Re.current.scrollLeft-=100)},Be=()=>{Re.current&&(Re.current.scrollLeft+=100)},it=()=>{Re.current&&(Re.current.scrollTop+=200)},tt=()=>{Re.current&&(Re.current.scrollTop-=200)},at=Xe=>Xe>=640&&Xe<1024?4:Xe>=1024&&Xe<1240?7:Xe>=1240&&Xe<1540||Xe>=1540?8:3,[dt,ct]=m.useState(null),[Ut,kt]=m.useState(!1),[tn,jt]=m.useState(!1);m.useEffect(()=>{const Xe=()=>{jt(window.innerWidth<640)};return window.addEventListener("resize",Xe),Xe(),()=>window.removeEventListener("resize",Xe)},[]);const un=Xe=>{tn&&(ct(Xe),kt(!0))};m.useEffect(()=>{const Xe=window.location.hash;if(!Xe)return;const Vt=Xe.split("#").filter(Boolean);Vt.includes("add-account")&&(v(!0),Vt[0]==="hyperliquid"&&(u("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")),Vt[0]==="lighter"&&(u("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")),Vt[0]==="extended"&&(u("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED")))},[]);const cn=Xe=>{v(!1),Xe==="HYPER"?(window.history.replaceState(null,"",`${window.location.pathname}#hyperliquid`),u("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")):Xe==="LIGHTER"?(window.history.replaceState(null,"",`${window.location.pathname}#lighter`),u("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")):Xe==="EXTENDED"&&(window.history.replaceState(null,"",`${window.location.pathname}#extended`),u("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED"))};return i.jsxs(i.Fragment,{children:[i.jsx(Lce,{open:L,setOpen:z,data:e,walletData:P,withdrawableUsdc:X,setWithdrawableUsdc:ne,modalWalletId:F,setModalWalletId:U}),i.jsx(Bce,{open:J,setOpen:Z,walletAddress:re}),i.jsx($ce,{open:oe,setOpen:G,handleDeleteWallet:Ie,deleteWalleInfo:V,confirmClosePositions:ae,setConfirmClosePositions:fe,confirmWithdrawEquity:Ae,setConfirmWithdrawEquity:ce}),i.jsx(rp,{isOpen:Ut,onClose:()=>kt(!1),children:i.jsx(Uce,{rowData:dt})}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full sm:min-h-[340px] max-h-max font-manrope relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-10  pl-2 sm:pl-0 pt-4",children:[i.jsxs("div",{className:"hidden sm:flex flex-col items-start justify-start gap-2 font-manrope min-w-max bg-[#161616] ",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px]",children:"Wallet Management"})})]}),i.jsxs("div",{className:"flex flex-col items-start lg:flex-row lg:justify-start lg:items-center gap-1 lg:gap-10",children:[i.jsx(Dce,{handleListRequest:l,handlePageChange:a,isGenWalletModal:g,setIsGenWalletModal:v}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(KY,{title:"HYPER",label:"HYPERLIQUID",walletLength:d,handleSelectMenuChange:cn,isSelectMenu:c}),i.jsx(KY,{title:"LIGHTER",label:"LIGHTER",walletLength:f,handleSelectMenuChange:cn,isSelectMenu:c}),i.jsx(KY,{title:"EXTENDED",label:"EXTENDED",walletLength:x,handleSelectMenuChange:cn,isSelectMenu:c})]})]})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"absolute -top-5 right-4 z-10 hidden justify-start items-center gap-2",children:[i.jsx("button",{onClick:Qe,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:Be,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:tt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:it,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{className:"w-full h-auto sm:h-max max-w-[100%] overflow-scroll relative flex-grow",ref:Re,children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] sm:left-0 h-8 pl-3 min-w-[120px] sm:min-w-[140px] z-[8]",children:i.jsx(ci,{title:"Name",sortKey:"wallet_name",sortOption:Ne,setSortOption:be,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] sm:left-[140px] h-10 px-1 min-w-[160px] sm:min-w-[190px] z-[8]",children:i.jsx(ci,{title:"Follower Wallet",sortKey:"wallet_address",sortOption:Ne,setSortOption:be,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[110px] sm:min-w-[110px] px-1 hidden sm:table-cell",children:i.jsx(ci,{title:"Creation Date",sortKey:"wallet_created_data",sortOption:Ne,setSortOption:be,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[330px] sm:min-w-[330px] pl-1 pr-4 hidden sm:table-cell",children:i.jsx("div",{className:"font-medium flex items-center justify-start w-full min-w-max",children:i.jsx("div",{className:"flex items-center justify-end w-full"})})})]})}),i.jsx("tbody",{children:!e||t?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:at(window.innerWidth),children:i.jsx("div",{className:"fixed top-1/3 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-10 min-h-[30vh] flex flex-col justify-center items-center",children:i.jsx(Ma,{})})})}):n&&!e?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:at(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[30vh] flex-col justify-center items-center top-[7%] lg:top-[10%] left-[20%] sm:left-[40%] lg:left-[50%] 2xl:left-[45%] z-10",children:i.jsx(Ml,{})})})}):(e==null?void 0:e.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:at(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[30vh] flex-col justify-center items-center top-[7%] lg:top-[15%] left-[20%] sm:left-[40%] lg:left-[50%] 2xl:left-[45%] z-10",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3  ml-1 sm:-ml-16",children:[i.jsx("img",{src:ec,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"You have not created a wallet yet."}),i.jsxs("div",{className:"text-center -mt-2",children:[i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["Please use the"," "]}),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"'Add Account'"}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:[" ","button to create a wallet."]})]})]})]})})})})}):(Pt=je(Ne))==null?void 0:Pt.map((Xe,Vt)=>{!isNaN(Xe==null?void 0:Xe.perpEquity)&&!isNaN(Xe==null?void 0:Xe.marginUsed)&&(Xe==null?void 0:Xe.perpEquity)-(Xe==null?void 0:Xe.marginUsed);const Yt=tn?{onClick:()=>un(Xe),className:"cursor-pointer"}:{};return i.jsxs("tr",{...Yt,className:`${Vt%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[44px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${Vt%2==0,"bg-[#161616]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 h-[44px] max-h-[44px] ",children:(Xe==null?void 0:Xe.version)==3?i.jsx(fi,{content:"This is an API wallet created from your login wallet. It enables copy trading without withdrawal permissions, keeping your funds safe.",children:i.jsxs("div",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5 min-w-max",children:(Xe==null?void 0:Xe.wallet_name.length)>=12?(Xe==null?void 0:Xe.wallet_name).slice(0,12)+"... (API-AGENT) Wallet":(Xe==null?void 0:Xe.wallet_name)+"(API-AGENT) Wallet"}),(Xe==null?void 0:Xe.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(_a,{content:`${Xe==null?void 0:Xe.wallet_name}`,positionTop:!0,alignRight:!1})}),i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 ml-1"})]})}):i.jsxs("div",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5",children:(Xe==null?void 0:Xe.wallet_name.length)>=12?(Xe==null?void 0:Xe.wallet_name).slice(0,12)+"...":Xe==null?void 0:Xe.wallet_name}),(Xe==null?void 0:Xe.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(_a,{content:`${Xe==null?void 0:Xe.wallet_name}`,positionTop:!0,alignRight:!1})})]})})}),i.jsx("td",{scope:"row",className:`${Vt%2===0,"bg-[#161616]"} sm:sticky sm:left-[140px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4  min-h-[44px] max-h-[44px]",children:i.jsxs("div",{onClick:()=>{window.open(`/wallet-details/${Xe==null?void 0:Xe.wallet_address}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-[44px] max-h-[44px] cursor-pointer",children:[i.jsx("div",{className:"fle justify-center items-center",children:i.jsx("div",{className:"w-4 h-4 sm:w-6 sm:h-6 bg-[#4a4a4a] rounded-full",children:i.jsx("img",{src:Hi,alt:"",className:"w-4 h-4 sm:w-6 sm:h-6"})})}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx(ra,{info1:`${(Xe==null?void 0:Xe.wallet_address).slice(0,5)+"..."+(Xe==null?void 0:Xe.wallet_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:Ve=>{Ve.stopPropagation(),navigator.clipboard.writeText(Xe==null?void 0:Xe.wallet_address),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:bo,alt:"",className:"cursor-pointer"})]})]})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsx("div",{className:"flex flex-col items-start gap-0.5",children:i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5",children:(Xe==null?void 0:Xe.wallet_created_data)&&d3(Xe==null?void 0:Xe.wallet_created_data)})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsxs("div",{className:"flex items-center justify-end gap-2 pr-3",children:[i.jsx(fi,{content:"Deposits are currently unavailable.",children:i.jsxs("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:[i.jsx(fy,{className:"text-[#848484] w-[14px] h-[14px] rotate-180"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Deposit"})]})}),i.jsx(fi,{content:"Withdrawals are currently unavailable.",children:i.jsxs("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:[i.jsx(fy,{className:"text-[#848484] w-[14px] h-[14px]"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Withdraw"})]})}),Y[`${Xe==null?void 0:Xe.wallet_id}_${Xe==null?void 0:Xe.wallet_name.toLowerCase()}`]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[90px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):(Xe==null?void 0:Xe.version)===3?i.jsx(fi,{content:"API wallets cannot be deleted here. To remove this wallet, please delete it from the Hyperliquid API page.",children:i.jsx("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Delete"})})}):i.jsx("div",{onClick:()=>{ee({wallet:Xe==null?void 0:Xe.wallet_address,walletId:Xe==null?void 0:Xe.wallet_id,walletName:Xe==null?void 0:Xe.wallet_name.toLowerCase(),unrealizedPnL:Xe==null?void 0:Xe.unrealizedPnl,perpEquity:Xe==null?void 0:Xe.perpEquity}),G(!0)},className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Delete"})})]})})]},Vt)})})]})})]}),i.jsxs("div",{className:`flex justify-start items-center gap-2 absolute top-[10px] sm:top-6 right-1 sm:translate-x-0 sm:right-2
`,children:[i.jsx("button",{onClick:()=>a(s-1),disabled:s===1,className:`${s===1?"cursor-not-allowed":"cursor-pointer"} h-8 px-2 sm:px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex bg-transparent`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Previous"})}),i.jsxs("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px] w-20 sm:w-auto text-center",children:["Page ",s," / ",Math.ceil(o.length/I)]}),i.jsx("button",{onClick:()=>a(s+1),disabled:s*I>=o.length,className:`${s*I>=o.length?"cursor-not-allowed":"cursor-pointer"} h-8 px-2 sm:px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex bg-transparent`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Next"})})]})]})]})},KY=({title:e,label:t,handleSelectMenuChange:n,isSelectMenu:r,walletLength:s})=>i.jsxs("div",{onClick:()=>n(e),className:`${r==e?"bg-[#67ffbd]/20 text-[#67FFBD]":"bg-transparent text-[#9b9b9b]"} ${e==="HYPER"?"gap-1":e==="LIGHTER"?"gap-0.5":"gap-1"} text-[13px] font-medium font-manrope leading-[8px] cursor-pointer flex justify-center items-center min-w-max rounded-md px-[6px] sm:px-[10px] h-[22px]`,children:[e==="HYPER"?i.jsx("img",{src:ax,alt:"hyper",className:"w-4 h-4 rounded-sm"}):e==="LIGHTER"?i.jsx(Hf,{className:"w-4 h-4 text-[#fff]"}):e==="EXTENDED"?i.jsx("img",{src:"https://app.extended.exchange/assets/logo/extended.svg",alt:"Extended",className:"h-[20px] text-white -ml-0.5"}):null,`${t} (${(s==null?void 0:s.length)>0?"⚡"+(s==null?void 0:s.length)+" wallet":"🔌 Not Connected"}) `]}),han=({initialAddress:e="",wallets:t,positions:n,setPositions:r,isWalletIndex:s,posLoading:a,setPosLoading:o,setGenerateWalletData:l})=>{var Ve;const{getTrackedWatchList:c,hyperToken:u,copyTradeWatchList:d,getCopyTradeWatchList:f,setTelegramChatId:x,setSubscriberRole:g,setSubsExpireDay:v,setMushboomerETH:w,setMushboomerSOL:C,setIsReferralCode:N,isReferralCodeName:I,setIsReferralCodeName:P,setIsWhitelist:R,setHyperToken:F,setHyperAddress:U,setSignModalOpen:L,latestPnL:z}=m.useContext(Gr),{address:X}=Yr(),[ne,J]=m.useState(!1);m.useState({}),m.useState(!1),m.useEffect(()=>{if(!(s!=null&&s.index))return;const Ke=new WebSocket("wss://mainnet.zklighter.elliot.ai/stream");let ft;Ke.onopen=()=>{console.log("Lighter WebSocket connected"),Ke.send(JSON.stringify({type:"subscribe",channel:`account_all/${s.index}`})),ft=setInterval(()=>{Ke.readyState===WebSocket.OPEN&&Ke.send(JSON.stringify({type:"subscribe",channel:`account_all/${s.index}`}))},5e3)},Ke.onmessage=Dt=>{const At=JSON.parse(Dt==null?void 0:Dt.data);if(At!=null&&At.positions&&Object.keys(At.positions).length>0){const Je=Object.values(At.positions).filter(lt=>Number(lt.position)!==0).map(lt=>({funding:0,leverage:lt.initial_margin_fraction?Math.round(100/Number(lt.initial_margin_fraction)):0,positionValue:Number(lt.position_value??0),unrealizedPnl:Number(lt.unrealized_pnl??0),currentPrice:lt.avg_entry_price&&lt.unrealized_pnl&&lt.position&&lt.sign?Number(lt.avg_entry_price)+Number(lt.unrealized_pnl)/(Number(lt.position)*Number(lt.sign)):Number(lt.position_value)/Math.abs(Number(lt.position)),entryPrice:Number(lt.avg_entry_price??0),size:Number(lt.position??0),type:Number(lt.sign)>0?"Long":"Short",asset:lt.symbol??"",sign:Number(lt.sign??1)})),He=Je.reduce((lt,xt)=>lt+xt.unrealizedPnl,0),Rt=Je.reduce((lt,xt)=>{const Nt=xt.leverage>0?xt.leverage:1,It=xt.positionValue/Nt;return lt+(isFinite(It)?It:0)},0),qe=Number(At.available_balance??0);l(lt=>lt==null?void 0:lt.map(xt=>{var Nt;return((Nt=xt.wallet_address)==null?void 0:Nt.toLowerCase())===(e==null?void 0:e.toLowerCase())?{...xt,unrealizedPnl:He.toFixed(6),withdrawableUsdc:qe.toFixed(6),marginUsed:Rt.toFixed(6),positions:Je}:xt})),r(Je),(ce==null?void 0:ce.length)>0&&o(!1)}else r([]),a&&o(!1)},Ke.onclose=Dt=>{console.log("🔌 ZkLighter WebSocket disconnected",Dt.code,Dt.reason),clearInterval(ft)},Ke.onerror=Dt=>{console.error("❌ ZkLighter WS error:",Dt),clearInterval(ft)};const en=()=>{Ke.readyState===WebSocket.OPEN&&Ke.send(JSON.stringify({type:"unsubscribe",channel:`account_all/${s.index}`})),clearInterval(ft),Ke.close()};return window.addEventListener("beforeunload",en),()=>{en(),window.removeEventListener("beforeunload",en)}},[s]);const Z=m.useRef(null),re=()=>{Z.current&&(Z.current.scrollLeft-=200)},he=()=>{Z.current&&(Z.current.scrollLeft+=200)},Y=()=>{Z.current&&(Z.current.scrollTop+=200)},ie=()=>{Z.current&&(Z.current.scrollTop-=200)};m.useEffect(()=>{(async()=>{var Dt,At;const ft=window.localStorage.getItem("hyperToken"),en=window.localStorage.getItem("hyperAddress");if(!(!ft||!en))try{const Je=await Si(en.toLowerCase(),ft);Je!=null&&Je.success?(x(Je==null?void 0:Je.telegram_chat_id),g(Je==null?void 0:Je.subscriber_role),v(Je==null?void 0:Je.subs_expire_day),w((Dt=Je==null?void 0:Je.mushboomer_counts)==null?void 0:Dt.eth),C((At=Je==null?void 0:Je.mushboomer_counts)==null?void 0:At.sol),N(Je==null?void 0:Je.referral_code),P(Je==null?void 0:Je.refcode),R(Je==null?void 0:Je.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),F(""),U(""))}catch(Je){console.error("Token verification error:",Je),console.error(Je.message||"An unknown error occurred.")}})()},[]);const[oe,G]=m.useState(""),[V,ee]=m.useState(!1),ae=m.useRef(null);m.useEffect(()=>{function Ke(ft){ae.current&&!ae.current.contains(ft.target)&&ee(!1)}return document.addEventListener("mousedown",Ke),()=>document.removeEventListener("mousedown",Ke)},[]);const[fe,Ae]=m.useState([]),ce=n==null?void 0:n.filter(Ke=>{var ft;return oe?(ft=Ke.asset)==null?void 0:ft.toLowerCase().includes(oe.toLowerCase()):!0}).map(Ke=>{const ft=fe.find(en=>en.coin===Ke.asset&&(en.wallet||"").toLowerCase()===(Ke.wallet||"").toLowerCase());return{...Ke,tagName:(ft==null?void 0:ft.tag)||null,tagWallet:(ft==null?void 0:ft.cp_wallet)||null}}),ye="-unrealizedPnl",[Ne,be]=m.useState(ye),je=Ke=>{const Je=ce==null?void 0:ce.map(He=>{const Rt=He!=null&&He.positionValue&&(He!=null&&He.leverage)?He.unrealizedPnl*He.leverage*100/He.positionValue:0,qe=.004+6e-4*He.leverage;let lt=0;(He==null?void 0:He.type)==="Long"?lt=He.entryPrice*(He.leverage/(He.leverage+1-He.leverage*qe)):lt=He.entryPrice*(He.leverage/(He.leverage-1+He.leverage*qe));const xt=lt*5.05,Nt=He.leverage?He.positionValue/He.leverage:0,It=He.positionValue*1e-4*(He.sign??-1);return{...He,roe:Rt,liquidationPrice:xt,marginUsed:Nt,funding:It}});return Je==null?void 0:Je.sort((He,Rt)=>{const qe=He.tagName?He.tagName.toUpperCase():"",lt=Rt.tagName?Rt.tagName.toUpperCase():"",xt=He.asset?He.asset.toUpperCase():"",Nt=Rt.asset?Rt.asset.toUpperCase():"",It=He.type==="Long"?1:0,xn=Rt.type==="Long"?1:0,dn=He.type==="Short"?1:0,Mn=Rt.type==="Short"?1:0;return Ke==="-unrealizedPnl"?Rt.unrealizedPnl-He.unrealizedPnl:Ke==="unrealizedPnl"?He.unrealizedPnl-Rt.unrealizedPnl:Ke==="-roe"?Rt.roe-He.roe:Ke==="roe"?He.roe-Rt.roe:Ke==="-size"?Rt.size-He.size:Ke==="size"?He.size-Rt.size:Ke==="-entryPrice"?Rt.entryPrice-He.entryPrice:Ke==="entryPrice"?He.entryPrice-Rt.entryPrice:Ke==="-currentPrice"?Rt.currentPrice-He.currentPrice:Ke==="currentPrice"?He.currentPrice-Rt.currentPrice:Ke==="-leverage"?Rt.leverage-He.leverage:Ke==="leverage"?He.leverage-Rt.leverage:Ke==="-positionValue"?Rt.positionValue-He.positionValue:Ke==="positionValue"?He.positionValue-Rt.positionValue:Ke==="-marginUsed"?Rt.marginUsed-He.marginUsed:Ke==="marginUsed"?He.marginUsed-Rt.marginUsed:Ke==="-funding"?Rt.funding-He.funding:Ke==="funding"?He.funding-Rt.funding:Ke==="-liquidationPrice"?Rt.liquidationPrice-He.liquidationPrice:Ke==="liquidationPrice"?He.liquidationPrice-Rt.liquidationPrice:Ke==="-entryTime"?new Date(Rt.latestFill)-new Date(He.latestFill):Ke==="entryTime"?new Date(He.latestFill)-new Date(Rt.latestFill):Ke==="-source_tag"?qe<lt?-1:qe>lt?1:0:Ke==="source_tag"?qe>lt?-1:qe<lt?1:0:Ke==="-type_leverage"?It!==xn?xn-It:Rt.leverage-He.leverage:Ke==="type_leverage"?dn!==Mn?Mn-dn:Rt.leverage-He.leverage:Ke==="-asset"?xt<Nt?-1:xt>Nt?1:0:Ke==="asset"?xt>Nt?-1:xt<Nt?1:0:0})};n.length,n.filter(Ke=>Ke.unrealizedPnl>=0).length;const[Ie,Re]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",positionDistribution:0,pnl:0,closePx:0}),Be=localStorage.getItem("isDateOpenPositionsLighterFormat")||"date",[it,tt]=m.useState(Be);m.useEffect(()=>{localStorage.setItem("isDateOpenPositionsLighterFormat",it)},[it]);const[at,dt]=m.useState([]),ct=async()=>{try{const Ke=window.localStorage.getItem("hyperToken");if(!Ke){L(!0);return}const ft="https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",en=window.localStorage.getItem("hyperAddress"),At=await(await fetch(ft,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:X?X.toLowerCase():en,token:Ke,balance:"false"})})).json();At!=null&&At.success?(dt(At.data||[]),Pt(At.data)):console.log(At.error_message)}catch(Ke){console.error("Error fetching generate wallet list:",Ke)}};m.useEffect(()=>{window.localStorage.getItem("hyperToken")&&ct()},[u]);const[Ut,kt]=m.useState([]),[tn,jt]=m.useState(!0),[un,cn]=m.useState(!1);m.useEffect(()=>{ce&&ce.length>0&&(Xe(),at.length>0&&tn&&Pt())},[ce]);const Pt=()=>{Ut.length!==0&&(Vt(Ut),tn&&jt(!1))};m.useEffect(()=>{const Ke=window.localStorage.getItem("hyperToken");Ut.length&&Ke&&Vt(Ut)},[Ut]);const Xe=()=>{const Ke=window.localStorage.getItem("hyperToken");let ft=!1;const en=[...Ut];ce.forEach(Dt=>{var Rt;const At=Dt.asset,Je=(Rt=Dt.wallet||e)==null?void 0:Rt.toLowerCase();en.some(qe=>qe.coin===At&&(qe.wallet||"").toLowerCase()===Je)||(en.push({coin:At,wallet:Je}),ft=!0)}),ft&&(kt(en),at.some(At=>At.wallet_address===(e==null?void 0:e.toLowerCase()))&&Ke&&Vt(en))},Vt=async Ke=>{if(!un)try{cn(!0);const ft=window.localStorage.getItem("hyperToken"),en="https://dextrabothypev2.nftinit.io/api/hyper/following/position_info/";if(!ft||!Ke){cn(!1);return}ft||L(!0);const Dt=window.localStorage.getItem("hyperAddress"),Je=await(await fetch(en,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:X?X.toLowerCase():Dt,token:ft,positions:Ke})})).json();Je.success?Ae(Je==null?void 0:Je.data):(console.log(Je.error_message),on.error(Je.error_message))}catch(ft){console.error("Error tag request",ft),on.error(ft.message)}finally{cn(!1)}};(t==null?void 0:t.length)>1||at.some(Ke=>Ke.wallet_address===(e==null?void 0:e.toLowerCase()));const Yt={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return i.jsxs("div",{className:"w-full",children:[i.jsx(hT,{open:ne,setOpen:J,data:Ie,setTradeInfo:Re}),i.jsxs("div",{className:"relative w-full ",children:[i.jsxs("div",{className:"absolute -top-6 right-2 z-10 hidden lg:flex justify-start items-center gap-2",children:[i.jsx("button",{onClick:re,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Pl,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:he,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Pl,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:ie,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Pl,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:Y,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Pl,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{ref:Z,className:"w-full overflow-scroll min-h-[60vh] max-h-[60vh] h-full flex-grow mt-1 mb-3 bg-[#161616] border-collapse rounded-lg pb-24",children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] font-semibold leading-[13px] tracking-[0.26px] text-[#9b9b9b] text-[13px] font-manrope mr-3",children:[i.jsx("th",{scope:"col",className:"sticky bg-[#161616] left-0 h-10 pl-2 sm:pl-6 min-w-[130px] sm:min-w-[145px] z-[8]",children:i.jsxs("div",{className:"flex justify-start items-center gap-2 relative",children:[i.jsx(ci,{title:"Coin",sortKey:"asset",sortOption:Ne,setSortOption:be,isFilterIcon:!1}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>ee(!V),className:`${oe?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx(Ff,{className:`w-4 h-4 ${oe?"text-blue-500":"text-white"}`})}),V&&i.jsxs("div",{ref:ae,className:`absolute left-[58px] mt-32 w-[208px]
                               bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>G(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"text",value:oe,onChange:Ke=>G(Ke.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2  placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Coin"})]})]})]})}),i.jsx(pan,{className:"min-w-[100px] sm:min-w-[120px] px-1",title:"Type",sortKey:"type_leverage",sortOption:Ne,setSortOption:be}),i.jsx(uv,{className:"min-w-[80px] sm:min-w-[80px] px-1",title:"Size",sortKey:"size",sortOption:Ne,setSortOption:be}),i.jsx(uv,{className:"min-w-[130px] sm:min-w-[145px] px-1",title:"Position Value",sortKey:"positionValue",sortOption:Ne,setSortOption:be}),i.jsx(uv,{className:"min-w-[120px] sm:min-w-[120px] px-1",title:"Entry Price",sortKey:"entryPrice",sortOption:Ne,setSortOption:be}),i.jsx(uv,{className:"min-w-[120px]  sm:min-w-[120px] px-1",title:"Mark Price",sortKey:"currentPrice",sortOption:Ne,setSortOption:be}),i.jsx(uv,{className:"min-w-[100px] sm:min-w-[160px] px-1",title:"PnL(ROE%)",sortKey:"unrealizedPnl",sortOption:Ne,setSortOption:be}),i.jsx(uv,{className:"min-w-[120px] sm:min-w-[130px] px-1",title:"Margin",sortKey:"marginUsed",sortOption:Ne,setSortOption:be}),i.jsx(uv,{className:"min-w-[110px] sm:min-w-[130px] px-1",title:"Funding",sortKey:"funding",sortOption:Ne,setSortOption:be})]})}),i.jsx("tbody",{children:a?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:window.innerWidth>=640&&window.innerWidth<768?5:window.innerWidth>=768&&window.innerWidth<1024?6:window.innerWidth>=1024&&window.innerWidth<1240?8:window.innerWidth>=1240&&window.innerWidth<1540?10:window.innerWidth>=1540?12:4,className:"h-[36vh]",children:i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-[100%] sm:w-[75%] max-w-[300px] sm:max-w-[700px] justify-center items-center text-center",children:i.jsx(Ma,{})})})})}):(ce==null?void 0:ce.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:window.innerWidth>=640&&window.innerWidth<768?5:window.innerWidth>=768&&window.innerWidth<1024?6:window.innerWidth>=1024&&window.innerWidth<1240?8:window.innerWidth>=1240&&window.innerWidth<1540?10:window.innerWidth>=1540?12:4,className:"h-[36vh]",children:i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-[100%] sm:w-[75%] max-w-[300px] sm:max-w-[700px] justify-center items-center text-center",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ec,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No open positions are currently available"}),i.jsxs("div",{className:"text-center -mt-2",children:[i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["To discover a different wallet, you can use the"," "]}),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"'Discover Wallets'"}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:[" ","tab above."]})]})]})]})})})})}):(Ve=je(Ne))==null?void 0:Ve.map((Ke,ft)=>{var Rt;const en=Ke!=null&&Ke.positionValue&&(Ke!=null&&Ke.leverage)?(Ke==null?void 0:Ke.unrealizedPnl)*(Ke==null?void 0:Ke.leverage)*100/(Ke==null?void 0:Ke.positionValue):0,Dt=.004+6e-4*Ke.leverage;Ke.entryPrice*(Ke.leverage/(Ke.sign===1?Ke.leverage+1-Ke.leverage*Dt:Ke.leverage-1+Ke.leverage*Dt));const At=Ke!=null&&Ke.leverage?(Ke==null?void 0:Ke.positionValue)/(Ke==null?void 0:Ke.leverage):0,He=(Ke==null?void 0:Ke.positionValue)*1e-4*(Ke==null?void 0:Ke.sign);return i.jsxs(Se.Fragment,{children:[i.jsxs("tr",{className:"relative group bg-[#1b1b1b] hover:bg-[#222222] h-[32px] max-h-[32px] text-white rounded-2xl",style:{margin:"2px"},children:[i.jsx("td",{scope:"row",className:"sticky left-0 z-[2] bg-[#1b1b1b] group-hover:bg-[#222222] sm:rounded-l-2xl",children:i.jsx("div",{onClick:()=>{window.open(`/terminal/${Ke==null?void 0:Ke.asset}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 sm:pl-6 h-8 max-h-14 rounded-2xl cursor-pointer",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"w-5 h-5 rounded-full",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Yt[Ke.asset]||((Rt=Ke.asset)==null?void 0:Rt.split("/")[0])}.svg`||Ua,alt:Ke==null?void 0:Ke.asset,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:qe=>ea(qe)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:Ke.asset})]})})}),i.jsx("td",{scope:"row",className:"z-[2] bg-[#1b1b1b] group-hover:bg-[#222222]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-8 max-h-8",children:i.jsxs("div",{className:`${Ke.type==="Long"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-5 pl-1 pr-1.5 py-1  rounded-md justify-start items-center gap-0.5 inline-flex`,children:[i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx("div",{className:"w-3 h-3 relative",children:Ke.type==="Long"?i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):i.jsx(Es,{className:"text-[#FF797C] w-3 h-3"})})}),i.jsxs("div",{className:" text-[11px] font-semibold font-manrope leading-[8px] tracking-wide uppercase",children:[Ke.type," - ",Ke==null?void 0:Ke.leverage,"x"]})]})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-tight",children:ro(Math.abs(Ke.size))})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:Ke.positionValue?`$${ro(Ke.positionValue)}`:ro(Ke.positionValue)})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:Ke.entryPrice?`$${Er(Ke.entryPrice)}`:Er(Ke.entryPrice)})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:Ke.currentPrice?`$${Er(Ke.currentPrice)}`:Er(Ke.currentPrice)})})}),i.jsx("td",{children:i.jsxs("div",{onClick:()=>{Re(qe=>({...qe,coin:Ke.asset,type:Ke.type,leverage:Ke.leverage,roe:en,entryPrice:Ke.entryPrice,markPrice:Ke.currentPrice,pnl:Ke.unrealizedPnl,referral:window.localStorage.getItem("hyperToken")?I:null})),J(!0)},className:"pl-1 pr-2 flex justify-end gap-2 font-manrope cursor-pointer min-w-max",children:[i.jsxs("div",{className:`${Ke.unrealizedPnl>=0?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:[Ke.unrealizedPnl?`$${ro(Math.abs(Ke.unrealizedPnl))}`:ro(Math.abs(Ke.unrealizedPnl)),` (${ro(Math.abs(en.toFixed(2)))}%)`]}),i.jsx("div",{className:"flex justify-center items-center rounded",children:i.jsx("img",{src:cm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px] min-w-max",children:At?`$${ro(At)}`:ro(At)})})}),i.jsx("td",{children:i.jsx("div",{className:"pl-1 pr-2 flex flex-col items-end gap-2 font-manrope",children:i.jsx("div",{className:`${!isNaN(Number(He))&&Number(He)<=0?"text-[#67ffbd]":"text-[#ff787b]"} text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]`,children:isNaN(Number(He))?"$0.00":`$${Math.abs(Number(He)).toFixed(4)}`})})})]}),i.jsx("tr",{children:i.jsx("td",{colSpan:"100",style:{height:"2px"}})})]},ft)})})]})})]})]})},uv=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(ci,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!0})}),pan=({className:e,title:t,sortKey:n,sortOption:r,setSortOption:s})=>i.jsx("th",{scope:"col",className:e,children:i.jsx(ci,{title:t,sortKey:n,sortOption:r,setSortOption:s,isFilterIcon:!1})}),man=({initialAddress:e="",wallets:t,isWalletIndex:n,posLoading:r,setPosLoading:s,setGenerateWalletData:a})=>{const[o,l]=m.useState("positions"),[c,u]=m.useState([]);return i.jsxs("div",{className:"w-full",children:[i.jsxs("div",{className:"flex justify-start items-center w-full gap-2 mb-2 mx-4 mt-4 relative overflow-x-auto whitespace-nowrap scrollbar-hide [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[i.jsx("div",{className:"absolute bottom-0 left-0 w-[80%] h-[1px] bg-[#2A2A2A]"}),i.jsx("div",{onClick:()=>l("positions"),className:`${o==="positions"?"active text-[#67FFBD] border-b border-[#67FFBD] z-20":"text-[#C1C1C1]"} h-6 px-2 py-3 flex justify-center items-center gap-2.5 cursor-pointer  font-manrope font-semibold pb-4 hover:text-[#67FFBD]`,children:i.jsxs("div",{className:"flex items-center text-[13px] font-semibold font-manrope leading-[8px] pointer-events-none min-w-max",children:[i.jsx("span",{className:"mr-2",children:"Open Positions"}),i.jsx("span",{className:"flex w-[22px] h-[22px] px-3 justify-center items-center gap-[2px] flex-shrink-0 rounded-md bg-[rgba(103,255,189,0.16)] text-[14px] font-semibold font-manrope",children:c.length})]})})]}),o==="positions"?i.jsx(han,{initialAddress:e,wallets:t,positions:c,setPositions:u,isWalletIndex:n,posLoading:r,setPosLoading:s,setGenerateWalletData:a}):""]})},xan=({data:e,isWalletIndex:t,fetchAllIndex:n,setGenerateWalletData:r})=>{const{isConnected:s,address:a}=Yr(),{setSignModalOpen:o,hyperToken:l,isReferralCodeName:c}=m.useContext(Gr),[u,d]=m.useState(""),[f,x]=m.useState(!0);m.useState({});const[g,v]=m.useState(!1),[w,C]=m.useState(""),[N,I]=m.useState(!1),P=m.useRef(null),R=m.useRef(null),[F,U]=m.useState(!1),[L,z]=m.useState(!1),[X,ne]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",pnl:0}),J="-unrealizedPnl",[Z,re]=m.useState(J),[he,Y]=m.useState([]),[ie,oe]=m.useState(!1);m.useEffect(()=>{if(e.length===0||ie)return;const be=e.reduce((je,Ie)=>parseFloat(Ie.perpEquity||0)>parseFloat(je.perpEquity||0)?Ie:je);be.wallet_address&&d(be.wallet_address)},[e,ie]);const G=(be,je,Ie)=>{const Re=be==null?void 0:be.filter(Qe=>Qe&&Qe.walletAddress&&Qe.asset).filter(Qe=>{var Be,it;return Ie?(it=(Be=Qe==null?void 0:Qe.asset)==null?void 0:Be.toString())==null?void 0:it.toUpperCase().includes(Ie.toUpperCase()):!0});return Re==null?void 0:Re.sort((Qe,Be)=>{const it=Qe.wallet_name?Qe.wallet_name.toUpperCase():"",tt=Be.wallet_name?Be.wallet_name.toUpperCase():"",at=Qe.tag?Qe.tag.toUpperCase():"",dt=Be.tag?Be.tag.toUpperCase():"",ct=Qe.asset?Qe.asset.toUpperCase():"",Ut=Be.asset?Be.asset.toUpperCase():"",kt=Qe.type==="Long"?1:0,tn=Be.type==="Long"?1:0,jt=Qe.type==="Short"?1:0,un=Be.type==="Short"?1:0;return je==="wallet_name"?it<tt?-1:it>tt?1:0:je==="-wallet_name"?it>tt?-1:it<tt?1:0:je==="-unrealizedPnl"?Be.unrealizedPnl-Qe.unrealizedPnl:je==="unrealizedPnl"?Qe.unrealizedPnl-Be.unrealizedPnl:je==="-roe"?Be.roe-Qe.roe:je==="roe"?Qe.roe-Be.roe:je==="-size"?Be.size-Qe.size:je==="size"?Qe.size-Be.size:je==="-entryPrice"?Be.entryPrice-Qe.entryPrice:je==="entryPrice"?Qe.entryPrice-Be.entryPrice:je==="-currentPrice"?Be.currentPrice-Qe.currentPrice:je==="currentPrice"?Qe.currentPrice-Be.currentPrice:je==="-leverage"?Be.leverage-Qe.leverage:je==="leverage"?Qe.leverage-Be.leverage:je==="-positionValue"?Be.positionValue-Qe.positionValue:je==="positionValue"?Qe.positionValue-Be.positionValue:je==="-marginUsed"?Be.marginUsed-Qe.marginUsed:je==="marginUsed"?Qe.marginUsed-Be.marginUsed:je==="funding"?Be.funding-Qe.funding:je==="-funding"?Qe.funding-Be.funding:je==="-liquidationPrice"?Be.liquidationPrice-Qe.liquidationPrice:je==="liquidationPrice"?Qe.liquidationPrice-Be.liquidationPrice:je==="-tag"?at<dt?-1:at>dt?1:0:je==="tag"?at>dt?-1:at<dt?1:0:je==="-coin"?ct<Ut?-1:ct>Ut?1:0:je==="coin"?ct>Ut?-1:ct<Ut?1:0:je==="-type_leverage"?kt!==tn?tn-kt:Be.leverage-Qe.leverage:je==="type_leverage"?jt!==un?un-jt:Be.leverage-Qe.leverage:0})},V=async be=>{if(be===""&&he.filter(je=>je!==void 0).length===0||be===""&&G(he,Z,w).length===0||G(he,Z,w).length===0){on.success("There are no open positions to close.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}if(be===""&&(e==null?void 0:e.length)>0){const je=G(he,Z,w),Ie=[...new Set(je.map(Re=>Re.wallet_id))];if(Ie.length===0){on.success("There are no open positions to close.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}try{if(v(!0),!window.localStorage.getItem("hyperToken")){o(!0),v(!1);return}await Promise.all(Ie.map(Qe=>ee(Qe,!1))),on.success("All close order operations successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",width:"400px",minWidth:"400px",height:"60px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})}catch(Re){console.error("Error closing all orders:",Re)}finally{v(!1)}return}await ee(be)},ee=async(be,je=!0)=>{if(he.filter(Ie=>Ie!==void 0).length===0){on.success("There are no open positions to closes.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}});return}if(!be){console.error("Close order called with invalid parameters"),on.error("Close order called with invalid parameters");return}try{v(!0);const Ie=window.localStorage.getItem("hyperToken"),Re="https://dextrabothypev2.nftinit.io/api/hyper/order/close_order_all_new/";if(!Ie){o(!0),v(!1);return}const Qe=window.localStorage.getItem("hyperAddress"),Be=await fetch(Re,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:a?a.toLowerCase():Qe,token:Ie,wallet_id:be.toString()})});if(!Be.ok)throw new Error(`Server responded with status ${Be.status}`);const it=await Be.json();it.status=="ok"?(v(!1),je&&on.success("Close order operation successful.",{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px",width:"400px",minWidth:"400px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):it.success?(v(!1),je&&on.success("There are no open positions to close.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})):(console.log("Close order operation failed."),on.error("Close order operation failed."),v(!1))}catch(Ie){throw console.error("Something went wrong!"),on.error("Something went wrong!"),v(!1),Ie}},[ae,fe]=m.useState(!1);m.useEffect(()=>{const be=()=>{(localStorage.getItem("walletManagementInfo")!==void 0||localStorage.getItem("walletManagementInfo")!==null)&&Date.now()-Number(localStorage.getItem("walletManagementInfo"))>=864e5&&fe(!0)};be();const je=setInterval(()=>{be()},1e3*60*30);return()=>{clearInterval(je)}},[]);const Ae=async be=>{try{const je=window.localStorage.getItem("hyperToken"),Ie="https://dextrabothypev2.nftinit.io/api/hyper/following/position_info/";if(!je){o(!0);return}const Re=be==null?void 0:be.filter(tt=>tt&&tt.walletAddress&&tt.asset).map(tt=>({wallet:tt.walletAddress,coin:tt.asset})),Qe=window.localStorage.getItem("hyperAddress"),it=await(await fetch(Ie,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:a?a.toLowerCase():Qe,token:je,positions:Re})})).json();it.success?Y(tt=>tt.map(at=>{const dt=it==null?void 0:it.data.find(ct=>(ct==null?void 0:ct.wallet)===(at==null?void 0:at.walletAddress)&&(ct==null?void 0:ct.coin)===(at==null?void 0:at.asset));return{...at,tag:dt==null?void 0:dt.tag,tagWallet:dt==null?void 0:dt.cp_wallet}})):(console.log(it.error_message),on.error(it.error_message))}catch(je){console.error("Error tag request",je),on.error(je.message)}},ce=m.useRef(he==null?void 0:he.filter(be=>(be==null?void 0:be.walletAddress)&&(be==null?void 0:be.asset)).length),ye=m.useRef(),Ne=m.useRef(!0);return m.useEffect(()=>{const be=he==null?void 0:he.filter(Ie=>Ie!==void 0&&(Ie==null?void 0:Ie.walletAddress)&&(Ie==null?void 0:Ie.asset)),je=be==null?void 0:be.length;if(je>0&&je>ce.current){const Ie=u===""?he:he.filter(Re=>(Re==null?void 0:Re.wallet_id)==u);Ne.current?(Ae(Ie),Ne.current=!1):(ye.current&&clearTimeout(ye.current),ye.current=setTimeout(()=>{Ae(Ie)},5e3))}ce.current=je},[he]),m.useEffect(()=>{if((he==null?void 0:he.filter(be=>be!==void 0&&(be==null?void 0:be.walletAddress)&&(be==null?void 0:be.asset)).length)>0){const be=u==""?he:he==null?void 0:he.filter(je=>(je==null?void 0:je.wallet_id)==u);(be==null?void 0:be.length)>0&&Ae(be)}},[u]),m.useEffect(()=>{function be(je){P.current&&!P.current.contains(je.target)&&setIsDropdownOpen(!1),R.current&&!R.current.contains(je.target)&&I(!1)}return document.addEventListener("mousedown",be),()=>document.removeEventListener("mousedown",be)},[]),i.jsx(i.Fragment,{children:i.jsxs(i.Fragment,{children:[i.jsx(KUe,{open:F,setOpen:U,data:X,setShare:z,setTradeInfo:ne}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full min-h-[500px] max-h-max font-manrope relative sm:pt-10",children:[i.jsxs("div",{className:"flex items-center justify-start gap-4",children:[i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px] w-full",children:"Manage Positions"}),i.jsx("div",{className:"flex sm:hidden items-center justify-end w-full gap-1 min-w-max",children:i.jsx("div",{className:"flex items-center justify-end group",children:i.jsxs("div",{onClick:be=>{be.preventDefault(),g||V(u)},className:"h-[26px] pl-1 pr-2 py-1.5 bg-[#67ffbd]/20 hover:bg-[#67ffbd]/30 rounded-md inline-flex justify-start items-center gap-2 cursor-pointer",children:[i.jsx("div",{className:"",children:i.jsx("img",{src:tae,alt:"",className:"w-4 h-4"})}),g?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[66px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{className:"justify-start text-[#67ffbd] text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Fast Close All"})]})})})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsx("span",{className:"font-bold min-w-[200px] lg:min-w-max text-xs sm:text-[14px]",children:"Select wallet to see your current positions:"}),i.jsx("select",{className:"rounded-md py-0.5 bg-[#303030] text-white text-md outline-none w-full h-8 min-w-[150px] px-2",onChange:be=>{d(be.target.value),oe(!0),n(be.target.value),x(!0),r(je=>je==null?void 0:je.map(Ie=>({...Ie,unrealizedPnl:0,marginUsed:0})))},value:u,children:e==null?void 0:e.map(be=>i.jsx("option",{value:be==null?void 0:be.wallet_address,children:`${be==null?void 0:be.wallet_name} - (${(be==null?void 0:be.wallet_address).slice(0,5)+"..."+(be==null?void 0:be.wallet_address).slice(-4)})`},be==null?void 0:be.wallet_id))})]}),!1]}),i.jsx("div",{className:"w-full h-max max-w-[100%] min-h-[60vh] sm:min-h-[36vh] overflow-scroll relative flex-grow",children:i.jsx(man,{initialAddress:u,wallets:u===""?e:void 0,isWalletIndex:t,posLoading:f,setPosLoading:x,setGenerateWalletData:r})})]})]})]})})},gan=({isSelectMenu:e,setIsSelectMenu:t,hyperWallet:n,lighterWallet:r,extendedWallet:s,lighterWalletList:a})=>{const{isConnected:o,address:l}=Yr(),{setSignModalOpen:c,hyperToken:u}=m.useContext(Gr),[d,f]=m.useState([]),[x,g]=m.useState(!1),[v,w]=m.useState(null),[C,N]=m.useState(!0),[I,P]=m.useState(null),[R,F]=m.useState([]),[U,L]=m.useState(()=>parseInt(localStorage.getItem("walletManagementLighterPage"))||1),z=5,[X,ne]=m.useState(!1),[J,Z]=m.useState(!1);m.useEffect(()=>{window.localStorage.getItem("hyperToken")?re():(c(!0),f([]),window.localStorage.setItem("walletManagementLighterPage",1))},[o,u]);const re=async()=>{var oe;try{g(!0);const G=window.localStorage.getItem("hyperToken");if(!G){c(!0);return}const V="https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",ee=window.localStorage.getItem("hyperAddress"),fe=await(await fetch(V,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:l?l.toLowerCase():ee,token:G})})).json();if(fe.success){a(),F(fe.data||[]),ne(!0);const Ae=parseInt(localStorage.getItem("walletManagementLighterPage"))||1,ce=Math.max(Math.ceil(((fe==null?void 0:fe.data)||[]).length/z),1),ye=Math.min(Ae,ce);L(ye),localStorage.setItem("walletManagementLighterPage",ye),Y(ye,fe.data||[]);const Ne=(ye-1)*z,be=(oe=fe.data)==null?void 0:oe[Ne];be&&he(be==null?void 0:be.wallet_address)}else console.log(fe.error_message),g(!1),w(fe.error_message)}catch(G){console.error("Error fetching lighter wallet list:",G),g(!1),w(G.message)}},he=async oe=>{try{const V=`https://mainnet.zklighter.elliot.ai/api/v1/accountsByL1Address?l1_address=${wc(oe)}`,ae=await(await fetch(V,{method:"GET",headers:{accept:"application/json"}})).json();if(ae.sub_accounts&&ae.sub_accounts.length>0){const fe=ae.sub_accounts[0],Ae=(fe==null?void 0:fe.collateral)??fe.collateral??"",ce=(fe==null?void 0:fe.margin_used)??"",ye=(fe==null?void 0:fe.available_balance)??"",Ne=(fe==null?void 0:fe.unrealized_pnl)??"",be=(fe==null?void 0:fe.positions)??[];f(je=>je==null?void 0:je.map(Ie=>Ie.wallet_address.toLowerCase()===oe.toLowerCase()?{...Ie,perpEquity:Ae,unrealizedPnl:Ne,withdrawableUsdc:ye,marginUsed:ce,positions:be}:Ie)),P(fe),Z(!0),g(!1),N(!1)}}catch(G){console.error("Error fetching lighter index:",G)}};m.useEffect(()=>{const oe=()=>{const G=parseInt(localStorage.getItem("walletManagementLighterPage"))||1;G!==U&&X&&J&&(L(G),Y(G,R))};return window.addEventListener("storage",oe),()=>{window.removeEventListener("storage",oe)}},[U,R,X,J]);const Y=(oe,G)=>{if(!G||G.length===0){g(!1);return}g(!0);const V=(oe-1)*z,ee=V+z,ae=G.slice(V,ee);f(ae)},ie=oe=>{oe<1||oe>Math.ceil(R.length/z)||(g(!0),L(oe),localStorage.setItem("walletManagementLighterPage",oe),Y(oe,R))};return i.jsxs(i.Fragment,{children:[i.jsx(fan,{data:d,loading:x,error:v,socketLoading:C,handlePageChange:ie,handleListRequest:re,currentPage:U,allWallets:R,isSelectMenu:e,setIsSelectMenu:t,hyperWallet:n,lighterWallet:r,extendedWallet:s}),i.jsx(xan,{data:d,setGenerateWalletData:f,isWalletIndex:I,fetchAllIndex:he})]})},ban=({data:e,loading:t,error:n,socketLoading:r,currentPage:s,handlePageChange:a,allWallets:o,handleListRequest:l,isSelectMenu:c,setIsSelectMenu:u,hyperWallet:d,lighterWallet:f,extendedWallet:x})=>{var Pt;const[g,v]=m.useState(!1),{setSignModalOpen:w}=m.useContext(Gr),{isConnected:C,address:N}=Yr(),I=5,[P,R]=m.useState(null),[F,U]=m.useState(null),[L,z]=m.useState(!1),[X,ne]=m.useState(null),[J,Z]=m.useState(!1),[re,he]=m.useState("");m.useState({});const[Y,ie]=m.useState({}),[oe,G]=m.useState(!1),[V,ee]=m.useState({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),[ae,fe]=m.useState(!1),[Ae,ce]=m.useState(!1),ye="-perpEquity",[Ne,be]=m.useState(ye),je=Xe=>e.sort((Vt,Yt)=>{if(Vt.version===3&&Yt.version!==3)return-1;if(Yt.version===3&&Vt.version!==3)return 1;const Ve=Vt.wallet_name?Vt.wallet_name.toUpperCase():"",Ke=Yt.wallet_name?Yt.wallet_name.toUpperCase():"",ft=Vt.wallet_address?Vt.wallet_address.toLowerCase():"",en=Yt.wallet_address?Yt.wallet_address.toLowerCase():"";return Xe==="wallet_name"?Ve<Ke?-1:Ve>Ke?1:0:Xe==="-wallet_name"?Ve>Ke?-1:Ve<Ke?1:0:Xe==="-wallet_address"?ft<en?-1:ft>en?1:0:Xe==="wallet_address"?ft>en?-1:ft<en?1:0:Xe==="-wallet_created_data"?new Date(Yt.wallet_created_data)-new Date(Vt.wallet_created_data):Xe==="wallet_created_data"?new Date(Vt.wallet_created_data)-new Date(Yt.wallet_created_data):Xe==="-perpEquity"?Yt.perpEquity-Vt.perpEquity:Xe==="perpEquity"?Vt.perpEquity-Yt.perpEquity:Xe==="-unrealizedPnl"?Yt.unrealizedPnl-Vt.unrealizedPnl:Xe==="unrealizedPnl"?Vt.unrealizedPnl-Yt.unrealizedPnl:Xe==="-marginUsed"?Yt.marginUsed-Vt.marginUsed:Xe==="marginUsed"?Vt.marginUsed-Yt.marginUsed:Xe==="-withdrawableUsdc"?Yt.withdrawableUsdc-Vt.withdrawableUsdc:Xe==="withdrawableUsdc"?Vt.withdrawableUsdc-Yt.withdrawableUsdc:0}),Ie=async(Xe,Vt,Yt)=>{if(!Xe||!Vt||!Yt){console.error("Delete order called with invalid parameters"),on.error("Delete order called with invalid parameters");return}const Ve=`${Xe}_${Vt}`;try{ie(Je=>({...Je,[Ve]:!0}));const Ke=window.localStorage.getItem("hyperToken"),ft="https://dextrabothypev2.nftinit.io/api/wallet/delete-extended";if(!Ke){w(!0),ie(Je=>({...Je,[Ve]:!1}));return}const en=window.localStorage.getItem("hyperAddress"),Dt=await fetch(ft,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:N?N.toLowerCase():en,token:Ke,wallet_id:Xe})});if(!Dt.ok)throw new Ml(`Server responded with status ${Dt.status}`);const At=await Dt.json();At.success?(l(),ee({wallet:"",walletId:"",walletName:"",unrealizedPnL:"",perpEquity:""}),fe(!1),ce(!1),G(!1),ie(Je=>({...Je,[Ve]:!1})),on.success(i.jsxs(i.Fragment,{children:[i.jsx("span",{children:Yt.slice(0,5)+"..."+Yt.slice(-3)}),i.jsxs("span",{style:{color:"#ff797c",paddingLeft:"5px"},children:[" ","removed from generated wallets"]})]}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"440px",minWidth:"440px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}})):(console.log(At.error_message),on.error(At.error_message),ie(Je=>({...Je,[Ve]:!1})))}catch(Ke){console.error("Error deleting wallet:",Ke),on.error(Ke.message),ie(ft=>({...ft,[Ve]:!1}))}},Re=m.useRef(null),Qe=()=>{Re.current&&(Re.current.scrollLeft-=100)},Be=()=>{Re.current&&(Re.current.scrollLeft+=100)},it=()=>{Re.current&&(Re.current.scrollTop+=200)},tt=()=>{Re.current&&(Re.current.scrollTop-=200)},at=Xe=>Xe>=640&&Xe<1024?4:Xe>=1024&&Xe<1240?7:Xe>=1240&&Xe<1540||Xe>=1540?8:3,[dt,ct]=m.useState(null),[Ut,kt]=m.useState(!1),[tn,jt]=m.useState(!1);m.useEffect(()=>{const Xe=()=>{jt(window.innerWidth<640)};return window.addEventListener("resize",Xe),Xe(),()=>window.removeEventListener("resize",Xe)},[]);const un=Xe=>{tn&&(ct(Xe),kt(!0))};m.useEffect(()=>{const Xe=window.location.hash;if(!Xe)return;const Vt=Xe.split("#").filter(Boolean);Vt.includes("add-account")&&(v(!0),Vt[0]==="hyperliquid"&&(u("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")),Vt[0]==="lighter"&&(u("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")),Vt[0]==="extended"&&(u("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED")))},[]);const cn=Xe=>{v(!1),Xe==="HYPER"?(window.history.replaceState(null,"",`${window.location.pathname}#hyperliquid`),u("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")):Xe==="LIGHTER"?(window.history.replaceState(null,"",`${window.location.pathname}#lighter`),u("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")):Xe==="EXTENDED"&&(window.history.replaceState(null,"",`${window.location.pathname}#extended`),u("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED"))};return i.jsxs(i.Fragment,{children:[i.jsx(Lce,{open:L,setOpen:z,data:e,walletData:P,withdrawableUsdc:X,setWithdrawableUsdc:ne,modalWalletId:F,setModalWalletId:U}),i.jsx(Bce,{open:J,setOpen:Z,walletAddress:re}),i.jsx($ce,{open:oe,setOpen:G,handleDeleteWallet:Ie,deleteWalleInfo:V,confirmClosePositions:ae,setConfirmClosePositions:fe,confirmWithdrawEquity:Ae,setConfirmWithdrawEquity:ce}),i.jsx(rp,{isOpen:Ut,onClose:()=>kt(!1),children:i.jsx(Uce,{rowData:dt})}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full sm:min-h-[340px] max-h-max font-manrope relative",children:[i.jsxs("div",{className:"flex justify-start items-center gap-10  pl-2 sm:pl-0 pt-4",children:[i.jsxs("div",{className:"hidden sm:flex flex-col items-start justify-start gap-2 font-manrope min-w-max bg-[#161616] ",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px]",children:"Wallet Management"})})]}),i.jsxs("div",{className:"flex flex-col items-start lg:flex-row lg:justify-start lg:items-center gap-1 lg:gap-10",children:[i.jsx(Dce,{handleListRequest:l,handlePageChange:a,isGenWalletModal:g,setIsGenWalletModal:v}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(YY,{title:"HYPER",label:"HYPERLIQUID",walletLength:d,handleSelectMenuChange:cn,isSelectMenu:c}),i.jsx(YY,{title:"LIGHTER",label:"LIGHTER",walletLength:f,handleSelectMenuChange:cn,isSelectMenu:c}),i.jsx(YY,{title:"EXTENDED",label:"EXTENDED",walletLength:x,handleSelectMenuChange:cn,isSelectMenu:c})]})]})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"absolute -top-5 right-4 z-10 hidden justify-start items-center gap-2",children:[i.jsx("button",{onClick:Qe,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:Be,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:tt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:it,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{className:"w-full h-auto sm:h-max max-w-[100%] overflow-scroll relative flex-grow",ref:Re,children:i.jsxs("table",{className:"w-full relative",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] sm:left-0 h-8 pl-3 min-w-[120px] sm:min-w-[140px] z-[8]",children:i.jsx(ci,{title:"Name",sortKey:"wallet_name",sortOption:Ne,setSortOption:be,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] sm:left-[140px] h-10 px-1 min-w-[160px] sm:min-w-[190px] z-[8]",children:i.jsx(ci,{title:"Follower Wallet",sortKey:"wallet_address",sortOption:Ne,setSortOption:be,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[110px] sm:min-w-[110px] px-1 hidden sm:table-cell",children:i.jsx(ci,{title:"Creation Date",sortKey:"wallet_created_data",sortOption:Ne,setSortOption:be,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[330px] sm:min-w-[330px] pl-1 pr-4 hidden sm:table-cell",children:i.jsx("div",{className:"font-medium flex items-center justify-start w-full min-w-max",children:i.jsx("div",{className:"flex items-center justify-end w-full"})})})]})}),i.jsx("tbody",{children:!e||t?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:at(window.innerWidth),children:i.jsx("div",{className:"fixed top-1/3 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-10 min-h-[30vh] flex flex-col justify-center items-center",children:i.jsx(Ma,{})})})}):n&&!e?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:at(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[30vh] flex-col justify-center items-center top-[7%] lg:top-[10%] left-[20%] sm:left-[40%] lg:left-[50%] 2xl:left-[45%] z-10",children:i.jsx(Ml,{})})})}):(e==null?void 0:e.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:at(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[30vh] flex-col justify-center items-center top-[7%] lg:top-[15%] left-[20%] sm:left-[40%] lg:left-[50%] 2xl:left-[45%] z-10",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3  ml-1 sm:-ml-16",children:[i.jsx("img",{src:ec,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"You have not created a wallet yet."}),i.jsxs("div",{className:"text-center -mt-2",children:[i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["Please use the"," "]}),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"'Add Account'"}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:[" ","button to create a wallet."]})]})]})]})})})})}):(Pt=je(Ne))==null?void 0:Pt.map((Xe,Vt)=>{!isNaN(Xe==null?void 0:Xe.perpEquity)&&!isNaN(Xe==null?void 0:Xe.marginUsed)&&(Xe==null?void 0:Xe.perpEquity)-(Xe==null?void 0:Xe.marginUsed);const Yt=tn?{onClick:()=>un(Xe),className:"cursor-pointer"}:{};return i.jsxs("tr",{...Yt,className:`${Vt%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[44px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${Vt%2==0,"bg-[#161616]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-2 h-[44px] max-h-[44px] ",children:(Xe==null?void 0:Xe.version)==3?i.jsx(fi,{content:"This is an API wallet created from your login wallet. It enables copy trading without withdrawal permissions, keeping your funds safe.",children:i.jsxs("div",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5 min-w-max",children:(Xe==null?void 0:Xe.wallet_name.length)>=12?(Xe==null?void 0:Xe.wallet_name).slice(0,12)+"... (API-AGENT) Wallet":(Xe==null?void 0:Xe.wallet_name)+"(API-AGENT) Wallet"}),(Xe==null?void 0:Xe.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(_a,{content:`${Xe==null?void 0:Xe.wallet_name}`,positionTop:!0,alignRight:!1})}),i.jsx(vi,{className:"text-[#7C7C7C] w-4 min-w-4 min-h-4 h-4 ml-1"})]})}):i.jsxs("div",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5",children:(Xe==null?void 0:Xe.wallet_name.length)>=12?(Xe==null?void 0:Xe.wallet_name).slice(0,12)+"...":Xe==null?void 0:Xe.wallet_name}),(Xe==null?void 0:Xe.wallet_name.length)>=12&&i.jsx("span",{className:"ml-3",children:i.jsx(_a,{content:`${Xe==null?void 0:Xe.wallet_name}`,positionTop:!0,alignRight:!1})})]})})}),i.jsx("td",{scope:"row",className:`${Vt%2===0,"bg-[#161616]"} sm:sticky sm:left-[140px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4  min-h-[44px] max-h-[44px]",children:i.jsxs("div",{onClick:()=>{window.open(`/wallet-details/${Xe==null?void 0:Xe.wallet_address}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-[44px] max-h-[44px] cursor-pointer",children:[i.jsx("div",{className:"fle justify-center items-center",children:i.jsx("div",{className:"w-4 h-4 sm:w-6 sm:h-6 bg-[#4a4a4a] rounded-full",children:i.jsx("img",{src:Hi,alt:"",className:"w-4 h-4 sm:w-6 sm:h-6"})})}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx(ra,{info1:`${(Xe==null?void 0:Xe.wallet_address).slice(0,5)+"..."+(Xe==null?void 0:Xe.wallet_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:Ve=>{Ve.stopPropagation(),navigator.clipboard.writeText(Xe==null?void 0:Xe.wallet_address),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:bo,alt:"",className:"cursor-pointer"})]})]})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsx("div",{className:"flex flex-col items-start gap-0.5",children:i.jsx("div",{className:"text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5",children:(Xe==null?void 0:Xe.wallet_created_data)&&d3(Xe==null?void 0:Xe.wallet_created_data)})})}),i.jsx("td",{className:"hidden sm:table-cell",children:i.jsxs("div",{className:"flex items-center justify-end gap-2 pr-3",children:[i.jsx(fi,{content:"Deposits are currently unavailable.",children:i.jsxs("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:[i.jsx(fy,{className:"text-[#848484] w-[14px] h-[14px] rotate-180"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Deposit"})]})}),i.jsx(fi,{content:"Withdrawals are currently unavailable.",children:i.jsxs("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:[i.jsx(fy,{className:"text-[#848484] w-[14px] h-[14px]"}),i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Withdraw"})]})}),Y[`${Xe==null?void 0:Xe.wallet_id}_${Xe==null?void 0:Xe.wallet_name.toLowerCase()}`]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[90px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):(Xe==null?void 0:Xe.version)===3?i.jsx(fi,{content:"API wallets cannot be deleted here. To remove this wallet, please delete it from the Hyperliquid API page.",children:i.jsx("div",{className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex opacity-80",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight opacity-60",children:"Delete"})})}):i.jsx("div",{onClick:()=>{ee({wallet:Xe==null?void 0:Xe.wallet_address,walletId:Xe==null?void 0:Xe.wallet_id,walletName:Xe==null?void 0:Xe.wallet_name.toLowerCase(),unrealizedPnL:Xe==null?void 0:Xe.unrealizedPnl,perpEquity:Xe==null?void 0:Xe.perpEquity}),G(!0)},className:"w-[91px] h-[26px] px-2 py-1.5 rounded-md border border-[#353535] justify-center items-center gap-2 hidden sm:inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:"Delete"})})]})})]},Vt)})})]})})]}),i.jsxs("div",{className:`flex justify-start items-center gap-2 absolute top-[10px] sm:top-6 right-1 sm:translate-x-0 sm:right-2
`,children:[i.jsx("button",{onClick:()=>a(s-1),disabled:s===1,className:`${s===1?"cursor-not-allowed":"cursor-pointer"} h-8 px-2 sm:px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex bg-transparent`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Previous"})}),i.jsxs("div",{className:"text-white text-[14px] font-medium font-inter leading-[8px] w-20 sm:w-auto text-center",children:["Page ",s," / ",Math.ceil(o.length/I)]}),i.jsx("button",{onClick:()=>a(s+1),disabled:s*I>=o.length,className:`${s*I>=o.length?"cursor-not-allowed":"cursor-pointer"} h-8 px-2 sm:px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex bg-transparent`,children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Next"})})]})]})]})},YY=({title:e,label:t,handleSelectMenuChange:n,isSelectMenu:r,walletLength:s})=>i.jsxs("div",{onClick:()=>n(e),className:`${r==e?"bg-[#67ffbd]/20 text-[#67FFBD]":"bg-transparent text-[#9b9b9b]"} ${e==="HYPER"?"gap-1":e==="LIGHTER"?"gap-0.5":"gap-1"} text-[13px] font-medium font-manrope leading-[8px] cursor-pointer flex justify-center items-center min-w-max rounded-md px-[6px] sm:px-[10px] h-[22px]`,children:[e==="HYPER"?i.jsx("img",{src:ax,alt:"hyper",className:"w-4 h-4 rounded-sm"}):e==="LIGHTER"?i.jsx(Hf,{className:"w-4 h-4 text-[#fff]"}):e==="EXTENDED"?i.jsx("img",{src:"https://app.extended.exchange/assets/logo/extended.svg",alt:"Extended",className:"h-[20px] text-white -ml-0.5"}):null,`${t} (${(s==null?void 0:s.length)>0?"⚡"+(s==null?void 0:s.length)+" wallet":"🔌 Not Connected"}) `]}),yan=({isSelectMenu:e,setIsSelectMenu:t,hyperWallet:n,lighterWallet:r,extendedWallet:s,fetchAllWalletList:a})=>{const{isConnected:o,address:l}=Yr(),{setSignModalOpen:c,hyperToken:u}=m.useContext(Gr),[d,f]=m.useState([]),[x,g]=m.useState(!1),[v,w]=m.useState(null),[C,N]=m.useState(!0);m.useState(null);const[I,P]=m.useState([]),[R,F]=m.useState(()=>parseInt(localStorage.getItem("walletManagementExtendedPage"))||1),U=5,[L,z]=m.useState(!1),[X,ne]=m.useState(!1);m.useEffect(()=>{window.localStorage.getItem("hyperToken")?J():(c(!0),f([]),window.localStorage.setItem("walletManagementExtendedPage",1))},[o,u]);const J=async()=>{var he,Y;try{g(!0);const ie=window.localStorage.getItem("hyperToken");if(!ie){c(!0);return}const oe="https://dextrabothypev2.nftinit.io/api/wallet/list-extended",G=window.localStorage.getItem("hyperAddress"),ee=await(await fetch(oe,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:l?l.toLowerCase():G,token:ie})})).json();if(ee.success&&((he=ee==null?void 0:ee.data)==null?void 0:he.length)>0){a(),P(ee.data||[]),z(!0);const ae=parseInt(localStorage.getItem("walletManagementExtendedPage"))||1,fe=Math.max(Math.ceil(((ee==null?void 0:ee.data)||[]).length/U),1),Ae=Math.min(ae,fe);F(Ae),localStorage.setItem("walletManagementExtendedPage",Ae),Z(Ae,ee.data||[]);const ce=(Ae-1)*U,ye=(Y=ee.data)==null?void 0:Y[ce];g(!1)}else console.log(ee.error_message),g(!1),w(ee.error_message),f([])}catch(ie){console.error("Error fetching lighter wallet list:",ie),g(!1),w(ie.message)}};m.useEffect(()=>{const he=()=>{const Y=parseInt(localStorage.getItem("walletManagementExtendedPage"))||1;Y!==R&&L&&X&&(F(Y),Z(Y,I))};return window.addEventListener("storage",he),()=>{window.removeEventListener("storage",he)}},[R,I,L,X]);const Z=(he,Y)=>{if(!Y||Y.length===0){g(!1);return}g(!0);const ie=(he-1)*U,oe=ie+U,G=Y.slice(ie,oe);f(G)},re=he=>{he<1||he>Math.ceil(I.length/U)||(g(!0),F(he),localStorage.setItem("walletManagementExtendedPage",he),Z(he,I))};return i.jsx(i.Fragment,{children:i.jsx(ban,{data:d,loading:x,error:v,socketLoading:C,handlePageChange:re,handleListRequest:J,currentPage:R,allWallets:I,isSelectMenu:e,setIsSelectMenu:t,hyperWallet:n,lighterWallet:r,extendedWallet:s})})},van="wss://api.hyperliquid.xyz/ws",wan=()=>{const e=Ic(),{isConnected:t,address:n}=Yr(),{setSignModalOpen:r,hyperToken:s,setTelegramChatId:a,setSubscriberRole:o,setSubsExpireDay:l,setMushboomerETH:c,setMushboomerSOL:u,setIsReferralCode:d,setIsReferralCodeName:f,setIsWhitelist:x,setHyperToken:g,setHyperAddress:v}=m.useContext(Gr),w=m.useRef(null),C=m.useRef(null),N=m.useRef(null),[I,P]=m.useState([]),[R,F]=m.useState(!1),[U,L]=m.useState(null),[z,X]=m.useState(!0),[ne,J]=m.useState("null");m.useEffect(()=>{const Be=e.hash;if(Be){const it=Be.split("#").filter(Boolean);it[0]==="hyperliquid"?(J("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")):it[0]==="lighter"?(J("LIGHTER"),localStorage.setItem("isWalletSelectMenu","LIGHTER")):it[0]==="extended"?(J("EXTENDED"),localStorage.setItem("isWalletSelectMenu","EXTENDED")):(window.history.replaceState(null,"",`${window.location.pathname}#hyperliquid`),J("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER"))}else window.history.replaceState(null,"",`${window.location.pathname}#hyperliquid`),J("HYPER"),localStorage.setItem("isWalletSelectMenu","HYPER")},[e.hash]);const[Z,re]=m.useState([]),[he,Y]=m.useState([]),[ie,oe]=m.useState([]),[G,V]=m.useState(()=>parseInt(localStorage.getItem("walletManagementPage"))||1),ee=5,[ae,fe]=m.useState(!1);m.useEffect(()=>{window.localStorage.getItem("hyperToken")?(Ae(),ce(),ye()):(r(!0),P([]),window.localStorage.setItem("walletManagementPage",1))},[t,s]);const Ae=async()=>{try{F(!0);const Be=window.localStorage.getItem("hyperToken");if(!Be){r(!0);return}const it="https://dextrabothypev2.nftinit.io/api/wallet/list",tt=window.localStorage.getItem("hyperAddress"),dt=await(await fetch(it,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():tt,token:Be,balance:"false"})})).json();if(dt.success){oe(dt.data||[]),fe(!0);const ct=parseInt(localStorage.getItem("walletManagementPage"))||1,Ut=Math.max(Math.ceil(((dt==null?void 0:dt.data)||[]).length/ee),1),kt=Math.min(ct,Ut);V(kt),localStorage.setItem("walletManagementPage",kt),Re(kt,dt.data||[])}else console.log(dt.error_message),F(!1),L(dt.error_message)}catch(Be){console.error("Error fetching wallet list:",Be),F(!1),L(Be.message)}},ce=async()=>{try{F(!0);const Be=window.localStorage.getItem("hyperToken");if(!Be){r(!0);return}const it="https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",tt=window.localStorage.getItem("hyperAddress"),dt=await(await fetch(it,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():tt,token:Be})})).json();dt.success&&re(dt.data||[])}catch(Be){console.error("Error fetching wallet list:",Be)}},ye=async()=>{try{F(!0);const Be=window.localStorage.getItem("hyperToken");if(!Be){r(!0);return}const it="https://dextrabothypev2.nftinit.io/api/wallet/list-extended",tt=window.localStorage.getItem("hyperAddress"),dt=await(await fetch(it,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:n?n.toLowerCase():tt,token:Be})})).json();dt.success&&Y(dt.data||[])}catch(Be){console.error("Error fetching wallet list:",Be)}},Ne=Be=>Be!=null&&Be.assetPositions?Be.assetPositions.filter(it=>{if(!it.position||!it.position.szi)return!1;const tt=parseFloat(it.position.szi);return!isNaN(tt)&&tt!==0}).map(it=>{const tt=it.position,at=parseFloat(tt.szi),dt=parseFloat(tt.entryPx),ct=parseFloat(tt.positionValue),Ut=parseFloat(tt.unrealizedPnl),kt=parseFloat(tt.returnOnEquity)*100,tn=parseFloat(tt.marginUsed),jt=tt.leverage.value,un=tt.leverage.type,cn=parseFloat(tt.cumFunding.sinceOpen),Pt=at>0?"Long":"Short";return{asset:tt.coin,type:Pt,size:at,entryPrice:dt.toFixed(4),currentPrice:(ct/Math.abs(at)).toFixed(4),leverage:jt,leverageType:un,positionValue:ct.toFixed(2),marginUsed:tn.toFixed(2),unrealizedPnl:Ut.toFixed(2),roe:kt.toFixed(2),funding:cn.toFixed(4),liquidationPrice:tt.liquidationPx?parseFloat(tt.liquidationPx).toFixed(2):"N/A"}}):[],be=()=>{w.current&&(console.log("Closing WebSocket connection..."),w.current.readyState===WebSocket.OPEN&&w.current.send(JSON.stringify({method:"unsubscribe",subscription:{type:"webData2"}})),w.current.close(),w.current=null),N.current&&(clearInterval(N.current),N.current=null),C.current&&(clearTimeout(C.current),C.current=null)},je=Be=>{w.current=new WebSocket(van),w.current.onopen=()=>{console.log("WebSocket Connected"),Be.forEach(it=>{let tt={method:"subscribe",subscription:{type:"webData2",user:it==null?void 0:it.wallet_address}};w.current.send(JSON.stringify(tt))}),N.current=setInterval(()=>{var it;if(((it=w.current)==null?void 0:it.readyState)===WebSocket.OPEN){const tt={id:99,method:"ping"};w.current.send(JSON.stringify(tt))}},3e4)},w.current.onclose=it=>{console.log("WebSocket Disconnected",it.code,it.reason),N.current&&(clearInterval(N.current),N.current=null),it.code!==1e3&&(C.current||(C.current=setTimeout(()=>{C.current=null,je(Be)},5e3)))},w.current.onerror=it=>{console.error("WebSocket Error:",it)},w.current.onmessage=it=>{try{const tt=JSON.parse(it.data);if(tt.method==="pong")return;if(tt.result==="success"){console.log("Successfully subscribed to channel");return}tt.channel==="webData2"&&Ie(tt)}catch(tt){console.error("Error processing WebSocket message:",tt),console.error("Raw message that caused error:",it.data),X(!1)}}},Ie=Be=>{P(it=>{let tt=!1;const at=it.map(dt=>{var ct,Ut,kt,tn,jt,un,cn,Pt,Xe,Vt,Yt,Ve,Ke;if((dt==null?void 0:dt.wallet_address.toLowerCase())===((ct=Be==null?void 0:Be.data)==null?void 0:ct.user.toLowerCase())){const ft=(tn=(kt=(Ut=Be==null?void 0:Be.data)==null?void 0:Ut.clearinghouseState)==null?void 0:kt.assetPositions)==null?void 0:tn.reduce((At,Je)=>{var He;return At+(parseFloat((He=Je==null?void 0:Je.position)==null?void 0:He.unrealizedPnl)||0)},0),en=Ne((jt=Be==null?void 0:Be.data)==null?void 0:jt.clearinghouseState),Dt={...dt,perpEquity:(Pt=(cn=(un=Be==null?void 0:Be.data)==null?void 0:un.clearinghouseState)==null?void 0:cn.marginSummary)==null?void 0:Pt.accountValue,unrealizedPnl:ft,withdrawableUsdc:(Vt=(Xe=Be==null?void 0:Be.data)==null?void 0:Xe.clearinghouseState)==null?void 0:Vt.withdrawable,marginUsed:(Ke=(Ve=(Yt=Be==null?void 0:Be.data)==null?void 0:Yt.clearinghouseState)==null?void 0:Ve.marginSummary)==null?void 0:Ke.totalMarginUsed,positions:en};if(JSON.stringify(dt)!==JSON.stringify(Dt))return tt=!0,Dt}return dt});return tt?at:it}),setTimeout(()=>{F(!1),X(!1)},3e3)};m.useEffect(()=>{const Be=()=>{const it=parseInt(localStorage.getItem("walletManagementPage"))||1;it!==G&&ae&&(be(),V(it),Re(it,ie))};return window.addEventListener("storage",Be),()=>{window.removeEventListener("storage",Be)}},[G,ie,ae]);const Re=(Be,it)=>{if(!it||it.length===0){F(!1);return}F(!0);const tt=(Be-1)*ee,at=tt+ee,dt=it.slice(tt,at);P(dt),be(),je(dt)},Qe=Be=>{Be<1||Be>Math.ceil(ie.length/ee)||(F(!0),V(Be),localStorage.setItem("walletManagementPage",Be),Re(Be,ie))};return m.useEffect(()=>()=>{be()},[e.pathname]),m.useEffect(()=>{(async()=>{var at,dt;const it=window.localStorage.getItem("hyperToken"),tt=window.localStorage.getItem("hyperAddress");if(!(!it||!tt))try{const ct=await Si(tt.toLowerCase(),it);ct!=null&&ct.success?(a(ct==null?void 0:ct.telegram_chat_id),o(ct==null?void 0:ct.subscriber_role),l(ct==null?void 0:ct.subs_expire_day),c((at=ct==null?void 0:ct.mushboomer_counts)==null?void 0:at.eth),u((dt=ct==null?void 0:ct.mushboomer_counts)==null?void 0:dt.sol),d(ct==null?void 0:ct.referral_code),f(ct==null?void 0:ct.refcode),x(ct==null?void 0:ct.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),g(""),v(""))}catch(ct){console.error("Token verification error:",ct),console.error(ct.message||"An unknown error occurred.")}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(Io,{children:i.jsxs($o,{children:[i.jsx("title",{children:"Wallet Management | Create & Fund Trading Wallets | Dextrabot"}),i.jsx("meta",{name:"description",content:"Create, fund, and manage your follower wallets on Dextrabot. Start copy trading today."}),i.jsx("meta",{name:"og:title",content:"Wallet Management | Create & Fund Trading Wallets | Dextrabot"}),i.jsx("meta",{name:"og:description",content:"Create, fund, and manage your follower wallets on Dextrabot. Start copy trading today."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/wallet-management"})]})}),i.jsx("div",{style:{height:"calc(100vh - 5rem)"},className:"flex justify-center items-center w-full h-auto px-1 pt-1 sm:px-6 sm:pt-2 bg-[#161616] overflow-scroll",children:i.jsx("div",{className:"flex flex-col items-stretch justify-start h-full gap-[26px] w-full flex-grow xl:flex-grow-0",children:ne==="HYPER"?i.jsxs(i.Fragment,{children:[i.jsx(uan,{data:I,loading:R,error:U,socketLoading:z,handlePageChange:Qe,handleListRequest:Ae,currentPage:G,allWallets:ie,lighterWallet:Z,extendedWallet:he,isSelectMenu:ne,setIsSelectMenu:J}),i.jsx(dan,{data:I,loading:R,error:U,socketLoading:z,handlePageChange:Qe,currentPage:G,allWallets:ie})]}):ne==="LIGHTER"?i.jsx(i.Fragment,{children:i.jsx(gan,{isSelectMenu:ne,setIsSelectMenu:J,hyperWallet:ie,lighterWallet:Z,extendedWallet:he,lighterWalletList:ce})}):i.jsx(i.Fragment,{children:i.jsx(yan,{isSelectMenu:ne,setIsSelectMenu:J,hyperWallet:ie,lighterWallet:Z,extendedWallet:he,fetchAllWalletList:ye})})})})]})};function Can({open:e,setOpen:t,copyTradeDelete:n,isDeleteWallet:r}){return i.jsxs(ga,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Oa})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Hi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-2",children:[i.jsx("div",{className:"w-80 text-center text-white text-2xl font-semibold font-manropeleading-7",children:"Confirm Delete"}),i.jsx("div",{className:"w-[348px] text-center text-white/60 text-[16px] font-medium font-manrope leading-5",children:"Are you sure you want to delete this copy trade task? This action cannot be undone."})]}),i.jsxs("div",{className:"flex  items-center justify-center gap-4",children:[i.jsx("div",{onClick:()=>{t(!1)},className:"h-8 px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Cancel"})}),i.jsx("div",{onClick:()=>{n(r.followerWallet,r.sourceWallet,r.platform,r.id)},className:"h-8 px-2.5 bg-[#7445ff] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] justify-center items-center gap-1.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Delete"})})]})]})})})})})]})}const YUe=({open:e=!1,setOpen:t=()=>{},checkAccountCopy:n,roleType:r="farming"})=>{const{setSignModalOpen:s,setTelegramChatId:a,setSubscriberRole:o,setSubsExpireDay:l,setMushboomerETH:c,setMushboomerSOL:u,setIsReferralCode:d,setIsReferralCodeName:f,setIsWhitelist:x,setHyperToken:g,setHyperAddress:v}=m.useContext(Gr),{address:w}=Yr(),[C,N]=m.useState(!1),[I,P]=m.useState(!1),[R,F]=m.useState(""),[U,L]=m.useState(""),[z,X]=m.useState(""),ne=async()=>{var ie,oe;const he=window.localStorage.getItem("hyperToken"),Y=window.localStorage.getItem("hyperAddress");if(!(!he||!Y))try{setLoadingCheckAccount(!0);const G=await Si(Y.toLowerCase(),he);G!=null&&G.success?(a(G==null?void 0:G.telegram_chat_id),o(G==null?void 0:G.subscriber_role),l(G==null?void 0:G.subs_expire_day),c((ie=G==null?void 0:G.mushboomer_counts)==null?void 0:ie.eth),u((oe=G==null?void 0:G.mushboomer_counts)==null?void 0:oe.sol),d(G==null?void 0:G.referral_code),f(G==null?void 0:G.refcode),x(G==null?void 0:G.whitelist),g(he),v(Y),X(G==null?void 0:G.farming_tools),setLoadingCheckAccount(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),g(""),v(""),setLoadingCheckAccount(!1))}catch(G){console.error("Token verification error:",G),console.error(G.message||"An unknown error occurred."),setLoadingCheckAccount(!1)}},J=async()=>new yl(window.ethereum).eth.getAccounts(Y=>Y),Z=async(he="farming",Y=24,ie=5e3)=>{Y<=0||(await new Promise(oe=>setTimeout(oe,ie)),await ne(),he==="farming"&&!z?Z(he,Y-1,ie):n())},re=async()=>{L("");const he=window.localStorage.getItem("hyperToken"),Y=window.localStorage.getItem("hyperAddress");if(!he||!w){s(!0);return}P(!0),N(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(G){console.error("Failed to switch network",G),N(!1);return}const ie=new yl(window.ethereum);var oe=await J();if(oe.length>0?oe=oe[0]:oe=void 0,oe){const V={from:oe,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:"120000000000000000"};await ie.eth.sendTransaction(V).then(ee=>{console.log("txHash :>> ",ee),N(!1),F(ee.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:w?w.toLowerCase():Y,token:he,payment_tx:ee.transactionHash,payment_role:r==="bots_extra_slot"?"bots_extra_slot":"farming_tools"})}),ne(),Z(r)}).catch(ee=>{console.log(ee),ee.code===-32003||ee.message.includes("insufficient funds")?L("Insufficient funds."):ee.message==="MetaMask Tx Signature: User denied transaction signature."&&P(!1)})}else await ie.eth.requestAccounts()};return i.jsxs(i.Fragment,{children:[i.jsx(fd,{open:I,setOpen:P,transactionHash:R,transactionLoading:C,paymentPresaleRole:z,errorFunds:U,activeMethod:2}),i.jsxs("div",{className:"fixed inset-0 z-[51] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[2px]",onClick:()=>t(!1)}),i.jsx("div",{className:"relative w-[380px] max-w-[92vw] rounded-3xl bg-[#1B1B1B] text-white shadow-xl border border-[#404040] max-h-[97dvh] overflow-y-auto p-5",children:i.jsxs("div",{className:"flex flex-col w-full gap-8 py-6",children:[i.jsx("div",{className:"mx-auto",children:i.jsx("img",{src:i5,alt:""})}),i.jsx("div",{className:"flex justify-center items-center",children:i.jsx("div",{className:"text-lg font-semibold",children:"Copy Trade"})}),i.jsx("div",{className:"text-center text-[#bdbdbd] text-sm px-6 leading-5 -mt-6",children:"You don't have an active subscription yet. Subscribe now to unlock trading bots, copy trading, and farming tools across multiple DEXs."}),i.jsx("div",{onClick:()=>{re()},className:"flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer min-w-max font-semibold",children:"Subscribe / 0.12 ETH"})]})})]})]})},San=({loading:e,error:t,trackerData:n,isRequest:r,handleCopyDelete:s,deleteLoading:a,isDeleteModalOpen:o,setIsDeleteModalOpen:l,isDeleteWallet:c,setIsDeleteWallet:u,slotTotalCount:d,checkSlotAccount:f,slotCountWallets:x,subsRole:g,slotCount:v})=>{const{trackedWatchList:w,setSignModalOpen:C}=m.useContext(Gr),{isConnected:N,address:I}=Yr(),[P,R]=m.useState(!1),[F,U]=m.useState(null),[L,z]=m.useState(""),[X,ne]=m.useState(""),[J,Z]=m.useState([]),[re,he]=m.useState(!1),[Y,ie]=m.useState({}),[oe,G]=m.useState({}),[V,ee]=m.useState([]),[ae,fe]=m.useState([]),[Ae,ce]=m.useState(null),[ye,Ne]=m.useState(!1),[be,je]=m.useState(!1),[Ie,Re]=m.useState(!1),[Qe,Be]=m.useState([]),it=m.useRef(null),[tt,at]=m.useState([]),dt=m.useRef(!1);m.useEffect(()=>{const He={};n==null||n.forEach(Rt=>{const qe=`${Rt==null?void 0:Rt.wm_address}_${Rt==null?void 0:Rt.wallet_address}_${Rt==null?void 0:Rt.wallet_id}`;He[qe]=Rt==null?void 0:Rt.copy_trait_mode}),ie(He),!dt.current&&(n==null?void 0:n.length)>0&&(Ut(),dt.current=!0)},[n]),m.useEffect(()=>{if((n==null?void 0:n.length)>0){const He=[...n];(V==null?void 0:V.length)>0&&V.forEach(Rt=>{var qe;((qe=Rt.openPositionCoinList)==null?void 0:qe.length)>0&&Rt.generated_wallet_public&&!He.some(lt=>lt.wallet_address.toLowerCase()===Rt.generated_wallet_public.toLowerCase())&&He.push({wallet_address:Rt.generated_wallet_public})}),fe(Rt=>{const qe=Rt.map(xt=>xt.wallet_address).sort().join(","),lt=He.map(xt=>xt.wallet_address).sort().join(",");return qe!==lt?He:Rt})}},[n,V]);const ct=async(He,Rt,qe,lt,xt)=>{const Nt=`${He}_${Rt}_${xt}`;try{const It=window.localStorage.getItem("hyperToken"),xn="https://dextrabothypev2.nftinit.io/api/test_app/following/status/";It||C(!0),G(kn=>({...kn,[Nt]:!0}));const dn=window.localStorage.getItem("hyperAddress"),_n=await(await fetch(xn,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:I?I.toLowerCase():dn,token:It,follow_address:Rt==null?void 0:Rt.toLowerCase(),copy_trait_mode:qe,target_platform:lt,wallet_id:xt})})).json();_n.success?(ie(kn=>({...kn,[Nt]:qe})),f()):(console.log(_n.error_message),on.error(_n.error_message))}catch(It){console.error("Error status mode:",It),on.error(It.message||"Something went wrong!")}finally{G(It=>({...It,[Nt]:!1}))}},Ut=async()=>{try{const He=window.localStorage.getItem("hyperToken"),Rt=window.localStorage.getItem("hyperAddress"),qe="https://dextrabothypev2.nftinit.io/api/wallet/generated_wallet_summary";He||C(!0);const lt=await fetch(qe,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:I?I.toLowerCase():Rt,token:He})});if(!lt.ok)throw new Ml(`Server responded with status ${lt.status}`);const xt=await lt.json();xt.success?ee(xt.data):(console.log(xt.error_message),on.error(xt.error_message))}catch(He){console.error("Error in like function:",He),on.error(He.message||"Something went wrong!")}},kt="tag",[tn,jt]=m.useState(kt),un=(He,Rt,qe,lt)=>He!=null&&He.length?[...He].sort((xt,Nt)=>{var qn,nr,tr,Qt;if(!Y||Object.keys(Y).length===0)return 0;const It=`${xt.wm_address}_${xt.wallet_address}_${xt.wallet_id}`,xn=`${Nt.wm_address}_${Nt.wallet_address}_${Nt.wallet_id}`;if(Y!=null&&Y[It]&&!(Y!=null&&Y[xn]))return-1;if(!(Y!=null&&Y[It])&&(Y!=null&&Y[xn]))return 1;const dn=qe.find(zn=>zn.wallet_address===xt.wallet_address)||{},Mn=qe.find(zn=>zn.wallet_address===Nt.wallet_address)||{},_n=qe.find(zn=>{var Yn,Lt;return((Yn=zn.wallet_address)==null?void 0:Yn.toLowerCase())===((Lt=xt==null?void 0:xt.wm_address)==null?void 0:Lt.toLowerCase())})||{},kn=qe.find(zn=>{var Yn,Lt;return((Yn=zn.wallet_address)==null?void 0:Yn.toLowerCase())===((Lt=Nt==null?void 0:Nt.wm_address)==null?void 0:Lt.toLowerCase())})||{},vn=dn.data?dn.data.reduce((zn,Yn)=>zn+parseFloat(Yn.unrealizedPnl||0),0):0,Qn=Mn.data?Mn.data.reduce((zn,Yn)=>zn+parseFloat(Yn.unrealizedPnl||0),0):0,Hn=lt==null?void 0:lt.find(zn=>{var Yn,Lt,Fn,Ee;return((Yn=zn==null?void 0:zn.generated_wallet_public)==null?void 0:Yn.toLowerCase())===((Lt=xt==null?void 0:xt.wm_address)==null?void 0:Lt.toLowerCase())&&((Fn=zn==null?void 0:zn.copy_trader_wallet)==null?void 0:Fn.toLowerCase())===((Ee=xt==null?void 0:xt.wallet_address)==null?void 0:Ee.toLowerCase())}),$n=lt==null?void 0:lt.find(zn=>{var Yn,Lt,Fn,Ee;return((Yn=zn==null?void 0:zn.generated_wallet_public)==null?void 0:Yn.toLowerCase())===((Lt=Nt==null?void 0:Nt.wm_address)==null?void 0:Lt.toLowerCase())&&((Fn=zn==null?void 0:zn.copy_trader_wallet)==null?void 0:Fn.toLowerCase())===((Ee=Nt==null?void 0:Nt.wallet_address)==null?void 0:Ee.toLowerCase())}),Jn=Hn?Hn.total_pnl:0,Nn=$n?$n.total_pnl:0,ln=Hn&&((qn=Hn.openPositionCoinList)==null?void 0:qn.length)>0&&((nr=_n.data)==null?void 0:nr.length)>0?Hn.openPositionCoinList.reduce((zn,Yn)=>{const Lt=_n.data.find(Fn=>Fn.asset===Yn);return Lt!=null&&Lt.unrealizedPnl?zn+parseFloat(Lt.unrealizedPnl):zn},0):0,Oe=$n&&((tr=$n.openPositionCoinList)==null?void 0:tr.length)>0&&((Qt=kn.data)==null?void 0:Qt.length)>0?$n.openPositionCoinList.reduce((zn,Yn)=>{const Lt=kn.data.find(Fn=>Fn.asset===Yn);return Lt!=null&&Lt.unrealizedPnl?zn+parseFloat(Lt.unrealizedPnl):zn},0):0,sn=xt.tag?xt.tag.toUpperCase():"",fn=Nt.tag?Nt.tag.toUpperCase():"",Et=xt.wm_name?xt.wm_name.toUpperCase():"",Kn=Nt.wm_name?Nt.wm_name.toUpperCase():"",Cn=xt.wallet_address?xt.wallet_address.toLowerCase():"",Bt=Nt.wallet_address?Nt.wallet_address.toLowerCase():"",an=xt.wm_address?xt.wm_address.toLowerCase():"",Pn=Nt.wm_address?Nt.wm_address.toLowerCase():"";return Rt==="tag"?sn<fn?-1:sn>fn?1:0:Rt==="-tag"?sn>fn?-1:sn<fn?1:0:Rt==="-wallet_address"?Cn<Bt?-1:Cn>Bt?1:0:Rt==="wallet_address"?Cn>Bt?-1:Cn<Bt?1:0:Rt==="-wm_address"?an<Pn?-1:an>Pn?1:0:Rt==="wm_address"?an>Pn?-1:an<Pn?1:0:Rt==="perp_equity"?(dn.perp_equity||0)-(Mn.perp_equity||0):Rt==="-perp_equity"?(Mn.perp_equity||0)-(dn.perp_equity||0):Rt==="margin_usage"?(dn.margin_usage||0)-(Mn.margin_usage||0):Rt==="-margin_usage"?(Mn.margin_usage||0)-(dn.margin_usage||0):Rt==="unrealizedPnl"?vn-Qn:Rt==="-unrealizedPnl"?Qn-vn:Rt==="-wm_name"?Et<Kn?-1:Et>Kn?1:0:Rt==="wm_name"?Et>Kn?-1:Et<Kn?1:0:Rt==="total_pnl"?Jn-Nn:Rt==="-total_pnl"?Nn-Jn:Rt==="totalUnrealizedPnl"?ln-Oe:Rt==="-totalUnrealizedPnl"?Oe-ln:Rt==="-created_at"?new Date(Nt.created_at)-new Date(xt.created_at):Rt==="created_at"?new Date(xt.created_at)-new Date(Nt.created_at):0}):[];m.useEffect(()=>{if(!(n!=null&&n.length))return;const He=n.filter(Rt=>!!(!(Qe!=null&&Qe.length)||Qe.includes("HyperLiquid")&&Rt.target_platform==="hyper"||Qe.includes("Lighter")&&Rt.target_platform==="lighter"));at(un(He,tn,J,V))},[tn,n,Qe]);const cn=async(He,Rt)=>{try{z(He),ne(Rt);const qe=window.localStorage.getItem("hyperToken"),lt=window.localStorage.getItem("hyperAddress"),xt="https://dextrabothypev2.nftinit.io/api/test_app/following/info/";qe||C(!0);const Nt=await fetch(xt,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:I?I.toLowerCase():lt,token:qe,follow_address:He.toLowerCase()})});if(!Nt.ok)throw new Ml(`Server responded with status ${Nt.status}`);const It=await Nt.json();It.success?(U(Array.isArray(It==null?void 0:It.data)?[...It.data].sort((xn,dn)=>new Date(dn.created_at||0)-new Date(xn.created_at||0)):It==null?void 0:It.data),R(!0)):(console.log(It.error_message),on.error(It.error_message))}catch(qe){console.error("Error in like function:",qe),on.error(qe.message||"Something went wrong!")}},Pt=He=>He!=null&&He.assetPositions?He.assetPositions.filter(Rt=>{if(!Rt.position||!Rt.position.szi)return!1;const qe=parseFloat(Rt.position.szi);return!isNaN(qe)&&qe!==0}).map(Rt=>{const qe=Rt.position,lt=parseFloat(qe.szi),xt=parseFloat(qe.entryPx),Nt=parseFloat(qe.positionValue),It=parseFloat(qe.unrealizedPnl),xn=parseFloat(qe.returnOnEquity)*100,dn=parseFloat(qe.marginUsed),Mn=qe.leverage.value,_n=parseFloat(qe.cumFunding.sinceOpen),kn=lt>0?"Long":"Short";return{asset:qe.coin,type:kn,size:Math.abs(lt),entryPrice:xt.toFixed(2),currentPrice:(Nt/Math.abs(lt)).toFixed(2),leverage:Mn,positionValue:Nt.toFixed(2),marginUsed:dn.toFixed(2),unrealizedPnl:It.toFixed(2),roe:xn.toFixed(2),funding:_n.toFixed(4),liquidationPrice:qe.liquidationPx?parseFloat(qe.liquidationPx).toFixed(2):"N/A"}}):[],Xe=async He=>{try{const qe=await ls.post("https://api-ui.hyperliquid.xyz/info",{type:"clearinghouseState",user:He});if(qe.data){const lt=Pt(qe.data);Z(xt=>{var Nt,It,xn,dn;return[...xt,{wallet_address:He,perp_equity:(It=(Nt=qe==null?void 0:qe.data)==null?void 0:Nt.marginSummary)==null?void 0:It.accountValue,margin_usage:parseFloat((xn=qe==null?void 0:qe.data)==null?void 0:xn.marginSummary.totalMarginUsed)/parseFloat((dn=qe==null?void 0:qe.data)==null?void 0:dn.marginSummary.accountValue),data:lt}]})}}catch(Rt){console.error("Error fetching user state from HyperState:",Rt)}},Vt=async He=>{try{const Rt=window.localStorage.getItem("hyperToken"),qe=window.localStorage.getItem("hyperAddress"),xt=await fetch("https://dextrabothypev2.nftinit.io/api/hyper/trade/getclearinghousestate/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:I?I.toLowerCase():qe,token:Rt,follow_address:He.toLowerCase()})});if(xt.ok){const Nt=await xt.json();if(Nt.success){const It=Pt(Nt==null?void 0:Nt.data);Z(xn=>{var dn;return[...xn,{wallet_address:He,perp_equity:(dn=Nt==null?void 0:Nt.data.marginSummary)==null?void 0:dn.accountValue,margin_usage:parseFloat(Nt==null?void 0:Nt.data.marginSummary.totalMarginUsed)/parseFloat(Nt==null?void 0:Nt.data.marginSummary.accountValue),data:It}]})}}else if(xt.status===500)console.warn(`Received 500 error for ${He}, retrying with getUserHyperState`),await Xe(He);else throw new Ml(`Request failed with status ${xt.status}`)}catch(Rt){console.error("Error fetching user state:",Rt)}},Yt=m.useRef(new Set);m.useEffect(()=>{!e&&r&&(ae==null?void 0:ae.length)>0&&(async()=>{var qe;const Rt=new Set;for(let lt=0;lt<ae.length;lt++){const xt=ae[lt],Nt=(qe=xt==null?void 0:xt.wallet_address)==null?void 0:qe.toLowerCase();if(!(!Nt||Yt.current.has(Nt))){Rt.add(Nt),Yt.current.add(Nt);try{await Vt(Nt)}catch(It){console.error(`Error fetching user state for wallet ${Nt}:`,It)}await new Promise(It=>setTimeout(It,500))}}})()},[r,e,ae]),m.useEffect(()=>{P||f()},[P]);const Ve=m.useRef(null),Ke=()=>{Ve.current&&(Ve.current.scrollLeft-=100)},ft=()=>{Ve.current&&(Ve.current.scrollLeft+=100)},en=()=>{Ve.current&&(Ve.current.scrollTop+=200)},Dt=()=>{Ve.current&&(Ve.current.scrollTop-=200)},At=["HyperLiquid","Lighter"],Je=He=>{Be(Rt=>Rt.includes(He)?Rt.filter(qe=>qe!==He):[...Rt,He])};return m.useEffect(()=>{function He(Rt){it.current&&!it.current.contains(Rt.target)&&Re(!1)}return document.addEventListener("mousedown",He),()=>document.removeEventListener("mousedown",He)},[]),i.jsxs(i.Fragment,{children:[i.jsx(g5,{open:P,setOpen:R,copyTradeData:F,copyTradeWallet:L,setCopyTradeWallet:z,setCopyTradeData:U,sourcePage:X}),i.jsx(Can,{open:o,setOpen:l,copyTradeDelete:s,isDeleteWallet:c}),ye&&Ia.createPortal(i.jsx(Ale,{open:ye,setOpen:Ne,oldSlotCount:Ae,checkAccountTrade:f,tradeMarket:"copyTrade"}),document.body),be&&Ia.createPortal(i.jsx(YUe,{open:be,setOpen:je,checkAccountCopy:f}),document.body),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white bg-[#161616] w-full h-full font-manrope",children:[i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2 font-manrope max-w-full w-full bg-[#161616] pl-2 sm:pl-0 pt-4",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px]",children:"Copy Trade"})})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"absolute hidden -top-6 right-4 z-10 lg:flex justify-start items-center gap-2",children:[i.jsx("button",{onClick:Ke,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:ft,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:Dt,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:en,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{className:"w-full h-full overflow-x-scroll relative overflow-y-scroll flex-grow",ref:Ve,children:i.jsxs("table",{className:"w-full relative mb-20",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] sm:left-0 h-8 pl-3 min-w-[95px] sm:min-w-[95px] z-[8]",children:i.jsx("div",{className:"flex items-center justify-start w-full min-w-max sticky left-0 h-8",children:i.jsx("div",{className:"flex items-center justify-start",children:"Status"})})}),i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] left-[95px] h-8 px-1 min-w-[130px] z-[8]",children:i.jsx("div",{className:"flex items-center justify-start w-full min-w-max sticky left-0 h-8",children:i.jsx("div",{className:"flex items-center justify-start",children:"Actions"})})}),i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] left-[225px] h-8 px-1 min-w-[75px] z-[8]",children:i.jsxs("div",{className:"flex items-center justify-start w-full min-w-max sticky left-0 h-8",children:[i.jsx("div",{className:"flex items-center justify-start",children:"DEX"}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>{Re(!Ie)},className:`${Qe.length>0?"bg-gray-900":"bg-[#555555]"} ml-2 inline-flex items-center p-1 rounded  hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx(Ff,{className:`w-4 h-4 ${Qe.length>0?"text-blue-500":"text-white"}`})}),Ie&&i.jsxs("div",{ref:it,className:`absolute left-[58px] mt-32 w-[208px]
                               bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>Be(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),At==null?void 0:At.map(He=>i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-6 relative rounded hover:bg-[#464646] cursor-pointer text-white text-[13px] font-semibold font-manrope leading-[8px] mt-2",children:[i.jsx("input",{type:"checkbox",checked:Qe.includes(He),onChange:()=>Je(He),className:"mr-2 bg-[#3b3b3b] hidden "}),i.jsx("div",{className:`w-4 h-4 max-w-4 max-h-4 flex items-center justify-center border ${Qe.includes(He)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:Qe.includes(He)&&i.jsx("img",{src:Wc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[1px]"})}),He]},He))]})]})]})}),i.jsx("th",{scope:"col",className:"sm:sticky bg-[#161616] lg:left-[300px] h-10 px-1 min-w-[130px] z-[7]",children:i.jsx(ci,{title:"Follower Name",sortKey:"wm_name",sortOption:tn,setSortOption:jt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#161616] h-10 px-1 min-w-[145px] z-[8]",children:i.jsx(ci,{title:"Follower Wallet",sortKey:"wm_address",sortOption:tn,setSortOption:jt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#161616] h-10 px-1 min-w-[130px]",children:i.jsx(ci,{title:"Source Tag",sortKey:"tag",sortOption:tn,setSortOption:jt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#161616] h-10 px-1 min-w-[140px] z-[8]",children:i.jsx(ci,{title:"Source Wallet",sortKey:"wallet_address",sortOption:tn,setSortOption:jt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[110px] pl-1",children:i.jsx(ci,{title:"Follower PnL",sortKey:"total_pnl",sortOption:tn,setSortOption:jt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[130px] pl-1",children:i.jsx(ci,{title:"Follower uPnL",sortKey:"totalUnrealizedPnl",sortOption:tn,setSortOption:jt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[115px] sm:min-w-[115px] pl-1",children:i.jsx(ci,{title:"Perp Equity",sortKey:"perp_equity",sortOption:tn,setSortOption:jt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[130px] sm:min-w-[130px] pl-1",children:i.jsx(ci,{title:"Margin Usage",sortKey:"margin_usage",sortOption:tn,setSortOption:jt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[114px] sm:min-w-[114px] pl-1",children:i.jsx(ci,{title:"uPnL",sortKey:"unrealizedPnl",sortOption:tn,setSortOption:jt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[124px] sm:min-w-[124px] pl-1",children:i.jsx(ci,{title:"Created Date",sortKey:"created_at",sortOption:tn,setSortOption:jt,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[100px] pl-1 pr-4",children:i.jsx("div",{className:"flex items-center justify-center gap-1 min-w-max font-manrope",children:i.jsx("div",{className:"cursor-pointer flex items-center justify-end group"})})})]})}),i.jsx("tbody",{children:!n||e?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:12,children:i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center -mt-16 ml-[45%] w-max",children:i.jsx(Ma,{})})})}):t&&!n?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:13,children:i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center ml-[33%] w-max",children:i.jsx(Ml,{})})})}):(n==null?void 0:n.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:13,children:i.jsx("div",{className:"flex min-h-[44vh] h-66 flex-col justify-center items-center  ml-[33%] w-max",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 -ml-16",children:[i.jsx("img",{src:ec,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"You haven't added a wallet to your copied wallet list yet."}),i.jsxs("div",{className:"text-center -mt-2",children:[i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:["To start copy trading, please visit the"," "]}),i.jsx("span",{className:"text-white text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:"'Discover Wallets'"}),i.jsxs("span",{className:"text-[#979797] text-[13px] font-normal font-manrope leading-[14px] tracking-wide",children:[" ","page."]})]})]})]})})})})}):tt==null?void 0:tt.map((He,Rt)=>{var dn,Mn,_n,kn,vn;const qe=J.find(Qn=>Qn.wallet_address===He.wallet_address),lt=J.find(Qn=>Qn.wallet_address===(He==null?void 0:He.wm_address)),xt=V==null?void 0:V.find(Qn=>{var Hn,$n,Jn,Nn;return((Hn=Qn==null?void 0:Qn.generated_wallet_public)==null?void 0:Hn.toLowerCase())===(($n=He==null?void 0:He.wm_address)==null?void 0:$n.toLowerCase())&&((Jn=Qn==null?void 0:Qn.copy_trader_wallet)==null?void 0:Jn.toLowerCase())===((Nn=He==null?void 0:He.wallet_address)==null?void 0:Nn.toLowerCase())}),Nt=xt?xt.total_pnl:null;let It=0;xt&&((dn=xt==null?void 0:xt.openPositionCoinList)==null?void 0:dn.length)>0&&((Mn=lt==null?void 0:lt.data)==null?void 0:Mn.length)>0&&((_n=xt==null?void 0:xt.openPositionCoinList)==null||_n.forEach(Qn=>{var $n;const Hn=($n=lt==null?void 0:lt.data)==null?void 0:$n.find(Jn=>{var Nn;return((Nn=Jn==null?void 0:Jn.asset)==null?void 0:Nn.toLowerCase().trim())===(Qn==null?void 0:Qn.toLowerCase().trim())});Hn&&(Hn!=null&&Hn.unrealizedPnl)&&(It+=parseFloat(Hn==null?void 0:Hn.unrealizedPnl))}));const xn=`${He.follower_wallet}_${He.wallet_address}_${He.wallet_id}`;return i.jsxs("tr",{className:`${Rt%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[56px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",className:`${Rt%2==0,"bg-[#161616]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222]`,children:(()=>{const Qn=x==null?void 0:x.includes(He.wallet_id),Hn=`${He==null?void 0:He.wm_address}_${He==null?void 0:He.wallet_address}_${He==null?void 0:He.wallet_id}`,$n=d===0&&!Y[Hn]&&!Qn,Jn=g;return i.jsxs("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2.5 pl-2 h-14 max-h-14 relative",children:[i.jsxs("div",{className:"relative group/switch",children:[i.jsx(Oo,{checked:!!Y[Hn],onChange:()=>{if(!Jn&&(He==null?void 0:He.target_platform)==="lighter"){je(!0);return}if($n&&(He==null?void 0:He.target_platform)==="lighter"){ce(v),Ne(!0);return}ct(He==null?void 0:He.wm_address,He.wallet_address,!Y[Hn],He==null?void 0:He.target_platform,He==null?void 0:He.wallet_id)},disabled:oe[Hn],className:`${Y[Hn]?"bg-[#1DE674]":"bg-[#353535]"} ${oe[Hn]?"cursor-not-allowed":"cursor-pointer"} flex h-[18px] w-[28px] rounded-[256px] p-1 transition-colors`,children:i.jsx("span",{"aria-hidden":"true",className:`${Y[Hn]?"translate-x-1.5 bg-white":"-translate-x-[1px] bg-[#D5D5D5]"} inline-block size-[14px] -mt-[3px] rounded-full shadow-lg transition`})}),!Jn&&(He==null?void 0:He.target_platform)==="lighter"?i.jsx("div",{className:"absolute -left-1 translate-x-0 top-[-34px] px-2 py-1 text-xs rounded-md bg-[#353535] text-white whitespace-nowrap opacity-0 group-hover/switch:opacity-100 transition duration-200",children:"Subscribe"}):$n&&(He==null?void 0:He.target_platform)==="lighter"&&i.jsx("div",{className:"absolute -left-1 translate-x-0 top-[-34px] px-2 py-1 text-xs rounded-md bg-[#353535] text-white whitespace-nowrap opacity-0 group-hover/switch:opacity-100 transition duration-200",children:"Get more slots"})]}),oe[Hn]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[34px] px-0.5 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):Y[Hn]?"On":"Off"]})})()}),i.jsx("td",{scope:"row",className:`${Rt%2==0,"bg-[#161616]"} sm:sticky left-[95px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-0.5 h-14 max-h-14",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{onClick:()=>{cn(He==null?void 0:He.wallet_address,He==null?void 0:He.wallet_id)},className:`${n!=null&&n.some(Qn=>Qn.wallet_address===(He==null?void 0:He.wallet_address))?"bg-[#67ffbd] text-[#161616] font-semibold":"border border-[#67ffbd] bg-[#161616] text-[#67ffbd] hover:bg-[#67ffbd] hover:text-[#161616] font-bold"} h-[22px] rounded-[256px] justify-center items-center gap-1 inline-flex cursor-pointer text-xs font-['Manrope'] leading-[8px] tracking-tight px-2 min-w-max`,children:"Copy Trade"}),i.jsx(x5,{walletAddress:He==null?void 0:He.wallet_address,children:i.jsx("div",{className:"w-[18px] h-[18px] justify-center items-center flex cursor-pointer",children:w.some(Qn=>Qn.wallet_address===(He==null?void 0:He.wallet_address))?i.jsx("img",{src:r5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:SA,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})})]})})}),i.jsx("td",{scope:"row",className:`${Rt%2==0,"bg-[#161616]"} sm:sticky left-[225px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-5 h-14 max-h-14",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5",children:(He==null?void 0:He.target_platform)==="lighter"?i.jsx(fi,{content:"Lighter",children:i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(Hf,{className:"w-4 h-4 text-[#fff]"})})}):(He==null?void 0:He.target_platform)==="hyper"?i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(fi,{content:"Hyperliquid",children:i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx("img",{src:ax,alt:"",className:"w-4 h-4 text-[#fff]"})})})}):i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(fi,{content:"Dextrabot",children:i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx("img",{src:Hi,alt:"",className:"w-4 h-4 text-[#fff]"})})})})})})}),i.jsx("td",{scope:"row",className:`${Rt%2===0,"bg-[#161616]"} sm:sticky lg:left-[300px] z-[1] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5 has-tooltip relative",children:[i.jsx(ra,{info1:He!=null&&He.wm_name?(He==null?void 0:He.wm_name.length)>=13?(He==null?void 0:He.wm_name).slice(0,13)+"...":He==null?void 0:He.wm_name:"--",info1_Color:"text-white",rowTwo:!1}),(He==null?void 0:He.wm_name)&&(He==null?void 0:He.wm_name.length)>=13&&i.jsx("span",{className:"-ml-[9px]",children:i.jsx(_a,{content:`${He==null?void 0:He.wm_name}`,positionTop:!0,alignRight:!1})})]})})})}),i.jsx("td",{scope:"row",className:`${Rt%2===0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4  min-h-[56px]",children:i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${He==null?void 0:He.wm_address}`,"_blank")},className:"cursor-pointer group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx(ra,{info1:`${(He==null?void 0:He.wm_address).slice(0,5)+"..."+(He==null?void 0:He.wm_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:Qn=>{Qn.stopPropagation(),navigator.clipboard.writeText(He==null?void 0:He.wm_address),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:bo,alt:"",className:"cursor-pointer"})]})})})}),i.jsx("td",{scope:"row",className:`${Rt%2===0,"bg-[#161616]"} group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5 has-tooltip relative",children:[i.jsx(ra,{info1:He!=null&&He.tag?(He==null?void 0:He.tag.length)>=10?(He==null?void 0:He.tag).slice(0,10)+"...":He==null?void 0:He.tag:"--",info1_Color:"text-white",rowTwo:!1}),(He==null?void 0:He.tag)&&(He==null?void 0:He.tag.length)>=10&&i.jsx("span",{className:"-ml-[9px]",children:i.jsx(_a,{content:`${He==null?void 0:He.tag}`,positionTop:!0,alignRight:!1})})]})})})}),i.jsx("td",{scope:"row",className:`${Rt%2===0,"bg-[#161616]"}  group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4  min-h-[56px]",children:i.jsx("div",{onClick:()=>{window.open(`/wallet-details/${He==null?void 0:He.wallet_address}`,"_blank")},className:"cursor-pointer group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx(ra,{info1:`${(He==null?void 0:He.wallet_address).slice(0,5)+"..."+(He==null?void 0:He.wallet_address).slice(-4)}`,info1_Color:"text-white",rowTwo:!1}),i.jsx("img",{onClick:Qn=>{Qn.stopPropagation(),navigator.clipboard.writeText(He==null?void 0:He.wallet_address),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:bo,alt:"",className:"cursor-pointer"})]})})})}),i.jsx("td",{children:i.jsx(xh,{info:Nt!==null?`$${Er(Math.abs(Nt))}`:"--",textColor:`${Nt>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"}`})}),i.jsx("td",{children:i.jsx(xh,{info:xt?`$${Er(Math.abs(It))}`:"--",textColor:`${It>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"}`})}),i.jsx("td",{children:re?i.jsx(xh,{info:"Loading...",textColor:"text-white"}):qe?i.jsx(xh,{info:(qe==null?void 0:qe.perp_equity)!=0?`$${Er(qe==null?void 0:qe.perp_equity)}`:"$0",textColor:"text-white"}):i.jsx(xh,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{children:re?i.jsx(xh,{info:"Loading...",textColor:"text-white"}):qe?i.jsx(xh,{info:isNaN(qe==null?void 0:qe.margin_usage)?"0%":`${((qe==null?void 0:qe.margin_usage)*100).toFixed(2)}%`,textColor:"text-white"}):i.jsx(xh,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{children:re?i.jsx(xh,{info:"Loading...",textColor:"text-white"}):qe?i.jsx(xh,{info:(qe==null?void 0:qe.data)!=0?`$${Er(Math.abs((kn=qe==null?void 0:qe.data)==null?void 0:kn.reduce((Qn,Hn)=>Qn+parseFloat(Hn.unrealizedPnl||0),0)))}`:"$0",textColor:`${((vn=qe==null?void 0:qe.data)==null?void 0:vn.reduce((Qn,Hn)=>Qn+parseFloat(Hn.unrealizedPnl),0))>=0?"text-[#4ae3b5]":"text-[#ff6b6b]"}`}):i.jsx(xh,{info:"Loading...",textColor:"text-white"})}),i.jsx("td",{children:i.jsx(xh,{info:(He==null?void 0:He.created_at)&&d3(He==null?void 0:He.created_at),textColor:"text-white"})}),i.jsx("td",{className:"pr-4",children:i.jsx("div",{className:"pl-1 flex flex-col items-end gap-2 font-manrope",children:a[xn]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[54px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{onClick:()=>{u({followerWallet:He==null?void 0:He.wm_address,sourceWallet:He==null?void 0:He.wallet_address,platform:He==null?void 0:He.target_platform,id:He==null?void 0:He.wallet_id}),l(!0)},className:"h-5 px-2 py-1.5 rounded-md border border-white justify-start items-center gap-2 inline-flex",children:i.jsx("div",{className:"text-white text-[11px] font-semibold font-manrope leading-[8px] tracking-tight cursor-pointer",children:"Delete"})})})})]},Rt)})})]})})]})]})]})},xh=({info:e,textColor:t})=>i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:`${t} text-sm font-semibold font-manrope leading-none flex items-center justify-start pl-1 gap-0.5`,children:e})}),Nan=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState(!1),{isConnected:s,address:a}=Yr(),{copyTradeWatchList:o,getCopyTradeWatchList:l,trackedWatchList:c,getTrackedWatchList:u,copyWatchListLoading:d,copyWatchListError:f,setTelegramChatId:x,setSubscriberRole:g,setSubsExpireDay:v,setMushboomerETH:w,setIsWhitelist:C,setMushboomerSOL:N,setIsReferralCode:I,setIsReferralCodeName:P,setHyperToken:R,setHyperAddress:F,hyperToken:U}=m.useContext(Gr),[L,z]=m.useState({}),[X,ne]=m.useState(!1),[J,Z]=m.useState({followerWallet:"",sourceWallet:"",platform:"",id:null}),[re,he]=m.useState(0),[Y,ie]=m.useState([]),[oe,G]=m.useState(""),[V,ee]=m.useState(0);m.useEffect(()=>{U&&(l(),u(),t(!0),r(!0))},[U]);const ae=async()=>{var Ne,be,je,Ie;const ce=window.localStorage.getItem("hyperToken"),ye=window.localStorage.getItem("hyperAddress");if(!(!ce||!ye))try{const Re=await Si(ye.toLowerCase(),ce);Re!=null&&Re.success?(x(Re==null?void 0:Re.telegram_chat_id),g(Re==null?void 0:Re.subscriber_role),v(Re==null?void 0:Re.subs_expire_day),w((Ne=Re==null?void 0:Re.mushboomer_counts)==null?void 0:Ne.eth),N((be=Re==null?void 0:Re.mushboomer_counts)==null?void 0:be.sol),I(Re==null?void 0:Re.referral_code),P(Re==null?void 0:Re.refcode),C(Re==null?void 0:Re.whitelist),he((je=Re==null?void 0:Re.copy_trade_slots_info)==null?void 0:je.total_slot_count),ie(Re==null?void 0:Re.copy_trade_slots_wallets),G(Re==null?void 0:Re.farming_tools),ee((Ie=Re==null?void 0:Re.copy_trade_slots_info)==null?void 0:Ie.extra_slot_count)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),R(""),F(""))}catch(Re){console.error("Token verification error:",Re)}};m.useEffect(()=>{ae()},[]);const fe=async(ce,ye,Ne,be)=>{const je=`${ce}_${ye}_${be}`;try{const Ie=window.localStorage.getItem("hyperToken"),Re="https://dextrabothypev2.nftinit.io/api/test_app/following/unfollow/";if(!Ie||!ye||!Ne||!be||!ce)throw new Error("Required information is missing. Please log in or connect your wallet.");z(tt=>({...tt,[je]:!0}));const Qe=window.localStorage.getItem("hyperAddress"),Be=await fetch(Re,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:a?a.toLowerCase():Qe,token:Ie,follow_address:ye.toLowerCase(),target_platform:Ne,wallet_id:be})});if(!Be.ok)throw new Error(`Failed to unlike: ${Be.status} ${Be.statusText}`);const it=await Be.json();it.success?(z(tt=>({...tt,[je]:!1})),l(),ne(!1),Z({followerWallet:"",sourceWallet:"",platform:"",id:null}),ae(),on.success(`${ye==null?void 0:ye.slice(0,5)}...${ye==null?void 0:ye.slice(-3)} removed from watchlist`,{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}})):(on.error(it.error_message),z(tt=>({...tt,[je]:!1})),ne(!1))}catch(Ie){on.error(Ie.message||"Something went wrong!"),z(Re=>({...Re,[je]:!1})),ne(!1)}},Ae=!!window.localStorage.getItem("hyperToken");return i.jsxs(i.Fragment,{children:[i.jsx(Io,{children:i.jsx($o,{children:Ae?i.jsxs(i.Fragment,{children:[i.jsx("title",{children:"Copy Trade on Hyperliquid | Mirror Top Traders with Dextrabot"}),i.jsx("meta",{name:"description",content:"Automatically copy trade top-performing Hyperliquid traders with customizable risk parameters. Set position sizing, stop-loss levels, and take-profit targets with Dextrabot's copy trade system."}),i.jsx("meta",{property:"og:title",content:"Copy Trade on Hyperliquid | Mirror Top Traders with Dextrabot"}),i.jsx("meta",{property:"og:description",content:"Automatically copy trade top-performing Hyperliquid traders with customizable risk parameters. Set position sizing, stop-loss levels, and take-profit targets with Dextrabot's copy trade system."}),i.jsx("meta",{property:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{property:"og:url",content:"https://app.dextrabot.com/copy-trade"})]}):i.jsxs(i.Fragment,{children:[i.jsx("title",{children:"Dextrabot Copy Trading | Automate Hyperliquid Trading with Top Performers"}),i.jsx("meta",{name:"description",content:"Replicate top Hyperliquid traders automatically with Dextrabot's advanced copy trading system. Set custom risk parameters, position sizing, and selective token filtering for precise portfolio control."}),i.jsx("meta",{property:"og:title",content:"Dextrabot Copy Trading | Automate Hyperliquid Trading with Top Performers"}),i.jsx("meta",{property:"og:description",content:"Replicate top Hyperliquid traders automatically with Dextrabot's advanced copy trading system. Set custom risk parameters, position sizing, and selective token filtering for precise portfolio control."}),i.jsx("meta",{property:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{property:"og:url",content:"https://app.dextrabot.com/copy-trade"})]})})}),i.jsx("div",{style:{height:"calc(100vh - 5rem)"},className:"flex justify-center items-center w-full h-full px-1 pt-1 sm:px-6 sm:pt-6 bg-[#161616] overflow-hidden",children:i.jsx("div",{className:"flex flex-col items-stretch justify-center h-full gap-[26px] w-full flex-grow xl:flex-grow-0",children:Ae?i.jsx(San,{loading:d,error:f,trackerData:o,isRequest:e,handleCopyDelete:fe,deleteLoading:L,isDeleteModalOpen:X,setIsDeleteModalOpen:ne,isDeleteWallet:J,setIsDeleteWallet:Z,slotTotalCount:re,checkSlotAccount:ae,slotCountWallets:Y,subsRole:oe,slotCount:V}):i.jsx("div",{className:"flex justify-center items-center w-full",children:i.jsx(dU,{})})})})]})},Aan=({volumeLeaderboardData:e,userData:t,currentPage:n=1,rowsPerPage:r=25})=>{const[s,a]=m.useState([]),[o,l]=m.useState({key:null,direction:"asc"}),c=localStorage.getItem("hyperAddress");localStorage.getItem("hyperToken");const u=(t==null?void 0:t.refCode)||(t==null?void 0:t.refcode)||(typeof window<"u"?window.localStorage.getItem("refcode"):"")||"";m.useEffect(()=>{const x=c?c.toLowerCase():null,g=e.map(v=>{const w=v.out_subscriber_address?v.out_subscriber_address.toLowerCase():null,C=v.owner||x&&w===x;return{...v,owner:!!C,refCode:C&&u?u:v.refCode||v.refcode||null,referral_xp:v.referral_xp??v.calculated_xp??v.overall_point_result??0}});a(g)},[e,c,u]);const d=x=>{let v=["overall_point_result","referral_xp"].includes(x)?"desc":"asc";o.key===x&&(v=o.direction==="asc"?"desc":"asc");const w=[...s].sort((C,N)=>{const I=parseFloat(C[x])||0,P=parseFloat(N[x])||0;return I<P?v==="asc"?-1:1:I>P?v==="asc"?1:-1:0});a(w),l({key:x,direction:v})},f=x=>o.key!==x?i.jsx(T3,{className:"inline ml-2 text-white"}):o.direction==="asc"?i.jsx(k3,{className:"inline ml-2 text-white"}):i.jsx(_3,{className:"inline ml-2 text-white"});return i.jsx("div",{className:"overflow-x-auto mobile-scroll-indicator",children:i.jsxs("table",{className:"w-full text-white min-w-[900px]",children:[i.jsx("thead",{className:"text-left",children:i.jsxs("tr",{children:[i.jsxs("th",{className:"px-3 sm:px-6 py-3 sm:py-4 cursor-pointer flex items-center text-gray-300 font-semibold text-xs sm:text-sm",onClick:()=>d("ranking"),children:["# ",f("ranking")]}),i.jsx("th",{className:"px-3 sm:px-6 py-3 sm:py-4 text-gray-300 font-semibold text-xs sm:text-sm",children:"Wallet"}),i.jsxs("th",{className:"px-3 sm:px-6 py-3 sm:py-4 cursor-pointer text-gray-300 font-semibold text-xs sm:text-sm",onClick:()=>d("overall_point_result"),children:[i.jsx("span",{className:"hidden sm:inline",children:"XP"}),i.jsx("span",{className:"sm:hidden",children:"Points"})," ",f("overall_point_result")]}),i.jsxs("th",{className:"px-3 sm:px-6 py-3 sm:py-4 cursor-pointer text-gray-300 font-semibold text-xs sm:text-sm",onClick:()=>d("referral_xp"),children:[i.jsx("span",{className:"hidden sm:inline",children:"Referral XP"}),i.jsx("span",{className:"sm:hidden",children:"Ref XP"})," ",f("referral_xp")]})]})}),i.jsx("tbody",{children:s.slice((n-1)*r,n*r).map((x,g)=>{const v=(n-1)*r+g,w=v%2===0?"bg-[#1b1b1b]":"bg-[#1f1f1f]",C=x.owner?"bg-[#162720] ring-1 ring-emerald-400/30":"";return i.jsxs("tr",{className:`${w} ${C} group text-white transition-colors hover:bg-[#222222]`,children:[i.jsx("td",{className:"px-3 sm:px-6 py-3 sm:py-4",children:i.jsx("span",{className:"text-sm sm:text-lg font-bold",children:x.ranking||"Unranked"})}),i.jsx("td",{className:"px-3 sm:px-6 py-3 sm:py-4",children:i.jsxs("div",{className:"flex items-center gap-2 text-white",children:[i.jsx("span",{className:"font-mono text-xs sm:text-sm",children:GD(x.out_subscriber_address)}),x.owner&&i.jsx("span",{className:"text-[10px] uppercase tracking-wide text-[#67FFBD] bg-[#132822] border border-emerald-400/40 rounded-full px-2 py-0.5",children:"You"})]})}),i.jsx("td",{className:"px-3 sm:px-6 py-3 sm:py-4",children:i.jsx("span",{className:"text-xs sm:text-sm",children:Er(x.calculated_xp||0)})}),i.jsx("td",{className:"px-3 sm:px-6 py-3 sm:py-4",children:i.jsx("span",{className:"text-xs sm:text-sm",children:Er(x.referral_xp??x.calculated_xp??0)})})]},v)})})]})})},jan=({pnlLeaderboardData:e,userData:t,currentPage:n=1,rowsPerPage:r=25})=>{var x,g,v,w;const[s,a]=m.useState([]),o=localStorage.getItem("hyperAddress"),l=localStorage.getItem("hyperToken"),[c,u]=m.useState({key:null,direction:"asc"});m.useEffect(()=>{a(e)},[e]);const d=C=>{let N="asc";c.key===C&&c.direction==="asc"&&(N="desc");const I=[...s].sort((P,R)=>{const F=parseFloat(P[C])||0,U=parseFloat(R[C])||0;return F<U?N==="asc"?-1:1:F>U?N==="asc"?1:-1:0});a(I),u({key:C,direction:N})},f=C=>c.key!==C?i.jsx(T3,{className:"inline ml-2 text-white"}):c.direction==="asc"?i.jsx(k3,{className:"inline ml-2 text-white"}):i.jsx(_3,{className:"inline ml-2 text-white"});return i.jsx("div",{className:"mx-auto w-full sm:w-4/6 overflow-x-auto shadow-lg mt-[24px] h-[100vh] overflow-auto rounded-xl bg-[#161616]",children:i.jsxs("table",{className:"table-fixed min-w-full text-white border-separate border-spacing-y-2 rounded-xl",children:[i.jsx("thead",{className:"text-left sticky -top-1 z-10",children:i.jsxs("tr",{className:"text-white font-manrope text-[14px] font-semibold leading-[13px] tracking-[0.26px] bg-[#161616]",children:[i.jsxs("th",{className:"px-4 py-3 cursor-pointer flex items-center",onClick:()=>d("ranked"),children:["# ",f("ranked")]}),i.jsx("th",{className:"px-4 py-3",children:"Wallet"}),i.jsxs("th",{className:"flex items-center px-4 py-3",children:[i.jsx("span",{className:"text-[#67FFBD] [text-shadow:0px_0px_8px_rgba(103,255,189,0.48)] font-manrope text-[14px] not-italic font-semibold leading-[32px] tracking-[0.56px]",children:"Booster"}),i.jsx("img",{src:Xbt,alt:"Dextrabot"})]}),i.jsxs("th",{className:"px-4 py-3 cursor-pointer relative",onClick:()=>d("daily_point_result"),children:["Points 24h",f("daily_point_result")]}),i.jsxs("th",{className:"flex justify-end items-center px-4 py-3 cursor-pointer relative",onClick:()=>d("total_pnl"),children:[i.jsx("span",{className:"text-[#D65AFF] [text-shadow:0px_0px_8px_rgba(214,90,255,0.48)] font-manrope text-[14px] not-italic font-semibold leading-[32px] tracking-[0.56px]",children:"Total Points"}),i.jsx("img",{src:Qbt,alt:"Dextrabot"}),f("total_pnl")]})]})}),i.jsxs("tbody",{className:"text-left",children:[o&&l&&t&&Object.keys(t).length>0?i.jsxs("tr",{className:"text-white font-manrope text-[14px] font-bold leading-[13px] tracking-[0.28px] bg-[#2D2D2D]",children:[i.jsx("td",{className:"h-[inherit] rounded-l-2xl p-0",children:i.jsx("div",{className:`min-w-[48px] w-fit px-2 h-12 flex items-center justify-center text-black font-bold text-[18px] first:rounded-tl-2xl first:rounded-bl-2xl ${t.ranked===1?"bg-[#67FFBD]":t.ranked===2?"bg-[#D65AFF]":t.ranked===3?"bg-[#36C9FF]":"bg-[#525252] text-white"}`,children:t.ranked||"Unranked"})}),i.jsx("td",{className:"px-4 py-3 font-semibold",children:i.jsx("div",{className:"flex justify-left items-center gap-2 cursor-pointer",children:i.jsx("span",{className:"w-[75px] text-[#67FFBD]",children:"You"})})}),i.jsx("td",{className:"px-4 py-3 font-bold flex items-center gap-2",children:i.jsxs("div",{className:"flex items-center gap-2 min-h-[24px]",children:[((x=t.mushInfo)==null?void 0:x.eth)>0&&i.jsxs("a",{href:"https://blur.io/eth/collection/mushboomers",target:"_blank",rel:"noopener noreferrer",className:"relative",children:[i.jsx("img",{src:zme,className:"w-[24px] h-[24px] cursor-pointer",alt:"Mushboomers"}),i.jsx("span",{className:"absolute right-[-8px] top-[-8px] bg-[rgba(103,103,103,0.32)] backdrop-blur-[4px] text-white text-xs rounded-full px-1 flex items-center justify-center w-5 h-5 font-semibold font-manrope",children:t.mushInfo.eth})]}),((g=t.mushInfo)==null?void 0:g.sol)>0&&i.jsxs("a",{href:"https://www.tensor.trade/trade/mushboomers",target:"_blank",rel:"noopener noreferrer",className:"relative",children:[i.jsx("img",{src:Hme,className:"w-[24px] h-[24px] cursor-pointer",alt:"Mushboomers"}),i.jsx("span",{className:"absolute right-[-8px] top-[-8px] bg-[rgba(103,103,103,0.32)] backdrop-blur-[4px] text-white text-xs rounded-full px-1 flex items-center justify-center w-5 h-5 font-semibold font-manrope",children:t.mushInfo.sol})]}),((v=t.mushInfo)==null?void 0:v.eth)===0&&((w=t.mushInfo)==null?void 0:w.sol)===0&&i.jsx("div",{className:"w-[24px] h-[24px]"})]})}),i.jsx("td",{className:"px-4 py-3 font-semibold",children:Er(t.daily_point_result)}),i.jsx("td",{className:"px-4 py-3 font-semibold rounded-br-2xl rounded-tr-2xl text-right",children:Er(t.total_pnl)})]}):(o||l)&&(!t||Object.keys(t).length===0)?i.jsxs("tr",{className:"text-white font-manrope text-[14px] font-bold leading-[13px] tracking-[0.28px] bg-[#2D2D2D]",children:[i.jsx("td",{className:"h-[inherit] rounded-l-2xl p-0",children:i.jsx("div",{className:"bg-[#525252] min-w-[48px] w-fit px-2 h-12 flex items-center justify-center text-white font-bold text-[18px] first:rounded-tl-2xl first:rounded-bl-2xl font-manrope",children:"Unranked"})}),i.jsx("td",{className:"px-4 py-3 font-bold text-[#67FFBD]",children:"You"}),i.jsx("td",{className:"px-4 py-3 text-[#FFF] font-semibold",children:"-"}),i.jsx("td",{className:"px-4 py-3 font-bold flex items-center gap-2",children:"-"}),i.jsx("td",{className:"px-4 py-3 font-semibold rounded-br-2xl rounded-tr-2xl text-right",children:"-"})]}):null,s.slice((n-1)*r,n*r).map((C,N)=>{const I=(n-1)*r+N,P=I%2===0?"bg-[#1b1b1b]":"bg-[#1f1f1f]",R=C.owner?"bg-[#162720] ring-1 ring-emerald-400/30":"";return i.jsxs("tr",{className:`text-white h-[50px] font-manrope text-[14px] font-bold leading-[13px] tracking-[0.28px] ${P} ${R} group hover:bg-[#222222]`,children:[i.jsx("td",{className:"h-[inherit] rounded-l-2xl p-0",children:i.jsx("div",{className:`min-w-[48px] w-fit px-2 h-full flex items-center justify-center text-black font-bold text-[18px] first:rounded-tl-2xl first:rounded-bl-2xl ${C.ranked===1?"bg-[#67FFBD]":C.ranked===2?"bg-[#D65AFF]":C.ranked===3?"bg-[#36C9FF]":"bg-[#2D2D2D] text-white"}`,children:C.ranked||"Unranked"})}),i.jsx("td",{className:"px-4 py-3",children:i.jsx("div",{className:"flex justify-left items-center gap-2 cursor-pointer",children:i.jsx("span",{className:"w-[75px]",children:GD(C.subscriber_address)})})}),i.jsx("td",{className:"px-4 py-3 font-bold flex items-center gap-2",children:i.jsxs("div",{className:"flex items-center gap-2 min-h-[24px] pl-1",children:[C.mushInfo.eth>0&&i.jsxs("a",{href:"https://blur.io/eth/collection/mushboomers",target:"_blank",rel:"noopener noreferrer",className:"relative",children:[i.jsx("img",{src:zme,className:"w-[24px] h-[24px] cursor-pointer",alt:"Mushboomers"}),i.jsx("span",{className:"absolute right-[-8px] top-[-8px] bg-[rgba(103,103,103,0.32)] backdrop-blur-[4px] text-white text-xs rounded-full px-1 flex items-center justify-center w-5 h-5 font-semibold font-manrope",children:C.mushInfo.eth})]}),C.mushInfo.sol>0&&i.jsxs("a",{href:"https://www.tensor.trade/trade/mushboomers",target:"_blank",rel:"noopener noreferrer",className:"relative",children:[i.jsx("img",{src:Hme,className:"w-[24px] h-[24px] cursor-pointer",alt:"Mushboomers"}),i.jsx("span",{className:"absolute right-[-8px] top-[-8px] bg-[rgba(103,103,103,0.32)] backdrop-blur-[4px] text-white text-xs rounded-full px-1 flex items-center justify-center w-5 h-5 font-semibold font-manrope",children:C.mushInfo.sol})]}),C.mushInfo.eth===0&&C.mushInfo.sol===0&&i.jsx("div",{className:"w-[24px] h-[24px]"})]})}),i.jsx("td",{className:"px-4 py-3 font-semibold",children:Er(C.daily_point_result)}),i.jsx("td",{className:"px-4 py-3 font-semibold last:rounded-tr-xl last:rounded-br-xl text-right",children:Er(C.total_pnl)})]},I)})]})]})})},Ean="/assets/bg_-D6bvhHQD.png",_an=({className:e="w-4 h-4"})=>i.jsxs("svg",{className:e,viewBox:"0 0 9 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("g",{clipPath:"url(#paint0_angular_3845_132_clip_path)",children:i.jsx("g",{transform:"matrix(0 0.008 -0.0045 0 4.35268 6.96028)",children:i.jsx("foreignObject",{x:"-1189.48",y:"-1189.48",width:"2378.97",height:"2378.97",children:i.jsx("div",{xmlns:"http://www.w3.org/1999/xhtml",className:"h-full w-full opacity-100",style:{background:"conic-gradient(from 90deg,rgba(230, 159, 29, 1) 0deg,rgba(255, 225, 0, 1) 360deg)"}})})})}),i.jsx("path",{d:"M3.48108 0.509775C3.86338 -0.169925 4.84198 -0.169925 5.22428 0.509775L8.57688 6.46998C8.74818 6.77448 8.74818 7.14607 8.57688 7.45057L5.22428 13.4108C4.84198 14.0905 3.86338 14.0905 3.48108 13.4108L0.128475 7.45057C-0.042825 7.14607 -0.042825 6.77448 0.128475 6.46998L3.48108 0.509775Z",fill:"url(#gradient)"}),i.jsx("defs",{children:i.jsx("clipPath",{id:"paint0_angular_3845_132_clip_path",children:i.jsx("path",{d:"M3.48108 0.509775C3.86338 -0.169925 4.84198 -0.169925 5.22428 0.509775L8.57688 6.46998C8.74818 6.77448 8.74818 7.14607 8.57688 7.45057L5.22428 13.4108C4.84198 14.0905 3.86338 14.0905 3.48108 13.4108L0.128475 7.45057C-0.042825 7.14607 -0.042825 6.77448 0.128475 6.46998L3.48108 0.509775Z"})})})]}),kan=({className:e="w-4 h-4"})=>i.jsxs("svg",{className:e,viewBox:"0 0 9 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("g",{clipPath:"url(#paint0_angular_3845_127_clip_path)",children:i.jsx("g",{transform:"matrix(0 0.008 -0.0045 0 4.35268 6.96028)",children:i.jsx("foreignObject",{x:"-1189.48",y:"-1189.48",width:"2378.97",height:"2378.97",children:i.jsx("div",{xmlns:"http://www.w3.org/1999/xhtml",className:"h-full w-full opacity-100",style:{background:"conic-gradient(from 90deg,rgba(255, 255, 255, 1) 0deg,rgba(214, 214, 214, 1) 360deg)"}})})})}),i.jsx("path",{d:"M3.48108 0.509775C3.86338 -0.169925 4.84198 -0.169925 5.22428 0.509775L8.57688 6.46998C8.74818 6.77448 8.74818 7.14607 8.57688 7.45057L5.22428 13.4108C4.84198 14.0905 3.86338 14.0905 3.48108 13.4108L0.128475 7.45057C-0.042825 7.14607 -0.042825 6.77448 0.128475 6.46998L3.48108 0.509775Z",fill:"url(#gradient)"}),i.jsx("defs",{children:i.jsx("clipPath",{id:"paint0_angular_3845_127_clip_path",children:i.jsx("path",{d:"M3.48108 0.509775C3.86338 -0.169925 4.84198 -0.169925 5.22428 0.509775L8.57688 6.46998C8.74818 6.77448 8.74818 7.14607 8.57688 7.45057L5.22428 13.4108C4.84198 14.0905 3.86338 14.0905 3.48108 13.4108L0.128475 7.45057C-0.042825 7.14607 -0.042825 6.77448 0.128475 6.46998L3.48108 0.509775Z"})})})]}),Tan=()=>{const[e,t]=m.useState([]),[n,r]=m.useState([]),[s,a]=m.useState(null),[o,l]=m.useState(null),[c,u]=m.useState("volume"),[d,f]=m.useState(!1),[x,g]=m.useState(!1),[v,w]=m.useState(!1),[C,N]=m.useState(1),I=25,P=m.useRef(null),R=m.useRef(null),{isConnected:F,address:U}=Yr(),{openConnectModal:L}=m5(),{walletLogin:z,signIn:X,hyperToken:ne,hyperAddress:J,setSignInConnectButtonOpen:Z,isReferralCodeName:re}=m.useContext(Gr),he=()=>{F?window.localStorage.getItem("hyperToken")&&ne?z():X(1):(L(),Z(!0))},Y=re||window.localStorage.getItem("refcode")||"",ie=Y?`https://app.dextrabot.com/referral/${Y}`:"",oe=()=>{if(!J||!ne){he();return}f(!0)},G=()=>{if(!J||!ne){he();return}g(!0)},V=ct=>{ct&&(navigator.clipboard.writeText(ct),on.success("Copied to clipboard"))},ee=async()=>{var ct;if(P.current)try{(ct=document==null?void 0:document.fonts)!=null&&ct.ready&&await document.fonts.ready;const Ut=await j1(P.current,{cacheBust:!0,backgroundColor:"#040707",pixelRatio:2}),kt=document.createElement("a");kt.href=Ut,kt.download="dextrabot-leaderboard-rank.png",document.body.appendChild(kt),kt.click(),document.body.removeChild(kt),on.success("Image downloaded")}catch(Ut){console.error("Share card download error",Ut),on.error("Failed to download image")}};m.useCallback(()=>{ls.get("https://dextrabothypev2.nftinit.io/api/subscriber/leaderboard/").then(Ut=>{const kt=(Ut.data.data||[]).map(tn=>({ranking:tn.rank_position,out_subscriber_address:tn.address,overall_pos_value:tn.total_volume,calculated_xp:tn.total_xp,overall_point_result:tn.total_xp,referral_xp:tn.ref_bf_xp,refCode:tn.refCode??null,daily_pos_value:null,generated_wallets:[],owner:!!tn.owner}));t(kt)}).catch(Ut=>{console.error("Error fetching volume data:",Ut)})},[]),m.useEffect(()=>{const ct="https://dextrabothypev2.nftinit.io/api/subscriber/leaderboard/",Ut=kt=>(kt||[]).map(tn=>({ranking:tn.rank_position,out_subscriber_address:tn.address,overall_pos_value:tn.total_volume,calculated_xp:tn.total_xp,overall_point_result:tn.total_xp,referral_xp:tn.ref_bf_xp,refCode:tn.refCode??null,daily_pos_value:null,generated_wallets:[],owner:!!tn.owner}));ls.get(ct).then(kt=>{const tn=Ut(kt.data.data);t(tn),r(tn)}).catch(kt=>{console.error("Error fetching leaderboard data:",kt),t([]),r([])})},[]);const ae=m.useCallback(()=>{R.current&&R.current.abort();const ct=J||typeof window<"u"&&window.localStorage.getItem("hyperAddress"),Ut=ne||typeof window<"u"&&window.localStorage.getItem("hyperToken");if(ct&&Ut){w(!0);const kt="https://dextrabothypev2.nftinit.io/api/subscriber/leaderboard/",tn=new AbortController;R.current=tn,ls.post(kt,{address:ct,token:Ut},{headers:{"Content-Type":"application/json"},signal:tn.signal}).then(jt=>{if(!tn.signal.aborted){if(jt.data.ownerRank)a(jt.data.ownerRank);else if(jt.data.data){const un=jt.data.data.find(cn=>{var Pt;return((Pt=cn.address)==null?void 0:Pt.toLowerCase())===(ct==null?void 0:ct.toLowerCase())});a(un?{ranking:un.rank_position,rank_position:un.rank_position,overall_pos_value:un.total_volume,total_volume:un.total_volume,calculated_xp:un.total_xp,total_xp:un.total_xp,overall_point_result:un.total_xp,referral_xp:un.ref_bf_xp,refCode:un.refCode}:null)}else a(null);w(!1)}}).catch(jt=>{jt.name!=="CanceledError"&&!tn.signal.aborted&&(console.error("API Error (Volume):",jt),w(!1))})}else a(null),w(!1)},[J,ne]),fe=m.useCallback(()=>{const ct=J||typeof window<"u"&&window.localStorage.getItem("hyperAddress"),Ut=ne||typeof window<"u"&&window.localStorage.getItem("hyperToken");ct&&Ut?ls.post("https://dextrabothypev2.nftinit.io/api/subscriber/leaderboard/",{address:ct,token:Ut},{headers:{"Content-Type":"application/json"}}).then(kt=>{if(kt.data.ownerRanks)l(kt.data.ownerRanks[0]);else if(kt.data.ownerRank)l(kt.data.ownerRank);else if(kt.data.data){const tn=kt.data.data.find(jt=>{var un;return((un=jt.address)==null?void 0:un.toLowerCase())===(ct==null?void 0:ct.toLowerCase())});l(tn?{ranked:tn.rank_position,rank_position:tn.rank_position,subscriber_address:tn.address,total_pnl:tn.total_xp,daily_point_result:tn.daily_point_result||0,mushInfo:tn.mushInfo||{eth:0,sol:0}}:null)}else l(null)}).catch(kt=>console.error("API Error (PnL):",kt)):l(null)},[J,ne]);m.useEffect(()=>{ae(),c==="pnl"&&fe();const ct=()=>{ae(),c==="pnl"&&fe()};return window.addEventListener("localStorageUpdated",ct),()=>{window.removeEventListener("localStorageUpdated",ct),R.current&&R.current.abort()}},[J,ne,c,ae,fe]);const Ae=m.useMemo(()=>c==="volume"?s:o,[c,s,o]),ce=m.useMemo(()=>(Ae==null?void 0:Ae.ranking)??"--",[Ae==null?void 0:Ae.ranking]),ye=m.useMemo(()=>(Ae==null?void 0:Ae.overall_pos_value)??(Ae==null?void 0:Ae.total_volume)??0,[Ae==null?void 0:Ae.overall_pos_value,Ae==null?void 0:Ae.total_volume]),Ne=m.useMemo(()=>(Ae==null?void 0:Ae.calculated_xp)??(Ae==null?void 0:Ae.total_xp)??0,[Ae==null?void 0:Ae.calculated_xp,Ae==null?void 0:Ae.total_xp]),be=m.useMemo(()=>s?s.overall_point_result??s.total_xp??s.calculated_xp??(s.calculated_xp||0)+(s.referral_xp||0):0,[s]),je=m.useMemo(()=>s?s.overall_pos_value??s.total_volume??0:0,[s]),Ie=m.useMemo(()=>s?s.rank_position??s.ranking??"Unranked":"Unranked",[s]),Re=m.useMemo(()=>c==="volume"?e:n,[c,e,n]),Qe=m.useMemo(()=>Math.ceil(Re.length/I),[Re.length,I]),Be=Re.length;m.useEffect(()=>{N(1)},[c]);const it=m.useCallback(ct=>{ct>=1&&ct<=Qe&&(N(ct),window.scrollTo({top:0,behavior:"smooth"}))},[Qe]),tt=Ae?`Here’s my @Dextrabot rank #${ce}. Volume (All Time): $${Er(ye)} · XP: ${Er(Ne)}. Farming points and stacking profit at the same time.`:"Here’s my @Dextrabot rank. Farming points and stacking profit at the same time.",at=ie||"https://app.dextrabot.com/leaderboard",dt=`https://x.com/intent/post?text=${encodeURIComponent(tt)}&url=${encodeURIComponent(at)}`;return i.jsxs(i.Fragment,{children:[i.jsx(Io,{children:i.jsxs($o,{children:[i.jsx("meta",{name:"description",content:"See the top traders on DextraBot ranked by trading volume. Track the best-performing users and find inspiration for your next trade."}),i.jsx("meta",{name:"og:title",content:"Top Traders Leaderboard – Track the Best Performers on DextraBot"}),i.jsx("meta",{name:"og:description",content:"See the top traders on DextraBot ranked by trading volume. Track the best-performing users and find inspiration for your next trade."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/leaderboard"})]})}),i.jsxs("div",{className:"min-h-screen bg-black relative overflow-hidden",children:[i.jsx("div",{className:"absolute top-0 right-0 w-[1200px] h-full pointer-events-none hidden lg:block bg-contain bg-right-top bg-no-repeat z-[1]",style:{backgroundImage:`url(${Ean})`}}),i.jsxs("div",{className:"relative z-10 max-w-7xl mx-auto px-4 sm:px-6 py-8 sm:py-16",children:[i.jsx("div",{className:"mb-6 sm:mb-10 pl-0 pr-4 sm:pr-16 py-6 sm:py-12 leaderboard-card rounded-2xl",children:i.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-6 lg:gap-12",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-6 sm:gap-8 lg:gap-32",children:[i.jsx("div",{className:"flex-shrink-0",children:J&&ne?i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("span",{className:"text-white text-xs sm:text-sm",children:"Connected"}),i.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"})]}),i.jsx("div",{className:"text-white font-mono text-sm sm:text-lg font-bold",children:GD(J)})]}):i.jsx("button",{onClick:he,className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-2xl font-semibold transition-colors text-sm h-10 w-full sm:w-auto",children:"Connect Wallet"})}),i.jsxs("div",{className:"grid grid-cols-3 sm:flex sm:items-center gap-4 sm:gap-8 lg:gap-32",children:[i.jsxs("div",{className:"flex-shrink-0",children:[i.jsx("div",{className:"text-gray-400 text-xs sm:text-sm mb-1",children:"XP"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-white font-bold text-sm sm:text-lg",children:v&&J&&ne?"...":J&&ne&&s?Er(be):"0"}),i.jsx(_an,{className:"w-4 h-4 sm:w-5 sm:h-5"})]})]}),i.jsxs("div",{className:"flex-shrink-0",children:[i.jsx("div",{className:"text-gray-400 text-xs sm:text-sm mb-1",children:"Volume"}),i.jsxs("div",{className:"text-white font-bold text-sm sm:text-lg",children:["$",v&&J&&ne?"...":J&&ne&&s?Er(je):"0"]})]}),i.jsxs("div",{className:"flex-shrink-0",children:[i.jsx("div",{className:"text-gray-400 text-xs sm:text-sm mb-1",children:"#"}),i.jsx("div",{className:"text-white font-bold text-sm sm:text-lg",children:v&&J&&ne?"...":J&&ne&&s?Ie:"Unranked"})]})]})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-4 sm:gap-6",children:[i.jsxs("button",{onClick:G,className:"flex items-center justify-center gap-2 bg-white hover:bg-gray-100 text-black px-3 py-2 rounded-2xl font-semibold transition-colors text-sm border border-gray-300 h-10 w-full sm:w-auto whitespace-nowrap",children:[i.jsx("span",{className:"text-black",children:"𝕏"}),i.jsx("span",{className:"hidden sm:inline",children:"Share your rank"}),i.jsx("span",{className:"sm:hidden",children:"Share"}),i.jsxs("span",{className:"bg-black text-white text-xs px-2 py-1 rounded-lg flex items-center gap-1",children:[i.jsx("span",{children:"200"}),i.jsx(kan,{className:"w-3 h-3"})]})]}),i.jsx("button",{onClick:oe,className:"flex items-center justify-center text-black px-4 py-2 rounded-2xl font-semibold transition-colors text-sm h-10 w-full sm:w-20 bg-[#1DE674]",children:"Invite"})]})]})}),i.jsxs("div",{className:"mb-8 sm:mb-12",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 sm:gap-6 mt-12 sm:mt-16 mb-0",children:[i.jsx("h2",{className:"text-2xl sm:text-3xl lg:text-4xl font-bold text-white",children:"Leaderboard"}),Re.length>0&&i.jsxs("div",{className:"flex flex-col sm:flex-row items-end sm:items-center gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2 text-[12px] font-semibold",children:[i.jsx(vi,{className:"text-white hidden sm:block"}),i.jsx("span",{className:"text-white",children:Be}),i.jsx("span",{className:"text-white",children:"wallets found"})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("button",{onClick:()=>it(C-1),disabled:C===1,className:`${C===1?"cursor-not-allowed text-white/30":"text-white hover:bg-white/40"} relative inline-flex items-center justify-center p-1.5 rounded-md bg-[#3d3d3d] w-7 h-7`,children:i.jsx(zh,{className:`w-3 h-3 rotate-90 ${C===1?"text-white/30":"text-white"}`})}),i.jsxs("div",{className:"px-3 py-1 rounded-md bg-[#3d3d3d]/60 text-sm font-medium text-white min-w-max h-7 flex items-center",children:[C," / ",Math.max(Qe,1)]}),i.jsx("button",{onClick:()=>it(C+1),disabled:C===Qe||Qe===0,className:`${C===Qe||Qe===0?"cursor-not-allowed text-white/30":"text-white hover:bg-white/40"} relative inline-flex items-center justify-center p-1.5 rounded-md bg-[#3d3d3d] w-7 h-7`,children:i.jsx(zh,{className:`w-3 h-3 -rotate-90 ${C===Qe||Qe===0?"text-white/30":"text-white"}`})})]})]})]}),i.jsx("div",{className:"leaderboard-card rounded-2xl overflow-hidden mt-4 sm:mt-6",children:c==="volume"?i.jsx(Aan,{volumeLeaderboardData:e,userData:s,currentPage:C,rowsPerPage:I}):c==="pnl"?i.jsx(jan,{pnlLeaderboardData:n,userData:o,currentPage:C,rowsPerPage:I}):i.jsx(i.Fragment,{})})]})]})]}),i.jsx(rp,{isOpen:d,onClose:()=>f(!1),blurBackground:!0,children:i.jsxs("div",{className:"w-[320px] sm:w-[420px] bg-[#1c1c1c] rounded-3xl p-6 text-white",children:[i.jsxs("div",{className:"mb-6",children:[i.jsx("p",{className:"text-sm uppercase tracking-widest text-green-300/80 mb-2",children:"Invite friends"}),i.jsx("h3",{className:"text-2xl font-semibold mb-2",children:"Share your referral"}),i.jsx("p",{className:"text-sm text-white/70",children:"You can send your code or unique link."})]}),Y?i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"bg-[#262626] rounded-2xl p-4 flex items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-white/60 mb-1",children:"Your Referral Code"}),i.jsx("p",{className:"text-lg font-semibold",children:Y})]}),i.jsx("button",{className:"p-2 rounded-xl border border-white/10 transition hover:bg-white/10",onClick:()=>V(Y),children:i.jsx("img",{src:fM,alt:"Copy referral code",className:"w-4 h-4"})})]}),i.jsxs("div",{className:"bg-[#262626] rounded-2xl p-4 flex items-center justify-between gap-4",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:"text-xs text-white/60 mb-1",children:"Your Referral URL"}),i.jsx("p",{className:"text-sm text-green-300 truncate",children:ie})]}),i.jsx("button",{className:"p-2 rounded-xl border border-white/10 transition hover:bg-white/10",onClick:()=>V(ie),children:i.jsx("img",{src:fM,alt:"Copy referral url",className:"w-4 h-4"})})]})]}):null,!Y&&i.jsxs("div",{className:"text-xs text-white/50 mt-4",children:["You can create your referral code on the"," ",i.jsx("a",{href:"/referral",className:"text-green-300 hover:text-green-200 underline",children:"Referral page"}),"."]})]})}),i.jsx(rp,{isOpen:x,onClose:()=>g(!1),blurBackground:!0,children:i.jsxs("div",{className:"w-[340px] sm:w-[460px] bg-[#101010] rounded-3xl p-6 text-white",children:[i.jsxs("div",{ref:P,className:"bg-gradient-to-b from-[#0c1414] via-[#040707] to-[#040505] rounded-[32px] border border-emerald-500/10 p-5 shadow-[0_0_60px_rgba(0,255,200,0.08)]",children:[i.jsxs("div",{className:"flex items-center justify-between mb-5",children:[i.jsx("div",{children:i.jsx("p",{className:"text-sm uppercase tracking-[0.3em] text-white/70",children:"Leaderboard"})}),i.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 rounded-full bg-white/5 border border-white/10",children:[i.jsx("img",{src:i5,alt:"Dextrabot",className:"w-5 h-5 rounded-full"}),i.jsx("span",{className:"text-xs font-semibold tracking-wide",children:"DEXTRABOT"})]})]}),i.jsxs("div",{className:"mt-5 bg-[#05090a] rounded-3xl p-5 text-center border border-white/5",children:[i.jsx("p",{className:"text-xs uppercase tracking-[0.4em] text-white/50",children:"Rank"}),i.jsx("p",{className:"text-4xl font-bold text-[#67FFBD] mt-2",children:(Ae==null?void 0:Ae.ranking)??"--"}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 mt-6 text-left",children:[i.jsxs("div",{className:"bg-white/3 rounded-2xl p-3 border border-white/5",children:[i.jsx("p",{className:"text-[11px] uppercase tracking-wide text-white/50",children:"Volume (All Time)"}),i.jsxs("p",{className:"text-lg font-semibold text-white mt-1",children:["$",Er((Ae==null?void 0:Ae.overall_pos_value)??(Ae==null?void 0:Ae.total_volume)??0)]})]}),i.jsxs("div",{className:"bg-white/3 rounded-2xl p-3 border border-white/5",children:[i.jsx("p",{className:"text-[11px] uppercase tracking-wide text-white/50",children:"XP"}),i.jsx("p",{className:"text-lg font-semibold text-white mt-1",children:Er((Ae==null?void 0:Ae.calculated_xp)??(Ae==null?void 0:Ae.total_xp)??0)})]})]})]}),i.jsxs("div",{className:"mt-4 flex items-center justify-between text-[11px] text-white/50",children:[i.jsx("span",{children:"Generated by Dextrabot"}),i.jsx("span",{children:new Date().toLocaleDateString("en-US",{month:"short",day:"numeric"})})]})]}),!Ae&&i.jsx("p",{className:"text-xs text-white/60 mt-4",children:"Connect your wallet and climb the leaderboard to unlock personalized stats."}),i.jsxs("div",{className:"mt-6 space-y-3",children:[i.jsx("button",{onClick:ee,className:"w-full border border-emerald-400/60 rounded-2xl py-3 text-emerald-300 font-semibold hover:bg-emerald-400/10 transition disabled:opacity-40 disabled:cursor-not-allowed",disabled:!Ae,children:"Download image"}),i.jsx("a",{href:dt,target:"_blank",rel:"noopener noreferrer",className:"w-full block text-center bg-white text-black font-semibold rounded-2xl py-3 hover:bg-gray-100 transition",children:"Share on X"})]})]})})]})};function Ian({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"}))}const Pan=m.forwardRef(Ian);function Fan({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const Oan=m.forwardRef(Fan);function Man({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"}))}const Ran=m.forwardRef(Man);function Lan({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))}const XY=m.forwardRef(Lan);function Dan({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}const Ban=m.forwardRef(Dan);function $an({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}const Uan=m.forwardRef($an);function zan({title:e,titleId:t,...n},r){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?m.createElement("title",{id:t},e):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const XUe=m.forwardRef(zan),_Ce=[{name:"Blog",key:"blog",href:"https://blog.dextrabot.com/"},{name:"Features",key:"features",href:"/#features"},{name:"How it works?",key:"howItWorks",href:"/#howitworks"},{name:"FAQ",key:"faq",href:"/#faq"},{name:"Launch",key:"launchApp",href:"/hyperliquid-fee-calculator"}];function Han(...e){return e.filter(Boolean).join(" ")}const zce=({scrollToFeatures:e,scrollToHowItWorks:t,scrollToFAQ:n})=>i.jsxs(l8e,{as:"nav",className:"bg-transparent lg:pt-[24px]",children:[i.jsx("div",{className:"mx-auto max-w-7xl px-2 sm:px-0",children:i.jsxs("div",{className:"relative flex h-16 items-center justify-between",children:[i.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pr-2 sm:static sm:inset-auto sm:ml-1 sm:pr-0",children:i.jsx(OD,{as:"div",className:"relative ml-1",children:i.jsxs("div",{onClick:()=>{window.location.href="/"},className:"flex justify-start items-center gap-4 cursor-pointer",children:[i.jsx("img",{src:hyt,alt:"Dextrabot",className:"w-12 h-12"}),i.jsx("div",{className:"justify-start text-white text-2xl font-semibold font-['Manrope'] leading-[21px]",children:"Dextrabot"})]})})}),i.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center sm:hidden",children:i.jsxs(Zre,{className:"group relative inline-flex items-center justify-center rounded-md p-2 text-gray-400 bg-[#1e1e1e] hover:bg-[#353535] hover:text-white focus:outline-none focus:ring-0 border-none",children:[i.jsx("span",{className:"absolute -inset-0.5"}),i.jsx("span",{className:"sr-only",children:"Open main menu"}),i.jsx(Pan,{"aria-hidden":"true",className:"block size-6 group-data-[open]:hidden"}),i.jsx(XUe,{"aria-hidden":"true",className:"hidden size-6 group-data-[open]:block"})]})}),i.jsx("div",{className:"flex flex-1 items-center justify-center sm:items-stretch sm:justify-end",children:i.jsx("div",{className:"hidden sm:ml-6 sm:block mr-2",children:i.jsx("div",{className:"flex items-center space-x-6",children:_Ce.map(r=>i.jsx("a",{href:r.href||"#",onClick:s=>{r.href||s.preventDefault(),r.key==="features"&&(e==null||e()),r.key==="howItWorks"&&(t==null||t()),r.key==="faq"&&(n==null||n())},className:Han(r.current?"bg-transparent text-white":`${r.name==="Launch"?"text-[#121213] hover:text-[#121213] hover:scale-105 transition-transform duration-300":"text-white/50 hover:text-white"}`,"",r.name==="Launch"?"w-24 h-10 px-12 py-3 bg-white rounded-[256px] inline-flex justify-center items-center gap-2.5 text-[#121213] text-sm font-semibold font-manrope leading-8":"rounded-md text-sm font-semibold font-manrope leading-8 h-8"),children:r.name},r.name))})})})]})}),i.jsx(Jre,{className:"sm:hidden",children:i.jsx("div",{className:"space-y-1 px-2 pb-3 pt-2",children:_Ce.map(r=>r.key==="launchApp"?i.jsx("a",{href:r.href,className:"block rounded-md px-3 py-2 text-base font-medium text-white hover:text-white bg-[#1a1a1a] hover:bg-[#353535]",children:r.name},r.name):i.jsx("button",{onClick:async()=>{r.key==="features"&&(e==null||e()),r.key==="howItWorks"&&(t==null||t()),r.key==="faq"&&(n==null||n())},className:"w-full text-left block rounded-md px-3 py-2 text-base font-medium text-white/50 bg-transparent hover:bg-[#353535] hover:text-white focus:outline-none focus:ring-0 border-none",children:r.name},r.name))})})]}),Van=()=>{const[e,t]=m.useState("");return i.jsx("section",{className:"px-1 py-5 sm:py-[64px] text-center",children:i.jsx("div",{className:"max-w-7xl mx-auto",children:i.jsx("div",{className:"flex flex-col items-center gap-[88px]",children:i.jsxs("div",{className:"flex flex-col lg:flex-row items-center lg:items-start gap-6",children:[i.jsx("div",{className:"w-full lg:flex-[0.45] flex justify-center lg:justify-start",children:i.jsx("div",{className:"bg-transparent p-1 rounded-xl h-full",children:i.jsxs("div",{className:"flex flex-col items-start gap-4",children:[i.jsx("h1",{className:"max-w-[553px] w-full lg:w-[553px] justify-start text-white text-[36px] sm:text-[56px] font-semibold font-['Manrope'] leading-[42px] sm:leading-[64px] text-left",children:"Dextrabot - Find and Copy Trade Top Hyperliquid Wallets"}),i.jsx("div",{className:"max-w-[512px] justify-start text-[#aaaaaa] text-base font-medium font-['Manrope'] leading-[21px] tracking-tight text-left",children:"Discover profitable traders, analyze their performance, and automatically copy their strategies with customizable risk settings."}),i.jsxs("div",{className:"flex flex-col sm:flex-row justify-start items-center gap-4 sm:gap-6 pt-[22px] w-full",children:[i.jsx("div",{onClick:()=>{window.location.href="/discover-wallets"},className:"w-full sm:w-auto sm:before:max-w-[200px] h-12 px-2 sm:px-6 py-1 sm:py-3 bg-[#67ffbd] rounded-[256px] flex justify-center items-center cursor-pointer hover:scale-105 transition-transform duration-300",children:i.jsx("span",{className:"text-[#103324] text-lg font-semibold font-['Manrope'] leading-6 min-w-max",children:"Start Copy Trade"})}),i.jsx("div",{onClick:()=>{window.location.href="/discover-wallets"},className:"w-full sm:w-auto sm:max-w-[200px] h-12 px-2 sm:px-6 py-1 sm:py-3 bg-[#1e1e1e] rounded-[256px] flex justify-center items-center cursor-pointer hover:scale-105 transition-transform duration-300",children:i.jsx("span",{className:"text-white text-lg font-semibold font-['Manrope'] leading-6 min-w-max ",children:"Discover Wallets"})})]}),i.jsx("div",{className:"w-full",children:i.jsxs("div",{className:"w-full sm:w-[424px] h-12 px-4 py-3 bg-[#1e1e1e] rounded-[256px] flex items-center gap-2.5 relative mt-2",children:[i.jsx(Ny,{className:"text-white"}),i.jsx("input",{type:"text",value:e,onChange:n=>t(n.target.value),placeholder:"Track and Analyze Wallet",className:"flex bg-transparent outline-none border-none text-[#cfcfcf] placeholder-[#636363] text-lg font-normal font-['Manrope'] leading-[21px] pr-10 w-full sm:w-[424px]"}),i.jsx("div",{onClick:n=>{if(n.preventDefault(),!e)on.error("Please enter a wallet address");else if(e.match(/^0x[a-fA-F0-9]{40}$/))window.open(`/wallet-details/${e}`,"_blank"),setTimeout(()=>{t("")},200);else{on.error("Please enter a valid Ethereum address");return}},className:"w-10 h-10 bg-[#67ffbd]/20 rounded-[256px] inline-flex justify-center items-center absolute right-1 hover:scale-105 transition-transform duration-300 cursor-pointer",children:i.jsx("img",{src:fyt,alt:"search",className:"w-6 h-6 min-w-6 min-h-6"})})]})})]})})}),i.jsx("div",{className:"w-full lg:flex-[0.55]",children:i.jsx("div",{className:"bg-transparent rounded-xl shadow-lg h-full",children:i.jsx("div",{className:"w-full",children:i.jsx("img",{src:ryt,alt:"Copy trade Hyperliquid wallets with Dextrabot platform and customizable risk settings",className:"w-full h-auto max-w-[728px] mx-auto"})})})})]})})})})},Wan=()=>i.jsx("section",{className:"py-16 bg-transparent",children:i.jsxs("div",{className:"max-w-7xl mx-auto",children:[i.jsx("h2",{className:"text-center justify-start text-white text-[40px] font-semibold font-['Manrope'] leading-[48px] mb-10",children:"Dextrabot Features"}),i.jsxs("div",{className:"flex flex-wrap xl:flex-nowrap justify-center gap-4",children:[i.jsxs("div",{className:"flex flex-col gap-4",children:[i.jsxs("div",{className:"flex flex-wrap md:flex-nowrap justify-center md:justify-start gap-4",children:[i.jsx(K7,{title:"Copy Trade",description:"Automatically copy trade perpetual positions with customizable risk parameters",altInfo:"Automated copy trading perpetual positions on Hyperliquid with customizable risk parameters",icon:syt,cssInfo:"w-[348px] h-[348px]",imgCss:"absolute bottom-0 left-0"}),i.jsx(K7,{title:"Discover Wallets",description:"Find overlooked high-performers on Hyperliquid with advanced filtering",altInfo:"Find high-performing wallets on Hyperliquid with advanced filtering and wallet discovery",icon:ayt,cssInfo:"w-[348px] h-[348px]",imgCss:"absolute -bottom-2"})]}),i.jsxs("div",{className:"flex flex-wrap md:flex-nowrap justify-center md:justify-start gap-4",children:[i.jsx(K7,{title:"Real-Time Alerts",description:"Get instant Telegram notifications for all trading activities",altInfo:"Real-time Telegram notifications for all Hyperliquid trading activities and copy trades",icon:oyt,cssInfo:"w-[348px] h-[348px]",imgCss:"absolute bottom-[20px] w-[294px] h-[204px]"}),i.jsx(K7,{title:"Referrals",description:"Earn up to 65% reward through our multi-level program",altInfo:"Earn up to 65% rewards through Dextrabot's multi-level referral program for crypto traders",icon:iyt,cssInfo:"w-[348px] h-[348px]",imgCss:"absolute bottom-0 -left-1"})]})]}),i.jsx(K7,{title:"Analyze Wallet",description:"Track performance metrics, open positions, and trading patterns",icon:lyt,altInfo:"Track performance metrics, open positions, and trading patterns of top Hyperliquid wallets",cssInfo:"max-w-full md:w-[720px] xl:w-[552px] h-[500px] md:h-[916px] xl:h-[716px] bg-[#161616] rounded-3xl p-6 text-white flex-shrink-0 relative overflow-hidden hover:scale-105 transition-transform duration-300",imgCss:"absolute bottom-0 left-6"})]})]})}),K7=({title:e,description:t,altInfo:n,icon:r,cssInfo:s,imgCss:a})=>i.jsxs("div",{className:`${s} bg-[#161616] rounded-3xl p-6 text-white relative overflow-hidden hover:scale-105 transition-transform duration-300`,children:[i.jsx("div",{className:"text-start justify-start text-white text-[21px] font-semibold font-['Manrope'] leading-normal mb-1",children:e}),i.jsx("div",{className:"w-[290px] justify-start text-[#979797] text-sm font-medium font-['Manrope'] leading-[21px]",children:t}),i.jsx("img",{src:r,alt:n,className:a})]}),qan=()=>i.jsx("section",{className:"py-16 bg-transparent",children:i.jsxs("div",{className:"max-w-7xl mx-auto",children:[i.jsx("h2",{className:"text-center justify-start text-white text-[40px] font-semibold font-['Manrope'] leading-[48px] mb-10",children:"Three Simple Steps to Start Copy Trade"}),i.jsxs("div",{className:"flex flex-wrap xl:flex-nowrap justify-center gap-4",children:[i.jsx(QY,{title:"Discover",description:"Find profitable wallets using our advanced filters",icon:cyt,altInfo:"Discover profitable Hyperliquid wallets using Dextrabot's advanced filtering system"}),i.jsx(QY,{title:"Analyze",description:"Examine detailed metrics and trading patterns",icon:uyt,altInfo:"Examine detailed PnL metrics and win rate statistics for Hyperliquid trading strategies"}),i.jsx(QY,{title:"Copy Trade",description:"Set your risk parameters and start automating",icon:dyt,altInfo:"Set custom take profit and stop loss parameters for automated copy trading on Hyperliquid"})]})]})}),QY=({title:e,description:t,altInfo:n,icon:r,imgCss:s})=>i.jsxs("div",{className:"w-[348px] xl:w-[416px] h-[348px] bg-[#161616] rounded-3xl p-6 text-white relative overflow-hidden hover:scale-105 transition-transform duration-300",children:[i.jsx("div",{className:"text-start justify-start text-white text-[21px] font-semibold font-['Manrope'] leading-normal mb-1",children:e}),i.jsx("div",{className:"w-[290px] justify-start text-[#979797] text-sm font-medium font-['Manrope'] leading-[21px]",children:t}),i.jsx("img",{src:r,alt:n,className:"absolute bottom-[12px] left-1/2 transform -translate-x-1/2 w-[314px] xl:w-[382px]"})]}),kCe=({className:e})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:e,children:i.jsx("path",{d:"M16.6004 7.45831L11.1671 12.8916C10.5254 13.5333 9.47539 13.5333 8.83372 12.8916L3.40039 7.45831",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})}),Gan=()=>{const e=[{question:"How does copy trade work on Dextrabot?",answer:"Dextrabot monitors wallet activity and automatically executes the same perpetual positions in your account based on your risk settings."},{question:"What fees does Dextrabot charge?",answer:"Dextrabot charges 0.055% on trade size for copy trade transactions. Use a referral code for a 4% discount."},{question:"How do I set up Telegram notifications?",answer:"Connect your Telegram account through the Tracker page to receive instant alerts about wallet activities and copy trades."},{question:"What risk management options are available?",answer:"Dextrabot offers customizable stop-loss and take-profit levels, position size limits, and margin increase controls for comprehensive risk management."},{question:" How does the referral program work?",answer:"You can earn up to 65% reward on the fees generated by traders you refer to Dextrabot, with multi-tier commissions coming soon."},{question:"Can I copy multiple wallets simultaneously?",answer:"Yes, you can copy trade multiple wallets at once, each with their own customized risk parameters and position sizing."}];return i.jsx("section",{className:"py-16 bg-transparent",children:i.jsxs("div",{className:"max-w-7xl mx-auto",children:[i.jsx("div",{className:"text-center justify-start text-white text-[40px] font-semibold font-['Manrope'] leading-[48px] mb-[18px]",children:"FAQ"}),i.jsx("h2",{className:"w-full text-center justify-center text-white/60 text-lg font-semibold font-['Manrope'] leading-normal",children:"Frequently Asked Questions"}),i.jsx("dl",{className:"mt-[41px] divide-y divide-gray-900/10 border-none outline-none w-full lg:w-[777px] mx-auto",children:e.map(t=>i.jsx(l8e,{as:"div",className:"my-4 first:pt-0 last:pb-0 rounded-2xl bg-[#161616]",children:i.jsxs("dt",{children:[i.jsxs(Zre,{className:"group flex w-full items-start justify-start text-left text-white gap-4 border-none bg-transparent focus:outline-none focus:ring-0 first:pt-4 last:pb-4",children:[i.jsxs("span",{className:"ml-1 flex h-7 items-center",children:[i.jsx(kCe,{"aria-hidden":"true",className:"size-6 group-data-[open]:hidden"}),i.jsx(kCe,{"aria-hidden":"true",className:"size-6 rotate-180 group-[&:not([data-open])]:hidden"})]}),i.jsx("span",{className:"text-start justify-start text-white text-base font-semibold font-['Manrope'] leading-normal",children:t.question})]}),i.jsx(Jre,{as:"dd",className:"pr-12 ml-[64px] pb-4 -mt-2",children:i.jsx("p",{className:"w-full lg:w-[683px] justify-start text-[#cfcfcf] text-sm font-medium font-['Manrope'] leading-normal",children:t.answer})})]})},t.question))})]})})},Kan=({className:e})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",className:e,children:[i.jsx("g",{clipPath:"url(#clip0_235_3767)",children:i.jsx("path",{d:"M8.99969 0.180054C4.12852 0.180054 0.179688 4.12889 0.179688 9.00005C0.179688 13.8712 4.12852 17.8201 8.99969 17.8201C13.8709 17.8201 17.8197 13.8712 17.8197 9.00005C17.8197 4.12889 13.8709 0.180054 8.99969 0.180054ZM13.0879 6.17836C12.9552 7.57303 12.3808 10.9575 12.0885 12.5195C11.9649 13.1804 11.7214 13.4021 11.4858 13.4237C10.9737 13.4709 10.5847 13.0853 10.0886 12.7601C9.3123 12.2512 8.87375 11.9344 8.12021 11.4379C7.24942 10.8641 7.81393 10.5488 8.3102 10.0331C8.44008 9.8982 10.6968 7.84552 10.7405 7.65931C10.7459 7.63601 10.7512 7.54906 10.6995 7.50339C10.6477 7.45773 10.5718 7.4732 10.5168 7.48561C10.439 7.5033 9.19888 8.32296 6.7965 9.94461C6.44453 10.1863 6.12571 10.3041 5.84003 10.2979C5.52511 10.2911 4.91933 10.1199 4.46898 9.97345C3.91663 9.79393 3.47762 9.699 3.51585 9.39407C3.53577 9.23522 3.75449 9.07281 4.17202 8.90684C6.74324 7.7866 8.45778 7.04805 9.31564 6.69117C11.765 5.67235 12.274 5.49538 12.6058 5.48948C12.6787 5.48827 12.8419 5.50634 12.9475 5.59208C13.0178 5.65316 13.0626 5.7384 13.0731 5.83094C13.091 5.94583 13.0959 6.06236 13.0879 6.17836Z",fill:"currentColor"})}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_235_3767",children:i.jsx("rect",{width:"18",height:"18",fill:"currentColor"})})})]}),Yan=({className:e})=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",className:e,children:[i.jsx("g",{clipPath:"url(#clip0_235_3764)",children:i.jsx("path",{d:"M11.0256 0.672607H13.1722L8.48225 6.03344L14 13.3269H9.67983L6.2965 8.90286L2.42433 13.3269H0.2765L5.29317 7.59269L0 0.673191H4.42983L7.48825 4.71686L11.0256 0.672607ZM10.2725 12.0424H11.4619L3.7835 1.89002H2.50717L10.2725 12.0424Z",fill:"currentColor"})}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_235_3764",children:i.jsx("rect",{width:"14",height:"14",fill:"currentColor"})})})]}),Xan=({className:e})=>i.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:i.jsx("path",{d:"M16.9419 3.52317C15.6473 2.91744 14.263 2.47723 12.8157 2.22656C12.638 2.5479 12.4304 2.98012 12.2872 3.32394C10.7487 3.09258 9.22445 3.09258 7.7143 3.32394C7.57116 2.98012 7.3588 2.5479 7.17947 2.22656C5.73067 2.47723 4.3448 2.91906 3.05016 3.52638C0.438869 7.47238 -0.269009 11.3204 0.0849305 15.1137C1.81688 16.4071 3.49534 17.1928 5.14548 17.7069C5.55291 17.1462 5.91628 16.5501 6.22931 15.9219C5.63313 15.6954 5.06211 15.4158 4.52256 15.0912C4.6657 14.9852 4.80571 14.8743 4.94098 14.7603C8.23183 16.2995 11.8074 16.2995 15.0589 14.7603C15.1958 14.8743 15.3358 14.9852 15.4774 15.0912C14.9362 15.4174 14.3637 15.6969 13.7675 15.9235C14.0805 16.5501 14.4423 17.1478 14.8513 17.7085C16.503 17.1944 18.183 16.4087 19.915 15.1137C20.3303 10.7163 19.2056 6.90361 16.9419 3.52317ZM6.67765 12.7809C5.68977 12.7809 4.87963 11.8586 4.87963 10.7355C4.87963 9.61247 5.67247 8.68864 6.67765 8.68864C7.68285 8.68864 8.49297 9.61086 8.47567 10.7355C8.47723 11.8586 7.68285 12.7809 6.67765 12.7809ZM13.3223 12.7809C12.3344 12.7809 11.5243 11.8586 11.5243 10.7355C11.5243 9.61247 12.3171 8.68864 13.3223 8.68864C14.3275 8.68864 15.1376 9.61086 15.1203 10.7355C15.1203 11.8586 14.3275 12.7809 13.3223 12.7809Z",fill:"currentColor"})}),Hce=()=>i.jsxs("footer",{className:"bg-[#121213] pt-12 pb-28 sm:pt-6 sm:pb-6 text-center text-sm text-gray-400",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row justify-center items-center gap-[32px] relative",children:[i.jsx("div",{onClick:()=>window.location.href="https://blog.dextrabot.com/",className:"text-center justify-start text-[#696969] hover:text-white text-[13px] font-semibold font-['Manrope'] leading-normal cursor-pointer",children:"Blog"}),i.jsx("div",{onClick:()=>window.location.href="/sitemap",className:"text-center justify-start text-[#696969] hover:text-white text-[13px] font-semibold font-['Manrope'] leading-normal cursor-pointer",children:"Sitemap"}),i.jsx("div",{onClick:()=>window.location.href="/videos",className:"text-center justify-start text-[#696969] hover:text-white text-[13px] font-semibold font-['Manrope'] leading-normal cursor-pointer",children:"Videos"}),i.jsx("div",{onClick:()=>window.open("https://docs.dextrabot.com/","_blank"),className:"text-center justify-start text-[#696969] hover:text-white text-[13px] font-semibold font-['Manrope'] leading-normal cursor-pointer",children:"Documentation"}),i.jsx("div",{onClick:()=>window.open("https://docs.dextrabot.com/faq-and-official-links/risk-disclaimer","_blank"),className:"text-center justify-start text-[#696969] hover:text-white text-[13px] font-semibold font-['Manrope'] leading-normal cursor-pointer",children:"Risk Disclaimer"}),i.jsxs("div",{className:"flex justify-center sm:justify-start items-center gap-4",children:[i.jsx("div",{onClick:()=>{window.open("https://x.com/dextrabot","_blank")},className:"rounded-full cursor-pointer p-[1px]",children:i.jsx(Yan,{className:"text-[#696969] hover:text-white"})}),i.jsx("div",{onClick:()=>{window.open("https://discord.gg/dextrabot","_blank")},className:"rounded-full cursor-pointer p-[1px]",children:i.jsx(Xan,{className:"text-[#696969] hover:text-white"})}),i.jsx("div",{onClick:()=>{window.open("https://t.me/Dextrabot_Official","_blank")},className:"rounded-full cursor-pointer p-[1px]",children:i.jsx(Kan,{className:"text-[#696969] hover:text-white"})})]}),i.jsxs("div",{className:"hidden xl:flex absolute right-2 justify-end items-center text-center text-[#696969] hover:text-white text-[13px] font-semibold font-['Manrope'] leading-normal",children:["© ",new Date().getFullYear()," Dextrabot. All rights reserved."]})]}),i.jsxs("div",{className:"block xl:hidden text-center text-[#696969] hover:text-white text-[13px] font-semibold font-['Manrope'] leading-normal mt-6",children:["© ",new Date().getFullYear()," Dextrabot. All rights reserved."]})]}),Qan=()=>{const e=m.useRef(null),t=m.useRef(null),n=m.useRef(null);return i.jsxs(i.Fragment,{children:[i.jsx(Io,{children:i.jsxs($o,{children:[i.jsx("meta",{name:"description",content:"Find high-performing Hyperliquid wallets, analyze their trading patterns, and automatically copy their strategies with custom risk settings. Real-time alerts via Telegram."}),i.jsx("meta",{name:"og:title",content:"Dextrabot | Discover and Copy Trade Top Hyperliquid Wallets"}),i.jsx("meta",{name:"og:description",content:"Find high-performing Hyperliquid wallets, analyze their trading patterns, and automatically copy their strategies with custom risk settings. Real-time alerts via Telegram."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/"}),i.jsx("link",{rel:"canonical",href:"https://app.dextrabot.com/"}),i.jsx("meta",{name:"theme-color",content:"#121213"}),i.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://app.dextrabot.com/#organization",name:"Dextrabot",url:"https://app.dextrabot.com/",logo:{"@type":"ImageObject","@id":"https://app.dextrabot.com/#logo",url:"https://app.dextrabot.com/assets/dextrabotIcon-B5aLRkPC.png",width:192,height:192,caption:"Dextrabot - Copy Trade on Hyperliquid"},sameAs:["https://x.com/dextrabot","https://discord.gg/dextrabot"]},{"@type":"WebSite","@id":"https://app.dextrabot.com/#website",url:"https://app.dextrabot.com/",name:"Dextrabot",description:"Find profitable Hyperliquid traders, analyze their strategies, and automatically copy their trades. Real-time alerts and advanced analytics for Hyperliquid.",publisher:{"@id":"https://app.dextrabot.com/#organization"},potentialAction:{"@type":"SearchAction",target:"https://app.dextrabot.com/wallet-details/{search_term_string}","query-input":"required name=search_term_string"}},{"@type":"WebPage","@id":"https://app.dextrabot.com/#webpage",url:"https://app.dextrabot.com/",name:"Discover, Analyze & Copy Trade Top Traders on Hyperliquid | Dextrabot",isPartOf:{"@id":"https://app.dextrabot.com/#website"},about:{"@id":"https://app.dextrabot.com/#organization"},description:"Find profitable Hyperliquid traders, analyze their strategies, and automatically copy their trades with customizable risk parameters.",inLanguage:"en-US"},{"@type":"SoftwareApplication","@id":"https://app.dextrabot.com/#softwareapplication",name:"Dextrabot",operatingSystem:"Web",applicationCategory:"DeFiApplication",offers:{"@type":"Offer",price:"0.055",priceCurrency:"USDC",priceSpecification:{"@type":"UnitPriceSpecification",price:"0.055",priceCurrency:"USDC",unitCode:"PERCENT",description:"0.055% fee for every copy trade transaction"}},featureList:["Copy Trade","Wallet Discovery","Performance Analytics","Real-time Alerts","Telegram Notifications"]},{"@type":"FAQPage","@id":"https://app.dextrabot.com/#faqpage",mainEntity:[{"@type":"Question",name:"How does copy trade work on Dextrabot?",acceptedAnswer:{"@type":"Answer",text:"Dextrabot monitors wallet activity and automatically executes the same perpetual positions in your account based on your risk settings."}},{"@type":"Question",name:"What fees does Dextrabot charge?",acceptedAnswer:{"@type":"Answer",text:"Dextrabot charges 0.055% on trade size for copy trade transactions. Use a referral code for a 4% discount."}},{"@type":"Question",name:"How do I set up Telegram notifications?",acceptedAnswer:{"@type":"Answer",text:"Connect your Telegram account through the Tracker page to receive instant alerts about wallet activities and copy trades."}},{"@type":"Question",name:"What risk management options are available?",acceptedAnswer:{"@type":"Answer",text:"Dextrabot offers customizable stop-loss and take-profit levels, position size limits, and margin increase controls for comprehensive risk management."}},{"@type":"Question",name:"How does the referral program work?",acceptedAnswer:{"@type":"Answer",text:"You can earn up to 65% reward on the fees generated by traders you refer to Dextrabot, with multi-tier commissions coming soon."}},{"@type":"Question",name:"Can I copy multiple wallets simultaneously?",acceptedAnswer:{"@type":"Answer",text:"Yes, you can copy trade multiple wallets at once, each with their own customized risk parameters and position sizing."}}]}]})})]})}),i.jsxs("div",{className:"bg-[#121213] p-4 w-screen h-screen overflow-x-hidden overflow-y-auto relative z-50",children:[i.jsx("div",{className:"landing-green-background-landing h-full w-full absolute -z-10 top-0"}),i.jsx(zce,{scrollToFeatures:()=>{var r;return(r=e.current)==null?void 0:r.scrollIntoView({behavior:"smooth"})},scrollToHowItWorks:()=>{var r;return(r=t.current)==null?void 0:r.scrollIntoView({behavior:"smooth"})},scrollToFAQ:()=>{var r;return(r=n.current)==null?void 0:r.scrollIntoView({behavior:"smooth"})}}),i.jsx(Van,{}),i.jsx("div",{ref:e,children:i.jsx(Wan,{})}),i.jsx("div",{ref:t,children:i.jsx(qan,{})}),i.jsx("div",{ref:n,children:i.jsx(Gan,{})}),i.jsx(Hce,{})]})]})};var Wx={},TCe;function Zan(){if(TCe)return Wx;TCe=1;var e=Wx.__assign||function(){return e=Object.assign||function(d){for(var f,x=1,g=arguments.length;x<g;x++){f=arguments[x];for(var v in f)Object.prototype.hasOwnProperty.call(f,v)&&(d[v]=f[v])}return d},e.apply(this,arguments)},t=Wx.__createBinding||(Object.create?function(d,f,x,g){g===void 0&&(g=x);var v=Object.getOwnPropertyDescriptor(f,x);(!v||("get"in v?!f.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return f[x]}}),Object.defineProperty(d,g,v)}:function(d,f,x,g){g===void 0&&(g=x),d[g]=f[x]}),n=Wx.__setModuleDefault||(Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f}),r=Wx.__importStar||function(){var d=function(f){return d=Object.getOwnPropertyNames||function(x){var g=[];for(var v in x)Object.prototype.hasOwnProperty.call(x,v)&&(g[g.length]=v);return g},d(f)};return function(f){if(f&&f.__esModule)return f;var x={};if(f!=null)for(var g=d(f),v=0;v<g.length;v++)g[v]!=="default"&&t(x,f,g[v]);return n(x,f),x}}(),s=Wx.__rest||function(d,f){var x={};for(var g in d)Object.prototype.hasOwnProperty.call(d,g)&&f.indexOf(g)<0&&(x[g]=d[g]);if(d!=null&&typeof Object.getOwnPropertySymbols=="function")for(var v=0,g=Object.getOwnPropertySymbols(d);v<g.length;v++)f.indexOf(g[v])<0&&Object.prototype.propertyIsEnumerable.call(d,g[v])&&(x[g[v]]=d[g[v]]);return x};Object.defineProperty(Wx,"__esModule",{value:!0});var a=r(tx()),o=$Ue(),l=UUe(),c=[(0,l.createAnimation)("PacmanLoader","0% {transform: rotate(0deg)} 50% {transform: rotate(-44deg)}","pacman-1"),(0,l.createAnimation)("PacmanLoader","0% {transform: rotate(0deg)} 50% {transform: rotate(44deg)}","pacman-2")];function u(d){var f=d.loading,x=f===void 0?!0:f,g=d.color,v=g===void 0?"#000000":g,w=d.speedMultiplier,C=w===void 0?1:w,N=d.cssOverride,I=N===void 0?{}:N,P=d.size,R=P===void 0?25:P,F=d.margin,U=F===void 0?2:F,L=s(d,["loading","color","speedMultiplier","cssOverride","size","margin"]),z=(0,o.parseLengthAndUnit)(R),X=z.value,ne=z.unit,J=e({display:"inherit",position:"relative",fontSize:0,height:"".concat(X*2).concat(ne),width:"".concat(X*2).concat(ne)},I),Z=(0,l.createAnimation)("PacmanLoader",`75% {opacity: 0.7}
    100% {transform: translate(`.concat("".concat(-4*X).concat(ne),", ").concat("".concat(-X/4).concat(ne),")}"),"ball"),re=function(V){return{width:"".concat(X/3).concat(ne),height:"".concat(X/3).concat(ne),backgroundColor:v,margin:(0,o.cssValue)(U),borderRadius:"100%",transform:"translate(0, ".concat("".concat(-X/4).concat(ne),")"),position:"absolute",top:"".concat(X).concat(ne),left:"".concat(X*4).concat(ne),animation:"".concat(Z," ").concat(1/C,"s ").concat(V*.25,"s infinite linear"),animationFillMode:"both"}},he="".concat((0,o.cssValue)(R)," solid transparent"),Y="".concat((0,o.cssValue)(R)," solid ").concat(v),ie=function(V){return{width:0,height:0,borderRight:he,borderTop:V===0?he:Y,borderLeft:Y,borderBottom:V===0?Y:he,borderRadius:(0,o.cssValue)(R),position:"absolute",animation:"".concat(c[V]," ").concat(.8/C,"s infinite ease-in-out"),animationFillMode:"both"}},oe=ie(0),G=ie(1);return x?a.createElement("span",e({style:J},L),a.createElement("span",{style:oe}),a.createElement("span",{style:G}),a.createElement("span",{style:re(2)}),a.createElement("span",{style:re(3)}),a.createElement("span",{style:re(4)}),a.createElement("span",{style:re(5)})):null}return Wx.default=u,Wx}var Jan=Zan();const eon=ji(Jan),ton=()=>{const{setHyperToken:e,setHyperAddress:t}=m.useContext(Gr),[n]=VNe(),r=nl(),s=n.get("temp_mobile_password");return m.useEffect(()=>{s?(async()=>{try{const o=await ls.post("https://dextrabothypev2.nftinit.io/api/subscriber/sign_mobile_complete/",{temp_mobile_password:s},{headers:{"Content-Type":"application/json"}}),{token:l,address:c}=o.data;setTimeout(()=>{window.localStorage.setItem("hyperToken",l),window.localStorage.setItem("hyperAddress",c),t(c),e(l),on.success("Authentication successful.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}),r("/discover-wallets")},1e3)}catch{on.error("Invalid QR or request failed."),r("/")}})():r("/")},[s,e,t,r]),i.jsxs("div",{className:"w-screen text-white flex flex-col items-center justify-center min-h-screen gap-4 ",children:[i.jsx("img",{src:Hi,alt:"",className:"w-24 h-24"}),i.jsx("div",{className:"font-manrope font-bold text-lg",children:"Welcome to Dextrabot"}),i.jsx("div",{className:"font-manrope font-bold text-lg",children:"Authenticating..."}),i.jsx(eon,{color:"#46eda1",size:30})]})},non=()=>i.jsxs(i.Fragment,{children:[i.jsx(Io,{children:i.jsxs($o,{children:[i.jsx("meta",{name:"description",content:"Navigate all sections of Dextrabot through our comprehensive sitemap. Find links to copy trading features, wallet management, leaderboards, and more in one convenient location."}),i.jsx("meta",{name:"og:title",content:"Complete Dextrabot Website Sitemap"}),i.jsx("meta",{name:"og:description",content:"Navigate all sections of Dextrabot through our comprehensive sitemap. Find links to copy trading features, wallet management, leaderboards, and more in one convenient location."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/sitemap"})]})}),i.jsxs("div",{className:"bg-[#121213] p-4 w-screen h-screen overflow-x-hidden overflow-y-auto relative z-50",children:[i.jsx("div",{className:"h-full w-full absolute -z-10 -mt-[138px]"}),i.jsx(zce,{scrollToFeatures:()=>{var e;return(e=featuresRef.current)==null?void 0:e.scrollIntoView({behavior:"smooth"})},scrollToHowItWorks:()=>{var e;return(e=howItWorksRef.current)==null?void 0:e.scrollIntoView({behavior:"smooth"})},scrollToFAQ:()=>{var e;return(e=faQRef.current)==null?void 0:e.scrollIntoView({behavior:"smooth"})}}),i.jsx("section",{className:"px-1 py-5 sm:py-[64px] text-center h-[calc(100vh-190px)]",children:i.jsx("div",{className:"max-w-7xl mx-auto h-full",children:i.jsx("div",{className:"flex flex-col items-start gap-[88px] h-full",children:i.jsxs("div",{className:"flex flex-col items-start justify-start gap-6 h-full",children:[i.jsx("h2",{className:"text-start justify-start text-white text-[40px] font-semibold font-['Manrope'] leading-[48px]",children:"Dextrabot Sitemap"}),i.jsx("div",{className:"flex flex-col items-start",children:i.jsx("nav",{"aria-label":"Sitemap",children:i.jsxs("ul",{className:"text-start text-[#c9c9c9] text-base font-semibold font-['Manrope']",children:[i.jsx("li",{children:i.jsx("a",{href:"/",className:"hover:text-white text-[#c9c9c9] underline",children:"Dextrabot Homepage"})}),i.jsx("li",{children:i.jsx("a",{href:"/discover-wallets",className:"hover:text-white text-[#c9c9c9] underline",children:"Discover Wallets"})}),i.jsx("li",{children:i.jsx("a",{href:"/copy-trade",className:"hover:text-white text-[#c9c9c9] underline",children:"Copy Trade"})}),i.jsx("li",{children:i.jsx("a",{href:"/wallet-management",className:"hover:text-white text-[#c9c9c9] underline",children:"Wallet Management"})}),i.jsx("li",{children:i.jsx("a",{href:"/tracked-wallets",className:"hover:text-white text-[#c9c9c9] underline",children:"Tracked Wallets"})}),i.jsx("li",{children:i.jsx("a",{href:"/tracker",className:"hover:text-white text-[#c9c9c9] underline",children:"My Activities"})}),i.jsx("li",{children:i.jsx("a",{href:"/referral",className:"hover:text-white text-[#c9c9c9] underline",children:"Referral"})}),i.jsx("li",{children:i.jsx("a",{href:"/leaderboard",className:"hover:text-white text-[#c9c9c9] underline",children:"Leaderboard"})})]})})})]})})})}),i.jsx(Hce,{})]})]}),ron=()=>{const e=[{id:"JDdZ5yWmEXk",title:"The Best Vaults on Hyperliquid (Get your free Google Vault Analysis Sheet)"},{id:"bCJTNChKfFA",title:"Copy Trading Challenge: Day 7: Wallet Adjustments (Reduced the Number of Copy Traded Wallets to one)"},{id:"l6xkJugg1PY",title:"Copy Trading Vaults on Hyperliquid (with Dextrabot)"},{id:"Yu_V6YNw6oA",title:"Hottest Copy Traded Wallets (Hyperliquid Copy Trading)"},{id:"OwpWPDGBJUU",title:"Copy Trading Challenge: Day 6 (+1500 USD) - Hyperliquid Copy Trading"},{id:"gN11fXPPFvU",title:"Copy Trading Challenge: Day 2 (Analysing Current Situation & Some Tips / Info on Hyperliquid)"},{id:"LDEjjcR-FqE",title:"Copy Trading Challenge: Day 1 (Finding & Analysing Wallets - Starting Copy Trading on Hyperliquid)"},{id:"HVxt-rnXHfk",title:"Copy Trading Tips & Tricks - (Hyperliquid Automated Copy Trading)"},{id:"e6ePwfGaMRc",title:"Hyperliquid Copy Trading: Mirror Copy Trading (Trade At The Same Margin Usage As The Source Wallet)"},{id:"Z1QB190V9M0",title:"Hyperliquid Copy Trading: Copy Current Positions (Dextrabot)"},{id:"C_mqwSqT2mI",title:"Hyperliquid Copy Trading Software in Action!"},{id:"jJYxbdkq514",title:"Hyperliqud Free Wallet Tracker (Telegram and Webpage) - Copy Trading"},{id:"gpzB62yp-rY",title:"Hyperliqud Copy Trading & Wallet Analysis Tool (Dextra: First of its kind!)"}];return i.jsxs(i.Fragment,{children:[i.jsx(Io,{children:i.jsxs($o,{children:[i.jsx("title",{children:"Hyperliquid Copy Trade Video Tutorials & Guides"}),i.jsx("meta",{name:"description",content:"Watch step-by-step Dextrabot video tutorials on Hyperliquid copy trading. Learn how to set up copy trading and discover profitable wallets."}),i.jsx("meta",{name:"og:title",content:"Hyperliquid Copy Trade Video Tutorials & Guides"}),i.jsx("meta",{name:"og:description",content:"Watch step-by-step Dextrabot video tutorials on Hyperliquid copy trading. Learn how to set up copy trading and discover profitable wallets."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/videos"})]})}),i.jsxs("div",{className:"bg-[#121213] p-4 w-screen h-screen overflow-x-hidden overflow-y-auto relative z-50",children:[i.jsx("div",{className:"h-full w-full absolute -z-10 -mt-[138px]"}),i.jsx(zce,{scrollToFeatures:()=>{var t;return(t=featuresRef.current)==null?void 0:t.scrollIntoView({behavior:"smooth"})},scrollToHowItWorks:()=>{var t;return(t=howItWorksRef.current)==null?void 0:t.scrollIntoView({behavior:"smooth"})},scrollToFAQ:()=>{var t;return(t=faQRef.current)==null?void 0:t.scrollIntoView({behavior:"smooth"})}}),i.jsx("section",{className:"px-1 py-5 sm:py-[64px] text-center",children:i.jsx("div",{className:"max-w-7xl mx-auto h-full",children:i.jsx("div",{className:"flex flex-col items-start gap-[88px] h-full",children:i.jsxs("div",{className:"flex flex-col items-center justify-center gap-6 h-full",children:[i.jsx("h2",{className:"text-center justify-start text-white text-[40px] font-semibold font-['Manrope'] leading-[48px]",children:"Hyperliquid Copy Trade Video Tutorials & Guides"}),i.jsx("div",{className:"flex justify-center flex-wrap gap-6",children:e.map(t=>i.jsxs("div",{className:"w-full sm:w-1/4 bg-[#1c1c1c] rounded-xl overflow-hidden shadow-md p-4",children:[i.jsx("div",{className:"text-white font-semibold text-base p-4 h-32",children:t.title}),i.jsx("div",{className:"aspect-w-16 aspect-h-9",children:i.jsx("iframe",{src:`https://www.youtube.com/embed/${t.id}`,title:t.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"w-full h-48 rounded-xl"})})]},t.id))})]})})})}),i.jsx(Hce,{})]})]})},$P=(e,t=2)=>Number(e).toLocaleString("en-US",{style:"currency",currency:"USD",maximumFractionDigits:t}),ZY=(e,t=2)=>Number(e).toLocaleString("en-US",{maximumFractionDigits:t}),ICe=e=>`${(e*100).toFixed(2)}%`,JY=e=>Math.floor((Date.now()-e)/864e5);function son(){const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,a]=m.useState(""),[o,l]=m.useState(""),[c,u]=m.useState(""),[d,f]=m.useState(""),[x,g]=m.useState(""),[v,w]=m.useState(!1),[C,N]=m.useState(""),[I,P]=m.useState("tvl"),[R,F]=m.useState("desc"),[U,L]=m.useState(20),[z,X]=m.useState(1),ne=ee=>(ee.summary.name||"").trim()==="Hyperliquidity Provider (HLP)",J=()=>{r(!0),ls.get("https://stats-data.hyperliquid.xyz/Mainnet/vaults").then(ee=>t(Array.isArray(ee.data)?ee.data:[])).finally(()=>r(!1))};m.useEffect(()=>J(),[]);const Z=(ee,ae)=>{var Ae;const fe=(Ae=ee.pnls)==null?void 0:Ae.find(([ce])=>ce===ae);return fe?parseFloat(fe[1].slice(-1)[0]||0):0},re=m.useMemo(()=>{if(!e.length)return null;const ee=e.reduce((fe,Ae)=>fe+ +Ae.summary.tvl,0),ae=e.reduce((fe,Ae)=>fe+(Ae.apr||0),0)/e.length;return{total:e.length,active:e.filter(fe=>!fe.summary.isClosed).length,tvl:ee,avgApr:ae,profitable:e.filter(fe=>Z(fe,"allTime")>0).length}},[e]),he=m.useMemo(()=>e.filter(ee=>{const ae=+ee.summary.tvl,fe=ee.apr||0,Ae=Z(ee,"month"),ce=Z(ee,"allTime"),ye=JY(ee.summary.createTimeMillis),Ne=(ee.summary.name||"").toLowerCase()+(ee.summary.vaultAddress||"").toLowerCase();return!(s&&ae<+s||o&&fe*100<+o||c&&Ae<+c||d&&ce<+d||x&&ye<+x||!v&&ee.summary.isClosed||C&&!Ne.includes(C.toLowerCase()))}),[e,s,o,c,d,x,v,C]),Y=(ee,ae)=>{var fe;switch(ae){case"name":return((fe=ee.summary.name)==null?void 0:fe.toLowerCase())||"";case"apr":return ee.apr||0;case"tvl":return+ee.summary.tvl;case"p30":return Z(ee,"month");case"pAll":return Z(ee,"allTime");case"days":return JY(ee.summary.createTimeMillis);default:return 0}},ie=m.useMemo(()=>[...he].sort((ee,ae)=>{const fe=Y(ee,I),Ae=Y(ae,I);return fe===Ae?0:R==="asc"?fe>Ae?1:-1:fe<Ae?1:-1}),[he,I,R]),oe=Math.max(1,Math.ceil(ie.length/U)),G=ie.slice((z-1)*U,z*U),V=(ee,ae)=>i.jsx("th",{onClick:()=>P(ee)||F(I===ee?R==="asc"?"desc":"asc":"desc"),className:`px-3 py-2 cursor-pointer whitespace-nowrap ${I===ee?"text-[#67FFBD]":""}`,children:ae},ee);return n?i.jsx("div",{className:"flex justify-center items-center w-full py-10",children:i.jsx(GUe,{color:"#ffffff",size:40})}):i.jsxs(i.Fragment,{children:[i.jsx(Io,{children:i.jsxs($o,{children:[i.jsx("title",{children:"Hyperliquid Vaults Dashboard | Track Performance Metrics | Dextrabot"}),i.jsx("meta",{name:"description",content:"Monitor real-time performance of 7,200+ Hyperliquid vaults with comprehensive metrics on TVL, APR, and PnL. Filter by performance criteria to find the most profitable vaults."}),i.jsx("meta",{name:"og:title",content:"Hyperliquid Vaults Dashboard | Track Performance Metrics | Dextrabot"}),i.jsx("meta",{name:"og:description",content:"Monitor real-time performance of 7,200+ Hyperliquid vaults with comprehensive metrics on TVL, APR, and PnL. Filter by performance criteria to find the most profitable vaults."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/hyperliquid-vaults"})]})}),i.jsxs("div",{className:"max-w-7xl mx-auto p-6 font-manrope font-bold w-full",children:[i.jsx("h1",{className:"text-3xl font-bold text-center mb-8 text-white",children:"Hyperliquid Vaults Dashboard"}),i.jsx("button",{onClick:()=>{J(),X(1)},disabled:n,className:"bg-[#1c1c1c] hover:bg-[#303030] text-white px-4 py-2 rounded disabled:opacity-40 text-sm font-bold mb-4 flex justify-end",children:n?"Refreshing…":"Refresh Data"}),re&&i.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-5 gap-4 mb-8 text-center",children:[["Total Vaults",ZY(re.total,0)],["Active Vaults",ZY(re.active,0)],["Total TVL",$P(re.tvl,0)],["Average APR",ICe(re.avgApr)],["Profitable Vaults",ZY(re.profitable,0)]].map(([ee,ae])=>i.jsxs("div",{className:"bg-[#1c1c1c] rounded-lg p-4",children:[i.jsx("p",{className:"text-sm text-gray-400 mb-1",children:ee}),i.jsx("p",{className:"text-xl font-semibold text-white",children:ae})]},ee))}),i.jsxs("div",{className:"bg-[#1c1c1c] rounded-lg p-4 mb-8",children:[i.jsx("h2",{className:"text-xl font-semibold mb-4 text-white",children:"Filters"}),i.jsxs("div",{className:"grid md:grid-cols-6 gap-4 mb-4",children:[[["Min TVL",s,a],["Min APR (%)",o,l],["Min 30d PNL",c,u],["Min All-Time PNL",d,f],["Min Days",x,g]].map(([ee,ae,fe])=>i.jsxs("div",{className:"flex flex-col",children:[i.jsx("label",{className:"text-sm text-gray-300 mb-1",children:ee}),i.jsx("input",{type:"number",value:ae===0?"":ae,placeholder:"0",onChange:Ae=>fe(Ae.target.value===""?"":+Ae.target.value),className:"bg-[#303030] text-white rounded px-3 py-2 outline-none"})]},ee)),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("label",{className:"text-sm text-gray-300 mb-1",children:"Search"}),i.jsx("input",{value:C,onChange:ee=>N(ee.target.value),className:"bg-[#303030] text-white rounded px-3 py-2 outline-none"})]})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("label",{className:"flex items-center text-sm text-gray-300",children:[i.jsx("input",{type:"checkbox",checked:v,onChange:ee=>w(ee.target.checked),className:"mr-2"}),"Show Closed Vaults"]}),i.jsx("button",{onClick:()=>{a(""),l(""),u(""),f(""),g(""),w(!1),N("")},className:"bg-[#303030] text-white px-3 py-1 text-sm font-bold rounded",children:"Reset"})]})]}),i.jsx("div",{className:"rounded-lg overflow-auto border border-[#303030]",children:i.jsxs("table",{className:"min-w-full text-sm text-gray-200 border-separate border-spacing-y-1",children:[i.jsx("thead",{className:"bg-[#161616]",children:i.jsxs("tr",{children:[V("name","Vault"),V("tvl","TVL"),V("apr","APR"),V("p30","30d PNL"),V("pAll","All-Time PNL"),V("days","Days")]})}),i.jsx("tbody",{children:G.map((ee,ae)=>{const fe=+ee.summary.tvl,Ae=ee.apr||0,ce=Z(ee,"month"),ye=Z(ee,"allTime"),Ne=JY(ee.summary.createTimeMillis),be=ee.summary.vaultAddress;return i.jsxs("tr",{className:"border-b border-[#1b1b1b] bg-[#1b1b1b] hover:bg-[#222222] text-center",children:[i.jsxs("td",{className:"px-3 py-2 whitespace-nowrap flex items-center gap-2",children:[i.jsx("a",{href:`https://app.hyperliquid.xyz/vaults/${be}`,target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#67FFBD] font-bold text-white",children:ee.summary.name||"Unnamed"}),i.jsx("a",{href:`/wallet-details/${be}`,target:"_blank",rel:"noopener noreferrer",children:i.jsx("img",{src:Hi,className:"w-4 h-4"})}),ne(ee)&&i.jsx("span",{className:"text-[#FF7173] ml-1",children:"(Protocol Vault)"})]}),i.jsx("td",{className:"px-3 py-2",children:$P(fe)}),i.jsx("td",{className:"px-3 py-2",children:ICe(Ae)}),i.jsx("td",{className:`px-3 py-2 ${ce>=0?"text-[#67FFBD]":"text-[#FF7173]"}`,children:$P(ce)}),i.jsx("td",{className:`px-3 py-2 ${ye>=0?"text-[#67FFBD]":"text-[#FF7173]"}`,children:$P(ye)}),i.jsx("td",{className:"px-3 py-2",children:Ne})]},be)})})]})}),i.jsxs("div",{className:"flex items-center justify-between mt-4 text-gray-200",children:[i.jsxs("div",{className:"text-sm",children:["Rows:",i.jsx("select",{value:U,onChange:ee=>{L(+ee.target.value),X(1)},className:"bg-[#303030] ml-2 px-2 py-1 rounded text-sm font-bold",children:[10,20,30,40,50,100].map(ee=>i.jsx("option",{children:ee},ee))})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{onClick:()=>X(ee=>Math.max(1,ee-1)),disabled:z===1,className:"px-2 py-1 bg-[#1c1c1c] rounded disabled:opacity-40",children:"‹"}),i.jsxs("span",{className:"text-sm",children:[z,"/",oe]}),i.jsx("button",{onClick:()=>X(ee=>Math.min(oe,ee+1)),disabled:z===oe,className:"px-2 py-1 bg-[#1c1c1c] rounded disabled:opacity-40",children:"›"})]})]})]})]})}const gh=({title:e,sortKey:t,sortOption:n,setSortOption:r,isFilterIcon:s})=>{const a=()=>{r(n===`-${t}`?t:`-${t}`)};return i.jsx(i.Fragment,{children:i.jsxs("div",{onClick:()=>a(),className:`${e==="Wallet"?"sm:sticky left-0 h-8":s?"justify-end":"justify-start"} flex items-center gap-1 min-w-max font-manrope cursor-pointer`,children:[i.jsx("div",{className:`${n.includes(t)?"text-white":""} cursor-pointer flex items-center justify-end group`,children:e}),i.jsx(cU,{sortKey:t,state:n,className:""})]})})},ion=({data:e,period:t})=>i.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 lg:gap-4 px-2 sm:px-0 min-w-max",children:e?e==null?void 0:e.map((n,r)=>i.jsxs(m.Fragment,{children:[i.jsx(fb,{title:"Total Notional",value:n!=null&&n.total_notional?n==null?void 0:n.total_notional:"--",info:`${n!=null&&n.ticker_count?n==null?void 0:n.ticker_count:"--"} tickers`,icon:Wme,period:t}),i.jsx(fb,{title:"Long Positions",value:n!=null&&n.long_exposure?n==null?void 0:n.long_exposure:"--",info:"Long exposure",icon:xJ,period:t}),i.jsx(fb,{title:"Short Positions",value:n!=null&&n.short_exposure?n==null?void 0:n.short_exposure:"--",info:"Short exposure",icon:gJ,period:t}),i.jsx(fb,{title:"Global Bias",value:n!=null&&n.global_bias?n==null?void 0:n.global_bias:"--",info:`L/S: ${n!=null&&n.long_ratio_percent?n==null?void 0:n.long_ratio_percent:"--"}%`,icon:4,period:t})]},r)):i.jsxs(i.Fragment,{children:[i.jsx(fb,{title:"Total Notional",value:"--",info:"--",icon:Wme,period:t}),i.jsx(fb,{title:"Long Positions",value:"--",info:"Long exposure",icon:xJ,period:t}),i.jsx(fb,{title:"Short Positions",value:"--",info:"Short exposure",icon:gJ,period:t}),i.jsx(fb,{title:"Global Bias",value:"--",info:"L/S: --",icon:4,period:t})]})}),fb=({title:e,value:t,info:n,icon:r,period:s})=>i.jsxs("div",{style:{background:"linear-gradient(180deg, #000000 0%, #1C1C1C 100%)"},className:"h-20 lg:h-28 bg-[#1c1c1c] rounded-2xl p-2 lg:p-6 min-w-max relative overflow-hidden",children:[i.jsxs("div",{className:"flex justify-start items-start w-full h-full gap-2",children:[i.jsx("div",{className:"w-8 h-11 lg:w-12 lg:h-11 bg-[#1e1e1e] rounded-md border-[0.50px] border-[#313131] flex justify-center items-center",children:r===4?i.jsx(ORt,{className:`${t=="LONG"?"text-[#34D399]":(t=="SHORT","text-[#F87171]")} w-4 h-4 lg:w-5 lg:h-5`}):i.jsx("img",{src:r,alt:"",className:"w-4 h-4 lg:w-5 lg:h-5"})}),i.jsxs("div",{className:"flex flex-col items-start justify-start gap-2",children:[i.jsx("div",{className:"justify-start text-[#9b9b9b] text-[13px] lg:text-[14px] font-semibold font-['Manrope'] leading-[13px] tracking-tight mt-[3px]",children:`${e}`}),i.jsx("div",{className:"justify-start text-white text-[15px] lg:text-[17px] font-semibold font-['Manrope'] leading-[13px] tracking-tight",children:e==="Global Bias"?t:`$${Xlt(t)}`}),i.jsx("div",{className:"justify-start text-[#7e7e7e] text-[11px] lg:text-[12px] font-medium font-['Inter'] leading-[8px] tracking-tight mt-2",children:n})]})]}),r===4&&i.jsx("div",{className:`${t=="LONG"?"bg-[#67ffbd]/20":t=="SHORT"?"bg-[#ff797c]/20":""} h-2 lg:h-4 w-full absolute bottom-0 right-0 rounded-t-2xl`})]}),Fne=({data_1:e,data_2:t,margin:n})=>i.jsxs("div",{className:`${n=="true"?"mt-3":""} flex flex-col items-start justify-start gap-2 w-full px-1`,children:[i.jsx("div",{className:"text-white bg-transparent text-xs font-medium font-inter leading-[8px] tracking-[0.18px] w-full",children:i.jsxs("span",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-[#67ffbd]",children:e?`${e}%`:"--"}),i.jsx("span",{className:"text-[#ff787b]",children:t?`${t}%`:"--"})]})}),i.jsxs("div",{className:"h-1 w-full bg-[#333333] rounded-[256px] flex gap-[2px] overflow-hidden",children:[i.jsx("div",{style:e?isNaN(e)?{width:"0%"}:{width:`${e}%`}:{width:"0%"},className:"flex justify-center items-center h-1 bg-[#67FFBD] rounded-[256px] text-[#67ffbd] text-[11px] font-bold font-inter leading-[8px] tracking-[0.18px]"}),i.jsx("div",{style:t?isNaN(t)?{width:"0%"}:{width:`${t}%`}:{width:"0%"},className:"bg-[#FF797C] h-1 rounded-[256px] flex justify-center items-center text-[#67ffbd] text-[11px] font-bold font-inter leading-[8px] tracking-[0.18px]"})]}),i.jsx("div",{className:"text-white bg-transparent text-[11px] font-medium font-inter leading-[8px] tracking-[0.18px] w-full",children:i.jsxs("span",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-[#67ffbd]",children:"Long"}),i.jsx("span",{className:"text-[#ff787b]",children:"Short"})]})})]}),aon=({data:e,loading:t,error:n,period:r,periods:s,handlePeriodChange:a})=>{var ne,J;const o="-total_notional",[l,c]=m.useState(o),[u,d]=m.useState("All"),f=m.useRef({}),[x,g]=m.useState(""),v=m.useRef(null),w=Z=>{var he;const re=(he=e.data)==null?void 0:he.filter(Y=>{var oe,G,V,ee,ae;if(u!=="All"&&Y.majority_side!==u)return!1;const ie=(oe=x==null?void 0:x.trim())==null?void 0:oe.toLowerCase();return!(ie!==""&&!((V=(G=Y==null?void 0:Y.asset)==null?void 0:G.toLowerCase())!=null&&V.includes(ie)||(ae=(ee=Y==null?void 0:Y.coin_name)==null?void 0:ee.toLowerCase())!=null&&ae.includes(ie)))});return re==null?void 0:re.sort((Y,ie)=>{const oe=Y.asset?Y.asset.toUpperCase():"",G=ie.asset?ie.asset.toUpperCase():"",V=Y.majority_side==="LONG"?1:0,ee=ie.majority_side==="LONG"?1:0,ae=Y.majority_side==="SHORT"?1:0,fe=ie.majority_side==="SHORT"?1:0,Ae=Y.maj_side_pnl==="Profit"?1:0,ce=ie.maj_side_pnl==="Profit"?1:0,ye=Y.maj_side_pnl==="Loss"?1:0,Ne=ie.maj_side_pnl==="Loss"?1:0,be=Be=>{if(!Be||typeof Be!="string"||!Be.includes("/"))return 0;const[it,tt]=Be.split("/").map(at=>Number(at.trim()));return tt!==0?it/tt:0},je=be(Y.traders_l_s),Ie=be(ie.traders_l_s),Re=Be=>{var at,dt;const it=parseFloat((at=Be==null?void 0:Be.asset_change24h)==null?void 0:at.markPx),tt=parseFloat((dt=Be==null?void 0:Be.asset_change24h)==null?void 0:dt.prevDayPx);return!it||!tt||isNaN(it)||isNaN(tt)||tt===0?-1/0:(it-tt)/tt*100},Qe=Be=>{var tt;const it=parseFloat((tt=Be==null?void 0:Be.asset_change24h)==null?void 0:tt.markPx);return isNaN(it)?0:it};return Z==="asset"?oe<G?-1:oe>G?1:0:Z==="-asset"?oe>G?-1:oe<G?1:0:Z==="-total_notional"?ie.total_notional-Y.total_notional:Z==="total_notional"?Y.total_notional-ie.total_notional:Z==="-price"?Qe(ie)-Qe(Y):Z==="price"?Qe(Y)-Qe(ie):Z==="-long_notional"?ie.long_notional-Y.long_notional:Z==="long_notional"?Y.long_notional-ie.long_notional:Z==="-short_notional"?ie.short_notional-Y.short_notional:Z==="short_notional"?Y.short_notional-ie.short_notional:Z==="-total_long_pnl"?ie.total_long_pnl-Y.total_long_pnl:Z==="total_long_pnl"?Y.total_long_pnl-ie.total_long_pnl:Z==="-total_short_pnl"?ie.total_short_pnl-Y.total_short_pnl:Z==="total_short_pnl"?Y.total_short_pnl-ie.total_short_pnl:Z==="-majority_side"?ee-V:Z==="majority_side"?fe-ae:Z==="-l_s_ratio"?ie.l_s_ratio-Y.l_s_ratio:Z==="l_s_ratio"?Y.l_s_ratio-ie.l_s_ratio:Z==="-long_ratio"?ie.long_ratio-Y.long_ratio:Z==="long_ratio"?Y.long_ratio-ie.long_ratio:Z==="-short_ratio"?ie.short_ratio-Y.short_ratio:Z==="short_ratio"?Y.short_ratio-ie.short_ratio:Z==="-maj_side_notional"?ie.maj_side_notional-Y.maj_side_notional:Z==="maj_side_notional"?Y.maj_side_notional-ie.maj_side_notional:Z==="-maj_side_pnl"?ce-Ae:Z==="maj_side_pnl"?Ne-ye:Z==="-traders_l_s"?Ie-je:Z==="traders_l_s"?je-Ie:Z==="-open_interest"?ie.open_interest-Y.open_interest:Z==="open_interest"?Y.open_interest-ie.open_interest:Z==="-change_24h"?Re(ie)-Re(Y):Z==="change_24h"?Re(Y)-Re(ie):0})},C=m.useRef(null),N=()=>{C.current&&(C.current.scrollLeft-=100)},I=()=>{C.current&&(C.current.scrollLeft+=100)},P=()=>{C.current&&(C.current.scrollTop+=200)},R=()=>{C.current&&(C.current.scrollTop-=200)},F=Z=>{var re;Z.key==="Escape"&&(g(""),(re=v.current)==null||re.blur())},U=({coin:Z,price:re,prevPricesRef:he})=>{const[Y,ie]=m.useState("text-white");return m.useEffect(()=>{if(!Z||re==null||isNaN(re))return;const oe=parseFloat(re),G=he.current[Z]??0;oe>G?ie("text-[#1DE6A3]"):oe<G&&ie("text-[#FF7173]"),he.current[Z]=oe;const V=setTimeout(()=>{ie("text-white")},800);return()=>clearTimeout(V)},[re,Z]),i.jsx(qx,{info:re==null||isNaN(re)?i.jsx("div",{className:"flex items-center justify-end w-[96px]",children:i.jsx("div",{className:"w-[96px] max-w-[96px] h-[20px] rounded skeleton-ticker-text short"})}):`$${re>=1e3?zw(re):re}`,textColor:Y})},L={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},z=()=>i.jsx("div",{className:"flex items-center justify-end w-[96px]",children:i.jsx("div",{className:"w-[96px] max-w-[96px] h-[20px] rounded skeleton-ticker-text short"})}),X=Z=>Z>=376&&Z<500?4:Z>=500&&Z<640?5:Z>=640&&Z<768?6:Z>=768&&Z<1024?7:Z>=1024&&Z<1280?9:Z>=1280&&Z<1540?11:Z>=1540&&Z<1700||Z>=1700?12:3;return i.jsx(i.Fragment,{children:i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[10px] sm:gap-[13px] text-white bg-[#161616] w-full h-full font-manrope",children:[i.jsx("div",{className:"flex justify-between sm:justify-start items-center gap-6 w-full sm:w-max",children:i.jsxs("div",{className:"flex flex-row sm:flex-col justify-between items-center sm:items-start sm:justify-start gap-2 font-manrope max-w-full w-max sm:w-full bg-[#161616] pl-2 sm:pl-0 pt-1 pr-2 sm:pr-0",children:[i.jsx("div",{className:"text-[#7e7e7e] text-[11px] font-medium font-inter leading-[8px]",children:"Hype / Explore"}),i.jsx("div",{className:"flex items-center justify-start gap-4",children:i.jsx("div",{className:"text-white text-sm sm:text-lg font-medium font-manrope leading-[21px]",children:"Ticker"})})]})}),i.jsx(ion,{data:e.topbox,period:r}),i.jsxs("div",{className:"flex justify-start items-center gap-2 w-full h-max px-2 sm:px-0",children:[i.jsxs("div",{className:"flex justify-start items-center gap-0.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx("input",{ref:v,type:"text",value:x,onChange:Z=>g(Z.target.value),onKeyDown:F,className:"bg-[#222222] rounded text-white py-1 pl-2 pr-4 w-40 text-sm outline-none  placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Search Coin"}),i.jsx("div",{onClick:()=>g(""),className:"text-[#aaa] hover:text-white outline-none focus:outline-none focus:ring-0 border-none w-4 h-[26px] bg-[#222222] hover:bg-[#333333] rounded flex justify-center items-center cursor-pointer",children:i.jsx("img",{src:Oa,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]}),i.jsxs("div",{className:"flex justify-start items-center gap-1.5 w-max h-max rounded-lg border border-[#333333] p-1",children:[i.jsx(eX,{title:"All",set_click:()=>d("All"),tableSortButton:u}),i.jsx(eX,{title:"LONG",set_click:()=>d("LONG"),tableSortButton:u}),i.jsx(eX,{title:"SHORT",set_click:()=>d("SHORT"),tableSortButton:u})]})]}),i.jsxs("div",{className:"relative w-full h-full",children:[i.jsxs("div",{className:"absolute -top-6 right-4 z-10 hidden sm:flex justify-start items-center gap-2",children:[i.jsx("button",{onClick:N,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 rotate-90"})})}),i.jsx("button",{onClick:I,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none block lg:hidden",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 -rotate-90"})})}),i.jsx("button",{onClick:R,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 -rotate-180"})})}),i.jsx("button",{onClick:P,className:"bg-[#353535] hover:bg-gray-600 text-white p-1 rounded-lg focus:outline-none focus:ring-0 border-none",children:i.jsx("span",{className:"w-6 h-6",children:i.jsx(Ga,{className:"text-gray-300 w-4 h-4 "})})})]}),i.jsx("div",{className:"w-full h-[calc(100vh-330px)] sm:h-[calc(100vh-390px)] md:h-[calc(100vh-305px)] lg:h-[calc(100vh-340px)] overflow-x-scroll relative overflow-y-scroll flex-grow",ref:C,children:i.jsxs("table",{className:"w-full relative mb-20",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#161616] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#161616] sm:left-0 h-8 pl-3 min-w-[160px] z-[8]",children:i.jsx(gh,{title:"Coin",sortKey:"asset",sortOption:l,setSortOption:c,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[120px] px-1",children:i.jsx(gh,{title:"Majority Side",sortKey:"majority_side",sortOption:l,setSortOption:c,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"min-w-[110px] ",children:i.jsxs("div",{className:"flex justify-end items-center gap-1.5 min-w-[110px] px-1",children:[i.jsx("span",{className:"w-1.5 h-1.5 min-w-1.5 min-h-1.5 bg-[#67FFBD] inline-block rounded-full live-dot"}),i.jsx(gh,{title:"Mark Price",sortKey:"price",sortOption:l,setSortOption:c,isFilterIcon:!0})]})}),i.jsx("th",{scope:"col",className:"min-w-[170px] ",children:i.jsxs("div",{className:"flex justify-end items-center gap-1.5 min-w-[110px] px-1",children:[i.jsx("span",{className:"w-1.5 h-1.5 min-w-1.5 min-h-1.5 bg-[#67FFBD] inline-block rounded-full live-dot"}),i.jsx(gh,{title:"24h Change",sortKey:"change_24h",sortOption:l,setSortOption:c,isFilterIcon:!0})]})}),i.jsx("th",{scope:"col",className:"min-w-[120px] px-1",children:i.jsx(gh,{title:"Long PnL",sortKey:"total_long_pnl",sortOption:l,setSortOption:c,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[110px] px-1",children:i.jsx(gh,{title:"Short PnL",sortKey:"total_short_pnl",sortOption:l,setSortOption:c,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[130px] px-1",children:i.jsx(gh,{title:"Long Notional",sortKey:"long_notional",sortOption:l,setSortOption:c,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[135px] px-1",children:i.jsx(gh,{title:"Short Notional",sortKey:"short_notional",sortOption:l,setSortOption:c,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[135px] px-1",children:i.jsx(gh,{title:"Total Notional",sortKey:"total_notional",sortOption:l,setSortOption:c,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[190px] px-1",children:i.jsx(gh,{title:"Long/Short Ratio",sortKey:"long_ratio",sortOption:l,setSortOption:c,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[130px] px-1",children:i.jsx(gh,{title:"Traders (L/S)",sortKey:"traders_l_s",sortOption:l,setSortOption:c,isFilterIcon:!0})}),i.jsx("th",{scope:"col",className:"min-w-[140px] pl-1 pr-4",children:i.jsx(gh,{title:"Open Interest",sortKey:"open_interest",sortOption:l,setSortOption:c,isFilterIcon:!0})})]})}),i.jsx("tbody",{children:!e.data||t?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:X(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center -mt-16 ml-[45%] w-max",children:i.jsx(Ma,{})})})}):n&&!e.data?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:X(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[26vh] sm:min-h-[50vh] flex-col justify-center items-center ml-[18%] sm:ml-[25%] md:ml-[39%] w-max",children:i.jsx(Ml,{})})})}):((ne=e.data)==null?void 0:ne.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:X(window.innerWidth),children:i.jsx("div",{className:"flex min-h-[26vh] sm:min-h-[50vh] flex-col justify-center items-center ml-[18%] sm:ml-[25%] md:ml-[39%] w-max",children:i.jsx(CUe,{})})})}):(J=w(l))==null?void 0:J.map((Z,re)=>{var he,Y,ie,oe,G,V,ee,ae,fe,Ae,ce,ye,Ne,be,je,Ie,Re,Qe;return i.jsx(Se.Fragment,{children:i.jsxs("tr",{className:`${re%2===0,"bg-[#161616]"} relative group hover:bg-[#222222] h-[56px] border-b border-[#232323] text-white`,children:[i.jsx("td",{scope:"row",onClick:()=>{window.open(`/terminal/${Z==null?void 0:Z.asset}`,"_blank")},className:`${re%2==0,"bg-[#161616]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222] cursor-pointer`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2.5 pl-2 h-14 max-h-14",children:i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${L[Z==null?void 0:Z.asset]||((he=Z==null?void 0:Z.asset)==null?void 0:he.split("/")[0])}.svg`||dummyImage,alt:Z==null?void 0:Z.asset,className:"rounded-full w-5 h-5 min-w-5 min-h-5 bg-gray-700",loading:"lazy",onError:Be=>sm(Be)}),i.jsx(qx,{info:Z!=null&&Z.asset?Z==null?void 0:Z.asset:"--",textColor:"text-white"}),i.jsx("div",{className:"flex justify-center items-center rounded",children:i.jsx("img",{src:cm,alt:"",className:"w-[12px] h-[12px] min-w-[12px] min-h-[12px]"})})]})})}),i.jsx("td",{children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-8 max-h-8",children:i.jsxs("div",{className:`${Z.majority_side=="LONG"?"text-[#67ffbd] bg-[#67ffbd]/20":Z.majority_side=="SHORT"?"text-[#ff787b] bg-[#ff797c]/20":"text-[#67ffbd] bg-[#67ffbd]/20"} h-5 pl-1 pr-1.5 py-1  rounded-md justify-start items-center gap-0.5 inline-flex`,children:[i.jsx("div",{className:"w-3 h-3 justify-center items-center flex",children:i.jsx("div",{className:"w-3 h-3 relative",children:Z.majority_side=="LONG"?i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):Z.majority_side=="SHORT"?i.jsx(Es,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-3 h-3"})})}),i.jsx("div",{className:" text-[11px] font-semibold font-manrope leading-[8px] tracking-wide",children:Z.majority_side?Z.majority_side:"--"})]})})}),i.jsx("td",{className:"px-1",children:i.jsx(U,{coin:Z==null?void 0:Z.asset,price:(Y=Z==null?void 0:Z.asset_change24h)==null?void 0:Y.markPx,prevPricesRef:f})}),i.jsx("td",{className:"px-1",children:i.jsx(oon,{info:((ie=Z==null?void 0:Z.asset_change24h)==null?void 0:ie.markPx)-((oe=Z==null?void 0:Z.asset_change24h)==null?void 0:oe.prevDayPx)?((G=Z==null?void 0:Z.asset_change24h)==null?void 0:G.markPx)-((V=Z==null?void 0:Z.asset_change24h)==null?void 0:V.prevDayPx)>0?"+"+Math.abs(parseFloat(((ee=Z==null?void 0:Z.asset_change24h)==null?void 0:ee.markPx)-((ae=Z==null?void 0:Z.asset_change24h)==null?void 0:ae.prevDayPx)).toFixed(5)):"-"+Math.abs(parseFloat(((fe=Z==null?void 0:Z.asset_change24h)==null?void 0:fe.markPx)-((Ae=Z==null?void 0:Z.asset_change24h)==null?void 0:Ae.prevDayPx)).toFixed(5)):z(),info_2:(((ce=Z==null?void 0:Z.asset_change24h)==null?void 0:ce.markPx)-((ye=Z==null?void 0:Z.asset_change24h)==null?void 0:ye.prevDayPx))/((Ne=Z==null?void 0:Z.asset_change24h)==null?void 0:Ne.prevDayPx)*100,color_1:`${((be=Z==null?void 0:Z.asset_change24h)==null?void 0:be.markPx)-((je=Z==null?void 0:Z.asset_change24h)==null?void 0:je.prevDayPx)>=0?"text-[#1DE6A3]":"text-[#FF7173]"}`,color_2:`${(((Ie=Z==null?void 0:Z.asset_change24h)==null?void 0:Ie.markPx)-((Re=Z==null?void 0:Z.asset_change24h)==null?void 0:Re.prevDayPx))/((Qe=Z==null?void 0:Z.asset_change24h)==null?void 0:Qe.prevDayPx)*100>0?"text-[#1DE6A3]":"text-[#FF7173]"}`})}),i.jsx("td",{className:"px-1",children:i.jsx(qx,{info:(Z==null?void 0:Z.total_long_pnl)==null||isNaN(parseFloat(Z==null?void 0:Z.total_long_pnl))?"--":`$${Ku(Math.abs(Z==null?void 0:Z.total_long_pnl))}`,textColor:`${(Z==null?void 0:Z.total_long_pnl)==null||isNaN(parseFloat(Z==null?void 0:Z.total_long_pnl))||(Z==null?void 0:Z.total_long_pnl)==0?"text-white":(Z==null?void 0:Z.total_long_pnl)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`})}),i.jsx("td",{className:"px-1",children:i.jsx(qx,{info:(Z==null?void 0:Z.total_short_pnl)==null||isNaN(parseFloat(Z==null?void 0:Z.total_short_pnl))?"--":`$${Ku(Math.abs(Z==null?void 0:Z.total_short_pnl))}`,textColor:`${(Z==null?void 0:Z.total_short_pnl)==null||isNaN(parseFloat(Z==null?void 0:Z.total_short_pnl))||(Z==null?void 0:Z.total_short_pnl)==0?"text-white":(Z==null?void 0:Z.total_short_pnl)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`})}),i.jsx("td",{className:"px-1",children:i.jsx(qx,{info:(Z==null?void 0:Z.long_notional)==null||isNaN(parseFloat(Z==null?void 0:Z.long_notional))?"--":`$${Ku(Z==null?void 0:Z.long_notional)}`,textColor:"text-white"})}),i.jsx("td",{className:"px-1",children:i.jsx(qx,{info:(Z==null?void 0:Z.short_notional)==null||isNaN(parseFloat(Z==null?void 0:Z.short_notional))?"--":`$${Ku(Z==null?void 0:Z.short_notional)}`,textColor:"text-white"})}),i.jsx("td",{className:"px-1",children:i.jsx(qx,{info:(Z==null?void 0:Z.total_notional)==null||isNaN(parseFloat(Z==null?void 0:Z.total_notional))?"--":`$${Ku(Z==null?void 0:Z.total_notional)}`,textColor:"text-white"})}),i.jsx("td",{className:"",children:i.jsx("div",{className:"flex justify-end w-full",children:i.jsx("div",{className:"flex justify-end w-full max-w-[150px]",children:i.jsx(Fne,{data_1:Z!=null&&Z.long_ratio?parseFloat(Z==null?void 0:Z.long_ratio).toFixed(2):0,data_2:Z!=null&&Z.short_ratio?parseFloat(Z==null?void 0:Z.short_ratio).toFixed(2):0,margin:"false"})})})}),i.jsx("td",{className:"px-1",children:i.jsx(qx,{info:Z!=null&&Z.traders_l_s?Z==null?void 0:Z.traders_l_s:"--",textColor:"text-white"})}),i.jsx("td",{className:"pr-4",children:i.jsx(qx,{info:(Z==null?void 0:Z.open_interest)==null||isNaN(parseFloat(Z==null?void 0:Z.open_interest))?"--":`$${Ku(Z==null?void 0:Z.open_interest)}`,textColor:"text-white"})})]})},re)})})]})})]})]})})},qx=({info:e,textColor:t})=>i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:`${t} text-sm font-semibold font-manrope leading-none flex items-center justify-start px-1 gap-0.5`,children:e})}),oon=({info:e,info_2:t,color_1:n,color_2:r})=>i.jsx("div",{className:"flex justify-end items-center gap-0.5",children:t?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:`${n} text-sm font-semibold font-manrope leading-none flex items-center justify-start px-1 gap-0.5`,children:e}),i.jsx("div",{className:`${n} flex justify-center items-center max-h-2`,children:e?"/":""}),i.jsx("div",{className:`${r} text-sm font-semibold font-manrope leading-none flex items-center justify-start px-1 gap-0.5`,children:`${t>0?"+":"-"}${parseFloat(t).toFixed(2)}%`})]}):i.jsx("div",{className:`${n} text-sm font-semibold font-manrope leading-none flex items-center justify-start px-1 gap-0.5`,children:e})}),eX=({title:e,set_click:t,tableSortButton:n})=>i.jsx("div",{onClick:t,className:`${n==e?"bg-[#3d3d3d]  text-white":"bg-[#161616] text-[#9b9b9b]"} text-[13px] font-medium font-manrope leading-[8px] cursor-pointer flex justify-center items-center min-w-max rounded-md px-[6px] sm:px-[10px] h-7`,children:e}),lon=()=>{Yr();const{setTelegramChatId:e,setSubscriberRole:t,setSubsExpireDay:n,setMushboomerETH:r,setIsWhitelist:s,setMushboomerSOL:a,setIsReferralCode:o,setIsReferralCodeName:l,setHyperToken:c,setHyperAddress:u,hyperToken:d}=m.useContext(Gr),[f,x]=m.useState([]),[g,v]=m.useState(!1),[w,C]=m.useState(null),N=[{index:0,name:"1D",value:1},{index:1,name:"7D",value:7},{index:2,name:"30D",value:30},{index:3,name:"90D",value:90}],I=parseInt(localStorage.getItem("ticker_period")),P=!isNaN(I)&&N[I]?N[I].value:N[1].value,[R,F]=m.useState(P),U=z=>{F(Number(z)),localStorage.setItem("ticker_period",N.findIndex(X=>X.value===Number(z)).toFixed(0))},L=async()=>{try{v(!0);const X=await fetch("https://dextradata.nftinit.io/api/hyper/analytics_v2/",{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(!X.ok)throw new Error("Network response was not ok");const ne=await X.json();ne!=null&&ne.success?(x(ne),v(!1)):(v(!1),C(ne==null?void 0:ne.error_message),console.error("Error fetching analytics data:",ne==null?void 0:ne.error_message))}catch(z){setError(z.message),v(!1),console.error("Error fetching analytics data:",z)}finally{v(!1)}};return m.useEffect(()=>{L()},[]),m.useEffect(()=>{const z=new WebSocket("wss://api-ui.hyperliquid.xyz/ws");z.onopen=()=>{z.send(JSON.stringify({method:"subscribe",subscription:{type:"webData2",user:"0x0000000000000000000000000000000000000000"}}))},z.onmessage=J=>{var re;const Z=JSON.parse(J==null?void 0:J.data);if(Z.channel==="webData2"){const he=Z.data,Y=he.assetCtxs,ie=(re=he.meta)==null?void 0:re.universe;if(Array.isArray(Y)&&Array.isArray(ie)){const oe=Y.map((G,V)=>{var ee;return{...G,name:((ee=ie[V])==null?void 0:ee.name)??null}});x(G=>{if(!G||!Array.isArray(G.data))return G;const V=G.data.map(ee=>{const ae=oe.find(fe=>fe.name===ee.asset);return ae?{...ee,asset_change24h:ae}:ee});return{...G,data:V}})}else console.error("missing assetCtxs or universe:",{assetCtxs:Y,universe:ie})}};const X=()=>{z.readyState===WebSocket.OPEN&&z.send(JSON.stringify({method:"unsubscribe",subscription:{type:"webData2",user:"0x0000000000000000000000000000000000000000"}})),z.close()},ne=()=>{X(),window.removeEventListener("beforeunload",X)};return window.addEventListener("beforeunload",X),ne},[]),m.useEffect(()=>{(async()=>{var J,Z;const X=window.localStorage.getItem("hyperToken"),ne=window.localStorage.getItem("hyperAddress");if(!(!X||!ne))try{const re=await Si(ne.toLowerCase(),X);re!=null&&re.success?(e(re==null?void 0:re.telegram_chat_id),t(re==null?void 0:re.subscriber_role),n(re==null?void 0:re.subs_expire_day),r((J=re==null?void 0:re.mushboomer_counts)==null?void 0:J.eth),a((Z=re==null?void 0:re.mushboomer_counts)==null?void 0:Z.sol),o(re==null?void 0:re.referral_code),l(re==null?void 0:re.refcode),s(re==null?void 0:re.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),c(""),u(""))}catch(re){console.error("Token verification error:",re)}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(Io,{children:i.jsx($o,{children:i.jsxs(i.Fragment,{children:[i.jsx("title",{children:"Real-time Crypto Positions Tracker | Top Hyperliquid Traders | Dextrabot"}),i.jsx("meta",{name:"description",content:"Track real-time positions of top-performing Hyperliquid traders by cryptocurrency. View live long/short exposure, trading volumes, and performance metrics for BTC, ETH, SOL and more. Copy profitable strategies instantly."}),i.jsx("meta",{property:"og:title",content:"Real-time Crypto Positions Tracker | Top Hyperliquid Traders | Dextrabot"}),i.jsx("meta",{property:"og:description",content:"Track real-time positions of top-performing Hyperliquid traders by cryptocurrency. View live long/short exposure, trading volumes, and performance metrics for BTC, ETH, SOL and more. Copy profitable strategies instantly."}),i.jsx("meta",{property:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{property:"og:url",content:"https://app.dextrabot.com/ticker"})]})})}),i.jsx("div",{className:"flex justify-center items-center w-full h-[calc(100vh-65px)] sm:h-[calc(100vh-80px)] px-1 pt-1 sm:px-6 sm:pt-3 bg-[#161616] overflow-hidden",children:i.jsx("div",{className:"flex flex-col items-stretch justify-center h-full gap-[26px] w-full flex-grow xl:flex-grow-0",children:i.jsx(aon,{data:f,loading:g,error:w,period:R,periods:N,handlePeriodChange:U})})})]})},Vce=m.createContext({});function Wce(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const qce=typeof window<"u",QUe=qce?m.useLayoutEffect:m.useEffect,fU=m.createContext(null),UP=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function con(e,t){let n=new Set,r=new Set,s=!1,a=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(d){o.has(d)&&(u.schedule(d),e()),d(l)}const u={schedule:(d,f=!1,x=!1)=>{const v=x&&s?n:r;return f&&o.add(d),v.has(d)||v.add(d),d},cancel:d=>{r.delete(d),o.delete(d)},process:d=>{if(l=d,s){a=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),n.clear(),s=!1,a&&(a=!1,u.process(d))}};return u}const uon=40;function ZUe(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=UP.reduce((P,R)=>(P[R]=con(a),P),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:d,update:f,preRender:x,render:g,postRender:v}=o,w=()=>{const P=kc.useManualTiming?s.timestamp:performance.now();n=!1,kc.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(P-s.timestamp,uon),1)),s.timestamp=P,s.isProcessing=!0,l.process(s),c.process(s),u.process(s),d.process(s),f.process(s),x.process(s),g.process(s),v.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(w))},C=()=>{n=!0,r=!0,s.isProcessing||e(w)};return{schedule:UP.reduce((P,R)=>{const F=o[R];return P[R]=(U,L=!1,z=!1)=>(n||C(),F.schedule(U,L,z)),P},{}),cancel:P=>{for(let R=0;R<UP.length;R++)o[UP[R]].cancel(P)},state:s,steps:o}}const{schedule:ko,cancel:qy,state:Vc,steps:tX}=ZUe(typeof requestAnimationFrame<"u"?requestAnimationFrame:rl,!0);let wO;function don(){wO=void 0}const qd={now:()=>(wO===void 0&&qd.set(Vc.isProcessing||kc.useManualTiming?Vc.timestamp:performance.now()),wO),set:e=>{wO=e,queueMicrotask(don)}},JUe=e=>t=>typeof t=="string"&&t.startsWith(e),Gce=JUe("--"),fon=JUe("var(--"),Kce=e=>fon(e)?hon.test(e.split("/*")[0].trim()):!1,hon=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,s8={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},D_={...s8,transform:e=>_c(0,1,e)},zP={...s8,default:1},u9=e=>Math.round(e*1e5)/1e5,Yce=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function pon(e){return e==null}const mon=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Xce=(e,t)=>n=>!!(typeof n=="string"&&mon.test(n)&&n.startsWith(e)||t&&!pon(n)&&Object.prototype.hasOwnProperty.call(n,t)),eze=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,a,o,l]=r.match(Yce);return{[e]:parseFloat(s),[t]:parseFloat(a),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},xon=e=>_c(0,255,e),nX={...s8,transform:e=>Math.round(xon(e))},aw={test:Xce("rgb","red"),parse:eze("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+nX.transform(e)+", "+nX.transform(t)+", "+nX.transform(n)+", "+u9(D_.transform(r))+")"};function gon(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const One={test:Xce("#"),parse:gon,transform:aw.transform},pT=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Cb=pT("deg"),B0=pT("%"),ni=pT("px"),bon=pT("vh"),yon=pT("vw"),PCe={...B0,parse:e=>B0.parse(e)/100,transform:e=>B0.transform(e*100)},$C={test:Xce("hsl","hue"),parse:eze("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+B0.transform(u9(t))+", "+B0.transform(u9(n))+", "+u9(D_.transform(r))+")"},Il={test:e=>aw.test(e)||One.test(e)||$C.test(e),parse:e=>aw.test(e)?aw.parse(e):$C.test(e)?$C.parse(e):One.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?aw.transform(e):$C.transform(e),getAnimatableNone:e=>{const t=Il.parse(e);return t.alpha=0,Il.transform(t)}},von=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function won(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Yce))==null?void 0:t.length)||0)+(((n=e.match(von))==null?void 0:n.length)||0)>0}const tze="number",nze="color",Con="var",Son="var(",FCe="${}",Non=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function B_(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let a=0;const l=t.replace(Non,c=>(Il.test(c)?(r.color.push(a),s.push(nze),n.push(Il.parse(c))):c.startsWith(Son)?(r.var.push(a),s.push(Con),n.push(c)):(r.number.push(a),s.push(tze),n.push(parseFloat(c))),++a,FCe)).split(FCe);return{values:n,split:l,indexes:r,types:s}}function rze(e){return B_(e).values}function sze(e){const{split:t,types:n}=B_(e),r=t.length;return s=>{let a="";for(let o=0;o<r;o++)if(a+=t[o],s[o]!==void 0){const l=n[o];l===tze?a+=u9(s[o]):l===nze?a+=Il.transform(s[o]):a+=s[o]}return a}}const Aon=e=>typeof e=="number"?0:Il.test(e)?Il.getAnimatableNone(e):e;function jon(e){const t=rze(e);return sze(e)(t.map(Aon))}const Gy={test:won,parse:rze,createTransformer:sze,getAnimatableNone:jon};function rX(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Eon({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,a=0,o=0;if(!t)s=a=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;s=rX(c,l,e+1/3),a=rX(c,l,e),o=rX(c,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function qL(e,t){return n=>n>0?t:e}const Do=(e,t,n)=>e+(t-e)*n,sX=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},_on=[One,aw,$C],kon=e=>_on.find(t=>t.test(e));function OCe(e){const t=kon(e);if(!t)return!1;let n=t.parse(e);return t===$C&&(n=Eon(n)),n}const MCe=(e,t)=>{const n=OCe(e),r=OCe(t);if(!n||!r)return qL(e,t);const s={...n};return a=>(s.red=sX(n.red,r.red,a),s.green=sX(n.green,r.green,a),s.blue=sX(n.blue,r.blue,a),s.alpha=Do(n.alpha,r.alpha,a),aw.transform(s))},Mne=new Set(["none","hidden"]);function Ton(e,t){return Mne.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Ion(e,t){return n=>Do(e,t,n)}function Qce(e){return typeof e=="number"?Ion:typeof e=="string"?Kce(e)?qL:Il.test(e)?MCe:Oon:Array.isArray(e)?ize:typeof e=="object"?Il.test(e)?MCe:Pon:qL}function ize(e,t){const n=[...e],r=n.length,s=e.map((a,o)=>Qce(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)n[o]=s[o](a);return n}}function Pon(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Qce(e[s])(e[s],t[s]));return s=>{for(const a in r)n[a]=r[a](s);return n}}function Fon(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const a=t.types[s],o=e.indexes[a][r[a]],l=e.values[o]??0;n[s]=l,r[a]++}return n}const Oon=(e,t)=>{const n=Gy.createTransformer(t),r=B_(e),s=B_(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Mne.has(e)&&!s.values.length||Mne.has(t)&&!r.values.length?Ton(e,t):ix(ize(Fon(r,s),s.values),n):qL(e,t)};function aze(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Do(e,t,n):Qce(e)(e,t)}const Mon=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ko.update(t,n),stop:()=>qy(t),now:()=>Vc.isProcessing?Vc.timestamp:qd.now()}},oze=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let a=0;a<s;a++)r+=Math.round(e(a/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},GL=2e4;function Zce(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<GL;)t+=n,r=e.next(t);return t>=GL?1/0:t}function Ron(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Zce(r),GL);return{type:"keyframes",ease:a=>r.next(s*a).value/t,duration:Jo(s)}}const Lon=5;function lze(e,t,n){const r=Math.max(t-Lon,0);return DD(n-e(r),t-r)}const Xo={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},RCe=.001;function Don({duration:e=Xo.duration,bounce:t=Xo.bounce,velocity:n=Xo.velocity,mass:r=Xo.mass}){let s,a,o=1-t;o=_c(Xo.minDamping,Xo.maxDamping,o),e=_c(Xo.minDuration,Xo.maxDuration,Jo(e)),o<1?(s=u=>{const d=u*o,f=d*e,x=d-n,g=Rne(u,o),v=Math.exp(-f);return RCe-x/g*v},a=u=>{const f=u*o*e,x=f*n+n,g=Math.pow(o,2)*Math.pow(u,2)*e,v=Math.exp(-f),w=Rne(Math.pow(u,2),o);return(-s(u)+RCe>0?-1:1)*((x-g)*v)/w}):(s=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-.001+d*f},a=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=$on(s,a,l);if(e=Rl(e),isNaN(c))return{stiffness:Xo.stiffness,damping:Xo.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const Bon=12;function $on(e,t,n){let r=n;for(let s=1;s<Bon;s++)r=r-e(r)/t(r);return r}function Rne(e,t){return e*Math.sqrt(1-t*t)}const Uon=["duration","bounce"],zon=["stiffness","damping","mass"];function LCe(e,t){return t.some(n=>e[n]!==void 0)}function Hon(e){let t={velocity:Xo.velocity,stiffness:Xo.stiffness,damping:Xo.damping,mass:Xo.mass,isResolvedFromDuration:!1,...e};if(!LCe(e,zon)&&LCe(e,Uon))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,a=2*_c(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Xo.mass,stiffness:s,damping:a}}else{const n=Don(e);t={...t,...n,mass:Xo.mass},t.isResolvedFromDuration=!0}return t}function KL(e=Xo.visualDuration,t=Xo.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:a},{stiffness:c,damping:u,mass:d,duration:f,velocity:x,isResolvedFromDuration:g}=Hon({...n,velocity:-Jo(n.velocity||0)}),v=x||0,w=u/(2*Math.sqrt(c*d)),C=o-a,N=Jo(Math.sqrt(c/d)),I=Math.abs(C)<5;r||(r=I?Xo.restSpeed.granular:Xo.restSpeed.default),s||(s=I?Xo.restDelta.granular:Xo.restDelta.default);let P;if(w<1){const F=Rne(N,w);P=U=>{const L=Math.exp(-w*N*U);return o-L*((v+w*N*C)/F*Math.sin(F*U)+C*Math.cos(F*U))}}else if(w===1)P=F=>o-Math.exp(-N*F)*(C+(v+N*C)*F);else{const F=N*Math.sqrt(w*w-1);P=U=>{const L=Math.exp(-w*N*U),z=Math.min(F*U,300);return o-L*((v+w*N*C)*Math.sinh(z)+F*C*Math.cosh(z))/F}}const R={calculatedDuration:g&&f||null,next:F=>{const U=P(F);if(g)l.done=F>=f;else{let L=F===0?v:0;w<1&&(L=F===0?Rl(v):lze(P,F,U));const z=Math.abs(L)<=r,X=Math.abs(o-U)<=s;l.done=z&&X}return l.value=l.done?o:U,l},toString:()=>{const F=Math.min(Zce(R),GL),U=oze(L=>R.next(F*L).value,F,30);return F+"ms "+U},toTransition:()=>{}};return R}KL.applyToOptions=e=>{const t=Ron(e,100,KL);return e.ease=t.ease,e.duration=Rl(t.duration),e.type="keyframes",e};function Lne({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:a=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],x={done:!1,value:f},g=z=>l!==void 0&&z<l||c!==void 0&&z>c,v=z=>l===void 0?c:c===void 0||Math.abs(l-z)<Math.abs(c-z)?l:c;let w=n*t;const C=f+w,N=o===void 0?C:o(C);N!==C&&(w=N-f);const I=z=>-w*Math.exp(-z/r),P=z=>N+I(z),R=z=>{const X=I(z),ne=P(z);x.done=Math.abs(X)<=u,x.value=x.done?N:ne};let F,U;const L=z=>{g(x.value)&&(F=z,U=KL({keyframes:[x.value,v(x.value)],velocity:lze(P,z,x.value),damping:s,stiffness:a,restDelta:u,restSpeed:d}))};return L(0),{calculatedDuration:null,next:z=>{let X=!1;return!U&&F===void 0&&(X=!0,R(z),L(z)),F!==void 0&&z>=F?U.next(z-F):(!X&&R(z),x)}}}function Von(e,t,n){const r=[],s=n||kc.mix||aze,a=e.length-1;for(let o=0;o<a;o++){let l=s(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||rl:t;l=ix(c,l)}r.push(l)}return r}function Won(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const a=e.length;if(AS(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=Von(t,r,s),c=l.length,u=d=>{if(o&&d<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(d<e[f+1]);f++);const x=H0(e[f],e[f+1],d);return l[f](x)};return n?d=>u(_c(e[0],e[a-1],d)):u}function qon(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=H0(0,t,r);e.push(Do(n,1,s))}}function Gon(e){const t=[0];return qon(t,e.length-1),t}function Kon(e,t){return e.map(n=>n*t)}function Yon(e,t){return e.map(()=>t||fse).splice(0,e.length-1)}function d9({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=g8e(r)?r.map(zO):zO(r),a={done:!1,value:t[0]},o=Kon(n&&n.length===t.length?n:Gon(t),e),l=Won(o,t,{ease:Array.isArray(s)?s:Yon(t,s)});return{calculatedDuration:e,next:c=>(a.value=l(c),a.done=c>=e,a)}}const Xon=e=>e!==null;function Jce(e,{repeat:t,repeatType:n="loop"},r,s=1){const a=e.filter(Xon),l=s<0||t&&n!=="loop"&&t%2===1?0:a.length-1;return!l||r===void 0?a[l]:r}const Qon={decay:Lne,inertia:Lne,tween:d9,keyframes:d9,spring:KL};function cze(e){typeof e.type=="string"&&(e.type=Qon[e.type])}class eue{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const Zon=e=>e/100;class tue extends eue{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==qd.now()&&this.tick(qd.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;cze(t);const{type:n=d9,repeat:r=0,repeatDelay:s=0,repeatType:a,velocity:o=0}=t;let{keyframes:l}=t;const c=n||d9;c!==d9&&typeof l[0]!="number"&&(this.mixKeyframes=ix(Zon,aze(l[0],l[1])),l=[0,100]);const u=c({...t,keyframes:l});a==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...l].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Zce(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:f,repeatType:x,repeatDelay:g,type:v,onUpdate:w,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const N=this.currentTime-u*(this.playbackSpeed>=0?1:-1),I=this.playbackSpeed>=0?N<0:N>s;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let P=this.currentTime,R=r;if(f){const z=Math.min(this.currentTime,s)/l;let X=Math.floor(z),ne=z%1;!ne&&z>=1&&(ne=1),ne===1&&X--,X=Math.min(X,f+1),!!(X%2)&&(x==="reverse"?(ne=1-ne,g&&(ne-=g/l)):x==="mirror"&&(R=o)),P=_c(0,1,ne)*l}const F=I?{done:!1,value:d[0]}:R.next(P);a&&(F.value=a(F.value));let{done:U}=F;!I&&c!==null&&(U=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&U);return L&&v!==Lne&&(F.value=Jce(d,this.options,C,this.speed)),w&&w(F.value),L&&this.finish(),F}then(t,n){return this.finished.then(t,n)}get duration(){return Jo(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Jo(t)}get time(){return Jo(this.currentTime)}set time(t){var n;t=Rl(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(qd.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Jo(this.currentTime))}play(){var s,a;if(this.isStopped)return;const{driver:t=Mon,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(a=(s=this.options).onPlay)==null||a.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(qd.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function Jon(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ow=e=>e*180/Math.PI,Dne=e=>{const t=ow(Math.atan2(e[1],e[0]));return Bne(t)},eln={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Dne,rotateZ:Dne,skewX:e=>ow(Math.atan(e[1])),skewY:e=>ow(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Bne=e=>(e=e%360,e<0&&(e+=360),e),DCe=Dne,BCe=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),$Ce=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),tln={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:BCe,scaleY:$Ce,scale:e=>(BCe(e)+$Ce(e))/2,rotateX:e=>Bne(ow(Math.atan2(e[6],e[5]))),rotateY:e=>Bne(ow(Math.atan2(-e[2],e[0]))),rotateZ:DCe,rotate:DCe,skewX:e=>ow(Math.atan(e[4])),skewY:e=>ow(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function $ne(e){return e.includes("scale")?1:0}function Une(e,t){if(!e||e==="none")return $ne(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=tln,s=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=eln,s=l}if(!s)return $ne(t);const a=r[t],o=s[1].split(",").map(rln);return typeof a=="function"?a(o):o[a]}const nln=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Une(n,t)};function rln(e){return parseFloat(e.trim())}const i8=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],a8=new Set(i8),UCe=e=>e===s8||e===ni,sln=new Set(["x","y","z"]),iln=i8.filter(e=>!sln.has(e));function aln(e){const t=[];return iln.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const a3={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Une(t,"x"),y:(e,{transform:t})=>Une(t,"y")};a3.translateX=a3.x;a3.translateY=a3.y;const o3=new Set;let zne=!1,Hne=!1,Vne=!1;function uze(){if(Hne){const e=Array.from(o3).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=aln(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([a,o])=>{var l;(l=r.getValue(a))==null||l.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Hne=!1,zne=!1,o3.forEach(e=>e.complete(Vne)),o3.clear()}function dze(){o3.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Hne=!0)})}function oln(){Vne=!0,dze(),uze(),Vne=!1}class nue{constructor(t,n,r,s,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(o3.add(this),zne||(zne=!0,ko.read(dze),ko.resolveKeyframes(uze))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const a=s==null?void 0:s.get(),o=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const l=r.readValue(n,o);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=o),s&&a===void 0&&s.set(t[0])}Jon(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),o3.delete(this)}cancel(){this.state==="scheduled"&&(o3.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const lln=e=>e.startsWith("--");function cln(e,t,n){lln(t)?e.style.setProperty(t,n):e.style[t]=n}const uln=aA(()=>window.ScrollTimeline!==void 0),dln={};function fln(e,t){const n=aA(e);return()=>dln[t]??n()}const fze=fln(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ij=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,zCe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ij([0,.65,.55,1]),circOut:Ij([.55,0,1,.45]),backIn:Ij([.31,.01,.66,-.59]),backOut:Ij([.33,1.53,.69,.99])};function hze(e,t){if(e)return typeof e=="function"?fze()?oze(e,t):"ease-out":hse(e)?Ij(e):Array.isArray(e)?e.map(n=>hze(n,t)||zCe.easeOut):zCe[e]}function hln(e,t,n,{delay:r=0,duration:s=300,repeat:a=0,repeatType:o="loop",ease:l="easeOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const f=hze(l,s);Array.isArray(f)&&(d.easing=f);const x={delay:r,duration:s,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return u&&(x.pseudoElement=u),e.animate(d,x)}function pze(e){return typeof e=="function"&&"applyToOptions"in e}function pln({type:e,...t}){return pze(e)&&fze()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class mln extends eue{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=t;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=t,AS(typeof t.type!="string");const u=pln(t);this.animation=hln(n,r,s,u,a),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const d=Jce(s,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(d):cln(n,r,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Jo(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Jo(t)}get time(){return Jo(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Rl(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&uln()?(this.animation.timeline=t,rl):n(this)}}const mze={anticipate:lse,backInOut:ose,circInOut:dse};function xln(e){return e in mze}function gln(e){typeof e.ease=="string"&&xln(e.ease)&&(e.ease=mze[e.ease])}const HCe=10;class bln extends mln{constructor(t){gln(t),cze(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:a,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new tue({...o,autoplay:!1}),c=Rl(this.finishedTime??this.time);n.setWithVelocity(l.sample(c-HCe).value,l.sample(c).value,HCe),l.stop()}}const VCe=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Gy.test(e)||e==="0")&&!e.startsWith("url("));function yln(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function vln(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=VCe(s,t),l=VCe(a,t);return!o||!l?!1:yln(e)||(n==="spring"||pze(n))&&r}function Wne(e){e.duration=0,e.type="keyframes"}const wln=new Set(["opacity","clipPath","filter","transform"]),Cln=aA(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Sln(e){var d;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:a,type:o}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return Cln()&&n&&wln.has(n)&&(n!=="transform"||!u)&&!c&&!r&&s!=="mirror"&&a!==0&&o!=="inertia"}const Nln=40;class Aln extends eue{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:a=0,repeatType:o="loop",keyframes:l,name:c,motionValue:u,element:d,...f}){var v;super(),this.stop=()=>{var w,C;this._animation&&(this._animation.stop(),(w=this.stopTimeline)==null||w.call(this)),(C=this.keyframeResolver)==null||C.cancel()},this.createdAt=qd.now();const x={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:a,repeatType:o,name:c,motionValue:u,element:d,...f},g=(d==null?void 0:d.KeyframeResolver)||nue;this.keyframeResolver=new g(l,(w,C,N)=>this.onKeyframesResolved(w,C,x,!N),c,u,d),(v=this.keyframeResolver)==null||v.scheduleResolve()}onKeyframesResolved(t,n,r,s){this.keyframeResolver=void 0;const{name:a,type:o,velocity:l,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=qd.now(),vln(t,a,o,l)||((kc.instantAnimations||!c)&&(d==null||d(Jce(t,r,n))),t[0]=t[t.length-1],Wne(r),r.repeat=0);const x={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>Nln?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},g=!u&&Sln(x)?new bln({...x,element:x.motionValue.owner.current}):new tue(x);g.finished.then(()=>this.notifyFinished()).catch(rl),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),oln()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const jln=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Eln(e){const t=jln.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function xze(e,t,n=1){const[r,s]=Eln(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return MD(o)?parseFloat(o):o}return Kce(s)?xze(s,t,n+1):s}function rue(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const gze=new Set(["width","height","top","left","right","bottom",...i8]),_ln={test:e=>e==="auto",parse:e=>e},bze=e=>t=>t.test(e),yze=[s8,ni,B0,Cb,yon,bon,_ln],WCe=e=>yze.find(bze(e));function kln(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||LD(e):!0}const Tln=new Set(["brightness","contrast","saturate","opacity"]);function Iln(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Yce)||[];if(!r)return e;const s=n.replace(r,"");let a=Tln.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+s+")"}const Pln=/\b([a-z-]*)\(.*?\)/gu,qne={...Gy,getAnimatableNone:e=>{const t=e.match(Pln);return t?t.map(Iln).join(" "):e}},qCe={...s8,transform:Math.round},Fln={rotate:Cb,rotateX:Cb,rotateY:Cb,rotateZ:Cb,scale:zP,scaleX:zP,scaleY:zP,scaleZ:zP,skew:Cb,skewX:Cb,skewY:Cb,distance:ni,translateX:ni,translateY:ni,translateZ:ni,x:ni,y:ni,z:ni,perspective:ni,transformPerspective:ni,opacity:D_,originX:PCe,originY:PCe,originZ:ni},sue={borderWidth:ni,borderTopWidth:ni,borderRightWidth:ni,borderBottomWidth:ni,borderLeftWidth:ni,borderRadius:ni,radius:ni,borderTopLeftRadius:ni,borderTopRightRadius:ni,borderBottomRightRadius:ni,borderBottomLeftRadius:ni,width:ni,maxWidth:ni,height:ni,maxHeight:ni,top:ni,right:ni,bottom:ni,left:ni,padding:ni,paddingTop:ni,paddingRight:ni,paddingBottom:ni,paddingLeft:ni,margin:ni,marginTop:ni,marginRight:ni,marginBottom:ni,marginLeft:ni,backgroundPositionX:ni,backgroundPositionY:ni,...Fln,zIndex:qCe,fillOpacity:D_,strokeOpacity:D_,numOctaves:qCe},Oln={...sue,color:Il,backgroundColor:Il,outlineColor:Il,fill:Il,stroke:Il,borderColor:Il,borderTopColor:Il,borderRightColor:Il,borderBottomColor:Il,borderLeftColor:Il,filter:qne,WebkitFilter:qne},vze=e=>Oln[e];function wze(e,t){let n=vze(e);return n!==qne&&(n=Gy),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Mln=new Set(["auto","none","0"]);function Rln(e,t,n){let r=0,s;for(;r<e.length&&!s;){const a=e[r];typeof a=="string"&&!Mln.has(a)&&B_(a).values.length&&(s=e[r]),r++}if(s&&n)for(const a of t)e[a]=wze(n,s)}class Lln extends nue{constructor(t,n,r,s,a){super(t,n,r,s,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),Kce(u))){const d=xze(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!gze.has(r)||t.length!==2)return;const[s,a]=t,o=WCe(s),l=WCe(a);if(o!==l)if(UCe(o)&&UCe(l))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else a3[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||kln(t[s]))&&r.push(s);r.length&&Rln(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=a3[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var l;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const a=r.length-1,o=r[a];r[a]=a3[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}}function Dln(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const s=document.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}const Cze=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Sze(e){return RD(e)&&"offsetHeight"in e}const GCe=30,Bln=e=>!isNaN(parseFloat(e));class $ln{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var a;const s=qd.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((a=this.events.change)==null||a.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=qd.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Bln(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new oA);const r=this.events[t].add(n);return t==="change"?()=>{r(),ko.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=qd.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>GCe)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,GCe);return DD(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function WN(e,t){return new $ln(e,t)}const{schedule:iue,cancel:gvn}=ZUe(queueMicrotask,!1),_p={x:!1,y:!1};function Nze(){return _p.x||_p.y}function Uln(e){return e==="x"||e==="y"?_p[e]?null:(_p[e]=!0,()=>{_p[e]=!1}):_p.x||_p.y?null:(_p.x=_p.y=!0,()=>{_p.x=_p.y=!1})}function Aze(e,t){const n=Dln(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function KCe(e){return!(e.pointerType==="touch"||Nze())}function zln(e,t,n={}){const[r,s,a]=Aze(e,n),o=l=>{if(!KCe(l))return;const{target:c}=l,u=t(c,l);if(typeof u!="function"||!c)return;const d=f=>{KCe(f)&&(u(f),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,s)};return r.forEach(l=>{l.addEventListener("pointerenter",o,s)}),a}const jze=(e,t)=>t?e===t?!0:jze(e,t.parentElement):!1,aue=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Hln=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Vln(e){return Hln.has(e.tagName)||e.tabIndex!==-1}const CO=new WeakSet;function YCe(e){return t=>{t.key==="Enter"&&e(t)}}function iX(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Wln=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=YCe(()=>{if(CO.has(n))return;iX(n,"down");const s=YCe(()=>{iX(n,"up")}),a=()=>iX(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function XCe(e){return aue(e)&&!Nze()}function qln(e,t,n={}){const[r,s,a]=Aze(e,n),o=l=>{const c=l.currentTarget;if(!XCe(l))return;CO.add(c);const u=t(c,l),d=(g,v)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",x),CO.has(c)&&CO.delete(c),XCe(g)&&typeof u=="function"&&u(g,{success:v})},f=g=>{d(g,c===window||c===document||n.useGlobalTarget||jze(c,g.target))},x=g=>{d(g,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",x,s)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),Sze(l)&&(l.addEventListener("focus",u=>Wln(u,s)),!Vln(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),a}function Eze(e){return RD(e)&&"ownerSVGElement"in e}function Gln(e){return Eze(e)&&e.tagName==="svg"}const Tu=e=>!!(e&&e.getVelocity),Kln=[...yze,Il,Gy],Yln=e=>Kln.find(bze(e)),oue=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function QCe(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Xln(...e){return t=>{let n=!1;const r=e.map(s=>{const a=QCe(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<r.length;s++){const a=r[s];typeof a=="function"?a():QCe(e[s],null)}}}}function Qln(...e){return m.useCallback(Xln(...e),e)}class Zln extends m.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,s=Sze(r)&&r.offsetWidth||0,a=this.props.sizeRef.current;a.height=n.offsetHeight||0,a.width=n.offsetWidth||0,a.top=n.offsetTop,a.left=n.offsetLeft,a.right=s-a.width-a.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Jln({children:e,isPresent:t,anchorX:n,root:r}){const s=m.useId(),a=m.useRef(null),o=m.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:l}=m.useContext(oue),c=Qln(a,e==null?void 0:e.ref);return m.useInsertionEffect(()=>{const{width:u,height:d,top:f,left:x,right:g}=o.current;if(t||!a.current||!u||!d)return;const v=n==="left"?`left: ${x}`:`right: ${g}`;a.current.dataset.motionPopId=s;const w=document.createElement("style");l&&(w.nonce=l);const C=r??document.head;return C.appendChild(w),w.sheet&&w.sheet.insertRule(`
          [data-motion-pop-id="${s}"] {
            position: absolute !important;
            width: ${u}px !important;
            height: ${d}px !important;
            ${v}px !important;
            top: ${f}px !important;
          }
        `),()=>{C.contains(w)&&C.removeChild(w)}},[t]),i.jsx(Zln,{isPresent:t,childRef:a,sizeRef:o,children:m.cloneElement(e,{ref:c})})}const ecn=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:a,mode:o,anchorX:l,root:c})=>{const u=Wce(tcn),d=m.useId();let f=!0,x=m.useMemo(()=>(f=!1,{id:d,initial:t,isPresent:n,custom:s,onExitComplete:g=>{u.set(g,!0);for(const v of u.values())if(!v)return;r&&r()},register:g=>(u.set(g,!1),()=>u.delete(g))}),[n,u,r]);return a&&f&&(x={...x}),m.useMemo(()=>{u.forEach((g,v)=>u.set(v,!1))},[n]),m.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),o==="popLayout"&&(e=i.jsx(Jln,{isPresent:n,anchorX:l,root:c,children:e})),i.jsx(fU.Provider,{value:x,children:e})};function tcn(){return new Map}function _ze(e=!0){const t=m.useContext(fU);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,a=m.useId();m.useEffect(()=>{if(e)return s(a)},[e]);const o=m.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const HP=e=>e.key||"";function ZCe(e){const t=[];return m.Children.forEach(e,n=>{m.isValidElement(n)&&t.push(n)}),t}const mT=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:a="sync",propagate:o=!1,anchorX:l="left",root:c})=>{const[u,d]=_ze(o),f=m.useMemo(()=>ZCe(e),[e]),x=o&&!u?[]:f.map(HP),g=m.useRef(!0),v=m.useRef(f),w=Wce(()=>new Map),[C,N]=m.useState(f),[I,P]=m.useState(f);QUe(()=>{g.current=!1,v.current=f;for(let U=0;U<I.length;U++){const L=HP(I[U]);x.includes(L)?w.delete(L):w.get(L)!==!0&&w.set(L,!1)}},[I,x.length,x.join("-")]);const R=[];if(f!==C){let U=[...f];for(let L=0;L<I.length;L++){const z=I[L],X=HP(z);x.includes(X)||(U.splice(L,0,z),R.push(z))}return a==="wait"&&R.length&&(U=R),P(ZCe(U)),N(f),null}const{forceRender:F}=m.useContext(Vce);return i.jsx(i.Fragment,{children:I.map(U=>{const L=HP(U),z=o&&!u?!1:f===I||x.includes(L),X=()=>{if(w.has(L))w.set(L,!0);else return;let ne=!0;w.forEach(J=>{J||(ne=!1)}),ne&&(F==null||F(),P(v.current),o&&(d==null||d()),r&&r())};return i.jsx(ecn,{isPresent:z,initial:!g.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:a,root:c,onExitComplete:z?void 0:X,anchorX:l,children:U},L)})})},kze=m.createContext({strict:!1}),JCe={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},qN={};for(const e in JCe)qN[e]={isEnabled:t=>JCe[e].some(n=>!!t[n])};function ncn(e){for(const t in e)qN[t]={...qN[t],...e[t]}}const rcn=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function YL(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||rcn.has(e)}let Tze=e=>!YL(e);function scn(e){typeof e=="function"&&(Tze=t=>t.startsWith("on")?!YL(t):e(t))}try{scn(require("@emotion/is-prop-valid").default)}catch{}function icn(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Tze(s)||n===!0&&YL(s)||!t&&!YL(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const hU=m.createContext({});function pU(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function $_(e){return typeof e=="string"||Array.isArray(e)}const lue=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],cue=["initial",...lue];function mU(e){return pU(e.animate)||cue.some(t=>$_(e[t]))}function Ize(e){return!!(mU(e)||e.variants)}function acn(e,t){if(mU(e)){const{initial:n,animate:r}=e;return{initial:n===!1||$_(n)?n:void 0,animate:$_(r)?r:void 0}}return e.inherit!==!1?t:{}}function ocn(e){const{initial:t,animate:n}=acn(e,m.useContext(hU));return m.useMemo(()=>({initial:t,animate:n}),[e4e(t),e4e(n)])}function e4e(e){return Array.isArray(e)?e.join(" "):e}const U_={};function lcn(e){for(const t in e)U_[t]=e[t],Gce(t)&&(U_[t].isCSSVariable=!0)}function Pze(e,{layout:t,layoutId:n}){return a8.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!U_[e]||e==="opacity")}const ccn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ucn=i8.length;function dcn(e,t,n){let r="",s=!0;for(let a=0;a<ucn;a++){const o=i8[a],l=e[o];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(o.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const u=Cze(l,sue[o]);if(!c){s=!1;const d=ccn[o]||o;r+=`${d}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function uue(e,t,n){const{style:r,vars:s,transformOrigin:a}=e;let o=!1,l=!1;for(const c in t){const u=t[c];if(a8.has(c)){o=!0;continue}else if(Gce(c)){s[c]=u;continue}else{const d=Cze(u,sue[c]);c.startsWith("origin")?(l=!0,a[c]=d):r[c]=d}}if(t.transform||(o||n?r.transform=dcn(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=a;r.transformOrigin=`${c} ${u} ${d}`}}const due=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Fze(e,t,n){for(const r in t)!Tu(t[r])&&!Pze(r,n)&&(e[r]=t[r])}function fcn({transformTemplate:e},t){return m.useMemo(()=>{const n=due();return uue(n,t,e),Object.assign({},n.vars,n.style)},[t])}function hcn(e,t){const n=e.style||{},r={};return Fze(r,n,e),Object.assign(r,fcn(e,t)),r}function pcn(e,t){const n={},r=hcn(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const mcn={offset:"stroke-dashoffset",array:"stroke-dasharray"},xcn={offset:"strokeDashoffset",array:"strokeDasharray"};function gcn(e,t,n=1,r=0,s=!0){e.pathLength=1;const a=s?mcn:xcn;e[a.offset]=ni.transform(-r);const o=ni.transform(t),l=ni.transform(n);e[a.array]=`${o} ${l}`}function Oze(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:a=1,pathOffset:o=0,...l},c,u,d){if(uue(e,l,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:x}=e;f.transform&&(x.transform=f.transform,delete f.transform),(x.transform||f.transformOrigin)&&(x.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),x.transform&&(x.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),s!==void 0&&gcn(f,s,a,o,!1)}const Mze=()=>({...due(),attrs:{}}),Rze=e=>typeof e=="string"&&e.toLowerCase()==="svg";function bcn(e,t,n,r){const s=m.useMemo(()=>{const a=Mze();return Oze(a,t,Rze(r),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};Fze(a,e.style,e),s.style={...a,...s.style}}return s}const ycn=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function fue(e){return typeof e!="string"||e.includes("-")?!1:!!(ycn.indexOf(e)>-1||/[A-Z]/u.test(e))}function vcn(e,t,n,{latestValues:r},s,a=!1){const l=(fue(e)?bcn:pcn)(t,r,s,e),c=icn(t,typeof e=="string",a),u=e!==m.Fragment?{...c,...l,ref:n}:{},{children:d}=t,f=m.useMemo(()=>Tu(d)?d.get():d,[d]);return m.createElement(e,{...u,children:f})}function t4e(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function hue(e,t,n,r){if(typeof t=="function"){const[s,a]=t4e(r);t=t(n!==void 0?n:e.custom,s,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,a]=t4e(r);t=t(n!==void 0?n:e.custom,s,a)}return t}function SO(e){return Tu(e)?e.get():e}function wcn({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:Ccn(n,r,s,e),renderState:t()}}function Ccn(e,t,n,r){const s={},a=r(e,{});for(const x in a)s[x]=SO(a[x]);let{initial:o,animate:l}=e;const c=mU(e),u=Ize(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const f=d?l:o;if(f&&typeof f!="boolean"&&!pU(f)){const x=Array.isArray(f)?f:[f];for(let g=0;g<x.length;g++){const v=hue(e,x[g]);if(v){const{transitionEnd:w,transition:C,...N}=v;for(const I in N){let P=N[I];if(Array.isArray(P)){const R=d?P.length-1:0;P=P[R]}P!==null&&(s[I]=P)}for(const I in w)s[I]=w[I]}}}return s}const Lze=e=>(t,n)=>{const r=m.useContext(hU),s=m.useContext(fU),a=()=>wcn(e,t,r,s);return n?a():Wce(a)};function pue(e,t,n){var a;const{style:r}=e,s={};for(const o in r)(Tu(r[o])||t.style&&Tu(t.style[o])||Pze(o,e)||((a=n==null?void 0:n.getValue(o))==null?void 0:a.liveStyle)!==void 0)&&(s[o]=r[o]);return s}const Scn=Lze({scrapeMotionValuesFromProps:pue,createRenderState:due});function Dze(e,t,n){const r=pue(e,t,n);for(const s in e)if(Tu(e[s])||Tu(t[s])){const a=i8.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[a]=e[s]}return r}const Ncn=Lze({scrapeMotionValuesFromProps:Dze,createRenderState:Mze}),Acn=Symbol.for("motionComponentSymbol");function UC(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function jcn(e,t,n){return m.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):UC(n)&&(n.current=r))},[t])}const mue=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ecn="framerAppearId",Bze="data-"+mue(Ecn),$ze=m.createContext({});function _cn(e,t,n,r,s){var w,C;const{visualElement:a}=m.useContext(hU),o=m.useContext(kze),l=m.useContext(fU),c=m.useContext(oue).reducedMotion,u=m.useRef(null);r=r||o.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:a,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}));const d=u.current,f=m.useContext($ze);d&&!d.projection&&s&&(d.type==="html"||d.type==="svg")&&kcn(u.current,n,s,f);const x=m.useRef(!1);m.useInsertionEffect(()=>{d&&x.current&&d.update(n,l)});const g=n[Bze],v=m.useRef(!!g&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,g))&&((C=window.MotionHasOptimisedAnimation)==null?void 0:C.call(window,g)));return QUe(()=>{d&&(x.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),v.current&&d.animationState&&d.animationState.animateChanges())}),m.useEffect(()=>{d&&(!v.current&&d.animationState&&d.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var N;(N=window.MotionHandoffMarkAsComplete)==null||N.call(window,g)}),v.current=!1),d.enteringChildren=void 0)}),d}function kcn(e,t,n,r){const{layoutId:s,layout:a,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Uze(e.parent)),e.projection.setOptions({layoutId:s,layout:a,alwaysMeasureLayout:!!o||l&&UC(l),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:u})}function Uze(e){if(e)return e.options.allowProjection!==!1?e.projection:Uze(e.parent)}function aX(e,{forwardMotionProps:t=!1}={},n,r){n&&ncn(n);const s=fue(e)?Ncn:Scn;function a(l,c){let u;const d={...m.useContext(oue),...l,layoutId:Tcn(l)},{isStatic:f}=d,x=ocn(l),g=s(l,f);if(!f&&qce){Icn();const v=Pcn(d);u=v.MeasureLayout,x.visualElement=_cn(e,g,d,r,v.ProjectionNode)}return i.jsxs(hU.Provider,{value:x,children:[u&&x.visualElement?i.jsx(u,{visualElement:x.visualElement,...d}):null,vcn(e,l,jcn(g,x.visualElement,c),g,f,t)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const o=m.forwardRef(a);return o[Acn]=e,o}function Tcn({layoutId:e}){const t=m.useContext(Vce).id;return t&&e!==void 0?t+"-"+e:e}function Icn(e,t){m.useContext(kze).strict}function Pcn(e){const{drag:t,layout:n}=qN;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Fcn(e,t){if(typeof Proxy>"u")return aX;const n=new Map,r=(a,o)=>aX(a,o,e,t),s=(a,o)=>r(a,o);return new Proxy(s,{get:(a,o)=>o==="create"?r:(n.has(o)||n.set(o,aX(o,void 0,e,t)),n.get(o))})}function zze({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Ocn({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Mcn(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function oX(e){return e===void 0||e===1}function Gne({scale:e,scaleX:t,scaleY:n}){return!oX(e)||!oX(t)||!oX(n)}function _v(e){return Gne(e)||Hze(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Hze(e){return n4e(e.x)||n4e(e.y)}function n4e(e){return e&&e!=="0%"}function XL(e,t,n){const r=e-n,s=t*r;return n+s}function r4e(e,t,n,r,s){return s!==void 0&&(e=XL(e,s,r)),XL(e,n,r)+t}function Kne(e,t=0,n=1,r,s){e.min=r4e(e.min,t,n,r,s),e.max=r4e(e.max,t,n,r,s)}function Vze(e,{x:t,y:n}){Kne(e.x,t.translate,t.scale,t.originPoint),Kne(e.y,n.translate,n.scale,n.originPoint)}const s4e=.999999999999,i4e=1.0000000000001;function Rcn(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let a,o;for(let l=0;l<s;l++){a=n[l],o=a.projectionDelta;const{visualElement:c}=a.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&HC(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Vze(e,o)),r&&_v(a.latestValues)&&HC(e,a.latestValues))}t.x<i4e&&t.x>s4e&&(t.x=1),t.y<i4e&&t.y>s4e&&(t.y=1)}function zC(e,t){e.min=e.min+t,e.max=e.max+t}function a4e(e,t,n,r,s=.5){const a=Do(e.min,e.max,s);Kne(e,t,n,a,r)}function HC(e,t){a4e(e.x,t.x,t.scaleX,t.scale,t.originX),a4e(e.y,t.y,t.scaleY,t.scale,t.originY)}function Wze(e,t){return zze(Mcn(e.getBoundingClientRect(),t))}function Lcn(e,t,n){const r=Wze(e,n),{scroll:s}=t;return s&&(zC(r.x,s.offset.x),zC(r.y,s.offset.y)),r}const o4e=()=>({translate:0,scale:1,origin:0,originPoint:0}),VC=()=>({x:o4e(),y:o4e()}),l4e=()=>({min:0,max:0}),fl=()=>({x:l4e(),y:l4e()}),Yne={current:null},qze={current:!1};function Dcn(){if(qze.current=!0,!!qce)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Yne.current=e.matches;e.addEventListener("change",t),t()}else Yne.current=!1}const Bcn=new WeakMap;function $cn(e,t,n){for(const r in t){const s=t[r],a=n[r];if(Tu(s))e.addValue(r,s);else if(Tu(a))e.addValue(r,WN(s,{owner:e}));else if(a!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,WN(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const c4e=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ucn{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:a,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=nue,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const x=qd.now();this.renderScheduledAt<x&&(this.renderScheduledAt=x,ko.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=mU(n),this.isVariantNode=Ize(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const x in f){const g=f[x];c[x]!==void 0&&Tu(g)&&g.set(c[x])}}mount(t){var n;this.current=t,Bcn.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,s)=>this.bindToMotionValue(s,r)),qze.current||Dcn(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Yne.current,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),qy(this.notifyUpdate),qy(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=a8.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&ko.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in qN){const n=qN[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fl()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<c4e.length;r++){const s=c4e[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const a="on"+s,o=t[a];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=$cn(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=WN(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(MD(r)||LD(r))?r=parseFloat(r):!Yln(r)&&Gy.test(n)&&(r=wze(t,n)),this.setBaseTarget(t,Tu(r)?r.get():r)),Tu(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var a;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=hue(this.props,n,(a=this.presenceContext)==null?void 0:a.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Tu(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new oA),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){iue.render(this.render)}}class Gze extends Ucn{constructor(){super(...arguments),this.KeyframeResolver=Lln}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Tu(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Kze(e,{style:t,vars:n},r,s){const a=e.style;let o;for(o in t)a[o]=t[o];s==null||s.applyProjectionStyles(a,r);for(o in n)a.setProperty(o,n[o])}function zcn(e){return window.getComputedStyle(e)}class Hcn extends Gze{constructor(){super(...arguments),this.type="html",this.renderInstance=Kze}readValueFromInstance(t,n){var r;if(a8.has(n))return(r=this.projection)!=null&&r.isProjecting?$ne(n):nln(t,n);{const s=zcn(t),a=(Gce(n)?s.getPropertyValue(n):s[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Wze(t,n)}build(t,n,r){uue(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return pue(t,n,r)}}const Yze=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Vcn(e,t,n,r){Kze(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(Yze.has(s)?s:mue(s),t.attrs[s])}class Wcn extends Gze{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=fl}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(a8.has(n)){const r=vze(n);return r&&r.default||0}return n=Yze.has(n)?n:mue(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Dze(t,n,r)}build(t,n,r){Oze(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){Vcn(t,n,r,s)}mount(t){this.isSVGTag=Rze(t.tagName),super.mount(t)}}const qcn=(e,t)=>fue(e)?new Wcn(t):new Hcn(t,{allowProjection:e!==m.Fragment});function x4(e,t,n){const r=e.getProps();return hue(r,t,n!==void 0?n:r.custom,e)}const Xne=e=>Array.isArray(e);function Gcn(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,WN(n))}function Kcn(e){return Xne(e)?e[e.length-1]||0:e}function Ycn(e,t){const n=x4(e,t);let{transitionEnd:r={},transition:s={},...a}=n||{};a={...a,...r};for(const o in a){const l=Kcn(a[o]);Gcn(e,o,l)}}function Xcn(e){return!!(Tu(e)&&e.add)}function Qne(e,t){const n=e.getValue("willChange");if(Xcn(n))return n.add(t);if(!n&&kc.WillChange){const r=new kc.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Xze(e){return e.props[Bze]}const Qcn=e=>e!==null;function Zcn(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(Qcn),a=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[a]}const Jcn={type:"spring",stiffness:500,damping:25,restSpeed:10},eun=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),tun={type:"keyframes",duration:.8},nun={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},run=(e,{keyframes:t})=>t.length>2?tun:a8.has(e)?e.startsWith("scale")?eun(t[1]):Jcn:nun;function sun({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:a,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const xue=(e,t,n,r={},s,a)=>o=>{const l=rue(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Rl(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:x=>{t.set(x),l.onUpdate&&l.onUpdate(x)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:a?void 0:s};sun(l)||Object.assign(d,run(e,d)),d.duration&&(d.duration=Rl(d.duration)),d.repeatDelay&&(d.repeatDelay=Rl(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(Wne(d),d.delay===0&&(f=!0)),(kc.instantAnimations||kc.skipAnimations)&&(f=!0,Wne(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,f&&!a&&t.get()!==void 0){const x=Zcn(d.keyframes,l);if(x!==void 0){ko.update(()=>{d.onUpdate(x),d.onComplete()});return}}return l.isSync?new tue(d):new Aln(d)};function iun({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Qze(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:o,...l}=t;r&&(a=r);const c=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const d in l){const f=e.getValue(d,e.latestValues[d]??null),x=l[d];if(x===void 0||u&&iun(u,d))continue;const g={delay:n,...rue(a||{},d)},v=f.get();if(v!==void 0&&!f.isAnimating&&!Array.isArray(x)&&x===v&&!g.velocity)continue;let w=!1;if(window.MotionHandoffAnimation){const N=Xze(e);if(N){const I=window.MotionHandoffAnimation(N,d,ko);I!==null&&(g.startTime=I,w=!0)}}Qne(e,d),f.start(xue(d,f,x,e.shouldReduceMotion&&gze.has(d)?{type:!1}:g,e,w));const C=f.animation;C&&c.push(C)}return o&&Promise.all(c).then(()=>{ko.update(()=>{o&&Ycn(e,o)})}),c}function Zze(e,t,n,r=0,s=1){const a=Array.from(e).sort((u,d)=>u.sortNodePosition(d)).indexOf(t),o=e.size,l=(o-1)*r;return typeof n=="function"?n(a,o):s===1?a*r:l-a*r}function Zne(e,t,n={}){var c;const r=x4(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const a=r?()=>Promise.all(Qze(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:x}=s;return aun(e,t,u,d,f,x,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[u,d]=l==="beforeChildren"?[a,o]:[o,a];return u().then(()=>d())}else return Promise.all([a(),o(n.delay)])}function aun(e,t,n=0,r=0,s=0,a=1,o){const l=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),l.push(Zne(c,t,{...o,delay:n+(typeof r=="function"?0:r)+Zze(e.variantChildren,c,r,s,a)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(l)}function oun(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(a=>Zne(e,a,n));r=Promise.all(s)}else if(typeof t=="string")r=Zne(e,t,n);else{const s=typeof t=="function"?x4(e,t,n.custom):t;r=Promise.all(Qze(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Jze(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const lun=cue.length;function eHe(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?eHe(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<lun;n++){const r=cue[n],s=e.props[r];($_(s)||s===!1)&&(t[r]=s)}return t}const cun=[...lue].reverse(),uun=lue.length;function dun(e){return t=>Promise.all(t.map(({animation:n,options:r})=>oun(e,n,r)))}function fun(e){let t=dun(e),n=u4e(),r=!0;const s=c=>(u,d)=>{var x;const f=x4(e,d,c==="exit"?(x=e.presenceContext)==null?void 0:x.custom:void 0);if(f){const{transition:g,transitionEnd:v,...w}=f;u={...u,...w,...v}}return u};function a(c){t=c(e)}function o(c){const{props:u}=e,d=eHe(e.parent)||{},f=[],x=new Set;let g={},v=1/0;for(let C=0;C<uun;C++){const N=cun[C],I=n[N],P=u[N]!==void 0?u[N]:d[N],R=$_(P),F=N===c?I.isActive:null;F===!1&&(v=C);let U=P===d[N]&&P!==u[N]&&R;if(U&&r&&e.manuallyAnimateOnMount&&(U=!1),I.protectedKeys={...g},!I.isActive&&F===null||!P&&!I.prevProp||pU(P)||typeof P=="boolean")continue;const L=hun(I.prevProp,P);let z=L||N===c&&I.isActive&&!U&&R||C>v&&R,X=!1;const ne=Array.isArray(P)?P:[P];let J=ne.reduce(s(N),{});F===!1&&(J={});const{prevResolvedValues:Z={}}=I,re={...Z,...J},he=oe=>{z=!0,x.has(oe)&&(X=!0,x.delete(oe)),I.needsAnimating[oe]=!0;const G=e.getValue(oe);G&&(G.liveStyle=!1)};for(const oe in re){const G=J[oe],V=Z[oe];if(g.hasOwnProperty(oe))continue;let ee=!1;Xne(G)&&Xne(V)?ee=!Jze(G,V):ee=G!==V,ee?G!=null?he(oe):x.add(oe):G!==void 0&&x.has(oe)?he(oe):I.protectedKeys[oe]=!0}I.prevProp=P,I.prevResolvedValues=J,I.isActive&&(g={...g,...J}),r&&e.blockInitialAnimation&&(z=!1);const Y=U&&L;z&&(!Y||X)&&f.push(...ne.map(oe=>{const G={type:N};if(typeof oe=="string"&&r&&!Y&&e.manuallyAnimateOnMount&&e.parent){const{parent:V}=e,ee=x4(V,oe);if(V.enteringChildren&&ee){const{delayChildren:ae}=ee.transition||{};G.delay=Zze(V.enteringChildren,e,ae)}}return{animation:oe,options:G}}))}if(x.size){const C={};if(typeof u.initial!="boolean"){const N=x4(e,Array.isArray(u.initial)?u.initial[0]:u.initial);N&&N.transition&&(C.transition=N.transition)}x.forEach(N=>{const I=e.getBaseTarget(N),P=e.getValue(N);P&&(P.liveStyle=!0),C[N]=I??null}),f.push({animation:C})}let w=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,w?t(f):Promise.resolve()}function l(c,u){var f;if(n[c].isActive===u)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(x=>{var g;return(g=x.animationState)==null?void 0:g.setActive(c,u)}),n[c].isActive=u;const d=o(c);for(const x in n)n[x].protectedKeys={};return d}return{animateChanges:o,setActive:l,setAnimateFunction:a,getState:()=>n,reset:()=>{n=u4e()}}}function hun(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Jze(t,e):!1}function dv(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function u4e(){return{animate:dv(!0),whileInView:dv(),whileHover:dv(),whileTap:dv(),whileDrag:dv(),whileFocus:dv(),exit:dv()}}class m2{constructor(t){this.isMounted=!1,this.node=t}update(){}}class pun extends m2{constructor(t){super(t),t.animationState||(t.animationState=fun(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();pU(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let mun=0;class xun extends m2{constructor(){super(...arguments),this.id=mun++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const gun={animation:{Feature:pun},exit:{Feature:xun}};function z_(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function xT(e){return{point:{x:e.pageX,y:e.pageY}}}const bun=e=>t=>aue(t)&&e(t,xT(t));function f9(e,t,n,r){return z_(e,t,bun(n),r)}const tHe=1e-4,yun=1-tHe,vun=1+tHe,nHe=.01,wun=0-nHe,Cun=0+nHe;function rd(e){return e.max-e.min}function Sun(e,t,n){return Math.abs(e-t)<=n}function d4e(e,t,n,r=.5){e.origin=r,e.originPoint=Do(t.min,t.max,e.origin),e.scale=rd(n)/rd(t),e.translate=Do(n.min,n.max,e.origin)-e.originPoint,(e.scale>=yun&&e.scale<=vun||isNaN(e.scale))&&(e.scale=1),(e.translate>=wun&&e.translate<=Cun||isNaN(e.translate))&&(e.translate=0)}function h9(e,t,n,r){d4e(e.x,t.x,n.x,r?r.originX:void 0),d4e(e.y,t.y,n.y,r?r.originY:void 0)}function f4e(e,t,n){e.min=n.min+t.min,e.max=e.min+rd(t)}function Nun(e,t,n){f4e(e.x,t.x,n.x),f4e(e.y,t.y,n.y)}function h4e(e,t,n){e.min=t.min-n.min,e.max=e.min+rd(t)}function p9(e,t,n){h4e(e.x,t.x,n.x),h4e(e.y,t.y,n.y)}function Sh(e){return[e("x"),e("y")]}const rHe=({current:e})=>e?e.ownerDocument.defaultView:null,p4e=(e,t)=>Math.abs(e-t);function Aun(e,t){const n=p4e(e.x,t.x),r=p4e(e.y,t.y);return Math.sqrt(n**2+r**2)}class sHe{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:a=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=cX(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,v=Aun(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!v)return;const{point:w}=x,{timestamp:C}=Vc;this.history.push({...w,timestamp:C});const{onStart:N,onMove:I}=this.handlers;g||(N&&N(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),I&&I(this.lastMoveEvent,x)},this.handlePointerMove=(x,g)=>{this.lastMoveEvent=x,this.lastMoveEventInfo=lX(g,this.transformPagePoint),ko.update(this.updatePoint,!0)},this.handlePointerUp=(x,g)=>{this.end();const{onEnd:v,onSessionEnd:w,resumeAnimation:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=cX(x.type==="pointercancel"?this.lastMoveEventInfo:lX(g,this.transformPagePoint),this.history);this.startEvent&&v&&v(x,N),w&&w(x,N)},!aue(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=xT(t),c=lX(l,this.transformPagePoint),{point:u}=c,{timestamp:d}=Vc;this.history=[{...u,timestamp:d}];const{onSessionStart:f}=n;f&&f(t,cX(c,this.history)),this.removeListeners=ix(f9(this.contextWindow,"pointermove",this.handlePointerMove),f9(this.contextWindow,"pointerup",this.handlePointerUp),f9(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),qy(this.updatePoint)}}function lX(e,t){return t?{point:t(e.point)}:e}function m4e(e,t){return{x:e.x-t.x,y:e.y-t.y}}function cX({point:e},t){return{point:e,delta:m4e(e,iHe(t)),offset:m4e(e,jun(t)),velocity:Eun(t,.1)}}function jun(e){return e[0]}function iHe(e){return e[e.length-1]}function Eun(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=iHe(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Rl(t)));)n--;if(!r)return{x:0,y:0};const a=Jo(s.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const o={x:(s.x-r.x)/a,y:(s.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function _un(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Do(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Do(n,e,r.max):Math.min(e,n)),e}function x4e(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function kun(e,{top:t,left:n,bottom:r,right:s}){return{x:x4e(e.x,n,s),y:x4e(e.y,t,r)}}function g4e(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Tun(e,t){return{x:g4e(e.x,t.x),y:g4e(e.y,t.y)}}function Iun(e,t){let n=.5;const r=rd(e),s=rd(t);return s>r?n=H0(t.min,t.max-r,e.min):r>s&&(n=H0(e.min,e.max-s,t.min)),_c(0,1,n)}function Pun(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Jne=.35;function Fun(e=Jne){return e===!1?e=0:e===!0&&(e=Jne),{x:b4e(e,"left","right"),y:b4e(e,"top","bottom")}}function b4e(e,t,n){return{min:y4e(e,t),max:y4e(e,n)}}function y4e(e,t){return typeof e=="number"?e:e[t]||0}const Oun=new WeakMap;class Mun{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fl(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const a=f=>{const{dragSnapToOrigin:x}=this.getProps();x?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(xT(f).point)},o=(f,x)=>{const{drag:g,dragPropagation:v,onDragStart:w}=this.getProps();if(g&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Uln(g),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=x,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Sh(N=>{let I=this.getAxisMotionValue(N).get()||0;if(B0.test(I)){const{projection:P}=this.visualElement;if(P&&P.layout){const R=P.layout.layoutBox[N];R&&(I=rd(R)*(parseFloat(I)/100))}}this.originPoint[N]=I}),w&&ko.postRender(()=>w(f,x)),Qne(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},l=(f,x)=>{this.latestPointerEvent=f,this.latestPanInfo=x;const{dragPropagation:g,dragDirectionLock:v,onDirectionLock:w,onDrag:C}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:N}=x;if(v&&this.currentDirection===null){this.currentDirection=Run(N),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",x.point,N),this.updateAxis("y",x.point,N),this.visualElement.render(),C&&C(f,x)},c=(f,x)=>{this.latestPointerEvent=f,this.latestPanInfo=x,this.stop(f,x),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>Sh(f=>{var x;return this.getAnimationState(f)==="paused"&&((x=this.getAxisMotionValue(f).animation)==null?void 0:x.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new sHe(t,{onSessionStart:a,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:rHe(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&ko.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!VP(t,s,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=_un(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){var a;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)==null?void 0:a.layout,s=this.constraints;t&&UC(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=kun(r.layoutBox,t):this.constraints=!1,this.elastic=Fun(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Sh(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Pun(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!UC(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const a=Lcn(r,s.root,this.visualElement.getTransformPagePoint());let o=Tun(s.layout.layoutBox,a);if(n){const l=n(Ocn(o));this.hasMutatedConstraints=!!l,l&&(o=zze(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Sh(d=>{if(!VP(d,n,this.currentDirection))return;let f=c[d]||{};o&&(f={min:0,max:0});const x=s?200:1e6,g=s?40:1e7,v={type:"inertia",velocity:r?t[d]:0,bounceStiffness:x,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...a,...f};return this.startAxisValueAnimation(d,v)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Qne(this.visualElement,t),r.start(xue(t,r,0,n,this.visualElement,!1))}stopAnimation(){Sh(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Sh(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Sh(n=>{const{drag:r}=this.getProps();if(!VP(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,a=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n];a.set(t[n]-Do(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!UC(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Sh(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();s[o]=Iun({min:c,max:c},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Sh(o=>{if(!VP(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(Do(c,u,s[o]))})}addListeners(){if(!this.visualElement.current)return;Oun.set(this.visualElement,this);const t=this.visualElement.current,n=f9(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();UC(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,a=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ko.read(r);const o=z_(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Sh(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{o(),n(),a(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:a=!1,dragElastic:o=Jne,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:a,dragElastic:o,dragMomentum:l}}}function VP(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Run(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Lun extends m2{constructor(t){super(t),this.removeGroupControls=rl,this.removeListeners=rl,this.controls=new Mun(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||rl}unmount(){this.removeGroupControls(),this.removeListeners()}}const v4e=e=>(t,n)=>{e&&ko.postRender(()=>e(t,n))};class Dun extends m2{constructor(){super(...arguments),this.removePointerDownListener=rl}onPointerDown(t){this.session=new sHe(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:rHe(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:v4e(t),onStart:v4e(n),onMove:r,onEnd:(a,o)=>{delete this.session,s&&ko.postRender(()=>s(a,o))}}}mount(){this.removePointerDownListener=f9(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const NO={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function w4e(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Y7={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ni.test(e))e=parseFloat(e);else return e;const n=w4e(e,t.target.x),r=w4e(e,t.target.y);return`${n}% ${r}%`}},Bun={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Gy.parse(e);if(s.length>5)return r;const a=Gy.createTransformer(e),o=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;s[0+o]/=l,s[1+o]/=c;const u=Do(l,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),a(s)}};let uX=!1;class $un extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:a}=t;lcn(Uun),a&&(n.group&&n.group.add(a),r&&r.register&&s&&r.register(a),uX&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),NO.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,uX=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==a?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||ko.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),iue.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;uX=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function aHe(e){const[t,n]=_ze(),r=m.useContext(Vce);return i.jsx($un,{...e,layoutGroup:r,switchLayoutGroup:m.useContext($ze),isPresent:t,safeToRemove:n})}const Uun={borderRadius:{...Y7,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Y7,borderTopRightRadius:Y7,borderBottomLeftRadius:Y7,borderBottomRightRadius:Y7,boxShadow:Bun};function zun(e,t,n){const r=Tu(e)?e:WN(e);return r.start(xue("",r,t,n)),r.animation}const Hun=(e,t)=>e.depth-t.depth;class Vun{constructor(){this.children=[],this.isDirty=!1}add(t){bk(this.children,t),this.isDirty=!0}remove(t){yk(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Hun),this.isDirty=!1,this.children.forEach(t)}}function Wun(e,t){const n=qd.now(),r=({timestamp:s})=>{const a=s-n;a>=t&&(qy(r),e(a-t))};return ko.setup(r,!0),()=>qy(r)}const oHe=["TopLeft","TopRight","BottomLeft","BottomRight"],qun=oHe.length,C4e=e=>typeof e=="string"?parseFloat(e):e,S4e=e=>typeof e=="number"||ni.test(e);function Gun(e,t,n,r,s,a){s?(e.opacity=Do(0,n.opacity??1,Kun(r)),e.opacityExit=Do(t.opacity??1,0,Yun(r))):a&&(e.opacity=Do(t.opacity??1,n.opacity??1,r));for(let o=0;o<qun;o++){const l=`border${oHe[o]}Radius`;let c=N4e(t,l),u=N4e(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||S4e(c)===S4e(u)?(e[l]=Math.max(Do(C4e(c),C4e(u),r),0),(B0.test(u)||B0.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=Do(t.rotate||0,n.rotate||0,r))}function N4e(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Kun=lHe(0,.5,use),Yun=lHe(.5,.95,rl);function lHe(e,t,n){return r=>r<e?0:r>t?1:n(H0(e,t,r))}function A4e(e,t){e.min=t.min,e.max=t.max}function bh(e,t){A4e(e.x,t.x),A4e(e.y,t.y)}function j4e(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function E4e(e,t,n,r,s){return e-=t,e=XL(e,1/n,r),s!==void 0&&(e=XL(e,1/s,r)),e}function Xun(e,t=0,n=1,r=.5,s,a=e,o=e){if(B0.test(t)&&(t=parseFloat(t),t=Do(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=Do(a.min,a.max,r);e===a&&(l-=t),e.min=E4e(e.min,t,n,l,s),e.max=E4e(e.max,t,n,l,s)}function _4e(e,t,[n,r,s],a,o){Xun(e,t[n],t[r],t[s],t.scale,a,o)}const Qun=["x","scaleX","originX"],Zun=["y","scaleY","originY"];function k4e(e,t,n,r){_4e(e.x,t,Qun,n?n.x:void 0,r?r.x:void 0),_4e(e.y,t,Zun,n?n.y:void 0,r?r.y:void 0)}function T4e(e){return e.translate===0&&e.scale===1}function cHe(e){return T4e(e.x)&&T4e(e.y)}function I4e(e,t){return e.min===t.min&&e.max===t.max}function Jun(e,t){return I4e(e.x,t.x)&&I4e(e.y,t.y)}function P4e(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function uHe(e,t){return P4e(e.x,t.x)&&P4e(e.y,t.y)}function F4e(e){return rd(e.x)/rd(e.y)}function O4e(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class edn{constructor(){this.members=[]}add(t){bk(this.members,t),t.scheduleRender()}remove(t){if(yk(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const a=this.members[s];if(a.isPresent!==!1){r=a;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function tdn(e,t,n){let r="";const s=e.x.translate/t.x,a=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||a||o)&&(r=`translate3d(${s}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:x,skewX:g,skewY:v}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),x&&(r+=`rotateY(${x}deg) `),g&&(r+=`skewX(${g}deg) `),v&&(r+=`skewY(${v}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const dX=["","X","Y","Z"],ndn=1e3;let rdn=0;function fX(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function dHe(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Xze(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ko,!(s||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&dHe(r)}function fHe({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=t==null?void 0:t()){this.id=rdn++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(adn),this.nodes.forEach(udn),this.nodes.forEach(ddn),this.nodes.forEach(odn)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Vun)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new oA),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Eze(o)&&!Gln(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||l)&&(this.isLayoutDirty=!0),e){let d,f=0;const x=()=>this.root.updateBlockedByResize=!1;ko.read(()=>{f=window.innerWidth}),e(o,()=>{const g=window.innerWidth;g!==f&&(f=g,this.root.updateBlockedByResize=!0,d&&d(),d=Wun(x,250),NO.hasAnimatedSinceResize&&(NO.hasAnimatedSinceResize=!1,this.nodes.forEach(L4e)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:x,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||u.getDefaultTransition()||xdn,{onLayoutAnimationStart:w,onLayoutAnimationComplete:C}=u.getProps(),N=!this.targetLayout||!uHe(this.targetLayout,g),I=!f&&x;if(this.options.layoutRoot||this.resumeFrom||I||f&&(N||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const P={...rue(v,"layout"),onPlay:w,onComplete:C};(u.shouldReduceMotion||this.options.layoutRoot)&&(P.delay=0,P.type=!1),this.startAnimation(P),this.setAnimationOrigin(d,I)}else f||L4e(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),qy(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(fdn),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&dHe(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(M4e);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(R4e);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(cdn),this.nodes.forEach(sdn),this.nodes.forEach(idn)):this.nodes.forEach(R4e),this.clearAllSnapshots();const l=qd.now();Vc.delta=_c(0,1e3/60,l-Vc.timestamp),Vc.timestamp=l,Vc.isProcessing=!0,tX.update.process(Vc),tX.preRender.process(Vc),tX.render.process(Vc),Vc.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,iue.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ldn),this.sharedNodes.forEach(hdn)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ko.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ko.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!rd(this.snapshot.measuredBox.x)&&!rd(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=fl(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!cHe(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&this.instance&&(l||_v(this.latestValues)||d)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),gdn(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return fl();const l=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(bdn))){const{scroll:d}=this.root;d&&(zC(l.x,d.offset.x),zC(l.y,d.offset.y))}return l}removeElementScroll(o){var c;const l=fl();if(bh(l,o),(c=this.scroll)!=null&&c.wasRoot)return l;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:x}=d;d!==this.root&&f&&x.layoutScroll&&(f.wasRoot&&bh(l,o),zC(l.x,f.offset.x),zC(l.y,f.offset.y))}return l}applyTransform(o,l=!1){const c=fl();bh(c,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&HC(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),_v(d.latestValues)&&HC(c,d.latestValues)}return _v(this.latestValues)&&HC(c,this.latestValues),c}removeTransform(o){const l=fl();bh(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!_v(u.latestValues))continue;Gne(u.latestValues)&&u.updateSnapshot();const d=fl(),f=u.measurePageBox();bh(d,f),k4e(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return _v(this.latestValues)&&k4e(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Vc.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var x;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=Vc.timestamp,!this.targetDelta&&!this.relativeTarget){const g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=fl(),this.relativeTargetOrigin=fl(),p9(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),bh(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=fl(),this.targetWithTransforms=fl()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Nun(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):bh(this.target,this.layout.layoutBox),Vze(this.target,this.targetDelta)):bh(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const g=this.getClosestProjectingParent();g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=fl(),this.relativeTargetOrigin=fl(),p9(this.relativeTargetOrigin,this.target,g.target),bh(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Gne(this.parent.latestValues)||Hze(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var v;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Vc.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;bh(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,x=this.treeScale.y;Rcn(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=fl());const{target:g}=o;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(j4e(this.prevProjectionDelta.x,this.projectionDelta.x),j4e(this.prevProjectionDelta.y,this.projectionDelta.y)),h9(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==x||!O4e(this.projectionDelta.x,this.prevProjectionDelta.x)||!O4e(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=VC(),this.projectionDelta=VC(),this.projectionDeltaWithTransform=VC()}setAnimationOrigin(o,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=VC();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const x=fl(),g=c?c.source:void 0,v=this.layout?this.layout.source:void 0,w=g!==v,C=this.getStack(),N=!C||C.members.length<=1,I=!!(w&&!N&&this.options.crossfade===!0&&!this.path.some(mdn));this.animationProgress=0;let P;this.mixTargetDelta=R=>{const F=R/1e3;D4e(f.x,o.x,F),D4e(f.y,o.y,F),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(p9(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),pdn(this.relativeTarget,this.relativeTargetOrigin,x,F),P&&Jun(this.relativeTarget,P)&&(this.isProjectionDirty=!1),P||(P=fl()),bh(P,this.relativeTarget)),w&&(this.animationValues=d,Gun(d,u,this.latestValues,F,I,N)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=F},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,c,u;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(qy(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ko.update(()=>{NO.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=WN(0)),this.currentAnimation=zun(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ndn),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&hHe(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||fl();const f=rd(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const x=rd(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+x}bh(l,c),HC(l,d),h9(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new edn),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&fX("z",o,u,this.animationValues);for(let d=0;d<dX.length;d++)fX(`rotate${dX[d]}`,o,u,this.animationValues),fX(`skew${dX[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=SO(l==null?void 0:l.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=SO(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!_v(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=tdn(this.projectionDeltaWithTransform,this.treeScale,d);c&&(f=c(d,f)),o.transform=f;const{x,y:g}=this.projectionDelta;o.transformOrigin=`${x.origin*100}% ${g.origin*100}% 0`,u.animationValues?o.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:o.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const v in U_){if(d[v]===void 0)continue;const{correct:w,applyTo:C,isCSSVariable:N}=U_[v],I=f==="none"?d[v]:w(d[v],u);if(C){const P=C.length;for(let R=0;R<P;R++)o[C[R]]=I}else N?this.options.visualElement.renderState.vars[v]=I:o[v]=I}this.options.layoutId&&(o.pointerEvents=u===this?SO(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(M4e),this.root.sharedNodes.clear()}}}function sdn(e){e.updateLayout()}function idn(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:a}=e.options,o=t.source!==e.layout.source;a==="size"?Sh(f=>{const x=o?t.measuredBox[f]:t.layoutBox[f],g=rd(x);x.min=r[f].min,x.max=x.min+g}):hHe(a,t.layoutBox,r)&&Sh(f=>{const x=o?t.measuredBox[f]:t.layoutBox[f],g=rd(r[f]);x.max=x.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+g)});const l=VC();h9(l,r,t.layoutBox);const c=VC();o?h9(c,e.applyTransform(s,!0),t.measuredBox):h9(c,r,t.layoutBox);const u=!cHe(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:x,layout:g}=f;if(x&&g){const v=fl();p9(v,t.layoutBox,x.layoutBox);const w=fl();p9(w,r,g.layoutBox),uHe(v,w)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=v,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function adn(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function odn(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ldn(e){e.clearSnapshot()}function M4e(e){e.clearMeasurements()}function R4e(e){e.isLayoutDirty=!1}function cdn(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function L4e(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function udn(e){e.resolveTargetDelta()}function ddn(e){e.calcProjection()}function fdn(e){e.resetSkewAndRotation()}function hdn(e){e.removeLeadSnapshot()}function D4e(e,t,n){e.translate=Do(t.translate,0,n),e.scale=Do(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function B4e(e,t,n,r){e.min=Do(t.min,n.min,r),e.max=Do(t.max,n.max,r)}function pdn(e,t,n,r){B4e(e.x,t.x,n.x,r),B4e(e.y,t.y,n.y,r)}function mdn(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const xdn={duration:.45,ease:[.4,0,.1,1]},$4e=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),U4e=$4e("applewebkit/")&&!$4e("chrome/")?Math.round:rl;function z4e(e){e.min=U4e(e.min),e.max=U4e(e.max)}function gdn(e){z4e(e.x),z4e(e.y)}function hHe(e,t,n){return e==="position"||e==="preserve-aspect"&&!Sun(F4e(t),F4e(n),.2)}function bdn(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const ydn=fHe({attachResizeListener:(e,t)=>z_(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),hX={current:void 0},pHe=fHe({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!hX.current){const e=new ydn({});e.mount(window),e.setOptions({layoutScroll:!0}),hX.current=e}return hX.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),vdn={pan:{Feature:Dun},drag:{Feature:Lun,ProjectionNode:pHe,MeasureLayout:aHe}};function H4e(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,a=r[s];a&&ko.postRender(()=>a(t,xT(t)))}class wdn extends m2{mount(){const{current:t}=this.node;t&&(this.unmount=zln(t,(n,r)=>(H4e(this.node,r,"Start"),s=>H4e(this.node,s,"End"))))}unmount(){}}class Cdn extends m2{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ix(z_(this.node.current,"focus",()=>this.onFocus()),z_(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function V4e(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),a=r[s];a&&ko.postRender(()=>a(t,xT(t)))}class Sdn extends m2{mount(){const{current:t}=this.node;t&&(this.unmount=qln(t,(n,r)=>(V4e(this.node,r,"Start"),(s,{success:a})=>V4e(this.node,s,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ere=new WeakMap,pX=new WeakMap,Ndn=e=>{const t=ere.get(e.target);t&&t(e)},Adn=e=>{e.forEach(Ndn)};function jdn({root:e,...t}){const n=e||document;pX.has(n)||pX.set(n,{});const r=pX.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(Adn,{root:e,...t})),r[s]}function Edn(e,t,n){const r=jdn(t);return ere.set(e,n),r.observe(e),()=>{ere.delete(e),r.unobserve(e)}}const _dn={some:0,all:1};class kdn extends m2{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:a}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:_dn[s]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),x=u?d:f;x&&x(c)};return Edn(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Tdn(t,n))&&this.startObserver()}unmount(){}}function Tdn({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Idn={inView:{Feature:kdn},tap:{Feature:Sdn},focus:{Feature:Cdn},hover:{Feature:wdn}},Pdn={layout:{ProjectionNode:pHe,MeasureLayout:aHe}},Fdn={...gun,...Idn,...vdn,...Pdn},go=Fcn(Fdn,qcn);function gue({markets:e=[],value:t="",onChange:n=()=>{},loading:r=!1,iconsBaseUrl:s="https://app.hyperliquid.xyz/coins",mode:a="single",pairWhitelist:o=null,pairBase:l=[],showIcon:c=!0}){const[u,d]=m.useState(!1),[f,x]=m.useState(!1),[g,v]=m.useState(""),[w,C]=m.useState(0),[N,I]=m.useState(0),[P,R]=m.useState(320),[F,U]=m.useState("vol"),[L,z]=m.useState("desc"),[X,ne]=m.useState("all"),[J,Z]=m.useState(()=>{try{const at=localStorage.getItem("favCoins");return at?new Set(JSON.parse(at)):new Set}catch{return new Set}}),re=m.useRef(null),he=m.useRef(null),Y=150,ie={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},oe=at=>{var ct;const dt=(ct=at==null?void 0:at.split("/")[0])==null?void 0:ct.replace("-USD","").replace("/USD","");return ie[dt]||dt},G=at=>at==null||isNaN(at)?"--":Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:2}).format(Number(at)),V=(at,dt=6)=>at==null||isNaN(at)?"--":Number(at).toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:dt}),ee=at=>{const dt=new Set(J);dt.has(at)?dt.delete(at):dt.add(at),Z(dt),localStorage.setItem("favCoins",JSON.stringify([...dt]))},ae=at=>{F===at?z(dt=>dt==="asc"?"desc":"asc"):(U(at),z("desc"))},fe=m.useMemo(()=>((e==null?void 0:e.map(dt=>{const ct=dt.rawSymbol||dt.symbol||dt.coin||dt.ticker||"";let Ut=dt.symbol||dt.coin||dt.ticker||ct,kt=dt.builder||dt.dex||"";if(dt.kind==="hip3"){const Ke=ct.indexOf(":");!kt&&Ke>=0&&(kt=ct.slice(0,Ke),Ut=ct.slice(Ke+1))}const tn=dt.lastPrice??dt.last??dt.markPrice??null,jt=dt.change24hPct??dt.chg24??null,un=dt.volume??dt.vol??dt.dayNtlVlm??null,cn=dt.fundingRate??dt.funding??null,Pt=dt.openInterest??dt.oi??null,Xe=dt.openInterestUsd??dt.oiUsd??(Pt!=null&&tn!=null?Number(Pt)*Number(tn):null),Vt=dt.leverage!=null?dt.leverage:dt.lev!=null?dt.lev:null,Yt=dt.kind||(kt?"hip3":"perp"),Ve=dt.coin||Ut.replace(/-USDH$/,"").replace(/-USDC$/,"").replace(/-USD$/,"").replace(/\/USD$/,"");return{kind:Yt,builder:kt,dex:dt.dex||"",symbol:Ut,rawSymbol:ct,last:tn,chg24:jt,vol:un,funding:cn,openInterest:Xe,leverage:Vt!=null&&isFinite(Vt)?Math.floor(Vt):null,coinForChange:Ve}}))??[]).filter(dt=>dt.symbol),[e]),Ae=m.useMemo(()=>{const at=new Map;for(const dt of fe){const ct=dt.symbol.replace("-USD","").replace("/USD","");at.set(ct,dt)}return at},[fe]),ce=m.useMemo(()=>{if(a!=="pair")return[];const at=fe.filter(un=>un.kind!=="hip3"),dt=at.map(un=>un.symbol.replace("-USD","").replace("/USD","")),ct=Array.from(new Set(dt)),Ut=Array.isArray(o)?new Set(o):null;let kt=Array.isArray(l)&&l.length?l:at.slice().sort((un,cn)=>Number(cn.vol||0)-Number(un.vol||0)).slice(0,30).map(un=>un.symbol.replace("-USD","").replace("/USD",""));kt=kt.filter(un=>ct.includes(un));const tn=[],jt=new Set;for(let un=0;un<kt.length;un++){const cn=kt[un];for(let Pt=0;Pt<ct.length;Pt++){const Xe=ct[Pt];if(!cn||!Xe||cn===Xe)continue;const Vt=`${cn}/${Xe}`;if(jt.has(Vt)||Ut&&!Ut.has(Vt))continue;jt.add(Vt);const Yt=Ae.get(cn),Ve=Ae.get(Xe),Ke=Yt&&Ve&&Number(Yt.last)>0&&Number(Ve.last)>0?Number(Yt.last)/Number(Ve.last):null,ft=Yt&&Ve?Math.min(Number(Yt.vol||0),Number(Ve.vol||0)):null;if(tn.push({kind:"pair",builder:"",dex:"",symbol:Vt,rawSymbol:Vt,last:Ke,chg24:null,vol:ft,funding:null,openInterest:null,leverage:null,coinForChange:Vt}),tn.length>=300)return tn}}return tn},[a,fe,o,l,Ae]),ye=m.useMemo(()=>fe.some(at=>at.kind==="hip3"),[fe]);m.useEffect(()=>{a==="pair"&&(U("vol"),z("desc"),ne("perps"))},[a]),m.useEffect(()=>{!ye&&X==="hip3"&&ne("all")},[ye,X]),m.useEffect(()=>{a==="pair"&&(U("vol"),z("desc"),ne("perps"))},[a]);const Ne=m.useMemo(()=>{const at=g.trim().toLowerCase();let ct=a==="pair"?ce.slice():fe.slice();a!=="pair"&&(X==="perps"?ct=ct.filter(kt=>kt.kind!=="hip3"):X==="hip3"&&(ct=ct.filter(kt=>kt.kind==="hip3"))),at&&(ct=ct.filter(kt=>kt.symbol.toLowerCase().includes(at)));const Ut=kt=>kt==null||isNaN(Number(kt))?NaN:Number(kt);return ct.sort((kt,tn)=>{const jt=J.has(kt.symbol)?1:0,un=J.has(tn.symbol)?1:0;if(jt!==un)return un-jt;const cn=Ut(kt[F]),Pt=Ut(tn[F]),Xe=isNaN(cn),Vt=isNaN(Pt);return Xe&&Vt?kt.symbol.localeCompare(tn.symbol):Xe?1:Vt?-1:cn===Pt?kt.symbol.localeCompare(tn.symbol):L==="asc"?cn-Pt:Pt-cn}),ct},[a,fe,ce,g,J,F,L,X]),be=()=>{const at=he.current;if(!at)return;const dt=at.getBoundingClientRect(),ct=getComputedStyle(at),Ut=parseFloat(ct.paddingLeft)||0,kt=document.documentElement.clientWidth,tn=16,un=Math.min(740,kt-tn*2);let cn=dt.left+Ut;cn+un>kt-tn&&(cn=kt-tn-un),cn<tn&&(cn=tn),R(un),I(cn),C(dt.bottom+8)},je=()=>{be(),d(!0),requestAnimationFrame(()=>x(!0))},Ie=()=>{x(!1),setTimeout(()=>d(!1),Y)};m.useEffect(()=>{const at=ct=>ct.key==="Escape"&&u&&Ie(),dt=ct=>{var Ut;return u&&!((Ut=re.current)!=null&&Ut.contains(ct.target))&&Ie()};return document.addEventListener("keydown",at),document.addEventListener("mousedown",dt),document.addEventListener("touchstart",dt,{passive:!0}),()=>{document.removeEventListener("keydown",at),document.removeEventListener("mousedown",dt),document.removeEventListener("touchstart",dt)}},[u]),m.useLayoutEffect(()=>{if(!u)return;be();const at=()=>be(),dt=()=>be();return window.addEventListener("scroll",at,!0),window.addEventListener("resize",dt),()=>{window.removeEventListener("scroll",at,!0),window.removeEventListener("resize",dt)}},[u]);const Re=t&&t.length>8?"min-w-[120px]":t&&t.length>6?"min-w-[108px]":"min-w-[96px]",Qe=at=>{at.currentTarget.src="data:image/svg+xml;utf8,"+encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20'><rect width='100%' height='100%' fill='#2a2a2a'/></svg>")},Be=({active:at,dir:dt})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:`w-3 h-3 ml-1 ${at?"text-white":"text-[#6a6a6a]"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:dt==="asc"?i.jsx("path",{d:"M7 14l5-5 5 5"}):i.jsx("path",{d:"M7 10l5 5 5-5"})}),it=m.useMemo(()=>a!=="pair"?t||"Select":t||"Select Pair",[a,t]),tt=({children:at})=>i.jsx("span",{className:"tabular-nums whitespace-nowrap",children:at});return i.jsxs("div",{className:`relative ${Re} z-[30]`,ref:re,children:[i.jsx("div",{ref:he,className:" text-white px-1 py-2 rounded cursor-pointer text-[14px] font-medium font-['Inter'] select-none leading-none",onClick:()=>u?Ie():je(),children:i.jsxs("div",{className:"flex items-center justify-start gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i.jsx("span",{className:"truncate text-white font-inter text-[14px] not-italic font-medium leading-4 tracking-[-0.28px]",children:it}),i.jsx("span",{className:"inline-flex px-1 py-[2px] justify-center items-center gap-[10px] rounded-[6px] bg-[rgba(103,255,189,0.16)] text-[#67FFBD] font-inter text-[11px] not-italic font-medium leading-4 w-12",children:(()=>{const at=fe.find(dt=>a==="pair"?dt.symbol===t:dt.rawSymbol===t||dt.symbol===t||dt.coinForChange===t);return at&&at.kind==="hip3"?"HIP-3":"PERP"})()})]}),i.jsx("span",{className:"text-[#929292] ml-auto",children:"▾"})," "]})}),u&&i.jsx("div",{className:`fixed inset-0 z-[55] bg-black/50 transition-opacity duration-[${Y}ms] ${f?"opacity-100":"opacity-0"}`,"aria-hidden":!0,onClick:Ie}),u&&i.jsx("div",{className:`fixed z-[60] transition-all duration-[${Y}ms] ease-out ${f?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-1 scale-[0.99]"}`,style:{top:w,left:N,width:P,willChange:"transform, opacity"},children:i.jsxs("div",{className:"bg-[#121212] border border-[#2a2a2a] shadow-xl rounded-md overflow-hidden",children:[i.jsxs("div",{className:"p-2",children:[a!=="pair"&&ye&&i.jsx("div",{className:"mb-2 inline-flex text-[11px] bg-[#1b1b1b] rounded-lg p-0.5",children:[["all","All Coins"],["perps","Perps"],["hip3","HIP-3"]].map(([at,dt])=>i.jsx("button",{className:`px-2 py-1 rounded-md font-bold ${X===at?"bg-[#262626] text-white":"text-[#8a8a8a]"}`,onClick:()=>ne(at),children:dt},at))}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:g,onChange:at=>v(at.target.value),placeholder:a==="pair"?"Search pairs (e.g., BTC/ETH)":"Search markets...",className:"w-full pr-8 py-1.5 pl-2.5 bg-[#1b1b1b] rounded-md border border-[#303030] h-8 block text-white text-[12px] font-medium placeholder:text-[#535353] focus:outline-none leading-none",autoFocus:!0}),i.jsx("div",{className:"absolute right-2 top-1 pointer-events-none",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-5 h-5 text-[#646464]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:[i.jsx("circle",{cx:"11",cy:"11",r:"7",strokeWidth:"1.5"}),i.jsx("path",{d:"M20 20L17 17",strokeWidth:"1.5"})]})})]})]}),i.jsx("div",{className:"max-h-[400px] overflow-y-auto",children:i.jsxs("table",{className:"w-full text-[12px] font-inter table-fixed",children:[i.jsxs("colgroup",{children:[i.jsx("col",{className:"w-[44px]"}),i.jsx("col",{className:"w-[220px]"}),i.jsx("col",{className:"w-[80px]"}),a!=="pair"&&i.jsxs(i.Fragment,{children:[i.jsx("col",{className:"w-[160px]"}),i.jsx("col",{}),i.jsx("col",{}),i.jsx("col",{})]})]}),i.jsx("thead",{className:"sticky top-0 bg-[#141414] border-b border-[#1f1f1f] text-[#9B9B9B]",children:i.jsxs("tr",{children:[i.jsx("th",{className:"text-left align-middle"}),i.jsx("th",{className:"text-left align-middle",children:a==="pair"?"Pair":"Symbol"}),i.jsx("th",{className:"text-right align-middle",children:i.jsxs("span",{className:"inline-flex items-center cursor-pointer select-none",onClick:()=>ae("last"),children:["Last Price",i.jsx("span",{className:"ml-1",children:i.jsx(Be,{active:F==="last",dir:F==="last"?L:"desc"})})]})}),a!=="pair"&&i.jsxs(i.Fragment,{children:[i.jsx("th",{className:"text-right align-middle",children:i.jsxs("span",{className:"inline-flex items-center cursor-pointer select-none",onClick:()=>ae("chg24"),children:["24h Change",i.jsx("span",{className:"ml-1",children:i.jsx(Be,{active:F==="chg24",dir:F==="chg24"?L:"desc"})})]})}),i.jsx("th",{className:"text-right align-middle",children:i.jsxs("span",{className:"inline-flex items-center cursor-pointer select-none",onClick:()=>ae("vol"),children:["Vol",i.jsx("span",{className:"ml-1",children:i.jsx(Be,{active:F==="vol",dir:F==="vol"?L:"desc"})})]})}),i.jsx("th",{className:"text-right align-middle",children:i.jsxs("span",{className:"inline-flex items-center cursor-pointer select-none",onClick:()=>ae("funding"),children:["Funding",i.jsx("span",{className:"ml-1",children:i.jsx(Be,{active:F==="funding",dir:F==="funding"?L:"desc"})})]})}),i.jsx("th",{className:"text-right align-middle",children:i.jsxs("span",{className:"inline-flex items-center cursor-pointer select-none",onClick:()=>ae("openInterest"),children:["Open Int.",i.jsx("span",{className:"ml-1",children:i.jsx(Be,{active:F==="openInterest",dir:F==="openInterest"?L:"desc"})})]})})]})]})}),i.jsx("tbody",{className:"divide-y divide-[#1f1f1f]",children:r?i.jsx("tr",{children:i.jsx("td",{className:"px-3 py-4 text-[#888888]",colSpan:a==="pair"?3:7,children:"Loading..."})}):Ne.length===0?i.jsx("tr",{children:i.jsx("td",{className:"px-3 py-4 text-[#888888]",colSpan:a==="pair"?3:7,children:"No matches found"})}):Ne.map(at=>{const dt=J.has(at.symbol),ct=a==="pair"&&at.symbol.includes("/"),[Ut,kt]=ct?at.symbol.split("/"):[null,null],tn=`${at.kind||"perp"}:${at.builder||""}:${at.rawSymbol||at.symbol}`;return i.jsxs("tr",{className:"hover:bg-[#1b1b1b]/70 cursor-pointer",onClick:()=>{const jt=a==="pair"?at.symbol:at.kind==="hip3"&&at.rawSymbol?at.rawSymbol:at.coinForChange;n(jt),Ie()},children:[i.jsx("td",{className:"align-middle",children:i.jsx("button",{onClick:jt=>{jt.stopPropagation(),ee(at.symbol)},className:`shrink-0 bg-transparent ${dt?"text-yellow-400":"text-[#9b9b9b]"} hover:text-yellow-400`,title:dt?"Unfavorite":"Favorite",children:dt?i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:i.jsx("path",{d:"M12 .587l3.668 7.568L24 9.75l-6 5.85 1.42 8.41L12 19.77 4.58 24l1.42-8.4L0 9.75l8.332-1.595z"})}):i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:i.jsx("path",{d:"M12 17.77l-6.18 3.73 1.42-6.82L2 9.75l6.91-1.32L12 2l3.09 6.43L22 9.75l-5.24 4.93 1.42 6.82z",strokeWidth:"1.2"})})})}),i.jsx("td",{className:"align-middle",children:i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c&&i.jsx(i.Fragment,{children:ct?i.jsxs(i.Fragment,{children:[i.jsx("img",{src:`${s}/${Ut}.svg`,alt:Ut,className:"rounded-full w-4 h-4 bg-gray-700",loading:"lazy",onError:Qe}),i.jsx("span",{className:"text-[#8a8a8a] text-xs",children:"/"}),i.jsx("img",{src:`${s}/${kt}.svg`,alt:kt,className:"rounded-full w-4 h-4 bg-gray-700",loading:"lazy",onError:Qe})]}):i.jsx("img",{src:at.kind==="hip3"?`${s}/${at.builder}:${at.symbol.replace(/-USDC$/,"").replace(/-USDH$/,"")}.svg`:`${s}/${oe(at.symbol)}.svg`,alt:at.symbol,className:"rounded-full w-4 h-4 bg-gray-700",loading:"lazy",onError:Qe})}),i.jsx("span",{className:"font-semibold text-white",children:a==="pair"||at.kind==="hip3"?at.symbol:at.symbol.replace(/-USD$/,"").replace(/\/USD$/,"")}),a!=="pair"&&i.jsxs("span",{className:"ml-1 inline-flex items-center gap-1",children:[at.leverage&&i.jsxs("span",{className:"px-1.5 py-[2px] rounded-[6px] bg-[rgba(103,255,189,0.16)] text-[#67FFBD] text-[11px] font-semibold",children:[at.leverage,"x"]}),at.kind==="hip3"&&at.builder&&i.jsx("span",{className:"px-1.5 py-[2px] rounded-[6px] bg-[rgba(103,255,189,0.16)] text-[#67FFBD] text-[11px] font-semibold uppercase",children:at.builder})]})]})}),i.jsx("td",{className:"text-right text-white font-medium align-middle",children:i.jsx(tt,{children:at.last==null||at.last===0?"--":V(at.last)})}),a!=="pair"&&i.jsxs(i.Fragment,{children:[i.jsx("td",{className:"text-right font-medium align-middle",children:i.jsx(tt,{children:at.chg24==null||isNaN(Number(at.chg24))||at.last==null||at.last===0?"--":(()=>{const jt=Number(at.chg24),un=Number(at.last),cn=un/(1+jt/100||1),Pt=un-cn,Xe=Math.abs(Pt);let Vt;Xe>=1e3?Vt=0:Xe>=100?Vt=2:Vt=4;const Yt=Pt>=0?"+":"-",Ve=Xe.toLocaleString(void 0,{minimumFractionDigits:Vt,maximumFractionDigits:Vt}),Ke=`${jt>0?"+":""}${jt.toFixed(2)}%`,ft=jt>0?"#67FFBD":"#FF7173";return i.jsx("span",{style:{color:ft},children:`${Yt}${Ve} / ${Ke}`})})()})}),i.jsx("td",{className:"text-right text-white font-medium align-middle",children:i.jsx(tt,{children:G(at.vol)})}),i.jsx("td",{className:"text-right text-white font-medium align-middle",children:i.jsx(tt,{children:at.funding==null||isNaN(Number(at.funding))?"--":(Number(at.funding)*100).toFixed(4)+"%"})}),i.jsx("td",{className:"text-right text-white font-medium align-middle",children:i.jsx(tt,{children:at.openInterest==null||isNaN(Number(at.openInterest))?"--":"$"+G(at.openInterest)})})]})]},tn)})})]})})]})})]})}let WP=null;function Odn(){return typeof window>"u"?null:(WP||(WP=new Audio("/success.mp3"),WP.volume=.9),WP)}function Mdn(){const e=Odn();if(e)try{e.currentTime=0;const t=e.play();t&&typeof t.then=="function"&&t.catch(function(){})}catch{}}function Rdn(){const e=typeof window<"u"?window.ethereum:null;if(!e)return null;if(Array.isArray(e.providers)&&e.providers.length){const t=e.providers.find(r=>r&&r.isMetaMask);if(t)return t;const n=e.providers.find(r=>r&&r.isCoinbaseWallet);return n||e.providers[0]}return e}let tre=null;function Ldn(e){typeof e=="object"&&!Array.isArray(e)?tre=e:tre=null}async function Ddn(e,t){let n=await e.request({method:"eth_chainId"});if((n==null?void 0:n.toLowerCase())!==t.toLowerCase()){try{await e.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]})}catch(r){if(r&&r.code===4902)await e.request({method:"wallet_addEthereumChain",params:[{chainId:t,chainName:"Arbitrum One",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:["https://arb1.arbitrum.io/rpc"],blockExplorerUrls:["https://arbiscan.io/"]}]});else throw r}if(n=await e.request({method:"eth_chainId"}),(n==null?void 0:n.toLowerCase())!==t.toLowerCase())throw new Error(`Wrong network after switch: active ${parseInt(n,16)} expected ${parseInt(t,16)}.`)}}function W4e(e,t){return fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t||{})}).then(n=>{if(!n.ok)throw new Error(`HTTP ${n.status} on ${e}`);return n.json()})}function q4e(e){if(typeof e=="function")return e();const t=typeof window<"u"?window.localStorage.getItem("hyperAddress"):null,n=typeof window<"u"?window.localStorage.getItem("hyperToken"):null;return{address:t,token:n}}function mX(e){if(typeof window>"u")return null;for(const t of e){const n=window.localStorage.getItem(t);if(n!=null&&n!=="")return n}return null}function bue(e){const t=e&&e.response&&e.response.data&&e.response.data.statuses,n=e&&e.statuses;return Array.isArray(t)?t:Array.isArray(n)?n:[]}function Bdn(e){return bue(e).some(t=>{const n=String(t.status||t.s||"").toLowerCase();return n.includes("placed")||n.includes("resting")})}function $dn(e){return bue(e).some(n=>{const r=String(n.status||n.s||"").toLowerCase();return r.includes("filled")||r.includes("success")||!!n.filled})}function qP(e){const t=new Set;function n(r){if(!r||typeof r!="object"||t.has(r))return null;if(t.add(r),r.oid!=null&&!Number.isNaN(Number(r.oid)))return Number(r.oid);if(r.o!=null&&!Number.isNaN(Number(r.o)))return Number(r.o);for(const s in r){const a=n(r[s]);if(a!=null)return a}return null}return n(e)}function GN({baseUrl:e="https://api.hyperliquid.xyz",address:t,signer:n,vaultAddress:r=null,dex:s="",defaultSlippage:a=.08,isMainnet:o=!0,signatureChainIdHex:l="0xa4b1",getPK:c=()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,dextraApiBase:u="https://dextrabothypev2.nftinit.io",builderAddress:d="0x49ae63056b3a0be0b166813ee687309ab653c07c",getAuth:f,defaultFromStart:x="website",defaultAppType:g="terminal",defaultLeverage:v=null,getLeverage:w,feeTtlMs:C=12e4}={}){if(!t)throw new Error("address is required for info calls");if(!n||typeof n.sign!="function")throw new Error("signer with sign(action, nonce) is required for exchange actions");let N=null;const I={"Content-Type":"application/json"},P=6,R=o?"Mainnet":"Testnet",F=async(qe,lt)=>{const xt=e+qe,Nt=await fetch(xt,{method:"POST",headers:I,body:JSON.stringify(lt)});if(!Nt.ok)throw new Error(`HTTP ${Nt.status} on ${qe}`);return Nt.json()},U=(qe,lt)=>{if(!qe||typeof qe!="object")return NaN;const xt=String(lt||"").trim();if(!xt)return NaN;const Nt=xt.toUpperCase();if(qe[xt]!=null){const dn=Number(qe[xt]);if(Number.isFinite(dn))return dn}if(qe[Nt]!=null){const dn=Number(qe[Nt]);if(Number.isFinite(dn))return dn}const It=Nt.indexOf("-");if(It>0){const dn=Nt.slice(0,It);if(Nt.slice(It+1)==="PERP"&&qe[dn]!=null){const _n=Number(qe[dn]);if(Number.isFinite(_n))return _n}}const xn=Object.keys(qe).find(dn=>String(dn).toUpperCase()===Nt);if(xn){const dn=Number(qe[xn]);if(Number.isFinite(dn))return dn}return NaN},L={allMids:async()=>F("/info",{type:"allMids",dex:s}),openOrders:async(qe=t)=>F("/info",{type:"openOrders",user:qe,dex:s}),frontendOpenOrders:async(qe=t)=>F("/info",{type:"frontendOpenOrders",user:qe,dex:s}),clearinghouseState:async(qe=t)=>F("/info",{type:"clearinghouseState",user:qe,dex:s}),meta:async()=>{if(N)return N;const qe=await F("/info",{type:"allPerpMetas"});return N=qe,qe},metaAndAssetCtxs:async()=>F("/info",{type:"metaAndAssetCtxs",dex:s}),twapHistory:async(qe=t)=>F("/info",{type:"twapHistory",user:qe,dex:s}),userTwapSliceFills:async(qe=t)=>F("/info",{type:"userTwapSliceFills",user:qe,dex:s}),userTwapSliceFillsByTime:async({user:qe=t,startTime:lt,endTime:xt,aggregateByTime:Nt}={})=>{const It={type:"userTwapSliceFillsByTime",user:qe,startTime:lt,dex:s};return xt!=null&&(It.endTime=xt),Nt!=null&&(It.aggregateByTime=!!Nt),F("/info",It)}};async function z(qe){const lt=await X(),xt=String(qe).toUpperCase();for(let Nt=0;Nt<lt.length;Nt++){const It=lt[Nt];if(Array.isArray(It.universe)){const xn=It.universe.findIndex(dn=>dn.name.toUpperCase()===xt);if(xn!==-1){let dn;return Nt===0?dn=xn:dn=1e5+Nt*1e4+xn,{entry:It.universe[xn],index:dn,block:It}}}}throw new Error(`Unknown perp symbol: ${qe}`)}const X=async()=>{if(N)return N;const qe=await L.meta();return N=qe,qe},ne=async qe=>(await z(qe)).index,J=async qe=>(await z(qe)).entry.szDecimals,Z=qe=>{const[lt,xt=""]=String(qe).split(".");if(!xt)return lt;const Nt=xt.replace(/0+$/,"");return Nt.length?`${lt}.${Nt}`:lt},re=async(qe,lt)=>{const xt=await J(qe),Nt=Math.max(0,P-Number(xt)),It=Math.abs(Number(lt));if(!(It>0)||!Number.isFinite(It))return Nt;const xn=It>=1?Math.floor(Math.log10(It))+1:0,dn=Math.max(0,5-xn);return Math.min(Nt,dn)},he=async(qe,lt)=>{const xt=await re(qe,lt);return Number((1/10**xt).toFixed(xt))},Y=async(qe,lt,xt)=>{const Nt=await re(qe,lt),It=10**-Nt,xn=Number(lt),dn=xt?Math.floor(xn/It)*It:Math.ceil(xn/It)*It;return Z(Number(dn).toFixed(Nt))},ie=async(qe,lt)=>{if(lt==null||!Number.isFinite(Number(lt)))throw new Error("price required");const xt=await re(qe,lt),Nt=Number(lt),It=xt===0?Math.round(Nt):Math.round(Nt*10**xt)/10**xt;return Z(It.toFixed(xt))},oe=async(qe,lt)=>{if(lt==null||!Number.isFinite(Number(lt)))throw new Error("size required");const xt=await J(qe);return Z(Number(lt).toFixed(Number(xt)))},G=async(qe,lt,xt,Nt=a)=>{let It=xt;if(It==null){let dn=U(tre,qe);if(!Number.isFinite(dn)){const Mn=await L.allMids();dn=U(Mn,qe)}if(It=dn,!Number.isFinite(It))throw new Error(`Mid price not available for ${qe}`)}const xn=lt?It*(1+Nt):It*(1-Nt);return Y(qe,xn,lt)},V=new Set(["usdSend","spotSend","usdClassTransfer","withdraw3","cDeposit","cWithdraw","approveBuilderFee"]),ee=()=>({name:"HyperliquidSignTransaction",version:"1",chainId:parseInt(l,16),verifyingContract:"0x0000000000000000000000000000000000000000"}),ae=(qe,lt)=>{switch(qe.type){case"usdSend":return{primaryType:"HyperliquidTransaction:UsdSend",types:{"HyperliquidTransaction:UsdSend":[{name:"hyperliquidChain",type:"string"},{name:"destination",type:"string"},{name:"amount",type:"string"},{name:"time",type:"uint64"}]},message:{hyperliquidChain:R,destination:String(qe.destination).toLowerCase(),amount:String(qe.amount),time:lt}};case"spotSend":return{primaryType:"HyperliquidTransaction:SpotSend",types:{"HyperliquidTransaction:SpotSend":[{name:"hyperliquidChain",type:"string"},{name:"destination",type:"string"},{name:"token",type:"string"},{name:"amount",type:"string"},{name:"time",type:"uint64"}]},message:{hyperliquidChain:R,destination:String(qe.destination).toLowerCase(),token:qe.token,amount:String(qe.amount),time:lt}};case"usdClassTransfer":return{primaryType:"HyperliquidTransaction:UsdClassTransfer",types:{"HyperliquidTransaction:UsdClassTransfer":[{name:"hyperliquidChain",type:"string"},{name:"amount",type:"string"},{name:"toPerp",type:"bool"},{name:"nonce",type:"uint64"}]},message:{hyperliquidChain:R,amount:String(qe.amount),toPerp:!!qe.toPerp,nonce:lt}};case"withdraw3":return{primaryType:"HyperliquidTransaction:Withdraw",types:{"HyperliquidTransaction:Withdraw":[{name:"hyperliquidChain",type:"string"},{name:"destination",type:"string"},{name:"amount",type:"string"},{name:"time",type:"uint64"}]},message:{hyperliquidChain:R,destination:String(qe.destination).toLowerCase(),amount:String(qe.amount),time:lt}};case"cDeposit":return{primaryType:"HyperliquidTransaction:CDeposit",types:{"HyperliquidTransaction:CDeposit":[{name:"hyperliquidChain",type:"string"},{name:"wei",type:"string"},{name:"nonce",type:"uint64"}]},message:{hyperliquidChain:R,wei:String(qe.wei),nonce:lt}};case"cWithdraw":return{primaryType:"HyperliquidTransaction:CWithdraw",types:{"HyperliquidTransaction:CWithdraw":[{name:"hyperliquidChain",type:"string"},{name:"wei",type:"string"},{name:"nonce",type:"uint64"}]},message:{hyperliquidChain:R,wei:String(qe.wei),nonce:lt}};case"approveBuilderFee":return{primaryType:"HyperliquidTransaction:ApproveBuilderFee",types:{"HyperliquidTransaction:ApproveBuilderFee":[{name:"hyperliquidChain",type:"string"},{name:"maxFeeRate",type:"string"},{name:"builder",type:"address"},{name:"nonce",type:"uint64"}]},message:{hyperliquidChain:R,maxFeeRate:qe.maxFeeRate.endsWith("%")?qe.maxFeeRate:`${qe.maxFeeRate}%`,builder:qe.builder.toLowerCase(),nonce:lt}};default:return null}},fe=qe=>{const lt=Zc.from(qe),xt=lt.v>=27?lt.v:lt.v+27;return{r:lt.r,s:lt.s,v:xt}},Ae=async(qe,lt)=>{const xt=ae(qe,lt);if(!xt)throw new Error("Unsupported typed action");const Nt=ee(),It=Object.assign({},xt.types,{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}]}),xn=(c()||"").trim();if(xn){const _n=await new _ae(xn).signTypedData(Nt,xt.types,xt.message);return fe(_n)}const dn=Rdn();if(dn){await Ddn(dn,l);let Mn=await dn.request({method:"eth_accounts"});(!Mn||!Mn.length)&&(Mn=await dn.request({method:"eth_requestAccounts"}));const _n=Mn[0];if(!_n)throw new Error("No connected account in wallet");if(String(_n).toLowerCase()!==String(t).toLowerCase())throw new Error(`Connected wallet ${_n} does not match HL address ${t}.`);const kn={domain:Nt,types:It,primaryType:xt.primaryType,message:xt.message},vn=await dn.request({method:"eth_signTypedData_v4",params:[_n,JSON.stringify(kn)]});return fe(vn)}throw new Error("No signer for typed action")};let ce={ts:0,fee:null};async function ye(qe=!1){const lt=Date.now();if(!qe&&ce.fee!=null&&lt-ce.ts<C)return{builder_fee:ce.fee};const{address:xt,token:Nt}=q4e(f);if(!xt||!Nt)return{builder_fee:null};const It=u+"/api/subscriber/check_account/",xn=await W4e(It,{address:xt,token:Nt}),dn=(xn==null?void 0:xn.builder_fee)!=null?Number(xn.builder_fee):null;return ce={ts:lt,fee:dn},{builder_fee:dn}}async function Ne(qe){if(qe.type!=="order")return qe;const{builder_fee:lt}=await ye();return lt==null?qe:{...qe,builder:{b:d,f:Number(lt)}}}function be(qe){return qe!=null&&qe.fromStart?qe.fromStart:mX(["dextra_from_start","from_start"])||x||null}function je(qe){return qe!=null&&qe.appType?qe.appType:mX(["dextra_app_type","app_type"])||g||null}async function Ie(qe,lt){if((lt==null?void 0:lt.leverage)!=null)return Number(lt.leverage);if(typeof w=="function"){const Nt=await w(qe);if(Nt!=null)return Number(Nt)}const xt=mX([`leverage:${qe}`,`${qe}_leverage`,"dextra_leverage","hl_leverage","leverage"])||v;return xt!=null?Number(xt):null}async function Re(qe){const lt=await L.clearinghouseState(t),xt=((lt==null?void 0:lt.assetPositions)||[]).find(It=>{var xn,dn;return((dn=(xn=It==null?void 0:It.position)==null?void 0:xn.coin)==null?void 0:dn.toUpperCase())===String(qe).toUpperCase()});if(!xt)return null;const Nt=Number(xt.position.szi||0);return{side:Nt>=0?"long":"short",size:Math.abs(Nt)}}async function Qe({symbol:qe,isBuy:lt,usePosSide:xt,size:Nt,price:It,telemetry:xn,oid:dn}){var Nn;if(!dn&&dn!==0)return;const{address:Mn,token:_n}=q4e(f);if(!Mn||!_n)return;const kn=typeof window<"u"?window.localStorage.getItem("hl:wallet_id"):null,vn=qe?await Ie(qe,xn):null,Qn=xt&&((Nn=await Re(qe))==null?void 0:Nn.side)||(lt?"long":"short"),{builder_fee:Hn}=await ye(),$n={address:Mn,token:_n,order_params:{coin:String(qe),wallet_id:kn!=null?Number(kn):null,leverage:vn!=null?Number(vn):null,size:Nt!=null?Number(Nt):null,from_start:be(xn),app_type:je(xn),price:It!=null?Number(It):null,fee_amount:Hn!=null?Number(Hn):null,side:String(Qn),oid:Number(dn)}},Jn=u+"/api/hyper/order_save/";try{await W4e(Jn,$n)}catch{}}async function Be(qe,lt){const xt=lt??Date.now(),Nt=qe.type==="order"?await Ne(qe):qe,It=V.has(Nt.type)?await Ae(Nt,xt):await n.sign(Nt,xt),xn={action:Nt,nonce:xt,signature:It,...r?{vaultAddress:r}:{}};return F("/exchange",xn)}async function it(qe,lt){var dn;const xt=await Be(qe),Nt=bue(xt),It=$dn(xt)||Bdn(xt)||(xt==null?void 0:xt.status)==="ok"||((dn=xt==null?void 0:xt.response)==null?void 0:dn.status)==="ok";let xn=null;return It&&(Mdn(),xn=qP(xt),xn==null&&Nt&&Nt.length&&(xn=qP(Nt))),await Qe({symbol:lt.symbol,isBuy:lt.isBuy,usePosSide:!!lt.usePosSide,size:lt.size,price:lt.price,telemetry:lt.telemetry,oid:xn}),xt}const tt=async({symbol:qe,isBuy:lt,size:xt,price:Nt,tif:It="Gtc",reduceOnly:xn=!1,cloid:dn,builder:Mn,telemetry:_n}={})=>{const kn=await ne(qe),vn=await oe(qe,xt),Qn=await Y(qe,Nt,!!lt),$n={type:"order",orders:[{a:kn,b:!!lt,p:Qn,s:vn,r:!!xn,t:{limit:{tif:It}},...dn?{c:dn}:{}}],grouping:"na",...Mn?{builder:Mn}:{}};return it($n,{symbol:qe,isBuy:lt,size:vn,price:Qn,telemetry:_n,usePosSide:!1})},at=async({symbol:qe,isBuy:lt,size:xt,price:Nt,tif:It="Gtc",reduceOnly:xn=!1,tpPrice:dn=null,slPrice:Mn=null,triggerSlippage:_n=.08,cloid:kn,builder:vn,telemetry:Qn}={})=>{const Hn=await ne(qe),$n=await oe(qe,xt),Jn=[],Nn=await Y(qe,Nt,!!lt);Jn.push({a:Hn,b:!!lt,p:Nn,s:$n,r:!!xn,t:{limit:{tif:It}},...kn?{c:kn}:{}});const ln=!lt;if(Mn!=null&&Mn!==""&&Number(Mn)>0){const sn=await ie(qe,Mn),fn=await G(qe,ln,Number(sn),_n);Jn.push({a:Hn,b:ln,p:fn,s:$n,r:!0,t:{trigger:{isMarket:!0,triggerPx:sn,tpsl:"sl"}}})}if(dn!=null&&dn!==""&&Number(dn)>0){const sn=await ie(qe,dn),fn=await G(qe,ln,Number(sn),_n);Jn.push({a:Hn,b:ln,p:fn,s:$n,r:!0,t:{trigger:{isMarket:!0,triggerPx:sn,tpsl:"tp"}}})}const Oe={type:"order",orders:Jn,grouping:Jn.length>1?"normalTpsl":"na",...vn?{builder:vn}:{}};return it(Oe,{symbol:qe,isBuy:lt,size:$n,price:Nn,telemetry:Qn,usePosSide:!1})},dt=async({symbol:qe,tpPrice:lt=null,slPrice:xt=null,size:Nt=null,useLimitPx:It=!1,triggerSlippage:xn=.1,telemetry:dn}={})=>{const Mn=await Re(qe);if(!Mn)throw new Error(`No open position for ${qe}`);const _n=await ne(qe),kn=await oe(qe,Nt??Mn.size),vn=Mn.side==="short",Qn=[];let Hn=null;if(xt!=null&&Number(xt)>0){const Jn=await ie(qe,xt),Nn=It?Jn:await G(qe,vn,Number(Jn),xn);Qn.push({a:_n,b:vn,p:Nn,s:kn,r:!0,t:{trigger:{isMarket:!It,triggerPx:Jn,tpsl:"sl"}}}),Hn=Hn??Jn}if(lt!=null&&Number(lt)>0){const Jn=await ie(qe,lt),Nn=It?Jn:await G(qe,vn,Number(Jn),xn);Qn.push({a:_n,b:vn,p:Nn,s:kn,r:!0,t:{trigger:{isMarket:!It,triggerPx:Jn,tpsl:"tp"}}}),Hn=Hn??Jn}if(!Qn.length)throw new Error("TP/SL price required");return it({type:"order",orders:Qn,grouping:"normalTpsl"},{symbol:qe,isBuy:vn,size:kn,price:Hn??0,telemetry:dn,usePosSide:!0})},ct=async(qe={})=>(await Xe({filter:"tpsl",symbol:qe.symbol}),dt(qe)),Ut=async(qe,lt,xt,{price:Nt,slippage:It=a,cloid:xn,tif:dn="Ioc",reduceOnly:Mn=!1,builder:_n,telemetry:kn}={})=>{const vn=await G(qe,lt,Nt,It);return tt({symbol:qe,isBuy:lt,size:xt,price:vn,tif:"FrontendMarket",reduceOnly:Mn,cloid:xn,builder:_n,telemetry:kn})},kt=async(qe,lt,{price:xt,slippage:Nt=a,cloid:It,tif:xn="Ioc",reduceOnly:dn=!0,builder:Mn,telemetry:_n}={})=>{let kn,vn=lt;if(vn==null){const ln=await L.clearinghouseState(t),Oe=((ln==null?void 0:ln.assetPositions)||[]).find(fn=>{var Et,Kn;return((Kn=(Et=fn==null?void 0:fn.position)==null?void 0:Et.coin)==null?void 0:Kn.toUpperCase())===String(qe).toUpperCase()});if(!Oe)throw new Error(`No position found for ${qe}`);const sn=parseFloat(Oe.position.szi);if(!sn)throw new Error(`No open size on ${qe}`);vn=Math.abs(sn),kn=sn<0}else try{const ln=await L.clearinghouseState(t),Oe=((ln==null?void 0:ln.assetPositions)||[]).find(fn=>{var Et,Kn;return((Kn=(Et=fn==null?void 0:fn.position)==null?void 0:Et.coin)==null?void 0:Kn.toUpperCase())===String(qe).toUpperCase()});kn=(Oe?parseFloat(Oe.position.szi):0)<0}catch{kn=!1}const Qn=await G(qe,kn,xt,Nt),Hn=await ne(qe),$n=await oe(qe,vn),Nn={type:"order",orders:[{a:Hn,b:kn,p:Qn,s:$n,r:!0,t:{limit:{tif:"FrontendMarket"}},...It?{c:It}:{}}],grouping:"na",...Mn?{builder:Mn}:{}};return it(Nn,{symbol:qe,isBuy:kn,size:$n,price:Qn,telemetry:_n,usePosSide:!0})},tn=async qe=>{const lt=await L.openOrders(t),xt=qe?lt.filter(dn=>dn.coin.toUpperCase()===String(qe).toUpperCase()):lt;if(!xt.length)return{status:"ok",response:{type:"cancel",data:{count:0}}};const Nt=new Map;for(const dn of xt)Nt.has(dn.coin)||Nt.set(dn.coin,await ne(dn.coin));const xn={type:"cancel",cancels:xt.map(dn=>({a:Nt.get(dn.coin),o:Number(dn.oid)}))};return Be(xn)},jt=async qe=>{const lt=qe==null?{type:"scheduleCancel"}:{type:"scheduleCancel",time:Date.now()+Math.max(5e3,Number(qe))};return Be(lt)},un=async({symbol:qe,isBuy:lt,size:xt,minutes:Nt,randomize:It=!1,reduceOnly:xn=!1}={})=>{var Hn,$n,Jn,Nn,ln,Oe,sn,fn;const dn=await ne(qe),Mn=await oe(qe,xt),kn={type:"twapOrder",twap:{a:dn,b:!!lt,s:Mn,r:!!xn,m:Number(Nt),t:!!It}},vn=await Be(kn),Qn=((Jn=($n=(Hn=vn==null?void 0:vn.response)==null?void 0:Hn.data)==null?void 0:$n.status)==null?void 0:Jn.error)||((ln=(Nn=vn==null?void 0:vn.response)==null?void 0:Nn.data)==null?void 0:ln.error)||((sn=(Oe=vn==null?void 0:vn.data)==null?void 0:Oe.status)==null?void 0:sn.error)||((fn=vn==null?void 0:vn.data)==null?void 0:fn.error);if(Qn)throw new Error(Qn);return vn},cn=async({symbol:qe,twapId:lt}={})=>{const Nt={type:"twapCancel",a:await ne(qe),t:Number(lt)};return Be(Nt)},Pt=async({symbol:qe,oid:lt,cloid:xt}={})=>{const Nt=await ne(qe);if(lt!=null&&/^\d+$/.test(String(lt)))return Be({type:"cancel",cancels:[{a:Nt,o:Number(lt)}]});if(xt)return Be({type:"cancelByCloid",cancels:[{asset:Nt,cloid:String(xt)}]});throw new Error("cancelOrder requires a numeric oid or a cloid")},Xe=async({filter:qe="all",symbol:lt=null}={})=>{const xt=await L.openOrders(t),Nt=Array.isArray(xt)?xt:[],It=kn=>{const vn=String(kn.orderType||kn.type||"").toLowerCase();return qe==="all"?!0:qe==="limit"?vn==="limit":qe==="tpsl"?vn.includes("take profit")||vn.includes("stop"):qe==="reduceOnly"?!!kn.reduceOnly:qe==="nonReduce"?!kn.reduceOnly:!1},xn=Nt.filter(kn=>(!lt||String(kn.coin).toUpperCase()===String(lt).toUpperCase())&&It(kn));if(!xn.length)return{ok:!0,count:0};const dn=new Map,Mn=[];for(const kn of xn){let vn=dn.get(kn.coin);vn||(vn=await ne(kn.coin),dn.set(kn.coin,vn)),Mn.push({a:vn,o:Number(kn.oid)})}return Be({type:"cancel",cancels:Mn})},Vt=async()=>{const qe=await L.clearinghouseState(t),xt=(Array.isArray(qe==null?void 0:qe.assetPositions)?qe.assetPositions:[]).map(Nt=>Nt==null?void 0:Nt.position).filter(Nt=>Math.abs(Number((Nt==null?void 0:Nt.szi)||0))>0);for(const Nt of xt){const It=Nt.coin,xn=Math.abs(Number(Nt.szi));await kt(It,xn,{tif:"FrontendMarket",reduceOnly:!0})}return!0},Yt={usdTransfer:async(qe,lt)=>{const xt=Date.now(),Nt={type:"usdSend",hyperliquidChain:R,signatureChainId:l,destination:String(qe).toLowerCase(),amount:String(lt),time:xt};return Be(Nt)},spotTransfer:async(qe,lt,xt)=>{const Nt=Date.now(),It={type:"spotSend",hyperliquidChain:R,signatureChainId:l,destination:String(qe).toLowerCase(),token:lt,amount:String(xt),time:Nt};return Be(It)},usdClassTransfer:async(qe,lt)=>{const xt=Date.now(),Nt={type:"usdClassTransfer",hyperliquidChain:R,signatureChainId:l,amount:String(qe),toPerp:!!lt,nonce:xt};return Be(Nt,xt)},withdraw:async(qe,lt)=>{const xt=Date.now(),Nt={type:"withdraw3",hyperliquidChain:R,signatureChainId:l,destination:String(qe).toLowerCase(),amount:String(lt),time:xt};return Be(Nt,xt)},cDeposit:async qe=>{const lt=Date.now(),xt={type:"cDeposit",hyperliquidChain:R,signatureChainId:l,wei:String(qe),nonce:lt};return Be(xt,lt)},cWithdraw:async qe=>{const lt=Date.now(),xt={type:"cWithdraw",hyperliquidChain:R,signatureChainId:l,wei:String(qe),nonce:lt};return Be(xt,lt)},approveBuilderFee:async({builder:qe,maxFeeRate:lt})=>{const xt=Date.now(),Nt={type:"approveBuilderFee",hyperliquidChain:R,signatureChainId:l,builder:String(qe).toLowerCase(),maxFeeRate:String(lt),nonce:xt};return Be(Nt,xt)}},Ve=(()=>{const qe="hl:pairs",lt=()=>{try{return JSON.parse(localStorage.getItem(qe)||"[]")}catch{return[]}},xt=Mn=>{try{localStorage.setItem(qe,JSON.stringify(Mn))}catch{}};return{read:lt,write:xt,get:Mn=>lt().find(_n=>_n.id===Mn)||null,add:Mn=>{const _n=lt();_n.push(Mn),xt(_n)},upsert:Mn=>{const _n=lt().filter(kn=>kn.id!==Mn.id);_n.push(Mn),xt(_n)},remove:Mn=>xt(lt().filter(_n=>_n.id!==Mn))}})(),Ke=(qe="PAIR")=>`${qe}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;async function ft(qe,lt,xt,Nt,It){const xn=[{symbol:lt.symbol,side:"long",size:Number(lt.size),oid:qP(Nt)??null},{symbol:xt.symbol,side:"short",size:Number(xt.size),oid:qP(It)??null}];return Ve.add({id:qe,createdAt:Date.now(),legs:xn}),{pairId:qe,long:{oid:xn[0].oid},short:{oid:xn[1].oid}}}const en=async({long:qe,short:lt,entrySlippage:xt=a,triggerSlippage:Nt=.1,telemetry:It,pairId:xn}={})=>{if(!(qe!=null&&qe.symbol)||!(lt!=null&&lt.symbol))throw new Error("pair requires long.symbol and short.symbol");if(!(Number(qe.size)>0)||!(Number(lt.size)>0))throw new Error("pair sizes must be > 0");const dn=xn||Ke(),[Mn,_n]=await Promise.all([placeMarketWithTPSL({symbol:qe.symbol,isBuy:!0,size:Number(qe.size),entrySlippage:xt,tpPrice:qe.tpPrice??null,slPrice:qe.slPrice??null,triggerSlippage:Nt,telemetry:It,cloid:`${dn}:L`}),placeMarketWithTPSL({symbol:lt.symbol,isBuy:!1,size:Number(lt.size),entrySlippage:xt,tpPrice:lt.tpPrice??null,slPrice:lt.slPrice??null,triggerSlippage:Nt,telemetry:It,cloid:`${dn}:S`})]);return ft(dn,qe,lt,Mn,_n)},Dt=async({long:qe,short:lt,triggerSlippage:xt=a,telemetry:Nt,pairId:It}={})=>{if(!(qe!=null&&qe.symbol)||!(lt!=null&&lt.symbol))throw new Error("pair requires long.symbol and short.symbol");const xn=It||Ke(),[dn,Mn]=await Promise.all([qe.tpPrice||qe.slPrice?at({symbol:qe.symbol,isBuy:!0,size:Number(qe.size),price:Number(qe.price),tif:String(qe.tif||"Gtc"),reduceOnly:!!qe.reduceOnly,tpPrice:qe.tpPrice??null,slPrice:qe.slPrice??null,triggerSlippage:xt,telemetry:Nt,cloid:`${xn}:L`}):tt({symbol:qe.symbol,isBuy:!0,size:Number(qe.size),price:Number(qe.price),tif:String(qe.tif||"Gtc"),reduceOnly:!!qe.reduceOnly,telemetry:Nt,cloid:`${xn}:L`}),lt.tpPrice||lt.slPrice?at({symbol:lt.symbol,isBuy:!1,size:Number(lt.size),price:Number(lt.price),tif:String(lt.tif||"Gtc"),reduceOnly:!!lt.reduceOnly,tpPrice:lt.tpPrice??null,slPrice:lt.slPrice??null,triggerSlippage:xt,telemetry:Nt,cloid:`${xn}:S`}):tt({symbol:lt.symbol,isBuy:!1,size:Number(lt.size),price:Number(lt.price),tif:String(lt.tif||"Gtc"),reduceOnly:!!lt.reduceOnly,telemetry:Nt,cloid:`${xn}:S`})]);return ft(xn,qe,lt,dn,Mn)},At=async({long:qe,short:lt,telemetry:xt,pairId:Nt}={})=>{if(!(qe!=null&&qe.symbol)||!(lt!=null&&lt.symbol))throw new Error("pair requires long.symbol and short.symbol");const It=Nt||Ke(),[xn,dn]=await Promise.all([un({symbol:qe.symbol,isBuy:!0,size:Number(qe.size),minutes:Number(qe.minutes),randomize:!!qe.randomize,reduceOnly:!!qe.reduceOnly}),un({symbol:lt.symbol,isBuy:!1,size:Number(lt.size),minutes:Number(lt.minutes),randomize:!!lt.randomize,reduceOnly:!!lt.reduceOnly})]);return ft(It,qe,lt,xn,dn)};async function Je(qe){var It;const lt=await L.clearinghouseState(t),xt=((lt==null?void 0:lt.assetPositions)||[]).find(xn=>{var dn,Mn;return((Mn=(dn=xn==null?void 0:xn.position)==null?void 0:dn.coin)==null?void 0:Mn.toUpperCase())===String(qe).toUpperCase()}),Nt=Number(((It=xt==null?void 0:xt.position)==null?void 0:It.szi)||0);return{size:Math.abs(Nt),side:Nt>=0?"long":"short"}}return{updateLeverage:async(qe,lt,xt)=>{var Mn,_n,kn,vn,Qn,Hn,$n,Jn;const It={type:"updateLeverage",asset:await ne(qe),isCross:String(lt||"").toLowerCase()==="cross",leverage:Number(xt)},xn=await Be(It),dn=((kn=(_n=(Mn=xn==null?void 0:xn.response)==null?void 0:Mn.data)==null?void 0:_n.status)==null?void 0:kn.error)||((Qn=(vn=xn==null?void 0:xn.response)==null?void 0:vn.data)==null?void 0:Qn.error)||(($n=(Hn=xn==null?void 0:xn.data)==null?void 0:Hn.status)==null?void 0:$n.error)||((Jn=xn==null?void 0:xn.data)==null?void 0:Jn.error)||((xn==null?void 0:xn.status)==="err"?xn==null?void 0:xn.response:null);if(dn)throw new Error(String(dn));return xn},placeOrder:tt,placeLimitWithTPSL:at,placeTPSLForPosition:dt,replaceTPSLForPosition:ct,cancelAllOrders:tn,scheduleCancel:jt,marketOpen:Ut,marketClose:kt,placeMarketWithTPSL:async qe=>{const lt=await G(qe.symbol,qe.isBuy,null,qe.entrySlippage??a);return at({...qe,price:Number(lt),tif:"FrontendMarket"})},placeTwapOrder:un,cancelTwapOrder:cn,cancelOrder:Pt,cancelOrdersFiltered:Xe,closeAllPositions:Vt,marketOpenPair:en,limitOpenPair:Dt,twapOpenPair:At,marketClosePair:async({pairId:qe,slippage:lt=a,fraction:xt=1,telemetry:Nt}={})=>{const It=Ve.get(qe);if(!It)throw new Error("Unknown pairId");const[xn]=It.legs.filter(Nn=>Nn.side==="long"),[dn]=It.legs.filter(Nn=>Nn.side==="short");if(!xn||!dn)throw new Error("Pair legs corrupted");const[Mn,_n]=await Promise.all([Je(xn.symbol),Je(dn.symbol)]),kn=Math.max(0,Math.min(Mn.size,xn.size)*Number(xt||1)),vn=Math.max(0,Math.min(_n.size,dn.size)*Number(xt||1)),Qn=[];if(kn>0&&Qn.push(kt(xn.symbol,kn,{slippage:lt,reduceOnly:!0,telemetry:Nt,cloid:`${qe}:L:CLOSE`})),vn>0&&Qn.push(kt(dn.symbol,vn,{slippage:lt,reduceOnly:!0,telemetry:Nt,cloid:`${qe}:S:CLOSE`})),!Qn.length)return{pairId:qe,message:"Nothing to close"};const Hn=await Promise.all(Qn),[$n,Jn]=await Promise.all([Je(xn.symbol),Je(dn.symbol)]);return $n.size===0&&Jn.size===0&&Ve.remove(qe),{pairId:qe,results:Hn}},pairs:{list:()=>Ve.read(),get:qe=>Ve.get(qe),remove:qe=>Ve.remove(qe)},info:L,transfers:Yt,utils:{getPerpAssetId:ne,getSzDecimals:J,toPxString:ie,toSzString:oe,withSlippagePx:G,trimZeros:Z,getPxDecimalsAt:re,getTickSize:he,quantizePx:Y}}}const nre="https://api.hyperliquid.xyz/info",Udn="wss://api.hyperliquid.xyz/ws";function zdn(e){const t=String(e||""),n=t.indexOf(":");if(n>=0){const r=t.slice(0,n),s=t.slice(n+1);return{builder:r,symbol:s+(r==="xyz"?"-USDC":"-USDH")}}return{builder:null,symbol:t}}const Ld={rows:[],subs:new Set,started:!1,ws:null,timer:null};function mHe(){for(const e of Ld.subs)try{e(Ld.rows)}catch{}}async function Hdn(){const t=await(await fetch(nre,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({type:"metaAndAssetCtxs"})})).json(),n=Array.isArray(t)?t[0]:t.meta||t||{},r=Array.isArray(t)?t[1]:t.assetCtxs||[];return(n&&n.universe?n.universe:[]).map((o,l)=>{const c=r&&r[l]||{},u=o.name,d=Number(c.markPx??c.midPx??0),f=Number(c.prevDayPx??0);return{kind:"perp",dex:"",builder:"",rawSymbol:u,coin:u,symbol:`${u}-USD`,last:d,prevDayPx:f,chg24:f?(d-f)/f*100:0,vol:Number(c.dayNtlVlm??0),funding:Number(c.funding??0),leverage:o.maxLeverage??null,openInterest:Number(c.openInterest??0)}})}async function Vdn(){try{const t=await(await fetch(nre,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({type:"perpDexs"})})).json();let n=[];Array.isArray(t)?n=t:Array.isArray(t.dexs)&&(n=t.dexs);const r=n.map(a=>a?typeof a=="string"?a:typeof a=="object"&&a.name?a.name:null:null).filter(a=>{if(!a)return!1;const o=String(a),l=o.toLowerCase();return!(o==="HL"||l==="vntl"||l==="flx")}),s=[];for(const a of r)try{const l=await(await fetch(nre,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({type:"metaAndAssetCtxs",dex:a})})).json(),c=Array.isArray(l)?l[0]:l.meta||l||{},u=Array.isArray(l)?l[1]:l.assetCtxs||[],d=c&&c.universe?c.universe:[];for(let f=0;f<d.length;f++){const x=d[f],g=u[f]||{},v=zdn(x.name),w=Number(g.markPx??g.midPx??0),C=Number(g.prevDayPx??0);s.push({kind:"hip3",dex:a,builder:v.builder||a,rawSymbol:x.name,coin:v.symbol,symbol:v.symbol,last:w,prevDayPx:C,chg24:C?(w-C)/C*100:0,vol:Number(g.dayNtlVlm??0),funding:Number(g.funding??0),leverage:x.maxLeverage??null,openInterest:Number(g.openInterest??0)})}}catch{}return s}catch{return[]}}async function G4e(){try{const[e,t]=await Promise.all([Hdn(),Vdn()]);Ld.rows=[...e,...t],mHe()}catch{}}function Wdn(){if(!Ld.started){Ld.started=!0,G4e(),Ld.timer=setInterval(G4e,6e4);try{const e=new WebSocket(Udn);Ld.ws=e,e.onopen=()=>{try{e.send(JSON.stringify({method:"subscribe",subscription:{type:"allMids",dex:"ALL_DEXS"}}))}catch{}},e.onmessage=t=>{let n;try{n=JSON.parse(t.data||"{}")}catch{return}if(n.channel!=="allMids")return;const r=n.data&&n.data.mids||{};Ldn(r);const s=Ld.rows.map(a=>{const o=a.rawSymbol||a.symbol||a.coin,c=String(o).replace(/^[a-z0-9]+:/i,""),u=a.coin,d=a.symbol,f=o,x=r[c]??r[u]??r[d]??r[f]??null;if(x==null)return a;const g=Number(x),v=a.prevDayPx?(g-a.prevDayPx)/a.prevDayPx*100:a.chg24||0;return{...a,last:g,chg24:v}});Ld.rows=s,mHe()},e.onclose=()=>{Ld.ws=null}}catch{}}}function xU(){const[e,t]=m.useState(Ld.rows);return m.useEffect(()=>{Wdn(),t(Ld.rows);const n=r=>{t(r)};return Ld.subs.add(n),()=>{Ld.subs.delete(n)}},[]),e}const xX=({children:e,text:t})=>{const[n,r]=m.useState({x:0,y:0}),[s,a]=m.useState(!1);return i.jsxs("div",{className:"relative inline-block",onMouseMove:o=>{const l=o.currentTarget.getBoundingClientRect();r({x:o.clientX-l.left,y:o.clientY-l.top})},onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[i.jsx("span",{className:"underline decoration-dotted underline-offset-2 cursor-help",children:e}),i.jsx(mT,{children:s&&i.jsx(go.div,{className:"absolute z-50 px-3 py-2 text-xs text-white bg-black rounded-md pointer-events-none shadow-lg w-72",style:{top:n.y+18,left:n.x+18},initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{type:"spring",stiffness:300,damping:25},children:t})})]})},qdn=({coin:e,onCoinChange:t,headerData:n,setIsDigits:r,mode:s="single",pairKey:a="BTC/ETH",onPairChange:o=()=>{},markets:l=[],market:c="hyperliquid"})=>{const u=(n==null?void 0:n.nextFundingTime)??(n==null?void 0:n.nextFundingRate),[d,f]=m.useState(L(u)),[x,g]=m.useState((n==null?void 0:n.markPx)||0),[v,w]=m.useState("text-white"),[C,N]=m.useState({last:null,mark:null,oracle:null}),I=m.useRef((n==null?void 0:n.markPx)||0),P=xU(),R=l.length?l:P,F=c==="hyperliquid"&&s==="pair",U={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};m.useEffect(()=>{if(!F&&(n==null?void 0:n.markPx)!=null){const fe=n.markPx.toString(),Ae=fe.includes(".")?fe.split(".")[1].length:0;r(Ae)}},[F,n==null?void 0:n.markPx]),m.useEffect(()=>{if(!F)return;let fe=!1;const Ae=async()=>{var ce;try{const Ne=await(await fetch("https://api-ui.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"allMids"})})).json(),be=((ce=Ne==null?void 0:Ne.data)==null?void 0:ce.universe)||[],[je,Ie]=String(a).split("/"),Re=be.find(dt=>(dt==null?void 0:dt.name)===je),Qe=be.find(dt=>(dt==null?void 0:dt.name)===Ie),Be=Number((Re==null?void 0:Re.markPx)||0),it=Number((Qe==null?void 0:Qe.markPx)||0),tt=Number((Re==null?void 0:Re.oraclePx)||0),at=Number((Qe==null?void 0:Qe.oraclePx)||0);if(Be>0&&it>0){const dt=Be/it,ct=tt>0&&at>0?tt/at:null;N({last:dt,mark:dt,oracle:ct});const Ut=dt.toString().includes(".")?dt.toString().split(".")[1].length:0;r(Ut)}}catch{}fe||setTimeout(Ae,1500)};return Ae(),()=>{fe=!0}},[F,a]);function L(fe){const Ae=new Date,ce=Ae.getTime(),ye=Number(fe);if(Number.isFinite(ye)&&ye>ce){const it=Math.max(0,Math.floor((ye-ce)/1e3)),tt=String(Math.floor(it/3600)).padStart(2,"0"),at=String(Math.floor(it%3600/60)).padStart(2,"0"),dt=String(it%60).padStart(2,"0");return`${tt}:${at}:${dt}`}Ae.setSeconds(Ae.getSeconds()+1);const Ne=Date.UTC(Ae.getUTCFullYear(),Ae.getUTCMonth(),Ae.getUTCDate(),Ae.getUTCHours(),Ae.getUTCMinutes(),Ae.getUTCSeconds()),je=new Date(Date.UTC(Ae.getUTCFullYear(),Ae.getUTCMonth(),Ae.getUTCDate(),Ae.getUTCHours()+1,0,0,0)).getTime()-Ne,Ie=Math.floor(je/1e3),Re=String(Math.floor(Ie/3600)).padStart(2,"0"),Qe=String(Math.floor(Ie%3600/60)).padStart(2,"0"),Be=String(Ie%60).padStart(2,"0");return`${Re}:${Qe}:${Be}`}m.useEffect(()=>{f(L(u));const fe=setInterval(()=>f(L(u)),1e3);return()=>clearInterval(fe)},[u]),m.useEffect(()=>{if(F){const fe=C.mark;if(!fe)return;const Ae=I.current;fe>Ae?w("text-[#1DE6A3]"):fe<Ae&&w("text-[#FF7173]"),g(fe);const ce=setTimeout(()=>w("text-white"),800);return I.current=fe,()=>clearTimeout(ce)}else{if(!(n!=null&&n.markPx))return;const fe=n.markPx,Ae=I.current;fe>Ae?w("text-[#1DE6A3]"):fe<Ae&&w("text-[#FF7173]"),g(fe);const ce=setTimeout(()=>w("text-white"),800);return I.current=fe,()=>clearTimeout(ce)}},[F,C.mark,n==null?void 0:n.markPx]);const z=()=>i.jsx("div",{className:"flex items-center justify-start w-[76px]",children:i.jsx("div",{className:"w-[76px] max-w-[76px] h-[16px] rounded skeleton-ticker-text short ml-4 mt-1"})}),X=(n==null?void 0:n.source)==="extended",ne=fe=>{const Ae=Number(fe);if(!Number.isFinite(Ae))return z();const ce=Math.abs(Ae);let ye=1;return ce>=1e3?ye=1:ce>=100?ye=2:ce>=1?ye=3:ce>=.1?ye=4:ye=6,Ae.toLocaleString(void 0,{maximumFractionDigits:ye})},J=fe=>fe==null||isNaN(fe)?z():fe>=1e3?zw(fe):fe,Z=fe=>{const Ae=Number(fe);if(!Number.isFinite(Ae))return z();const ce=Math.abs(Ae),ye=Ae>=0?"+":"-";if(!X)return`${ye}${ce.toFixed(5)}`;let Ne=0;ce<.1?Ne=6:ce<1?Ne=4:ce<10?Ne=2:ce<100&&(Ne=1);const be=ce.toFixed(Ne),je=Ne>0?be.replace(/\.?0+$/,""):be;return`${ye}${je}`},re=Number.isFinite(n==null?void 0:n.markPx)&&Number.isFinite(n==null?void 0:n.prevDayPx)?n.markPx-n.prevDayPx:null,he=re!=null&&(n!=null&&n.prevDayPx)?re/n.prevDayPx*100:null,Y=re!=null?Z(re):null,ie=re==null?"text-white":re>=0?"text-[#1DE6A3]":"text-[#FF7173]",oe=he==null?"text-white":he>=0?"text-[#1DE6A3]":"text-[#FF7173]",G=()=>{const[fe,Ae]=String(a).split("/");return i.jsxs("div",{className:"flex -space-x-2 items-center",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${fe||""}.svg`||Ua,alt:"pair_a",className:"w-8 h-8 min-w-8 min-h-8 rounded-full bg-[#2a2a2a]",loading:"lazy",onError:ce=>sm(ce)}),i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Ae||""}.svg`||Ua,alt:"pair_b",className:"w-8 h-8 min-w-8 min-h-8 rounded-full bg-[#2a2a2a] border border-[#0f0f0f]",loading:"lazy",onError:ce=>sm(ce)})]})},V=F?"pair":"single",ee=F?a:e,ae=F?o:t;return i.jsx("div",{className:"flex justify-between items-center gap-2 md:gap-4 w-full relative",children:i.jsxs("div",{className:"flex justify-between xl:justify-start items-center gap-2 sm:gap-4 w-full sm:w-max",children:[i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"flex justify-center items-center",children:F?i.jsx(G,{}):i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${U[e]||(e==null?void 0:e.split("/")[0])}.svg`||Ua,alt:"token_image",className:"w-8 h-8 min-w-8 min-h-8 rounded-full",loading:"lazy",onError:fe=>sm(fe)})}),i.jsx(gue,{markets:R,value:ee,onChange:ae,loading:!R.length,showIcon:!0,mode:V})]}),i.jsx("div",{className:"hidden lg:flex bg-[#101010]",children:F?i.jsx(i.Fragment,{}):i.jsxs(i.Fragment,{children:[i.jsx(cC,{title:i.jsx(xX,{text:"Used for margining, computing unrealized PnL, liquidations and triggering TP/SL orders.",children:"Mark"}),widthValue:"70px",info:X?ne(x):J(x),color_1:v}),i.jsx(cC,{title:i.jsx(xX,{text:"Median price from external sources reported by validators; used to calculate funding rates.",children:"Oracle"}),widthValue:"80px",info:X?ne(n==null?void 0:n.oraclePx):J(n==null?void 0:n.oraclePx),color_1:"text-white"}),i.jsx(cC,{title:"24h Change",widthValue:"120px",info:Y??z(),info_2:he,color_1:ie,color_2:oe}),i.jsx(cC,{title:"24h Volume",widthValue:"130px",info:n!=null&&n.dayNtlVlm?`$${Er(parseFloat(n==null?void 0:n.dayNtlVlm))}`:z(),color_1:"text-white"}),i.jsx(cC,{title:"Open Interest",widthValue:"130px",info:n!=null&&n.oraclePx?`$${Er(parseFloat((n==null?void 0:n.oraclePx)*(n==null?void 0:n.openInterest)))}`:z(),color_1:"text-white"}),i.jsx(cC,{title:i.jsx(xX,{text:"If the funding rate is positive, longs pay shorts. If negative, shorts pay longs.",children:"Funding"}),title_2:"Countdown",widthValue:"145px",info:(n==null?void 0:n.funding)!=null?((n==null?void 0:n.funding)*100).toFixed(4)+"%":z(),info_2:(n==null?void 0:n.funding)!=null?d:z(),color_1:"text-[#1DE6A3]",color_2:"text-white",isLast:!0})]})}),i.jsx("div",{className:"flex lg:hidden justify-start items-center gap-4",children:"All Positions"})]})})},cC=({title:e,title_2:t,widthValue:n,info:r,info_2:s,color_1:a,color_2:o,isLast:l})=>i.jsxs("div",{className:"flex items-center",children:[i.jsxs("div",{style:{minWidth:n},className:"flex flex-col items-center justify-center",children:[i.jsx("div",{className:"flex flex-col items-start",children:t?i.jsxs("div",{className:`text-[#B7B7B7] text-[12px] font-medium font-inter leading
-snug`,children:[e," / ",t]}):i.jsx("div",{className:"text-[#B7B7B7] text-[12px] font-medium font-inter leading-snug",children:e})}),s?i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("div",{className:`${a} text-[12px] font-semibold font-inter leading-[16px]`,children:r}),i.jsx("div",{className:`${a} flex justify-center items-center max-h-2`,children:r?"/":""}),i.jsx("div",{className:`${o} text-[12px] font-semibold font-inter leading-[16px]`,children:t=="Countdown"?s:`${s>0?"+":""}${parseFloat(s).toFixed(2)}%`})]}):i.jsx("div",{className:`${a} text-[12px] font-semibold font-inter leading-[16px]`,children:r})]}),!l&&i.jsx("div",{className:"border-l border-[#3E3E3E]",style:{height:24}})]}),Gdn="wss://api.hyperliquid.xyz/ws",gX=new Map;function K4e(e){const t=(e||"").toLowerCase();return t?(gX.has(t)||gX.set(t,{key:t,ws:null,ping:null,subs:new Set,connected:!1,connecting:!1}),gX.get(t)):null}function xHe(e){if(!e||e.connecting||e.connected)return;e.connecting=!0;const t=new WebSocket(Gdn);e.ws=t,t.onopen=()=>{e.connected=!0,e.connecting=!1;try{t.send(JSON.stringify({method:"subscribe",subscription:{type:"user",user:e.key}})),t.send(JSON.stringify({method:"subscribe",subscription:{type:"webData2",user:e.key}})),t.send(JSON.stringify({method:"subscribe",subscription:{type:"webData3",user:e.key}}))}catch{}e.ping=setInterval(()=>{try{t.send(JSON.stringify({id:99,method:"ping"}))}catch{}},3e4)},t.onmessage=r=>{let s;try{s=JSON.parse(r.data)}catch{return}(s==null?void 0:s.method)!=="pong"&&e.subs.forEach(a=>{try{a(s)}catch{}})};const n=()=>{e.connected=!1,e.connecting=!1;try{t.close()}catch{}e.ping&&(clearInterval(e.ping),e.ping=null),e.ws=null,e.subs.size&&setTimeout(()=>xHe(e),1500)};t.onclose=n,t.onerror=n}function gHe(e,t){const n=K4e(e);return n?(n.subs.add(t),xHe(n),()=>{const r=K4e(e);if(r&&(r.subs.delete(t),!r.subs.size&&r.ws))try{r.ws.close()}catch{}}):()=>{}}const Kdn="https://api.hyperliquid.xyz/info",bX=new Map,Ydn=["xyz"];function Xdn(e){const t=(e==null?void 0:e.toLowerCase())||"";return t?(bX.has(t)||bX.set(t,{key:t,rows:[],count:void 0,loading:!0,emptyTimer:null,tpslByCoin:{},viewOrdersOnly:new Set,subs:new Set}),bX.get(t)):null}function bHe(e){e.subs.forEach(t=>{try{t({rows:e.rows,count:e.count,loading:e.loading,tpslByCoin:e.tpslByCoin,viewOrdersOnly:e.viewOrdersOnly})}catch{}})}function Qdn(e){return(Array.isArray(e)?e:[]).filter(n=>{var r;return((r=n==null?void 0:n.position)==null?void 0:r.szi)&&Number(n.position.szi)!==0}).map(n=>{var v,w,C;const r=n.position,s=Number(r.szi||0),a=Number(r.positionValue||0),o=Number(r.entryPx||0),l=Math.abs(s)>0?a/Math.abs(s):0,c=Number(r.unrealizedPnl||0),u=Number(r.returnOnEquity||0)*100,d=r.liquidationPx?Number(r.liquidationPx):null,f=Number(r.marginUsed||0),x=Number(((v=r.leverage)==null?void 0:v.value)||0),g=((w=r.leverage)==null?void 0:w.type)||null;return{id:`${r.coin}:${r.entryPx}:${r.szi}`,coin:r.coin,type:s>0?"Long":"Short",size:s,positionValue:a,entryPrice:o,markPrice:l,pnl:c,roe:u,liquidationPx:d,marginUsed:f,leverage:{value:x,type:g},funding:Number(((C=r.cumFunding)==null?void 0:C.sinceOpen)||0)}})}function Y4e(e,t){const n=Qdn(t);e.rows=n,e.count=n.length,e.loading=!1,bHe(e)}function GP(e,t){if(Array.isArray(t)&&t.length>0){e.emptyTimer&&(clearTimeout(e.emptyTimer),e.emptyTimer=null),Y4e(e,t);return}e.emptyTimer||(e.emptyTimer=setTimeout(()=>{e.emptyTimer=null,Y4e(e,[])},1e3))}function KP(e,t){const n=Array.isArray(t)?t:[],r={},s=new Set,a=new Set;for(const o of n)if(o!=null&&o.coin&&(s.add(o.coin),o.isPositionTpsl)){a.add(o.coin);const l=r[o.coin]||{tp:null,sl:null},c=Number(o.triggerPx||o.limitPx||0),u=String(o.orderType||"").toLowerCase();u.includes("take profit")&&(l.tp=Number.isFinite(c)?c:l.tp),u.includes("stop")&&(l.sl=Number.isFinite(c)?c:l.sl),r[o.coin]=l}for(const o of s)a.has(o)||(r[o]={tp:null,sl:null});e.tpslByCoin=r,bHe(e)}function yHe(e){const t=[],n=new Set;function r(s){if(Array.isArray(s))for(const a of s){if(!a)continue;const o=a.oid!=null?String(a.oid):a.cloid!=null?String(a.cloid):`${a.coin||""}-${a.timestamp||""}-${a.limitPx||""}-${a.side||""}`;n.has(o)||(n.add(o),t.push(a))}}if(!e)return t;if(Array.isArray(e))return r(e),t;if(typeof e!="object")return t;if(Array.isArray(e.orders)&&r(e.orders),r(e.openOrders),e.clearinghouseState&&typeof e.clearinghouseState=="object"&&r(e.clearinghouseState.openOrders),Array.isArray(e.perpDexStates))for(const s of e.perpDexStates)!s||typeof s!="object"||(Array.isArray(s.orders)&&r(s.orders),r(s.openOrders),s.clearinghouseState&&typeof s.clearinghouseState=="object"&&r(s.clearinghouseState.openOrders));return t}function vHe(e){let t=[],n=!1;if(e&&typeof e=="object"){const a=e.clearinghouseState;if(Array.isArray(a&&a.assetPositions)?(t.push(...a.assetPositions),n=!0):Array.isArray(e.assetPositions)&&(t.push(...e.assetPositions),n=!0),Array.isArray(e.perpDexStates)){let o=!1;for(const l of e.perpDexStates){if(!l||!l.clearinghouseState)continue;const c=l.clearinghouseState.assetPositions;Array.isArray(c)&&c.length>0&&(o=!0,t.push(...c))}o&&(n=!0)}}const r=yHe(e),s=r.length>0;return{hasAssetPositions:n,assetPositions:t,hasOpenOrders:s,openOrders:r}}function Zdn(e){if(!e||typeof e!="object")return{assetPositions:[],openOrders:[]};const{hasAssetPositions:t,assetPositions:n,hasOpenOrders:r,openOrders:s}=vHe(e);return{assetPositions:t?n:[],openOrders:r?s:[]}}function yue(e){const[t,n]=m.useState({rows:[],count:void 0,loading:!0,tpslByCoin:{},viewOrdersOnly:new Set});return m.useEffect(()=>{const r=e==null?void 0:e.toLowerCase();if(!r)return;const s=Xdn(r),a=l=>n(l);s.subs.add(a),n({rows:s.rows,count:s.count,loading:s.loading,tpslByCoin:s.tpslByCoin,viewOrdersOnly:s.viewOrdersOnly});const o=gHe(r,l=>{if(!l)return;const c=l.channel;if(c==="user"){const u=l.data&&l.data.state;if(!u)return;Array.isArray(u.assetPositions)&&GP(s,u.assetPositions);const d=yHe(u);d.length&&KP(s,d);return}if(c==="webData2"||c==="webData3"){const u=l.data||{},{hasAssetPositions:d,assetPositions:f,hasOpenOrders:x,openOrders:g}=vHe(u);d&&GP(s,f),x&&KP(s,g)}});return(async()=>{try{const l=Ydn.map(f=>{const x={type:"clearinghouseState",user:r};return f&&(x.dex=f),x}),c=await Promise.all(l.map(f=>fetch(Kdn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)}).then(x=>x.json()).catch(()=>null))),u=[],d=[];for(const f of c){if(!f)continue;const{assetPositions:x,openOrders:g}=Zdn(f);Array.isArray(x)&&x.length&&u.push(...x),Array.isArray(g)&&g.length&&d.push(...g)}GP(s,u),KP(s,d)}catch{GP(s,[]),KP(s,[])}})(),()=>{s.subs.delete(a),o()}},[e]),t}function wHe(e){const{count:t}=yue(e);return t}const yX=new Map;function Jdn(e){const t=(e==null?void 0:e.toLowerCase())||"";return t?(yX.has(t)||yX.set(t,{key:t,rows:[],count:void 0,loading:!0,subs:new Set,emptyTimer:null}),yX.get(t)):null}function efn(e){e.subs.forEach(t=>{try{t({rows:e.rows,count:e.count,loading:e.loading})}catch{}})}function tfn(e){return(Array.isArray(e)?e:[]).map(n=>({id:`${n.oid}-${n.timestamp}`,coin:n.coin,side:n.side==="B"?"Buy":"Sell",sideRaw:n.side,type:n.orderType,size:Number(n.sz)>0?Number(n.sz):"--",originalSize:Number(n.origSz)>0?Number(n.origSz):"--",price:Number(n.triggerPx)>0?"Market":Number(n.limitPx),limitPx:Number(n.limitPx||0),triggerPx:Number(n.triggerPx)||"N/A",isTrigger:!!n.isTrigger,reduceOnly:!!n.reduceOnly,tif:n.tif||null,orderValue:Number(n.limitPx||0)>0&&Number(n.sz||0)!==0?Number(n.limitPx)*Math.abs(Number(n.sz)):0,timestamp:Number(n.timestamp||0),children:Array.isArray(n.children)?n.children:[],isPositionTpsl:!!n.isPositionTpsl,cloid:n.cloid||null,oid:n.oid})).sort((n,r)=>r.timestamp-n.timestamp)}function vX(e){const t=[],n=new Set;function r(s){if(Array.isArray(s))for(const a of s){if(!a)continue;const o=a.oid!=null?String(a.oid):a.cloid!=null?String(a.cloid):`${a.coin||""}-${a.timestamp||""}-${a.limitPx||""}-${a.side||""}`;n.has(o)||(n.add(o),t.push(a))}}if(!e)return t;if(Array.isArray(e)){for(const s of e)!s||typeof s!="object"||(Array.isArray(s.orders)&&r(s.orders),Array.isArray(s.openOrders)&&r(s.openOrders));return t}if(typeof e!="object")return t;if(Array.isArray(e.orders)&&r(e.orders),Array.isArray(e.openOrders)&&r(e.openOrders),e.clearinghouseState&&typeof e.clearinghouseState=="object"&&Array.isArray(e.clearinghouseState.openOrders)&&r(e.clearinghouseState.openOrders),Array.isArray(e.perpDexStates))for(const s of e.perpDexStates)!s||typeof s!="object"||(Array.isArray(s.orders)&&r(s.orders),Array.isArray(s.openOrders)&&r(s.openOrders),s.clearinghouseState&&typeof s.clearinghouseState=="object"&&Array.isArray(s.clearinghouseState.openOrders)&&r(s.clearinghouseState.openOrders));return t}function X4e(e){if(!e||typeof e!="object")return!1;if(Array.isArray(e.orders)||Array.isArray(e.openOrders)||e.clearinghouseState&&typeof e.clearinghouseState=="object"&&Array.isArray(e.clearinghouseState.openOrders))return!0;if(Array.isArray(e.perpDexStates)){for(const t of e.perpDexStates)if(!(!t||typeof t!="object")&&(Array.isArray(t.orders)||Array.isArray(t.openOrders)||t.clearinghouseState&&typeof t.clearinghouseState=="object"&&Array.isArray(t.clearinghouseState.openOrders)))return!0}return!1}function wX(e,t){const n=tfn(t);e.rows=n,e.count=n.length,e.loading=!1,efn(e)}function CX(e,t,n){if(t.length>0){e.emptyTimer&&(clearTimeout(e.emptyTimer),e.emptyTimer=null),wX(e,t);return}if(n===0){e.emptyTimer&&(clearTimeout(e.emptyTimer),e.emptyTimer=null),wX(e,[]);return}e.emptyTimer||(e.emptyTimer=setTimeout(()=>{e.emptyTimer=null,!(n>0)&&wX(e,[])},2e3))}function vue(e){const t=(e==null?void 0:e.toLowerCase())||"",n=wHe(e),[r,s]=m.useState({rows:[],count:void 0,loading:!0});return m.useEffect(()=>{if(!t){s({rows:[],count:0,loading:!1});return}const a=Jdn(t);if(!a){s({rows:[],count:0,loading:!1});return}const o=c=>s(c);a.subs.add(o),s({rows:a.rows,count:a.count,loading:a.loading});const l=gHe(t,c=>{if(!c)return;const u=c.channel,d=c.data||{};if(u==="openOrders"){const f=vX(d);CX(a,f,n);return}if(u==="user"){const f=d.state;if(!f||!X4e(f))return;const x=vX(f);CX(a,x,n);return}if(u==="webData2"||u==="webData3"){if(!X4e(d))return;const f=vX(d);CX(a,f,n);return}});return()=>{a.subs.delete(o),l()}},[t,n]),r}function nfn(e){const{count:t}=vue(e);return t}const fv={"1m":"1","5m":"5","15m":"15","30m":"30","1h":"60","4h":"240","12h":"720","1d":"1D","1w":"1W","1M":"1M"},Pj={"1m":60,"5m":300,"15m":900,"30m":1800,"1h":3600,"4h":14400,"12h":43200,"1d":86400,"1w":604800,"1M":2592e3},YP={1:"1m",5:"5m",15:"15m",30:"30m",60:"1h",240:"4h",720:"12h","1D":"1d",D:"1d","1W":"1w",W:"1w","1M":"1M",M:"1M"},rfn="wss://api.starknet.extended.exchange",SX="https://api.starknet.extended.exchange/api/v1",NX="https://express-proxy-delta.vercel.app/proxy?url=",sfn={"1m":"PT1M","5m":"PT5M","15m":"PT15M","30m":"PT30M","1h":"PT1H","4h":"PT4H","12h":"PT12H","1d":"PT24H","1w":"P7D","1M":"P30D"},ifn="https://mainnet.zklighter.elliot.ai/api/v1/candles",afn="https://mainnet.zklighter.elliot.ai/api/v1/candlesticks",ofn=["tv.js","charting_library.standalone.js","charting_library.js"];let XP=null;function lfn(e="/charting_library/"){return typeof window>"u"?Promise.resolve(null):window.TradingView&&window.TradingView.widget?Promise.resolve(window.TradingView):XP||(XP=(async()=>{for(const t of ofn){const n=e.replace(/\/?$/,"/")+t;if(!document.querySelector(`script[data-tv-lib="${n}"]`)){const s=document.createElement("script");s.src=n,s.async=!0,s.dataset.tvLib=n,document.body.appendChild(s),await new Promise(a=>{s.onload=a,s.onerror=a})}if(window.TradingView&&window.TradingView.widget)return window.TradingView;let r=0;for(;(!window.TradingView||!window.TradingView.widget)&&r<40;)await new Promise(s=>setTimeout(s,25)),r++;if(window.TradingView&&window.TradingView.widget)return window.TradingView}return window.TradingView||null})(),XP)}const cfn="#133024",CHe="#67FFBD",ufn="#311621",SHe="#FF79AD",dfn={background:cfn,border:CHe},ffn={background:ufn,border:SHe},hfn="#67FFBD",pfn="rgba(103,255,189,0.12)",mfn="#67FFBD",xfn="#FF797C",gfn="rgba(255,121,124,0.12)",bfn="#FF79AD",yfn="#67FFBD",vfn="rgba(103,255,189,0.08)",wfn="#67FFBD",Q4e="#FF79AD",Z4e="rgba(255,121,173,0.08)",J4e="#FF79AD",m9=e=>{const t=String(e||"").trim().toUpperCase();return t==="SELL"||t==="SHORT"||t==="S"?"S":t==="BUY"||t==="LONG"||t==="B"?"B":""},AO="​",eSe="tv_chart_layout_v3",hb=e=>typeof e=="string"&&e.includes("/");function Cfn(e){const t=[e.isBuy,e.b,e.buy,e.side,e.dir,e.takerSide,e.action];for(const n of t){if(n===!0||n===1)return!0;if(n===!1||n===0)return!1;if(typeof n=="string"){const r=n.toLowerCase();if(r==="buy"||r==="b"||r==="long")return!0;if(r==="sell"||r==="s"||r==="short")return!1}}return!1}function NHe(e){const t=new Date(e);return Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())}function Sfn(e){const t=new Date(e),n=NHe(e),r=t.getUTCDay();return n-r*864e5}function Nfn(e){const t=new Date(e);return Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),1)}function hv(e,t){if(t==="1d")return NHe(e);if(t==="1w")return Sfn(e);if(t==="1M")return Nfn(e);const n=Pj[t]||60;return Math.floor(e/1e3/n)*n*1e3}function wue(e){return/limit/i.test(String(e.type||""))?Number(e.limitPx)||0:Number(e.triggerPx)||0}function AHe(e){return Number(e.sz??e.size??e.sizeCoin??e.coinSize??e.baseSize??e.qty??e.quantity??0)||0}function Afn(e,t){const n=m9(e.sideRaw||e.side),r=/take\s*profit/i.test(String(e.type||"")),s=/stop/i.test(String(e.type||"")),a=wue(e),o=AHe(e),l=e.coin||t||"",c=o>0?` (${o.toLocaleString(void 0,{maximumFractionDigits:6})}${l?" "+l:""})`:"";return r?AO+`TP ${n==="S"?">":"<"} ${a}${c}`:s?AO+`SL ${n==="S"?"<":">"} ${a}${c}`:AO+`Limit ${a}${c}`}function jfn(e){const t=/take\s*profit/i.test(String(e.type||"")),n=/stop/i.test(String(e.type||"")),r=m9(e.sideRaw||e.side),s=r==="S"||r==="A";return n?{txt:xfn,bg:gfn,br:bfn}:t?s?{txt:Q4e,bg:Z4e,br:J4e}:{txt:hfn,bg:pfn,br:mfn}:s?{txt:Q4e,bg:Z4e,br:J4e}:{txt:yfn,bg:vfn,br:wfn}}function tSe(e){return!e||typeof e!="object"||!Array.isArray(e.charts)?e:{...e,charts:e.charts.map(n=>!n||!Array.isArray(n.panes)?n:{...n,panes:n.panes.map(r=>{if(!r||!Array.isArray(r.sources))return r;const s=r.sources.filter(a=>{if(!a||typeof a!="object")return!0;const o=a.state||{},l=o.text||o.title||"";return!(typeof l=="string"&&l[0]===AO)});return{...r,sources:s}})})}}function Efn(e,t){const n=e.oid??e.cloid??e.clientOrderId??e.hash??e.orderId??e.id??null,r=e.sideRaw??e.side??"";return String(n??`${e.coin||t}|${r}|${wue(e)}`)}function nSe(e,t,n){var r,s,a,o;if(n!=null){try{(r=e==null?void 0:e.removeEntity)==null||r.call(e,n)}catch{}try{(s=t==null?void 0:t.removeEntity)==null||s.call(t,n)}catch{}try{const l=(a=t==null?void 0:t.getShapeById)==null?void 0:a.call(t,n);(o=l==null?void 0:l.remove)==null||o.call(l)}catch{}}}function QP(e,t,n){e.forEach(r=>{r&&(typeof r.then=="function"?r.then(s=>{s!=null&&nSe(t,n,s)}).catch(()=>{}):nSe(t,n,r))})}const _fn=(()=>{if(typeof Intl<"u"&&Intl.DateTimeFormat)try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(e&&typeof e=="string")return e}catch{}return"Etc/UTC"})();function AX({coin:e="BTC",interval:t="1h",domId:n,libPath:r="/charting_library/",walletAddress:s,gridLines:a=[],market:o="hyperliquid",lighterMarketId:l=null,extendedMarket:c=null,extendedLastPrice:u=null,extendedApiKey:d=null}){const f=m.useRef(null),x=m.useRef(null),g=m.useRef(null),v=m.useRef(new Map),[w,C]=m.useState(!1),N=m.useRef([]),I=m.useRef([]),P=vue(s||"").rows,R=m.useRef(null),F=m.useRef(t),U=m.useRef(new Map),L=m.useRef(0),[z,X]=m.useState([]);m.useEffect(()=>{P.length>0&&(N.current=P)},[P]);let ne;P.length===0?(L.current+=1,L.current<=1?ne=N.current:ne=P):(L.current=0,ne=P);const J=m.useMemo(()=>o!=="hyperliquid"?[]:ne.filter(G=>G&&G.coin===e),[ne,e,o]);m.useEffect(()=>{if(o!=="extended"||!d){X([]);return}let G=!1;const V=async()=>{try{const ae=`${SX}/user/orders`,fe=`${NX}${encodeURIComponent(ae)}`,ce=await(await fetch(fe,{headers:{"X-Api-Key":d}})).json().catch(()=>null);if(G)return;const Ne=((ce==null?void 0:ce.data)&&Array.isArray(ce.data)&&ce.data||(Array.isArray(ce)?ce:[])).map((be,je)=>{var Ie;return{id:be.id??je,market:(be.market||"").toUpperCase(),type:(be.type||"").toUpperCase(),side:m9(be.side)||(be.side||"").toUpperCase(),sideRaw:m9(be.side)||"B",status:(be.status||"").toUpperCase(),limitPx:Number(be.price)||null,triggerPx:((Ie=be.trigger)==null?void 0:Ie.triggerPrice)!=null?Number(be.trigger.triggerPrice):null,qty:Number(be.qty)||null,takeProfit:be.takeProfit||null,stopLoss:be.stopLoss||null,reduceOnly:!!be.reduceOnly,createdTime:be.createdTime||null,updatedTime:be.updatedTime||null}}).filter(be=>be.status==="NEW"||be.status==="PARTIALLY_FILLED");X(Ne)}catch{G||X([])}};V();const ee=setInterval(V,1e4);return()=>{G=!0,clearInterval(ee)}},[o,d]);const Z=m.useMemo(()=>{if(o==="hyperliquid")return J;if(o==="extended"){const G=String(c||e||"").toUpperCase();return z.filter(V=>String(V.market||"").toUpperCase()===G)}return[]},[o,J,z,c,e]);let re=_fn;try{const G=typeof window<"u"?JSON.parse(window.localStorage.getItem("tradingview.chartproperties")||"null"):null;G&&G.timezone&&(re=G.timezone)}catch{}const he=typeof window<"u"?window.localStorage.getItem("tranding_chart_interval_time"):null,Y=he&&fv[he]?he:t,ie=fv[Y]||"60";m.useEffect(()=>{P.length>0&&(I.current=P)},[P]),m.useEffect(()=>{if(!w)return;const G=x.current,V=G&&G.activeChart&&G.activeChart();if(!V)return;const ee=fv[t]?fv[t]:Object.values(fv).includes(t)?t:ie,ae=R.current!==e,fe=F.current!==t;if(ae){R.current=e,F.current=t;const Ae=g.current;if(Ae&&typeof Ae.clearMarksCache=="function")try{Ae.clearMarksCache()}catch{}try{V.setSymbol(e,ee,()=>{var ce;try{V.requestMarksRefresh&&V.requestMarksRefresh(),(ce=V.autoScaleAllSeries)==null||ce.call(V)}catch{}})}catch{}}else if(fe){F.current=t;try{V.setResolution(ee,()=>{var Ae;try{V.requestMarksRefresh&&V.requestMarksRefresh(),(Ae=V.autoScaleAllSeries)==null||Ae.call(V)}catch{}})}catch{}}},[e,t,w,ie]),m.useEffect(()=>{let G=!0;return(async()=>{const V=await lfn(r);if(!G||!V||!V.widget||!f.current)return;f.current.innerHTML="";let ee=5;function ae(Ne,be,je,Ie,Re,Qe,Be){let it=Ne||null,tt=Be||null,at=null,dt=null,ct=null,Ut=null,kt=null,tn=null;const jt={},un={},cn={},Pt={};let Xe=!0,Vt=Qe,Yt=null,Ve=0;const Ke=ln=>+String(ln).slice(0,13);let ft="1h",en="",Dt=[],At=null,Je=null,He=null;const Rt=ln=>sfn[ln]||"PT1M",qe=ln=>{if(Re)return Re;const Oe=String(ln||"");return!Oe||Oe.includes("/")?"":Oe.includes("-")?Oe:`${Oe}-USD`},lt=(ln,Oe)=>{if(!Oe)return;const sn=Pt[Oe]||[],fn=sn[sn.length-1];fn&&fn.time===ln.time?sn[sn.length-1]=ln:sn.push(ln),sn.length>2e3&&sn.splice(0,sn.length-2e3),Pt[Oe]=sn},xt=(ln,Oe,sn)=>{const fn=Pt[ln]||[];return fn.length?fn.filter(Et=>Number.isFinite(Et.time)&&Et.time/1e3>=Oe&&Et.time/1e3<=sn):[]},Nt=(ln,Oe,sn)=>{const fn=Number(Vt);if(!Number.isFinite(fn)||fn<=0)return[];const Et=hv(sn*1e3,ln);return Math.floor(Et/1e3)<Oe?[]:[{time:Et,open:fn,high:fn,low:fn,close:fn,volume:0}]};function It(){je==="hyperliquid"&&(at||(at=new WebSocket("wss://api-ui.hyperliquid.xyz/ws"),at.onopen=()=>{kt&&at&&at.send(JSON.stringify({method:"subscribe",subscription:kt}))},at.onmessage=ln=>{var fn;const Oe=(fn=JSON.parse(ln.data))==null?void 0:fn.data;if(!Oe||!Oe.c)return;const sn={time:Ke(Oe.t),open:+Oe.o,high:+Oe.h,low:+Oe.l,close:+Oe.c,volume:Oe.v??0};Object.values(jt).forEach(Et=>Et(sn))},at.onclose=()=>{at=null}))}function xn(){je==="extended"&&(!tn||dt||(dt=new WebSocket(tn),dt.onmessage=ln=>{let Oe;try{Oe=JSON.parse(ln.data)}catch{return}const sn=Array.isArray(Oe==null?void 0:Oe.data)?Oe.data:[];sn.length&&sn.forEach(fn=>{const Et={time:Ke(fn.T),open:+fn.o,high:+fn.h,low:+fn.l,close:+fn.c,volume:fn.v!=null?Number(fn.v):0};!Number.isFinite(Et.time)||!Number.isFinite(Et.open)||(lt(Et,ft),Object.values(jt).forEach(Kn=>Kn(Et)))})},dt.onclose=()=>{dt=null}))}function dn(ln,Oe,sn){if(je!=="hyperliquid")return;if(ct)try{ct.close()}catch{}if(Ut)try{Ut.close()}catch{}Je=null,He=null,ct=new WebSocket("wss://api-ui.hyperliquid.xyz/ws"),Ut=new WebSocket("wss://api-ui.hyperliquid.xyz/ws"),ct.onopen=()=>{ct&&ct.send(JSON.stringify({method:"subscribe",subscription:{type:"candle",coin:ln,interval:sn}}))},Ut.onopen=()=>{Ut&&Ut.send(JSON.stringify({method:"subscribe",subscription:{type:"candle",coin:Oe,interval:sn}}))};const fn=Et=>Kn=>{var nr;const Cn=(nr=JSON.parse(Kn.data))==null?void 0:nr.data;if(!Cn||!Cn.c)return;const Bt={time:Ke(Cn.t),open:+Cn.o,high:+Cn.h,low:+Cn.l,close:+Cn.c,volume:Cn.v??0};if(Et==="A"?Je=Bt:He=Bt,!Je||!He)return;const an=hv(Je.time,ft),Pn=hv(He.time,ft);if(an!==Pn)return;const qn={time:Math.max(Je.time,He.time),open:Je.open/He.open,high:Je.high/He.high,low:Je.low/He.low,close:Je.close/He.close,volume:0};Object.values(jt).forEach(tr=>tr(qn))};ct.onmessage=fn("A"),Ut.onmessage=fn("B"),ct.onclose=()=>{ct=null},Ut.onclose=()=>{Ut=null}}function Mn(ln){const Oe=String(ln||"");return Oe==="BTC"||Oe==="ETH"?2:Oe.startsWith("1000")||Oe.includes("/")?4:3}async function _n(ln,Oe,sn,fn){const Cn=(Pj[Oe]||60)*1e4,Bt=Math.max(sn*1e3,fn*1e3-Cn*1e3),{data:an}=await ls.post("https://api-ui.hyperliquid.xyz/info",{type:"candleSnapshot",req:{coin:ln,interval:Oe,startTime:Bt,endTime:fn*1e3}});return(Array.isArray(an)?an:an&&an.data?an.data:[]).map(qn=>({time:Ke(qn.t),open:+qn.o,high:+qn.h,low:+qn.l,close:+qn.c,volume:qn.v??0})).sort((qn,nr)=>qn.time-nr.time)}async function kn(ln,Oe,sn,fn,Et){const[Kn,Cn]=await Promise.all([_n(ln,sn,fn,Et),_n(Oe,sn,fn,Et)]),Bt=[];let an=0,Pn=0;for(;an<Kn.length&&Pn<Cn.length;){const qn=hv(Kn[an].time,ft),nr=hv(Cn[Pn].time,ft);qn===nr?(Bt.push({time:Math.max(Kn[an].time,Cn[Pn].time),open:Kn[an].open/Cn[Pn].open,high:Kn[an].high/Cn[Pn].high,low:Kn[an].low/Cn[Pn].low,close:Kn[an].close/Cn[Pn].close,volume:0}),an++,Pn++):qn<nr?an++:Pn++}return Bt}async function vn(ln,Oe,sn,fn){if(ln==null)return[];const Et=Pj[Oe]||60,Kn=Math.max(Et,fn-sn),Cn=Math.max(1,Math.ceil(Kn/Et)),Bt={market_id:ln,resolution:Oe,r:Oe,start_timestamp:sn*1e3,end_timestamp:fn*1e3,start:sn*1e3,end:fn*1e3,count_back:Cn,limit:Cn,set_timestamp_to_end:!0},an=tr=>{if(!tr)return null;if(Array.isArray(tr)){const[p,h,S,_,k,T]=tr;return{time:Ke(p),open:+h,high:+S,low:+_,close:+k,volume:Number(T??0)||0}}const Qt=tr.t??tr.time??tr.timestamp??tr.start_timestamp??tr.startTime??tr.start_time??0,zn=tr.o??tr.open,Yn=tr.h??tr.high,Lt=tr.l??tr.low,Fn=tr.c??tr.close,Ee=tr.v??tr.volume??tr.V??0;return{time:Ke(Qt),open:+zn,high:+Yn,low:+Lt,close:+Fn,volume:Number(Ee??0)||0}},Pn=tr=>tr.map(Qt=>an(Qt)).filter(Qt=>Qt&&Number.isFinite(Qt.time)&&Number.isFinite(Qt.open)&&Qt.time/1e3>=sn&&Qt.time/1e3<=fn).sort((Qt,zn)=>Qt.time-zn.time),qn=async tr=>{const{data:Qt}=await ls.get(tr,{params:Bt});return Qt?Array.isArray(Qt.c)?Qt.c:Array.isArray(Qt.data)?Qt.data:Array.isArray(Qt.candlesticks)?Qt.candlesticks:Array.isArray(Qt.candles)?Qt.candles:Array.isArray(Qt)?Qt:[]:[]};let nr=[];try{nr=await qn(ifn)}catch{}if(!nr.length)try{nr=await qn(afn)}catch{}return Pn(nr)}async function Qn(ln,Oe,sn,fn){if(!ln)return[];const Et=Pj[Oe]||60,Kn=Math.max(Et,fn-sn),Cn=Math.min(1e4,Math.max(1,Math.ceil(Kn/Et))),Bt=Rt(Oe),an=`${SX}/info/candles/${ln}/trades?interval=${Bt}&limit=${Cn}&endTime=${fn*1e3}`,Pn=`${NX}${encodeURIComponent(an)}`,{data:qn}=await ls.get(Pn);return(Array.isArray(qn==null?void 0:qn.data)?qn.data:[]).map(tr=>({time:Ke(tr.T),open:+tr.o,high:+tr.h,low:+tr.l,close:+tr.c,volume:tr.v!=null?Number(tr.v):0})).filter(tr=>Number.isFinite(tr.time)&&Number.isFinite(tr.open)&&tr.time/1e3>=sn&&tr.time/1e3<=fn).sort((tr,Qt)=>tr.time-Qt.time)}async function Hn(ln,Oe,sn){if(!it)return[];if(hb(ln))return[];const{data:fn}=await ls.post("https://api.hyperliquid.xyz/info",{type:"userFills",user:it,coin:ln,startTime:Oe*1e3,endTime:sn*1e3});return(Array.isArray(fn)?fn:fn&&fn.data?fn.data:[]).filter(Cn=>{const Bt=Cn.coin||Cn.asset||Cn.symbol;return Bt?String(Bt).toUpperCase()===String(ln).toUpperCase():!0}).map(Cn=>({t:+String(Cn.time).slice(0,13),b:Cfn(Cn),px:Number(Cn.px||Cn.price),sz:Number(Cn.sz||Cn.size)})).filter(Cn=>Cn.t/1e3>=Oe&&Cn.t/1e3<=sn&&Number.isFinite(Cn.px)&&Cn.px>0)}async function $n(ln,Oe,sn){if(!tt)return[];if(!ln)return[];const fn=`${SX}/user/trades`,Et=`${NX}${encodeURIComponent(fn)}`,{data:Kn}=await ls.get(Et,{headers:{"X-Api-Key":tt}}),Cn=Array.isArray(Kn==null?void 0:Kn.data)?Kn.data:Array.isArray(Kn)?Kn:[],Bt=String(ln||"").toUpperCase();return Cn.filter(an=>String(an.market||"").toUpperCase()===Bt).map(an=>({t:+String(an.createdTime||an.time||an.paidTime||0).slice(0,13),b:m9(an.side)!=="S"})).filter(an=>an.t/1e3>=Oe&&an.t/1e3<=sn&&Number.isFinite(an.t))}function Jn(ln){un[ln]&&(clearInterval(un[ln]),delete un[ln])}function Nn(){Object.keys(un).forEach(ln=>{Jn(ln)})}return{setWallet:ln=>{it=ln||null,en="",Dt=[],At=null},setExtendedApiKey:ln=>{tt=ln||null,en="",Dt=[],At=null},setExtendedFallbackPrice:ln=>{Vt=ln},clearMarksCache:()=>{en="",Dt=[],At=null},onReady:ln=>ln({supported_resolutions:Object.values(fv),supports_group_request:!1,supports_marks:!0,supports_timescale_marks:!1,supports_time:!0}),resolveSymbol:(ln,Oe)=>{Yt=ln;const sn=cn[ln]??Mn(ln);cn[ln]=sn,typeof be=="function"&&be(sn),Oe({name:ln,ticker:ln,full_name:ln,description:hb(ln)?ln:ln+"/USD",type:"crypto",session:"24x7",timezone:re,exchange:je==="lighter"?"Lighter":je==="extended"?"Extended":"Hyperliquid",pricescale:Math.pow(10,sn),minmov:1,has_intraday:!0,supported_resolutions:Object.values(fv),data_status:"streaming"})},getServerTime:ln=>ln(Math.floor(Date.now()/1e3)),getBars:async(ln,Oe,{from:sn,to:fn},Et,Kn)=>{const Cn=ln.ticker||ln.name,Bt=++Ve;try{const an=YP[Oe]||"1m";an&&(ft=an);let Pn=[];if(je==="lighter")hb(Cn)||(Pn=await vn(Ie,an,sn,fn));else if(je==="extended"){if(!hb(Cn)){const qn=qe(Cn);if(qn&&Xe)try{Pn=await Qn(qn,an,sn,fn)}catch{Xe=!1}Pn.length||(Pn=xt(an,sn,fn)),Pn.length||(Pn=Nt(an,sn,fn))}}else if(hb(Cn)){const qn=String(Cn).split("/"),nr=qn[0],tr=qn[1];Pn=await kn(nr,tr,an,sn,fn)}else Pn=await _n(Cn,an,sn,fn);if(Cn!==Yt||Bt!==Ve)return;Et(Pn,{noData:Pn.length===0})}catch(an){const Pn=an&&an.response&&an.response.status;if(je==="lighter"&&Pn===400){Cn===Yt&&Bt===Ve&&Et([],{noData:!0});return}try{Kn(an&&an.message?an.message:"Datafeed error")}catch{}}},getMarks:async(ln,Oe,sn,fn,Et)=>{const Kn=ln.ticker||ln.name;if(hb(Kn))return fn([]);const Cn=YP[Et]||null;Cn&&(ft=Cn);let Bt=Number(Oe),an=Number(sn);const Pn=Math.floor(Date.now()/1e3);(!Number.isFinite(Bt)||!Number.isFinite(an)||an<=Bt||Bt<=0||an<=0)&&(an=Pn,Bt=an-30*24*3600);const qn=je==="extended"?qe(Kn):Kn;if(je==="extended"&&!tt)return fn([]);const nr=[je,qn||Kn,Bt,an,ft];je==="extended"&&nr.push(tt||"no-key");const tr=nr.join("|");if(tr===en&&Dt.length)return fn(Dt);if(At&&At.key===tr){const zn=await At.promise;return fn(zn)}At={key:tr,promise:(async()=>{try{let zn=new Map;if(je==="hyperliquid"){const Lt=await Hn(Kn,Bt,an);zn=new Map;for(const Fn of Lt){const Ee=hv(Fn.t,ft),p=Math.floor(Ee/1e3),h=Fn.b?"B":"S",S=p+"-"+h;zn.has(S)||zn.set(S,{time:p,isBuy:Fn.b})}}else if(je==="extended"){const Lt=await $n(qn,Bt,an);zn=new Map;for(const Fn of Lt){const Ee=hv(Fn.t,ft),p=Math.floor(Ee/1e3),h=Fn.b?"B":"S",S=p+"-"+h;zn.has(S)||zn.set(S,{time:p,isBuy:Fn.b})}}const Yn=Array.from(zn.values()).map((Lt,Fn)=>({id:Lt.time+"-"+(Lt.isBuy?"B":"S")+"-"+Fn,time:Lt.time,color:Lt.isBuy?dfn:ffn,label:Lt.isBuy?"B":"S",labelFontColor:Lt.isBuy?CHe:SHe,text:Lt.isBuy?"Buy":"Sell",minSize:16,borderWidth:1,hoveredBorderWidth:2})).sort((Lt,Fn)=>Lt.time-Fn.time);return en=tr,Dt=Yn,At=null,Yn}catch{return At=null,[]}})()};const Qt=await At.promise;fn(Qt)},getTimescaleMarks:(ln,Oe,sn,fn)=>fn([]),subscribeBars:(ln,Oe,sn,fn)=>{const Et=ln.ticker||ln.name,Kn=YP[Oe]||"1m";if(jt[fn]=sn,ft=Kn,je==="lighter"){Jn(fn);const Cn=Pj[ft]||60,Bt=Math.max(2e3,Math.min(15e3,Math.floor(Cn*1e3/3)));let an=0;const Pn=async()=>{try{const qn=Math.floor(Date.now()/1e3),nr=qn-Cn*500,tr=await vn(Ie,ft,nr,qn);if(!Array.isArray(tr)||!tr.length)return;const Qt=tr[tr.length-1];if(!Number.isFinite(Qt.time))return;if(Qt.time>an){an=Qt.time;const zn=jt[fn];zn&&zn(Qt)}}catch{}};Pn(),un[fn]=setInterval(Pn,Bt);return}if(je==="extended"){if(hb(Et))return;const Cn=qe(Et);if(!Cn)return;const Bt=Rt(Kn);if(tn=`${rfn}/stream.extended.exchange/v1/candles/${encodeURIComponent(Cn)}/trades?interval=${encodeURIComponent(Bt)}`,dt){try{dt.close()}catch{}dt=null}xn();return}if(je==="hyperliquid")if(hb(Et)){const Cn=String(Et).split("/"),Bt=Cn[0],an=Cn[1];dn(Bt,an,Kn)}else{if(kt={type:"candle",coin:Et,interval:Kn},at){try{at.close()}catch{}at=null}It()}},unsubscribeBars:ln=>{delete jt[ln],Jn(ln)},cleanup:()=>{try{at&&at.close()}catch{}try{dt&&dt.close()}catch{}try{ct&&ct.close()}catch{}try{Ut&&Ut.close()}catch{}Nn(),en="",Dt=[],At=null,Je=null,He=null,tn=null}}}const fe=ae(s||null,Ne=>{ee=Ne},o,l,c,u,o==="extended"?d:null);g.current=fe;let Ae=null;if(typeof window<"u"){const Ne=window.localStorage.getItem(eSe);if(Ne)try{Ae=tSe(JSON.parse(Ne))}catch{}}const ce={container:f.current.id,library_path:r,datafeed:fe,autosize:!0,theme:"dark",locale:"en",timezone:re,loading_screen:{backgroundColor:"#101010"},enabled_features:["timeframes_toolbar","two_character_bar_marks_labels"],disabled_features:["header_symbol_search","symbol_search_hot_key","header_interval_dialog_button","header_settings","header_fullscreen_button","header_compare","header_undo_redo"],auto_save_delay:5,custom_formatters:{price:Ne=>Number(Ne).toLocaleString("en-US",{minimumFractionDigits:ee,maximumFractionDigits:ee})},custom_css_url:"/tv-custom.css",overrides:{"paneProperties.background":"#101010","paneProperties.backgroundGradientStartColor":"#101010","paneProperties.backgroundGradientEndColor":"#101010","paneProperties.vertGridProperties.color":"#202020","paneProperties.horzGridProperties.color":"#202020","scalesProperties.textColor":"#dcdada","scalesProperties.abbreviateLabel":!1,"mainSeriesProperties.candleStyle.upColor":"#67FFBD","mainSeriesProperties.candleStyle.downColor":"#FF7272","mainSeriesProperties.candleStyle.borderUpColor":"#67FFBD","mainSeriesProperties.candleStyle.borderDownColor":"#FF7272","mainSeriesProperties.candleStyle.wickUpColor":"#67FFBD","mainSeriesProperties.candleStyle.wickDownColor":"#FF7272","timeScale.rightOffset":100,"scalesProperties.allowSymbolChange":!0,"scalesProperties.backgroundColor":"#101010","scalesProperties.showLeftScale":!1,"scalesProperties.showRightScale":!0,"scalesProperties.vertTouchDrag":!0,"scalesProperties.vertScrollZoom":!0}};Ae?ce.saved_data=Ae:(ce.symbol=e,ce.interval=ie);const ye=new window.TradingView.widget(ce);x.current=ye,ye.onChartReady(()=>{const Ne=ye.activeChart(),be=()=>{var Ie;try{(Ie=Ne.autoScaleAllSeries)==null||Ie.call(Ne)}catch{}},je=()=>{!ye||!ye.save||typeof window>"u"||ye.save(Ie=>{try{const Re=tSe(Ie||{});window.localStorage.setItem(eSe,JSON.stringify(Re||{}))}catch{}})};if(!Ae)try{const Ie=Math.floor(Date.now()/1e3);Ne.setVisibleRange({from:Ie-30*24*3600,to:Ie},{percentRightMargin:.2}),be()}catch{}try{Ne.setEntityMarksVisible(!0)}catch{}Ne.onIntervalChanged().subscribe(null,Ie=>{try{const Re=YP[Ie]||Ie||ie;Re&&typeof window<"u"&&window.localStorage.setItem("tranding_chart_interval_time",Re)}catch{}try{Ne.requestMarksRefresh()}catch{}je()}),ye.subscribe("onAutoSaveNeeded",()=>{je()}),je(),C(!0)})})(),()=>{G=!1;const V=x.current,ee=g.current;try{const ae=V&&V.activeChart&&V.activeChart();ae&&(QP(v.current,V,ae),v.current.clear(),QP(U.current,V,ae),U.current.clear())}catch{}try{ee&&ee.cleanup&&ee.cleanup()}catch{}try{V&&V.remove&&V.remove()}catch{}x.current=null,g.current=null,C(!1)}},[r,o,l,c,e,t,s]),m.useEffect(()=>{if(!g.current)return;g.current.setWallet(s||null);const G=x.current;if(!G||!w)return;const V=G.activeChart&&G.activeChart();if(V)try{V.requestMarksRefresh&&V.requestMarksRefresh()}catch{}},[s,w]),m.useEffect(()=>{g.current&&typeof g.current.setExtendedApiKey=="function"&&g.current.setExtendedApiKey(o==="extended"&&d||null)},[d,o]),m.useEffect(()=>{if(!g.current||o!=="extended")return;const G=g.current.setExtendedFallbackPrice;typeof G=="function"&&G(u)},[u,o]),m.useEffect(()=>{if(!w||o!=="hyperliquid"&&o!=="extended")return;const G=x.current,V=G&&G.activeChart&&G.activeChart();if(!V||!V.createMultipointShape)return;const ee=v.current;QP(ee,G,V),ee.clear();const ae=Array.isArray(Z)?Z:[];if(!ae.length)return;const fe=V.getVisibleRange&&V.getVisibleRange(),Ae=Math.floor(Date.now()/1e3),ce=fe&&fe.to||Ae,ye=new Map;for(const Ne of ae){const be=wue(Ne);if(!Number.isFinite(be)||be<=0)continue;const je=Ne.sideRaw==="S"?"S":"B",Ie=/take\s*profit/i.test(String(Ne.type||"")),Re=/stop/i.test(String(Ne.type||"")),Be=`${be}|${je}|${Ie?"TP":Re?"SL":"L"}`,it=AHe(Ne);if(!ye.has(Be))ye.set(Be,{base:Ne,px:be,sz:it});else{const tt=ye.get(Be);tt.sz+=it}}ye.forEach(({base:Ne,px:be,sz:je})=>{const Ie=jfn(Ne),Re={...Ne,sz:je},Qe=Afn(Re,e),Be={time:ce,price:be};try{const it=V.createMultipointShape([Be],{shape:"horizontal_line",text:Qe,lock:!0,disableSelection:!0,disableSave:!0,overrides:{linecolor:Ie.br,linewidth:1,linestyle:2,extendLeft:!0,extendRight:!0,showLabel:!0,textcolor:Ie.txt,fillBackground:!0,backgroundColor:Ie.bg,bold:!1,fontsize:11}}),tt=Efn(Re,e);v.current.set(tt,it)}catch{}})},[Z,w,e,o]),m.useEffect(()=>{if(!w||Z.length>0)return;const G=x.current,V=G&&G.activeChart&&G.activeChart();if(!V)return;let ee=null;try{const ye=V.getPanes&&V.getPanes();if(Array.isArray(ye)&&ye[0]){const Ne=ye[0].getRightPriceScales&&ye[0].getRightPriceScales();Array.isArray(Ne)&&Ne[0]?ee=Ne[0]:ye[0].getMainSourcePriceScale&&(ee=ye[0].getMainSourcePriceScale())}}catch{}const ae=U.current;if(QP(ae,G,V),ae.clear(),!Array.isArray(a)){try{ee&&ee.setAutoScale(!0)}catch{}return}const fe=V.getVisibleRange&&V.getVisibleRange(),Ae=Math.floor(Date.now()/1e3),ce=fe&&fe.to||Ae;if(a.forEach((ye,Ne)=>{const be=Number(typeof ye=="number"?ye:ye&&ye.price);if(!Number.isFinite(be)||be<=0)return;const je=typeof ye=="object"&&ye?ye.side:null,Ie=je==="buy"?"#1EC98A":je==="sell"?"#FF5C7A":"#444CFF";try{const Re=V.createMultipointShape([{time:ce,price:be}],{shape:"horizontal_line",lock:!0,disableSelection:!0,disableSave:!0,text:"",overrides:{linecolor:Ie,linewidth:1,linestyle:2,extendLeft:!0,extendRight:!0,showLabel:!1,fillBackground:!1}});ae.set(`grid-${e}-${Ne}-${be}`,Re)}catch{}}),ee)try{ee.setAutoScale(!0)}catch{}},[a,w,e,Z.length]);const oe=n||`tv_${e}_container`;return i.jsx("div",{id:oe,ref:f,className:"relative h-full min-h-[320px] w-full bg-[#101010]"})}const kfn=({headerData:e,setIsDigits:t,markets:n=[],coin:r="",onCoinChange:s=()=>{},marketsLoading:a=!1})=>{const o=(e==null?void 0:e.source)==="extended",l=(e==null?void 0:e.nextFundingTime)??(e==null?void 0:e.nextFundingRate),[c,u]=m.useState(jX(l)),[d,f]=m.useState((e==null?void 0:e.markPx)||0),[x,g]=m.useState("text-white"),v=m.useRef((e==null?void 0:e.markPx)||0);m.useEffect(()=>{var ne;if((e==null?void 0:e.markPx)!=null){const J=((ne=e.markPx.toString().split(".")[1])==null?void 0:ne.length)||0;t(J)}},[e==null?void 0:e.markPx,t]),m.useEffect(()=>{u(jX(l));const ne=setInterval(()=>u(jX(l)),1e3);return()=>clearInterval(ne)},[l]),m.useEffect(()=>{if((e==null?void 0:e.markPx)==null)return;const ne=e.markPx,J=v.current;ne>J?g("text-[#1DE6A3]"):ne<J&&g("text-[#FF7173]"),f(ne);const Z=setTimeout(()=>g("text-white"),700);return v.current=ne,()=>clearTimeout(Z)},[e==null?void 0:e.markPx]);const w=(e==null?void 0:e.markPx)!=null&&(e==null?void 0:e.prevDayPx)!=null?e.markPx-e.prevDayPx:null,C=w!=null?w/e.prevDayPx*100:null,N=C!=null?C>=0?"text-[#1DE6A3]":"text-[#FF7173]":"text-white",I=ne=>{const J=Number(ne);if(!Number.isFinite(J))return null;const Z=Math.abs(J);let re=1;return Z>=1e3?re=1:Z>=100?re=2:Z>=1?re=3:Z>=.1?re=4:re=6,J.toLocaleString(void 0,{maximumFractionDigits:re})},P=ne=>ne==null||isNaN(ne)?null:ne>=1e3?zw(ne):ne,R=ne=>{const J=Number(ne);if(!Number.isFinite(J))return null;const Z=Math.abs(J),re=J>=0?"+":"-";if(!o)return`${re}${Z.toFixed(5)}`;let he=0;Z<.1?he=6:Z<1?he=4:Z<10?he=2:Z<100&&(he=1);const Y=Z.toFixed(he),ie=he>0?Y.replace(/\.?0+$/,""):Y;return`${re}${ie}`},F=w!=null?R(w):null,U=d!=null?o?I(d):P(d):null,L=(e==null?void 0:e.dayNtlVlm)!=null?`$${zw(Number(e.dayNtlVlm))}`:null,z=(e==null?void 0:e.oraclePx)!=null&&(e==null?void 0:e.openInterest)!=null?`$${zw(Number(e.oraclePx*e.openInterest))}`:null,X=(e==null?void 0:e.funding)!=null?`${(e.funding*100).toFixed(4)}%`:null;return i.jsxs("div",{className:"flex items-center w-full gap-2",children:[i.jsx("div",{className:"flex-none",children:i.jsx(gue,{markets:n,value:r,onChange:s,loading:a,showIcon:!0})}),i.jsx("div",{className:"flex-1 overflow-x-auto whitespace-nowrap [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:i.jsxs("div",{className:"flex items-center px-1",children:[i.jsx(X7,{label:"Mid Price",value:U,tone:x}),i.jsx(X7,{label:"24h Change",value:F,sub:C!=null?`${C>=0?"+":"-"}${Math.abs(C).toFixed(2)}%`:null,tone:N}),i.jsx(X7,{label:"Vol 24h",value:L}),i.jsx(X7,{label:"Open Interest",value:z}),i.jsx(X7,{label:"Funding",value:X,sub:e!=null&&e.funding?c:null,tone:"text-[#50D2C1]"})]})})]})};function jX(e){const t=new Date,n=t.getTime(),r=Number(e);if(Number.isFinite(r)&&r>n){const d=Math.max(0,Math.floor((r-n)/1e3)),f=String(Math.floor(d/3600)).padStart(2,"0"),x=String(Math.floor(d%3600/60)).padStart(2,"0"),g=String(d%60).padStart(2,"0");return`${f}:${x}:${g}`}t.setSeconds(t.getSeconds()+1);const s=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds()),a=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours()+1,0,0,0),o=Math.floor((a-s)/1e3),l=String(Math.floor(o/3600)).padStart(2,"0"),c=String(Math.floor(o%3600/60)).padStart(2,"0"),u=String(o%60).padStart(2,"0");return`${l}:${c}:${u}`}const X7=({label:e,value:t,sub:n=null,tone:r="text-white"})=>i.jsxs("div",{className:"shrink-0 inline-flex items-baseline gap-1 pr-3 mr-3 border-r border-white/5 last:mr-0 last:pr-0 last:border-r-0",children:[i.jsx("span",{className:"text-[11px] leading-none text-[#909090]",children:e}),i.jsx("span",{className:`text-xs leading-none font-semibold font-inter tabular-nums ${r}`,children:t??i.jsx(Tfn,{w:"90px"})}),n!=null&&i.jsx("span",{className:`text-[11px] leading-none ${r}`,children:n})]}),Tfn=({w:e="90px"})=>i.jsx("span",{className:"inline-block align-middle h-[12px] rounded skeleton-ticker-text short",style:{width:e}}),Ifn=({coin:e,data:t,loading:n,period:r,periods:s,handlePeriodChange:a})=>i.jsx("div",{className:"flex justify-start items-start p-4 w-full",children:i.jsxs("div",{className:"flex flex-col items-start justify-center gap-4 w-full",children:[i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[12px] w-full",children:[i.jsxs("div",{className:"flex justify-between items-center w-full",children:[i.jsxs("div",{className:"flex justify-start items-center gap-0.5 xl:gap-2 w-full",children:[i.jsx("div",{className:"text-[#dcdada] text-[11px] xl:text-sm font-semibold font-inter leading-4 tracking-wider uppercase",children:"Positioning"}),n&&i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[32px] xl:w-[54px] px-0.5 xl:px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]})]}),i.jsx("div",{className:"flex xl:hidden",children:i.jsx(kce,{periods:s,selectedPeriod:r,handlePeriod:a,borderColor:"ticker"})})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-1.5 w-full min-w-full border border-[#333333] rounded-lg p-1.5",children:[i.jsx(jp,{name:"Total Positions",info:t!=null&&t.total_notional?`$${Ku(t==null?void 0:t.total_notional)}`:"--",color:1}),i.jsx(jp,{name:"Traders",info:t!=null&&t.total_traders?`${Ku(t==null?void 0:t.total_traders)}`:"--",color:1,info_1:"true"}),i.jsx(Fne,{data_1:t!=null&&t.long_percentage?t==null?void 0:t.long_percentage:0,data_2:t!=null&&t.long_percentage?parseFloat(100-(t==null?void 0:t.long_percentage)).toFixed(2):0,margin:"true"})]})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[12px] w-full",children:[i.jsx("div",{className:"text-[#dcdada] text-[11px] xl:text-sm font-semibold font-inter leading-4 tracking-wider uppercase",children:"Breakdown"}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-1.5 w-full min-w-full border border-[#333333] rounded-lg p-1.5",children:[i.jsx(jp,{name:"Long",info:t!=null&&t.long_qty?`${Er(t==null?void 0:t.long_qty)} ${e}`:"--",color:2}),i.jsx(jp,{name:"Total",info:t!=null&&t.total_qty?`${Er(t==null?void 0:t.total_qty)} ${e}`:"--",color:1}),i.jsx(jp,{name:"Short",info:t!=null&&t.short_qty?`${Er(t==null?void 0:t.short_qty)} ${e}`:"--",color:3,info_1:"true"}),i.jsx(Fne,{data_1:t!=null&&t.long_pct?t==null?void 0:t.long_pct:0,data_2:t!=null&&t.short_pct?t==null?void 0:t.short_pct:0})]})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-[12px] w-full",children:[i.jsx("div",{className:"text-[#dcdada] text-[11px] xl:text-sm font-semibold font-inter leading-4 tracking-wider uppercase",children:"Position Stats"}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-1.5 w-full min-w-full border border-[#67FFBD] rounded-lg p-3",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2 pb-2.5",children:[i.jsx("div",{className:"text-[#67FFBD] text-[10px] font-semibold font-inter leading-[10px] tracking-wide uppercase",children:"Long"}),i.jsx("img",{src:xJ,alt:""})]}),i.jsx(jp,{name:"Total Notional",info:t!=null&&t.total_long_notional?`$${Ku(t==null?void 0:t.total_long_notional)}`:"--",color:1}),i.jsx(jp,{name:"Avg Entry",info:t!=null&&t.avg_long_entry?`$${Er(t==null?void 0:t.avg_long_entry)}`:"--",color:1}),i.jsx(jp,{name:"Total PnL",info:t!=null&&t.total_long_pnl?`$${Ku(Math.abs(t==null?void 0:t.total_long_pnl))}`:"--",color:(t==null?void 0:t.total_long_pnl)==null||isNaN(parseFloat(t==null?void 0:t.total_long_pnl))||(t==null?void 0:t.total_long_pnl)==0?1:(t==null?void 0:t.total_long_pnl)>0?2:3,info_1:"true"}),i.jsxs("div",{className:"flex justify-start items-center gap-2 w-full mt-3",children:[i.jsx(rSe,{data_1:t!=null&&t.long_profit_ratio?t==null?void 0:t.long_profit_ratio:0,color:"Long"}),i.jsxs("div",{className:"text-[#7b7b7b] text-[11px] font-normal font-['Inter'] leading-none min-w-max flex justify-start items-center",children:[t!=null&&t.long_profit_ratio?t==null?void 0:t.long_profit_ratio:"--","% in profit"]})]})]}),i.jsxs("div",{className:"flex flex-col items-start justify-center gap-1.5 w-full min-w-full border border-[#FF797C] rounded-lg p-3",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2 pb-2.5",children:[i.jsx("div",{className:"text-[#FF797C] text-[10px] font-semibold font-inter leading-[10px] tracking-wide uppercase",children:"Short"}),i.jsx("img",{src:gJ,alt:""})]}),i.jsx(jp,{name:"Total Notional",info:t!=null&&t.total_short_notional?`$${Ku(t==null?void 0:t.total_short_notional)}`:"--",color:1}),i.jsx(jp,{name:"Avg Entry",info:t!=null&&t.avg_short_entry?`$${Er(t==null?void 0:t.avg_short_entry)}`:"--",color:1}),i.jsx(jp,{name:"Total PnL",info:t!=null&&t.total_short_pnl?`$${Ku(Math.abs(t==null?void 0:t.total_short_pnl))}`:"--",info_1:"true",color:(t==null?void 0:t.total_short_pnl)==null||isNaN(parseFloat(t==null?void 0:t.total_short_pnl))||(t==null?void 0:t.total_short_pnl)==0?1:(t==null?void 0:t.total_short_pnl)>0?2:3}),i.jsxs("div",{className:"flex justify-start items-center gap-2 w-full mt-3",children:[i.jsx(rSe,{data_1:t!=null&&t.short_profit_ratio?t==null?void 0:t.short_profit_ratio:0,color:"Short"}),i.jsxs("div",{className:"text-[#7b7b7b] text-[11px] font-normal font-['Inter'] leading-none min-w-max flex justify-start items-center",children:[t!=null&&t.short_profit_ratio?t==null?void 0:t.short_profit_ratio:"--","% in profit"]})]})]})]})]})}),jp=({name:e,info:t,info_1:n,color:r})=>i.jsxs("div",{className:"flex flex-col items-start w-full gap-1.5",children:[i.jsxs("div",{className:"flex justify-between items-center w-full",children:[i.jsx("div",{className:"text-[#b0b0b0] text-xs font-semibold font-inter leading-none",children:e}),i.jsx("div",{className:`${r==1?"bg-[#313137] text-white":r==2?"bg-[#1de6a3]/20 text-[#67ffbd]":r==3?"bg-[#ff797c]/20 text-[#ff787b]":""} h-6 p-2 rounded-[256px] justify-start items-center gap-2 inline-flex`,children:i.jsx("div",{className:"text-[11px] font-semibold font-inter leading-none",children:t})})]}),i.jsx("div",{className:`${n==="true"?"hidden":""} w-full h-px bg-[#282d33]`})]}),rSe=({data_1:e,color:t})=>i.jsx("div",{className:"h-1 w-full bg-[#333333] rounded-[256px] flex gap-[2px] overflow-hidden",children:i.jsx("div",{style:e?isNaN(e)?{width:"0%"}:{width:`${e}%`}:{width:"0%"},className:`${t=="Long"?"bg-[#67FFBD]":t=="Short"?"bg-[#FF797C]":"bg-[#67FFBD]"} flex justify-center items-center h-1  rounded-[256px]  text-[11px] font-bold font-inter leading-[8px] tracking-[0.18px]`})}),Pfn="wss://api.hyperliquid.xyz/ws",Ffn="https://api.hyperliquid.xyz/info",QL=e=>e==null?0:Number(e),ZL=(e,t=6)=>isNaN(e)?"--":e.toLocaleString(void 0,{maximumFractionDigits:t}),Ofn=(e,t)=>{if(isNaN(e))return"--";const n=Number(t);let r=0;return n>0&&n<1&&(r=Math.min(8,Math.max(0,-Math.floor(Math.log10(n))))),e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:r})},Mfn=e=>{if(e>=1)return e.toLocaleString();const t=Math.min(8,Math.max(0,-Math.floor(Math.log10(e))));return e.toFixed(t)},jHe={BTC:{1:{value:1,nSigFigs:null,mantissa:null},10:{value:2,nSigFigs:5,mantissa:null},20:{value:5,nSigFigs:5,mantissa:2},50:{value:10,nSigFigs:5,mantissa:5},100:{value:100,nSigFigs:3,mantissa:null},1e3:{value:1e3,nSigFigs:2,mantissa:null}},ETH:{.1:{value:.1,nSigFigs:null,mantissa:null},.2:{value:.2,nSigFigs:5,mantissa:2},.5:{value:.5,nSigFigs:5,mantissa:5},1:{value:1,nSigFigs:4,mantissa:null},10:{value:10,nSigFigs:3,mantissa:null},100:{value:100,nSigFigs:2,mantissa:null}}},Rfn=e=>{if(!e)return null;const t=String(e).toUpperCase(),n=jHe[t];return n?Object.values(n).map(s=>s.value).filter(s=>Number.isFinite(s)&&s>0).sort((s,a)=>s-a):null},Lfn=(e,t)=>{if(!e)return null;const n=String(e).toUpperCase(),r=jHe[n];if(!r)return null;const s=Number(t)||0;return Object.values(r).find(l=>l.value===s)||null};function sSe(e,t,n){const r=new Map;for(const s of e||[]){const a=QL(s.px),o=QL(s.sz);if(!a||!o||!t)continue;const l=n==="bid"?Math.floor(a/t)*t:Math.ceil(a/t)*t,c=Number(l.toFixed(12));r.set(c,(r.get(c)||0)+o)}return[...r.entries()].map(([s,a])=>({price:s,size:a}))}async function Dfn(e){var o;const n=await fetch(Ffn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"l2Book",coin:e})});if(!n.ok)throw new Error("info request failed");const r=await n.json(),s=(r==null?void 0:r.levels)||((o=r==null?void 0:r.data)==null?void 0:o.levels),a=Array.isArray(s==null?void 0:s[0])&&s[0]||(s==null?void 0:s.bs)||(s==null?void 0:s.bids)||[];if(!Array.isArray(a)||!a.length)throw new Error("orderbook empty or bad format");return a}function Bfn(e){const t=e.slice(0,10).map(o=>Number(o.px??(Array.isArray(o)?o[0]:void 0))).filter(o=>Number.isFinite(o)),n=[];for(let o=0;o<t.length-1;o++){const l=t[o]-t[o+1];l>0&&n.push(l)}if(!n.length)return 0;const s=Math.min(...n).toFixed(18).replace(/0+$/g,"").replace(/\.$/,""),a=Number(s);return Number.isFinite(a)?a:0}function $fn(e){const t=e.toFixed(18).replace(/0+$/g,"").replace(/\.$/,""),n=Number(t);return Number.isFinite(n)?n:0}function Ufn(e,t){if(!e||e<=0)return[];const n=Math.floor(Math.log10(e)),r=[];t>0&&r.push(t);const s=n-4,a=Math.pow(10,s);[1,2,5].forEach(g=>r.push(g*a));const o=n-3;r.push(Math.pow(10,o));const l=n-2;r.push(Math.pow(10,l));const c=n-1;r.push(Math.pow(10,c));const u=r.filter(g=>g>0&&Number.isFinite(g)).map($fn),d=Array.from(new Set(u)).sort((g,v)=>g-v),f=t>0?t:0;return d.filter(g=>g>=f&&g>0)}function iSe(e){const n=(e||"").toUpperCase()==="BTC"?[1,10,20,50,100,1e3,1e4]:[.001,.01,.1,10,100];return Array.from(new Set(n)).sort((r,s)=>r-s)}async function zfn(e){if(!e)return[];const t=String(e).trim(),n=Rfn(t);if(n&&n.length)return n;const r=t.toUpperCase();try{const s=await Dfn(t),a=s[0],o=Number((a==null?void 0:a.px)??(Array.isArray(a)?a[0]:void 0));if(!Number.isFinite(o)||o<=0)throw new Error("bad bestBid");const l=Bfn(s);let c=Ufn(o,l);return r!=="BTC"?c=c.filter(u=>u!==1):c.includes(1)||c.push(1),c=Array.from(new Set(c.filter(u=>Number.isFinite(u)&&u>0))).sort((u,d)=>u-d),c.length?c:iSe(t)}catch(s){return console.error("getUiStepsForCoin error",t,s),iSe(t)}}function Hfn(e,t){const n=Lfn(t,e);if(n)return{nSigFigs:n.nSigFigs,mantissa:n.mantissa};const r=Number(e)||0;let s=null;r>=1e4?s=2:r>=1e3?s=3:r>=100?s=4:r>=10&&(s=5);let a;if(s===5&&r>=10){const o=Math.pow(10,Math.floor(Math.log10(r))),l=Math.floor(r/o);l<2?a=1:l<5?a=2:a=5}return{nSigFigs:s,mantissa:a}}function Vfn(e,t){return!e&&!t?!0:!e||!t?!1:e.type===t.type&&e.coin===t.coin&&(e.nSigFigs??null)===(t.nSigFigs??null)&&(e.mantissa??null)===(t.mantissa??null)}function Wfn({coin:e,rows:t=10,onSelectPrice:n,onBest:r}){const s=m.useRef(null),a=m.useRef([]),o=m.useRef(null),l=m.useRef(0),c=m.useRef(null),u=m.useRef(null),[d,f]=m.useState({bids:[],asks:[]}),[x,g]=m.useState("COIN"),[v,w]=m.useState(null),[C,N]=m.useState([]),I=(G,V)=>x==="USD"?G*V:G,P=x==="USD"?"USD":e,R=G=>{const V=s.current;V&&V.readyState===WebSocket.OPEN?V.send(JSON.stringify(G)):(a.current.push(G),F())},F=()=>{const G=s.current;if(G&&(G.readyState===WebSocket.OPEN||G.readyState===WebSocket.CONNECTING)||o.current)return;const V=new WebSocket(Pfn);s.current=V,V.onopen=()=>{l.current=0,a.current.splice(0,a.current.length).forEach(ae=>V.send(JSON.stringify(ae)))},V.onmessage=ee=>{var Re;const ae=JSON.parse(ee.data||"{}");if((ae==null?void 0:ae.channel)!=="l2Book")return;const fe=(ae==null?void 0:ae.data)??ae,Ae=(fe==null?void 0:fe.coin)??(ae==null?void 0:ae.coin);if(!Ae||Ae!==c.current)return;const ce=(fe==null?void 0:fe.levels)??((Re=fe==null?void 0:fe.data)==null?void 0:Re.levels)??(ae==null?void 0:ae.levels);let ye,Ne;if(Array.isArray(ce))ye=ce[0]||[],Ne=ce[1]||[];else if(ce)ye=ce.bs||ce.bids||[],Ne=ce.as||ce.asks||[];else return;const be=Qe=>(Qe||[]).map(Be=>{const it=Number(Array.isArray(Be)?Be[0]:Be.px),tt=Number(Array.isArray(Be)?Be[1]:Be.sz);return{px:it,sz:tt}}).filter(Be=>Number.isFinite(Be.px)&&Be.px>0&&Number.isFinite(Be.sz)&&Be.sz>0),je=be(ye),Ie=be(Ne);f({bids:je,asks:Ie})},V.onclose=()=>{l.current=Math.min(l.current+1,6),o.current=setTimeout(()=>{o.current=null,F()},500*Math.pow(2,l.current))},V.onerror=()=>{try{V.close()}catch{}}},U=G=>{G&&(Vfn(u.current,G)||(u.current&&R({method:"unsubscribe",subscription:u.current}),u.current=G,R({method:"subscribe",subscription:G})))},L=()=>{f({bids:[],asks:[]})};m.useEffect(()=>{let G=!1;try{s.current&&s.current.readyState<=1&&(s.current.onmessage=null,s.current.onopen=null,s.current.onclose=null,s.current.onerror=null,s.current.close())}catch{}if(s.current=null,u.current=null,a.current=[],l.current=0,o.current=null,L(),N([]),w(null),c.current=e||null,!!e)return F(),(async()=>{const V=await zfn(e);G||(N(V),w(V[0]??null))})(),()=>{G=!0}},[e]),m.useEffect(()=>{if(!e)return;const G=v||1,{nSigFigs:V,mantissa:ee}=Hfn(G,e),ae={type:"l2Book",coin:e};V!=null&&(ae.nSigFigs=V),ee!=null&&(ae.mantissa=ee),U(ae)},[e,v]);const z=m.useMemo(()=>(d.bids||[]).map(G=>QL(G.px)).filter(G=>Number.isFinite(G)&&G>0),[d]),X=m.useMemo(()=>(d.asks||[]).map(G=>QL(G.px)).filter(G=>Number.isFinite(G)&&G>0),[d]),ne=z.length?Math.max(...z):null,J=X.length?Math.min(...X):null;m.useEffect(()=>{ne!=null&&J!=null&&(r==null||r({bestBid:ne,bestAsk:J,mid:(ne+J)/2}))},[ne,J,r]);const Z=m.useMemo(()=>{const G=Number(v)||1,V=sSe(d.bids,G,"bid").sort((ae,fe)=>fe.price-ae.price),ee=sSe(d.asks,G,"ask").sort((ae,fe)=>ae.price-fe.price);return{bids:V,asksAsc:ee}},[d,v]),re=m.useMemo(()=>{const G=Z.asksAsc.slice(0,t);let V=0;return G.map(ae=>(V+=I(ae.size,ae.price),{...ae,total:V})).reverse()},[Z,t,x]),he=m.useMemo(()=>{const G=Z.bids.slice(0,t);let V=0;return G.map(ee=>(V+=I(ee.size,ee.price),{...ee,total:V}))},[Z,t,x]),Y=m.useMemo(()=>{if(ne==null||J==null)return null;const G=Math.abs(J-ne),V=(J+ne)/2;return{diff:G,pct:V?G/V*100:0}},[ne,J]),ie=Math.max(re.reduce((G,V)=>Math.max(G,V.total||0),0),1e-9),oe=Math.max(he.reduce((G,V)=>Math.max(G,V.total||0),0),1e-9);return i.jsxs("div",{className:"flex flex-col h-full w-full font-semibold font-inter",children:[i.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-[#292929]",children:[i.jsx(oSe,{value:String(v??""),onChange:G=>w(Number(G)),items:(C||[]).map(G=>({key:String(G),label:Mfn(G)}))}),i.jsx(oSe,{value:x,onChange:g,items:[{key:"USD",label:"USD"},{key:"COIN",label:e}],align:"right"})]}),i.jsxs("div",{className:"grid grid-cols-[84px_1fr_1fr] px-3 py-2 text-[11px] text-[#9b9b9b] w-full",children:[i.jsx("span",{className:"uppercase",children:"Price"}),i.jsxs("span",{className:"uppercase text-center",children:["Size (",P,")"]}),i.jsxs("span",{className:"uppercase text-right",children:["Total (",P,")"]})]}),i.jsx("div",{className:"flex-1 overflow-hidden w-full",children:i.jsxs("div",{className:"overflow-auto w-full",children:[re.map((G,V)=>i.jsx(aSe,{side:"ask",step:Number(v)||1,price:G.price,size:G.size!=null?I(G.size,G.price):null,total:G.total,widthPct:G.total?Math.min(100,G.total/ie*100):0,onClick:()=>G.price!=null&&(n==null?void 0:n(G.price)),unit:x},`ask-${V}`)),i.jsxs("div",{className:"grid grid-cols-[84px_1fr_1fr] px-3 py-2 text-[11px] text-[#9b9b9b] border-y border-[#292929] my-1 w-full",children:[i.jsx("span",{className:"uppercase",children:"Spread"}),i.jsx("span",{className:"text-right",children:Y?ZL(Y.diff,4):"--"}),i.jsx("span",{className:"text-right",children:Y?`${ZL(Y.pct,4)}%`:"--"})]}),he.map((G,V)=>i.jsx(aSe,{side:"bid",step:Number(v)||1,price:G.price,size:G.size!=null?I(G.size,G.price):null,total:G.total,widthPct:G.total?Math.min(100,G.total/oe*100):0,onClick:()=>G.price!=null&&(n==null?void 0:n(G.price)),unit:x},`bid-${V}`))]})})]})}function aSe({side:e,price:t,size:n,total:r,widthPct:s,onClick:a,step:o,unit:l}){const c=t==null,u=e==="bid"?"from-transparent to-[#67ffbd]/30":"from-transparent to-[#FF7272]/30",d=e==="bid"?"text-[#67FFBD]":"text-[#FF797C]",f=l==="USD";return i.jsxs("div",{className:"relative w-full font-semibold",children:[!c&&i.jsx("div",{className:`absolute left-0 top-px bottom-px bg-gradient-to-r ${u} transition-all duration-300 ease-[cubic-bezier(0.42,0,0.58,1)]`,style:{width:`${Math.max(0,s-2)}%`}}),i.jsxs("div",{className:`grid grid-cols-[84px_1fr_1fr] px-3 py-1 text-xs relative w-full ${c?"":"cursor-pointer"}`,onClick:c?void 0:a,children:[i.jsx("span",{className:`${c?"text-[#555]":d} hover:text-white`,children:c?"—":Ofn(t,o)}),i.jsx("span",{className:"text-center text-[#dcdada] hover:text-white",children:c?"—":ZL(n,f?0:6)}),i.jsx("span",{className:"text-right text-[#a8a8a8] hover:text-white",children:c?"—":ZL(r,f?0:6)})]})]})}function oSe({value:e,onChange:t,items:n,align:r="left"}){var l,c;const[s,a]=m.useState(!1),o=m.useRef(null);return m.useEffect(()=>{if(!s)return;const u=d=>{o.current&&(o.current.contains(d.target)||a(!1))};return window.addEventListener("mousedown",u),window.addEventListener("touchstart",u),()=>{window.removeEventListener("mousedown",u),window.removeEventListener("touchstart",u)}},[s]),i.jsxs("div",{className:"relative",ref:o,children:[i.jsxs("button",{className:"h-7 px-2 text-xs rounded-md border border-[#292929] bg-[#101010] text-[#dcdada] flex items-center gap-1",onClick:()=>a(u=>!u),children:[((l=n.find(u=>u.key===e))==null?void 0:l.label)??((c=n.find(u=>String(u.key)===String(e)))==null?void 0:c.label)??e,i.jsx("span",{className:"text-[#8b8b8b]",children:"▾"})]}),s&&i.jsx("div",{className:`absolute z-10 mt-1 min-w-[80px] rounded-md border border-[#292929] bg-[#101010] p-1 ${r==="right"?"right-0":"left-0"}`,children:n.map(u=>i.jsx("div",{className:`px-2 py-1 text-xs rounded cursor-pointer ${String(u.key)===String(e)?"bg-[#262626] text-white":"text-[#dcdada] hover:bg-[#262626]"}`,onClick:()=>{t(u.key),a(!1)},children:u.label},u.key))})]})}const qfn="wss://api.hyperliquid.xyz/ws",Gfn=e=>`https://app.hyperliquid.xyz/explorer/tx/${e}`,lSe=e=>e==null?0:Number(e),Kfn=(e,t=6)=>isNaN(e)?"--":e.toLocaleString(void 0,{maximumFractionDigits:t}),Yfn=e=>isNaN(e)?"--":e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:4}),Xfn=e=>new Date(e).toLocaleTimeString([],{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});function Qfn({coin:e,maxRows:t=300}){const n=m.useRef(null),r=m.useRef(null),s=m.useRef([]),a=m.useRef(null),[o,l]=m.useState([]);m.useEffect(()=>{var g,v;const u=w=>({method:"subscribe",subscription:{type:"trades",coin:w}}),d=w=>({method:"unsubscribe",subscription:{type:"trades",coin:w}});if(!n.current)n.current=new WebSocket(qfn),n.current.onopen=()=>{var w;(w=n.current)==null||w.send(JSON.stringify(u(e))),a.current=setInterval(()=>{var C;try{(C=n.current)==null||C.send(JSON.stringify({method:"ping"}))}catch{}},3e4)};else{if(r.current&&r.current!==e)try{(g=n.current)==null||g.send(JSON.stringify(d(r.current)))}catch{}try{(v=n.current)==null||v.send(JSON.stringify(u(e)))}catch{}}const f=w=>{const C=JSON.parse(w.data||"{}");if((C==null?void 0:C.channel)==="trades"&&(C!=null&&C.data)){const N=Array.isArray(C.data)?C.data:[C.data];s.current.push(...N)}};n.current.addEventListener("message",f);const x=setInterval(()=>{if(!s.current.length)return;const w=s.current.splice(0,s.current.length);l(C=>{const N=[...w,...C],I=[],P=new Set;for(const R of N){const F=R.tid??`${R.hash??""}-${R.time??""}`;if(!P.has(F)&&(P.add(F),I.push(R),I.length>=t))break}return I.sort((R,F)=>(F.time||0)-(R.time||0)),I})},150);return r.current=e,()=>{var w;(w=n.current)==null||w.removeEventListener("message",f),clearInterval(x)}},[e,t]),m.useEffect(()=>()=>{var u;a.current&&clearInterval(a.current);try{(u=n.current)==null||u.close()}catch{}},[]);const c=m.useMemo(()=>o,[o]);return i.jsxs("div",{className:"flex flex-col h-full w-full font-semibold",children:[i.jsxs("div",{className:"grid grid-cols-[100px_1fr_90px_28px] px-3 py-2 text-[11px] text-[#9b9b9b]",children:[i.jsx("span",{className:"uppercase whitespace-nowrap",children:"PRICE"}),i.jsxs("span",{className:"uppercase text-center whitespace-nowrap",children:["SIZE (",String(e).toUpperCase(),")"]}),i.jsx("span",{className:"uppercase text-right whitespace-nowrap",children:"TIME"}),i.jsx("span",{})]}),i.jsx("div",{className:"flex-1 overflow-auto",children:c.map(u=>{const d=lSe(u.px),f=lSe(u.sz),v=String(u.side||"").toLowerCase().startsWith("b")?"text-[#67FFBD]":"text-[#FF797C]";return i.jsxs("div",{className:"grid grid-cols-[100px_1fr_90px_28px] px-3 py-1.5 text-xs items-center font-inter",children:[i.jsx("div",{className:v,children:Yfn(d)}),i.jsx("div",{className:"text-right text-[#dcdada]",children:Kfn(f)}),i.jsx("div",{className:"text-right text-[#a8a8a8]",children:u.time?Xfn(u.time):"--:--:--"}),i.jsx("div",{className:"flex justify-end",children:u.hash?i.jsx("a",{href:Gfn(u.hash),target:"_blank",rel:"noreferrer",className:"text-white hover:text-white opacity-70 hover:opacity-100",children:i.jsx(det,{className:"w-4 h-4 shrink-0"})}):null})]},(u.tid??u.hash)+String(u.time))})})]})}function Zfn({coin:e,data:t,loading:n,period:r,periods:s,handlePeriodChange:a,onBookPrice:o,onBest:l,className:c=""}){const[u,d]=m.useState("orderbook"),[f,x]=m.useState("orderbook"),g=[{k:"orderbook",t:"Order Book"},{k:"trades",t:"Trades"}],v=N=>{x(u),d(N)},w=g.findIndex(N=>N.k===u)>g.findIndex(N=>N.k===f)?"right":"left",C={enter:N=>({x:N==="right"?24:-24,opacity:0}),center:{x:0,opacity:1},exit:N=>({x:N==="right"?-24:24,opacity:0})};return i.jsx("div",{className:`flex h-full min-h-0 flex-col gap-2 ${c}`,children:i.jsxs("div",{className:"bg-[#101010] flex-1 min-h-0 overflow-hidden relative rounded-[16px] pt-2",children:[i.jsx("div",{className:"relative flex w-full px-2 gap-2",children:g.map(N=>{const I=u===N.k;return i.jsxs("button",{onClick:()=>v(N.k),className:`relative flex-1 flex items-center justify-center py-[6px] cursor-pointer font-semibold text-xs rounded-[12px] bg-transparent ${I?"text-white":"text-[#a8a8a8] hover:text-white"}`,children:[I&&i.jsx(go.span,{layoutId:"side-pill",className:"absolute inset-0 bg-[#262626] rounded-[12px]",transition:{type:"spring",stiffness:380,damping:30}}),i.jsx("span",{className:"relative z-10",children:N.t})]},N.k)})}),i.jsx("div",{className:"relative w-full h-[calc(100%-40px)] min-h-0",children:i.jsx(mT,{mode:"wait",custom:w,children:i.jsxs(go.div,{custom:w,variants:C,initial:"enter",animate:"center",exit:"exit",transition:{type:"spring",stiffness:320,damping:28},className:"absolute inset-0",children:[u==="position"&&i.jsx("div",{className:"h-full overflow-auto",children:i.jsx(Ifn,{coin:e,data:t,loading:n,period:r,periods:s,handlePeriodChange:a})}),u==="orderbook"&&i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(Wfn,{coin:e,rows:9,onSelectPrice:o,onBest:l})}),u==="trades"&&i.jsx("div",{className:"h-full overflow-auto",children:i.jsx(Qfn,{coin:e})})]},u)})})]})})}const EHe="#101010",jo="#101010",ka="#2b3640",Vi="#929292",Oi="#929292",_g="#67FFBD",Fj="#FF7272",Jfn="https://dextrabothypev2.nftinit.io",ehn=[{key:"market",label:"Market"},{key:"limit",label:"Limit"},{key:"twap",label:"Twap"}];function thn({mode:e,onModeChange:t,className:n=""}){const r=m.useMemo(()=>ehn,[]),s=m.useRef(null),a=m.useRef({}),[o,l]=m.useState({w:0,x:0}),c=()=>{const u=a.current[e],d=s.current;if(!u||!d)return;const f=u.getBoundingClientRect(),x=d.getBoundingClientRect();l({w:f.width,x:f.left-x.left})};return m.useEffect(()=>{c()},[e]),m.useEffect(()=>{const u=()=>c();return window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[e]),i.jsxs("div",{ref:s,className:`relative flex items-center justify-evenly gap-8 ${n}`,style:{borderBottom:`1px solid ${ka}`},children:[r.map(u=>{const d=e===u.key;return i.jsx("button",{ref:f=>a.current[u.key]=f,onClick:()=>t(u.key),className:"relative font-semibold bg-transparent",style:{color:d?"#FFFFFF":Oi,opacity:d?1:.85,letterSpacing:"-0.01em"},children:u.label},u.key)}),i.jsx("div",{className:"absolute bottom-[-1px] left-0 h-[2px] rounded-full transition-all duration-200",style:{width:o.w,transform:`translateX(${o.x}px)`,background:"#67FFBD"}})]})}function g4({children:e,onClick:t}){return i.jsx("button",{onClick:t,className:"w-full px-[16px] py-[6px] bg-[#262626] grid place-items-center rounded-[8px] text-white font-semibold",style:{border:`1px solid ${ka}`},children:e})}function pb({label:e,value:t,onChange:n,right:r,clearZeroOnFocus:s=!0,restoreZeroOnBlur:a=!0}){const o=r?Se.cloneElement(r,{onClick:c=>{Number(t)===0&&n(""),typeof r.props.onClick=="function"&&r.props.onClick(c)}}):null,l=c=>{let u=c.target.value;if(u===""||u==="."){n(u);return}if(u.includes(".")){const[d,f=""]=u.split(".");u=f?`${d}.${f.slice(0,2)}`:d}n(u)};return i.jsxs("div",{className:"mb-3",children:[i.jsx("div",{className:"mb-1",style:{color:Oi},children:e}),i.jsxs("div",{className:"flex items-center gap-2 h-[30px] px-2 rounded-lg",style:{background:jo,border:`1px solid ${ka}`},children:[i.jsx("input",{className:"min-w-0 flex-1 bg-transparent outline-none font-inter text-white placeholder:text-gray-500",inputMode:"decimal",type:"number",value:t,onChange:l,onFocus:()=>{s&&String(t)!==""&&Number(t)===0&&n("")},onBlur:c=>{a&&(c.target.value===""||c.target.value===".")&&n("0")},placeholder:"0.00",style:{fontFeatureSettings:'"tnum"'}}),i.jsx("div",{className:"shrink-0",children:o})]})]})}function ZP({value:e,onChange:t,items:n}){var o;const[r,s]=m.useState(!1),a=((o=n.find(l=>l.key===e))==null?void 0:o.label)??e;return i.jsxs("div",{className:"relative",children:[i.jsxs("div",{onClick:()=>s(l=>!l),className:"h-[26px] px-2 rounded-md flex justify-center items-center cursor-pointer",style:{background:jo,color:Vi},children:[a," ▾"]}),r&&i.jsx("div",{className:"absolute right-0 z-40 mt-1 min-w-[140px] rounded-md p-1",style:{background:jo,border:`1px solid ${ka}`},children:n.map(l=>i.jsx("div",{className:"px-2 py-1 rounded cursor-pointer",style:{background:l.key===e?"#26313b":"transparent",color:l.key===e?"#ffffff":Vi},onClick:()=>{t(l.key),s(!1)},children:l.label},l.key))})]})}function pv({k:e,v:t,strong:n=!1,link:r=!1}){return i.jsxs("div",{className:"flex items-center justify-between text-[#929292] font-inter text-[13px] font-normal leading-4 space-y-2",children:[i.jsx("span",{children:e}),i.jsx("span",{style:{color:Vi},children:t})]})}function cSe({children:e,onClick:t,className:n=""}){return i.jsx("button",{onClick:t,className:`flex justify-center items-center h-[30px] px-4 py-2 shrink-0 rounded-lg border border-[rgba(80,80,80,0.32)] text-white font-inter text-[13px] not-italic font-normal leading-[16px] bg-transparent ${n}`,children:e})}function nm({title:e,children:t}){return i.jsxs("div",{className:"w-[520px] max-w-[92vw]",style:{background:EHe,border:`1px solid ${ka}`,borderRadius:16,padding:16},children:[e&&i.jsx("div",{className:"mb-3 text-sm font-semibold",style:{color:Vi},children:e}),t]})}function E0({children:e,onClick:t}){return i.jsx("button",{onClick:t,className:"w-full h-[38px] rounded-xl font-semibold text-sm",style:{background:_g,color:"#0f151a"},children:e})}function EX({active:e,onClick:t,title:n,desc:r}){return i.jsxs("button",{onClick:t,className:"w-full text-left rounded-xl p-3 mb-2",style:{background:e?"rgba(103,255,189,0.12)":jo,border:`1px solid ${e?"#67FFBD":ka}`,color:Vi},children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:e?"#67FFBD":"#555"}}),i.jsx("div",{className:"font-semibold",children:n})]}),i.jsx("div",{className:"text-[12px] leading-5",style:{color:Oi},children:r})]})}function qh({open:e,onClose:t,children:n}){const[r,s]=m.useState(!1),[a,o]=m.useState(!1);return m.useEffect(()=>{if(e)s(!0),requestAnimationFrame(()=>o(!0)),document.body.style.overflow="hidden";else{o(!1),document.body.style.overflow="";const l=setTimeout(()=>s(!1),200);return()=>clearTimeout(l)}},[e]),m.useEffect(()=>{const l=c=>{c.key==="Escape"&&t()};return e&&window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,t]),r?Ia.createPortal(i.jsx("div",{className:`fixed inset-0 z-[9999] flex items-center justify-center transition-opacity ${a?"opacity-100":"opacity-0"}`,style:{background:"rgba(0,0,0,0.45)",backdropFilter:"blur(6px)"},onMouseDown:t,children:i.jsx("div",{className:`transform transition-all ${a?"translate-y-0 scale-100":"translate-y-2 scale-[0.98]"} relative`,onMouseDown:l=>l.stopPropagation(),children:n})}),document.body):null}function Zm({onClick:e}){return i.jsx("button",{onClick:e,className:"w-full h-[36px] rounded-xl font-bold text-[12px] transition-opacity mb-2 flex items-center justify-center bg-[#67FFBD] text-black",children:"Connect"})}function rre(e=""){return e?`${e.slice(0,6)}...${e.slice(-4)}`:""}const _X="https://api.hyperliquid.xyz/info",nhn="wss://api.hyperliquid.xyz/ws",kX={accountValue:0,withdrawable:0,totalNtlPos:0,totalRawUsd:0,totalMarginUsed:0,crossMaintenanceMarginUsed:0,unrealizedPnl:0,crossAccountValue:0};function gT(e){const[t,n]=m.useState(kX),[r,s]=m.useState([]),[a,o]=m.useState({}),[l,c]=m.useState({}),[u,d]=m.useState({}),[f,x]=m.useState(!1),g=m.useRef(null),v=m.useRef(null);m.useEffect(()=>{let I=!0;return n(kX),s([]),o({}),c({}),d({}),x(!1),e?((async()=>{try{const[P,R,F]=await Promise.all([fetch(_X,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"clearinghouseState",user:e})}),fetch(_X,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"spotClearinghouseState",user:e})}),fetch(_X,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"spotMeta"})})]);if(!I)return;const U=await P.json(),L=await R.json(),z=await F.json(),X=(U==null?void 0:U.marginSummary)||{},ne=(U==null?void 0:U.crossMarginSummary)||{},J=Array.isArray(U==null?void 0:U.assetPositions)?U.assetPositions.reduce((oe,G)=>{var V;return oe+Number(((V=G==null?void 0:G.position)==null?void 0:V.unrealizedPnl)||0)},0):0,Z={accountValue:Number((X==null?void 0:X.accountValue)||0),totalNtlPos:Number((X==null?void 0:X.totalNtlPos)||0),totalRawUsd:Number((X==null?void 0:X.totalRawUsd)||0),withdrawable:Number((U==null?void 0:U.withdrawable)||0),totalMarginUsed:Number((X==null?void 0:X.totalMarginUsed)||0),crossMaintenanceMarginUsed:Number((U==null?void 0:U.crossMaintenanceMarginUsed)||0),unrealizedPnl:J,crossAccountValue:Number((ne==null?void 0:ne.accountValue)||0)},re=Array.isArray(L==null?void 0:L.balances)?L.balances.map(oe=>({coin:String(oe.coin),total:Number(oe.total||0),hold:Number(oe.hold||0)})):[],he={},Y={};if((Array.isArray(z==null?void 0:z.tokens)?z.tokens:[]).forEach(oe=>{const G=oe==null?void 0:oe.name;G&&(oe.tokenId&&(he[G]=oe.tokenId),Y[G]={tokenId:oe.tokenId||null,evmContract:oe.evmContract||null})}),!I)return;n(Z),s(re),o(he),c(Y)}catch{if(!I)return;n(kX),s([]),o({}),c({})}finally{I&&x(!0)}})(),()=>{I=!1}):(I&&x(!0),()=>{I=!1})},[e]),m.useEffect(()=>{if(!e)return;const I=new WebSocket(nhn);return g.current=I,I.onopen=()=>{[{method:"subscribe",subscription:{type:"user",user:e}},{method:"subscribe",subscription:{type:"webData2",user:e}}].forEach(P=>I.send(JSON.stringify(P))),v.current=setInterval(()=>{I.readyState===WebSocket.OPEN&&I.send(JSON.stringify({id:99,method:"ping"}))},3e4)},I.onmessage=P=>{var R,F,U,L,z,X;try{const ne=JSON.parse(P.data);if((ne==null?void 0:ne.channel)==="webData2"&&((R=ne==null?void 0:ne.data)!=null&&R.clearinghouseState)){const Z=ne.data.clearinghouseState,re=(Z==null?void 0:Z.marginSummary)||{},he=(Z==null?void 0:Z.crossMarginSummary)||{},Y=Array.isArray(Z==null?void 0:Z.assetPositions)?Z.assetPositions.reduce((ie,oe)=>{var G;return ie+Number(((G=oe==null?void 0:oe.position)==null?void 0:G.unrealizedPnl)||0)},0):0;n(ie=>({...ie,accountValue:Number((re==null?void 0:re.accountValue)||0),totalNtlPos:Number((re==null?void 0:re.totalNtlPos)||0),totalRawUsd:Number((re==null?void 0:re.totalRawUsd)||0),withdrawable:(Z==null?void 0:Z.withdrawable)!=null?Number(Z.withdrawable):ie.withdrawable,totalMarginUsed:Number((re==null?void 0:re.totalMarginUsed)||0),crossMaintenanceMarginUsed:Number((Z==null?void 0:Z.crossMaintenanceMarginUsed)||0),crossAccountValue:Number((he==null?void 0:he.accountValue)||0),unrealizedPnl:Y}))}if((ne==null?void 0:ne.channel)==="webData2"&&Array.isArray((F=ne==null?void 0:ne.data)==null?void 0:F.assetCtxs)){const Z={};for(const re of ne.data.assetCtxs){const he=re==null?void 0:re.coin,Y=Number((re==null?void 0:re.midPx)??(re==null?void 0:re.markPx)??(re==null?void 0:re.px));he&&Number.isFinite(Y)&&(Z[he]=Y)}Object.keys(Z).length&&d(re=>({...re,...Z}))}if((ne==null?void 0:ne.channel)==="user"&&((U=ne==null?void 0:ne.data)!=null&&U.state)){const Z=ne.data.state,re=(Z==null?void 0:Z.marginSummary)||{},he=Array.isArray(Z==null?void 0:Z.assetPositions)?Z.assetPositions.reduce((Y,ie)=>{var oe;return Y+Number(((oe=ie==null?void 0:ie.position)==null?void 0:oe.unrealizedPnl)||0)},0):void 0;n(Y=>({...Y,accountValue:Number((re==null?void 0:re.accountValue)||0),totalNtlPos:Number((re==null?void 0:re.totalNtlPos)||0),totalRawUsd:Number((re==null?void 0:re.totalRawUsd)||0),totalMarginUsed:Number((re==null?void 0:re.totalMarginUsed)||0),...he!=null?{unrealizedPnl:he}:{}}))}const J=Array.isArray((z=(L=ne==null?void 0:ne.data)==null?void 0:L.spotState)==null?void 0:z.balances)?ne.data.spotState.balances:Array.isArray((X=ne==null?void 0:ne.data)==null?void 0:X.balances)?ne.data.balances:null;if(Array.isArray(J)){const Z=J.filter(re=>re&&re.coin).map(re=>({coin:String(re.coin),total:Number(re.total||0),hold:Number(re.hold||0)}));s(Z)}}catch{}},I.onclose=()=>{v.current&&clearInterval(v.current)},I.onerror=()=>{},()=>{v.current&&clearInterval(v.current);try{I.close()}catch{}}},[e]);const w=m.useMemo(()=>({spot:r.reduce((P,R)=>{if(R.coin==="USDC")return P+Number(R.total||0);const F=u[R.coin];return P+(F?Number(R.total||0)*Number(F):0)},0),perps:t.accountValue}),[r,u,t.accountValue]),C=m.useMemo(()=>{const I=t.accountValue,P=t.unrealizedPnl,R=Number(t.crossAccountValue||0)>0?Number(t.crossAccountValue||0):Number(I||0),F=R>0?Number(t.crossMaintenanceMarginUsed||0)/R:0,U=Number(t.crossMaintenanceMarginUsed||0),L=I>0?t.totalNtlPos/I:0;return{balance:I,uPnl:P,cmr:F,maintenanceMargin:U,crossLeverage:L}},[t]);return{rows:m.useMemo(()=>{const I=[];return I.push({id:"perps",kind:"perps",coin:"USDC",unit:"USDC",totalDisplay:t.accountValue,totalSort:t.accountValue,availableDisplay:t.withdrawable,availableSort:t.withdrawable,usdcValue:t.accountValue}),r.forEach(P=>{const R=Math.max(0,Number(P.total||0)-Number(P.hold||0)),F=u[P.coin],U=P.coin==="USDC"?Number(P.total||0):Number(F)?Number(P.total||0)*Number(F):null;I.push({id:`spot-${P.coin}`,kind:"spot",coin:P.coin,unit:P.coin,totalDisplay:P.total,totalSort:P.total,availableDisplay:R,availableSort:R,usdcValue:U})}),I},[t,r,u]),perps:t,spotBalances:r,tokenIdMap:a,tokenMetaMap:l,priceMap:u,accountEquity:w,perpsOverview:C,initialLoaded:f}}const rhn="https://dextrabothypev2.nftinit.io/api/wallet/request-agent",shn="https://express-proxy-delta.vercel.app/proxy?url=",ihn="https://api.starknet.extended.exchange/api/v1",_He=e=>`${Number(e||0).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})} USDC`;function ahn({w:e,active:t,onSelect:n,open:r,mode:s,balances:a}){const[o,l]=m.useState(!1),[c,u]=m.useState(!1);m.useEffect(()=>{try{l(!!localStorage.getItem("hyperToken"))}catch{}},[]);const d=(e.wallet_address||"").toLowerCase(),{perpsOverview:f}=gT(d),x=f==null?void 0:f.balance,g=a&&a[e.wallet_id!=null?String(e.wallet_id):""],v=e.available_balance??e.availableForTrade??e.available_for_trade??e.balance??e.available??null;let w=null;s==="lighter"||s==="extended"?w=g!=null?Number(g):v!=null?Number(v):NaN:w=x;const C=Number.isFinite(w);return m.useEffect(()=>{if(!r||!o)return;u(!0);const N=setTimeout(()=>u(!1),2e3);return()=>clearTimeout(N)},[r,o,d]),m.useEffect(()=>{C&&u(!1)},[C]),i.jsxs("div",{className:"px-3 py-2 rounded cursor-pointer",style:{background:t?"#26313b":"transparent",color:t?"#ffffff":Vi},onClick:n,children:[i.jsxs("div",{className:"text-xs font-semibold flex items-center gap-2",children:[i.jsx("span",{children:e.wallet_name}),c?i.jsx(qUe,{size:3,color:"#ffffff"}):C?i.jsxs("span",{className:"text-[11px]",children:["— ",_He(w)]}):""]}),i.jsx("div",{className:"text-[11px]",style:{color:Oi},children:rre(e.wallet_address)})]})}function bT({wallets:e=[],value:t,onChange:n,selectedBalance:r,mode:s="hyper"}){const[a,o]=m.useState(!1),[l,c]=m.useState(!1),[u,d]=m.useState(0),[f,x]=m.useState(!1),[g,v]=m.useState({}),w=m.useRef(new Set),C=m.useRef(null),N=m.useRef(null),{address:I}=Yr();m.useEffect(()=>{const X=()=>{try{c(!!localStorage.getItem("hyperToken")),d(ne=>ne+1)}catch{}};return X(),window.addEventListener("localStorageUpdated",X),window.addEventListener("storage",X),()=>{window.removeEventListener("localStorageUpdated",X),window.removeEventListener("storage",X)}},[]),m.useEffect(()=>{if(!l||!t)return;x(!0);const X=setTimeout(()=>x(!1),2e3);return()=>clearTimeout(X)},[t,l]),m.useEffect(()=>{var ne;Number.isFinite(Number(r))&&x(!1);const X=e&&e.length?String(((ne=e.find(J=>String(J.wallet_id)===String(t))||e[0])==null?void 0:ne.wallet_id)??""):null;X&&Number.isFinite(Number(r))&&Number(r)>=0&&(C.current=X,v(J=>J[X]===Number(r)?J:{...J,[X]:Number(r)}))},[r,e,t]),m.useEffect(()=>{const X=J=>{N.current&&(N.current.contains(J.target)||o(!1))},ne=J=>{J.key==="Escape"&&o(!1)};return document.addEventListener("pointerdown",X,!0),document.addEventListener("keydown",ne),()=>{document.removeEventListener("pointerdown",X,!0),document.removeEventListener("keydown",ne)}},[]);const P=e&&e.length>0,R=P?e.find(X=>String(X.wallet_id)===String(t))||(t?null:e[0]):null,F=R&&R.wallet_address?`${R.wallet_name||`Wallet ${R.wallet_id}`} — ${rre(R.wallet_address)}`:R?R.wallet_name||`Wallet ${R.wallet_id}`:I?`MetaMask — ${rre(I)}`:"Select Wallet";let U=null;if(Number.isFinite(Number(r)))U=Number(r);else if(R){const ne=(g&&g[R.wallet_id!=null?String(R.wallet_id):""])??R.available_balance??R.availableForTrade??R.available_for_trade??R.balance??R.available??null,J=Number(ne);Number.isFinite(J)&&(U=J)}const L=R&&!f&&U!=null?`${F} — ${_He(U)}`:F,z=m.useCallback(async X=>{var G;if(s!=="hyper")return{data:{agent_pk:null,from_cache:!1}};const ne=localStorage.getItem("hyperTradeToken")||"",J=localStorage.getItem("hyperToken")||"",Z=localStorage.getItem("hyperAddress")||"",re=`hl_pk:${X}`,he=localStorage.getItem(re);if(he)return localStorage.setItem("hl_pk",he),{data:{agent_pk:he,from_cache:!0}};const ie=await(await fetch(rhn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Z,trade_token:ne,token:J,wallet_id:String(X)})})).json().catch(()=>({})),oe=(G=ie==null?void 0:ie.data)==null?void 0:G.agent_pk;return oe&&(localStorage.setItem(re,oe),localStorage.setItem("hl_pk",oe)),ie},[s]);return m.useEffect(()=>{if(!R||s!=="hyper"||!l)return;const ne=`hl_pk:${String(R.wallet_id)}`,J=localStorage.getItem("hyperTradeToken")||"",Z=localStorage.getItem("hyperToken")||"",re=localStorage.getItem("hyperAddress")||"";if(!(!J||!Z||!re)){try{const he=localStorage.getItem(ne);if(he){localStorage.setItem("hl_pk",he);return}}catch{}z(R.wallet_id).catch(()=>{})}},[l,s,R,z,u]),m.useEffect(()=>{if(typeof window>"u")return;const X=s==="lighter"?"lighter":"hl";if(e&&e.length){const ne=e.find(re=>String(re.wallet_id)===String(t))||e[0];if(!ne)return;const J=String(ne.wallet_id),Z=String(ne.wallet_address||"").toLowerCase();try{window.localStorage.setItem(`${X}_selected_wallet_id`,J),window.localStorage.setItem(`${X}_selected_wallet_address`,Z),window.dispatchEvent(new Event("localStorageUpdated")),window.dispatchEvent(new CustomEvent("hl_selected_wallet_changed",{detail:{id:J,address:Z,mode:s}})),s==="hyper"&&l&&z(ne.wallet_id).catch(()=>{})}catch{}}else if(I){const ne="",J=String(I||"").toLowerCase();try{window.localStorage.setItem(`${X}_selected_wallet_id`,ne),window.localStorage.setItem(`${X}_selected_wallet_address`,J),window.dispatchEvent(new Event("localStorageUpdated")),window.dispatchEvent(new CustomEvent("hl_selected_wallet_changed",{detail:{id:ne,address:J,mode:s}}))}catch{}}},[e,t,s,I,l,z]),m.useEffect(()=>{if(s!=="extended")return;let X=!1;const ne=async J=>{var ie,oe,G;const Z=J.wallet_id!=null?String(J.wallet_id):"";if(!Z||w.current.has(Z))return;const re=g[Z];if(Number.isFinite(re)&&re>0)return;const he=J.available_balance??J.availableForTrade??J.available_for_trade??J.balance??J.available??null,Y=Number(he);if(Number.isFinite(Y)&&Y>0){v(V=>V[Z]===Y?V:{...V,[Z]:Y});return}if(J.wallet_api_key){w.current.add(Z);try{const V=`${shn}${encodeURIComponent(`${ihn}/user/balance`)}`,ae=await(await fetch(V,{headers:{"X-Api-Key":J.wallet_api_key}})).json().catch(()=>({}));if(X)return;const fe=((ie=ae==null?void 0:ae.data)==null?void 0:ie.availableForTrade)??(ae==null?void 0:ae.availableForTrade)??((oe=ae==null?void 0:ae.data)==null?void 0:oe.available_balance)??(ae==null?void 0:ae.available_balance)??((G=ae==null?void 0:ae.data)==null?void 0:G.available)??(ae==null?void 0:ae.available)??null,Ae=Number(fe);Number.isFinite(Ae)&&v(ce=>ce[Z]===Ae?ce:{...ce,[Z]:Ae})}catch{}finally{w.current.delete(Z)}}};return e.forEach(J=>ne(J)),()=>{X=!0}},[e,s,g]),i.jsxs("div",{className:"relative",ref:N,children:[i.jsxs("div",{onClick:()=>o(X=>!X),className:"h-[32px] px-3 rounded-md flex justify-between items-center cursor-pointer",style:{background:jo,border:`1px solid ${ka}`,color:Vi},children:[i.jsxs("span",{className:"truncate text-xs flex items-center gap-1",children:[L,f&&i.jsx(qUe,{size:3,color:"#ffffff"})]}),i.jsx("span",{className:"ml-2",children:"▾"})]}),a&&i.jsxs("div",{className:"absolute z-50 mt-1 w-full max-h-[240px] overflow-auto rounded-md p-1",style:{background:jo,border:`1px solid ${ka}`},children:[i.jsxs("div",{onClick:()=>{o(!1);const X=s==="hyper"?"hyperliquid":s==="lighter"?"lighter":"extended";window.open(`/wallet-management#${X}#add-account#${X}`,"_blank")},className:"px-3 py-2 text-[#1de674] font-semibold text-sm cursor-pointer flex justify-start items-center gap-1.5 border border-[#8860ff] rounded-md mb-1 bg-[#7445ff]",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Add Account"})]}),P&&e.map(X=>{const ne=String(X.wallet_id)===String(t);return i.jsx(ahn,{w:X,active:ne,open:a,mode:s,balances:g,onSelect:async()=>{n(String(X.wallet_id)),o(!1);try{await z(X.wallet_id)}catch{}}},X.wallet_id)}),!P&&i.jsx("div",{className:"px-3 py-2 text-xs",style:{color:Oi},children:"No wallets"})]})]})}const TX=new Map;function ohn(e,t){const n=TX.get(e);if(n)return n;const r=Promise.resolve().then(t).finally(()=>TX.delete(e));return TX.set(e,r),r}const lhn=15e3,uSe=new Map;function kHe(e,t,n=!0,{pollMs:r=0,refreshOnFocus:s=!1}={}){const[a,o]=m.useState([]),[l,c]=m.useState(!1),u=m.useCallback(async()=>{if(!e||!t){o([]);return}const d=`wallets:${e}:${n?1:0}`,f=Date.now(),x=uSe.get(d);if(x&&f-x.ts<lhn)return o(x.data),c(!1),x.data;c(!0);const g=await ohn(d,async()=>{const w=await(await fetch(`${Jfn}/api/wallet/confirmed-list`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:e,token:t})})).json();let C=Array.isArray(w==null?void 0:w.data)?w.data:Array.isArray(w)?w:w!=null&&w.wallet_id?[w]:[];return C=C.map(N=>{var I,P,R;return{...N,balances:{eth:((I=N==null?void 0:N.balances)==null?void 0:I.eth)??0,usdc:((P=N==null?void 0:N.balances)==null?void 0:P.usdc)??0,hyper_usdc:((R=N==null?void 0:N.balances)==null?void 0:R.hyper_usdc)??0}}}),C});return o(g),uSe.set(d,{ts:Date.now(),data:g}),c(!1),g},[e,t,n]);return m.useEffect(()=>{(async()=>await u())()},[u]),m.useEffect(()=>{if(!s)return;const d=()=>{document.visibilityState==="visible"&&u()};return document.addEventListener("visibilitychange",d),()=>document.removeEventListener("visibilitychange",d)},[u,s]),m.useEffect(()=>{if(!r)return;const d=setInterval(u,r);return()=>clearInterval(d)},[u,r]),{wallets:a,loading:l,refresh:u}}function KN({value:e,onChange:t,accent:n="#67FFBD",trackBg:r="rgba(255,255,255,0.12)",marks:s=[0,25,33,50,66,75,100],className:a="",snap:o=!1}){const[l,c]=m.useState(!1),u=(C,N,I)=>Math.max(N,Math.min(I,C)),d=Math.max(2,s.length)-1,f=C=>{const N=u(Number(C)||0,s[0],s[s.length-1]);if(N<=s[0])return 0;if(N>=s[s.length-1])return 100;let I=0;for(;I<d&&N>s[I+1];)I++;const P=s[I+1]-s[I]||1,R=(N-s[I])/P;return(I+R)/d*100},x=C=>{const I=u(Number(C)||0,0,100)/100*d,P=Math.min(d-1,Math.floor(I)),R=I-P,F=s[P]+(s[P+1]-s[P])*R;if(!o)return F;let U=s[0],L=1/0;for(const z of s){const X=Math.abs(z-F);X<L&&(L=X,U=z)}return U},g=f(e),v=Math.round(u(e,0,100)),w={type:"spring",stiffness:420,damping:32,mass:.2};return i.jsxs("div",{className:`relative w-full pt-4 pb-5 ${a}`,children:[i.jsx("div",{className:"absolute inset-x-0 top-5 h-2 rounded-full",style:{background:r},children:i.jsx(Qp.div,{className:"h-2 rounded-full",animate:{width:`${g}%`},transition:w,style:{background:n}})}),i.jsx("div",{className:"absolute inset-x-0 top-6",children:s.map((C,N)=>{const I=N/d*100,P=g/100*d;return N<=P?null:i.jsx("div",{className:"absolute -translate-x-1/2 -translate-y-1/2 top-1/2",style:{left:`${I}%`},children:i.jsx("div",{className:"h-[10px] w-[10px] rounded-full",style:{background:n,boxShadow:"0 0 0 2px rgba(0,0,0,0.35) inset"}})},N)})}),i.jsx(Qp.div,{className:`${g>34?"-ml-2.5":"ml-2.5"} absolute top-5 -translate-y-full -translate-x-1/2 pointer-events-none z-10`,animate:{left:`${g}%`},transition:w,children:i.jsx("div",{className:"h-[18px] min-w-[24px] px-2 rounded-[6px] flex items-center justify-center text-[12px] leading-none",style:{background:n,color:"#0d0d0d",border:`1px solid ${ka}`},children:v})}),i.jsx(Qp.div,{className:"absolute top-[17px] -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none",animate:{left:`${g-2}%`,scale:l?1.12:1},transition:w,children:i.jsx("div",{className:"h-4 w-4 rounded-full",style:{background:"#0f151a",border:`2px solid ${n}`}})}),i.jsx("div",{className:"absolute inset-x-0 bottom-0",children:s.map((C,N)=>{if(N===0)return null;const I=N/d*100;return i.jsxs("div",{className:"absolute -translate-x-1/2 text-[12px] text-[#CFCFCF]",style:{left:`${I}%`},children:[C,"%"]},N)})}),i.jsx("input",{type:"range",min:0,max:100,step:.1,value:g,onMouseDown:()=>c(!0),onMouseUp:()=>c(!1),onTouchStart:()=>c(!0),onTouchEnd:()=>c(!1),onChange:C=>t(Math.round(x(C.target.value))),className:"absolute -left-2 -right-2 top-0 h-8 opacity-0 cursor-pointer z-30"})]})}const uC=42161,JP=10,IX=[{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{type:"address"},{type:"uint256"}],outputs:[{type:"bool"}]}],Km={BTC:"bc1plaavkq4u7wj8cc8nhrm6rxkhz9ylurw2u6l42ne7gw4493hvacks8wct4q",ETH:"0xa1D7ad9f7065BeE7b0b3E2AC30C9ddAaD9A70C71",SOL:"HWzcDXaTB2mPXvQYQy2g6PCNaj4mhTPVNoJP8zVupHJs",XPL:"0xa1D7ad9f7065BeE7b0b3E2AC30C9ddAaD9A70C71",USDC_BRIDGE_2:"0x2Df1c51E09aECF9cacB7bc98cB1742757f163dF7"},mv={USDC:{kind:"usdc",chains:[{key:"Arbitrum",label:"Arbitrum"}],icon:"USDC",bridge:Km.USDC_BRIDGE_2},BTC:{kind:"address",chains:[{key:"Bitcoin",label:"Bitcoin"}],icon:"BTC",address:Km.BTC,eta:"~21 minutes",fee:"~$2.29",min:"0.002 BTC",networkNote:"This address can only receive BTC on the Bitcoin network. Deposits below 0.002 BTC and deposits from other networks will result in a loss of funds."},ETH:{kind:"address",chains:[{key:"Ethereum",label:"Ethereum"}],icon:"ETH",address:Km.ETH,eta:"~3 minutes",fee:"~$1.22",min:"0.05 ETH",networkNote:"This address can only receive ETH on the Ethereum network. ETH sent from L2s (e.g. Arbitrum, Base, Optimism) will be lost. Any other asset (e.g., USDC, USDT) sent from Ethereum will be lost. Deposits below 0.05 ETH will result in a loss of funds."},SOL:{kind:"address",chains:[{key:"Solana",label:"Solana"}],icon:"SOL",address:Km.SOL,eta:"~1 minute",fee:"~1.40",min:"0.2 SOL",networkNote:"This address can only receive SOL on the Solana network. Any other asset (e.g., USDC, USDT) sent from Solana will be lost. Deposits below 0.2 SOL will result in a loss of funds."},"2Z":{kind:"address",chains:[{key:"Solana",label:"Solana"}],icon:"2Z",address:Km.SOL,eta:"~1 minute",fee:"~1.21",min:"150 2Z",networkNote:"This address can only receive 2Z on the Solana network. Deposits below 150 2Z will result in a loss of funds."},BONK:{kind:"address",chains:[{key:"Solana",label:"Solana"}],icon:"BONK",address:Km.SOL,eta:"~1 minute",fee:"~1.21",min:"1000000 BONK",networkNote:"This address can only receive BONK on the Solana network. Deposits below 1000000 BONK will result in a loss of funds."},FARTCOIN:{kind:"address",chains:[{key:"Solana",label:"Solana"}],icon:"FARTCOIN",address:Km.SOL,eta:"~1 minute",fee:"~1.21",min:"20 FARTCOIN",networkNote:"This address can only receive FARTCOIN on the Solana network. Deposits below 20 FARTCOIN will result in a loss of funds."},PUMP:{kind:"address",chains:[{key:"Solana",label:"Solana"}],icon:"PUMP",address:Km.SOL,eta:"~1 minute",fee:"~1.21",networkNote:"This address can only receive PUMP on the Solana network."},SPX:{kind:"address",chains:[{key:"Solana",label:"Solana"}],icon:"SPX",address:Km.SOL,eta:"~1 minute",fee:"~1.21",networkNote:"This address can only receive SPX on the Solana network."},XPL:{kind:"address",chains:[{key:"Plasma",label:"Plasma"}],icon:"XPL",address:Km.XPL,eta:"~1 minute",fee:"~1.20",min:"15 XPL",networkNote:"This address can only receive XPL on the Plasma network. Deposits below 15 XPL will result in a loss of funds."}};function chn({open:e,onClose:t,initialAsset:n="USDC",initialChain:r,toWalletAddress:s,usdcTokenAddress:a="0xaf88d065e77c8cC2239327C5EDb3A432268e5831"}){const[o,l]=m.useState(n),[c,u]=m.useState(r||mv[n].chains[0].key),d=mv[o],[f,x]=m.useState(""),[g,v]=m.useState(!1),[w,C]=m.useState(null),[N,I]=m.useState(!1);m.useEffect(()=>{e&&(l(n),u(r||mv[n].chains[0].key),x(""),v(!1),C(null),I(!1))},[e,n,r]);const P=m.useMemo(()=>`https://app.hyperliquid.xyz/coins/${(d.icon||o).toUpperCase()}.svg`,[o,d.icon]);d.kind==="usdc"?`${c}`:`${o}${c}`;const{address:R,isConnected:F}=Yr(),U=yA(),{switchChainAsync:L}=Vie(),z=x_e(),{writeContractAsync:X}=agt(),ne=o==="USDC",J=ne&&c==="Arbitrum",Z=ne&&c!=="Arbitrum",re=J&&U!==uC,{data:he}=Cme({address:a,abi:IX,functionName:"decimals",chainId:uC,query:{enabled:J}}),Y=Number(he??6),{data:ie,refetch:oe}=Cme({address:a,abi:IX,functionName:"balanceOf",args:[R??"0x0000000000000000000000000000000000000000"],chainId:uC,query:{enabled:J&&!!R}}),G=m.useMemo(()=>{try{return ie?jk(ie,Y):"0.00"}catch{return"0.00"}},[ie,Y]),V=J&&Number(f||0)<JP;function ee(Ne,be="error"){C({text:Ne,type:be})}function ae(Ne){const be=String((Ne==null?void 0:Ne.shortMessage)||(Ne==null?void 0:Ne.message)||Ne||"");return be.toLowerCase().includes("does not match the connection's chain")||be.toLowerCase().includes("chain mismatch")||be.toLowerCase().includes("connector chain")?"You're not on Arbitrum. Please switch to Arbitrum.":be}async function fe(){try{if(!F)return ee("Wallet is not connected");if(Z)return ee("The deposit bridge supports Arbitrum only");re&&await L({chainId:uC});const Ne=String(f||"").trim();if(!Ne||Number(Ne)<=0)return ee("Enter a valid amount");if(Number(Ne)<JP)return ee(`Minimum is ${JP} USDC`);const be=tmt(Ne,Y);v(!0),C({type:"info",text:"Submitting transaction..."});const je=await X({address:a,abi:IX,functionName:"transfer",args:[mv.USDC.bridge,be],chainId:uC});C({type:"info",text:"Waiting for confirmation..."}),await z.waitForTransactionReceipt({hash:je}),C({type:"success",text:"Deposit completed"}),x(""),oe==null||oe()}catch(Ne){ee(ae(Ne),"error")}finally{v(!1)}}function Ae(Ne){var be;Ne&&((be=navigator.clipboard)==null||be.writeText(Ne),I(!0),setTimeout(()=>I(!1),1500))}const ce=Z?"Arbitrum Required":J?re?"Deposit":g?"Depositing...":"Deposit":"Done",ye=g||Z||J&&V;return i.jsx(qh,{open:e,onClose:t,children:i.jsxs("div",{className:"relative",children:[i.jsx("button",{onClick:t,className:"absolute -top-1 right-1 w-8 h-8 rounded-full grid place-items-center text-white/90 bg-transparent",children:"×"}),i.jsxs("div",{className:"w-[560px] max-w-[92vw] rounded-2xl shadow-xl border border-[#2a2a2a] bg-[#101010] p-5",children:[i.jsx("div",{className:"w-12 h-12 rounded-full mx-auto -mt-10 mb-2 overflow-hidden flex justify-center items-center bg-[#1B1B1B]",children:i.jsx("img",{src:P,alt:o,className:"w-10 h-10",onError:Ne=>{Ne.currentTarget.style.display="none"}})}),i.jsx("div",{className:"text-center text-[18px] font-semibold mb-4 text-white",children:d.kind==="usdc"?`Deposit USDC from ${c}`:`Deposit ${o} from ${c}`}),w&&i.jsx("div",{className:"p-2 rounded-lg text-[12px] mb-3",style:{background:w.type==="error"?"#3b1f1f":w.type==="success"?"#1f3b2b":"#1b2a3b",color:w.type==="error"?"#ffb4b4":w.type==="success"?"#b7ffd8":"#c9e1ff",border:"1px solid #2a2a2a"},children:w.text}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"h-[42px] rounded-lg border border-[#2a2a2a] bg-[#262626] px-3 flex items-center justify-between",children:[i.jsx("span",{className:"text-[13px] text-[#b7b7b7]",children:"Asset"}),i.jsxs("div",{className:"relative",children:[i.jsx("select",{className:"appearance-none bg-transparent text-[13px] text-white outline-none",value:o,onChange:Ne=>{var je;const be=Ne.target.value;l(be),u((je=mv[be].chains[0])==null?void 0:je.key),C(null)},children:Object.keys(mv).map(Ne=>i.jsx("option",{value:Ne,children:Ne},Ne))}),i.jsx("svg",{className:"pointer-events-none absolute right-0 top-1/2 -translate-y-1/2 w-4 h-4 text-[#8c8c8c]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:i.jsx("path",{d:"M6 9l6 6 6-6"})})]})]}),i.jsxs("div",{className:"h-[42px] rounded-lg border border-[#2a2a2a] bg-[#262626] px-3 flex items-center justify-between",children:[i.jsx("span",{className:"text-[13px] text-[#b7b7b7]",children:"Deposit Chain"}),i.jsxs("div",{className:"relative",children:[i.jsx("select",{className:"appearance-none bg-transparent pr-6 text-[13px] text-white outline-none",value:c,onChange:Ne=>{u(Ne.target.value),C(null)},children:mv[o].chains.map(Ne=>i.jsx("option",{value:Ne.key,children:Ne.label},Ne.key))}),i.jsx("svg",{className:"pointer-events-none absolute right-0 top-1/2 -translate-y-1/2 w-4 h-4 text-[#8c8c8c]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:i.jsx("path",{d:"M6 9l6 6 6-6"})})]})]}),s&&d.kind!=="usdc"&&i.jsxs("div",{className:"h-[42px] rounded-lg border border-[#2a2a2a] bg-[#262626] px-3 flex items-center justify-between",children:[i.jsx("span",{className:"text-[13px] text-[#b7b7b7]",children:"To"}),i.jsxs("span",{className:"text-xs text-white",children:[s.slice(0,6),"...",s.slice(-4)]})]}),J&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"relative h-[42px] rounded-lg border border-[#2a2a2a] bg-[#262626] flex items-center justify-between px-3",children:[i.jsx("input",{type:"text",className:"w-full bg-transparent outline-none text-[13px] text-white placeholder:text-[#6a6a6a] font-mono pr-[55px]",placeholder:"0.00",value:f,onChange:Ne=>x(Ne.target.value.replace(",",".").replace(/[^\d.]/g,"")),inputMode:"decimal"}),i.jsxs("button",{type:"button",onClick:()=>x(String(G)),className:"absolute right-3 text-[12px] text-[#67FFBD] font-semibold",children:["MAX: ",Number(G||0).toFixed(2)]})]}),i.jsxs("div",{className:"text-[11px]",style:{color:V?"#ffb4b4":"#9BA3A7"},children:["Minimum: ",JP," USDC"]})]}),ne&&i.jsx(i.Fragment,{children:Z&&i.jsxs("div",{className:"p-2 rounded-lg text-[12px] mt-1 border border-[#2a2a2a] bg-[#3b1f1f] text-[#ffb4b4]",children:["The deposit bridge supports ",i.jsx("b",{children:"Arbitrum"})," only. Please select Arbitrum as the deposit chain."]})}),d.kind==="address"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"text-[12px] leading-5 text-[#9BA3A7]",children:["Deposits should arrive after ",d.eta,". This service is provided by Unit Protocol. Estimated fee ",d.fee," depending on the ",c," network."]}),i.jsxs("div",{className:"h-[42px] rounded-lg border border-[#2a2a2a] bg-[#262626] px-3 flex items-center justify-between",children:[i.jsx("span",{className:"text-[13px] text-[#b7b7b7]",children:"Address"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-xs text-white truncate max-w-[240px]",children:d.address}),i.jsx("button",{onClick:()=>Ae(d.address),className:"text-[12px] text-[#67FFBD]",children:"Copy"})]})]}),N&&i.jsx("div",{className:"text-[11px] text-[#67FFBD]",children:"Copied ✓"}),d.networkNote&&i.jsxs("div",{className:"p-2 rounded-lg text-[12px] mt-1 border border-[#2a2a2a] bg-[#3b1f1f] text-[#ffb4b4]",children:["IMPORTANT: ",d.min?`Minimum ${d.min}. `:"",d.networkNote]})]}),i.jsx("button",{onClick:ne?Z?void 0:re?async()=>{try{C(null),await L({chainId:uC}),C({type:"success",text:"Switched to Arbitrum"})}catch(Ne){C({type:"error",text:ae(Ne)})}}:fe:t,disabled:ye,className:"w-full h-[44px] mt-2 rounded-xl font-semibold text-sm disabled:opacity-60 bg[rgba(103,255,189,0.16)] text-[#67FFBD] ",children:ce})]})]})]})})}function uhn(e){const t=e.length;let n=0,r=0;for(;r<t;){let s=e.charCodeAt(r++);if(s&4294967168)if(!(s&4294965248))n+=2;else{if(s>=55296&&s<=56319&&r<t){const a=e.charCodeAt(r);(a&64512)===56320&&(++r,s=((s&1023)<<10)+(a&1023)+65536)}s&4294901760?n+=4:n+=3}else{n++;continue}}return n}function dhn(e,t,n){const r=e.length;let s=n,a=0;for(;a<r;){let o=e.charCodeAt(a++);if(o&4294967168)if(!(o&4294965248))t[s++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&a<r){const l=e.charCodeAt(a);(l&64512)===56320&&(++a,o=((o&1023)<<10)+(l&1023)+65536)}o&4294901760?(t[s++]=o>>18&7|240,t[s++]=o>>12&63|128,t[s++]=o>>6&63|128):(t[s++]=o>>12&15|224,t[s++]=o>>6&63|128)}else{t[s++]=o;continue}t[s++]=o&63|128}}const fhn=new TextEncoder,hhn=50;function phn(e,t,n){fhn.encodeInto(e,t.subarray(n))}function mhn(e,t,n){e.length>hhn?phn(e,t,n):dhn(e,t,n)}new TextDecoder;class eF{constructor(t,n){this.type=t,this.data=n}}class JL extends Error{constructor(t){super(t);const n=Object.create(JL.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:JL.name})}}function xhn(e,t,n){const r=n/4294967296,s=n;e.setUint32(t,r),e.setUint32(t+4,s)}function THe(e,t,n){const r=Math.floor(n/4294967296),s=n;e.setUint32(t,r),e.setUint32(t+4,s)}function ghn(e,t){const n=e.getInt32(t),r=e.getUint32(t+4);return n*4294967296+r}const bhn=-1,yhn=4294967296-1,vhn=17179869184-1;function whn({sec:e,nsec:t}){if(e>=0&&t>=0&&e<=vhn)if(t===0&&e<=yhn){const n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e),n}else{const n=e/4294967296,r=e&4294967295,s=new Uint8Array(8),a=new DataView(s.buffer);return a.setUint32(0,t<<2|n&3),a.setUint32(4,r),s}else{const n=new Uint8Array(12),r=new DataView(n.buffer);return r.setUint32(0,t),THe(r,4,e),n}}function Chn(e){const t=e.getTime(),n=Math.floor(t/1e3),r=(t-n*1e3)*1e6,s=Math.floor(r/1e9);return{sec:n+s,nsec:r-s*1e9}}function Shn(e){if(e instanceof Date){const t=Chn(e);return whn(t)}else return null}function Nhn(e){const t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:{const n=t.getUint32(0),r=t.getUint32(4),s=(n&3)*4294967296+r,a=n>>>2;return{sec:s,nsec:a}}case 12:{const n=ghn(t,4),r=t.getUint32(0);return{sec:n,nsec:r}}default:throw new JL(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${e.length}`)}}function Ahn(e){const t=Nhn(e);return new Date(t.sec*1e3+t.nsec/1e6)}const jhn={type:bhn,encode:Shn,decode:Ahn};class sre{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(jhn)}register({type:t,encode:n,decode:r}){if(t>=0)this.encoders[t]=n,this.decoders[t]=r;else{const s=-1-t;this.builtInEncoders[s]=n,this.builtInDecoders[s]=r}}tryToEncode(t,n){for(let r=0;r<this.builtInEncoders.length;r++){const s=this.builtInEncoders[r];if(s!=null){const a=s(t,n);if(a!=null){const o=-1-r;return new eF(o,a)}}}for(let r=0;r<this.encoders.length;r++){const s=this.encoders[r];if(s!=null){const a=s(t,n);if(a!=null){const o=r;return new eF(o,a)}}}return t instanceof eF?t:null}decode(t,n,r){const s=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return s?s(t,n,r):new eF(n,t)}}sre.defaultCodec=new sre;function Ehn(e){return e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer}function _hn(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Ehn(e)?new Uint8Array(e):Uint8Array.from(e)}const khn=100,Thn=2048;class Cue{constructor(t){this.entered=!1,this.extensionCodec=(t==null?void 0:t.extensionCodec)??sre.defaultCodec,this.context=t==null?void 0:t.context,this.useBigInt64=(t==null?void 0:t.useBigInt64)??!1,this.maxDepth=(t==null?void 0:t.maxDepth)??khn,this.initialBufferSize=(t==null?void 0:t.initialBufferSize)??Thn,this.sortKeys=(t==null?void 0:t.sortKeys)??!1,this.forceFloat32=(t==null?void 0:t.forceFloat32)??!1,this.ignoreUndefined=(t==null?void 0:t.ignoreUndefined)??!1,this.forceIntegerToFloat=(t==null?void 0:t.forceIntegerToFloat)??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new Cue({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(t){if(this.entered)return this.clone().encodeSharedRef(t);try{return this.entered=!0,this.reinitializeState(),this.doEncode(t,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(t){if(this.entered)return this.clone().encode(t);try{return this.entered=!0,this.reinitializeState(),this.doEncode(t,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(t,n){if(n>this.maxDepth)throw new Error(`Too deep objects in depth ${n}`);t==null?this.encodeNil():typeof t=="boolean"?this.encodeBoolean(t):typeof t=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(t):this.encodeNumber(t):typeof t=="string"?this.encodeString(t):this.useBigInt64&&typeof t=="bigint"?this.encodeBigInt64(t):this.encodeObject(t,n)}ensureBufferSizeToWrite(t){const n=this.pos+t;this.view.byteLength<n&&this.resizeBuffer(n*2)}resizeBuffer(t){const n=new ArrayBuffer(t),r=new Uint8Array(n),s=new DataView(n);r.set(this.bytes),this.view=s,this.bytes=r}encodeNil(){this.writeU8(192)}encodeBoolean(t){t===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(t){!this.forceIntegerToFloat&&Number.isSafeInteger(t)?t>=0?t<128?this.writeU8(t):t<256?(this.writeU8(204),this.writeU8(t)):t<65536?(this.writeU8(205),this.writeU16(t)):t<4294967296?(this.writeU8(206),this.writeU32(t)):this.useBigInt64?this.encodeNumberAsFloat(t):(this.writeU8(207),this.writeU64(t)):t>=-32?this.writeU8(224|t+32):t>=-128?(this.writeU8(208),this.writeI8(t)):t>=-32768?(this.writeU8(209),this.writeI16(t)):t>=-2147483648?(this.writeU8(210),this.writeI32(t)):this.useBigInt64?this.encodeNumberAsFloat(t):(this.writeU8(211),this.writeI64(t)):this.encodeNumberAsFloat(t)}encodeNumberAsFloat(t){this.forceFloat32?(this.writeU8(202),this.writeF32(t)):(this.writeU8(203),this.writeF64(t))}encodeBigInt64(t){t>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(t)):(this.writeU8(211),this.writeBigInt64(t))}writeStringHeader(t){if(t<32)this.writeU8(160+t);else if(t<256)this.writeU8(217),this.writeU8(t);else if(t<65536)this.writeU8(218),this.writeU16(t);else if(t<4294967296)this.writeU8(219),this.writeU32(t);else throw new Error(`Too long string: ${t} bytes in UTF-8`)}encodeString(t){const r=uhn(t);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),mhn(t,this.bytes,this.pos),this.pos+=r}encodeObject(t,n){const r=this.extensionCodec.tryToEncode(t,this.context);if(r!=null)this.encodeExtension(r);else if(Array.isArray(t))this.encodeArray(t,n);else if(ArrayBuffer.isView(t))this.encodeBinary(t);else if(typeof t=="object")this.encodeMap(t,n);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(t)}`)}encodeBinary(t){const n=t.byteLength;if(n<256)this.writeU8(196),this.writeU8(n);else if(n<65536)this.writeU8(197),this.writeU16(n);else if(n<4294967296)this.writeU8(198),this.writeU32(n);else throw new Error(`Too large binary: ${n}`);const r=_hn(t);this.writeU8a(r)}encodeArray(t,n){const r=t.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<4294967296)this.writeU8(221),this.writeU32(r);else throw new Error(`Too large array: ${r}`);for(const s of t)this.doEncode(s,n+1)}countWithoutUndefined(t,n){let r=0;for(const s of n)t[s]!==void 0&&r++;return r}encodeMap(t,n){const r=Object.keys(t);this.sortKeys&&r.sort();const s=this.ignoreUndefined?this.countWithoutUndefined(t,r):r.length;if(s<16)this.writeU8(128+s);else if(s<65536)this.writeU8(222),this.writeU16(s);else if(s<4294967296)this.writeU8(223),this.writeU32(s);else throw new Error(`Too large map object: ${s}`);for(const a of r){const o=t[a];this.ignoreUndefined&&o===void 0||(this.encodeString(a),this.doEncode(o,n+1))}}encodeExtension(t){if(typeof t.data=="function"){const r=t.data(this.pos+6),s=r.length;if(s>=4294967296)throw new Error(`Too large extension object: ${s}`);this.writeU8(201),this.writeU32(s),this.writeI8(t.type),this.writeU8a(r);return}const n=t.data.length;if(n===1)this.writeU8(212);else if(n===2)this.writeU8(213);else if(n===4)this.writeU8(214);else if(n===8)this.writeU8(215);else if(n===16)this.writeU8(216);else if(n<256)this.writeU8(199),this.writeU8(n);else if(n<65536)this.writeU8(200),this.writeU16(n);else if(n<4294967296)this.writeU8(201),this.writeU32(n);else throw new Error(`Too large extension object: ${n}`);this.writeI8(t.type),this.writeU8a(t.data)}writeU8(t){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,t),this.pos++}writeU8a(t){const n=t.length;this.ensureBufferSizeToWrite(n),this.bytes.set(t,this.pos),this.pos+=n}writeI8(t){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,t),this.pos++}writeU16(t){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,t),this.pos+=2}writeI16(t){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,t),this.pos+=2}writeU32(t){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,t),this.pos+=4}writeI32(t){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,t),this.pos+=4}writeF32(t){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,t),this.pos+=4}writeF64(t){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,t),this.pos+=8}writeU64(t){this.ensureBufferSizeToWrite(8),xhn(this.view,this.pos,t),this.pos+=8}writeI64(t){this.ensureBufferSizeToWrite(8),THe(this.view,this.pos,t),this.pos+=8}writeBigUint64(t){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,t),this.pos+=8}writeBigInt64(t){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,t),this.pos+=8}}function IHe(e,t){return new Cue(t).encodeSharedRef(e)}const Ihn={name:"Exchange",version:"1",chainId:1337,verifyingContract:"0x0000000000000000000000000000000000000000"},Phn={Agent:[{name:"source",type:"string"},{name:"connectionId",type:"bytes32"}]};function Fhn(e){if(typeof e!="string"||!e.includes("."))return String(e);const t=e.replace(/\.?0+$/,"");return t==="-0"?"0":t}function ire(e){if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(ire);const t={...e};for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;const r=t[n];r&&typeof r=="object"?t[n]=ire(r):(n==="p"||n==="s")&&typeof r=="string"&&(t[n]=Fhn(r))}return t}function Ohn(e){return cs(e)}function Mhn(e,t,n){const r=ire(e),s=IHe(r),a=t==null?9:29,o=new Uint8Array(s.length+a);o.set(s);const l=new DataView(o.buffer);return l.setBigUint64(s.length,BigInt(n),!1),t==null?l.setUint8(s.length+8,0):(l.setUint8(s.length+8,1),o.set(Ohn(t),s.length+9)),io(o)}function Rhn(e,t){return{source:t?"a":"b",connectionId:e}}async function Lhn(e,t){const n=await e.signTypedData(t.domain,t.types,t.message),{r,s,v:a}=Zc.from(n);return{r,s,v:a}}async function Dhn(e,t,n,r,s){const a=Mhn(t,n,r),o=Rhn(a,s);return Lhn(e,{domain:Ihn,types:Phn,primaryType:"Agent",message:o})}function yT({getPK:e=()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:t=!0,vaultAddress:n=null}={}){return{sign:async(r,s)=>{const a=e();if(!a)throw new Error("Please sign in to perform this action.");const o=new _ae(a);return Dhn(o,r,n,s,t)}}}function Bhn(e){return new _ae(e).address}function $hn({open:e,onClose:t,children:n,title:r}){return e?i.jsxs("div",{className:"fixed inset-0 z-[999] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[1px]",onClick:t}),i.jsxs("div",{className:"relative w-[560px] max-w-[92vw] rounded-2xl border border-[#2A2A2A] bg-[#161616] shadow-2xl",children:[i.jsxs("div",{className:"px-5 pt-4 pb-2 flex items-center justify-between",children:[i.jsx("div",{className:"font-inter text-[18px] leading-6 text-white",children:r}),i.jsx("button",{onClick:t,className:"w-8 h-8 flex items-center justify-center rounded-lg bg-[#222] text-[#BDBDBD]",children:"✕"})]}),i.jsx("div",{className:"px-5 pb-5",children:n})]})]}):null}const Uhn=({children:e})=>i.jsx("div",{className:"text-[12px] text-[#9B9B9B] font-inter mb-1 font-semibold",children:e}),zhn=({value:e,onChange:t,placeholder:n})=>i.jsx("input",{value:e,onChange:r=>t(r.target.value),placeholder:n,inputMode:"decimal",className:"flex-1 min-w-0 h-10 px-3 rounded-lg bg-[#101010] border border-[#2A2A2A] text-white outline-none"});function dSe(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}const PX=e=>e==="perps"?"Perps":"Spot";function PHe({open:e,onClose:t,perpsAvailable:n=0,spotUsdcAvailable:r=0,onSubmit:s,loading:a=!1,initialToPerp:o=!1}){const[l,c]=m.useState(o?"spot":"perps"),[u,d]=m.useState("");m.useEffect(()=>{e&&(c(o?"spot":"perps"),d(""))},[o,e]);const f=l==="perps"?"spot":"perps",x=Number(l==="perps"?n||0:r||0),g=()=>c(N=>N==="perps"?"spot":"perps"),v=()=>d(String(x)),w=()=>s==null?void 0:s({toPerp:l==="spot",amount:u,available:x}),C=!Number(u)||Number(u)<=0||Number(u)>x||a;return i.jsxs($hn,{open:e,onClose:t,title:"Transfer USDC",children:[i.jsx("p",{className:"text-[13px] text-[#9B9B9B] mb-3",children:"Transfer USDC between your Perps and Spot balances."}),i.jsx("div",{className:"flex justify-center mb-3 text-xs",children:i.jsxs("button",{onClick:g,className:"inline-flex items-center gap-2 px-3 py-1 rounded-lg border border-[#2A2A2A] bg-transparent hover:bg-[#101010] text-sm",children:[i.jsx("span",{className:`${l==="perps"?"text-[#67FFBD] font-medium":"text-[#bdbdbd]"}`,children:PX(l)}),i.jsx(kae,{className:"text-[#67FFBD]"}),i.jsx("span",{className:`${f==="perps"?"text-[#67FFBD] font-medium":"text-[#bdbdbd]"}`,children:PX(f)})]})}),i.jsxs("div",{className:"space-y-2 text-xs",children:[i.jsx(Uhn,{children:"Amount (USDC)"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(zhn,{value:u,onChange:d,placeholder:"0.0"}),i.jsxs("button",{onClick:v,className:"shrink-0 w-28 h-10 px-2 py-0 rounded-lg bg-[#1F2A23] border border-[#2F3B33] text-[#67FFBD] hover:opacity-95 flex flex-col items-end justify-center leading-tight text-right",title:"Use maximum available",children:[i.jsx("span",{className:"text-[10px] opacity-80",children:"MAX"}),i.jsx("span",{className:"text-[12px] font-medium truncate",children:dSe(x,6)})]})]}),i.jsxs("div",{className:"text-[12px] text-[#9B9B9B]",children:["Available (",PX(l),"): ",dSe(x,6)," USDC"]})]}),i.jsx("button",{onClick:w,disabled:C,className:`w-full h-11 rounded-xl mt-5 font-medium ${C?"bg-[#2C2C2C] text-[#8A8A8A] cursor-not-allowed":"bg-[rgba(103,255,189,0.16)] text-[#67FFBD] hover:opacity-95"}`,children:a?"Processing...":"Confirm"})]})}function fSe({label:e,children:t}){return i.jsxs("div",{className:"mb-3",children:[i.jsx("div",{className:"mb-1 text-[12px]",style:{color:Oi},children:e}),i.jsx("div",{className:"flex items-center gap-2",children:t})]})}const FX=42161,Hhn="0xa4b1",hSe="Mainnet";function Vhn(e){const t=e.startsWith("0x")?e.slice(2):e,n="0x"+t.slice(0,64),r="0x"+t.slice(64,128);let s=parseInt(t.slice(128,130),16);return s<27&&(s+=27),{r:n,s:r,v:s}}function Whn({open:e,onClose:t,perpsBalance:n=0,defaultDest:r=""}){const{address:s}=Yr(),a=yA(),{switchChainAsync:o}=Vie(),{signTypedDataAsync:l}=igt(),[c,u]=m.useState(""),[d,f]=m.useState(r||s||""),[x,g]=m.useState(!1),[v,w]=m.useState(null);m.useEffect(()=>{e&&(u(""),f(r||s||""),g(!1),w(null))},[e,r,s]);const C=m.useMemo(()=>{const R=Math.max(0,Number(n||0)-1);return R>0?Number(R.toFixed(6)):0},[n]),N="Withdraw USDC to Arbitrum";async function I(){var R;try{const F=Number(c||0);if(!F||F<=1){w({type:"error",text:"Enter an amount greater than $1 (fee)."});return}if(F>C){w({type:"error",text:"Amount exceeds available balance (after $1 fee)."});return}const U=(d||"").trim().toLowerCase();if(!/^0x[a-f0-9]{40}$/.test(U)){w({type:"error",text:"Invalid destination address."});return}if(a!==FX)try{await o({chainId:FX})}catch{w({type:"error",text:"Switch to Arbitrum to withdraw."});return}g(!0),w({type:"info",text:"Signing request..."});const L=Date.now(),z={name:"HyperliquidSignTransaction",version:"1",chainId:FX,verifyingContract:"0x0000000000000000000000000000000000000000"},X={"HyperliquidTransaction:Withdraw":[{name:"hyperliquidChain",type:"string"},{name:"destination",type:"string"},{name:"amount",type:"string"},{name:"time",type:"uint64"}]},ne={hyperliquidChain:hSe,destination:U,amount:String(F),time:L},J=await l({domain:z,types:X,primaryType:"HyperliquidTransaction:Withdraw",message:ne});w({type:"info",text:"Submitting..."});const Z={action:{type:"withdraw3",signatureChainId:Hhn,hyperliquidChain:hSe,destination:U,amount:String(F),time:L},nonce:L,signature:Vhn(J)},re=await fetch("https://api.hyperliquid.xyz/exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Z)}).then(he=>he.json());if((re==null?void 0:re.status)==="ok")w({type:"success",text:"Withdraw submitted. Funds will arrive shortly."}),setTimeout(()=>{u(""),t==null||t()},700),(R=window==null?void 0:window.dispatchEvent)==null||R.call(window,new Event("balances:refresh"));else{const he=typeof(re==null?void 0:re.response)=="string"?re.response:JSON.stringify(re);w({type:"error",text:he||"Withdraw failed."})}}catch(F){w({type:"error",text:String((F==null?void 0:F.message)||F)})}finally{g(!1)}}const P=v&&i.jsx("div",{className:"p-2 rounded-lg text-[12px] mb-3",style:{border:`1px solid ${ka}`,background:v.type==="error"?"#3b1f1f":v.type==="success"?"#1f3b2b":"#1b2a3b",color:v.type==="error"?"#ffb4b4":v.type==="success"?"#b7ffd8":"#c9e1ff"},children:v.text});return i.jsx(qh,{open:e,onClose:t,children:i.jsxs(nm,{title:N,children:[P,i.jsxs(fSe,{label:"Amount",children:[i.jsxs("div",{className:"flex items-center gap-2 h-[36px] px-2 rounded-lg",style:{background:jo,border:`1px solid ${ka}`,width:"100%"},children:[i.jsx("input",{className:"min-w-0 flex-1 bg-transparent outline-none text-right text-sm",inputMode:"decimal",placeholder:"0.0",style:{color:Vi,fontFeatureSettings:'"tnum"'},value:c,onChange:R=>u(R.target.value)}),i.jsx("button",{className:"text-xs text-[#67FFBD] h-6 flex items-center justify-center",onClick:()=>u(C?String(C):"0"),children:"MAX"})]}),i.jsxs("div",{className:"text-[11px]",style:{color:Oi},children:["MAX: ",C.toFixed(6)," USDC"]})]}),i.jsx(fSe,{label:"Destination Address",children:i.jsxs("div",{className:"flex items-center gap-2 h-[36px] px-2 rounded-lg",style:{background:jo,border:`1px solid ${ka}`,width:"100%"},children:[i.jsx("input",{className:"min-w-0 flex-1 bg-transparent outline-none text-sm",placeholder:"0x...",style:{color:Vi},value:d,onChange:R=>f(R.target.value)}),i.jsx("button",{className:"text-xs h-6 flex items-center justify-center text-[#67FFBD]",onClick:async()=>{const R=await navigator.clipboard.readText().catch(()=>"");R&&f(R.trim())},children:"Paste"})]})}),i.jsx("div",{className:"p-2 rounded-lg text-[12px] mb-3",style:{background:"#3b1f1f",color:"#ffb4b4",border:`1px solid ${ka}`},children:"IMPORTANT: A $1 fee is deducted from each withdrawal."}),i.jsx("button",{onClick:I,disabled:x,className:"w-full h-[42px] mt-1 rounded-xl font-semibold text-sm disabled:opacity-60",style:{background:_g,color:"#0f151a"},children:x?"Submitting...":"Withdraw"})]})})}function qhn({value:e,onChange:t,leftLabel:n,rightLabel:r,leftUsd:s=0,rightUsd:a=0}){const o=m.useRef(null),l=m.useRef(!1),c=g=>Math.max(0,Math.min(100,g)),u=g=>{const v=o.current;if(!v)return e;const w=v.getBoundingClientRect(),C=(g-w.left)/w.width*100;return Math.round(c(C))},d=g=>{l.current&&t(u(g.clientX))},f=()=>{l.current=!1,window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f)},x=g=>{l.current=!0,t(u(g.clientX)),window.addEventListener("pointermove",d,{passive:!0}),window.addEventListener("pointerup",f,{passive:!0}),window.addEventListener("pointercancel",f,{passive:!0})};return m.useEffect(()=>f,[]),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-[12px] mb-1",children:[i.jsxs("span",{className:"font-semibold",style:{color:_g},children:[n,": ",e,"%"]}),i.jsxs("span",{className:"font-semibold",style:{color:Fj},children:[r,": ",100-e,"%"]})]}),i.jsxs("div",{ref:o,onPointerDown:x,className:"relative h-[10px] select-none",style:{cursor:"pointer",touchAction:"none"},children:[i.jsx("div",{className:"absolute inset-0 rounded-full",style:{background:`linear-gradient(90deg, ${_g}80 0%, ${_g}80 ${e}%, ${Fj}80 ${e}%, ${Fj}80 100%)`,border:`1px solid ${ka}`}}),i.jsx("div",{className:"absolute -translate-x-1/2 -translate-y-1/2 rounded-md w-4 h-4",style:{left:`${e}%`,top:"50%",background:_g,boxShadow:"0 0 0 1px rgba(0,0,0,0.35)",pointerEvents:"none"}})]}),i.jsxs("div",{className:"flex justify-between text-[12px] mt-1",children:[i.jsx("span",{style:{color:_g},children:s?`${s.toLocaleString(void 0,{maximumFractionDigits:2})} USDC`:""}),i.jsx("span",{style:{color:Fj},children:a?`${a.toLocaleString(void 0,{maximumFractionDigits:2})} USDC`:""})]})]})}function Ghn(e){return Cl({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"},child:[]}]})(e)}function Khn({skipConfirm:e,setSkipConfirm:t}){const[n,r]=m.useState(!1),s=m.useRef(null);return m.useEffect(()=>{const a=o=>{!s.current||s.current.contains(o.target)||r(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[]),i.jsxs("div",{className:"relative",ref:s,children:[i.jsx("button",{onClick:()=>r(a=>!a),className:"ml-2 text-[#9B9B9B] hover:text-white p-1 rounded-md",children:i.jsx(Ghn,{size:14})}),n&&i.jsx("div",{className:"absolute right-0 top-6 w-[24    0px] rounded-lg bg-[#101010] border border-[#2A2A2A] shadow-xl p-3 z-50",children:i.jsxs("label",{className:"flex items-center gap-2 text-[12px] text-white cursor-pointer select-none",children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:e,onChange:a=>t(a.target.checked)}),"Skip Close Position Confirmation"]})})]})}const OX="wss://api.hyperliquid.xyz/ws";function Q7(e,t=2){const n=Number(e||0),r={maximumFractionDigits:t,minimumFractionDigits:n===0?2:0};return n.toLocaleString(void 0,r)}function pSe(e){return Number(e||0).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}const mSe=e=>{const t=String(e||"").toUpperCase();return t==="GTC"?"Gtc":t==="IOC"?"Ioc":t==="ALO"?"Alo":"Gtc"};function Yhn(e,t,n){if(!e||!n||n<=0)return null;const r=t==="buy"?e.asks:e.bids;if(!(r!=null&&r.length))return null;let s=n,a=0;for(const{px:o,sz:l}of r){const c=Math.min(s,l);if(a+=c*o,s-=c,s<=0)break}return s>1e-12?null:a/n}function Xhn({book:e,side:t,sizeCoin:n,mid:r}){const s=Yhn(e,t,n);if(!s||!r)return 0;const a=s/r,o=t==="buy"?a-1:1-a;return Math.max(0,o*100)}const FHe={position:"bottom-right",style:{background:"#1e1e1e",color:"#fff",fontSize:12,border:"1px solid #2A2A2A"}},Qhn="dextra-global-toast";function La(e,t){return on.promise(e,t,{id:Qhn,...FHe})}const Z7=e=>Number(e||0);function Zhn(e){var r,s,a;const t=[],n=((s=(r=e==null?void 0:e.response)==null?void 0:r.data)==null?void 0:s.statuses)||((a=e==null?void 0:e.data)==null?void 0:a.statuses)||[];for(const o of n){const l=o==null?void 0:o.filled;(l==null?void 0:l.oid)!=null&&t.push(Number(l.oid));const c=o==null?void 0:o.resting;(c==null?void 0:c.oid)!=null&&t.push(Number(c.oid)),(o==null?void 0:o.oid)!=null&&t.push(Number(o.oid))}return[...new Set(t)]}async function Jhn(e,t){const n=String(e||"").toLowerCase(),r=[];for(const s of t)try{const o=await(await fetch("https://api.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"orderStatus",user:n,oid:s})})).json();r.push({oid:s,data:o})}catch(a){r.push({oid:s,error:String((a==null?void 0:a.message)||a)})}return r}function epn({longSymbol:e,shortSymbol:t,longSize:n,shortSize:r,orderType:s,reduceOnlyFlag:a,maxSlipVal:o,tpOnFlag:l,tpVal:c,slVal:u,userAddr:d,lev:f,coinSym:x,isPairMode:g,isBuySide:v,sizeCoinVal:w}){return{userAddress:String(d||"").toLowerCase(),order:{actionType:a?"CLOSE":"OPEN",orderType:String(s||"MARKET").toUpperCase(),long:e||(g?"":v?x:""),short:t||(g||v?"":x),leverage:Z7(f)||1,longSize:Z7(n??(g?0:v?w:0)),shortSize:Z7(r??(g||v?0:w)),slippage:Number(o||0),takeProfit:l&&Z7(c)>0?String(c):"",stopLoss:l&&Z7(u)>0?String(u):""}}}async function MX({draft:e,responses:t,user:n}){const r=[];for(const o of Array.isArray(t)?t:[t])r.push(...Zhn(o));const s=r.length?await Jhn(n,r):[];return{...e,exchangeOids:r,orderStatus:s}}function dC(e){return e.then(t=>{var r,s,a;const n=(a=(s=(r=t==null?void 0:t.response)==null?void 0:r.data)==null?void 0:s.statuses)==null?void 0:a[0];if(n!=null&&n.error)throw new Error(n.error);if(n!=null&&n.filled){const o=n.filled;return`Filled ${o.totalSz} @ ${o.avgPx}`}return n!=null&&n.resting?`Placing order (oid ${n.resting.oid})`:typeof(t==null?void 0:t.response)=="string"?t.response:"Order placed"})}function xSe({coin:e="ETH",midPrice:t,selectedPrice:n,onSubmit:r,maxLeverage:s=25,wallet:a,onWalletChange:o,uiMode:l="single",pairKey:c="BTC/ETH"}){const[u,d]=m.useState("market"),[f,x]=m.useState("buy"),[g,v]=m.useState(""),[w,C]=m.useState(""),[N,I]=m.useState("USD"),[P,R]=m.useState(0),[F,U]=m.useState(!1),[L,z]=m.useState("GTC"),[X,ne]=m.useState(!1),[J,Z]=m.useState(""),[re,he]=m.useState(""),[Y,ie]=m.useState(""),[oe,G]=m.useState(""),[V,ee]=m.useState(!1),[ae,fe]=m.useState(!1),[Ae,ce]=m.useState(!1),[ye,Ne]=m.useState("Cross"),[be,je]=m.useState("Cross"),[Ie,Re]=m.useState(s),[Qe,Be]=m.useState(!1),[it,tt]=m.useState(!1),[at,dt]=m.useState(!1),[ct,Ut]=m.useState("One-Way"),[kt,tn]=m.useState(""),[jt,un]=m.useState("USDC"),[cn,Pt]=m.useState(0),[Xe,Vt]=m.useState(5),[Yt,Ve]=m.useState(!1),[Ke,ft]=m.useState(0),[en,Dt]=m.useState(!1),[At,Je]=m.useState(null),[He,Rt]=m.useState(null),[qe,lt]=m.useState(null),[xt,Nt]=m.useState(s),[It,xn]=m.useState(null),[dn,Mn]=m.useState({address:null,token:null}),[_n,kn]=m.useState(null),[vn,Qn]=m.useState(null),[Hn,$n]=m.useState(null),[Jn,Nn]=m.useState(50),[ln,Oe]=m.useState(!1),[sn,fn]=m.useState({bids:[],asks:[]}),[Et,Kn]=m.useState(!1),[Cn,Bt]=m.useState(String(e)),[an,Pn]=m.useState(()=>{if(typeof window>"u")return"8";const En=localStorage.getItem("hl_max_slip_pct");if(En==null||En==="")return"8";const Rn=Number(En);return Number.isFinite(Rn)&&Rn>0?String(Rn):"8"}),[qn,nr]=m.useState(""),[tr,Qt]=m.useState({}),[zn,Yn]=m.useState([]),[Lt,Fn]=m.useState(!1),Ee=m.useRef(null),p=m.useRef(null),[h,S]=m.useState(()=>localStorage.getItem("skipCloseConfirm")==="true"),[_,k]=m.useState([0,0]),[T,B]=m.useState({takerPct:null,makerPct:null});m.useEffect(()=>{localStorage.setItem("skipCloseConfirm",h?"true":"false")},[h]);const q=m.useMemo(()=>Math.max(0,Number(an||0))/100,[an]),te=En=>String(En||"").trim().toUpperCase(),ue="dextrabot.last_used_leverage",de=()=>{try{return JSON.parse(localStorage.getItem(ue)||"{}")}catch{return{}}},xe=En=>{const Rn=`leverage:${te(En)}`,Dn=Number(localStorage.getItem(Rn));return Number.isFinite(Dn)&&Dn>0?Dn:null},we=En=>{const Rn=te(En),Dn=de(),Nr=Number(Dn==null?void 0:Dn[Rn]);return Number.isFinite(Nr)&&Nr>0?Nr:xe(Rn)},ke=(En,Rn)=>{var cr;const Dn=te(En),Nr=Math.max(1,Number(Rn)||1),Mr=de();Mr[Dn]=Nr,localStorage.setItem(ue,JSON.stringify(Mr)),localStorage.setItem(`leverage:${Dn}`,String(Nr)),(cr=window.dispatchEvent)==null||cr.call(window,new Event("localStorageUpdated"))},{isConnected:Me}=Yr(),{openConnectModal:Ye}=m5(),{setSignInConnectButtonOpen:Fe}=m.useContext(Gr),{address:rt}=Yr(),se=typeof window<"u"&&window.matchMedia("(max-width: 768px)").matches,De=!!(typeof window<"u"&&localStorage.getItem("hyperToken")&&(Me||se)),Le=m.useRef(null);m.useEffect(()=>{const En=rt?rt.toLowerCase():null;if(Le.current&&Le.current!==En&&typeof window<"u"){const Rn=window.localStorage;Rn.removeItem("hyperToken"),Rn.removeItem("hyperAddress"),Rn.removeItem("hyperTradeToken"),Rn.removeItem("hl_pk"),Rn.removeItem("hl:wallet_id"),Object.keys(Rn).forEach(Dn=>{Dn.startsWith("hl_pk:")&&Rn.removeItem(Dn)}),window.dispatchEvent(new Event("localStorageUpdated"))}Le.current=En,Je(null)},[rt]),m.useEffect(()=>{const En=(a==null?void 0:a.id)!=null?String(a.id):null;if(En==null){Je(null);return}Je(Rn=>Rn!=null&&String(Rn)===En?Rn:En)},[a==null?void 0:a.id]),m.useEffect(()=>{At!=null&&localStorage.setItem("hl:wallet_id",String(At))},[At]);const _e=m.useRef(null);m.useEffect(()=>{l!=="pair"&&Cn&&_e.current===Cn&&ke(Cn,Ie)},[Ie,Cn,l]),m.useEffect(()=>{let En,Rn=!0;function Dn(){En=new WebSocket(OX),En.onopen=()=>{const Nr={method:"subscribe",subscription:{type:"l2Book",coin:String(e).toUpperCase()}};En.send(JSON.stringify(Nr))},En.onmessage=Nr=>{var ei;if(!Rn)return;const Mr=JSON.parse(Nr.data),cr=((ei=Mr==null?void 0:Mr.data)==null?void 0:ei.levels)||(Mr==null?void 0:Mr.levels),bs=(cr==null?void 0:cr.bs)||(cr==null?void 0:cr.bids)||[],Kr=(cr==null?void 0:cr.as)||(cr==null?void 0:cr.asks)||[],Ms=Tt=>Tt.map(sr=>Array.isArray(sr)?{px:Number(sr[0]),sz:Number(sr[1])}:{px:Number(sr.px),sz:Number(sr.sz)}).filter(sr=>sr.px>0&&sr.sz>0);(bs.length||Kr.length)&&fn({bids:Ms(bs),asks:Ms(Kr)})}}return Dn(),()=>{Rn=!1;try{En&&En.close()}catch{}}},[e]),m.useEffect(()=>{const En=()=>{const Rn=typeof window<"u"?localStorage.getItem("hyperAddress"):null,Dn=typeof window<"u"?localStorage.getItem("hyperToken"):null;Mn({address:Rn,token:Dn})};return En(),window.addEventListener("localStorageUpdated",En),window.addEventListener("storage",En),()=>{window.removeEventListener("localStorageUpdated",En),window.removeEventListener("storage",En)}},[]);const nt=()=>{const En=parseFloat(String(an).replace(",",".")),Dn=Math.max(.01,Math.min(50,Number.isFinite(En)?En:8)).toString();Pn(Dn),localStorage.setItem("hl_max_slip_pct",Dn),Kn(!1)},{wallets:ot}=kHe(dn.address,dn.token,!0,{pollMs:5e3});m.useEffect(()=>{if(!ot||!ot.length||At&&ot.some(Dn=>String(Dn.wallet_id)===String(At)))return;const En=ot.find(Dn=>Dn.confirmed)||ot[0];if(!En)return;const Rn=String(En.wallet_id);String(At)!==Rn&&(Je(Rn),o==null||o({id:Rn,address:En.wallet_address}))},[ot,At,o]);const gt=m.useMemo(()=>(ot||[]).find(En=>String(En.wallet_id)===String(At))||null,[ot,At]);m.useEffect(()=>{n!=null&&n!==""&&(d("limit"),v(Number(n)))},[n]),m.useEffect(()=>{let En=!0;Fn(!1);async function Rn(){try{const Nr=await(await fetch("https://api.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"metaAndAssetCtxs"})})).json(),Mr=Array.isArray(Nr)?Nr[0]:Nr,cr=(Mr==null?void 0:Mr.universe)||[],bs=new Map(cr.map(ei=>{const Tt=typeof ei=="string"?ei:(ei==null?void 0:ei.name)??(ei==null?void 0:ei[0])??"";return[te(Tt),typeof ei=="string"?{name:Tt}:ei]}));if(l==="pair"){const[ei,Tt]=String(c||"").split("/").map(Vr=>Vr.trim()),sr=bs.get(te(ei)),mr=bs.get(te(Tt));if(En){const Vr=(sr==null?void 0:sr.maxLeverage)??s,as=(mr==null?void 0:mr.maxLeverage)??s,ns=Math.max(1,Math.min(Vr,as));Nt(ns),Re(ys=>Math.min(ys||1,ns)),Rt(null),lt(null),xn(null),Bt(null),Fn(!0)}return}const Kr=bs.get(te(e));if(!Kr){En&&(Rt(null),lt(null),Nt(s),Re(ei=>Math.min(ei||1,s)),xn(null),Bt(String(e)),Fn(!0));return}const Ms=(Kr==null?void 0:Kr.name)||String(e);if(En){Rt(0),lt((Kr==null?void 0:Kr.szDecimals)??0),Nt((Kr==null?void 0:Kr.maxLeverage)??s),xn((Kr==null?void 0:Kr.maintenanceMarginFraction)??(Kr==null?void 0:Kr.mmr)??null),Bt(Ms);const ei=we(Ms),Tt=ei!=null?Math.min((Kr==null?void 0:Kr.maxLeverage)??s,Math.max(1,ei)):Math.min((Kr==null?void 0:Kr.maxLeverage)??s,Math.max(1,Ie||1));Re(Tt),_e.current=Ms,Fn(!0)}}catch{En&&(Rt(null),lt(null),Nt(s),Re(Dn=>Math.min(Dn||1,s)),xn(null),Bt(String(e)),Fn(!0))}}return Rn(),()=>{En=!1}},[e,s,l,c]);const Jt=f==="buy",Ge=Jt?_g:Fj,et=m.useMemo(()=>{var Dn,Nr,Mr,cr;const En=(Nr=(Dn=sn==null?void 0:sn.bids)==null?void 0:Dn[0])==null?void 0:Nr.px,Rn=(cr=(Mr=sn==null?void 0:sn.asks)==null?void 0:Mr[0])==null?void 0:cr.px;return Number.isFinite(En)&&Number.isFinite(Rn)&&En>0&&Rn>0?(Rn+En)/2:null},[sn]),We=m.useMemo(()=>{if(u==="limit"&&g!=="")return Number(g);const En=Number(t||0);if(En>0)return En;if(Number(et||0)>0)return Number(et);const Rn=Number((tr||{})[e]||0);return Rn>0?Rn:0},[u,g,t,et,tr,e]),wt=gt==null?void 0:gt.wallet_address,{accountEquity:St,perpsOverview:Kt,spotBalances:gn,perps:yn}=gT(wt),{rows:hn}=yue(wt);m.useEffect(()=>{let En=!1;async function Rn(){var Nr,Mr,cr,bs;if(!wt){En||B({takerPct:null,makerPct:null});return}try{const Ms=await(await fetch("https://api.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"userFees",user:wt.toLowerCase()})})).json();if(En)return;const ei=Number(Ms.userCrossRate??((Nr=Ms.feeSchedule)==null?void 0:Nr.cross)??NaN),Tt=Number(Ms.userAddRate??((Mr=Ms.feeSchedule)==null?void 0:Mr.add)??NaN);if(!Number.isFinite(ei)||!Number.isFinite(Tt)){B({takerPct:null,makerPct:null});return}const sr=Number(Ms.activeReferralDiscount??((cr=Ms.feeSchedule)==null?void 0:cr.referralDiscount)??0)||0,mr=Number(((bs=Ms.activeStakingDiscount)==null?void 0:bs.discount)??0)||0,Vr=Math.max(0,1-sr-mr),as=ei*Vr,ns=Tt*Vr;B({takerPct:as*100,makerPct:ns*100})}catch{En||B({takerPct:null,makerPct:null})}}Rn();const Dn=setInterval(Rn,5*60*1e3);return()=>{En=!0,clearInterval(Dn)}},[wt]);const br=m.useMemo(()=>{const{takerPct:En,makerPct:Rn}=T;if(En==null||Rn==null)return"—";const Dn=Nr=>Number(Nr).toLocaleString(void 0,{minimumFractionDigits:4,maximumFractionDigits:4});return`${Dn(En)}% / ${Dn(Rn)}%`},[T]);m.useEffect(()=>{let En=!1;async function Rn(){if(!(!wt||l==="pair"))try{const Nr=await(await fetch("https://api.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"activeAssetData",user:wt.toLowerCase(),coin:String(Cn||e)})})).json();if(En)return;const Mr=Nr==null?void 0:Nr.leverage;if(!Mr)return;const cr=String(Mr.type||"").toLowerCase()==="cross"?"Cross":"Isolated",Kr=Math.max(1,Math.min(xt||s,Number(Mr.value||Mr.leverage)||1));Ne(cr),je(cr),Re(Kr)}catch{}}return Rn(),()=>{En=!0}},[wt,e,l,xt,s]),m.useEffect(()=>{if(!wt)return;const En=new WebSocket(OX);return Ee.current=En,En.onopen=()=>{En.send(JSON.stringify({method:"subscribe",subscription:{type:"user",user:wt}})),En.send(JSON.stringify({method:"subscribe",subscription:{type:"webData2",user:wt}})),p.current=setInterval(()=>{En.readyState===WebSocket.OPEN&&En.send(JSON.stringify({id:99,method:"ping"}))},3e4)},En.onmessage=Rn=>{var Dn,Nr,Mr,cr;try{const bs=JSON.parse(Rn.data),Kr=(bs==null?void 0:bs.data)||{},Ms=(Dn=Kr==null?void 0:Kr.meta)==null?void 0:Dn.universe,ei=Kr==null?void 0:Kr.allMids;if(Array.isArray(Ms)&&Array.isArray(ei)&&Ms.length===ei.length){const sr={};for(let mr=0;mr<Ms.length;mr++){const Vr=typeof Ms[mr]=="string"?Ms[mr]:((Nr=Ms[mr])==null?void 0:Nr.name)||((Mr=Ms[mr])==null?void 0:Mr[0]),as=Number(ei[mr]);Vr&&Number.isFinite(as)&&(sr[Vr]=as)}Qt(mr=>({...mr,...sr}))}const Tt=Array.isArray((cr=Kr==null?void 0:Kr.spotState)==null?void 0:cr.balances)?Kr.spotState.balances:Array.isArray(Kr==null?void 0:Kr.balances)?Kr.balances:null;Array.isArray(Tt)&&Yn(Tt.filter(sr=>sr&&sr.coin).map(sr=>({coin:String(sr.coin),total:Number(sr.total||0),hold:Number(sr.hold||0)})))}catch{}},En.onclose=()=>{p.current&&clearInterval(p.current)},()=>{p.current&&clearInterval(p.current);try{En.close()}catch{}}},[wt]),m.useEffect(()=>{if(!wt){k([0,0]);return}k([0,0]);let En=!0;const Rn=new WebSocket(OX);return Rn.onopen=()=>{Rn.send(JSON.stringify({method:"subscribe",subscription:{type:"activeAssetData",user:wt.toLowerCase(),coin:String(e)}}))},Rn.onmessage=Dn=>{if(En)try{const Nr=JSON.parse(Dn.data);if(Nr.channel==="activeAssetData"&&Nr.data){const Mr=Nr.data.availableToTrade||[];k([Number(Mr[0]||0),Number(Mr[1]||0)])}}catch{}},Rn.onclose=()=>{En&&k([0,0])},()=>{En=!1;try{Rn.close()}catch{}}},[wt,e]);const pt=m.useMemo(()=>{const En=(gn||[]).find(Rn=>Rn.coin==="USDC");return En?Math.max(0,Number(En.total||0)-Number(En.hold||0)):0},[gn]),Wt=m.useMemo(()=>{if(!zn.length)return null;let En=0;for(const Rn of zn){const Dn=Number(Rn.total||0);if(Dn>0)if(Rn.coin==="USDC")En+=Dn;else{const Nr=tr[Rn.coin];Number.isFinite(Nr)&&Nr>0&&(En+=Dn*Nr)}}return En},[zn,tr]),Zt=Number((yn==null?void 0:yn.accountValue)??0),vt=Number((yn==null?void 0:yn.totalMarginUsed)??0),Ot=Math.max(0,Zt-vt),wn=Ot,Gn=Ot<1;async function fr({toPerp:En,amount:Rn,available:Dn}){var Nr;try{if(Oe(!0),!_n){await La(Promise.reject(new Error("Trading is not ready (HL not initialized)")),{loading:"Validating...",success:"OK",error:cr=>cr.message});return}if(!Number(Rn)){await La(Promise.reject(new Error("Amount is invalid")),{loading:"Validating...",success:"OK",error:cr=>cr.message});return}if(Number(Rn)>Number(Dn||0)){await La(Promise.reject(new Error("Amount exceeds available")),{loading:"Validating...",success:"OK",error:cr=>cr.message});return}const Mr=_n.transfers.usdClassTransfer(String(Rn),!!En).then(cr=>{if((cr==null?void 0:cr.status)==="ok")return"Transfer successful.";const bs=typeof(cr==null?void 0:cr.response)=="string"?cr.response:"Transfer failed";throw new Error(bs)});await La(Mr,{loading:`Transferring ${Rn} USDC ${En?"Spot → Perps":"Perps → Spot"}...`,success:cr=>cr,error:cr=>(cr==null?void 0:cr.message)||"Transfer failed"}),(Nr=window==null?void 0:window.dispatchEvent)==null||Nr.call(window,new Event("balances:refresh")),Be(!1)}catch{}finally{Oe(!1)}}const ur=(()=>{const En=Number(w)||0;return N==="COIN"?En:We?En/We:0})(),$t=ur*(We||0),nn=Ie?$t/Ie:0;function Vn(En){const Rn=Math.max(1,Number(Ie)||1),Dn=Math.max(0,Number(It)||0),Nr=En/Rn+En*Dn,Mr=wn>0?Nr/wn*100:0;R(Math.max(0,Math.min(100,Math.round(Mr))))}function lr(En){R(En);const Rn=Math.max(1,Number(Ie)||1),Dn=Math.max(0,Number(It)||0),Nr=En/100*wn,Mr=1/Rn+Dn,cr=Mr>0?Nr/Mr:0;if(l==="pair"){nr(cr?String(cr.toFixed(2)):"");return}if(N==="USD")C(cr?String(cr.toFixed(2)):"");else{const bs=We?cr/We:0,Kr=qe??4;C(bs?String(bs.toFixed(Kr)):""),Vn(bs*We)}}function er(En){const Rn=Math.max(1,Number(Ie)||1),Dn=Math.max(0,Number(It)||0),Nr=En/Rn+En*Dn,Mr=wn>0?Nr/wn*100:0;ft(Math.max(0,Math.min(100,Math.round(Mr))))}function gr(En){const Rn=Math.max(0,Math.min(100,Number(En)||0));ft(Rn);const Dn=Math.max(1,Number(Ie)||1),Nr=Math.max(0,Number(It)||0),Mr=Rn/100*wn,cr=1/Dn+Nr,bs=cr>0?Mr/cr:0;if(jt==="COIN"){const Kr=We?bs/We:0,Ms=qe??4;tn(Kr?String(Kr.toFixed(Ms)):"")}else tn(bs?String(bs.toFixed(2)):"")}function dr(En){tn(En);const Rn=Number(En)||0,Nr=(jt==="COIN"?Rn:We?Rn/We:0)*(We||0);er(Nr)}function Fs(En){if(En===jt)return;const Rn=Number(kt)||0;let Dn="";if(En==="USDC")Dn=String(((Rn||0)*(We||0)).toFixed(2)),un("USDC"),tn(Dn),er(Number(Dn)||0);else if(!We)un("COIN"),tn(""),er(0);else{const Nr=qe??4;Dn=String(((Rn||0)/We).toFixed(Nr)),un("COIN"),tn(Dn),er((Number(Dn)||0)*We)}}function us(En){C(En);const Rn=Number(En)||0,Nr=(N==="COIN"?Rn:We?Rn/We:0)*(We||0);Vn(Nr)}function xr(En){const Rn=En==="USDC"?"USD":En;if(Rn===N)return;const Dn=Number(w)||0;let Nr="";if(Rn==="USD")Nr=String(((Dn||0)*(We||0)).toFixed(2)),I("USD"),C(Nr),Vn(Number(Nr)||0);else if(!We)I("COIN"),C(""),Vn(0);else{const Mr=qe??4;Nr=String(((Dn||0)/We).toFixed(Mr)),I("COIN"),C(Nr),Vn((Number(Nr)||0)*We)}}function vr({entry:En,side:Rn,notionalUSD:Dn,maintenanceFrac:Nr,marginMode:Mr,accountValueUSD:cr,isolatedMarginUSD:bs}){const Kr=Number(En)||0,Ms=Math.abs(Number(Dn)||0);if(!Kr||!Ms)return null;const ei=Rn==="buy"?1:-1,Tt=Math.max(0,Number(Nr)||0),sr=Ms/Kr,mr=Ms*Tt;let Vr;Mr==="Cross"?Vr=cr-mr:Vr=bs-mr;const as=1-Tt*ei;if(!sr||!isFinite(as))return null;const ns=Kr-ei*(Vr/sr)/as;return Math.max(0,ns)}const rs=Number((Kt==null?void 0:Kt.balance)??0),Zr=typeof It=="number"?It:.01,gi=ur>0&&We?vr({entry:We,side:f,notionalUSD:$t,maintenanceFrac:Zr,marginMode:ye,accountValueUSD:rs}):null;m.useEffect(()=>{us(w)},[N,We,Ie,wn]),m.useEffect(()=>{u==="twap"&&dr(kt)},[u,jt,kt,We,Ie,wn]);const oi=m.useMemo(()=>Xhn({book:sn,side:f,sizeCoin:ur,mid:t}),[sn,f,ur,t]);m.useEffect(()=>{let En=!1;async function Rn(){if(!(gt!=null&&gt.wallet_address)||!At){kn(null);return}const Dn=yT({getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:!0,vaultAddress:null}),Nr=GN({address:gt.wallet_address,signer:Dn,dex:"",defaultSlippage:q});En||kn(Nr)}return Rn(),()=>{En=!0}},[At,gt==null?void 0:gt.wallet_address,q]);const la=En=>En||En===0?String(Math.trunc(Number(En))):"",jr=Number(We||0),Xt=En=>{ie(En),Qn("pct");const Rn=Number(En),Dn=Math.max(1,Number(Ie)||1);if(!jr||!isFinite(Rn)){Z("");return}const Nr=Rn/(Dn*100),Mr=Jt?jr*(1+Nr):jr*(1-Nr);Z(la(Mr))};m.useEffect(()=>{X&&(Z(""),he(""),ie(""),G(""),Qn(null),$n(null))},[f]);const pe=En=>{Z(En),Qn("price");const Rn=Number(En),Dn=Math.max(1,Number(Ie)||1);if(!jr||!Rn){ie("");return}const Nr=Rn/jr,Mr=Jt?(Nr-1)*Dn*100:(1-Nr)*Dn*100;ie(String(Number(Mr).toFixed(2)))},st=En=>{G(En),$n("pct");const Rn=Number(En),Dn=Math.max(1,Number(Ie)||1);if(!jr||!isFinite(Rn)){he("");return}const Nr=Rn/(Dn*100),Mr=Jt?jr*(1-Nr):jr*(1+Nr);he(la(Mr))},Ft=En=>{he(En),$n("price");const Rn=Number(En),Dn=Math.max(1,Number(Ie)||1);if(!jr||!Rn){G("");return}const Nr=Rn/jr,Mr=Jt?(1-Nr)*Dn*100:(Nr-1)*Dn*100;G(String(Number(Mr).toFixed(2)))};m.useEffect(()=>{jr&&(X&&(vn==="pct"?Xt(Y):vn==="price"&&pe(J)),Hn==="pct"?st(oe):Hn==="price"&&Ft(re))},[jr,Ie]);function yt(){var En;(En=window==null?void 0:window.dispatchEvent)==null||En.call(window,new Event("balances:refresh"))}async function pn(En){const Rn=()=>{typeof En=="function"&&En()};if(!At){await La(Promise.reject(new Error("Select a wallet")),{loading:"Validating...",success:"OK",error:cr=>cr.message}),Rn();return}if(!_n){await La(Promise.reject(new Error("Please sign in to perform this action.")),{loading:"Validating...",success:"OK",error:cr=>cr.message}),Rn();return}const Dn=String(ye||"").toLowerCase().startsWith("iso")?"isolated":"cross",Mr=Math.max(1,Math.min(xt||s,Number(Ie)||1));if(!Lr&&Math.abs(es||0)>0){const cr=String(be||"").toLowerCase().startsWith("iso")?"isolated":"cross";if(Dn!==cr){await La(new Promise(bs=>bs()),{loading:"Validating...",success:()=>{throw new Error("Cannot switch leverage type with open position.")},error:bs=>bs.message}),Ne(be),Rn();return}}try{if(l==="pair"){const[cr,bs]=String(c||"").split("/").map(Ms=>Ms.trim().toUpperCase()),Kr=Promise.all([_n.updateLeverage(cr,Dn,Mr),_n.updateLeverage(bs,Dn,Mr)]);await La(Kr,{loading:`Updating for ${cr}/${bs}...`,success:()=>"Updated",error:Ms=>(Ms==null?void 0:Ms.message)||"Failed to update leverage for pair"})}else{const cr=Cn||String(e).toUpperCase(),bs=_n.updateLeverage(cr,Dn,Mr);await La(bs,{loading:`Updating for ${cr}...`,success:()=>"Updated",error:Kr=>(Kr==null?void 0:Kr.message)||"Failed to update leverage"}),je(ye)}Rn()}catch{Ne(be),Rn()}}async function An(){const[En,Rn]=String(c||"").split("/").map(Dn=>Dn.trim().toUpperCase());try{if(!At){await La(Promise.reject(new Error("Select a wallet")),{loading:"Validating...",success:"OK",error:Vr=>Vr.message});return}if(!_n){await La(Promise.reject(new Error("Trading is not ready (HL not initialized)")),{loading:"Validating...",success:"OK",error:Vr=>Vr.message});return}const Dn=await _n.info.allMids(),Nr=Number(Dn[En]||0),Mr=Number(Dn[Rn]||0);if(!(Nr>0&&Mr>0)){await La(Promise.reject(new Error("Mid price not available for pair")),{loading:"Validating...",success:"OK",error:Vr=>Vr.message});return}const cr=Math.max(1,Math.min(Number(Ie)||1,Number(xt)||1));cr!==Ie&&(Re(cr),on.success(`Leverage adjusted to ${cr}x`,FHe));let bs=Number(qn)>0?Number(qn):P/100*wn*cr;if(!(bs>0)){await La(Promise.reject(new Error("Enter a valid total notional for pair")),{loading:"Validating...",success:"OK",error:Vr=>Vr.message});return}const Kr=Math.max(0,Math.min(100,Number(Jn)||0))/100,Ms=bs*Kr,ei=bs-Ms,Tt=Ms/Nr,sr=ei/Mr,mr=epn({longSymbol:En,shortSymbol:Rn,longSize:Tt,shortSize:sr,orderType:u,reduceOnlyFlag:!!F,maxSlipVal:q,tpOnFlag:!1,tpVal:"",slVal:"",userAddr:(gt==null?void 0:gt.wallet_address)||rt,lev:cr,coinSym:"",isPairMode:!0,isBuySide:!0,sizeCoinVal:0});if(u==="market"){const Vr=F?_n.marketClose(En,void 0,{tif:"Ioc",reduceOnly:!0,slippage:q}):_n.marketOpen(En,!0,Number(Tt),{tif:"Ioc",reduceOnly:!1,slippage:q}),as=F?_n.marketClose(Rn,void 0,{tif:"Ioc",reduceOnly:!0,slippage:q}):_n.marketOpen(Rn,!1,Number(sr),{tif:"Ioc",reduceOnly:!1,slippage:q}),ns=(async()=>{const[ys,Ns]=await Promise.all([Vr,as]);return await MX({draft:mr,responses:[ys,Ns],user:mr.userAddress}),"Pair market placed"})();await La(ns,{loading:`Opening ${En} long / ${Rn} short...`,success:ys=>ys,error:ys=>(ys==null?void 0:ys.message)||"Pair order failed"}),yt(),R(0),nr("");return}if(u==="limit"){const Vr=mSe(L),as=_n.placeOrder({symbol:En,isBuy:!0,size:Number(Tt),price:Nr,tif:Vr,reduceOnly:!1}),ns=_n.placeOrder({symbol:Rn,isBuy:!1,size:Number(sr),price:Mr,tif:Vr,reduceOnly:!1}),ys=(async()=>{const[Ns,ca]=await Promise.all([as,ns]);return await MX({draft:mr,responses:[Ns,ca],user:mr.userAddress}),"Pair limit placed"})();await La(ys,{loading:`Placing ${En} long / ${Rn} short limits...`,success:Ns=>Ns,error:Ns=>(Ns==null?void 0:Ns.message)||"Pair limit failed"}),yt(),R(0),nr("");return}if(u==="twap"){const Vr=Math.max(5,Math.min(1440,Number(cn||0)*60+Number(Xe||0))),as=_n.placeTwapOrder({symbol:En,isBuy:!0,size:Number(Tt),minutes:Vr,randomize:!!Yt,reduceOnly:!!F}),ns=_n.placeTwapOrder({symbol:Rn,isBuy:!1,size:Number(sr),minutes:Vr,randomize:!!Yt,reduceOnly:!!F}),ys=(async()=>{const[Ns,ca]=await Promise.all([as,ns]);return await MX({draft:mr,responses:[Ns,ca],user:mr.userAddress}),"Pair TWAP started"})();await La(ys,{loading:"Starting pair TWAP...",success:Ns=>Ns,error:Ns=>(Ns==null?void 0:Ns.message)||"Pair TWAP failed"}),yt(),R(0),nr("");return}await La(Promise.reject(new Error("Unsupported mode for pair")),{loading:"Validating...",success:"OK",error:Vr=>Vr.message})}catch{}}const or=m.useMemo(()=>{const En=Number(cn||0)*60+Number(Xe||0);return En?Math.max(5,Math.min(1440,En)):0},[cn,Xe]),_r=m.useMemo(()=>{if(!or)return 0;const En=Math.floor(or*60/30);return Math.max(1,En+1)},[or]),wr=m.useMemo(()=>{const En=Number(kt)||0;return En>0?jt==="COIN"?En:We?En/We:0:0},[kt,jt,We]),pr=m.useMemo(()=>!_r||!(wr>0)?0:wr/_r,[wr,_r]),es=m.useMemo(()=>{const En=String(e||"").toUpperCase();if(!hn||!hn.length)return 0;const Rn=hn.find(Dn=>String(Dn.coin||"").toUpperCase()===En);return Rn?Number(Rn.size||0):0},[hn,e]);async function ts(){try{if(!At){await La(Promise.reject(new Error("Select a wallet")),{loading:"Validating...",success:"OK",error:Rn=>Rn.message});return}if(!_n){await La(Promise.reject(new Error("Trading is not ready (HL not initialized)")),{loading:"Validating...",success:"OK",error:Rn=>Rn.message});return}if(l==="pair"){Dt(!0),await An(),Dt(!1);return}const En=Number(w)||0;if((u==="market"||u==="limit")&&En<=0&&!(u==="market"&&F)){await La(Promise.reject(new Error("Enter a valid amount")),{loading:"Validating...",success:"OK",error:Rn=>Rn.message});return}if(Dt(!0),u==="market")if(F){const Rn=En>0?dC(_n.marketClose(e,Number(ur),{tif:"Ioc",reduceOnly:!0,slippage:q})):dC(_n.marketClose(e,void 0,{tif:"Ioc",reduceOnly:!0,slippage:q}));await La(Rn,{loading:`Closing ${e} position...`,success:Dn=>Dn,error:Dn=>(Dn==null?void 0:Dn.message)||"Close failed"}),yt()}else{const Rn=X&&J!==""&&Number(J)>0,Dn=X&&re!==""&&Number(re)>0,Nr=dC(Rn||Dn?_n.placeMarketWithTPSL({symbol:e,isBuy:Jt,size:Number(ur),entrySlippage:q,tpPrice:Rn?Number(J):null,slPrice:Dn?Number(re):null,triggerSlippage:.1}):_n.marketOpen(e,Jt,Number(ur),{tif:"Ioc",reduceOnly:!1,slippage:q}));await La(Nr,{loading:`Placing ${Jt?"Buy":"Sell"} market order...`,success:Mr=>Mr,error:Mr=>(Mr==null?void 0:Mr.message)||"Order failed"}),yt(),R(0),C("")}else if(u==="limit"){const Rn=mSe(L),Dn=X&&J!==""&&Number(J)>0,Nr=X&&re!==""&&Number(re)>0,Mr=dC(Dn||Nr?_n.placeLimitWithTPSL({symbol:e,isBuy:Jt,size:Number(ur),price:Number(g),tif:Rn,reduceOnly:F,tpPrice:Dn?Number(J):null,slPrice:Nr?Number(re):null,triggerSlippage:q}):_n.placeOrder({symbol:e,isBuy:Jt,size:Number(ur),price:Number(g),tif:Rn,reduceOnly:F}));await La(Mr,{loading:`Placing ${Jt?"Buy":"Sell"} limit order...`,success:cr=>cr,error:cr=>(cr==null?void 0:cr.message)||"Order failed"}),yt(),R(0),C("")}else if(u==="twap"){const Rn=or;if(!Rn){await La(Promise.reject(new Error("Enter a valid running time (min 5 minutes)")),{loading:"Validating...",success:"OK",error:cr=>cr.message}),Dt(!1);return}let Dn=0;const Nr=Number(kt)||0;if(jt==="COIN")Dn=Nr;else{if(!We){await La(Promise.reject(new Error("Price required to convert USD to size")),{loading:"Validating...",success:"OK",error:cr=>cr.message}),Dt(!1);return}Dn=Nr/We}if(!(Dn>0)){await La(Promise.reject(new Error("Enter a valid TWAP size")),{loading:"Validating...",success:"OK",error:cr=>cr.message}),Dt(!1);return}const Mr=_n.placeTwapOrder({symbol:e,isBuy:Jt,size:Number(Dn),minutes:Rn,randomize:!!Yt,reduceOnly:!!F});await La(Mr,{loading:`Starting TWAP for ${e}...`,success:()=>`TWAP started: ${Number(Dn).toLocaleString(void 0,{maximumFractionDigits:qe??4})} ${e} over ${Rn}m`,error:cr=>(cr==null?void 0:cr.message)||"TWAP failed"}),yt()}else{await La(Promise.reject(new Error("This mode is not wired to HyperSDK yet")),{loading:"Validating...",success:"OK",error:Rn=>Rn.message}),Dt(!1);return}}catch{}finally{Dt(!1)}}const Lr=l==="pair",[Qr,Ir]=String(c||"").split("/").map(En=>En.trim().toUpperCase()),Ss=m.useMemo(()=>Lr?0:Number((Jt?_[0]:_[1])||0),[Lr,Jt,_]),hi=Number(Lr?qn||0:$t||0),li=u!=="twap"&&hi<10,Pr=li?"Order must have minimum value of $10.":Gn?"Not Enough Margin":en?"Placing...":u==="twap"?l==="pair"?"Start Pair TWAP":"Start TWAP":u==="scale"?"Place Scale Orders":l==="pair"?"Place Pair Order":"Place Order";return i.jsxs("div",{className:"w-full text-[12px]",style:{background:EHe,borderRadius:16,padding:12},children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsxs("div",{className:"flex flex-1 gap-2",children:[i.jsx(g4,{onClick:()=>ee(!0),children:ye}),i.jsx(g4,{onClick:Lt?()=>fe(!0):void 0,children:Lt?`${Ie}x`:i.jsx("span",{className:"flex items-center justify-center gap-1",children:i.jsx("span",{className:"inline-block w-3 h-3 border-2 border-[#67FFBD] border-t-transparent rounded-full animate-spin"})})}),i.jsx(g4,{onClick:()=>ce(!0),children:ct})]}),i.jsx(Khn,{skipConfirm:h,setSkipConfirm:S})]}),De&&i.jsx("div",{className:"mb-3",children:i.jsx(bT,{wallets:ot,value:At,selectedBalance:Kt==null?void 0:Kt.balance,onChange:En=>{if(String(At)===String(En))return;Je(En);const Rn=(ot||[]).find(Dn=>String(Dn.wallet_id)===String(En));o==null||o({id:String(En),address:(Rn==null?void 0:Rn.wallet_address)||null})}})}),i.jsx(thn,{mode:u,onModeChange:d,moreItems:[{key:"twap",label:"TWAP"}],className:"mb-3"}),!Lr&&i.jsx("div",{className:"mb-1",children:i.jsxs("div",{className:"mb-3 grid grid-cols-2 gap-2",children:[i.jsx("button",{type:"button",onClick:()=>x("buy"),className:"h-[34px] rounded-lg font-bold transition-colors flex justify-center items-center",style:{background:f==="buy"?"rgb(103, 255, 189)":jo,color:f==="buy"?"rgb(15, 21, 26)":Vi},children:"Buy / Long"}),i.jsx("button",{type:"button",onClick:()=>x("sell"),className:"h-[34px] rounded-lg font-bold transition-colors flex justify-center items-center",style:{background:f==="sell"?"rgb(255,121,124)":jo,color:f==="sell"?"rgb(15, 21, 26)":Vi},children:"Sell / Short"})]})}),i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("div",{style:{color:Oi},children:"Available to Trade"}),i.jsxs("div",{className:"text-white font-semibold",children:[Ss.toLocaleString(void 0,{maximumFractionDigits:2})," ","USDC"]})]}),i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("div",{style:{color:Oi},children:"Current Position"}),i.jsx("div",{className:"text-white font-semibold",children:es?`${Math.abs(es).toLocaleString(void 0,{maximumFractionDigits:qe??5})} ${e}`:`0.00000 ${e}`})]}),!Lr&&u==="limit"&&i.jsx("div",{className:"mb-3",children:i.jsx(pb,{label:"Price (USDC)",value:g,onChange:v,right:i.jsx("div",{className:"h-[22px] px-2 rounded-md flex justify-center items-center cursor-pointer",style:{background:"#1b242c",color:"#67FFBD",border:`1px solid ${ka}`},onClick:()=>v(t??""),children:"Mid"})})}),!Lr&&(u==="market"||u==="limit")&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"mb-3",children:i.jsx(pb,{label:"Size",value:w,onChange:us,right:i.jsx(ZP,{value:N,onChange:xr,items:[{key:"USD",label:"USDC"},{key:"COIN",label:e}]})})}),i.jsxs("div",{className:"flex items-center gap-3 mb-6 ",children:[i.jsx(KN,{value:P,onChange:lr,accent:Ge}),i.jsxs("div",{className:"h-[30px] rounded-lg flex items-center px-2",style:{width:84,background:jo,border:`1px solid ${ka}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-xs",inputMode:"numeric",value:P,onChange:En=>lr(Math.max(0,Math.min(100,Number(En.target.value)||0))),style:{color:Vi,fontFeatureSettings:'"tnum"'}}),i.jsx("span",{style:{color:Oi},className:"ml-1",children:"%"})]})]}),i.jsxs("div",{className:`${u==="market"?"flex-col space-y-2":"flex"} items-center justify-between mb-2`,children:[i.jsxs("label",{className:"flex items-center gap-2",style:{color:"#c9d1d9"},children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:F,onChange:En=>U(En.target.checked)}),"Reduce Only"]}),u==="limit"&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(fi,{align:"left",content:"Time In Force <br><br>GTC (Good Til Cancel): Order will rest until filled or canceled.<br><br>IOC (Immediate Or Cancel): Any portion that is not immediately filled will be canceled.<br><br>ALO (Add Liquidity Only): Order will exist only as a limit order on the book. Also known as post-only.",children:i.jsx("span",{style:{color:Oi},children:"TIF"})}),i.jsx(ZP,{value:L,onChange:z,items:[{key:"GTC",label:"GTC"},{key:"IOC",label:"IOC"},{key:"ALO",label:"ALO"}]})]}),u==="market"&&i.jsxs("label",{className:"flex items-center gap-2",style:{color:"#c9d1d9"},children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:X,onChange:En=>ne(En.target.checked)}),"TP/SL"]})]}),u==="limit"&&i.jsxs("label",{className:"flex items-center gap-2 mb-2",style:{color:"#c9d1d9"},children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:X,onChange:En=>ne(En.target.checked)}),"TP/SL"]}),X&&i.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-3",children:[i.jsx(pb,{label:"TP",value:J,onChange:pe}),i.jsx(pb,{label:"Gain %",value:Y,onChange:Xt,right:i.jsx("span",{style:{color:Oi},children:"%"})}),i.jsx(pb,{label:"SL",value:re,onChange:Ft}),i.jsx(pb,{label:"Loss %",value:oe,onChange:st,right:i.jsx("span",{style:{color:Oi},children:"%"})})]})]}),Lr&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"mb-2 w-full flex justify-between gap-2",children:[i.jsxs("span",{className:"h-[34px] rounded-lg font-semibold bg-[rgba(103,255,189,0.16)] text-[#67FFBD] flex justify-center items-center w-1/2",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Qr}.svg`,alt:"Dextrabot - Terminal",className:"w-4 h-4 mr-2"}),Qr," Long"]}),i.jsxs("span",{className:"h-[34px] rounded-lg font-semibold bg-[rgba(255,121,124,0.12)] text-[#FF7272] flex justify-center items-center w-1/2",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Ir}.svg`,alt:"Dextrabot - Terminal",className:"w-4 h-4 mr-2"}),Ir," Short"]})]}),i.jsx("div",{className:"mb-3",children:i.jsx(qhn,{value:Jn,onChange:Nn,leftLabel:Qr,rightLabel:Ir,leftUsd:Number(qn||0)>0?Number(qn)*Jn/100:0,rightUsd:Number(qn||0)>0?Number(qn)*(100-Jn)/100:0})}),i.jsx("div",{className:"mb-3",children:i.jsx(pb,{label:"Size (USD)",value:qn,onChange:En=>{nr(En)},right:i.jsx("div",{className:"h-[22px] px-2 rounded-md flex justify-center items-center cursor-pointer",style:{background:"#1b242c",color:"#67FFBD",border:`1px solid ${ka}`},onClick:()=>{const En=wn*(Number(Ie)||1);nr(String(En.toFixed(2)))},children:"Max"})})}),i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsxs("label",{className:"flex items-center gap-2",style:{color:"#c9d1d9"},children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:F,onChange:En=>U(En.target.checked)}),"Reduce Only"]}),u==="limit"&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{style:{color:Oi},children:"TIF"}),i.jsx(ZP,{value:L,onChange:z,items:[{key:"GTC",label:"GTC"},{key:"IOC",label:"IOC"},{key:"ALO",label:"ALO"}]})]})]})]}),u==="twap"&&!Lr&&i.jsxs(i.Fragment,{children:[i.jsx(pb,{label:"Total Size",value:kt,onChange:dr,right:i.jsx(ZP,{value:jt,onChange:Fs,items:[{key:"USDC",label:"USDC"},{key:"COIN",label:e}]})}),i.jsxs("div",{className:"flex items-center gap-3 mb-8 mt-3",children:[i.jsx(KN,{value:Ke,onChange:gr,accent:Ge}),i.jsxs("div",{className:"h-[30px] rounded-lg flex items-center px-2",style:{width:84,background:jo,border:`1px solid ${ka}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-xs",inputMode:"numeric",value:Ke,onChange:En=>gr(Math.max(0,Math.min(100,Number(En.target.value)||0))),style:{color:Vi,fontFeatureSettings:'"tnum"'}}),i.jsx("span",{style:{color:Oi},className:"ml-1",children:"%"})]})]}),i.jsx("div",{className:"mb-2 mt-3",style:{color:Oi},children:"Running Time (5m - 24h)"}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-3",children:[i.jsx("div",{className:"h-[30px] px-2 rounded-lg flex items-center",style:{background:jo,border:`1px solid ${ka}`},children:i.jsx("input",{className:"w-full bg-transparent outline-none text-right",inputMode:"numeric",placeholder:"Hour(s)",value:cn===0?"":cn,onChange:En=>{const Rn=En.target.value.replace(/[^\d]/g,""),Dn=Math.max(0,Math.min(24,Number(Rn)||0));Pt(Dn)},style:{color:cn?"#FFFFFF":Oi,fontFeatureSettings:'"tnum"'}})}),i.jsx("div",{className:"h-[30px] px-2 rounded-lg flex items-center",style:{background:jo,border:`1px solid ${ka}`},children:i.jsx("input",{className:"w-full bg-transparent outline-none text-right",inputMode:"numeric",placeholder:"Minute(s)",value:Xe===0?"":Xe,onFocus:()=>{Xe===5&&Vt(0)},onChange:En=>{const Rn=En.target.value.replace(/[^\d]/g,""),Dn=Math.max(0,Math.min(59,Number(Rn)||0));Vt(Dn)},style:{color:Xe?"#FFFFFF":Oi,fontFeatureSettings:'"tnum"'}})})]}),i.jsxs("div",{className:"flex-col space-y-2 items-center gap-6 mb-3",children:[i.jsxs("label",{className:"flex items-center gap-2",style:{color:"#c9d1d9"},children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:Yt,onChange:En=>Ve(En.target.checked)}),"Randomize"]}),i.jsxs("label",{className:"flex items-center gap-2",style:{color:"#c9d1d9"},children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:F,onChange:En=>U(En.target.checked)}),"Reduce Only"]})]})]}),De?i.jsx("button",{onClick:ts,disabled:en||!At||Gn||li,className:"w-full h-[32px] rounded-xl font-bold transition-opacity mb-2 flex items-center justify-center disabled:opacity-60",style:{background:Ge,color:"#0f151a"},children:Pr}):i.jsx(Zm,{onClick:()=>{Ye==null||Ye(),Fe(!0)}}),u==="twap"&&!Lr?i.jsxs("div",{className:"mt-4 border-t border-b border-dashed border-[#2F2F2F]",children:[i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Frequency"}),i.jsx("span",{className:"text-white",children:"30 seconds"})]}),i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Runtime"}),i.jsxs("span",{className:"text-white",children:[or.toLocaleString(void 0,{maximumFractionDigits:0})," ","minutes"]})]}),i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Number of Orders"}),i.jsx("span",{className:"text-white",children:_r.toLocaleString(void 0,{maximumFractionDigits:0})})]}),i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Size per Suborder"}),i.jsx("span",{className:"text-white",children:pr>0?`${pr.toLocaleString(void 0,{maximumFractionDigits:qe??5})} ${e}`:`0.00000 ${e}`})]}),i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Fees"}),i.jsx("span",{className:"text-[#67FFBD]",children:br})]})]}):i.jsxs("div",{className:"mt-4 border-t border-b border-dashed border-[#2F2F2F]",children:[i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Liquidation Price"}),i.jsx("span",{className:"text-white",children:Lr?"-":gi?`$${gi.toLocaleString(void 0,{maximumFractionDigits:2})}`:"$0.00"})]}),i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Order Value"}),i.jsx("span",{className:"text-white",children:Lr?`$${Number(qn||0).toLocaleString(void 0,{maximumFractionDigits:2})}`:`$${($t||0).toLocaleString(void 0,{maximumFractionDigits:2})}`})]}),i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Margin Required"}),i.jsx("span",{className:"text-white",children:Lr?`$${(Number(qn||0)/(Number(Ie)||1)||0).toLocaleString(void 0,{maximumFractionDigits:2})}`:`$${(nn||0).toLocaleString(void 0,{maximumFractionDigits:2})}`})]}),i.jsxs("div",{className:"flex items-center justify-between px-0 py-2 text-[13px] font-inter leading-4 border-t border-dashed border-[#2F2F2F] first:border-t-0",children:[i.jsx("span",{className:"text-[#929292]",children:"Slippage"}),i.jsxs("button",{type:"button",onClick:()=>Kn(!0),className:"text-[#67FFBD] hover:opacity-80 h-5 text-xs flex justify-center items-center",children:[`Est: ${oi}% / `,`Max: ${Number(an||0).toFixed(2)}%`]})]})]}),De&&gt&&i.jsx("button",{onClick:()=>dt(!0),className:"flex w-full h-[32px] px-4 py-2 justify-center items-center gap-[10px] shrink-0 rounded-lg bg[rgba(103,255,189,0.16)] text-[#67FFBD] font-inter text-[13px] not-italic font-medium leading-[16px] mt-3 transition-opacity",children:"Deposit"}),De&&gt&&i.jsxs("div",{className:"flex w-full gap-2 mt-2",children:[i.jsxs(cSe,{onClick:()=>Be(!0),className:"flex-1",children:["Perps ",i.jsx(kae,{className:"mx-1 text-xs"})," Spot"]}),i.jsx(cSe,{onClick:()=>tt(!0),className:"flex-1",children:"Withdraw"})]}),i.jsxs("div",{className:"mt-3 pt-2",children:[i.jsx("div",{className:"mb-2 text-white font-inter text-[13px] font-normal leading-4",children:"Account Equity"}),i.jsx(pv,{k:"Spot",v:`$${pSe(Wt??Number(St.spot||0))}`}),i.jsx(pv,{k:"Perps",v:`$${pSe(Kt.balance)}`})]}),i.jsxs("div",{className:"mt-3 pt-2",children:[i.jsx("div",{className:"mb-2 text-white font-inter text-[13px] font-normal leading-4",children:"Perps Overview"}),i.jsx(pv,{k:"Balance",v:`$${Q7(Kt.balance,2)}`}),i.jsx(pv,{k:"Unrealized PNL",v:i.jsxs("span",{style:{color:Kt.uPnl<0?"#FF7173":"#67FFBD"},children:["$",Q7(Kt.uPnl,2)]})}),i.jsx(pv,{k:"Cross Margin Ratio",v:i.jsxs("span",{style:{color:Kt.cmr>=.5?"#FF7173":"#67FFBD"},children:[Q7(Kt.cmr*100,2),"%"]}),link:!0}),i.jsx(pv,{k:"Maintenance Margin",v:`$${Q7(Kt.maintenanceMargin,2)}`}),i.jsx(pv,{k:"Cross Account Leverage",v:`${Q7(Kt.crossLeverage,2)}x`})]}),i.jsx(chn,{open:at,onClose:()=>dt(!1),initialAsset:"USDC",initialChain:"Arbitrum",toWalletAddress:(gt==null?void 0:gt.wallet_address)||""}),i.jsx(PHe,{open:Qe,onClose:()=>Be(!1),perpsAvailable:Ot,spotUsdcAvailable:pt,onSubmit:fr,loading:ln,initialToPerp:!1}),i.jsx(Whn,{open:it,onClose:()=>tt(!1),perpsBalance:Number((Kt==null?void 0:Kt.balance)??0),defaultDest:rt||""}),i.jsx(qh,{open:ae,onClose:()=>fe(!1),children:i.jsxs(nm,{title:"Adjust Leverage",children:[i.jsxs("div",{className:"text-[12px] leading-5 mb-3",style:{color:Oi},children:["Control the leverage used for ",Lr?`${Qr}/${Ir}`:e," ","positions. The maximum leverage is ",xt,"x. Max position size decreases the higher your leverage."]}),i.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[i.jsx("input",{type:"range",min:1,max:xt,step:1,value:Ie,onChange:En=>Re(Number(En.target.value)),className:"flex-1",style:{accentColor:_g}}),i.jsxs("div",{className:"h-[36px] rounded-lg flex items-center px-2",style:{width:84,background:jo,border:`1px solid ${ka}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right",inputMode:"numeric",value:Ie,onChange:En=>Re(Math.max(1,Math.min(xt,Number(En.target.value)||1))),style:{color:Vi,fontFeatureSettings:'"tnum"'}}),i.jsx("span",{style:{color:Oi},className:"ml-1",children:"x"})]})]}),i.jsx(E0,{onClick:()=>pn(()=>fe(!1)),children:"Confirm"}),i.jsxs("div",{className:"mt-3 flex items-start gap-2 text-[12px]",style:{color:"#ffd27a"},children:[i.jsx("span",{children:"⚠️"}),i.jsx("span",{children:"Higher leverage increases the risk of liquidation."})]})]})}),i.jsx(qh,{open:Et,onClose:()=>Kn(!1),children:i.jsxs(nm,{title:"Adjust Max Slippage",children:[i.jsx("div",{className:"text-[12px] leading-5 mb-3",style:{color:Oi},children:"Max slippage only affects market orders placed from the order form. Closing positions will use max slippage of 8% and market TP/SL orders will use max slippage of 10%."}),i.jsxs("div",{className:"h-[36px] rounded-lg flex items-center px-2 mb-3",style:{width:120,background:jo,border:`1px solid ${ka}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right",type:"text",inputMode:"decimal",value:an,onChange:En=>{const Rn=En.target.value.replace(",",".");if(Rn===""){Pn("");return}/^\d*\.?\d*$/.test(Rn)&&Pn(Rn)},style:{color:Vi,fontFeatureSettings:'"tnum"'}}),i.jsx("span",{style:{color:Oi},className:"ml-1",children:"%"})]}),i.jsx(E0,{onClick:nt,children:"Confirm"})]})}),i.jsx(qh,{open:V,onClose:()=>ee(!1),children:i.jsxs(nm,{title:`${Lr?`${Qr}/${Ir}`:e} Margin Mode`,children:[i.jsx(EX,{active:ye==="Cross",onClick:()=>Ne("Cross"),title:"Cross",desc:"All cross positions share the same cross margin as collateral. In the event of liquidation, your cross margin balance and any remaining open positions under assets in this mode may be forfeited."}),i.jsx(EX,{active:ye==="Isolated",onClick:()=>Ne("Isolated"),title:"Isolated",desc:"Manage your risk on individual positions by restricting the amount of margin allocated to each. If the margin ratio of an isolated position reaches 100%, the position will be liquidated. Margin can be added or removed to individual positions in this mode."}),i.jsx("div",{className:"mt-3",children:i.jsx(E0,{onClick:()=>pn(()=>ee(!1)),children:"Confirm"})})]})}),i.jsx(qh,{open:Ae,onClose:()=>ce(!1),children:i.jsxs(nm,{title:"Position Mode",children:[i.jsx(EX,{active:ct==="One-Way",onClick:()=>Ut("One-Way"),title:"One-Way",desc:"Open orders in the same direction merge into a single position for each market."}),i.jsx("div",{className:"mt-3",children:i.jsx(E0,{onClick:()=>ce(!1),children:"Confirm"})})]})})]})}const mb=({name:e,minFilterType:t,maxFilterType:n,handleChange:r,minInputName:s,maxInputName:a,isTooltip:o})=>{const l=f=>{f.preventDefault()},c=f=>{f.target.addEventListener("wheel",l,{passive:!1})},u=f=>{f.target.removeEventListener("wheel",l)},d=f=>{["-","+","e"].includes(f.key)&&f.preventDefault()};return i.jsxs("div",{className:`${e=="Account Value"?"mb-20":""} col-span-1 flex flex-col justify-start max-w-full z-3 font-manrope gap-[13px] mx-4`,children:[i.jsxs("p",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px] flex justify-start items-center gap-1",children:[e,o&&i.jsxs("span",{className:"flex justify-start items-center has-tooltip relative",children:[i.jsx(vi,{className:"text-[#c9c9c9] w-4 min-w-4 min-h-4 h-4"}),i.jsx("span",{className:"",children:i.jsx(_a,{content:"Snapshot data per hour",positionTop:!1,alignRight:!0})})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{value:t,onChange:r,type:"number",name:s,onFocus:c,onBlur:u,autoComplete:"off",onKeyDown:["Unrealized PnL","Funding Paid"].includes(e)?void 0:d,placeholder:"Min",className:`py-0.5 bg-[#1b1b1b] rounded-md border border-[#303030] h-8 block text-white text-sm font-medium font-inter leading-[8px] w-1/2 px-2 ${t!=null&&t!==""?"border border-[#8d67ff]":""} focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#535353] placeholder:text-sm placeholder:font-medium placeholder:font-inter placeholder:leading-[8px]`}),i.jsx("input",{value:n,onChange:r,type:"number",name:a,autoComplete:"off",onFocus:c,onBlur:u,onKeyDown:["Unrealized PnL","Funding Paid"].includes(e)?void 0:d,placeholder:"Max",className:`bg-[#1b1b1b] rounded-md border border-[#303030] py-0.5 h-8 block sm:text-sm font-semibold font-manrope leading-none w-1/2 px-2 ${n!=null&&n!==""?"border border-[#8d67ff]":""} focus:ring-1 focus:ring-[#8d67ff] focus:outline-none placeholder:text-[#535353] placeholder:text-sm placeholder:font-medium placeholder:font-inter placeholder:leading-[8px]`})]})]})},tpn=({walletFilter:e,setWalletFilter:t,filterTerminal:n,setFilterTerminal:r,resetFilters:s})=>{const a=m.useRef(null),o=c=>{const{name:u,value:d}=c.target;r(f=>({...f,[u]:d}))},l=c=>{var u;c.key==="Escape"&&(t(""),(u=a.current)==null||u.blur())};return i.jsxs("div",{className:"flex flex-col items-center gap-4 w-full h-full p-1 sm:p-2 mt-4 sm:px-0 overflow-y-scroll",children:[i.jsxs("div",{className:"flex flex-col items-center gap-2.5 w-[90%] sm:w-[90%]",children:[i.jsx("div",{className:"text-[#c9c9c9] text-[13px] font-semibold font-manrope leading-[8px] flex justify-start items-center gap-1 w-full pl-1",children:"Search Wallet"}),i.jsxs("div",{className:"flex justify-center items-center gap-0.5 h-max rounded-lg border border-[#333333] w-full overflow-hidden p-0.5",children:[i.jsx("input",{ref:a,type:"text",value:e,name:"walletFilter",onChange:c=>t(c.target.value),onKeyDown:l,className:"bg-[#353535] rounded text-white py-1 pl-2 pr-3 w-full text-sm outline-none  placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c] font-manrope",placeholder:"Search Wallet"}),i.jsx("div",{onClick:()=>t(""),className:"text-[#aaa] hover:text-white outline-none focus:outline-none focus:ring-0 border-none w-4 h-[26px] bg-[#353535] hover:bg-[#333333] rounded-l rounded-r-lg flex justify-center items-center cursor-pointer",children:i.jsx("img",{src:Oa,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})]}),i.jsx(mb,{minFilterType:n==null?void 0:n.min_notional,maxFilterType:n==null?void 0:n.max_notional,handleChange:o,minInputName:"min_notional",maxInputName:"max_notional",name:"Notional",isTooltip:!1}),i.jsx(mb,{minFilterType:n==null?void 0:n.min_size,maxFilterType:n==null?void 0:n.max_size,handleChange:o,minInputName:"min_size",maxInputName:"max_size",name:"Size",isTooltip:!1}),i.jsx(mb,{minFilterType:n==null?void 0:n.min_entry,maxFilterType:n==null?void 0:n.max_entry,handleChange:o,minInputName:"min_entry",maxInputName:"max_entry",name:"Entry",isTooltip:!1}),i.jsx(mb,{minFilterType:n==null?void 0:n.min_liq_price,maxFilterType:n==null?void 0:n.max_liq_price,handleChange:o,minInputName:"min_liq_price",maxInputName:"max_liq_price",name:"Liq. Price",isTooltip:!1}),i.jsx(mb,{minFilterType:n==null?void 0:n.min_unrealized_pnL,maxFilterType:n==null?void 0:n.max_unrealized_pnL,handleChange:o,minInputName:"min_unrealized_pnL",maxInputName:"max_unrealized_pnL",name:"Unrealized PnL",isTooltip:!1}),i.jsx(mb,{minFilterType:n==null?void 0:n.min_funding_paid,maxFilterType:n==null?void 0:n.max_funding_paid,handleChange:o,minInputName:"min_funding_paid",maxInputName:"max_funding_paid",name:"Funding Paid",isTooltip:!1}),i.jsx(mb,{minFilterType:n==null?void 0:n.min_account_value,maxFilterType:n==null?void 0:n.max_account_value,handleChange:o,minInputName:"min_account_value",maxInputName:"max_account_value",name:"Margin",isTooltip:!1}),i.jsx(mb,{minFilterType:n==null?void 0:n.min_perp_equity,maxFilterType:n==null?void 0:n.max_perp_equity,handleChange:o,minInputName:"min_perp_equity",maxInputName:"max_perp_equity",name:"Account Value",isTooltip:!1})]})},OHe=m.createContext({key:"All",setKey:()=>{}});function npn({children:e}){const t=typeof window<"u"&&localStorage.getItem("terminal_side_filter")||"All",[n,r]=m.useState(t);m.useEffect(()=>{typeof window<"u"&&localStorage.setItem("terminal_side_filter",n)},[n]);const s=m.useMemo(()=>({key:n,setKey:r}),[n]);return i.jsx(OHe.Provider,{value:s,children:e})}function x2(){return m.useContext(OHe)}function rpn({className:e=""}){const{key:t,setKey:n}=x2(),r=["All","Active","Long","Short"];return i.jsxs("label",{className:`inline-flex items-center gap-2 ${e}`,children:[i.jsx("span",{className:"text-[#9B9B9B] text-[12px]",children:"Filter"}),i.jsx("select",{value:t,onChange:s=>n(s.target.value),className:"h-7 bg-[#262626] text-white text-[12px] rounded-md px-2 border border-[#2F2F2F] outline-none",children:r.map(s=>i.jsx("option",{value:s,children:s},s))})]})}function spn(e){var a;const t=((e==null?void 0:e.direction)||(e==null?void 0:e.posSide)||(e==null?void 0:e.position_side)||"").toString().toLowerCase();if(t==="long")return"Long";if(t==="short")return"Short";const n=((e==null?void 0:e.dir)||(e==null?void 0:e.sideText)||"").toString().toLowerCase();if(n.includes("open long")||n.includes("close short")||n.includes("short > long")||n.endsWith(" long"))return"Long";if(n.includes("open short")||n.includes("close long")||n.includes("long > short")||n.endsWith(" short"))return"Short";const r=((e==null?void 0:e.side)||"").toString();if(r==="B"||r==="Buy")return"Long";if(r==="A"||r==="Sell")return"Short";if((e==null?void 0:e.isBuy)===!0||(e==null?void 0:e.b)===!0)return"Long";if((e==null?void 0:e.isBuy)===!1||(e==null?void 0:e.b)===!1)return"Short";const s=Number((e==null?void 0:e.szi)??(e==null?void 0:e.size)??((a=e==null?void 0:e.position)==null?void 0:a.szi)??0);return s>0?"Long":s<0?"Short":(e==null?void 0:e.side)==="Long"||(e==null?void 0:e.type)==="Long"?"Long":(e==null?void 0:e.side)==="Short"||(e==null?void 0:e.type)==="Short"?"Short":null}function ipn(e,t){var n;if(t==="positions"){const r=Number((e==null?void 0:e.szi)??(e==null?void 0:e.size)??((n=e==null?void 0:e.position)==null?void 0:n.szi)??0);return Math.abs(r)>0}return!0}function Gg(e,t="generic",n="All"){if(!Array.isArray(e)||e.length===0)return e||[];if(n==="All")return e;if(n==="Active")return e.filter(s=>ipn(s,t));const r=n;return e.filter(s=>{const a=spn(s);return a?a===r:!1})}const apn=({data:e,loading:t,error:n,isDigits:r,period:s,periods:a,handlePeriodChange:o})=>{const[l,c]=m.useState("All"),[u,d]=m.useState(!1),{key:f}=x2(),{copyTradeWatchList:x,trackedWatchList:g,setSignModalOpen:v}=m.useContext(Gr),{address:w}=Yr(),[C,N]=m.useState(!1),[I,P]=m.useState(null),[R,F]=m.useState(null),[U,L]=m.useState(""),[z,X]=m.useState(""),[ne,J]=m.useState({min_notional:"",max_notional:"",min_size:"",max_size:"",min_entry:"",max_entry:"",min_mark_price:"",max_mark_price:"",min_liq_price:"",max_liq_price:"",min_unrealized_pnL:"",max_unrealized_pnL:"",min_funding_paid:"",max_funding_paid:"",min_account_value:"",max_account_value:"",min_perp_equity:"",max_perp_equity:""}),Z=()=>{c("All"),X(""),J({min_notional:"",max_notional:"",min_size:"",max_size:"",min_entry:"",max_entry:"",min_mark_price:"",max_mark_price:"",min_liq_price:"",max_liq_price:"",min_unrealized_pnL:"",max_unrealized_pnL:"",min_funding_paid:"",max_funding_paid:"",min_account_value:"",max_account_value:"",min_perp_equity:"",max_perp_equity:""})},he=((G,V)=>V.reduce((ee,ae)=>{const fe=G[ae];return fe!==void 0&&fe!==""&&fe!==null&&ee++,ee},0))({...ne,walletFilter:z},[...Object.keys(ne),"walletFilter"]),Y=m.useMemo(()=>Gg(e,"positions",f),[e,f]),ie=async({walletAddress:G,isFollow:V,isScalper:ee})=>{try{L(G);const ae=window.localStorage.getItem("hyperToken"),fe=window.localStorage.getItem("hyperAddress");if(!ae){v(!0);return}const Ae=V?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",ce=V?{address:w?w.toLowerCase():fe,token:ae,follow_address:G.toLowerCase()}:{address:w?w.toLowerCase():fe,token:ae},ye=await fetch(Ae,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(ce)});if(!ye.ok)throw new Ml(`Server responded with status ${ye.status}`);const Ne=await ye.json();Ne.success?(P(Array.isArray(Ne==null?void 0:Ne.data)?[...Ne.data].sort((be,je)=>new Date(je.created_at||0)-new Date(be.created_at||0)):Ne==null?void 0:Ne.data),F(ee),N(!0)):on.error(Ne.error_message)}catch(ae){on.error(ae.message||"Something went wrong!")}},oe=[{key:"action",label:"Action",sortable:!1,width:"125px",render:(G,V)=>i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{onClick:ee=>{ee.preventDefault();const ae=x==null?void 0:x.some(fe=>fe.wallet_address===(V==null?void 0:V.address));ie({walletAddress:V==null?void 0:V.address,isFollow:ae,isScalper:V==null?void 0:V.is_scalper})},className:`${x.some(ee=>ee.wallet_address===(V==null?void 0:V.address))?"bg-[#67ffbd] text-[#161616] font-semibold":"border border-[#67ffbd] bg-[#161616] text-[#67ffbd] hover:bg-[#67ffbd] hover:text-[#161616] font-bold"} h-[22px] rounded-[256px] inline-flex items-center px-2 text-[12px] leading-[8px] tracking-tight cursor-pointer`,children:"Copy Trade"}),i.jsx(x5,{walletAddress:V==null?void 0:V.address,children:i.jsx("div",{className:"w-[18px] h-[18px] flex items-center justify-center cursor-pointer",children:g.some(ee=>ee.wallet_address===(V==null?void 0:V.address))?i.jsx("img",{src:r5,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"}):i.jsx("img",{src:SA,alt:"",className:"w-3.5 h-3.5 min-w-3.5 min-h-3.5"})})})]})},{key:"address",label:"Wallet",sortable:!0,sortValue:G=>(G.address||"").toLowerCase(),render:(G,V)=>i.jsx("div",{onClick:()=>window.open(`/wallet-details/${V==null?void 0:V.address}`,"_blank"),className:"flex items-center gap-2.5 cursor-pointer",children:i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(Gx,{info:V!=null&&V.address?`${V.address.slice(0,5)}...${V.address.slice(-4)}`:"--",textColor:"text-white"}),i.jsx("img",{onClick:ee=>{ee.stopPropagation(),navigator.clipboard.writeText((V==null?void 0:V.address)||""),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},src:bo,alt:"",className:"cursor-pointer"})]})})},{key:"direction",label:"Direction",sortable:!0,sortValue:G=>G.direction==="long"?1:G.direction==="short"?0:-1,render:(G,V)=>i.jsx("div",{className:"flex items-center gap-2 h-8",children:i.jsxs("div",{className:`${V.direction==="long"?"text-[#67ffbd] bg-[#67ffbd]/20":V.direction==="short"?"text-[#ff787b] bg-[#ff797c]/20":"text-[#67ffbd] bg-[#67ffbd]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md inline-flex items-center gap-0.5`,children:[i.jsx("div",{className:"w-3 h-3 flex items-center justify-center",children:V.direction==="long"?i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-3 h-3"}):V.direction==="short"?i.jsx(Es,{className:"text-[#FF797C] w-3 h-3"}):i.jsx(Es,{className:"text-[#67FFBD] rotate-180 w-3 h-3"})}),i.jsxs("div",{className:"text-[11px] font-semibold leading-[8px] tracking-wide uppercase",children:[V.direction," - ",V.leverage_value,"x"]})]})})},{key:"notional",label:"Notional",sortable:!0,sortValue:G=>Number(G.notional)||-1/0,render:(G,V)=>i.jsx(Gx,{info:(V==null?void 0:V.notional)==null||isNaN(parseFloat(V==null?void 0:V.notional))?"--":`$${Ku(V==null?void 0:V.notional)}`,textColor:"text-white"})},{key:"szi",label:"Size",sortable:!0,sortValue:G=>Number(G.szi)||-1/0,render:(G,V)=>i.jsx(Gx,{info:(V==null?void 0:V.szi)==null||isNaN(parseFloat(V==null?void 0:V.szi))?"--":`${Er(V==null?void 0:V.szi)}`,textColor:"text-white"})},{key:"entry_price",label:"Entry Price",sortable:!0,sortValue:G=>Number(G.entry_price)||-1/0,render:(G,V)=>i.jsx(Gx,{info:(V==null?void 0:V.entry_price)==null||isNaN(parseFloat(V==null?void 0:V.entry_price))?"--":`$${zw(parseFloat(V==null?void 0:V.entry_price).toFixed((V==null?void 0:V.entry_price)>=1e4?0:r))}`,textColor:"text-white"})},{key:"liq_price",label:"Liq. Price",sortable:!0,sortValue:G=>Number(G.liq_price)||-1/0,render:(G,V)=>i.jsx(Gx,{info:(V==null?void 0:V.liq_price)==null||isNaN(parseFloat(V==null?void 0:V.liq_price))?"--":`$${zw(parseFloat(V==null?void 0:V.liq_price).toFixed((V==null?void 0:V.liq_price)>=1e4?0:r))}`,textColor:"text-white"})},{key:"unrealized_pnl",label:"Unrealized PnL",sortable:!0,sortValue:G=>Number(G.unrealized_pnl)||0,render:(G,V)=>i.jsx(Gx,{info:(V==null?void 0:V.unrealized_pnl)==null||isNaN(parseFloat(V==null?void 0:V.unrealized_pnl))?"--":`$${Er(Math.abs(V==null?void 0:V.unrealized_pnl))}`,textColor:`${(V==null?void 0:V.unrealized_pnl)==null||isNaN(parseFloat(V==null?void 0:V.unrealized_pnl))||(V==null?void 0:V.unrealized_pnl)===0?"text-white":(V==null?void 0:V.unrealized_pnl)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`})},{key:"funding_paid",label:"Funding Paid",sortable:!0,sortValue:G=>Number(G.funding_paid)||0,render:(G,V)=>i.jsx(Gx,{info:(V==null?void 0:V.funding_paid)==null||isNaN(parseFloat(V==null?void 0:V.funding_paid))?"--":`$${Er(Math.abs(V==null?void 0:V.funding_paid))}`,textColor:`${(V==null?void 0:V.funding_paid)==null||isNaN(parseFloat(V==null?void 0:V.funding_paid))||(V==null?void 0:V.funding_paid)===0?"text-white":(V==null?void 0:V.funding_paid)>0?"text-[#1DE6A3]":"text-[#FF7173]"}`})},{key:"account_value",label:"Margin",sortable:!0,sortValue:G=>Number(G.account_value)||-1/0,render:(G,V)=>i.jsx(Gx,{info:(V==null?void 0:V.account_value)==null||isNaN(parseFloat(V==null?void 0:V.account_value))?"--":`$${Ku(V==null?void 0:V.account_value)}`,textColor:"text-white"})},{key:"perp_equity",label:"Account Value",sortable:!0,sortValue:G=>Number(G.perp_equity)||-1/0,render:(G,V)=>i.jsx(Gx,{info:(V==null?void 0:V.perp_equity)==null||isNaN(parseFloat(V==null?void 0:V.perp_equity))?"--":`$${Ku(V==null?void 0:V.perp_equity)}`,textColor:"text-white"})}];return i.jsxs(i.Fragment,{children:[i.jsx(g5,{open:C,setOpen:N,copyTradeData:I,copyTradeWallet:U,setCopyTradeWallet:L,isScalper:R,setCopyTradeData:P}),i.jsxs("div",{className:"flex flex-col w-full h-full mt-4",children:[i.jsx("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-2 md:gap-0 pl-3 pr-5",children:i.jsxs("div",{className:"flex flex-row justify-start items-center gap-2 sm:gap-4 md:gap-2 lg:gap-4 flex-wrap",children:[i.jsxs("div",{className:"flex justify-start items-center gap-2 sm:gap-4 md:gap-2 lg:gap-4",children:[i.jsxs("button",{onClick:()=>d(!u),className:`${he>0?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none border-none relative`,children:[i.jsx(Ff,{className:`w-4 h-4 ${he>0?"text-blue-500":"text-white"}`}),he>0&&i.jsx("div",{className:"absolute -top-2 -right-2 rounded-full w-4 h-4 text-[11px] bg-[#8D67FF] text-white flex justify-center items-center",children:he})]}),he>0&&i.jsx(opn,{title:"Reset Filter",set_click:()=>Z(),tableSortButton:"Reset"})]}),i.jsx("div",{className:"flex",children:i.jsx(kce,{periods:a,selectedPeriod:s,handlePeriod:o,borderColor:"ticker"})}),t&&i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[54px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]})]})}),i.jsxs("div",{className:"flex flex-col sm:flex-row w-full h-full",children:[i.jsxs("div",{className:`${u?"":"hidden"} w-[95%] sm:w-72 sm:min-w-72 h-[calc(100%-70px)] bg-[#232323] border border-[#292929] rounded-2xl m-2 overflow-hidden`,children:[i.jsxs("div",{className:"w-full sticky top-0 bg-[#232323] flex justify-between items-center pt-[2px] pl-3 pr-1 mt-3",children:[i.jsx("div",{className:"text-white text-base font-semibold font-inter leading-[8px]",children:"Filters"}),i.jsx("div",{onClick:()=>Z(),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md inline-flex items-center mr-3 cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-inter leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx(tpn,{walletFilter:z,setWalletFilter:X,filterTerminal:ne,setFilterTerminal:J,resetFilters:Z})]}),i.jsx("div",{className:"w-full h-[calc(100%-60px)] relative flex-grow",children:t?i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center -mt-10",children:i.jsx(Ma,{})}):n&&!e?i.jsx("div",{className:"flex min-h-[26vh] sm:min-h-[66vh] flex-col justify-center items-center",children:i.jsx(Ml,{})}):(Y==null?void 0:Y.length)===0?i.jsx("div",{className:"flex w-full justify-center items-center",children:i.jsx("div",{className:"flex min-h-[36vh] w-[100%] sm:w-[75%] max-w-[300px] sm:max-w-[700px] justify-center items-center text-center",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3",children:[i.jsx("img",{src:ec,alt:""}),i.jsxs("div",{className:"flex flex-col items-center h-max gap-3",children:[i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-inter leading-[8px] pt-3",children:"No data matched the selected filter range."}),i.jsx("div",{className:"text-center -mt-2",children:i.jsx("span",{className:"text-[#979797] text-[13px] font-normal font-inter leading-[14px] tracking-wide",children:"Please adjust your filters and try again."})})]})]})})}):i.jsx(Pu,{data:Y,columns:oe,rowHeight:30,listHeight:560,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal"})})]})]})]})},Gx=({info:e,textColor:t})=>i.jsx("div",{className:"flex flex-col items-end gap-0.5",children:i.jsx("div",{className:`${t} text-[12px] font-semibold font-inter leading-none flex items-center justify-start px-1 gap-0.5`,children:e})}),opn=({title:e,set_click:t,tableSortButton:n})=>i.jsx("div",{onClick:t,className:`${n==e?"bg-[#3d3d3d] text-white":n=="Reset"?"bg-[#3d3d3d] text-white hover:bg-[#4d4d4d]":"bg-[#161616] text-[#9b9b9b]"} text-[12px] font-medium font-inter leading-[8px] cursor-pointer flex justify-center items-center min-w-max rounded-md px-[6px] sm:px-[10px] h-7`,children:e});function kv(e,t=2){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function gSe(e){return new Promise(t=>setTimeout(t,e))}function bSe(e){if(!e)return"";const t=String(e);return t.slice(0,6)+"..."+t.slice(-4)}function lpn({open:e,onClose:t,children:n,title:r}){return e?i.jsxs("div",{className:"fixed inset-0 z-[999] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[1px]",onClick:t}),i.jsxs("div",{className:"relative w-[560px] max-w-[92vw] rounded-2xl border border-[#2A2A2A] bg-[#161616] shadow-2xl",children:[i.jsxs("div",{className:"px-5 pt-4 pb-2 flex items-center justify-between",children:[i.jsx("div",{className:"font-inter text-[18px] leading-6 text-white",children:r}),i.jsx("button",{onClick:t,className:"w-8 h-8 flex items-center justify-center rounded-lg bg-[#222] text-[#BDBDBD]",children:"✕"})]}),i.jsx("div",{className:"px-5 pb-5",children:n})]})]}):null}function tF({children:e}){return i.jsx("div",{className:"text-[12px] text-[#9B9B9B] font-inter mb-1",children:e})}function ySe({value:e,onChange:t,placeholder:n,invalid:r=!1}){return i.jsx("input",{value:e,onChange:s=>t(s.target.value),placeholder:n,className:`w-full h-10 px-3 rounded-lg bg-[#101010] outline-none text:white ${r?"border border-[#FF7173]":"border border-[#2A2A2A]"}`})}function vSe({value:e,onChange:t,options:n,disabled:r=!1}){return i.jsx("select",{disabled:r,value:e,onChange:s=>t(s.target.value),className:`w-full h-10 px-3 rounded-lg bg-[#101010] border text-white outline-none ${r?"border-[#2A2A2A] opacity-60 cursor-not-allowed":"border-[#2A2A2A]"}`,children:n.map(s=>i.jsx("option",{value:s.value,className:"bg-[#101010]",children:s.label},s.value))})}function cpn({children:e}){return i.jsx("div",{className:"grid grid-cols-2 gap-4",children:e})}function upn({onMax:e}){return i.jsx("button",{onClick:e,className:"px-2 h-8 rounded-md bg-[#1F2A23] text-[#67FFBD] text-[12px] font-medium ml-2",children:"MAX"})}function dpn({children:e,onClick:t,disabled:n,loading:r}){return i.jsx("button",{onClick:t,disabled:n||r,className:`${n||r?"bg-[#2C2C2C] text-[#8A8A8A] cursor-not-allowed":"bg[rgba(103,255,189,0.16)] text-[#67FFBD] hover:opacity-95"} w-full h-9 rounded-xl mt-5 font-medium`,children:r?"Processing...":e})}function fpn(){const e=typeof window<"u"?window.ethereum:null;if(!e)return null;if(Array.isArray(e.providers)&&e.providers.length){const t=e.providers.find(r=>r&&r.isMetaMask);if(t)return t;const n=e.providers.find(r=>r&&r.isCoinbaseWallet);return n||e.providers[0]}return e}async function hpn(e,t){let n=await e.request({method:"eth_chainId"});if((n==null?void 0:n.toLowerCase())!==t.toLowerCase())try{await e.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]})}catch(r){if(r&&r.code===4902)await e.request({method:"wallet_addEthereumChain",params:[{chainId:t,chainName:"Arbitrum One",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:["https://arb1.arbitrum.io/rpc"],blockExplorerUrls:["https://arbiscan.io/"]}]});else throw r}}const ppn=e=>typeof e=="string"&&/^0x[0-9a-fA-F]{40}$/.test(e.trim());function mpn({open:e,onClose:t,perpsAvailable:n,spotBalances:r,onSubmit:s,loading:a}){const o=[{value:"USDC",label:"USDC"},...r.filter(U=>U.coin!=="USDC").map(U=>({value:U.coin,label:U.coin}))],[l,c]=m.useState(""),[u,d]=m.useState("perps"),[f,x]=m.useState("USDC"),[g,v]=m.useState("");m.useEffect(()=>{u==="perps"&&x("USDC")},[u]);const w=u==="perps"?Number(n||0):r.find(L=>L.coin===f)?Math.max(0,Number(b.total||0)-Number(b.hold||0)):0,C=()=>v(String(w)),N=()=>s({kind:"send",from:u,token:f,destination:l,amount:g,available:w}),I=ppn(l),P=Number(g)>0&&Number(g)<=Number(w||0),R=!I||!P,F=l.length>0&&!I;return i.jsx(lpn,{open:e,onClose:t,title:"Send Tokens",children:i.jsxs("div",{className:"space-y-4 text-xs",children:[i.jsxs("div",{children:[i.jsx(tF,{children:"Destination"}),i.jsx(ySe,{value:l,onChange:c,placeholder:"Enter Hyperliquid account address (0x…)",invalid:F})]}),i.jsxs(cpn,{children:[i.jsxs("div",{children:[i.jsx(tF,{children:"From Account"}),i.jsx(vSe,{value:u,onChange:U=>d(U),options:[{value:"perps",label:"Perps Account"},{value:"spot",label:"Spot Account"}]})]}),i.jsxs("div",{children:[i.jsx(tF,{children:"Token"}),i.jsx(vSe,{value:f,onChange:x,options:o,disabled:u==="perps"})]})]}),i.jsxs("div",{children:[i.jsx(tF,{children:"Amount"}),i.jsxs("div",{className:"flex items-center",children:[i.jsx(ySe,{value:g,onChange:v,placeholder:"0.0"}),i.jsx(upn,{onMax:C})]}),i.jsxs("div",{className:"mt-1 text-[12px] text-[#9B9B9B]",children:["Available: ",kv(w,6)," ",f]})]}),i.jsx(dpn,{onClick:N,disabled:R,loading:a,children:"Send"})]})})}const xpn={name:"Exchange",version:"1",chainId:1337,verifyingContract:"0x0000000000000000000000000000000000000000"},gpn={Agent:[{name:"source",type:"string"},{name:"connectionId",type:"bytes32"}]};function bpn(e){if(typeof e!="string"||!e.includes("."))return String(e);const t=e.replace(/\.?0+$/,"");return t==="-0"?"0":t}function are(e){if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(are);const t={...e};for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;const r=t[n];r&&typeof r=="object"?t[n]=are(r):(n==="p"||n==="s")&&typeof r=="string"&&(t[n]=bpn(r))}return t}function ypn(e,t,n){const r=are(e),s=IHe(r),a=t==null?9:29,o=new Uint8Array(s.length+a);o.set(s);const l=new DataView(o.buffer);return l.setBigUint64(s.length,BigInt(n),!1),t==null?l.setUint8(s.length+8,0):(l.setUint8(s.length+8,1),o.set(cs(t),s.length+9)),io(o)}function vpn(e,t){return{source:t?"a":"b",connectionId:e}}function wpn(e){const t=e.startsWith("0x")?e.slice(2):e,n="0x"+t.slice(0,64),r="0x"+t.slice(64,128);let s=parseInt(t.slice(128,130),16);return s<27&&(s+=27),{r:n,s:r,v:s}}async function Cpn(e,t){const n=fpn();if(!n)throw new Error("No injected provider");return await hpn(n,"0xa4b1"),await n.request({method:"eth_signTypedData_v4",params:[e,JSON.stringify(t)]})}function Spn({addr:e,isMainnet:t=!0,vaultAddress:n=null}){return{sign:async(r,s)=>{const a=ypn(r,n,s),o={domain:xpn,types:gpn,primaryType:"Agent",message:vpn(a,t)},l=await Cpn(e,o);return wpn(l)}}}const wSe=e=>e?`${e.slice(0,6)}...${e.slice(-4)}`:"-";function Npn({walletAddress:e,listHeight:t=560}){const{address:n}=Yr(),{latestPnL:r}=m.useContext(Gr),[s,a]=m.useState(()=>typeof window>"u"?e||null:window.localStorage.getItem("hl_selected_wallet_address")||null||e||null);m.useEffect(()=>{const ie=()=>{if(typeof window>"u")return;const oe=window.localStorage.getItem("hl_selected_wallet_address")||null;a(oe||e||null)};return ie(),window.addEventListener("hl_selected_wallet_changed",ie),window.addEventListener("storage",ie),()=>{window.removeEventListener("hl_selected_wallet_changed",ie),window.removeEventListener("storage",ie)}},[e]);const o=gT(s?s.toLowerCase():null),{perps:l={},spotBalances:c=[],tokenIdMap:u={},tokenMetaMap:d={},priceMap:f={},initialLoaded:x=!1}=o,[g,v]=m.useState({send:!1,transfer:!1,transferInitToPerp:!1}),[w,C]=m.useState(!1),N=m.useMemo(()=>{const ie=typeof window<"u"?localStorage.getItem("hl_pk"):null,oe=ie?Bhn(ie).toLowerCase():null,G=n?n.toLowerCase():null,V=s?s.toLowerCase():null,ee=ie&&oe&&V&&oe===V;return{mode:ee?"local":!ee&&G?"metamask":"none",localAddr:oe,mmAddr:G,targetAddr:V}},[n,s]);m.useEffect(()=>{const ie=oe=>{var V;const G=!!((V=oe==null?void 0:oe.detail)!=null&&V.toPerp);v(ee=>({...ee,transfer:!0,transferInitToPerp:G}))};return window.addEventListener("balances:open-transfer",ie),()=>window.removeEventListener("balances:open-transfer",ie)},[]);const I=m.useMemo(()=>{try{if(!s)return null;if(N.mode==="local"){const ie=yT({getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:!0,vaultAddress:null});return GN({address:s,signer:ie,isMainnet:!0,signatureChainIdHex:"0xa4b1",getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null})}if(N.mode==="metamask"&&N.mmAddr){const ie=Spn({addr:N.mmAddr,isMainnet:!0,vaultAddress:null});return GN({address:s,signer:ie,isMainnet:!0,signatureChainIdHex:"0xa4b1",getPK:()=>null})}return null}catch{return null}},[s,N]);m.useEffect(()=>{const ie=()=>{(async()=>{try{await fetch("https://api.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"clearinghouseState",user:s})}).then(oe=>oe.json()),window.dispatchEvent(new CustomEvent("noop"))}catch{}})()};return window.addEventListener("balances:refresh",ie),()=>window.removeEventListener("balances:refresh",ie)},[s]);const P=m.useMemo(()=>c||[],[c]),R=m.useMemo(()=>{const ie=P.find(oe=>oe.coin==="USDC");return ie?Math.max(0,Number(ie.total||0)-Number(ie.hold||0)):0},[P]),F=()=>{const ie=N.mode==="local"?N.localAddr:N.mode==="metamask"?N.mmAddr:null;return ie?N.targetAddr?ie!==N.targetAddr?(on.error(`Connected wallet ${bSe(ie)} does not match selected account ${bSe(N.targetAddr)}. Switch wallet or change the selected account.`,{id:"addr-mismatch",duration:6e3}),!1):!0:(on.error("Target account is missing.",{id:"target-missing"}),!1):(on.error("Wallet not connected or signer unavailable.",{id:"signer-missing"}),!1)},U=()=>{on.error("No deposit found for this account. Please deposit USDC (Arbitrum) to Hyperliquid before performing this action.",{id:"err-deposit"})},L=async({from:ie,token:oe,destination:G,amount:V,available:ee})=>{var ae;try{if(C(!0),!I)throw new Error("SDK not ready");if(!F())return;const fe=(G||"").trim().toLowerCase();if(!fe||!fe.startsWith("0x")||fe.length!==42)throw new Error("Destination address is invalid");if(!Number(V))throw new Error("Amount is invalid");if(Number(V)>Number(ee||0))throw new Error("Amount exceeds available balance");let Ae;if(ie==="perps")Ae=await I.transfers.usdTransfer(fe,V);else{const ce=u[oe];if(!ce)throw new Error(`TokenId not found for ${oe}`);const ye=`${oe}:${ce}`;Ae=await I.transfers.spotTransfer(fe,ye,String(V))}if((Ae==null?void 0:Ae.status)==="ok")on.success("Send successful.",{id:"send-success"}),await gSe(600),(ae=window==null?void 0:window.dispatchEvent)==null||ae.call(window,new Event("balances:refresh"));else{const ce=typeof(Ae==null?void 0:Ae.response)=="string"?Ae.response:JSON.stringify(Ae);ce&&ce.toLowerCase().includes("must deposit")?U():on.error(`Send failed: ${ce||"Unknown error"}`,{id:"send-error"})}}catch(fe){const Ae=(fe==null?void 0:fe.message)||"Send failed";Ae.toLowerCase().includes("must deposit")?U():on.error(Ae,{id:"send-error"})}finally{C(!1),v(fe=>({...fe,send:!1}))}},z=async({toPerp:ie,amount:oe,available:G})=>{var V;try{if(C(!0),!I)throw new Error("SDK not ready");if(!F())return;if(!Number(oe))throw new Error("Amount is invalid");if(Number(oe)>Number(G||0))throw new Error("Amount exceeds available balance");const ee=await I.transfers.usdClassTransfer(String(oe),!!ie);if((ee==null?void 0:ee.status)==="ok")on.success("Transfer successful.",{id:"transfer-success"}),await gSe(600),(V=window==null?void 0:window.dispatchEvent)==null||V.call(window,new Event("balances:refresh"));else{const ae=typeof(ee==null?void 0:ee.response)=="string"?ee.response:JSON.stringify(ee);ae&&ae.toLowerCase().includes("must deposit")?U():on.error(`Transfer failed: ${ae||"Unknown error"}`,{id:"transfer-error"})}}catch(ee){const ae=(ee==null?void 0:ee.message)||"Transfer failed";ae.toLowerCase().includes("must deposit")?U():on.error(ae,{id:"transfer-error"})}finally{C(!1),v(ee=>({...ee,transfer:!1}))}},X=1,[ne,J]=m.useState(()=>typeof window>"u"?!1:localStorage.getItem("hide_small_balances")==="1");m.useEffect(()=>{const ie=oe=>{var G;typeof((G=oe==null?void 0:oe.detail)==null?void 0:G.value)=="boolean"?J(oe.detail.value):J(typeof window<"u"&&localStorage.getItem("hide_small_balances")==="1")};return window.addEventListener("balances:hide-small-changed",ie),()=>window.removeEventListener("balances:hide-small-changed",ie)},[]);const Z=m.useMemo(()=>ie=>{if(Number.isFinite(Number(ie.usdcValue)))return Number(ie.usdcValue);const oe=f[ie.coin],G=Number(ie.totalDisplay??0);return Number.isFinite(oe)&&Number.isFinite(G)?oe*G:null},[f]),re=m.useMemo(()=>{const ie=[],oe=Number((l==null?void 0:l.accountValue)??0),G=Number((l==null?void 0:l.totalMarginUsed)??0),V=Math.max(0,oe-G);return ie.push({id:"USDC_PERPS",kind:"perps",coin:"USDC",unit:"USDC",usdcValue:oe,totalDisplay:oe,availableDisplay:V,totalSort:oe,availableSort:V}),P.forEach(ee=>{const ae=String(ee.coin),fe=Number(ee.total||0),Ae=Number(ee.hold||0),ce=Math.max(0,fe-Ae);let ye=null;ae==="USDC"&&(ye=fe);const Ne=f[ae];ye==null&&Number.isFinite(Ne)&&(ye=Ne*fe),ie.push({id:`SPOT_${ae}`,kind:"spot",coin:ae,unit:ae,usdcValue:ye,totalDisplay:fe,availableDisplay:ce,totalSort:fe,availableSort:ce})}),ie},[l,P,f]),he=m.useMemo(()=>ne?re.filter(ie=>{if(ie.kind==="perps")return!0;const oe=Z(ie);return oe!=null?oe>=X:Number(ie.totalDisplay??0)>=1e-6}):re,[re,ne,Z]),Y=m.useMemo(()=>[{key:"coin",label:"Coin",sortable:!0,sortValue:ie=>ie.coin,render:(ie,oe)=>i.jsxs("span",{className:"text-white",children:[oe.coin," ",oe.kind==="perps"?i.jsx("span",{className:"text-[#9B9B9B]",children:"(Perps)"}):oe.coin==="USDC"&&oe.kind==="spot"?i.jsx("span",{className:"text-[#9B9B9B]",children:"(Spot)"}):null]})},{key:"total",label:"Total Balance",sortable:!0,sortValue:ie=>ie.totalSort,render:(ie,oe)=>i.jsxs("span",{className:"text-white",children:[kv(oe.totalDisplay)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:oe.unit})]})},{key:"available",label:"Available Balance",sortable:!0,sortValue:ie=>ie.availableSort,render:(ie,oe)=>{const G=oe.kind==="perps"&&oe.coin==="USDC",V=Number((l==null?void 0:l.withdrawable)||0),ee=G?`Available balance to open positions ignoring open orders. ${kv(V,2)} USDC is availableto withdraw.`:void 0;return i.jsxs("span",{className:"text-white underline-offset-2",title:ee,children:[kv(oe.availableDisplay)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:oe.unit})]})}},{key:"usdcValue",label:"USDC Value",sortable:!0,sortValue:ie=>{const oe=Z(ie);return oe??-1},render:(ie,oe)=>{const G=Z(oe);return i.jsxs("span",{className:"text-white",children:[G!=null?kv(G):"-"," ",G!=null?i.jsx("span",{className:"text-[#9B9B9B]",children:"USDC"}):null]})}},{key:"pnlRoe",label:"PnL (ROE %)",sortable:!1,render:(ie,oe)=>{if(oe.kind!=="perps")return i.jsx("span",{className:"text-white",children:"-"});const G=r==null?void 0:r.all,V=Number((l==null?void 0:l.accountValue)||0),ee=V>0&&typeof G=="number"?G/V*100:null,ae=typeof G!="number"?"text-white":G>0?"text-[#67FFBD]":G<0?"text-[#FF7173]":"text-white";return i.jsxs("span",{className:ae,children:[typeof G!="number"?"-":`$${kv(Math.abs(G),2)}`," ",i.jsx("span",{className:"text-[#9B9B9B]",children:ee==null?"":`(${kv(Math.abs(ee),2)}%)`})]})}},{key:"send",label:"Send",sortable:!1,render:(ie,oe)=>oe.kind==="perps"||oe.coin==="USDC"?i.jsxs("button",{onClick:()=>v(G=>({...G,send:!0})),className:"p-0 inline-flex items-center gap-1 h-5 text-white bg-transparent hover:opacity-90 -ml-1",title:"Send",children:[i.jsx(E6t,{}),i.jsx("span",{children:"Send"})]}):null},{key:"transfer",label:"Transfer",sortable:!1,render:(ie,oe)=>oe.coin==="USDC"?i.jsxs("button",{onClick:()=>v(G=>({...G,transfer:!0,transferInitToPerp:oe.kind==="spot"})),className:"p-0 inline-flex items-center gap-1 h-5 text-white bg-transparent hover:opacity-90 -ml-1",title:oe.kind==="perps"?"Transfer to Spot":"Transfer to Perpetual",children:[i.jsx(kae,{}),i.jsx("span",{children:oe.kind==="perps"?"Transfer to Spot":"Transfer to Perps"})]}):null},{key:"contract",label:"Contract",sortable:!1,render:(ie,oe)=>{const G=d[oe.coin],V=(G==null?void 0:G.tokenId)||null,ee=(G==null?void 0:G.evmContract)||null;if(V){const ae=`https://app.hyperliquid.xyz/explorer/token/${V}`;return i.jsx("a",{href:ae,target:"_blank",rel:"noreferrer",className:"text-white bg-transparent hover:text-white/80 -ml-2",children:wSe(V)})}if(ee){const ae=`https://arbiscan.io/token/${ee}`;return i.jsx("a",{href:ae,target:"_blank",rel:"noreferrer",className:"text-white bg-transparent -ml-2",children:wSe(ee)})}return i.jsx("span",{className:"text-[#9B9B9B] -ml-2",children:"-"})}}],[r==null?void 0:r.all,l,Z,d]);return x?i.jsxs(i.Fragment,{children:[i.jsx(Pu,{data:he,columns:Y,rowHeight:30,listHeight:t,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-semibold",rowKey:ie=>ie.id}),i.jsx(mpn,{open:g.send,onClose:()=>v(ie=>({...ie,send:!1})),perpsAvailable:l==null?void 0:l.withdrawable,spotBalances:P,onSubmit:L,loading:w}),i.jsx(PHe,{open:g.transfer,onClose:()=>v(ie=>({...ie,transfer:!1})),perpsAvailable:l==null?void 0:l.withdrawable,spotUsdcAvailable:R,onSubmit:z,loading:w,initialToPerp:!!g.transferInitToPerp})]}):i.jsx("div",{className:"mt-2 flex pt-12 justify-center text-[12px] text-[#9B9B9B]",style:{height:t},children:"Loading..."})}const Apn={position:"bottom-right",style:{background:"#1e1e1e",color:"#fff",fontSize:12,border:"1px solid #2A2A2A"}},jpn="dextra-global-toast";function RX(e,t){return on.promise(e,t,{id:jpn,...Apn})}async function LX(e){const t=yT({getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:!0,vaultAddress:null});return GN({address:e,signer:t,dex:""})}function fo(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function Epn(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}function Sue({open:e,onClose:t,title:n,width:r=720,children:s}){return e?Ia.createPortal(i.jsxs("div",{className:"fixed inset-0 z-[99999] font-inter",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:t}),i.jsxs("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 max-w[95vw] rounded-2xl border border-[#2A2A2A] bg-[#161616] shadow-2xl",style:{width:r},children:[i.jsxs("div",{className:"px-5 pt-4 pb-2 flex items-center justify-between",children:[i.jsx("div",{className:"text-white text-[16px]",children:n}),i.jsx("button",{onClick:t,className:"flex justify-center items-center w-8 h-8 rounded-lg bg-[#222] text-[#BDBDBD]",title:"Close",children:"✕"})]}),i.jsx("div",{className:"px-5 pb-5",children:s})]})]}),document.body):null}const kg=({children:e})=>i.jsx("div",{className:"text-[11px] text-[#9B9B9B] mb-1",children:e}),ore=({value:e,onChange:t,placeholder:n})=>i.jsx("input",{value:e,onChange:r=>t(r.target.value),placeholder:n,className:"w-full h-9 px-3 rounded-lg bg-[#101010] border border-[#2A2A2A] text-white outline-none font-inter text-[11px]"}),DX=({children:e,right:t})=>i.jsxs("div",{className:"h-9 rounded-lg bg-[#0E0E0E] border border-[#2A2A2A] px-3 flex items-center justify-between text-[#CFCFCF]",children:[i.jsx("span",{className:"text-[11px]",children:e}),t?i.jsx("span",{className:"text-[#9B9B9B] text-[11px]",children:t}):null]}),MHe=({children:e,onClick:t,disabled:n,loading:r})=>i.jsxs("button",{onClick:t,disabled:n||r,className:`w-full h-8 rounded-xl !mt-10 font-medium font-inter text-[12px] flex items-center justify-center gap-2 ${n||r?"bg-[#2C2C2C] text-[#8A8A8A] cursor-not-allowed":"bg-[#67FFBD] text-[#101010] hover:opacity-95"}`,children:[r?i.jsx(Wy,{size:14,color:"#FFF"}):null,i.jsx("span",{children:e})]});function _pn({open:e,onClose:t,row:n,onConfirm:r,initialTab:s="limit",busy:a=!1}){const[o,l]=Se.useState(s),[c,u]=Se.useState(n!=null&&n.markPrice?String(n.markPrice):""),[d,f]=Se.useState(100),x=Se.useRef(!1),g=Math.abs(Number((n==null?void 0:n.size)||0));Number((n==null?void 0:n.entryPrice)||0);const v=Number((n==null?void 0:n.markPrice)??(n==null?void 0:n.midPrice)??0),w=g*d/100,C=Number(c||0);Se.useEffect(()=>{e&&!x.current&&(l(s),f(100),u(n!=null&&n.markPrice?String(n.markPrice):""),x.current=!0),!e&&x.current&&(x.current=!1)},[e,s,n==null?void 0:n.markPrice]);const N=()=>{a||(o==="market"?r==null||r({mode:"market",id:n==null?void 0:n.id,coin:n==null?void 0:n.coin,side:n==null?void 0:n.type,size:w}):r==null||r({mode:"limit",id:n==null?void 0:n.id,coin:n==null?void 0:n.coin,side:n==null?void 0:n.type,price:C,size:w}))},I=o==="market"?"Market Close":"Limit Close",P=o==="market"?"This will attempt to immediately close the position.":"This will send an order to close your position at the limit price.";return i.jsx(Sue,{open:e,onClose:a?()=>{}:t,title:I,width:500,children:i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"text-[12px] text-[#9B9B9B]",children:P}),i.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[i.jsx(kg,{children:"Size"}),i.jsxs("div",{className:"text-[#CFCFCF]",children:[fo(g)," ",n==null?void 0:n.coin]})]}),o==="market"?i.jsxs("div",{className:"grid gap-3",children:[i.jsxs("div",{children:[i.jsx(kg,{children:"Price"}),i.jsx(DX,{right:"",children:i.jsx("span",{className:"text-white",children:"Market"})})]}),i.jsxs("div",{children:[i.jsx(kg,{children:"Size"}),i.jsx(DX,{right:"USDC",children:fo(w*v,2)})]})]}):i.jsxs("div",{className:"grid gap-3",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(kg,{children:"Price (USD)"}),i.jsx("button",{className:"text-[11px] text-[#67FFBD] px-2 py-0.5 rounded-md hover:opacity-90",onClick:()=>u(String(v)),children:"Mid"})]}),i.jsx(ore,{value:c,onChange:u,placeholder:"0.0"})]}),i.jsxs("div",{children:[i.jsx(kg,{children:"Size"}),i.jsx(DX,{right:"USDC",children:fo(w*(C||v),2)})]})]}),i.jsx(KN,{value:d,onChange:f,accent:"#67FFBD",trackBg:"rgba(255,255,255,0.12)",marks:[0,25,50,75,100],snap:!0}),i.jsx(MHe,{onClick:N,disabled:o==="limit"&&!c,loading:a,children:o==="market"?"Market Close":"Confirm"})]})})}function kpn({open:e,onClose:t,row:n,onConfirm:r,busy:s=!1}){const a=Math.abs(Number((n==null?void 0:n.size)||0)),o=(n==null?void 0:n.type)==="Long"?"Short":"Long";return i.jsx(Sue,{open:e,onClose:s?()=>{}:t,width:640,title:`Reverse ${n==null?void 0:n.coin} Position`,children:i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"rounded-xl border border-[#8d6a2a] bg-[#2a2212] text-[#f1c76c] p-3 text-[12px]",children:"This will close your existing positions and open reversed positions with the same size. This action cannot be undone."}),i.jsx("div",{className:"rounded-xl border border-[#2A2A2A] bg-[#101010] p-4 text-[12px]",children:i.jsxs("div",{className:"grid grid-cols-[1fr_1fr_1fr] gap-2",children:[i.jsx("div",{className:"text-[#9B9B9B]",children:"Asset"}),i.jsx("div",{className:"text-[#9B9B9B]",children:"Current Side"}),i.jsx("div",{className:"text-[#9B9B9B]",children:"New Side"}),i.jsx("div",{className:"text-white",children:n==null?void 0:n.coin}),i.jsxs("div",{className:"text-[#67FFBD]",children:[n==null?void 0:n.type," ",fo(a)]}),i.jsxs("div",{className:"text-[#FF797C]",children:[o," ",fo(a)]})]})}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx("button",{onClick:t,disabled:s,className:`flex-1 h-10 rounded-xl border border-[#2A2A2A] bg-transparent text-white hover:bg-white/5 ${s?"opacity-60 cursor-not-allowed":""}`,children:"Cancel"}),i.jsx("button",{onClick:()=>r==null?void 0:r({mode:"reverse",id:n==null?void 0:n.id,coin:n==null?void 0:n.coin,from:n==null?void 0:n.type,to:o,size:a}),disabled:s,className:`flex-1 h-10 rounded-xl bg-[#67FFBD] text-[#101010] hover:opacity-95 ${s?"opacity-60 cursor-not-allowed":""}`,children:s?i.jsx(Wy,{size:14,color:"#FFF"}):"Reverse"})]})]})})}const CSe=({value:e,onChange:t,placeholder:n="0"})=>i.jsxs("div",{className:"relative",children:[i.jsx("input",{value:e,onChange:r=>t(r.target.value),placeholder:n,className:"w-full h-9 px-3 pr-8 rounded-lg bg-[#101010] border border-[#2A2A2A] text-white outline-none font-inter text-[11px] text-right",inputMode:"decimal"}),i.jsx("span",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-[#9B9B9B] text-[11px]",children:"%"})]});function Tpn({open:e,onClose:t,row:n,initialTp:r,initialSl:s,onSubmit:a}){var ie;const[o,l]=m.useState(r?String(r):""),[c,u]=m.useState(s?String(s):""),[d,f]=m.useState(""),[x,g]=m.useState(""),[v,w]=m.useState(!1),[C,N]=m.useState(!1),I=Number((n==null?void 0:n.entryPrice)||0),P=Number((n==null?void 0:n.markPrice)??0),R=Math.abs(Number((n==null?void 0:n.size)||0)),F=n==null?void 0:n.type,U=(((ie=n==null?void 0:n.leverage)==null?void 0:ie.type)||(n==null?void 0:n.marginType)||"").toString(),L=oe=>Number.isFinite(oe)?Math.max(0,oe):0,z=(oe,G=4)=>Number.isFinite(oe)?String(Number(oe.toFixed(G))):"",X=oe=>{var ae;if(!I)return"";const G=Number(oe);if(!Number.isFinite(G))return"";const V=Number(((ae=n==null?void 0:n.leverage)==null?void 0:ae.value)||1),ee=(F==="Long"?G/I-1:1-G/I)*100*V;return z(L(ee),2)},ne=oe=>{var ae;if(!I)return"";const G=Number(oe);if(!Number.isFinite(G))return"";const V=Number(((ae=n==null?void 0:n.leverage)==null?void 0:ae.value)||1),ee=(F==="Long"?1-G/I:G/I-1)*100*V;return z(L(ee),2)},J=oe=>{var fe;const G=Number(oe);if(!Number.isFinite(G)||!I)return"";const V=Number(((fe=n==null?void 0:n.leverage)==null?void 0:fe.value)||1),ee=G/(V*100),ae=F==="Long"?I*(1+ee):I*(1-ee);return z(ae,4)},Z=oe=>{var fe;const G=Number(oe);if(!Number.isFinite(G)||!I)return"";const V=Number(((fe=n==null?void 0:n.leverage)==null?void 0:fe.value)||1),ee=G/(V*100),ae=F==="Long"?I*(1-ee):I*(1+ee);return z(ae,4)};m.useEffect(()=>{if(e){const oe=r?String(r):"",G=s?String(s):"";l(oe),u(G),f(oe?X(oe):""),g(G?ne(G):""),w(!1),N(!1)}},[e,r,s]);const re=o&&R?Math.max(0,(F==="Long"?Number(o)-P:P-Number(o))*R):0,he=c&&R?Math.max(0,(F==="Long"?P-Number(c):Number(c)-P)*R):0,Y=()=>{a==null||a({id:n==null?void 0:n.id,coin:n==null?void 0:n.coin,side:F,tpPrice:o?Number(o):null,slPrice:c?Number(c):null,configureAmount:v,useLimitPx:C}),t()};return i.jsx(Sue,{open:e,onClose:t,title:`TP/SL for Position - ${(n==null?void 0:n.coin)||"--"} - ${U||F||"--"}`,children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"rounded-xl border border-[#2A2A2A] bg-[#101010] p-4 text-[12px] space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-[#9B9B9B]",children:[i.jsx("span",{children:"Position"}),i.jsxs("span",{className:"text-[#1DE6A3]",children:[fo(R)," ",i.jsx("span",{className:"text-[#67FFBD]",children:n==null?void 0:n.coin})]})]}),i.jsxs("div",{className:"flex justify-between text-[#9B9B9B]",children:[i.jsx("span",{children:"Entry Price"}),i.jsx("span",{className:"text-white",children:fo(I,4)})]}),i.jsxs("div",{className:"flex justify-between text-[#9B9B9B]",children:[i.jsx("span",{children:"Mark Price"}),i.jsx("span",{className:"text-white",children:fo(P,4)})]})]}),i.jsxs("div",{className:"rounded-xl border border-[#2A2A2A] bg-[#101010] p-4 space-y-6",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[1fr_220px] gap-6 items-start",children:[i.jsxs("div",{children:[i.jsx(kg,{children:"TP Price"}),i.jsx(ore,{value:o,onChange:oe=>{l(oe),f(oe?X(oe):"")},placeholder:"0.0"}),i.jsx("div",{className:"text-[11px] text-[#9B9B9B] mt-1",children:"Est Gain:"}),i.jsxs("div",{className:"text-[11px] text-[#67FFBD]",children:["+$",fo(re,2)]})]}),i.jsxs("div",{children:[i.jsx(kg,{children:"Gain"}),i.jsx(CSe,{value:d,onChange:oe=>{f(oe),l(oe?J(oe):"")}})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[1fr_220px] gap-6 items-start",children:[i.jsxs("div",{children:[i.jsx(kg,{children:"SL Price"}),i.jsx(ore,{value:c,onChange:oe=>{u(oe),g(oe?ne(oe):"")},placeholder:"0.0"}),i.jsx("div",{className:"text-[11px] text-[#9B9B9B] mt-1",children:"Est Loss:"}),i.jsxs("div",{className:"text-[11px] text-[#FF7173]",children:["-$",fo(he,2)]})]}),i.jsxs("div",{children:[i.jsx(kg,{children:"Loss"}),i.jsx(CSe,{value:x,onChange:oe=>{g(oe),u(oe?Z(oe):"")}})]})]}),i.jsxs("div",{className:"flex items-center gap-6 text-[12px] text-white",children:[i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:v,onChange:oe=>w(oe.target.checked)}),i.jsx("span",{children:"Configure Amount"})]}),i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD]",checked:C,onChange:oe=>N(oe.target.checked)}),i.jsx("span",{children:"Limit Price"})]})]}),i.jsx(MHe,{onClick:Y,disabled:!o&&!c,children:"Confirm"})]})]})})}function Ipn({selectedRow:e,onOpenCloseModal:t,onOpenReverse:n,onCloseAll:r,busyCloseAll:s}){const[a,o]=m.useState(!1),l=m.useRef(null),[c,u]=m.useState({x:0,y:0});return m.useEffect(()=>{var f;if(!a)return;const d=(f=l.current)==null?void 0:f.getBoundingClientRect();d&&u({x:d.left,y:d.bottom+6})},[a]),m.useEffect(()=>{if(!a)return;const d=()=>o(!1),f=x=>{l.current&&l.current.contains(x.target)||d()};return window.addEventListener("resize",d),window.addEventListener("scroll",d),document.addEventListener("pointerdown",f),()=>{window.removeEventListener("resize",d),window.removeEventListener("scroll",d),document.removeEventListener("pointerdown",f)}},[a]),i.jsxs(i.Fragment,{children:[i.jsxs("button",{ref:l,className:"w-[100px] min-w-0 h-8 px-2 rounded-lg border border-[#2A2A2A] bg-[#161616] text-[#CFCFCF] text-xs flex items-center justify-between overflow-hidden",onClick:d=>{d.stopPropagation(),o(f=>!f)},title:"Close menu",children:[i.jsx("span",{className:"truncate",children:"Close"}),i.jsx("span",{className:"opacity-70 ml-2",children:"▾"})]}),a&&Ia.createPortal(i.jsx("div",{className:"fixed z-[99998] w-[300px] rounded-xl border border-[#2A2A2A] bg-[#0F0F0F] shadow-2xl p-3",style:{top:c.y,left:c.x},onPointerDown:d=>d.stopPropagation(),children:i.jsxs("div",{className:"mt-2 text-[13px] text-white/90",children:[i.jsx("div",{className:`${e?"hover:bg-white/5":"opacity-40 pointer-events-none"} px-2 py-1.5 rounded cursor-pointer`,onClick:()=>e&&(t==null?void 0:t("limit")),children:"Limit Close"}),i.jsx("div",{className:`${e?"hover:bg-white/5":"opacity-40 pointer-events-none"} px-2 py-1.5 rounded cursor-pointer`,onClick:()=>e&&(t==null?void 0:t("market")),children:"Market Close"}),i.jsxs("div",{className:`px-2 py-1.5 rounded cursor-pointer ${s?"opacity-60 pointer-events-none":"hover:bg-white/5"}`,onClick:()=>!s&&(r==null?void 0:r()),children:["Close All (Market)",s?i.jsx("span",{className:"inline-flex ml-2 align-middle",children:i.jsx(Wy,{size:12,color:"#FFF"})}):null]})]})}),document.body)]})}function Ppn({walletAddress:e,listHeight:t=560}){var ce,ye,Ne,be;const{isReferralCodeName:n}=m.useContext(Gr),{rows:r,tpslByCoin:s={},viewOrdersOnly:a}=yue(e),[o,l]=m.useState(e||"");m.useEffect(()=>{l(e||"")},[r]);const c=(o||"")===(e||""),u=m.useMemo(()=>c?r.map(je=>({...je,id:je.id})):[],[c,r]),{key:d}=x2(),[f,x]=m.useState({}),[g,v]=m.useState(null),[w,C]=m.useState(!1),[N,I]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",positionDistribution:0,pnl:0,closePx:0}),[P,R]=m.useState(null),F=m.useMemo(()=>u.find(je=>je.id===P)||null,[u,P]),[U,L]=m.useState(!1),[z,X]=m.useState("limit"),[ne,J]=m.useState(!1),[Z,re]=m.useState(!1),[he,Y]=m.useState(!1),ie=()=>typeof window<"u"&&window.localStorage.getItem("skipCloseConfirm")==="true",oe={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},G=je=>oe[je]||je,V=m.useCallback(async({id:je,coin:Ie,tpPrice:Re,slPrice:Qe,configureAmount:Be,useLimitPx:it})=>{var tt;try{const at=await LX(e);await RX(at.replaceTPSLForPosition({symbol:Ie,tpPrice:Re??null,slPrice:Qe??null,useLimitPx:!!it,triggerSlippage:.1}),{loading:`Placing TP/SL for ${Ie}...`,success:`TP/SL placed for ${Ie}`,error:dt=>`TP/SL failed: ${(dt==null?void 0:dt.message)||dt}`}),x(dt=>({...dt,[je]:{tp:Re||null,sl:Qe||null}})),(tt=window.dispatchEvent)==null||tt.call(window,new Event("orders:refresh"))}catch{}finally{v(null)}},[e]);m.useEffect(()=>{if(w&&!N.referral){const je=n||window.localStorage.getItem("refcode")||"";je&&I(Ie=>({...Ie,referral:je}))}},[w,n,N.referral]);const ee=m.useCallback(async je=>{re(!0);try{const Ie=await LX(e),Re=je.mode==="market"?Ie.marketClose(je.coin,je.size,{tif:"Ioc",reduceOnly:!0}):Ie.placeOrder({symbol:je.coin,isBuy:je.side==="Short",size:je.size,price:je.price,tif:"Gtc",reduceOnly:!0});await RX(Re,{loading:`Closing ${je.coin} ${je.mode}...`,success:`Closed ${je.coin} (${fo(je.size)} ${je.mode})`,error:Qe=>`Close failed: ${je.coin} • ${(Qe==null?void 0:Qe.message)||Qe}`}),L(!1)}finally{re(!1)}},[e]),ae=m.useMemo(()=>[{key:"coin",label:"Coin",sortable:!0,sortValue:Ie=>Ie.coin||"",render:(Ie,Re)=>{var it;const Qe=nl(),Be=()=>Qe(`/terminal/hyperliquid/${Re.coin}`);return i.jsxs("div",{onPointerDown:Be,className:"flex gap-1 items-center text-white font-medium min-w-[120px] cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${G(Re.coin)}.svg`,onError:ea,className:"w-5 h-5 mr-2",alt:Re.coin}),i.jsx("span",{children:Ie.replace("xyz:","")||"--"}),i.jsx("div",{className:"flex justify-start items-center gap-2 h-8 ml-1",children:i.jsx("div",{className:`${Re.type==="Long"?"text-[#67ffbd] bg-[#67ffbd]/20":"text-[#ff787b] bg-[#ff797c]/20"} h-5 pl-1 pr-1.5 py-1 rounded-md inline-flex items-center gap-1`,children:i.jsxs("div",{className:"text-[11px] font-semibold tracking-wide uppercase",children:[fo(((it=Re.leverage)==null?void 0:it.value)??0,0),"x"]})})})]})}},{key:"size",label:"Size",sortable:!0,sortValue:Ie=>Math.abs(Ie.size),render:(Ie,Re)=>i.jsxs("span",{className:`font-medium ${Re.type==="Long"?"text-[#67ffbd]":"text-[#ff787b]"}`,children:[fo(Math.abs(Ie))," ",Re.coin.replace("xyz:","")]})},{key:"positionValue",label:"Pos. Val.",sortable:!0,sortValue:Ie=>Ie.positionValue,render:Ie=>i.jsxs("span",{className:"text-white font-semibold",children:["$",fo(Ie,2)]})},{key:"entryPrice",label:"Entry Price",sortable:!0,sortValue:Ie=>Ie.entryPrice,render:Ie=>i.jsxs("span",{className:"text-white font-semibold",children:["$",fo(Ie,4)]})},{key:"markPrice",label:"Mark Price",sortable:!0,sortValue:Ie=>Ie.markPrice,render:Ie=>i.jsxs("span",{className:"text-white font-semibold",children:["$",fo(Ie,4)]})},{key:"pnl",label:"PnL (ROE%)",headerTooltip:"Mark price is used to estimate unrealized PNL. Only trade prices are used for realized PNL.",sortable:!0,sortValue:Ie=>Ie.pnl,render:(Ie,Re)=>i.jsxs("div",{className:"flex items-center justify-end gap-1",children:[i.jsxs("span",{className:Re.pnl>=0?"text-[#67FFBD]":"text-[#FF797C]",children:["$",fo(Math.abs(Re.pnl),2)," ",i.jsxs("span",{className:"text-[#9B9B9B]",children:["(",fo(Math.abs(Re.roe),1),"%)"]})]}),i.jsx("button",{onClick:Qe=>{var it;Qe.stopPropagation();const Be=n||window.localStorage.getItem("refcode")||"";I({coin:Re.coin,type:Re.type.toUpperCase(),leverage:((it=Re.leverage)==null?void 0:it.value)||0,roe:Re.roe||0,entryPrice:Number(Re.entryPrice||0),markPrice:Number(Re.markPrice||0),referral:Be,positionDistribution:0,pnl:Number(Re.pnl||0),closePx:0}),C(!0)},className:"flex items-center h-6 text-[#67FFBD] text-[11px] font-semibold bg-transparent -ml-3",title:"Share",children:i.jsx("img",{src:cm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})},{key:"liquidationPx",label:"Liq. Price",sortable:!0,sortValue:Ie=>Ie.liquidationPx??-1,render:Ie=>Ie==null?i.jsx("span",{className:"text-[#979797]",children:"--"}):i.jsx("span",{className:"text-white font-semibold",children:fo(Ie,0)})},{key:"marginUsed",label:"Margin",headerTooltip:"For isolated positions margin includes unrealized pnl.",sortable:!0,sortValue:Ie=>Ie.marginUsed,render:(Ie,Re)=>{var it;const Qe=Re.marginUsed,Be=(it=Re.leverage)!=null&&it.type?Epn(Re.leverage.type):null;return i.jsxs("span",{className:"text-white font-semibold",children:["$",fo(Qe,2)," ",Be?i.jsxs("span",{className:"text-[#9B9B9B]",children:["(",Be,")"]}):null]})}},{key:"funding",label:"Funding",headerTooltip:"Net funding payments since the position was opened. Hover for all-time and since changed.",sortable:!0,sortValue:Ie=>Ie.funding,render:Ie=>i.jsxs("span",{className:Number(Ie)<=0?"text-[#67FFBD] font-semibold":"text-[#FF797C] font-semibold",children:["$",fo(Math.abs(Ie),4)]})},{key:"close",label:i.jsx(Ipn,{selectedRow:F,onOpenCloseModal:async Ie=>{if(F){if(X(Ie),Ie==="market"&&ie()){await ee({mode:"market",id:F==null?void 0:F.id,coin:F==null?void 0:F.coin,side:F==null?void 0:F.type,size:Math.abs(Number((F==null?void 0:F.size)||0))});return}L(!0)}},onOpenReverse:()=>F&&J(!0),onCloseAll:async()=>{Y(!0);try{const Ie=await LX(e);await RX(Ie.closeAllPositions(),{loading:"Closing all positions...",success:"Closed all positions",error:Re=>`Close all failed: ${(Re==null?void 0:Re.message)||Re}`})}finally{Y(!1)}},busyCloseAll:he}),sortable:!1,align:"start",render:(Ie,Re)=>i.jsxs("div",{className:"w-full flex items-center gap-1",children:[i.jsx("button",{onClick:()=>{R(Re.id),X("limit"),L(!0)},className:"flex justify-center items-center h-5 px-2 rounded-md text-[11px] font-semibold text-[#0f151a] bg-[rgb(103,255,189)] -ml-2",children:"Limit"}),i.jsx("button",{onClick:async()=>{R(Re.id),X("market"),ie()?await ee({mode:"market",id:Re.id,coin:Re.coin,side:Re.type,size:Math.abs(Number(Re.size||0))}):L(!0)},className:"flex justify-center items-center h-5 px-2 rounded-md text-[11px] font-semibold text-[#0f151a] bg-[rgb(103,255,189)]",children:"Market"})]})},{key:"tpSl",label:"TP/SL",sortable:!1,render:(Ie,Re)=>{const Qe=s==null?void 0:s[Re.coin],Be=Qe&&(Qe.tp||Qe.sl),it=a instanceof Set?a.has(Re.coin):!1,tt=f[Re.id];return Be?i.jsxs("div",{className:"flex items-center justify-end gap-2 text-[#CFCFCF]",children:[i.jsxs("span",{className:"text-[#CFCFCF]",children:[Qe.tp?fo(Qe.tp,0):"--"," /"," ",Qe.sl?fo(Qe.sl,0):"--"]}),i.jsx("button",{onClick:()=>v(Re),className:"opacity-80 hover:opacity-100 bg-transparent p-0",children:"✎"})]}):it?i.jsx("div",{className:"flex items-center justify-end",children:i.jsx("button",{onClick:()=>window.dispatchEvent(new CustomEvent("terminal:setTab",{detail:{tab:"open"}})),className:"h-6 px-2 rounded-md text-[11px] font-semibold text-[#67ffbd] bg[rgba(103,255,189,0.16)] flex justify-center items-center",children:"View Orders"})}):tt&&(tt.tp||tt.sl)?i.jsxs("div",{className:"flex items-center justify-end gap-2 text-[#CFCFCF]",children:[i.jsxs("span",{className:"text-[#CFCFCF]",children:[tt.tp?fo(tt.tp,0):"--"," /"," ",tt.sl?fo(tt.sl,0):"--"]}),i.jsx("button",{onClick:()=>v(Re),className:"opacity-80 hover:opacity-100 bg-transparent",children:"✎"})]}):i.jsx("div",{className:"flex items-center justify-end gap-2 text-[#CFCFCF]",children:i.jsx("button",{onClick:()=>v(Re),className:"text-[#CFCFCF] underline underline-offset-4 decoration-dotted hover:text-white p-0 bg-transparent",children:"-- / -- ✎"})})}}],[F,n,f,s,a,e,he,ee]),fe=g?((ce=s==null?void 0:s[g.coin])==null?void 0:ce.tp)??((ye=f[g.id])==null?void 0:ye.tp)??null:null,Ae=g?((Ne=s==null?void 0:s[g.coin])==null?void 0:Ne.sl)??((be=f[g.id])==null?void 0:be.sl)??null:null;return i.jsxs(i.Fragment,{children:[i.jsx(Pu,{data:Gg(u,"positions",d),columns:ae,rowHeight:30,listHeight:t,tableClassName:"mt-2 font-inter",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:je=>`border-b border-[#1E1E1E] bg-transparent !rounded-none ${P===je.id?"bg-[#0d0d0d]":""}`,cellClassName:()=>"py-1 flex min-w-0 !text-[11px] font-normal",rowKey:je=>je.id,onRowClick:je=>R(je.id),emptyRenderer:()=>i.jsx("div",{className:"flex items-center justify-center h-[200px] text-[#9B9B9B] text-sm",children:"No open positions"})}),i.jsx(Tpn,{open:!!g,onClose:()=>v(null),row:g,initialTp:fe,initialSl:Ae,onSubmit:V}),i.jsx(_pn,{open:U&&!!F,onClose:()=>L(!1),row:F,initialTab:z,onConfirm:ee,busy:Z}),i.jsx(kpn,{open:ne&&!!F,onClose:()=>J(!1),row:F,onConfirm:je=>{J(!1),console.log("REVERSE CONFIRM",je)}}),i.jsx(hT,{open:w,setOpen:C,data:N,setTradeInfo:I})]})}async function SSe(e){const t=yT({getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:!0,vaultAddress:null});return GN({address:e,signer:t,dex:""})}function lre(e,t=2,n=!0){return Number(e||0).toLocaleString(void 0,{minimumFractionDigits:n?0:t,maximumFractionDigits:t})}function Fpn(e,t=2){return`${Number(e||0).toLocaleString(void 0,{minimumFractionDigits:t,maximumFractionDigits:t})} USDC`}function Opn(e){if(!e)return"--";const t=new Date(Number(e)),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear(),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),l=String(t.getSeconds()).padStart(2,"0");return`${n}/${r}/${s} - ${a}:${o}:${l}`}function Mpn(e){const t=e.side==="Buy"?"B":e.side==="Sell"?"A":e.side;return t==="B"?e.reduceOnly?"Close Short":"Open Long":t==="A"?e.reduceOnly?"Close Long":"Open Short":"-"}function Rpn({open:e,onClose:t,children:n,title:r}){return e?i.jsxs("div",{className:"fixed inset-0 z-[999] flex items-center justify-center",children:[i.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-[1px]",onClick:t}),i.jsxs("div",{className:"relative z-[1000] w-[760px] max-w-[95vw] rounded-2xl border border-[#262626] bg-[#141414] p-6 shadow-2xl",children:[i.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[i.jsx("div",{className:"text-white font-semibold",children:r}),i.jsx("button",{onClick:t,className:"rounded-md px-2 py-1 text-[#9B9B9B] hover:bg-[#1F1F1F] hover:text-white",children:"×"})]}),n]})]}):null}function Lpn(e){return typeof(e==null?void 0:e.type)=="string"&&e.type.toLowerCase()==="limit"}function Dpn(e){return typeof e=="string"&&e.toLowerCase().includes("stop")}function Bpn(e){return typeof e=="string"&&e.toLowerCase().includes("take profit")}function $pn(e){return e==="B"?"Long":"Short"}function Upn(e){return e==="B"?"Short":"Long"}function J7({k:e,v:t,strong:n}){return i.jsxs("div",{className:"flex items-center justify-between text-[13px] leading-5",children:[i.jsx("span",{className:"text-[#9B9B9B]",children:e}),i.jsx("span",{className:n?"text-white font-semibold":"text-white",children:t})]})}function nF({title:e,order:t,parentRawSide:n}){const r=!!t,s=r?t.side?$pn(t.side):Upn(n):"--",a=r&&typeof t.orderType=="string"&&t.orderType.toLowerCase()==="limit";return i.jsxs("div",{className:"rounded-xl border border-[#2a2a2a] bg-[#161616] px-4 py-3",children:[e?i.jsx("div",{className:"mb-2 text-[13px] text-[#9B9B9B]",children:e}):null,r?i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(J7,{k:"Order Type",v:t.orderType||"--"}),i.jsx(J7,{k:"Side",v:s}),i.jsx(J7,{k:"Amount",v:`${t.sz}`}),i.jsx(J7,{k:"Trigger",v:t.triggerCondition&&t.triggerCondition!=="N/A"?t.triggerCondition:"N/A"}),i.jsx(J7,{k:"Price",v:a?`$${lre(t.limitPx,3)}`:"Market"})]}):i.jsx("div",{className:"text-[#9B9B9B]",children:"—"})]})}function zpn({onBulkCancel:e,busy:t}){const[n,r]=m.useState(!1),s=m.useRef(null),[a,o]=m.useState({x:0,y:0});m.useEffect(()=>{var u;if(!n)return;const c=(u=s.current)==null?void 0:u.getBoundingClientRect();c&&o({x:c.left,y:c.bottom+6})},[n]),m.useEffect(()=>{if(!n)return;const c=()=>r(!1),u=d=>{s.current&&s.current.contains(d.target)||c()};return window.addEventListener("resize",c),window.addEventListener("scroll",c),document.addEventListener("pointerdown",u),()=>{window.removeEventListener("resize",c),window.removeEventListener("scroll",c),document.removeEventListener("pointerdown",u)}},[n]);const l=({label:c,val:u,showSpinner:d})=>i.jsx("div",{className:`px-2 py-1.5 rounded cursor-pointer ${t?"opacity-60 pointer-events-none":"hover:bg-white/5"}`,onClick:()=>{t||(e==null||e(u),r(!1))},children:i.jsxs("div",{className:"flex items-center",children:[i.jsx("span",{children:c}),d&&t?i.jsx("span",{className:"inline-flex ml-2 align-middle",children:i.jsx(Wy,{size:12,color:"#FFF"})}):null]})});return i.jsxs(i.Fragment,{children:[i.jsxs("button",{ref:s,className:"w-[120px] min-w-0 h-8 px-2 rounded-lg border border-[#2A2A2A] bg-[#161616] text-[#CFCFCF] text-xs flex items-center justify-between overflow-hidden",onClick:c=>{c.stopPropagation(),r(u=>!u)},title:"Cancel menu",children:[i.jsx("span",{className:"truncate",children:"Cancel"}),i.jsx("span",{className:"opacity-70 ml-2",children:"▾"})]}),n&&Ia.createPortal(i.jsx("div",{className:"fixed z-[99998] w-[260px] rounded-xl border border-[#2A2A2A] bg-[#0F0F0F] shadow-2xl p-3",style:{top:a.y,left:a.x},onPointerDown:c=>c.stopPropagation(),children:i.jsxs("div",{className:"mt-2 text-[13px] text-white/90",children:[i.jsx(l,{label:"Cancel All",val:"all",showSpinner:!0}),i.jsx(l,{label:"Cancel Limit",val:"limit"}),i.jsx(l,{label:"Cancel TP/SL",val:"tpsl"}),i.jsx(l,{label:"Cancel ReduceOnly",val:"reduceOnly"}),i.jsx(l,{label:"Cancel Non-Reduce",val:"nonReduce"})]})}),document.body)]})}function Hpn({walletAddress:e,listHeight:t=560,onCancelOrder:n,onBulkCancel:r}){const{rows:s,loading:a}=vue(e),[o,l]=m.useState(!1),[c,u]=m.useState(null),[d,f]=m.useState(null),[x,g]=m.useState(null),{key:v}=x2(),[w,C]=m.useState(new Set),[N,I]=m.useState(!1),P=V=>w.has(V),R=V=>C(ee=>new Set([...ee,V])),F=V=>C(ee=>{const ae=new Set(ee);return ae.delete(V),ae}),U=m.useCallback(async V=>{await(await SSe(e)).cancelOrder({symbol:V.coin,oid:V.oid})},[e]),L=m.useCallback(async V=>{await(await SSe(e)).cancelOrdersFiltered({filter:V})},[e]),z={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},X=V=>z[V]||V,ne=n??U,J=r??L,Z=m.useCallback(async V=>{const ee=V.oid;if(!P(ee)){R(ee);try{await on.promise(Promise.resolve(ne(V)),{loading:`Cancelling: ${V.coin} #${ee}...`,success:`Cancelled: ${V.coin} #${ee}`,error:ae=>`Cancel failed: ${V.coin} #${ee} • ${(ae==null?void 0:ae.message)||ae}`},{position:"bottom-right",style:{background:"#1e1e1e",color:"#fff",fontSize:12}})}finally{F(ee)}}},[ne,w]),re=V=>V==="all"?"All orders":V==="limit"?"Limit orders":V==="tpsl"?"TP/SL orders":V==="reduceOnly"?"ReduceOnly orders":V==="nonReduce"?"Non-Reduce orders":V,he=m.useCallback(async V=>{if(V){I(!0);try{await on.promise(Promise.resolve(J(V)),{loading:`Bulk cancelling: ${re(V)}...`,success:`Bulk cancelled: ${re(V)}`,error:ee=>`Bulk cancel failed: ${re(V)} • ${(ee==null?void 0:ee.message)||ee}`},{position:"bottom-right",style:{background:"#1e1e1e",color:"#fff",fontSize:12}})}finally{I(!1)}}},[J]),Y=m.useCallback(V=>{const ee=Array.isArray(V==null?void 0:V.children)?V.children:[],ae=ee.find(Ae=>Bpn(Ae.orderType))||null,fe=ee.find(Ae=>Dpn(Ae.orderType))||null;u({orderType:V.type,coin:V.coin,side:V.sideRaw,sz:V.size,limitPx:V.limitPx,triggerCondition:V.triggerCondition,timestamp:V.timestamp}),f(fe||ae||null),g(ae&&fe?ae:null),l(!0)},[]),ie=m.useMemo(()=>[{key:"timestamp",label:"Time",sortable:!0,width:"140px",sortValue:V=>V.timestamp,render:V=>i.jsx("span",{className:"text-white",children:Opn(V)})},{key:"type",label:"Type",sortable:!0,width:"120px",sortValue:V=>V.type||"",render:(V,ee)=>i.jsx("span",{className:"text-white",children:ee.type||"--"})},{key:"coin",label:"Coin",sortable:!0,sortValue:V=>V.coin||"",render:(V,ee)=>{const ae=(ee.side==="B",ee.reduceOnly?"text-[#FF797C]":"text-[#67FFBD]"),fe=nl(),Ae=()=>fe(`/terminal/hyperliquid/${ee.coin}`);return i.jsxs("div",{onPointerDown:Ae,className:"flex items-center font-medium cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${X(ee.coin)}.svg`,onError:ea,className:"w-5 h-5 mr-2",alt:ee.coin}),i.jsx("span",{className:ae,children:ee.coin.replace("xyz:","")||"--"})]})}},{key:"side",label:"Direction",sortable:!0,sortValue:V=>V.side==="B"?1:0,render:(V,ee)=>{const ae=Mpn(ee),fe=ee.side==="Sell";return i.jsx("span",{className:`h-5 px-1.5 py-1 rounded-md text-[11px] font-semibold flex justify-center items-center ${fe?"text-[#FF797C] bg-[#FF797C]/20":"text-[#67FFBD] bg-[#67FFBD]/20"}`,children:ae})}},{key:"size",label:"Size",sortable:!0,sortValue:V=>V.size,render:V=>i.jsx("span",{className:"text-white font-semibold",children:V})},{key:"originalSize",label:"Original Size",sortable:!0,sortValue:V=>Math.abs(V.originalSize),render:V=>i.jsx("span",{className:"text-white font-semibold",children:V})},{key:"orderValue",label:"Order value",sortable:!0,sortValue:V=>Math.abs(V.orderValue),render:V=>i.jsx("span",{className:"text-white font-semibold",children:Fpn(V,2)})},{key:"price",label:"Price",sortable:!0,sortValue:V=>V.limitPx,render:(V,ee)=>{if(ee.price==="Market")return i.jsx("span",{className:"text-white font-semibold",children:"Market"});const ae=typeof ee.pxDecimals=="number"?ee.pxDecimals:3;return i.jsx("span",{className:"text-white font-semibold",children:lre(ee.limitPx,ae)})}},{key:"reduceOnly",label:"Reduce",sortable:!0,sortValue:V=>V.reduceOnly?1:0,render:V=>i.jsx("span",{className:"text-white font-semibold",children:V?"Yes":"No"})},{key:"triggerCondition",label:"Trigger",sortable:!0,sortValue:V=>V.triggerPx||0,width:"140px",render:(V,ee)=>ee.triggerPx&&ee.triggerPx!=="N/A"?i.jsx("span",{className:"text-white font-semibold",children:ee.type==="Stop Market"?`Price Below ${ee.triggerPx}`:ee.type==="Take Profit Market"?`Price Above ${ee.triggerPx}`:ee.triggerPx}):i.jsx("span",{children:"N/A"})},{key:"tp_sl",label:"TP/SL",sortable:!1,render:(V,ee)=>{const ae=Array.isArray(ee.children)&&ee.children.length>0;return Lpn(ee)&&ae?i.jsx("button",{onClick:fe=>{fe.stopPropagation(),Y(ee)},className:"text-[#67FFBD] hover:opacity-80 underline underline-offset-4 p-0 -ml-2 w-full bg-transparent",children:i.jsx("span",{className:"flex justify-start",children:"View"})}):i.jsx("span",{className:"text-[#9B9B9B]",children:"--"})}},{key:"cancel",label:i.jsx(zpn,{onBulkCancel:he,busy:N}),sortable:!1,render:(V,ee)=>{const ae=P(ee.oid);return i.jsx("button",{onClick:fe=>{fe.stopPropagation(),ae||Z(ee)},disabled:ae,className:`h-6 w-6 flex items-center justify-center rounded-md border text-[#FF797C] transition-all duration-200 p-1 text-[11px] ${ae?"opacity-60 cursor-not-allowed border-red-500/30 bg-red-500/10":"border-[#2A2A2A] bg-red-500/20 hover:bg-red-500/30 border-red-500/50 hover:bg-[#2A0F12]"}`,title:ae?"Cancelling...":"Cancel order",children:ae?i.jsx(Wy,{size:12,color:"#FF797C"}):"×"})}}],[Y,Z,he,N,w]),oe=(d?1:0)+(x?1:0),G=c?`${c.coin} • TP/SL for Limit @ ${lre(c.limitPx,3)}`:"Take Profit / Stop Loss";return i.jsxs(i.Fragment,{children:[i.jsx(Pu,{data:Gg(s,"openOrders",v),loading:a,columns:ie,rowHeight:30,listHeight:t,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal",rowKey:V=>V.id,emptyState:i.jsx("div",{className:"px-3 py-6 text-[#9B9B9B]",children:"No open orders"})}),i.jsxs(Rpn,{open:o,onClose:()=>l(!1),title:G,children:[i.jsx("div",{className:"text-center text-[14px] text-[#9B9B9B] mb-4",children:oe===2?"If order A is filled, orders B and C will be placed":"If order A is filled, order B will be placed"}),i.jsxs("div",{className:"flex flex-col items-stretch gap-6",children:[i.jsxs("div",{className:"mx-auto",children:[i.jsx("div",{className:"text-center text-[#9B9B9B] mb-2",children:"Order A"}),i.jsx("div",{className:"w-[360px]",children:i.jsx(nF,{title:"",order:c,parentRawSide:c==null?void 0:c.side})})]}),i.jsx("div",{className:"relative mx-auto h-10 w-px bg-[#2a2a2a]"}),oe===2?i.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[i.jsx("div",{className:"text-center text-[#9B9B9B] mb-2",children:"If order B filled, cancel order C"}),i.jsx("div",{className:"text-center text-[#9B9B9B] mb-2",children:"If order C filled, cancel order B"}),i.jsx(nF,{title:"Order B",order:d,parentRawSide:c==null?void 0:c.side}),i.jsx(nF,{title:"Order C",order:x,parentRawSide:c==null?void 0:c.side})]}):i.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[i.jsx("div",{className:"text-center text-[#9B9B9B] mb-2",children:"Order B"}),i.jsx(nF,{title:"",order:d,parentRawSide:c==null?void 0:c.side})]})]})]})]})}async function Vpn(e){const t=yT({getPK:()=>typeof window<"u"?localStorage.getItem("hl_pk"):null,isMainnet:!0,vaultAddress:null});return GN({address:e,signer:t,dex:""})}const Wpn="wss://api.hyperliquid.xyz/ws",RHe="https://api.hyperliquid.xyz/info";function xv(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function ej(e,t=2){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function BX(e){if(!e)return"--";const t=new Date(Number(e)),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear(),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),l=String(t.getSeconds()).padStart(2,"0");return`${n}/${r}/${s} - ${a}:${o}:${l}`}function $X(e){return e?"Yes":"No"}function LHe(e,t){const n=Number(t||0);return n?Number(e||0)/n:null}const UX=new Map;function DHe(e){const t=(e==null?void 0:e.toLowerCase())||"";return t?(UX.has(t)||UX.set(t,{key:t,subs:new Set,ping:null,ws:null,connected:!1,booting:!1,activeRows:[],historyRows:[],fillRows:[],loadingActive:!0,loadingHistory:!0,loadingFills:!0,hydratedActive:!1}),UX.get(t)):null}function Y3(e){const t={activeRows:e.activeRows,historyRows:e.historyRows,fillRows:e.fillRows,loadingActive:e.loadingActive,loadingHistory:e.loadingHistory,loadingFills:e.loadingFills,hydratedActive:e.hydratedActive};e.subs.forEach(n=>n(t))}function jO(e){var t;try{(t=e.ws)==null||t.close()}catch{}e.ws=null,e.ping&&(clearInterval(e.ping),e.ping=null),e.connected=!1}function qpn(e){var s;const t=((s=e==null?void 0:e.data)==null?void 0:s.clearingHouseState)??(e==null?void 0:e.data)??e;if(!t||!Object.prototype.hasOwnProperty.call(t,"twapStates"))return{has:!1,pairs:[]};const n=t.twapStates;let r=[];return Array.isArray(n)&&(n.length===1&&Array.isArray(n[0])&&Array.isArray(n[0][0])?r=n[0]:n.length&&Array.isArray(n[0])?r=n:r=[]),{has:!0,pairs:r}}function BHe(e){if(e.booting||e.connected)return;e.booting=!0,jO(e);const t=new WebSocket(Wpn);e.ws=t,t.onopen=()=>{e.connected=!0,!e.hydratedActive&&e.activeRows.length===0&&(e.loadingActive=!0,Y3(e)),t.send(JSON.stringify({method:"subscribe",subscription:{type:"webData2",user:e.key}})),e.ping=setInterval(()=>{try{t.send(JSON.stringify({id:1,method:"ping"}))}catch{}},3e4)},t.onmessage=n=>{try{const r=JSON.parse(n.data);if((r==null?void 0:r.method)==="pong")return;const{has:s,pairs:a}=qpn(r);if(s){const o=[];for(const l of a){if(!Array.isArray(l)||l.length<2)continue;const[c,u]=l;if(!u||((u==null?void 0:u.user)||"").toLowerCase()!==e.key)continue;const d=LHe(u.executedNtl,u.executedSz);o.push({id:String(c),twapId:Number(c),coin:u.coin,sz:Number(u.sz||0),executedSz:Number(u.executedSz||0),avgPx:d,minutes:Number(u.minutes||0),reduceOnly:!!u.reduceOnly,randomize:!!u.randomize,timestamp:Number(u.timestamp||0),side:u.side,errors:"--"})}o.sort((l,c)=>c.timestamp-l.timestamp),e.activeRows=o,e.hydratedActive=!0,e.loadingActive=!1,Y3(e)}}catch{}},t.onclose=()=>{jO(e),setTimeout(()=>BHe(e),1500)},t.onerror=()=>{jO(e)},e.booting=!1}async function $He(e){try{e.loadingHistory=!0,Y3(e);const n=await(await fetch(RHe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"twapHistory",user:e.key})})).json(),s=(Array.isArray(n)?n:[]).map((a,o)=>{var u,d;const l=(a==null?void 0:a.state)||{},c=LHe(l.executedNtl,l.executedSz);return{id:`${a.time}-${o}`,time:Number(a.time)*1e3,coin:l.coin,totalSz:Number(l.sz||0),executedSz:Number(l.executedSz||0),avgPx:c,totalMinutes:Number(l.minutes||0),reduceOnly:!!l.reduceOnly,randomize:!!l.randomize,status:(((u=a==null?void 0:a.status)==null?void 0:u.status)||"").charAt(0).toUpperCase()+(((d=a==null?void 0:a.status)==null?void 0:d.status)||"").slice(1)}});s.sort((a,o)=>o.time-a.time),e.historyRows=s}catch{e.historyRows=[]}finally{e.loadingHistory=!1,Y3(e)}}function Gpn(e){const n=(Array.isArray(e)?e:[]).map(s=>{const a=(s==null?void 0:s.fill)||s,o=(s==null?void 0:s.twapId)??null;return{id:`${a==null?void 0:a.oid}-${a==null?void 0:a.time}`,coin:a==null?void 0:a.coin,dir:a==null?void 0:a.dir,px:Number((a==null?void 0:a.px)||0),sz:Number((a==null?void 0:a.sz)||0),fee:Number((a==null?void 0:a.fee)||0),closedPnl:Number((a==null?void 0:a.closedPnl)||0),oid:Number((a==null?void 0:a.oid)||0),time:Number((a==null?void 0:a.time)||0),twapId:o}}),r=new Map;return n.forEach(s=>{r.has(s.id)||r.set(s.id,s)}),[...r.values()].sort((s,a)=>a.time-s.time)}async function UHe(e){try{e.loadingFills=!0,Y3(e);const n=await(await fetch(RHe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"userTwapSliceFills",user:e.key})})).json();e.fillRows=Gpn(n||[])}catch{e.fillRows=[]}finally{e.loadingFills=!1,Y3(e)}}function Kpn(e){const t=(e==null?void 0:e.toLowerCase())||"",[n,r]=m.useState({activeRows:[],historyRows:[],fillRows:[],loadingActive:!0,loadingHistory:!0,loadingFills:!0,hydratedActive:!1});return m.useEffect(()=>{const s=DHe(t);if(!s){r({activeRows:[],historyRows:[],fillRows:[],loadingActive:!0,loadingHistory:!1,loadingFills:!1,hydratedActive:!1});return}const a=o=>r(o);return s.subs.add(a),r({activeRows:s.activeRows,historyRows:s.historyRows,fillRows:s.fillRows,loadingActive:s.loadingActive,loadingHistory:s.loadingHistory,loadingFills:s.loadingFills,hydratedActive:s.hydratedActive}),BHe(s),$He(s),UHe(s),()=>{s.subs.delete(a),s.subs.size===0&&jO(s)}},[t]),n}function Ypn(e){const t=Math.max(0,Math.floor(e/1e3)),n=String(Math.floor(t/3600)).padStart(2,"0"),r=String(Math.floor(t%3600/60)).padStart(2,"0"),s=String(t%60).padStart(2,"0");return`${n}:${r}:${s}`}function Xpn(e=1e3){const[t,n]=m.useState(Date.now());return m.useEffect(()=>{const r=setInterval(()=>n(Date.now()),e);return()=>clearInterval(r)},[e]),t}function EO(e=""){const t=e.toLowerCase();return t.includes("long")||t==="buy"}function _O(e=""){const t=e.toLowerCase();return t.includes("short")||t==="sell"}function Qpn(e=""){return EO(e)&&!_O(e)?3:EO(e)&&_O(e)?2:_O(e)&&!EO(e)?1:0}function Zpn({walletAddress:e}){const{activeRows:t,historyRows:n,fillRows:r,loadingActive:s,loadingHistory:a,loadingFills:o,hydratedActive:l}=Kpn(e),c=Xpn(1e3),u=m.useMemo(()=>t.map(re=>({...re,runtimeMs:Math.max(0,c-Number(re.timestamp||0))})),[t,c]),{key:d}=x2(),[f,x]=m.useState(new Set),g=re=>f.has(re),v=re=>x(he=>new Set([...he,re])),w=re=>x(he=>{const Y=new Set(he);return Y.delete(re),Y}),C=async re=>{const he=re.twapId??Number(re.id);if(!g(he)){v(he);try{const Y=await Vpn(e);await on.promise(Y.cancelTwapOrder({symbol:re.coin,twapId:he}),{loading:`Terminating: ${re.coin} #${he}...`,success:`Terminated: ${re.coin} #${he}`,error:oe=>`Terminate failed: ${re.coin} #${he} • ${(oe==null?void 0:oe.message)||oe}`},{position:"bottom-right",style:{background:"#1e1e1e",color:"#fff",fontSize:12}});const ie=DHe(e);if(ie){const oe=String(he);ie.activeRows=ie.activeRows.filter(G=>String(G.twapId??G.id)!==oe),ie.hydratedActive=!0,Y3(ie),$He(ie),UHe(ie)}}finally{w(he)}}},[N,I]=m.useState("active"),[P,R]=m.useState("active"),F=["active","history","fills"],U=F.indexOf(N)>F.indexOf(P)?"right":"left",L={enter:re=>({x:re==="right"?24:-24,opacity:0}),center:{x:0,opacity:1},exit:re=>({x:re==="right"?-24:24,opacity:0})};m.useEffect(()=>{const re=setInterval(()=>{},3e4);return()=>clearInterval(re)},[]);const z=(re,he,Y)=>re?i.jsxs("div",{className:"px-3 py-6 flex items-center gap-2 text-[#9B9B9B]",children:[i.jsx(Wy,{size:14,color:"#9B9B9B"}),i.jsx("span",{children:Y})]}):i.jsx("div",{className:"px-3 py-6 text-[#9B9B9B]",children:he}),X=m.useMemo(()=>[{key:"coin",label:"Coin",sortable:!0,sortValue:re=>re.coin||"",render:(re,he)=>{const Y=he.side==="A"||he.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]",ie=nl(),oe=()=>ie(`/terminal/hyperliquid/${he.coin}`);return i.jsxs("div",{onPointerDown:oe,className:"flex items-center font-medium cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${he.coin}.svg`,onError:ea,className:"w-5 h-5 mr-2",alt:he.coin}),i.jsx("span",{className:`font-bold ${Y}`,children:re||"--"})]})}},{key:"sz",label:"Size",sortable:!0,sortValue:re=>re.sz,render:(re,he)=>{const Y=he.side==="A"||he.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]";return i.jsxs("span",{className:Y,children:[xv(re)," ",he.coin]})}},{key:"executedSz",label:"Executed Size",sortable:!0,sortValue:re=>re.executedSz,render:(re,he)=>{const Y=he.side==="A"||he.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]";return re&&Number(re)!==0?i.jsxs("span",{className:Y,children:[xv(re)," ",he.coin]}):i.jsx("span",{className:"text-[#9B9B9B]",children:"--"})}},{key:"avgPx",label:"Average Price",sortable:!0,sortValue:re=>re.avgPx||0,render:re=>re?i.jsx("span",{className:"text-white font-semibold",children:ej(re,0)}):"--"},{key:"runtime",label:"Running Time / Total",sortable:!0,sortValue:re=>re.runtimeMs??0,render:(re,he)=>(Math.max(0,Math.floor((Date.now()-he.timestamp)/6e4)),i.jsxs("span",{className:"text-white font-semibold",children:[Ypn(he.runtimeMs??0)," / ",he.minutes," minutes"]}))},{key:"reduceOnly",label:"Reduce",sortable:!0,sortValue:re=>re.reduceOnly?1:0,render:re=>i.jsx("span",{className:"text-white font-semibold",children:$X(re)})},{key:"timestamp",label:"Creation Time",sortable:!0,sortValue:re=>re.timestamp,render:re=>i.jsx("span",{className:"text-white font-semibold",children:BX(re)})},{key:"errors",label:"Errors",sortable:!1,render:re=>i.jsx("span",{className:"text-[#9B9B9B] font-semibold",children:re||"--"})},{key:"terminate",label:"Terminate",sortable:!1,render:(re,he)=>{const Y=he.twapId??Number(he.id),ie=g(Y);return i.jsx("button",{onClick:oe=>{oe.stopPropagation(),ie||C(he)},disabled:ie,className:`h-6 w-6 flex items-center justify-center rounded-md border text-[#FF797C]
              transition-colors duration-150 p-1 text-[11px]
              border-red-500/50 mb-[1px] ${ie?"opacity-60 cursor-not-allowed bg-red-500/10":"bg-red-500/20"}`,title:ie?"Terminating...":"Terminate",children:ie?i.jsx(Wy,{size:12,color:"#FF797C"}):"×"})}}],[f,e]),ne=m.useMemo(()=>[{key:"time",label:"Time",sortable:!0,sortValue:re=>re.time,render:re=>i.jsx("span",{className:"text-white font-semibold",children:BX(re)})},{key:"coin",label:"Coin",sortable:!0,sortValue:re=>re.coin||"",render:(re,he)=>{const Y=he.side==="A"||he.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]",ie=nl(),oe=()=>ie(`/terminal/hyperliquid/${he.coin}`);return i.jsxs("div",{onPointerDown:oe,className:"flex items-center font-medium cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${he.coin}.svg`,onError:ea,className:"w-5 h-5 mr-2",alt:he.coin}),i.jsx("span",{className:`font-bold ${Y}`,children:re||"--"})]})}},{key:"totalSz",label:"Total Size",sortable:!0,sortValue:re=>re.totalSz,render:(re,he)=>i.jsxs("span",{className:he.side==="A"||he.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]",children:[xv(re)," ",he.coin]})},{key:"executedSz",label:"Executed Size",sortable:!0,sortValue:re=>re.executedSz,render:(re,he)=>i.jsxs("span",{className:he.side==="A"||he.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]",children:[xv(re)," ",he.coin]})},{key:"avgPx",label:"Average Price",sortable:!0,sortValue:re=>re.avgPx||0,render:re=>re?i.jsx("span",{className:"text-white font-semibold",children:ej(re,0)}):"--"},{key:"totalMinutes",label:"Total Runtime",sortable:!0,sortValue:re=>re.totalMinutes,render:re=>i.jsxs("span",{className:"text-white font-semibold",children:[xv(re,0)," minutes"]})},{key:"reduceOnly",label:"Reduce",sortable:!0,sortValue:re=>re.reduceOnly?1:0,render:re=>i.jsx("span",{className:"text-white font-semibold",children:$X(re)})},{key:"randomize",label:"Randomize",sortable:!0,sortValue:re=>re.randomize?1:0,render:re=>i.jsx("span",{className:"text-white font-semibold",children:$X(re)})},{key:"status",label:"Status",sortable:!0,sortValue:re=>re.status||"",render:re=>i.jsx("span",{className:"text-white font-semibold",children:re||"--"})}],[]),J=m.useMemo(()=>[{key:"time",label:"Time",sortable:!0,sortValue:re=>re.time,render:(re,he)=>i.jsx("span",{className:"text-white font-semibold",children:BX(he.time)})},{key:"coin",label:"Coin",sortable:!0,sortValue:re=>re.coin||"",render:(re,he)=>{const Y=he.side==="A"||he.side==="Buy"?"text-[#FF797C]":"text-[#67FFBD]",ie=nl(),oe=()=>ie(`/terminal/hyperliquid/${he.coin}`);return i.jsxs("div",{onPointerDown:oe,className:"flex items-center font-medium cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${he.coin}.svg`,onError:ea,className:"w-5 h-5 mr-2",alt:he.coin}),i.jsx("span",{className:`font-bold ${Y}`,children:re||"--"})]})}},{key:"dir",label:"Direction",sortable:!0,sortValue:re=>Qpn(re.dir),render:re=>i.jsx("span",{className:`${_O(re)?"text-[#FF6B6B]":EO(re)?"text-[#67FFBD]":"text-white"}`,children:re||"--"})},{key:"px",label:"Price",sortable:!0,sortValue:re=>re.px,render:re=>re!=null?i.jsxs("span",{className:"text-white font-semibold",children:["$",ej(re,0)]}):"--"},{key:"sz",label:"Size",sortable:!0,sortValue:re=>re.sz,render:re=>i.jsx("span",{className:"text-white font-semibold",children:xv(re)})},{key:"tradeValue",label:"Trade Value",sortable:!0,sortValue:re=>re.px*re.sz,render:(re,he)=>he.px&&he.sz?i.jsxs("span",{className:"text-white font-semibold",children:["$",ej(he.px*he.sz)]}):"--"},{key:"fee",label:"Fee",sortable:!0,sortValue:re=>re.fee,render:re=>i.jsx("span",{className:"text-white font-semibold",children:xv(re)})},{key:"closedPnl",label:"Closed PnL",sortable:!0,sortValue:re=>re.closedPnl-re.fee,render:(re,he)=>{const Y=Number(he.closedPnl||0)-Number(he.fee||0),ie=Y>0,oe=Y<0;return i.jsxs("span",{className:`${ie?"text-[#67FFBD] font-semibold":oe?"text-[#FF797C] font-semibold":"text-white font-semibold"}`,children:["$",ej(Math.abs(Y))]})}},{key:"oid",label:"Order ID",sortable:!0,sortValue:re=>re.oid,render:re=>i.jsx("span",{className:"text-[#979797] font-semibold",children:re||"--"})}],[]),Z=i.jsx("div",{className:"px-3",children:i.jsx("div",{className:"relative flex gap-2 overflow-x-auto whitespace-nowrap py-2",children:[{k:"active",t:"Active"},{k:"history",t:"History"},{k:"fills",t:"Fill History"}].map(re=>{const he=N===re.k;return i.jsxs("button",{onClick:()=>{R(N),I(re.k)},className:`relative cursor-pointer font-inter text-[12px] leading-[15px] px-4 py-[6px] flex items-center justify-center gap-[10px] rounded-lg bg-transparent ${he?"text-white":"text-[#929292] hover:text-white"}`,children:[he&&i.jsx(go.span,{layoutId:"twap-pill",className:"absolute inset-0 rounded-lg bg-[#262626]",transition:{type:"spring",stiffness:380,damping:30}}),i.jsx("span",{className:"relative z-10",children:re.t})]},re.k)})})});return i.jsxs("div",{className:"flex flex-col h-full",children:[Z,i.jsx("div",{className:"flex-1 min-h-0 relative",children:i.jsx(mT,{mode:"wait",custom:U,children:i.jsx(go.div,{custom:U,variants:L,initial:"enter",animate:"center",exit:"exit",transition:{type:"spring",stiffness:320,damping:28},className:"absolute inset-0",children:N==="active"?i.jsx(Pu,{data:Gg(u,"twap",d),loading:s||!l,columns:X,rowHeight:28,listHeight:560,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[12px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal",rowKey:re=>re.id,emptyState:z(s||!l,"No Active TWAP","Loading Active TWAP…")}):N==="history"?i.jsx(Pu,{data:Gg(n,"twap",d),loading:a,columns:ne,rowHeight:28,listHeight:560,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[12px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal",rowKey:re=>re.id,emptyState:z(a,"No TWAP History","Loading TWAP History…")}):i.jsx(Pu,{data:Gg(r,"twap",d),loading:o,columns:J,rowHeight:28,listHeight:560,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[12px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal",rowKey:re=>re.id,emptyState:z(o,"No TWAP fills available","Loading TWAP fills…")})},N)})})]})}const Jpn="wss://api.hyperliquid.xyz/ws",emn="https://api-ui.hyperliquid.xyz/info",tmn={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},nmn=e=>tmn[e]||e;function rmn(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function tj(e,t=2){return`$${Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}`}function cre(e){return e==="Open Long"||e==="Close Short"||e==="Short > Long"}function ure(e){return e==="Open Short"||e==="Close Long"||e==="Long > Short"}function smn(e){return cre(e)?1:ure(e)?0:-1}function imn(e){const t=Date.now(),n=Math.max(0,t-Number(e||0)),r=Math.floor(n/1e3);if(r<60)return`${r}s ago`;const s=Math.floor(r/60);if(s<60)return`${s}m ago`;const a=Math.floor(s/60);return a<24?`${a}h ${s%60}m ago`:`${Math.floor(a/24)}d ${a%24}h ago`}function amn(e){if(!e)return"--";const t=new Date(Number(e)),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear(),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),l=String(t.getSeconds()).padStart(2,"0");return`${n}/${r}/${s} - ${a}:${o}:${l}`}const zX=new Map;function omn(e,t=!0){const n=(e==null?void 0:e.toLowerCase())||"";if(!n)return null;zX.has(n)||zX.set(n,{key:n,rows:[],loading:!0,ws:null,ping:null,subs:new Set,booting:!1,connected:!1,hydrated:!1,aggregateByTime:t});const r=zX.get(n);return r.aggregateByTime=t,r}function dre(e){e.subs.forEach(t=>t({rows:e.rows,loading:e.loading}))}function kO(e){var t;try{(t=e.ws)==null||t.close()}catch{}e.ws=null,e.ping&&(clearInterval(e.ping),e.ping=null),e.connected=!1}function zHe(e){const n=(Array.isArray(e)?e:[]).map(s=>({id:`${(s==null?void 0:s.hash)||""}`,oid:s==null?void 0:s.oid,coin:s==null?void 0:s.coin,dir:(s==null?void 0:s.dir)||((s==null?void 0:s.side)==="B"?"Buy":(s==null?void 0:s.side)==="S"?"Sell":""),px:Number((s==null?void 0:s.px)||0),sz:Number((s==null?void 0:s.sz)||0),fee:Number((s==null?void 0:s.fee)||0),feeToken:(s==null?void 0:s.feeToken)||"USDC",closedPnl:Number((s==null?void 0:s.closedPnl)||0),time:Number((s==null?void 0:s.time)||0)})),r=new Map;return n.forEach(s=>{s.id&&!r.has(s.id)&&r.set(s.id,s)}),[...r.values()].sort((s,a)=>a.time-s.time)}async function lmn(e){try{e.loading=!0,dre(e);const n=await(await fetch(emn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({aggregateByTime:!!e.aggregateByTime,type:"userFills",user:e.key})})).json();e.rows=zHe(n||[]),e.hydrated=!0}catch{e.rows=[]}finally{e.loading=!1,dre(e)}}function NSe(e,t){const n=(t==null?void 0:t.fills)||t||[];if(!Array.isArray(n)||!n.length)return;const r=zHe(n),s=[...e.rows],a=new Set(s.map(o=>o.id));r.forEach(o=>{a.has(o.id)||(s.unshift(o),a.add(o.id))}),s.sort((o,l)=>l.time-o.time),e.rows=s,dre(e)}async function HHe(e){if(e.booting||e.connected)return;e.booting=!0,kO(e);const t=new WebSocket(Jpn);e.ws=t,t.onopen=()=>{e.connected=!0,t.send(JSON.stringify({method:"subscribe",subscription:{aggregateByTime:!!e.aggregateByTime,type:"userFills",user:e.key}})),e.ping=setInterval(()=>{try{t.send(JSON.stringify({id:99,method:"ping"}))}catch{}},3e4)},t.onmessage=n=>{var r,s;try{const a=JSON.parse(n.data);if((a==null?void 0:a.method)==="pong"||(a==null?void 0:a.result)==="success")return;(a==null?void 0:a.channel)==="userFills"&&NSe(e,a==null?void 0:a.data),(a==null?void 0:a.channel)==="user"&&((r=a==null?void 0:a.data)!=null&&r.fills)&&NSe(e,(s=a==null?void 0:a.data)==null?void 0:s.fills)}catch{}},t.onclose=()=>{kO(e),setTimeout(()=>HHe(e),1500)},t.onerror=()=>{kO(e)},e.booting=!1}function cmn(e,t){const n=(e==null?void 0:e.toLowerCase())||"",[r,s]=m.useState({rows:[],loading:!0});return m.useEffect(()=>{const a=omn(n,t);if(!a){s({rows:[],loading:!1});return}const o=l=>s(l);return a.subs.add(o),s({rows:a.rows,loading:a.loading}),lmn(a),HHe(a),()=>{a.subs.delete(o),a.subs.size===0&&kO(a)}},[n,t]),r}function umn({walletAddress:e,listHeight:t=560}){const[n,r]=m.useState(()=>typeof window>"u"?!0:window.localStorage.getItem("tradeHistoryAggregate")!=="false");m.useEffect(()=>{typeof window<"u"&&window.localStorage.setItem("tradeHistoryAggregate",n?"true":"false")},[n]);const{rows:s,loading:a}=cmn(e,n),[o,l]=m.useState(typeof window<"u"&&localStorage.getItem("isDateTradeHistoryFormat")||"date"),c=m.useRef(o);m.useEffect(()=>{typeof window<"u"&&localStorage.setItem("isDateTradeHistoryFormat",o),c.current=o},[o]);const{key:u}=x2(),{isReferralCodeName:d}=m.useContext(Gr),[f,x]=m.useState(!1),[g,v]=m.useState({coin:"",type:"",leverage:0,roe:0,entryPrice:0,markPrice:0,referral:"",positionDistribution:0,pnl:0,closePx:0}),[w,C]=m.useState(()=>new Map),N=m.useCallback(async R=>{const F=typeof window<"u"?window.localStorage.getItem("hyperAddress"):null,U=typeof window<"u"?window.localStorage.getItem("hyperToken"):null;if(!F||!U||!R||R.length===0)return null;try{const{data:L}=await ls.post("https://dextrabothypev2.nftinit.io/api/hyper/order/get_leverage_with_oids/",{address:F,token:U,position_oids:R},{headers:{"Content-Type":"application/json"}});if(L&&L.success){const z=parseFloat(L.leverage);return C(X=>{const ne=new Map(X);return R.forEach(J=>ne.set(String(J),z)),ne}),z}}catch(L){console.error("leverage fetch error:",L)}return null},[]);m.useEffect(()=>{if(f&&!g.referral){const R=d||typeof window<"u"&&window.localStorage.getItem("refcode")||"";R&&v(F=>({...F,referral:R}))}},[f,d,g.referral]);const I=m.useMemo(()=>[{key:"time",label:"Time",sortable:!0,sortValue:R=>R.time,render:(R,F)=>i.jsx("button",{onClick:()=>l(U=>U==="date"?"relative":"date"),className:"text-left text-white bg-transparent font-semibold",children:c.current==="date"?amn(F.time):imn(F.time)})},{key:"coin",label:"Coin",sortable:!0,sortValue:R=>R.coin||"",render:(R,F)=>{const U=nl(),L=()=>U(`/terminal/hyperliquid/${F.coin}`);return i.jsxs("div",{onPointerDown:L,className:"flex items-center text-white font-medium cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${nmn(F.coin)}.svg`,onError:ea,className:"w-5 h-5 mr-2",alt:F.coin}),i.jsx("span",{className:`font-bold ${ure(F.dir)?"text-[#FF6B6B]":cre(F.dir)?"text-[#67FFBD]":"text-white"}`,children:R||"--"})]})}},{key:"dir",label:"Direction",sortable:!0,sortValue:R=>smn(R.dir),render:R=>i.jsx("span",{className:`font-semibold ${ure(R)?"text-[#FF6B6B]":cre(R)?"text-[#67FFBD]":"text-white"}`,children:R||"--"})},{key:"px",label:"Price",sortable:!0,sortValue:R=>R.px,render:R=>i.jsx("span",{className:"text-white font-semibold",children:tj(R)})},{key:"sz",label:"Size",sortable:!0,sortValue:R=>R.sz,render:(R,F)=>i.jsxs("span",{className:"text-white font-semibold",children:[rmn(R)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:F.coin})]})},{key:"tradeValue",label:"Trade Value",sortable:!0,sortValue:R=>R.px*R.sz,render:(R,F)=>i.jsxs("span",{className:"text-white font-semibold",children:[tj(F.px*F.sz)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:"USDC"})]})},{key:"fee",label:"Fee",sortable:!0,sortValue:R=>R.fee,render:(R,F)=>i.jsxs("span",{className:"text-white font-semibold",children:[tj(R)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:F.feeToken||"USDC"})]})},{key:"netPnl",label:"Closed PnL",sortable:!0,sortValue:R=>R.closedPnl-R.fee,render:(R,F)=>{const U=Number(F.closedPnl||0),L=Number(F.fee||0),z=U-L,X=z>0,ne=z<0,J=!!U,Z=Number(F.px||0)*Number(F.sz||0),re=Z>0?z/Z*100:0;return i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsxs("span",{className:`${X?"text-[#67FFBD] font-semibold":ne?"text-[#FF797C] font-semibold":"text-white font-semibold"}`,children:[z===0?tj(0):`${z<0?"-":""}${tj(Math.abs(z))}`," ",i.jsx("span",{className:"text-[#9B9B9B]",children:"USDC"})]}),J&&i.jsx("button",{onClick:async()=>{const he=d||typeof window<"u"&&window.localStorage.getItem("refcode")||"";let Y=0;const ie=F.oid;if(ie){const oe=w.get(String(ie));if(oe!=null)Y=oe;else{const G=await N([ie]);typeof G=="number"&&!Number.isNaN(G)&&(Y=G)}}v({coin:F.coin||"",type:(F.dir||"").toUpperCase(),leverage:Y,roe:re,entryPrice:Number(F.px||0),markPrice:Number(F.px||0),referral:he,positionDistribution:0,pnl:Number(z||0),closePx:Number(F.px||0)}),x(!0)},className:"flex items-center h-6 text-[#67FFBD] text-[11px] font-semibold bg-transparent p-0",title:"Share",children:i.jsx("img",{src:cm,alt:"",className:"w-[14px] h-[14px] min-w-[14px] min-h-[14px]"})})]})}}],[o,d,N,w]),P=m.useMemo(()=>Gg(s,"trades",u),[s,u]);return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex items-center justify-end mt-2 px-1 mr-5",children:i.jsxs("label",{className:"flex items-center gap-2 text-[11px] text-[#9B9B9B]",children:[i.jsx("span",{children:"Aggregate"}),i.jsx("input",{type:"checkbox",checked:n,onChange:R=>r(R.target.checked),className:"w-3 h-3 accent-[#67FFBD]"})]})}),i.jsx(Pu,{data:P,loading:a,columns:I,rowHeight:30,listHeight:t,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal",rowKey:R=>R.id,emptyState:i.jsx("div",{className:"px-3 py-6 text-[#9B9B9B]",children:"No trades"})}),i.jsx(hT,{open:f,setOpen:x,data:g,setTradeInfo:v,pnlTitle:""})]})}const dmn="https://api.hyperliquid.xyz/info";function fmn(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function ASe(e,t=4){return`$${Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}`}function hmn(e){return`${(Number(e||0)*100).toLocaleString(void 0,{maximumFractionDigits:6})}%`}function pmn(e){const t=Date.now(),n=Math.max(0,t-Number(e||0)),r=Math.floor(n/1e3);if(r<60)return`${r}s ago`;const s=Math.floor(r/60);if(s<60)return`${s}m ago`;const a=Math.floor(s/60);return a<24?`${a}h ${s%60}m ago`:`${Math.floor(a/24)}d ${a%24}h ago`}function mmn(e){if(!e)return"--";const t=new Date(Number(e)),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear(),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),l=String(t.getSeconds()).padStart(2,"0");return`${n}/${r}/${s} - ${a}:${o}:${l}`}function xmn({walletAddress:e,listHeight:t=560,days:n=30}){const[r,s]=m.useState([]),[a,o]=m.useState(!0),[l,c]=m.useState(typeof window<"u"&&localStorage.getItem("isDateFundingHistoryFormat")||"date"),{key:u}=x2(),d=m.useRef(l);m.useEffect(()=>{typeof window<"u"&&localStorage.setItem("isDateFundingHistoryFormat",l),d.current=l},[l]),m.useEffect(()=>{let x=!0;async function g(){if(!e){x&&(s([]),o(!1));return}try{o(!0);const v=Date.now()-n*24*60*60*1e3,C=await(await fetch(dmn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"userFunding",user:e,startTime:v})})).json(),I=(Array.isArray(C)?C:Array.isArray(C==null?void 0:C.data)?C.data:[]).map((P,R)=>{const F=(P==null?void 0:P.delta)||{},U=Number((F==null?void 0:F.szi)||0),L=Number((F==null?void 0:F.fundingRate)||0),z=Number((F==null?void 0:F.usdc)||0);let X=U>0?"Long":U<0?"Short":null;return!X&&L!==0&&z!==0&&(X=L>0?z<0?"Long":"Short":z<0?"Short":"Long"),X||(X="Flat"),{id:`${P.time||R}-${F.coin||""}-${R}`,time:Number((P==null?void 0:P.time)||0),coin:(F==null?void 0:F.coin)||"",rate:Number((F==null?void 0:F.fundingRate)||0),size:U,amount:z,token:"USDC",side:X}}).sort((P,R)=>R.time-P.time);x&&s(I)}catch{x&&s([])}finally{x&&o(!1)}}return g(),()=>{x=!1}},[e,n]);const f=m.useMemo(()=>[{key:"time",label:"Time",sortable:!0,sortValue:x=>x.time,render:(x,g)=>i.jsx("button",{onClick:()=>c(v=>v==="date"?"relative":"date"),className:"text-left text-white bg-transparent font-semibold",children:d.current==="date"?mmn(g.time):pmn(g.time)})},{key:"coin",label:"Coin",sortable:!0,sortValue:x=>x.coin||"",render:(x,g)=>{const v=g.side==="Long"?"text-[#67FFBD]":g.side==="Short"?"text-[#FF6B6B]":"text-white",w=nl(),C=()=>w(`/terminal/hyperliquid/${g.coin}`);return i.jsxs("div",{onPointerDown:C,className:`flex items-center font-medium cursor-pointer hover:opacity-80 ${v}`,children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${g.coin}.svg`,onError:ea,className:"w-5 h-5 mr-2",alt:g.coin}),i.jsx("span",{children:x||"--"})]})}},{key:"size",label:"Size",sortable:!0,sortValue:x=>x.size,render:(x,g)=>i.jsxs("span",{className:"text-white font-semibold",children:[fmn(x)," ",i.jsx("span",{className:"text-[#9B9B9B]",children:g.coin})]})},{key:"side",label:"Position Side",sortable:!0,sortValue:x=>x.side,render:x=>{const g=x==="Long"?"text-[#67ffbd] bg-[#67ffbd]/20":x==="Short"?"text-[#ff797c] bg-[#ff797c]/20":"text-[#9B9B9B] bg-[#9B9B9B]/10";return i.jsx("span",{className:`flex justify-center items-center h-5 px-2 py-1 rounded-md text-[11px] font-semibold uppercase ${g}`,children:x})}},{key:"amount",label:"Payment",sortable:!0,sortValue:x=>x.amount,render:x=>{const g=x>0?"text-[#67FFBD]":x<0?"text-[#FF6B6B]":"text-white";return i.jsx("span",{className:g,children:x===0?ASe(0):`${x<0?"-":""}${ASe(Math.abs(x))}`})}},{key:"rate",label:"Rate",sortable:!0,sortValue:x=>x.rate,render:x=>i.jsx("span",{className:"text-white font-semibold",children:hmn(x)})}],[]);return i.jsx(Pu,{data:Gg(r,"funding",u),loading:a,columns:f,rowHeight:30,listHeight:t,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal",rowKey:x=>x.id,emptyState:i.jsx("div",{className:"px-3 py-6 text-[#9B9B9B]",children:"No funding records"})})}function rF(e,t=6){return Number(e||0).toLocaleString(void 0,{maximumFractionDigits:t})}function gmn(e){if(!e)return"--";const t=new Date(Number(e)),n=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear(),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),l=String(t.getSeconds()).padStart(2,"0");return`${n}/${r}/${s} - ${a}:${o}:${l}`}function bmn(e){return e.side==="B"?e.reduceOnly?"Close Short":"Open Long":e.side==="A"?e.reduceOnly?"Close Long":"Open Short":e.side||"-"}function fre(e){return e==="Open Long"||e==="Close Short"||e==="Short > Long"}function hre(e){return e==="Open Short"||e==="Close Long"||e==="Long > Short"}function ymn(e){return fre(e)?1:hre(e)?0:-1}function vmn({walletAddress:e,listHeight:t=560}){const[n,r]=m.useState([]),[s,a]=m.useState(!1),{key:o}=x2();m.useEffect(()=>{let c=!0;async function u(){if(!e){c&&r([]);return}try{a(!0);const x=(await(await fetch("https://api.hyperliquid.xyz/info",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"historicalOrders",user:e})})).json()||[]).map(g=>{var C;const v=g.order||{},w=Math.max(0,Number(v.origSz||0)-Number(v.sz||0));return{id:`${v.oid}-${g.status}`,time:Number(g.statusTimestamp||v.timestamp||0),type:v.orderType||"-",coin:v.coin||"-",sideText:bmn(v),size:Number(v.sz||0),filled:w,orderValue:(C=v.orderType)!=null&&C.toLowerCase().includes("market")?"Market":`${(Number(v.limitPx)/1e3).toFixed(2)} USDC`,priceLabel:v.orderType==="Market"?"Market":`${rF(Number(v.limitPx||0),2)} USD`,reduceOnly:!!v.reduceOnly,trigger:v.triggerCondition&&v.triggerCondition!=="N/A"?`${v.triggerCondition} @ ${rF(Number(v.triggerPx||0),4)}`:"N/A",status:g.status?g.status[0].toUpperCase()+g.status.slice(1):"-",orderId:v.oid}});x.sort((g,v)=>v.time-g.time),c&&r(x)}catch{c&&r([])}finally{c&&a(!1)}}return u(),()=>{c=!1}},[e]);const l=m.useMemo(()=>[{key:"time",label:"Time",width:"140px",sortable:!0,sortValue:c=>c.time,render:c=>i.jsx("span",{className:"text-white font-semibold",children:gmn(c)})},{key:"type",label:"Type",sortable:!0,sortValue:c=>c.type||"",render:c=>i.jsx("span",{className:"text-white font-semibold",children:c})},{key:"coin",label:"Coin",sortable:!0,sortValue:c=>c.coin||"",render:(c,u)=>{const d=nl(),f=()=>d(`/terminal/hyperliquid/${u.coin}`);return i.jsxs("div",{onPointerDown:f,className:"flex items-center font-medium cursor-pointer hover:opacity-80",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${u.coin}.svg`,onError:ea,className:"w-5 h-5 mr-2",alt:u.coin}),i.jsx("span",{className:`font-bold ${hre(u.sideText)?"text-[#FF6B6B]":fre(u.sideText)?"text-[#67FFBD]":"text-white"}`,children:c})]})}},{key:"sideText",label:"Side",sortable:!0,sortValue:c=>ymn(c.sideText),render:c=>i.jsx("span",{className:`font-semibold ${hre(c)?"text-[#FF6B6B]":fre(c)?"text-[#67FFBD]":"text-white"}`,children:c})},{key:"size",label:"Size",sortable:!0,sortValue:c=>c.size,render:c=>Number(c)>0?i.jsx("span",{className:"text-white font-semibold",children:rF(c)}):i.jsx("span",{className:"text-white font-semibold",children:"--"})},{key:"filled",label:"Filled",sortable:!0,sortValue:c=>c.filled,render:c=>Number(c)>0?i.jsx("span",{className:"text-white font-semibold",children:rF(c)}):i.jsx("span",{className:"text-white font-semibold",children:"--"})},{key:"orderValue",label:"Order Value",sortable:!0,sortValue:c=>c.orderValue,render:c=>i.jsx("span",{className:"text-white font-semibold",children:c})},{key:"priceLabel",label:"Price",sortable:!0,sortValue:c=>c.priceLabel==="Market"?-1:Number(String(c.priceLabel).replace(/[^0-9.]/g,"")),render:c=>i.jsx("span",{className:"text-white font-semibold",children:c})},{key:"reduceOnly",label:"Reduce",sortable:!0,sortValue:c=>c.reduceOnly?1:0,render:c=>i.jsx("span",{className:"text-whitefont-semibold",children:c?"✓":"–"})},{key:"trigger",label:"Trigger",sortable:!0,sortValue:c=>c.trigger||"",render:c=>i.jsx("span",{className:"text-white font-semibold",children:c||"N/A"})},{key:"status",label:"Status",sortable:!0,sortValue:c=>c.status||"",render:c=>i.jsx("span",{className:"text-white font-semibold",children:c})},{key:"orderId",label:"Order ID",sortable:!0,sortValue:c=>c.trigger||"",render:c=>i.jsx("span",{className:"text-white font-semibold",children:c})}],[]);return i.jsx(Pu,{data:Gg(n,"orderHistory",o),columns:l,loading:s,skeletonRowCount:12,rowHeight:30,listHeight:t,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent !rounded-none",cellClassName:()=>"py-1 flex !text-[11px] font-normal",rowKey:c=>c.id})}const wmn="https://dextrabothypev2.nftinit.io/api/hyper/gridbot/list/",Cmn="https://dextrabothypev2.nftinit.io/api/hyper/gridbot/update/",Smn="https://dextrabothypev2.nftinit.io/api/hyper/gridbot/update/",Nmn="https://dextrabothypev2.nftinit.io/api/hyper/extended_bot/update/";function jSe(e,t=4){const n=Number(e||0);return Number.isFinite(n)?n.toLocaleString(void 0,{maximumFractionDigits:t}):"--"}function Amn(e,t=2){const n=Number(e||0);return Number.isFinite(n)?`$${n.toLocaleString(void 0,{maximumFractionDigits:t})}`:"--"}const jmn={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"},nj=e=>{if(typeof e=="string"){const t=e.match(/^([A-Za-z]+:)(.*)$/);if(t){const n=t[1].toLowerCase(),r=t[2];return n+r}}return jmn[e]||e},Emn=e=>e&&e.length>10?`${e.slice(0,6)}...${e.slice(-4)}`:e||"--";function TO({walletAddress:e,sourceMarket:t="hyper"}){var U,L;const{botSlotsInfo:n,refreshBotSlots:r}=m.useContext(Gr)||{},[s,a]=m.useState([]),[o,l]=m.useState(!1),[c,u]=m.useState(null),[d,f]=m.useState(0),[x,g]=m.useState(null),v=nl();m.useEffect(()=>{let z=!0;async function X(){if(typeof window>"u")return;const ne=window.localStorage.getItem("hyperAddress"),J=window.localStorage.getItem("hyperToken");if(!ne||!J){z&&(a([]),l(!1));return}try{l(!0);const re=await(await fetch(wmn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:ne,token:J})})).json(),Y=(Array.isArray(re==null?void 0:re.data)?re.data:Array.isArray(re)?re:[]).filter(ie=>t?ie.source_market===t:!0);z&&a(Y)}catch{z&&(a([]),on.error("Failed to load bots"))}finally{z&&l(!1)}}return X(),()=>{z=!1}},[e,t,d]),m.useEffect(()=>{const z=X=>{const ne=X&&X.detail&&X.detail.sourceMarket;ne&&ne!==t||f(J=>J+1)};return window.addEventListener("gridbotUpdated",z),()=>{window.removeEventListener("gridbotUpdated",z)}},[t]);const w=m.useMemo(()=>{const z=s.map(X=>{const ne=X.bot_params||{},J=ne.investment||{},Z=ne.priceRange||{},re=ne.liquidationPrices||{},he=ne.direction==="long"?"Long":ne.direction==="short"?"Short":"--";return{id:X.id,coin:X.coin||ne.symbol||"--",market:X.source_market||"",status:X.is_deleted?"Stopped":"Active",side:he,gridType:ne.gridType||"--",gridCount:ne.gridCount??"--",lower:Z.lower??null,upper:Z.upper??null,currentPrice:ne.currentPrice??null,leverage:J.leverage??null,collateral:J.collateral??null,totalInvestment:J.totalInvestment??null,liqLong:re.long??null,liqShort:re.short??null,trailingUp:ne.trailing_up??null,trailingDown:ne.trailing_down??null,slUp:ne.sl_up??null,slDown:ne.sl_down??null,timestamp:ne.timestamp||null,walletName:X.wm_name||null,walletAddress:X.wm_address||null,walletId:X.wallet_id??null,raw:X}});return z.sort((X,ne)=>{const J=X.status==="Active",Z=ne.status==="Active";if(J!==Z)return J?-1:1;const re=X.timestamp?new Date(X.timestamp).getTime():0;return(ne.timestamp?new Date(ne.timestamp).getTime():0)-re}),z},[s]),C=async(z,X)=>{var Z,re,he;if(!z||!z.raw||typeof window>"u")return;const ne=window.localStorage.getItem("hyperAddress"),J=window.localStorage.getItem("hyperToken");if(!ne||!J){on.error("Please sign in to manage bots");return}try{u(z.id);const Y={is_deleted:X,bot_params:z.raw.bot_params||{}},ie=String(((Z=z.raw)==null?void 0:Z.source_market)||"").toLowerCase().includes("lighter")?Smn:String(((re=z.raw)==null?void 0:re.source_market)||"").toLowerCase().includes("extended")?Nmn:Cmn,G=await(await fetch(ie,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:ne,token:J,bot_id:z.id,update_params:Y})})).json().catch(()=>null);if(!(G!=null&&G.success)){const V=(G==null?void 0:G.error_message)||(G==null?void 0:G.message)||(G==null?void 0:G.detail)||"Failed to update bot";throw new Error(V)}on.success(X?"Bot stopped":"Bot started"),a(V=>V.map(ee=>ee.id===z.id?{...ee,is_deleted:X}:ee)),r==null||r(),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:((he=z.raw)==null?void 0:he.source_market)||t}})),f(V=>V+1)}catch(Y){on.error(Y.message||"Failed to update bot")}finally{u(null)}},N=z=>{if(!z||!z.raw||typeof window>"u")return;const X=z.status==="Active",ne=(J,Z)=>{var oe,G,V,ee;const re=((oe=J==null?void 0:J.raw)==null?void 0:oe.wallet_id)??(J==null?void 0:J.walletId),he=((G=Z==null?void 0:Z.raw)==null?void 0:G.wallet_id)??(Z==null?void 0:Z.walletId);if(re&&he&&String(re)===String(he))return!0;const Y=((J==null?void 0:J.walletAddress)||((V=J==null?void 0:J.raw)==null?void 0:V.wm_address)||"").toLowerCase(),ie=((Z==null?void 0:Z.walletAddress)||((ee=Z==null?void 0:Z.raw)==null?void 0:ee.wm_address)||"").toLowerCase();return!!(Y&&ie&&Y===ie)};if(!X){if(w.some(Z=>{var re,he;return Z.id!==z.id&&Z.status==="Active"&&((re=Z.raw)==null?void 0:re.source_market)===((he=z.raw)==null?void 0:he.source_market)&&ne(Z,z)})){on.error("You already have an active bot on this wallet. Please add an account.");return}g(z);return}C(z,X)},I=()=>g(null),P=()=>{x&&(C(x,!1),g(null))},R=z=>{var re,he,Y;if(!z)return;const X=z.coin;if(!X)return;const ne=((re=z.raw)==null?void 0:re.source_market)||z.market||t,J=z.status==="Active",Z={sourceMarket:ne,coin:X,botParams:((he=z.raw)==null?void 0:he.bot_params)||{},walletId:(Y=z.raw)==null?void 0:Y.wallet_id,isActive:J};if(typeof window<"u"){try{window.localStorage.setItem("gridbot:pending_selection",JSON.stringify(Z))}catch{}window.dispatchEvent(new CustomEvent("gridbotSelectFromTasks",{detail:Z}))}v(ne==="hyper"?`/terminal/hyperliquid/${nj(X)}#gridbot`:ne==="lighter"?`/terminal/lighter/${nj(X)}#gridbot`:`/terminal/extended/${nj(X)}#gridbot`)},F=m.useMemo(()=>[{key:"status",label:"Status",sortable:!0,sortValue:z=>z.status==="Active"?1:0,render:z=>{const X=z==="Active"?"text-[#67ffbd] bg-[#67ffbd]/15":"text-[#9B9B9B] bg-[#9B9B9B]/10";return i.jsx("span",{className:`inline-flex h-6 items-center justify-center px-2 py-[2px] rounded-md text-[11px] font-semibold ${X}`,children:z})}},{key:"coin",label:"Coin",sortable:!0,sortValue:z=>z.coin||"",render:(z,X)=>{var re;const ne=nl(),J=String(((re=X.raw)==null?void 0:re.source_market)||X.market||t||"").toLowerCase();J.includes("lighter")||J.includes("extended");const Z=()=>ne(`/terminal/${J}/${nj(X.coin)}${X.status==="Active"||X.status==="Stopped"?"#gridbot":""}`);return i.jsxs("div",{onPointerDown:Z,className:"flex items-center gap-2 text-white font-medium hover:opacity-80 cursor-pointer",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${nj(z)}.svg`,onError:ea,className:"w-4 h-4",alt:z}),i.jsx("span",{children:z.replace("XYZ:","")||"--"})]})}},{key:"wallet",label:"Wallet",sortable:!0,sortValue:z=>z.walletName||z.walletAddress||"",render:(z,X)=>{const ne=X.walletName||"Wallet",J=X.walletAddress?Emn(X.walletAddress):"--";return i.jsxs("div",{className:"flex flex-col leading-[14px]",children:[i.jsx("span",{className:"text-white font-medium",children:ne}),i.jsx("span",{className:"text-[10px] text-white/60",children:J})]})}},{key:"gridCount",label:"Grids",sortable:!0},{key:"lower",label:"Lower",sortable:!0,render:z=>z==null?"--":i.jsx("span",{className:"text-[#67FFBD] font-semibold",children:jSe(z)})},{key:"upper",label:"Upper",sortable:!0,render:z=>z==null?"--":i.jsx("span",{className:"text-[#FF797C] font-semibold",children:jSe(z)})},{key:"investment",label:"Investment",sortable:!0,sortValue:z=>z.totalInvestment??z.collateral??0,render:(z,X)=>i.jsx("div",{className:"flex flex-col leading-[14px]",children:i.jsx("span",{className:"text-white font-semibold",children:X.collateral!=null?Amn(X.collateral):"--"})})},{key:"leverage",label:"Lev",sortable:!0,render:z=>z==null?"--":`${z}x`},{key:"gridType",label:"Grid Type",sortable:!0},{key:"actions",label:"Actions",render:(z,X)=>{const ne=X.status==="Active",J=c===X.id;return i.jsxs("div",{className:"relative z-10 flex items-center justify-start gap-2",onClick:Z=>Z.stopPropagation(),onMouseDown:Z=>Z.stopPropagation(),children:[i.jsx("button",{type:"button",onPointerDown:Z=>{Z.preventDefault(),Z.stopPropagation(),R(X)},className:"h-6 flex justify-center items-center px-2 rounded-md text-[11px] font-semibold bg-[#161616] text-[#E5E7EB] hover:bg-[#1F2933]",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M12 20h9"}),i.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 1 1 3 3L7 19l-4 1 1-4Z"})]})}),i.jsx("button",{type:"button",disabled:J,onPointerDown:Z=>{Z.preventDefault(),Z.stopPropagation(),N(X)},className:`h-6 flex justify-center items-center px-3 rounded-md text-[11px] font-semibold ${ne?"bg-[#2a1616] text-[#ff797c] hover:bg-[#3a1c1c]":"bg-[#101613] text-[#67ffbd] hover:bg-[#19201b]"} disabled:opacity-60 disabled:cursor-not-allowed`,children:J?"Saving...":ne?"Stop":"Start"})]})}}],[c]);return i.jsxs(i.Fragment,{children:[i.jsx(Pu,{data:w,loading:o,columns:F,rowHeight:32,listHeight:560,tableClassName:"mt-2",theadClassName:"sticky top-0 z-10 whitespace-nowrap rounded-2xl px-2 py-2 flex !rounded-none bg-transparent !text-[#9B9B9B] font-inter !text-[11px] not-italic font-semibold leading-[13px] tracking-[-0.13px]",tbodyClassName:"px-1",rowClassName:"border-b border-[#1E1E1E] bg-transparent",cellClassName:()=>"py-1 text-[11px] font-normal",rowKey:z=>z.id,emptyState:i.jsx("div",{className:"px-3 py-6 text-[#9B9B9B]",children:"No bots for this market"})}),i.jsx(rp,{isOpen:!!x,onClose:I,children:i.jsxs("div",{className:"w-[320px] sm:w-[380px] rounded-2xl bg-[#050505] px-6 py-5 text-[#E5E7EB]",onClick:z=>z.stopPropagation(),children:[i.jsxs("div",{className:"text-sm font-semibold text-white",children:["Start"," ",String(((U=x==null?void 0:x.raw)==null?void 0:U.source_market)||"").toLowerCase().includes("lighter")?"Lighter":String(((L=x==null?void 0:x.raw)==null?void 0:L.source_market)||"").toLowerCase().includes("extended")?"Extended":"Hyperliquid"," ","Grid Bot?"]}),i.jsxs("p",{className:"mt-3 text-[13px] text-[#9B9B9B]",children:["You are starting the"," ",i.jsx("span",{className:"text-white font-bold",children:x==null?void 0:x.coin})," ","grid bot. Make sure your parameters are correct."]}),i.jsxs("div",{className:"mt-5 flex items-center justify-end gap-3",children:[i.jsx("button",{type:"button",onClick:I,className:"h-9 rounded-xl border border-[#2c2c2c] px-4 text-[12px] font-semibold text-[#9B9B9B] transition hover:border-[#3f3f3f] hover:text-white",children:"Cancel"}),i.jsx("button",{type:"button",onClick:P,className:"h-9 rounded-xl bg-[#67FFBD] px-4 text-[12px] font-semibold text-black transition hover:brightness-105",children:"Start Bot"})]})]})})]})}function _mn(){const[e,t]=m.useState(()=>typeof window>"u"?!1:localStorage.getItem("hide_small_balances")==="1");return m.useEffect(()=>{typeof window<"u"&&(localStorage.setItem("hide_small_balances",e?"1":"0"),window.dispatchEvent(new CustomEvent("balances:hide-small-changed",{detail:{value:e}})))},[e]),i.jsxs("label",{className:"inline-flex items-center gap-2 text-[12px] text-white mr-3 mt-1.5",children:[i.jsx("input",{type:"checkbox",className:"accent-[#67FFBD] w-[14px] h-[14px]",checked:e,onChange:n=>t(n.target.checked)}),"Hide Small Balances"]})}function kmn(e){const{data:t,loading:n,error:r,isDigits:s,period:a,periods:o,handlePeriodChange:l,className:c="",minHeight:u="min-h-[560px]",walletAddress:d,coin:f,sourceMarket:x="hyper"}=e,{setSignInConnectButtonOpen:g}=m.useContext(Gr),[v,w]=m.useState(()=>typeof window>"u"?d||null:window.localStorage.getItem("hl_selected_wallet_address")||d||null);m.useEffect(()=>{const fe=()=>{if(typeof window>"u"){w(d||null);return}const Ae=window.localStorage.getItem("hl_selected_wallet_address");w(Ae||d||null)};return fe(),window.addEventListener("hl_selected_wallet_changed",fe),window.addEventListener("storage",fe),()=>{window.removeEventListener("hl_selected_wallet_changed",fe),window.removeEventListener("storage",fe)}},[d]);const C=v||d||null,[N,I]=m.useState(()=>C);m.useEffect(()=>{C&&I(C)},[C]);const P=C||N||null,[R,F]=m.useState({address:null,token:null}),[U,L]=m.useState(!1);m.useEffect(()=>{const fe=()=>{const Ae=typeof window<"u"?localStorage.getItem("hyperAddress"):null,ce=typeof window<"u"?localStorage.getItem("hyperToken"):null;F({address:Ae,token:ce}),L(!0)};return fe(),window.addEventListener("localStorageUpdated",fe),window.addEventListener("storage",fe),()=>{window.removeEventListener("localStorageUpdated",fe),window.removeEventListener("storage",fe)}},[]);const z=!!(R.address&&R.token),X=fe=>fe==="balances"?"Connect your wallet to see your balances":fe==="positions"?"Connect your wallet to see your positions":fe==="open"?"Connect your wallet to see your open orders":fe==="twap"?"Connect your wallet to see your TWAP orders":fe==="trades"?"Connect your wallet to see your trade history":fe==="funding"?"Connect your wallet to see your funding history":fe==="orders"?"Connect your wallet to see your order history":"Connect your wallet to continue",ne=(fe,Ae)=>U?z?fe:i.jsxs("div",{className:"w-full h-full flex flex-col items-center py-10 gap-3",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6]",children:X(Ae)}),i.jsx("div",{className:"w-[220px]",children:i.jsx(Zm,{onClick:()=>g(!0)})})]}):fe,Z=`terminalTabs:${typeof window<"u"?window.location.pathname:"tt"}`,[re,he]=m.useState(()=>typeof window>"u"?"balances":localStorage.getItem(Z)||"balances"),Y=wHe(P),ie=nfn(P),oe=[{k:"balances",t:"Balances"},{k:"positions",t:`Positions${z&&Number.isFinite(Y)?` (${Y})`:""}`},{k:"open",t:`Open Orders${z&&Number.isFinite(ie)?` (${ie})`:""}`},{k:"twap",t:"TWAP"},{k:"trades",t:"Trade History"},{k:"funding",t:"Funding History"},{k:"orders",t:"Order History"},{k:"all",t:"Top Traders"},{k:"bots",t:"Bot Tasks"}];m.useEffect(()=>{oe.map(Ae=>Ae.k).includes(re)||he("balances")},[oe,re]),m.useEffect(()=>{typeof window<"u"&&localStorage.setItem(Z,re)},[re,Z]),m.useEffect(()=>{const fe=Ae=>{var Ne;const ce=(Ne=Ae==null?void 0:Ae.detail)==null?void 0:Ne.tab,ye=oe.map(be=>be.k);ce&&ye.includes(ce)&&he(ce)};return window.addEventListener("terminal:setTab",fe),()=>window.removeEventListener("terminal:setTab",fe)},[oe]);const G=fe=>{he(fe)},V=(P||"no-wallet").toLowerCase();let ee;re==="balances"?ee=i.jsx(Npn,{walletAddress:P}):re==="positions"?ee=i.jsx(Ppn,{walletAddress:P,coin:f}):re==="open"?ee=i.jsx(Hpn,{walletAddress:P}):re==="twap"?ee=i.jsx(Zpn,{walletAddress:P}):re==="trades"?ee=i.jsx(umn,{walletAddress:P}):re==="funding"?ee=i.jsx(xmn,{walletAddress:P}):re==="orders"?ee=i.jsx(vmn,{walletAddress:P}):re==="bots"?ee=i.jsx(TO,{walletAddress:P,sourceMarket:x}):re==="all"?ee=i.jsx(apn,{data:t,loading:n,error:r,isDigits:s,period:a,periods:o,handlePeriodChange:l}):ee=i.jsx("div",{className:"h-full"});const ae=re==="all"?ee:ne(ee,re);return i.jsx(npn,{children:i.jsxs("div",{className:`bg-[#101010] rounded-2xl flex flex-col h-full ${u} overflow-hidden ${c}`,children:[i.jsx("div",{className:"px-3",children:i.jsxs("div",{className:"relative flex overflow-x-auto whitespace-nowrap pt-2 -mb-3",children:[oe.map(fe=>{const Ae=re===fe.k;return i.jsxs("button",{onClick:()=>G(fe.k),className:`relative cursor-pointer font-inter text-[13px] font-normal leading-[16px] px-2 py-[6px] flex items-center justify-center gap-[10px] text-xs rounded-lg bg-transparent ${Ae?"text-white":"text-[#929292] hover:text-white"}`,children:[Ae&&i.jsx("span",{className:"absolute inset-0 rounded-lg bg-[#262626]"}),i.jsx("span",{className:"relative z-10",children:fe.t})]},fe.k)}),i.jsx("div",{className:"absolute right-3 top-2 hidden md:flex items-center gap-3",children:re==="balances"?i.jsx(_mn,{}):i.jsx(rpn,{})})]})}),i.jsx("div",{className:"flex-1 min-h-0 relative",children:i.jsx("div",{className:"absolute inset-0",children:ae})})]})},V)}function Nue(){const[e,t]=m.useState([]),n=["XAG","XAU","USDKRW","USDJPY","USDCAD","USDCHF","NZDUSD","AUDUSD","GBPUSD","EURUSD","HOOD"];return m.useEffect(()=>{let r=!1,s=!1;async function a(){if(!s){s=!0;try{const c=await(await fetch("https://mainnet.zklighter.elliot.ai/api/v1/orderBookDetails")).json(),u=((c==null?void 0:c.order_book_details)||[]).filter(d=>!n.includes(d.symbol)).map(d=>{const f=Number(d.last_trade_price??0),x=Number(d.daily_price_low??0),g=Number(d.daily_price_high??0),v=Number(d.daily_price_change??0),w=Number(d.daily_quote_token_volume??0),C=Number(d.open_interest??0),N=f>0?C*f:null;return{symbol:d.symbol,last:f,chg24:v,vol:w,funding:null,openInterest:N,marketId:d.market_id,priceDecimals:d.supported_price_decimals??d.price_decimals??6,sizeDecimals:d.supported_size_decimals??d.size_decimals??0,minBaseAmount:Number(d.min_base_amount??0),minQuoteAmount:Number(d.min_quote_amount??0),raw:d}});r||t(u)}catch{r||t([])}s=!1}}a();const o=setInterval(a,5e3);return()=>{r=!0,clearInterval(o),s=!1}},[]),e}const Tmn="https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=extended",Imn="https://dextrabothypesocketv2.nftinit.io/",Pmn='J5a5j28NeLpQbf"=h',Fmn=6e4,Omn=e=>{if(e==null||e==="")return null;const t=Number(e);return Number.isFinite(t)?t:null},Kx=(...e)=>{for(const t of e){const n=Omn(t);if(n!=null)return n}return null},VHe=e=>String(e||"").trim().toUpperCase(),Mmn=e=>VHe(e).replace(/-USD$/,"").replace(/\/USD$/,"");function Rmn(e,t){var N;if(!e||typeof e!="object")return null;const n=VHe(e.value||e.symbol||e.market||e.coin||e.label),r=Mmn(e.label||e.assetName||e.uiName||n);if(!n&&!r)return null;const s=e.marketStats||{},a=Kx(s.lastPrice,s.markPrice,s.indexPrice,e.lastPrice,e.markPrice,e.last),o=Kx(s.markPrice,e.markPrice,s.lastPrice,e.lastPrice,a),l=Kx(e.volume,s.dailyVolume,e.vol),c=Kx(s.fundingRate,e.fundingRate,e.funding),u=Kx(s.openInterestBase,e.openInterestBase),d=Kx(s.openInterest,e.openInterestUsd,e.openInterest),f=Kx((N=e==null?void 0:e.tradingConfig)==null?void 0:N.maxLeverage,e.maxLeverage,e.leverage,e.max_leverage);let x=null;const g=Kx(s.dailyPriceChange,e.dailyPriceChange);if(g!=null&&a!=null){const I=a-g;I&&(x=g/I*100)}if(x==null){const I=Kx(s.dailyPriceChangePercentage,e.dailyPriceChangePercentage,e.change24hPct,e.chg24);I!=null&&(x=Math.abs(I)<=1?I*100:I)}const v=r||n,w=Number.isFinite(x)?x:null,C=e.market_index??e.marketIndex??e.marketId??e.market_id??e.idx??e.id??t??null;return{...e,symbol:v,coin:v,rawSymbol:n||v,last:a,lastPrice:a,markPrice:o,change24hPct:w,chg24:w,volume:l,vol:l,fundingRate:c,funding:c,openInterest:u??d,openInterestUsd:d??(u!=null&&a!=null?u*a:null),leverage:f,maxLeverage:f??e.maxLeverage,marketStats:s,source:"extended",market_index:C,marketIndex:C,marketId:C,market_id:C,_idx:t}}const $d={rows:[],subs:new Set,started:!1,socket:null,timer:null};function Lmn(){for(const e of $d.subs)try{e($d.rows)}catch{}}function WHe(e){var t,n,r;return e?Array.isArray(e)?e:Array.isArray(e==null?void 0:e.data)?e.data:Array.isArray((t=e==null?void 0:e.data)==null?void 0:t.data)?e.data.data:Array.isArray(e==null?void 0:e.coins)?e.coins:Array.isArray((n=e==null?void 0:e.data)==null?void 0:n.coins)?e.data.coins:Array.isArray(e==null?void 0:e.markets)?e.markets:Array.isArray((r=e==null?void 0:e.data)==null?void 0:r.markets)?e.data.markets:e!=null&&e.marketStats||e!=null&&e.tradingConfig||e!=null&&e.value||e!=null&&e.symbol||e!=null&&e.label?[e]:[]:[]}function qHe(e){const t=e.map((n,r)=>Rmn(n,r)).filter(n=>n&&n.symbol);return t.length?($d.rows=t,Lmn(),!0):!1}function ESe(e){const t=WHe(e);return t.length?qHe(t):!1}async function _Se(){try{const t=await(await fetch(Tmn)).json(),n=WHe(t);if(!n.length)return;qHe(n)}catch{}}function Dmn(){if(!$d.started){$d.started=!0,_Se(),$d.timer=setInterval(()=>{$d.socket&&$d.socket.connected||_Se()},Fmn);try{const e=vy(Imn);$d.socket=e;const t=()=>{try{e.emit("extended_feed_subscribe",{password:Pmn},r=>ESe(r))}catch{}};e.on("connect",t),e.io.on("reconnect",t);const n=new Set(["connect","disconnect","connect_error","reconnect_attempt","reconnect_error"]);e.onAny((r,...s)=>{if(!(!s.length||n.has(r))){for(const a of s)if(ESe(a))return}})}catch{}}}function Aue(){const[e,t]=m.useState($d.rows);return m.useEffect(()=>{Dmn();const n=r=>t(r);return $d.subs.add(n),$d.rows.length&&t($d.rows),()=>{$d.subs.delete(n)}},[]),e}const Bmn=["arithmetic","geometric"];function $mn(e,t,n,r){const s=Number(e),a=Number(t),o=Number(n);if(!Number.isFinite(s)||!Number.isFinite(a)||!Number.isFinite(o))return[];if(o<2||a<=s)return[];if(r==="geometric"){const c=Math.pow(a/s,1/(o-1));return Array.from({length:o},(u,d)=>s*Math.pow(c,d))}const l=(a-s)/(o-1);return Array.from({length:o},(c,u)=>s+l*u)}function kSe({entry:e,side:t,notionalUSD:n,maintenanceFrac:r,marginMode:s,accountValueUSD:a,isolatedMarginUSD:o}){const l=Number(e)||0,c=Math.abs(Number(n)||0);if(!l||!c)return null;const u=t==="buy"?1:-1,d=Math.max(0,Number(r)||0),f=c/l,x=c*d;let g;s==="Cross"?g=a-x:g=o-x;const v=1-d*u;if(!f||!isFinite(v))return null;const w=l-u*(g/f)/v;return Math.max(0,w)}function TSe({coin:e,midPrice:t,selectedPrice:n,wallet:r,onLevelsChange:s}){const a=Nue(),[o]=m.useState("short"),[l,c]=m.useState(""),[u,d]=m.useState(""),[f,x]=m.useState(2),[g,v]=m.useState("2"),[w,C]=m.useState(""),[N,I]=m.useState("arithmetic"),[P,R]=m.useState(""),[F,U]=m.useState(0),[L,z]=m.useState(10),[X,ne]=m.useState(!1),[J,Z]=m.useState(!1),[re,he]=m.useState(!1),[Y,ie]=m.useState(50),[oe,G]=m.useState([]),[V,ee]=m.useState(!1),[ae,fe]=m.useState(0),[Ae,ce]=m.useState(!1),[ye,Ne]=m.useState(!1),[be,je]=m.useState(0),[Ie,Re]=m.useState(!1),[Qe,Be]=m.useState(0),[it,tt]=m.useState(!1),[at,dt]=m.useState(!0),[ct,Ut]=m.useState(!1),[kt,tn]=m.useState(()=>r&&r.id&&r.address?{id:r.id,address:r.address}:{id:null,address:null}),jt=m.useRef(!1),{refreshBotSlots:un,botSlotsInfo:cn}=m.useContext(Gr),Pt=m.useCallback(async()=>{try{const k=window.localStorage.getItem("hyperToken"),T=window.localStorage.getItem("hyperAddress");if(!k||!T){dt(!1),Ut(!0);return}const B=await Si(T.toLowerCase(),k);dt(!!(B!=null&&B.farming_tools))}catch{dt(!1)}finally{Ut(!0)}},[]);m.useEffect(()=>{un==null||un(),Pt()},[un,Pt]);const Xe=m.useMemo(()=>{const k=Array.isArray(cn)?cn:[],T=k.find(B=>String((B==null?void 0:B.bot_type)||"").toLowerCase()==="grid_bot"&&String((B==null?void 0:B.source_market)||"").toLowerCase()==="lighter");return T||k.find(B=>String((B==null?void 0:B.bot_type)||"").toLowerCase()==="grid_bot")},[cn]),Vt=Number((Xe==null?void 0:Xe.total_slot_count)||0),Yt=Number((Xe==null?void 0:Xe.using_extra_slot_count)||0)+Number((Xe==null?void 0:Xe.using_subs_slot_count)||0),Ve=Vt+Yt,Ke=Xe?Vt<=0:!1,ft=Ke;m.useEffect(()=>{r&&r.id&&r.address&&tn(k=>k.id===r.id&&k.address&&k.address.toLowerCase()===r.address.toLowerCase()?k:{id:r.id,address:r.address})},[r==null?void 0:r.id,r==null?void 0:r.address]);const en=m.useMemo(()=>a.find(k=>k.symbol===e),[a,e]),Dt=en&&en.raw&&en.raw.last_trade_price!=null&&Number(en.raw.last_trade_price)||0;m.useEffect(()=>{let k=!1;async function T(){try{const q=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=lighter_fr")).json().catch(()=>null);if(!q||k)return;const te=Array.isArray(q)&&q||Array.isArray(q.data)&&q.data||Array.isArray(q.coins)&&q.coins||[],ue=String(e||"").toUpperCase(),de=te.find(we=>String(we.value||we.label||we.symbol||we.coin||"").toUpperCase()===ue),xe=de&&de.maxLeverage!=null?Number(de.maxLeverage):null;!k&&xe!=null&&Number.isFinite(xe)&&xe>0&&(ie(xe),z(we=>{const ke=Number(we)||1;return Math.min(xe,Math.max(1,ke))}))}catch{if(k)return}}return e&&T(),()=>{k=!0}},[e]),m.useEffect(()=>{let k=!1;async function T(){if(typeof window>"u")return;const B=window.localStorage.getItem("hyperAddress"),q=window.localStorage.getItem("hyperToken");if(!B||!q){k||G([]);return}ee(!0);try{const ue=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:B,token:q})})).json().catch(()=>null);if(!ue||k)return;let de=[];Array.isArray(ue)?de=ue:Array.isArray(ue.data)?de=ue.data:ue&&ue.wallet_id!=null&&(de=[ue]);const xe=await Promise.all(de.map(async we=>{let ke=null;if(we.available_balance!=null){const Me=Number(we.available_balance);Number.isFinite(Me)&&(ke=Me)}else if(we.balance!=null){const Me=Number(we.balance);Number.isFinite(Me)&&(ke=Me)}try{if(we.wallet_address){const Ye=await(await fetch(`https://mainnet.zklighter.elliot.ai/api/v1/account?by=l1_address&value=${encodeURIComponent(wc(we.wallet_address))}`)).json().catch(()=>null),Fe=Ye&&Array.isArray(Ye.accounts)&&Ye.accounts.length>0&&Ye.accounts[0];if(Fe&&Fe.available_balance!=null){const rt=Number(Fe.available_balance);Number.isFinite(rt)&&(ke=rt)}}}catch{}return{wallet_id:we.wallet_id,wallet_address:we.wallet_address,wallet_name:we.wallet_name||`Wallet ${we.wallet_id}`,available_balance:ke}}));if(k)return;G(xe),tn(we=>{if(we&&we.id)return we;const ke=xe[0];return ke?{id:ke.wallet_id,address:ke.wallet_address}:we})}catch{k||G([])}finally{k||ee(!1)}}return T(),()=>{k=!0}},[]);const At=m.useMemo(()=>{if(!kt||!kt.id)return null;const k=oe.find(B=>String(B.wallet_id)===String(kt.id));if(!k||k.available_balance==null)return null;const T=Number(k.available_balance);return Number.isFinite(T)?T:null},[oe,kt]),Je=(k,T,B)=>{const q=typeof B=="boolean"?B:!0;if(k.priceRange&&k.priceRange.lower!=null&&k.priceRange.upper!=null&&Number.isFinite(Number(k.priceRange.lower))&&Number.isFinite(Number(k.priceRange.upper))&&(c(String(k.priceRange.lower)),d(String(k.priceRange.upper))),k.gridCount&&Number.isFinite(Number(k.gridCount))){const te=Number(k.gridCount);x(te),v(String(te))}if((k.gridType==="geometric"||k.gridType==="arithmetic")&&I(k.gridType),k.investment&&k.investment.leverage!=null&&Number.isFinite(Number(k.investment.leverage))){const te=Number(k.investment.leverage);z(te)}if(k.investment&&k.investment.collateral!=null&&Number.isFinite(Number(k.investment.collateral))){const te=Number(k.investment.collateral);if(R(String(te)),T&&T>0&&te>0){const ue=te/T*100;U(Math.max(0,Math.min(100,ue)))}else U(0)}else R(""),U(0);ne(q)};m.useEffect(()=>{if(typeof window>"u")return;if(!e||!(kt!=null&&kt.id)||!(kt!=null&&kt.address)){ne(!1);return}let k=!1;function T(){c(""),d(""),x(2),v("2"),I("arithmetic"),R(""),U(0),z(10),C("")}async function B(){Z(!0);try{const q=window.localStorage.getItem("hyperToken");if(!q){k||(ne(!1),T(),Z(!1));return}const te={address:localStorage.getItem("hyperAddress"),token:q,wallet_id:Number(kt.id),source_market:"lighter",coin:String(e||"").toUpperCase()},de=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/info/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(te)})).json().catch(()=>null);if(k)return;if(jt.current){jt.current=!1,Z(!1);return}const xe=de&&de.data?de.data:de;xe&&typeof xe=="object"&&xe.is_deleted===!1&&xe.bot_params&&xe.bot_params?Je(xe.bot_params,At,!0):(ne(!1),T())}catch{if(k)return;ne(!1),c(""),d(""),x(2),v("2"),I("arithmetic"),R(""),U(0),z(10),C("")}finally{k||Z(!1)}}return B(),()=>{k=!0}},[e,kt==null?void 0:kt.id,kt==null?void 0:kt.address,be]);const He=m.useMemo(()=>$mn(l,u,f,N),[l,u,f,N]),Rt=m.useMemo(()=>{if(!He.length)return[];const k=Number(l),T=Number(u),B=Number.isFinite(k)&&Number.isFinite(T)?(k+T)/2:null;return He.map(q=>({price:q,side:B==null?null:q>=B?"sell":"buy"}))},[He,l,u]);m.useEffect(()=>{typeof s=="function"&&s(Rt)},[Rt,s]);const qe=k=>{const T=Number(k);if(!(T>0))return;const q=T*.01;c((T-q).toFixed(2)),d((T+q).toFixed(2))};m.useEffect(()=>{const k=T=>{const B=T&&T.detail&&T.detail.sourceMarket;B&&B!=="lighter"||je(q=>q+1)};return window.addEventListener("gridbotUpdated",k),()=>{window.removeEventListener("gridbotUpdated",k)}},[]),m.useEffect(()=>{const k=T=>{const B=T&&T.detail;if(!B)return;const q=B.sourceMarket||B.source_market;if(q&&q!=="lighter"||String(B.coin||"").toUpperCase()!==String(e||"").toUpperCase())return;const ue=B.botParams||{};if(jt.current=!0,Je(ue,At,B.isActive),B.isActive===!0?ne(!0):B.isActive===!1&&ne(!1),B.walletId&&oe&&oe.length){const de=oe.find(xe=>String(xe.wallet_id)===String(B.walletId));de&&tn({id:de.wallet_id,address:de.wallet_address})}};return window.addEventListener("gridbotSelectFromTasks",k),()=>{window.removeEventListener("gridbotSelectFromTasks",k)}},[e,oe]),m.useEffect(()=>{if(typeof window>"u")return;const k=window.localStorage.getItem("gridbot:pending_selection");if(!k)return;let T=null;try{T=JSON.parse(k)}catch{T=null}if(!(!T||T.sourceMarket&&T.sourceMarket!=="lighter"||String(T.coin||"").toUpperCase()!==String(e||"").toUpperCase())){if(jt.current=!0,Je(T.botParams||{},At,T.isActive),T.isActive===!0?ne(!0):T.isActive===!1&&ne(!1),T.walletId&&oe&&oe.length){const B=oe.find(q=>String(q.wallet_id)===String(T.walletId));B&&tn({id:B.wallet_id,address:B.wallet_address})}try{window.localStorage.removeItem("gridbot:pending_selection")}catch{}}},[e,oe,At]),m.useEffect(()=>{if(l||u)return;const k=Dt>0?Dt:Number(t||n||0);!Number.isFinite(k)||k<=0||qe(k)},[Dt,t,n,l,u]);const lt=m.useMemo(()=>{if(Dt>0)return Dt;const k=Number(t||0);if(k>0)return k;const T=Number(n||0);if(T>0)return T;const B=Number(l),q=Number(u);return Number.isFinite(B)&&Number.isFinite(q)&&q>B?(B+q)/2:0},[Dt,t,n,l,u]),xt=lt,Nt=m.useMemo(()=>{const k=Math.max(1,Number(L)||1);return Math.min(Y,k)},[L,Y]),It=Number(P)||0,xn=It*Nt,dn=He.length,Mn=lt>0?lt:Dt,_n=Mn>0&&dn>0&&xn>0?Number((xn/dn/Mn).toFixed(5)):0,kn=Number.isFinite(en==null?void 0:en.sizeDecimals)?en.sizeDecimals:4,vn=Number.isFinite(en==null?void 0:en.priceDecimals)?en.priceDecimals:4,Qn=vn,Hn=(en==null?void 0:en.minBaseAmount)??0,$n=(en==null?void 0:en.minQuoteAmount)??0,Jn=_n>0?Number(_n.toFixed(kn)):0,Nn=Jn>0&&Hn>0&&Jn<Hn,ln=Jn>0&&$n>0&&He.length>0&&He.some(k=>k*Jn<$n),Oe=lt>0&&xn>0&&It>0?kSe({entry:lt,side:"buy",notionalUSD:xn,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:It,isolatedMarginUSD:It}):null,sn=lt>0&&xn>0&&It>0?kSe({entry:lt,side:"sell",notionalUSD:xn,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:It,isolatedMarginUSD:It}):null,fn=m.useMemo(()=>{if(!l&&!u)return"";const k=Number(l),T=Number(u);if(!Number.isFinite(k)||!Number.isFinite(T))return"";if(!(T>k))return"Upper price must be greater than lower price.";if(xt>0){if(k>xt)return`Lower price cannot be above mark price (${xt.toFixed(vn)}).`;if(T<xt)return`Upper price cannot be below mark price (${xt.toFixed(vn)}).`}return""},[l,u,xt,vn]),Et=m.useMemo(()=>{const k=Number(l),T=Number(u);return!(!Number.isFinite(k)||!Number.isFinite(T)||!(T>k)||xt>0&&(k>xt||T<xt))},[l,u,xt]),Kn=dn>1&&Et&&It>0&&Nt>0&&(kt==null?void 0:kt.id)&&(kt==null?void 0:kt.address),Cn=ae>0,Bt=!!w,an=Nn||ln,Pn=ct&&!at,qn=Kn&&!J&&!re&&!V&&!Cn&&!Bt&&!an&&!Ke&&!Pn,nr=re||J||V||Bt?!1:X||Pn?!0:an||Cn||Ke?!1:Kn,tr=re||J||V?!0:X||Pn?!1:an||Cn||Ke||Bt?!0:!Kn,Qt=X||re||J,zn=Y&&Y>0;m.useEffect(()=>{if(!ae)return;const k=setInterval(()=>{fe(T=>T>1?T-1:0)},1e3);return()=>clearInterval(k)},[ae]);const Yn=()=>{if(Qt)return;const k=Dt>0?Dt:lt>0?lt:Number(t||n||0);!Number.isFinite(k)||k<=0||qe(k)},Lt=k=>{if(Qt)return;const T=Math.max(0,Math.min(100,Number(k)||0));if(U(T),!At||At<=0){T===0&&R("");return}const B=At*T/100;R(B&&Number.isFinite(B)?String(B.toFixed(2)):"")},Fn=k=>{if(Qt)return;R(k);const T=Number(k);if(!At||!Number.isFinite(T)||T<=0||At<=0){U(0);return}const B=T/At*100;U(Math.max(0,Math.min(100,B)))},Ee=async()=>{if(!qn||typeof window>"u"||!(kt!=null&&kt.address)||!(kt!=null&&kt.id))return;const k=He.filter(ke=>Number.isFinite(ke));if(k.length<2)return;const T=k[0],B=k[k.length-1],q=(T+B)/2,te=k.length,ue=window.localStorage.getItem("hyperToken");if(!ue)return;const de=Jn,xe={symbol:String(e||"").toUpperCase(),gridType:N==="geometric"?"geometric":"arithmetic",direction:o,priceRange:{lower:Number(T.toFixed(Qn)),upper:Number(B.toFixed(Qn)),middle:Number(q.toFixed(Qn))},gridCount:te,gridPrices:k.map(ke=>Number(ke.toFixed(Qn))),investment:{collateral:It,leverage:Nt,totalInvestment:xn,qtyPerOrder:de},liquidationPrices:{long:Oe?Number(Oe.toFixed(2)):null,short:sn?Number(sn.toFixed(2)):null},marginMode:"Cross",currentPrice:lt||null,timestamp:new Date().toISOString()},we={address:localStorage.getItem("hyperAddress"),token:ue,wallet_id:Number(kt.id),source_market:"lighter",bot_params:xe,coin:String(e||"").toUpperCase()};he(!0);try{const Me=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/save/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(we)})).json().catch(()=>null);if(!(Me&&(Me.success===!0||Me.status==="ok"||Me.status==="success"))){const Fe=Me&&(Me.error_message||Me.message||Me.detail)||"Grid bot failed to start.";on.error(Fe);return}ne(!0),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"lighter"}})),un==null||un(),on.success("Grid bot started.")}catch{on.error("An error occurred while starting the grid bot.")}finally{he(!1)}},p=async()=>{if(typeof window>"u"||!(kt!=null&&kt.address)||!(kt!=null&&kt.id))return;const k=window.localStorage.getItem("hyperToken");if(!k)return;const T={address:localStorage.getItem("hyperAddress"),token:k,wallet_id:Number(kt.id),source_market:"lighter",coin:String(e||"").toUpperCase()};he(!0);try{const q=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/stop/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)})).json().catch(()=>null);if(!(q&&(q.success===!0||q.status==="ok"||q.status==="success"))){const ue=q&&(q.error_message||q.message||q.detail)||"Grid bot could not be stopped.";on.error(ue);return}ne(!1),fe(10),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"lighter"}})),un==null||un(),on.success("Grid bot has been stopped.")}catch{on.error("An error occurred while stopping the grid bot.")}finally{he(!1)}},h=()=>{if(Pn){tt(!0);return}nr&&(X?p():Ne(!0))},S=async()=>{qn&&(Ne(!1),await Ee())},_=Pn?"Subscribe / 0.12 ETH":re?X?"Stopping...":"Starting...":X?"Stop":Cn?`Stopping ${ae}s`:"Start";return i.jsxs(i.Fragment,{children:[it&&i.jsx(YUe,{open:it,setOpen:tt,checkAccountCopy:Pt,roleType:"farming"}),Ie&&i.jsx(d5,{open:Ie,setOpen:Re,oldSlotCount:Qe,checkAccountLighter:un,product:"grid_bot"}),i.jsxs("div",{className:"h-full w-full flex flex-col text-[13px]",children:[i.jsx("div",{className:"px-3 pb-2 flex items-center justify-between border-b border-[#292929]"}),i.jsxs("div",{className:"flex-1 overflow-y-auto px-3 pb-3 space-y-4 mt-2",children:[i.jsxs("section",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Lighter Wallet"}),i.jsx(bT,{wallets:oe,value:kt&&kt.id?String(kt.id):"",onChange:k=>{const T=oe.find(B=>String(B.wallet_id)===String(k));T&&tn({id:T.wallet_id,address:T.wallet_address})},selectedBalance:At,mode:"lighter"})]}),i.jsxs("section",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2 text-[12px] text-[#7C7C7C] font-semibold",children:[i.jsx(iA,{className:"w-4 h-4 text-[#67FFBD]"}),i.jsx("span",{children:"Slot"})]}),i.jsx("div",{className:"flex items-center gap-1 text-[#67FFBD] text-[12px] font-semibold",children:i.jsx("span",{children:Ve?`${Yt}/${Ve}`:Xe?"0/0":"--"})})]}),i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx("div",{className:"text-[11px] text-[#7C7C7C]",children:Ke?"No slots left. Get more to start new grid bots.":""}),ft&&i.jsx("button",{type:"button",onClick:()=>{Be(Vt),Re(!0)},className:"flex items-center justify-center h-8 px-3 sm:px-5 rounded-[10px] text-[11px] sm:text-[13px] border bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer min-w-max font-semibold",children:"Get more slots"})]})]}),i.jsxs("section",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center justify-between mt-2",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Price Range"}),i.jsx("button",{type:"button",onClick:Yn,disabled:Qt,className:"text-[11px] px-2 py-0.5 rounded-md bg-[#161616] border border-[#292929] text-white/60 hover:text-white disabled:opacity-60 disabled:cursor-not-allowed",children:"Autofill"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"text-[11px] text:white/40 text-white/40",children:"Lower"}),i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex items-center",children:i.jsx("input",{value:l,onChange:k=>{Qt||c(k.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:Qt})})]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"text-[11px] text-white/40",children:"Upper"}),i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex items-center",children:i.jsx("input",{value:u,onChange:k=>{Qt||d(k.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:Qt})})]})]}),xt>0&&i.jsxs("div",{className:"text-[11px] text:white/40 text-white/40",children:["Mark Price: ",xt.toFixed(vn)]}),fn&&i.jsx("div",{className:"text-[11px] text-[#FF7173]",children:fn})]}),i.jsxs("section",{className:"space-y-1",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("span",{className:"text-xs text-white/70",children:"Number of Grids (max 36, even only)"})}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex-1 flex items-center",children:i.jsx("input",{value:g,onChange:k=>{if(Qt)return;const T=k.target.value.replace(/[^\d]/g,"");if(v(T),C(""),T==="")return;const B=Number(T);if(Number.isFinite(B)){if(B<2){C("The minimum number of grids must be 2.");return}if(B>36){C("The maximum number of grids can be 36.");return}if(B%2!==0){C("The number of grids must be even.");return}x(B)}},className:"bg-transparent outline-none flex-1 text-[13px]",inputMode:"numeric",disabled:Qt})}),i.jsx("div",{className:"relative",children:i.jsx("select",{value:N,onChange:k=>{Qt||I(k.target.value)},className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 text-[12px] outline-none",disabled:Qt,children:Bmn.map(k=>i.jsx("option",{value:k,className:"bg-[#101010]",children:k[0].toUpperCase()+k.slice(1)},k))})})]}),i.jsxs("div",{className:"text-[11px] text-white/40",children:[w&&i.jsx("div",{className:"text-[11px] text-[#FF7173] mt-1",children:w}),"Step:"," ",He.length>1?(He[1]-He[0]).toFixed(Qn):"--"]})]}),i.jsxs("section",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Investment"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex-1 flex items-center",children:[i.jsx("input",{value:P,onChange:k=>Fn(k.target.value),className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"USDC",inputMode:"decimal",disabled:Qt}),i.jsx("span",{className:"text-[11px] text-white/40 ml-1",children:"USDC"})]}),i.jsx("div",{className:"flex flex-col gap-1 w-[120px]",children:i.jsx(g4,{onClick:zn&&!Qt?()=>ce(!0):void 0,children:zn?`${Nt}x`:"--"})})]}),i.jsxs("div",{className:"flex items-center gap-3 mt-3 pb-6",children:[i.jsx(KN,{value:F,onChange:k=>Lt(k),accent:"#67FFBD"}),i.jsxs("div",{className:"h-[30px] rounded-lg flex items-center px-2",style:{width:84,background:jo,border:`1px solid ${ka}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-xs",inputMode:"numeric",value:F,onChange:k=>Lt(Math.max(0,Math.min(100,Number(k.target.value)||0))),style:{color:Vi,fontFeatureSettings:'"tnum"'},disabled:Qt}),i.jsx("span",{style:{color:Oi},className:"ml-1",children:"%"})]})]}),i.jsxs("div",{className:"text-[11px] text-white/40 flex justify-between mt-2  border-t border-[#292929] pt-4 font-semibold",children:[i.jsxs("span",{children:["Max ",e,": ",`${Y}x`]}),i.jsxs("span",{children:["Total:"," ",xn>0?`${xn.toFixed(2)} USDC`:"--"]})]}),i.jsxs("div",{className:"text-[11px] text-white/40 flex justify-between font-semibold",children:[i.jsxs("span",{children:["Qty per order:"," ",Jn>0?`${Jn} ${e}`:"--"]}),i.jsx("span",{children:"Margin Mode: Cross"})]})]}),i.jsxs("section",{className:"pt-2 border-t border-[#292929]",children:[i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-white/40 mb-2",children:[i.jsx("span",{children:"Est. Liq Long"}),i.jsx("span",{children:Oe?`$${Oe.toLocaleString(void 0,{maximumFractionDigits:2})}`:"--"})]}),i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-white/40 mb-3",children:[i.jsx("span",{children:"Est. Liq Short"}),i.jsx("span",{children:sn?`$${sn.toLocaleString(void 0,{maximumFractionDigits:2})}`:"--"})]}),i.jsx("button",{type:"button",onClick:h,disabled:tr,className:`w-full h-[32px] rounded-xl font-bold text-[13px] flex items-center justify-center transition-opacity ${tr?"bg-[#303030] text-white/40 cursor-not-allowed opacity-70":Pn?"bg-[#7446FF] text-white hover:bg-[#5834C3]":X?"bg-[#FF7173] text:black text-black hover:opacity-90":"bg-[#67FFBD] text-black hover:opacity-90"}`,children:_}),Nn&&i.jsxs("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:["Quantity per order is below min size (",Hn," ",e,")."]}),ln&&i.jsxs("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:["Your order size is below minimum order size of $",$n.toFixed(2),"."]})]})]})]}),i.jsx(qh,{open:Ae,onClose:()=>ce(!1),children:i.jsxs(nm,{title:"Adjust Leverage",children:[i.jsxs("div",{className:"text-[12px] leading-5 mb-3",style:{color:Oi},children:["Control the leverage used for ",e," grid bot positions. The maximum leverage is ",Y,"x."]}),i.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[i.jsx("input",{type:"range",min:1,max:Y||1,step:1,value:L,onChange:k=>z(Math.max(1,Math.min(Y||1,Number(k.target.value)))),className:"flex-1",style:{accentColor:"#67FFBD"}}),i.jsxs("div",{className:"h-[36px] rounded-lg flex items-center px-2",style:{width:84,background:jo,border:`1px solid ${ka}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-white",inputMode:"numeric",value:L,onChange:k=>{const T=Number(k.target.value)||1,B=Math.max(1,Math.min(Y||1,T));z(B)}}),i.jsx("span",{className:"text-[11px] text-white/40 ml-1",children:"x"})]})]}),i.jsx(E0,{onClick:()=>ce(!1),children:"Confirm"})]})}),i.jsx(qh,{open:ye,onClose:()=>Ne(!1),children:i.jsxs(nm,{title:`${e} Lighter Grid Bot`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-4 text-[10px]",children:[i.jsx("span",{className:"px-2 py-0.5 rounded-full bg-[#151b23] text-[#9CA3AF]",children:"Cross"}),i.jsxs("span",{className:"px-2 py-0.5 rounded-full bg-[#FF71731a] text-[#FF7173]",children:["Leverage ",Nt,"x"]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-y-2 gap-x-6 text-[12px] mb-4",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Oi},children:"Price Range"}),i.jsx("div",{className:"font-medium",style:{color:Vi},children:Number.isFinite(Number(l))&&Number.isFinite(Number(u))?`${Number(l).toFixed(Qn)} - ${Number(u).toFixed(Qn)} USDC`:"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Oi},children:"Number of Grids"}),i.jsx("div",{className:"font-medium",style:{color:Vi},children:dn||"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Oi},children:"Mode"}),i.jsx("div",{className:"font-medium",style:{color:Vi},children:N==="geometric"?"Geometric":"Arithmetic"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Oi},children:"Qty Per Order"}),i.jsx("div",{className:"font-medium",style:{color:Vi},children:Jn>0?`${Jn} ${e}`:"--"})]})]}),i.jsx("div",{className:"mt-2 pt-3 border-t border-[#292929]",children:i.jsxs("div",{className:"flex items-center justify-between text-[12px]",children:[i.jsx("span",{className:"font-medium",style:{color:Vi},children:"Total Investment"}),i.jsx("span",{className:"font-semibold text-[#67FFBD]",children:xn>0?`${xn.toFixed(2)} USDC`:"--"})]})}),i.jsx("div",{className:"mt-4",children:i.jsx(E0,{onClick:S,disabled:re,children:re?"Starting...":"Confirm"})})]})})]})}const Umn=["arithmetic","geometric"],zmn=6,GHe="https://api.hyperliquid.xyz/info",Hmn=10,Vmn=10*60*1e3;let xb={data:null,ts:0,promise:null};async function Wmn(){const e=Date.now();if(xb.data&&e-xb.ts<Vmn)return xb.data;if(xb.promise)return xb.promise;const t=fetch(GHe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"allPerpMetas"})}).then(n=>n.json()).then(n=>{const r=Array.isArray(n)?n:[];return xb={data:r,ts:Date.now(),promise:null},r}).catch(n=>{throw xb.promise=null,n});return xb.promise=t,t}function qmn(e,t,n,r){const s=Number(e),a=Number(t),o=Number(n);if(!Number.isFinite(s)||!Number.isFinite(a)||!Number.isFinite(o))return[];if(o<2||a<=s)return[];if(r==="geometric"){const c=Math.pow(a/s,1/(o-1));return Array.from({length:o},(u,d)=>s*Math.pow(c,d))}const l=(a-s)/(o-1);return Array.from({length:o},(c,u)=>s+l*u)}function ISe({entry:e,side:t,notionalUSD:n,maintenanceFrac:r,marginMode:s,accountValueUSD:a,isolatedMarginUSD:o}){const l=Number(e)||0,c=Math.abs(Number(n)||0);if(!l||!c)return null;const u=t==="buy"?1:-1,d=Math.max(0,Number(r)||0),f=c/l,x=c*d;let g;s==="Cross"?g=a-x:g=o-x;const v=1-d*u;if(!f||!isFinite(v))return null;const w=l-u*(g/f)/v;return Math.max(0,w)}function HX(e){const t=String(e||""),n=t.indexOf(":");return n>0?t.slice(0,n).toLowerCase():"hl"}function Gmn(e){let t=String(e||"").toUpperCase();if(!t)return"";t.endsWith("-PERP")&&(t=t.slice(0,-5));const n=t.indexOf("-USD");return n>0&&(t=t.slice(0,n)),t}function Kmn(e,t,n=6){if(!Number.isFinite(e)||e<=0)return n-(t||0);const r=5,s=Math.max(0,n-(t||0)),a=Math.floor(Math.log10(e))+1,o=Math.max(0,r-a);return Math.min(s,o)}function PSe({coin:e,midPrice:t,selectedPrice:n,wallet:r,onWalletChange:s,onLevelsChange:a}){const o=xU(),[l]=m.useState("short"),[c,u]=m.useState(""),[d,f]=m.useState(""),[x,g]=m.useState(2),[v,w]=m.useState("2"),[C,N]=m.useState(""),[I,P]=m.useState("arithmetic"),[R,F]=m.useState(""),[U,L]=m.useState(0),[z,X]=m.useState(10),[ne,J]=m.useState(!1),[Z,re]=m.useState(!1),[he,Y]=m.useState(!1),[ie,oe]=m.useState(50),[G,V]=m.useState(0),[ee,ae]=m.useState(!1),[fe,Ae]=m.useState(!1),[ce,ye]=m.useState(()=>r&&r.id&&r.address?{id:r.id,address:r.address}:{id:null,address:null}),[Ne,be]=m.useState({address:null,token:null}),[je,Ie]=m.useState(null),[Re,Qe]=m.useState(null),[Be,it]=m.useState(""),[tt,at]=m.useState(""),[dt,ct]=m.useState(""),[Ut,kt]=m.useState(""),[tn,jt]=m.useState(!1),[un,cn]=m.useState(!1),[Pt,Xe]=m.useState(!1),[Vt,Yt]=m.useState(!1),[Ve,Ke]=m.useState(0),ft=()=>{u(""),f(""),g(2),w("2"),P("arithmetic"),F(""),L(0),X(10),N(""),it(""),at(""),ct(""),kt(""),jt(!1),cn(!1),Xe(!1),Yt(!1)},{address:en,isConnected:Dt}=Yr();Dt&&(typeof window<"u"&&window.localStorage.getItem("hyperToken"));const{wallets:At,loading:Je}=kHe(Ne.address,Ne.token,!0,{pollMs:5e3}),He=m.useRef(!1),Rt=Je&&(!At||At.length===0);m.useEffect(()=>{r&&r.id&&r.address&&ye(ot=>ot.id===r.id&&ot.address&&ot.address.toLowerCase()===r.address.toLowerCase()?ot:{id:r.id,address:r.address})},[r==null?void 0:r.id,r==null?void 0:r.address]),m.useEffect(()=>{const ot=()=>{const gt=typeof window<"u"?window.localStorage.getItem("hyperAddress"):null,Jt=typeof window<"u"?window.localStorage.getItem("hyperToken"):null;be({address:gt,token:Jt})};return ot(),window.addEventListener("localStorageUpdated",ot),window.addEventListener("storage",ot),()=>{window.removeEventListener("localStorageUpdated",ot),window.removeEventListener("storage",ot)}},[]),m.useEffect(()=>{if(ce.id||!At||!At.length)return;const ot=At.find(Jt=>Jt.confirmed)||At[0];if(!ot)return;const gt={id:ot.wallet_id,address:ot.wallet_address};ye(gt),typeof s=="function"&&s({id:String(gt.id),address:gt.address})},[At,ce.id,s]),m.useEffect(()=>{e&&(ft(),J(!1))},[e]);const qe=m.useMemo(()=>o.find(ot=>ot.symbol===e),[o,e]),lt=qe&&qe.raw&&qe.raw.last_trade_price!=null&&Number(qe.raw.last_trade_price)||0;m.useEffect(()=>{let ot=!1;async function gt(){if(e)try{const Ge=await(await fetch(GHe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"allPerpMetas"})})).json().catch(()=>null);if(!Ge||ot)return;let et=null;for(const wt of Ge)if(Array.isArray(wt==null?void 0:wt.universe)){for(const St of wt.universe)if(String(St.name||"").toUpperCase()===String(e||"").toUpperCase()){et=St;break}}if(!et||!Number.isFinite(et.maxLeverage))return;const We=Number(et.maxLeverage);oe(We),X(wt=>Math.min(We,Math.max(1,wt)))}catch{}}return gt(),()=>{ot=!0}},[e]),m.useEffect(()=>{let ot=!1;async function gt(){try{const Ge=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=hyper_fr")).json().catch(()=>null);if(!Ge||ot)return;const et=Array.isArray(Ge)&&Ge||Array.isArray(Ge.data)&&Ge.data||Array.isArray(Ge.coins)&&Ge.coins||[],We=String(e||"").toUpperCase(),wt=et.find(Kt=>String(Kt.value||Kt.label||Kt.symbol||Kt.coin||"").toUpperCase()===We),St=wt&&wt.maxLeverage!=null?Number(wt.maxLeverage):null;!ot&&St!=null&&Number.isFinite(St)&&St>0&&(oe(St),X(Kt=>Math.min(St,Math.max(1,Number(Kt)||1))))}catch{}}return e&&gt(),()=>{ot=!0}},[e]);const xt=(ce==null?void 0:ce.address)||(en?en.toLowerCase():null),{perpsOverview:Nt}=gT(xt),It=m.useMemo(()=>{if(!Nt||Nt.balance==null)return null;const ot=Number(Nt.balance);return Number.isFinite(ot)?ot:null},[Nt]),xn=(ot,gt)=>{var pt,Wt,Zt,vt;const Jt=ot.priceRange||{},Ge=Array.isArray(ot.gridPrices)?ot.gridPrices:[];let et=Jt.lower,We=Jt.upper;(!Number.isFinite(et)||!Number.isFinite(We))&&Ge.length>=2&&(et=Ge[0],We=Ge[Ge.length-1]),Number.isFinite(et)?u(String(et)):u(""),Number.isFinite(We)?f(String(We)):f("");let wt=ot.gridCount;Number.isFinite(wt)||Ge.length>=2&&(wt=Ge.length),Number.isFinite(wt)?(g(wt),w(String(wt))):(g(2),w("2"));let St=ot.gridType;St!=="geometric"&&St!=="arithmetic"&&(St="arithmetic"),P(St);const Kt=ot.investment||{};if(Kt&&Kt.leverage!=null&&Number.isFinite(Number(Kt.leverage))&&X(Number(Kt.leverage)),Kt&&Kt.collateral!=null&&Number.isFinite(Number(Kt.collateral))){const Ot=Number(Kt.collateral);if(F(String(Ot)),gt&&gt>0&&Ot>0){const wn=Ot/gt*100;L(Math.max(0,Math.min(100,wn)))}else L(0)}else F(""),L(0);const gn=ot.trailing_up??((pt=ot==null?void 0:ot.trailing)==null?void 0:pt.up),yn=ot.trailing_down??((Wt=ot==null?void 0:ot.trailing)==null?void 0:Wt.down),hn=ot.sl_up??((Zt=ot==null?void 0:ot.sl)==null?void 0:Zt.up),br=ot.sl_down??((vt=ot==null?void 0:ot.sl)==null?void 0:vt.down);it(gn!=null&&Number.isFinite(Number(gn))?String(gn):""),at(yn!=null&&Number.isFinite(Number(yn))?String(yn):""),ct(hn!=null&&Number.isFinite(Number(hn))?String(hn):""),kt(br!=null&&Number.isFinite(Number(br))?String(br):""),jt(gn!=null&&Number.isFinite(Number(gn))),cn(yn!=null&&Number.isFinite(Number(yn))),Xe(hn!=null&&Number.isFinite(Number(hn))),Yt(br!=null&&Number.isFinite(Number(br)))};m.useEffect(()=>{if(typeof window>"u")return;if(!e||!(ce!=null&&ce.id)||!(ce!=null&&ce.address)){J(!1),ft();return}let ot=!1;async function gt(){re(!0);try{const Jt=window.localStorage.getItem("hyperToken");if(!Jt){ot||(J(!1),ft(),re(!1));return}const Ge={address:window.localStorage.getItem("hyperAddress"),token:Jt,wallet_id:Number(ce.id),source_market:"hyper",coin:String(e||"").toUpperCase()},We=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/info/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ge)})).json().catch(()=>null);if(ot)return;if(He.current){He.current=!1,re(!1);return}const wt=We&&We.data?We.data:We;wt&&typeof wt=="object"&&wt.is_deleted===!1&&wt.bot_params&&wt.bot_params?(xn(wt.bot_params,It),J(!0)):(J(!1),ft(),u(""),f(""))}catch{J(!1),ft(),u(""),f("")}finally{ot||re(!1)}}return gt(),()=>{ot=!0}},[e,ce==null?void 0:ce.id,ce==null?void 0:ce.address,Ve]),m.useEffect(()=>{if(typeof window>"u")return;const ot=window.localStorage.getItem("gridbot:pending_selection");if(!ot)return;let gt=null;try{gt=JSON.parse(ot)}catch{gt=null}if(!(!gt||gt.sourceMarket&&gt.sourceMarket!=="hyper"||String(gt.coin||"").toUpperCase()!==String(e||"").toUpperCase())){if(He.current=!0,xn(gt.botParams||{},It),gt.isActive===!0?J(!0):gt.isActive===!1&&J(!1),gt.walletId&&At&&At.length){const Jt=At.find(Ge=>String(Ge.wallet_id)===String(gt.walletId));if(Jt){const Ge={id:Jt.wallet_id,address:Jt.wallet_address};ye(Ge),typeof s=="function"&&s({id:String(Ge.id),address:Ge.address})}}try{window.localStorage.removeItem("gridbot:pending_selection")}catch{}}},[e,At,s,It]),m.useEffect(()=>{const ot=gt=>{const Jt=gt&&gt.detail&&gt.detail.sourceMarket;Jt&&Jt!=="hyper"||Ke(Ge=>Ge+1)};return window.addEventListener("gridbotUpdated",ot),()=>{window.removeEventListener("gridbotUpdated",ot)}},[]),m.useEffect(()=>{const ot=gt=>{const Jt=gt&&gt.detail;if(!Jt)return;const Ge=Jt.sourceMarket||Jt.source_market;if(Ge&&Ge!=="hyper"||String(Jt.coin||"").toUpperCase()!==String(e||"").toUpperCase())return;const We=Jt.botParams||{};if(xn(We,It),He.current=!0,Jt.isActive===!0?J(!0):Jt.isActive===!1&&J(!1),Jt.walletId&&At&&At.length){const wt=At.find(St=>String(St.wallet_id)===String(Jt.walletId));if(wt){const St={id:wt.wallet_id,address:wt.wallet_address};ye(St),typeof s=="function"&&s({id:String(St.id),address:St.address})}}};return window.addEventListener("gridbotSelectFromTasks",ot),()=>{window.removeEventListener("gridbotSelectFromTasks",ot)}},[e,At,s]);const dn=m.useMemo(()=>qmn(c,d,x,I),[c,d,x,I]),Mn=m.useMemo(()=>{if(!dn.length)return[];const ot=Number(c),gt=Number(d),Jt=Number.isFinite(ot)&&Number.isFinite(gt)?(ot+gt)/2:null;return dn.map(Ge=>({price:Ge,side:Jt==null?null:Ge>=Jt?"sell":"buy"}))},[dn,c,d]);m.useEffect(()=>{typeof a=="function"&&a(Mn)},[Mn,a]);const _n=ot=>{const gt=Number(ot);if(!(gt>0))return;const Jt=gt*.01;u((gt-Jt).toFixed(2)),f((gt+Jt).toFixed(2))},kn=m.useMemo(()=>{if(lt>0)return lt;const ot=Number(t||0);if(ot>0)return ot;const gt=Number(n||0);if(gt>0)return gt;const Jt=Number(c),Ge=Number(d);return Number.isFinite(Jt)&&Number.isFinite(Ge)&&Ge>Jt?(Jt+Ge)/2:0},[lt,t,n,c,d]);m.useEffect(()=>{let ot=!1;async function gt(){const Jt=Gmn(e);if(!Jt){Ie(null),Qe(null);return}try{const Ge=await Wmn();let et=null;e:for(const We of Ge)if(Array.isArray(We==null?void 0:We.universe)){for(const wt of We.universe)if(String((wt==null?void 0:wt.name)||"").toUpperCase()===Jt){const Kt=Number(wt.szDecimals);Number.isFinite(Kt)&&(et=Kt);break e}}if(ot)return;et!=null?Ie(et):(Ie(null),Qe(null))}catch{Ie(null),Qe(null)}}return e?gt():(Ie(null),Qe(null)),()=>{ot=!0}},[e]),m.useEffect(()=>{if(!Number.isFinite(je)){Qe(null);return}const ot=Kmn(kn,je);Qe(ot)},[kn,je]);const vn=kn,Qn=m.useMemo(()=>Math.min(ie,Math.max(1,Number(z)||1)),[z,ie]),Hn=Number(R)||0,$n=Hn*Qn,Jn=dn.length,Nn=kn>0?kn:lt,ln=Nn>0&&Jn>0&&$n>0?Number(($n/Jn/Nn).toFixed(5)):0,Oe=Number.isFinite(je)?je:Number.isFinite(qe==null?void 0:qe.sizeDecimals)?qe.sizeDecimals:4,sn=m.useMemo(()=>{if(Number.isFinite(Re))return Re;const ot=Number.isFinite(Oe)?Number(Oe):4,gt=Math.max(0,zmn-ot),Jt=Math.abs(Number(kn||0));if(!(Jt>0)||!Number.isFinite(Jt))return gt;const Ge=Jt>=1?Math.floor(Math.log10(Jt))+1:0,et=Math.max(0,5-Ge);return Math.min(gt,et)},[Re,Oe,kn]),fn=sn,Et=(qe==null?void 0:qe.minBaseAmount)??0,Kn=(qe==null?void 0:qe.minQuoteAmount)??0,Cn=ln>0?Number(ln.toFixed(Oe)):0,Bt=Cn>0&&Et>0&&Cn<Et,an=Cn>0&&Kn>0&&dn.length>0&&dn.some(ot=>ot*Cn<Kn),Pn=m.useMemo(()=>{if(Cn<=0||dn.length===0)return 0;let ot=1/0;for(const gt of dn){if(!(gt>0))continue;const Jt=gt*Cn;Jt<ot&&(ot=Jt)}return ot===1/0?0:ot},[Cn,dn]),qn=Cn<=0||Pn<Hmn,nr=kn>0&&$n>0&&Hn>0?ISe({entry:kn,side:"buy",notionalUSD:$n,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:Hn,isolatedMarginUSD:Hn}):null,tr=kn>0&&$n>0&&Hn>0?ISe({entry:kn,side:"sell",notionalUSD:$n,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:Hn,isolatedMarginUSD:Hn}):null,Qt=m.useMemo(()=>{if(!c&&!d)return"";const ot=Number(c),gt=Number(d);if(!Number.isFinite(ot)||!Number.isFinite(gt))return"";if(!(gt>ot))return"Upper price must be greater than lower price.";if(vn>0){if(ot>vn)return`Lower price cannot be above mark price (${vn.toFixed(sn)}).`;if(gt<vn)return`Upper price cannot be below mark price (${vn.toFixed(sn)}).`}return""},[c,d,vn,sn]),zn=m.useMemo(()=>{const ot=Number(c),gt=Number(d);return!(!Number.isFinite(ot)||!Number.isFinite(gt)||!(gt>ot)||vn>0&&(ot>vn||gt<vn))},[c,d,vn]),Yn=Number(c),Lt=Number(d),Fn=Number(Be),Ee=Number(tt),p=Number(dt),h=Number(Ut),S=tn&&(Be===""||!Number.isFinite(Fn)||!(Fn>Lt)),_=un&&(tt===""||!Number.isFinite(Ee)||!(Ee<Yn));m.useEffect(()=>{tn||it(""),un||at("")},[tn,un]),m.useEffect(()=>{Pt||ct(""),Vt||kt("")},[Pt,Vt]);const k=Pt&&(dt===""||!Number.isFinite(p)||!tn&&Number.isFinite(Lt)&&!(p>Lt)||tn&&Number.isFinite(Fn)&&!(p>Fn)),T=Vt&&(Ut===""||!Number.isFinite(h)||!un&&Number.isFinite(Yn)&&!(h<Yn)||un&&Number.isFinite(Ee)&&!(h<Ee)),B=Jn>1&&zn&&Hn>0&&Qn>0&&(ce==null?void 0:ce.id)&&(ce==null?void 0:ce.address),q=G>0,te=!!C,ue=Bt||an,de=S||_||k||T,xe=B&&!Z&&!he&&!Rt&&!q&&!te&&!ue&&!qn&&!de,we=he||Z||Rt||te||ue||qn||q||de?!1:ne?!0:B,ke=ne||he||Z||Rt;m.useEffect(()=>{if(!G)return;const ot=setInterval(()=>V(gt=>gt>1?gt-1:0),1e3);return()=>clearInterval(ot)},[G]);const Me=()=>{if(ke)return;const ot=lt>0?lt:kn>0?kn:Number(t||n||0);!Number.isFinite(ot)||ot<=0||_n(ot)},Ye=ot=>{if(ke)return;const gt=Math.max(0,Math.min(100,Number(ot)||0));if(L(gt),!It||It<=0){gt===0&&F("");return}const Jt=It*gt/100;F(Jt&&Number.isFinite(Jt)?String(Jt.toFixed(2)):"")},Fe=ot=>{if(ke)return;F(ot);const gt=Number(ot);if(!It||!Number.isFinite(gt)||gt<=0||It<=0){L(0);return}const Jt=gt/It*100;L(Math.max(0,Math.min(100,Jt)))},rt=async()=>{if(!xe||typeof window>"u"||!(ce!=null&&ce.address)||!(ce!=null&&ce.id))return;const ot=dn.filter(yn=>Number.isFinite(yn));if(ot.length<2)return;const gt=ot[0],Jt=ot[ot.length-1],Ge=(gt+Jt)/2,et=ot.length,We=window.localStorage.getItem("hyperToken");if(!We)return;if(tn&&S){on.error("Trailing Up is invalid.");return}if(un&&_){on.error("Trailing Down is invalid.");return}if(Pt&&k){const yn=tn?"SL Up must be greater than Trailing Up.":"SL Up must be greater than Upper price.";on.error(yn);return}if(Vt&&T){const yn=un?"SL Down must be less than Trailing Down.":"SL Down must be less than Lower price.";on.error(yn);return}const wt=Cn,St=HX(e),Kt={symbol:String(e||"").toUpperCase(),dex:St,gridType:I==="geometric"?"geometric":"arithmetic",direction:l,priceRange:{lower:Number(gt.toFixed(fn)),upper:Number(Jt.toFixed(fn)),middle:Number(Ge.toFixed(fn))},gridCount:et,gridPrices:ot.map(yn=>Number(yn.toFixed(fn))),investment:{collateral:Hn,leverage:Qn,totalInvestment:$n,qtyPerOrder:wt},liquidationPrices:{long:nr?Number(nr.toFixed(2)):null,short:tr?Number(tr.toFixed(2)):null},trailing_up:tn&&!S?Number(Fn.toFixed(fn)):null,trailing_down:un&&!_?Number(Ee.toFixed(fn)):null,sl_up:Pt&&!k?Number(p.toFixed(fn)):null,sl_down:Vt&&!T?Number(h.toFixed(fn)):null,marginMode:"Cross",currentPrice:kn||null,timestamp:new Date().toISOString()},gn={address:window.localStorage.getItem("hyperAddress"),token:We,wallet_id:Number(ce.id),source_market:"hyper",...St?{dex:St}:{},bot_params:Kt,coin:String(e||"").toUpperCase()};Y(!0);try{const hn=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/save/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(gn)})).json().catch(()=>null);if(!(hn&&(hn.success===!0||hn.status==="ok"||hn.status==="success"))){const pt=hn&&(hn.error_message||hn.message||hn.detail)||"Grid bot failed to start.";on.error(pt);return}J(!0),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"hyper"}})),on.success("Grid bot started.")}catch{on.error("An error occurred while starting the grid bot.")}finally{Y(!1)}},se=async()=>{if(typeof window>"u"||!(ce!=null&&ce.address)||!(ce!=null&&ce.id))return;const ot=window.localStorage.getItem("hyperToken");if(!ot)return;const gt=HX(e),Jt={address:window.localStorage.getItem("hyperAddress"),token:ot,wallet_id:Number(ce.id),source_market:"hyper",...gt?{dex:gt}:{},coin:String(e||"").toUpperCase()};Y(!0);try{const et=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/gridbot/stop/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Jt)})).json().catch(()=>null);if(!(et&&(et.success===!0||et.status==="ok"||et.status==="success"))){const wt=et&&(et.error_message||et.message||et.detail)||"Grid bot could not be stopped.";on.error(wt);return}J(!1),V(10),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"hyper"}})),on.success("Grid bot has been stopped.")}catch{on.error("An error occurred while stopping the grid bot.")}finally{Y(!1)}},Ce=()=>{we&&(ne?se():Ae(!0))},De=async()=>{xe&&(Ae(!1),await rt())},Le=he?ne?"Stopping...":"Starting...":ne?"Stop":q?`Stopping ${G}s`:"Start",_e=["xyz","vntl","flx"].includes(HX(e))?"Isolated":"Cross",nt=!1;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"h-full w-full flex flex-col text-[13px]",children:[i.jsx("div",{className:"px-3 pb-2 flex items-center justify-between border-b border-[#292929]"}),i.jsxs("div",{className:"flex-1 overflow-y-auto px-3 pb-3 space-y-4 mt-2",children:[i.jsxs("section",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Perps Wallet"}),i.jsx(bT,{wallets:At,value:ce&&ce.id?String(ce.id):"",onChange:ot=>{const gt=(At||[]).find(Jt=>String(Jt.wallet_id)===String(ot))||null;if(gt){const Jt={id:gt.wallet_id,address:gt.wallet_address};ye(Jt),typeof s=="function"&&s({id:String(Jt.id),address:Jt.address})}},selectedBalance:It})]}),i.jsxs("section",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center justify-between mt-2",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Price Range"}),i.jsx("button",{type:"button",onClick:Me,disabled:ke,className:"text-[11px] px-2 py-0.5 rounded-md bg-[#161616] border border-[#292929] text-white/60 hover:text-white disabled:opacity-60 disabled:cursor-not-allowed",children:"Autofill"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"text-[11px] text-white/40",children:"Lower"}),i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex items-center",children:i.jsx("input",{value:c,onChange:ot=>{ke||u(ot.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:ke})})]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"text-[11px] text-white/40",children:"Upper"}),i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex items-center",children:i.jsx("input",{value:d,onChange:ot=>{ke||f(ot.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:ke})})]})]}),vn>0&&i.jsxs("div",{className:"text-[11px] text-white/40",children:["Mark Price: ",vn.toFixed(sn)]}),Qt&&i.jsx("div",{className:"text-[11px] text-[#FF7173]",children:Qt})]}),i.jsxs("section",{className:"space-y-1",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("span",{className:"text-xs text-white/70",children:"Number of Grids (Even only)"})}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex-1 flex items-center",children:i.jsx("input",{value:v,onChange:ot=>{if(ke)return;const gt=ot.target.value.replace(/[^\d]/g,"");if(w(gt),N(""),gt==="")return;const Jt=Number(gt);if(Number.isFinite(Jt)){if(Jt<2){N("The minimum number of grids must be 2.");return}if(Jt>120){N("The maximum number of grids is 120.");return}if(Jt%2!==0){N("The number of grids must be even.");return}g(Jt)}},className:"bg-transparent outline-none flex-1 text-[13px]",inputMode:"numeric",disabled:ke})}),i.jsx("div",{className:"relative",children:i.jsx("select",{value:I,onChange:ot=>{ke||P(ot.target.value)},className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 text-[12px] outline-none",disabled:ke,children:Umn.map(ot=>i.jsx("option",{value:ot,className:"bg-[#101010]",children:ot[0].toUpperCase()+ot.slice(1)},ot))})})]}),i.jsx("div",{className:"text-[11px] text-white/40",children:C&&i.jsx("div",{className:"text-[11px] text-[#FF7173] mt-1",children:C})})]}),nt,i.jsxs("section",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Investment"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex-1 flex items-center",children:[i.jsx("input",{value:R,onChange:ot=>Fe(ot.target.value),className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"USDC",inputMode:"decimal",disabled:ke}),i.jsx("span",{className:"text-[11px] text-white/40 ml-1",children:"USDC"})]}),i.jsx("div",{className:"flex flex-col gap-1 w-[120px]",children:i.jsx(g4,{onClick:ie&&ie>0&&!ke?()=>ae(!0):void 0,children:ie&&ie>0?`${Qn}x`:"--"})})]}),i.jsxs("div",{className:"flex items-center gap-3 !mt-4 pb-6",children:[i.jsx(KN,{value:U,onChange:ot=>Ye(ot),accent:"#67FFBD"}),i.jsxs("div",{className:"h-[30px] rounded-lg flex items-center px-2",style:{width:84,background:jo,border:`1px solid ${ka}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-xs",inputMode:"numeric",value:U,onChange:ot=>Ye(Math.max(0,Math.min(100,Number(ot.target.value)||0))),style:{color:Vi,fontFeatureSettings:'"tnum"'},disabled:ke}),i.jsx("span",{style:{color:Oi},className:"ml-1",children:"%"})]})]}),i.jsxs("div",{className:"text-[11px] text-white/40 flex justify-between mt-2  border-t border-[#292929] pt-4 font-semibold",children:[i.jsxs("span",{children:["Max ",e,": ",`${ie}x`]}),i.jsxs("span",{children:["Total:"," ",$n>0?`${$n.toFixed(2)} USDC`:"--"]})]}),i.jsxs("div",{className:"text-[11px] text-white/40 flex justify-between font-semibold",children:[i.jsxs("span",{children:["Qty per order:"," ",Cn>0?`${Cn} ${e}`:"--"]}),i.jsxs("span",{children:["Margin Mode: ",_e]})]})]}),i.jsxs("section",{className:"pt-2 border-t border-[#292929]",children:[i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-white/40 mb-2",children:[i.jsx("span",{children:"Est. Liq Long"}),i.jsx("span",{children:nr?`$${nr.toLocaleString(void 0,{maximumFractionDigits:2})}`:"--"})]}),i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-white/40 mb-3",children:[i.jsx("span",{children:"Est. Liq Short"}),i.jsx("span",{children:tr?`$${tr.toLocaleString(void 0,{maximumFractionDigits:2})}`:"--"})]}),i.jsx("button",{type:"button",onClick:Ce,disabled:!we,className:`w-full h-[32px] rounded-xl font-bold text-[13px] flex items-center justify-center transition-opacity ${we?ne?"bg-[#FF7173] text-black hover:opacity-90":"bg-[#67FFBD] text-black hover:opacity-90":"bg-[#303030] text-white/40 cursor-not-allowed opacity-70"}`,children:Le}),Bt&&i.jsxs("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:["Quantity per order is below min size (",Et," ",e,")."]}),an&&i.jsxs("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:["Your order size is below minimum order size of $",Kn.toFixed(2),"."]}),qn&&i.jsx("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:"Each grid order must be at least $10 notional. Increase your investment, reduce the number of grids, or lower leverage."}),nt]})]})]}),i.jsx(qh,{open:ee,onClose:()=>ae(!1),children:i.jsxs(nm,{title:"Adjust Leverage",children:[i.jsxs("div",{className:"text-[12px] leading-5 mb-3",style:{color:Oi},children:["Control the leverage used for ",e," grid bot positions. The maximum leverage is ",ie,"x."]}),i.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[i.jsx("input",{type:"range",min:1,max:ie||1,step:1,value:z,onChange:ot=>X(Math.max(1,Math.min(ie||1,Number(ot.target.value)))),className:"flex-1",style:{accentColor:"#67FFBD"}}),i.jsxs("div",{className:"h-[36px] rounded-lg flex items-center px-2",style:{width:84,background:jo,border:`1px solid ${ka}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-white",inputMode:"numeric",value:z,onChange:ot=>{const gt=Number(ot.target.value)||1,Jt=Math.max(1,Math.min(ie||1,gt));X(Jt)}}),i.jsx("span",{className:"text-[11px] text-white/40 ml-1",children:"x"})]})]}),i.jsx(E0,{onClick:()=>ae(!1),children:"Confirm"})]})}),i.jsx(qh,{open:fe,onClose:()=>Ae(!1),children:i.jsxs(nm,{title:`${e} Grid Bot`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-4 text-[10px]",children:[i.jsx("span",{className:"px-2 py-0.5 rounded-full bg-[#151b23] text-[#9CA3AF]",children:_e}),i.jsxs("span",{className:"px-2 py-0.5 rounded-full bg-[#FF71731a] text-[#FF7173]",children:["Leverage ",Qn,"x"]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-y-2 gap-x-6 text-[12px] mb-4",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Oi},children:"Price Range"}),i.jsx("div",{className:"font-medium",style:{color:Vi},children:Number.isFinite(Number(c))&&Number.isFinite(Number(d))?`${Number(c).toFixed(fn)} - ${Number(d).toFixed(fn)} USDC`:"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Oi},children:"Number of Grids"}),i.jsx("div",{className:"font-medium",style:{color:Vi},children:Jn||"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Oi},children:"Mode"}),i.jsx("div",{className:"font-medium",style:{color:Vi},children:I==="geometric"?"Geometric":"Arithmetic"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Oi},children:"Qty Per Order"}),i.jsx("div",{className:"font-medium",style:{color:Vi},children:Cn>0?`${Cn} ${e}`:"--"})]}),nt,nt,nt,nt]}),i.jsx("div",{className:"mt-2 pt-3 border-t border-[#292929]",children:i.jsxs("div",{className:"flex items-center justify-between text-[12px]",children:[i.jsx("span",{className:"font-medium",style:{color:Vi},children:"Total Investment"}),i.jsx("span",{className:"font-semibold text-[#67FFBD]",children:$n>0?`${$n.toFixed(2)} USDC`:"--"})]})}),i.jsx("div",{className:"mt-4",children:i.jsx(E0,{onClick:De,disabled:he,children:he?"Starting...":"Confirm"})})]})})]})}const Ymn=["arithmetic","geometric"],Xmn=10,Qmn="https://express-proxy-delta.vercel.app/proxy?url=",Zmn="https://api.starknet.extended.exchange/api/v1";function Jmn(e,t,n,r,s,a=1){const o=Number(e),l=Number(t),c=Number(n);if(!Number.isFinite(o)||!Number.isFinite(l)||!Number.isFinite(c))return[];if(c<2||l<=o)return[];const u=Number.isFinite(Number(r))?Number(r):0,d=Math.max(1,Number(a)||1),f=Math.max(0,u)*d,x=c>0?f/c:0;if(s==="geometric"){if(!(o>0)||!(l>0))return[];const C=Math.pow(l/o,1/(c-1));return Array.from({length:c},(N,I)=>{const P=o*Math.pow(C,I),R=P>0?x/P:0;return{index:I,price:P,qty:R,order_size_usd:x}})}const g=(l-o)/(c-1),v=(o+l)/2,w=v>0?x/v:0;return Array.from({length:c},(C,N)=>{const I=o+g*N;return{index:N,price:I,qty:w,order_size_usd:x}})}function FSe({entry:e,side:t,notionalUSD:n,maintenanceFrac:r,marginMode:s,accountValueUSD:a,isolatedMarginUSD:o}){const l=Number(e)||0,c=Math.abs(Number(n)||0);if(!l||!c)return null;const u=t==="buy"?1:-1,d=Math.max(0,Number(r)||0),f=c/l,x=c*d;let g;s==="Cross"?g=a-x:g=o-x;const v=1-d*u;if(!f||!isFinite(v))return null;const w=l-u*(g/f)/v;return Math.max(0,w)}function VX(e){const t=String(e||""),n=t.indexOf(":");return n>0?t.slice(0,n).toLowerCase():"hl"}function e0n(e,t,n=6){if(!Number.isFinite(e)||e<=0)return n-0;const r=5,s=Math.max(0,n-0),a=Math.floor(Math.log10(e))+1,o=Math.max(0,r-a);return Math.min(s,o)}function OSe({coin:e,midPrice:t,selectedPrice:n,wallet:r,onWalletChange:s,onLevelsChange:a}){var yn,hn,br;const o=Aue(),[l]=m.useState("neutral"),[c,u]=m.useState(""),[d,f]=m.useState(""),[x,g]=m.useState(2),[v,w]=m.useState("2"),[C,N]=m.useState(""),[I,P]=m.useState("arithmetic"),[R,F]=m.useState(""),[U,L]=m.useState(0),[z,X]=m.useState(10),[ne,J]=m.useState(!1),[Z,re]=m.useState(!1),[he,Y]=m.useState(!1),[ie,oe]=m.useState(50),[G,V]=m.useState(0),[ee,ae]=m.useState(!1),[fe,Ae]=m.useState(!1),[ce,ye]=m.useState(()=>r&&r.id&&r.address?{id:r.id,address:r.address,apiKey:r.apiKey}:{id:null,address:null,apiKey:null}),[Ne,be]=m.useState({address:null,token:null}),[je,Ie]=m.useState(null),[Re,Qe]=m.useState(""),[Be,it]=m.useState(""),[tt,at]=m.useState(""),[dt,ct]=m.useState(""),[Ut,kt]=m.useState(!1),[tn,jt]=m.useState(!1),[un,cn]=m.useState(!1),[Pt,Xe]=m.useState(!1),[Vt,Yt]=m.useState(0),Ve=m.useRef(null),Ke=m.useRef(!1),ft=pt=>{const Wt=Number(pt);if(!Number.isFinite(Wt)||Wt<=0)return{num:null,str:""};const Zt=Wt>=3?Wt*.99:Wt,vt=Number(Zt.toFixed(2));return{num:Number.isFinite(vt)?vt:null,str:Number.isFinite(vt)?String(vt):""}},en=()=>{u(""),f(""),g(2),w("2"),P("arithmetic"),F(""),L(0),X(10),N(""),Qe(""),it(""),at(""),ct(""),kt(!1),jt(!1),cn(!1),Xe(!1),Ve.current=null,Ke.current=!1},{address:Dt,isConnected:At}=Yr();At||typeof window<"u"&&window.localStorage.getItem("hyperToken");const[Je,He]=m.useState([]),[Rt,qe]=m.useState(!1),lt=m.useRef(!1),xt=Rt&&(!Je||Je.length===0);m.useEffect(()=>{r&&r.id&&r.address&&ye(pt=>pt.id===r.id&&pt.address&&pt.address.toLowerCase()===r.address.toLowerCase()?pt:{id:r.id,address:r.address,apiKey:r.apiKey})},[r==null?void 0:r.id,r==null?void 0:r.address,r==null?void 0:r.apiKey]),m.useEffect(()=>{const pt=()=>{const Wt=typeof window<"u"?window.localStorage.getItem("hyperAddress"):null,Zt=typeof window<"u"?window.localStorage.getItem("hyperToken"):null;be({address:Wt,token:Zt})};return pt(),window.addEventListener("localStorageUpdated",pt),window.addEventListener("storage",pt),()=>{window.removeEventListener("localStorageUpdated",pt),window.removeEventListener("storage",pt)}},[]),m.useEffect(()=>{if(!Ne.address||!Ne.token){He([]);return}let pt=!1;return(async()=>{try{qe(!0);const vt=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-extended",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:Ne.address.toLowerCase(),token:Ne.token,balance:"true"})})).json().catch(()=>({}));if(pt)return;if(vt!=null&&vt.success&&Array.isArray(vt.data)){const Ot=vt.data.map((wn,Gn)=>({...wn,wallet_id:wn.wallet_id??wn.id??Gn,wallet_address:wn.wallet_address||"",wallet_name:wn.wallet_name||wn.name||`Extended Wallet ${Gn+1}`,wallet_api_key:wn.wallet_api_key||wn.api_key||null}));He(Ot)}else He([])}catch(Zt){pt||(console.error("Extended wallet list error",Zt),He([]))}finally{pt||qe(!1)}})(),()=>{pt=!0}},[Ne.address,Ne.token]),m.useEffect(()=>{if(ce.id||!Je||!Je.length)return;const pt=Je.find(Zt=>Zt.confirmed)||Je[0];if(!pt)return;const Wt={id:pt.wallet_id,address:pt.wallet_address,apiKey:pt.wallet_api_key};ye(Wt),typeof s=="function"&&s({id:String(Wt.id),address:Wt.address,apiKey:Wt.apiKey})},[Je,ce.id,s]),m.useEffect(()=>{if(!(ce!=null&&ce.id)||!(Je!=null&&Je.length))return;const pt=Je.find(vt=>String(vt.wallet_id)===String(ce.id));if(!pt||!(ce.apiKey!==pt.wallet_api_key||!ce.address&&pt.wallet_address))return;const Zt={id:pt.wallet_id,address:pt.wallet_address,apiKey:pt.wallet_api_key};ye(Zt),typeof s=="function"&&s({id:String(Zt.id),address:Zt.address,apiKey:Zt.apiKey})},[ce==null?void 0:ce.id,ce==null?void 0:ce.apiKey,ce==null?void 0:ce.address,Je,s]),m.useEffect(()=>{e&&(en(),J(!1))},[e]);const Nt=m.useMemo(()=>{if(!e)return null;const pt=String(e).toUpperCase(),Wt=pt.replace(/-USD$/,"");return o.find(Zt=>{const vt=String((Zt==null?void 0:Zt.symbol)||"").toUpperCase(),Ot=String((Zt==null?void 0:Zt.rawSymbol)||"").toUpperCase();return vt===pt||Ot===pt||vt===Wt||Ot===Wt})||null},[o,e]),It=m.useMemo(()=>{const pt=Nt==null?void 0:Nt.marketStats,Wt=(pt==null?void 0:pt.markPrice)??(pt==null?void 0:pt.lastPrice)??(pt==null?void 0:pt.indexPrice)??(Nt==null?void 0:Nt.lastPrice)??(Nt==null?void 0:Nt.markPrice)??(Nt==null?void 0:Nt.last)??null,Zt=Number(Wt);return Number.isFinite(Zt)?Zt:0},[Nt]);m.useEffect(()=>{var Zt;const pt=((Zt=Nt==null?void 0:Nt.tradingConfig)==null?void 0:Zt.maxLeverage)??(Nt==null?void 0:Nt.maxLeverage)??(Nt==null?void 0:Nt.leverage),Wt=Number(pt);!Number.isFinite(Wt)||Wt<=0||(oe(Wt),X(vt=>Math.min(Wt,Math.max(1,Number(vt)||1))))},[Nt]);const xn=(ce==null?void 0:ce.address)||(Dt?Dt.toLowerCase():null),{perpsOverview:dn}=gT(xn),Mn=m.useMemo(()=>{const pt=Je.find(wn=>String(wn.wallet_id)===String(ce==null?void 0:ce.id)),Wt=(pt==null?void 0:pt.available_balance)??(pt==null?void 0:pt.balance)??null,Zt=Number(Wt);if(!(ce!=null&&ce.apiKey))return Number.isFinite(Zt)?Zt:null;const vt=Number(je==null?void 0:je.availableForTrade);if(Number.isFinite(vt))return vt;if(Number.isFinite(Zt))return Zt;if(!dn||dn.balance==null)return null;const Ot=Number(dn.balance);return Number.isFinite(Ot)?Ot:null},[je,dn,ce==null?void 0:ce.apiKey,ce==null?void 0:ce.id,Je]);m.useEffect(()=>{if(!(ce!=null&&ce.apiKey)){Ie(null);return}let pt=!1;const Wt=async()=>{var vt,Ot,wn;try{const Gn=`${Qmn}${encodeURIComponent(`${Zmn}/user/balance`)}`,ur=await(await fetch(Gn,{headers:{"X-Api-Key":ce.apiKey}})).json().catch(()=>null);if(!pt){const $t=((vt=ur==null?void 0:ur.data)==null?void 0:vt.availableForTrade)??(ur==null?void 0:ur.availableForTrade)??((Ot=ur==null?void 0:ur.data)==null?void 0:Ot.available_balance)??(ur==null?void 0:ur.available_balance)??((wn=ur==null?void 0:ur.data)==null?void 0:wn.available)??(ur==null?void 0:ur.available),nn=Number($t);Ie({availableForTrade:Number.isFinite(nn)&&nn>=0?nn:null,raw:ur})}}catch{pt||Ie(null)}};Wt();const Zt=setInterval(Wt,2e4);return()=>{pt=!0,clearInterval(Zt)}},[ce==null?void 0:ce.apiKey]);const _n=(pt,Wt)=>{var us,xr,vr,rs;const Zt=pt.priceRange||{},Ot=(Array.isArray(pt.gridPrices)?pt.gridPrices:[]).map(Zr=>Zr&&typeof Zr=="object"&&Zr.price!=null?Number(Zr.price):Number(Zr)).filter(Zr=>Number.isFinite(Zr));let wn=Zt.lower,Gn=Zt.upper;(!Number.isFinite(wn)||!Number.isFinite(Gn))&&Ot.length>=2&&(wn=Ot[0],Gn=Ot[Ot.length-1]),Number.isFinite(wn)?u(String(wn)):u(""),Number.isFinite(Gn)?f(String(Gn)):f("");let fr=pt.gridCount;Number.isFinite(fr)||Ot.length>=2&&(fr=Ot.length),Number.isFinite(fr)?(g(fr),w(String(fr))):(g(2),w("2"));let ur=pt.gridType;ur!=="geometric"&&ur!=="arithmetic"&&(ur="arithmetic"),P(ur);const $t=pt.investment||{};$t&&$t.leverage!=null&&Number.isFinite(Number($t.leverage))&&X(Number($t.leverage));const nn=$t.wallet_balance??$t.walletBalance??$t.balance??$t.available_balance??$t.availableBalance??null,Vn=($t==null?void 0:$t.collateral_input)??($t==null?void 0:$t.collateralInput)??($t==null?void 0:$t.collateral)??($t==null?void 0:$t.collateral_used)??($t==null?void 0:$t.collateralUsed)??($t==null?void 0:$t.collateralEffective)??null,lr=Number(Vn);if($t&&Number.isFinite(lr)){const{num:Zr,str:gi}=ft(lr);F(gi),Ve.current=Zr;const oi=$t.percentChosen!=null?Number($t.percentChosen):$t.percent!=null?Number($t.percent):null,la=oi!=null&&Number.isFinite(oi),jr=Number(nn);if(la)L(Math.max(0,Math.min(100,oi))),Ke.current=!1;else{const Xt=Number.isFinite(jr)&&jr>0?jr:Wt;if(Xt&&Xt>0&&Zr>0){const pe=Zr/Xt*100;L(Math.max(0,Math.min(100,pe))),Ke.current=!1}else L(0),Ke.current=Zr>0}}else F(""),L(0),Ve.current=null,Ke.current=!1;const er=pt.trailing_up??((us=pt==null?void 0:pt.trailing)==null?void 0:us.up),gr=pt.trailing_down??((xr=pt==null?void 0:pt.trailing)==null?void 0:xr.down),dr=pt.sl_up??((vr=pt==null?void 0:pt.sl)==null?void 0:vr.up),Fs=pt.sl_down??((rs=pt==null?void 0:pt.sl)==null?void 0:rs.down);Qe(er!=null&&Number.isFinite(Number(er))?String(er):""),it(gr!=null&&Number.isFinite(Number(gr))?String(gr):""),at(dr!=null&&Number.isFinite(Number(dr))?String(dr):""),ct(Fs!=null&&Number.isFinite(Number(Fs))?String(Fs):""),kt(er!=null&&Number.isFinite(Number(er))),jt(gr!=null&&Number.isFinite(Number(gr))),cn(dr!=null&&Number.isFinite(Number(dr))),Xe(Fs!=null&&Number.isFinite(Number(Fs)))};m.useEffect(()=>{if(!Ke.current)return;const pt=Number(Ve.current),Wt=Number(Mn);if(!Number.isFinite(pt)||pt<=0||!Number.isFinite(Wt)||Wt<=0)return;const Zt=pt/Wt*100;L(Math.max(0,Math.min(100,Zt))),Ke.current=!1},[Mn]),m.useEffect(()=>{if(typeof window>"u")return;if(!e||!(ce!=null&&ce.id)||!(ce!=null&&ce.address)){J(!1),en();return}let pt=!1;async function Wt(){re(!0);try{const Zt=window.localStorage.getItem("hyperToken");if(!Zt){pt||(J(!1),en(),re(!1));return}const vt={address:window.localStorage.getItem("hyperAddress"),token:Zt,wallet_id:Number(ce.id),source_market:"extended",coin:String(e||"").toUpperCase()},wn=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/extended_bot/info/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(vt)})).json().catch(()=>null);if(pt)return;if(lt.current){lt.current=!1,re(!1);return}const Gn=wn&&wn.data?wn.data:wn,ur=(Array.isArray(Gn)?Gn:[Gn]).filter(Boolean).filter(nn=>nn&&typeof nn=="object"&&String(nn.coin||"").toUpperCase()===String(e||"").toUpperCase()&&String(nn.wallet_id||"")===String(ce.id||"")),$t=ur.find(nn=>nn&&typeof nn=="object"&&nn.is_deleted===!1&&nn.bot_params)||ur.find(nn=>nn&&typeof nn=="object"&&nn.is_deleted!==!0&&nn.bot_params)||null;if($t){if($t.wallet_id&&String($t.wallet_id)!==String(ce.id)){const nn=Je.find(Vn=>String(Vn.wallet_id)===String($t.wallet_id));if(nn){const Vn={id:nn.wallet_id,address:nn.wallet_address,apiKey:nn.wallet_api_key};ye(Vn),typeof s=="function"&&s({id:String(Vn.id),address:Vn.address,apiKey:Vn.apiKey})}}_n($t.bot_params,Mn),J(!0)}else J(!1),en(),u(""),f("")}catch{J(!1),en(),u(""),f("")}finally{pt||re(!1)}}return Wt(),()=>{pt=!0}},[e,ce==null?void 0:ce.id,ce==null?void 0:ce.address,Vt,Je,s]),m.useEffect(()=>{if(typeof window>"u")return;const pt=window.localStorage.getItem("gridbot:pending_selection");if(!pt)return;let Wt=null;try{Wt=JSON.parse(pt)}catch{Wt=null}if(!(!Wt||Wt.sourceMarket&&Wt.sourceMarket!=="extended"||String(Wt.coin||"").toUpperCase()!==String(e||"").toUpperCase())){if(lt.current=!0,_n(Wt.botParams||{},Mn),Wt.isActive===!0?J(!0):Wt.isActive===!1&&J(!1),Wt.walletId&&Je&&Je.length){const Zt=Je.find(vt=>String(vt.wallet_id)===String(Wt.walletId));if(Zt){const vt={id:Zt.wallet_id,address:Zt.wallet_address,apiKey:Zt.wallet_api_key};ye(vt),typeof s=="function"&&s({id:String(vt.id),address:vt.address,apiKey:vt.apiKey})}}try{window.localStorage.removeItem("gridbot:pending_selection")}catch{}}},[e,Je,s,Mn]),m.useEffect(()=>{const pt=Wt=>{const Zt=Wt&&Wt.detail&&Wt.detail.sourceMarket;Zt&&Zt!=="extended"||Yt(vt=>vt+1)};return window.addEventListener("gridbotUpdated",pt),()=>{window.removeEventListener("gridbotUpdated",pt)}},[]),m.useEffect(()=>{const pt=Wt=>{const Zt=Wt&&Wt.detail;if(!Zt)return;const vt=Zt.sourceMarket||Zt.source_market;if(vt&&vt!=="extended"||String(Zt.coin||"").toUpperCase()!==String(e||"").toUpperCase())return;const wn=Zt.botParams||{};if(_n(wn,Mn),lt.current=!0,Zt.isActive===!0?J(!0):Zt.isActive===!1&&J(!1),Zt.walletId&&Je&&Je.length){const Gn=Je.find(fr=>String(fr.wallet_id)===String(Zt.walletId));if(Gn){const fr={id:Gn.wallet_id,address:Gn.wallet_address,apiKey:Gn.wallet_api_key};ye(fr),typeof s=="function"&&s({id:String(fr.id),address:fr.address,apiKey:fr.apiKey})}}};return window.addEventListener("gridbotSelectFromTasks",pt),()=>{window.removeEventListener("gridbotSelectFromTasks",pt)}},[e,Je,s]);const kn=m.useMemo(()=>Math.min(ie,Math.max(1,Number(z)||1)),[z,ie]),vn=Number(R)||0,Qn=vn,Hn=m.useMemo(()=>Jmn(c,d,x,vn,I,kn),[c,d,x,vn,I,kn]),$n=m.useMemo(()=>{if(!Hn.length)return[];const pt=Number(c),Wt=Number(d),Zt=Number.isFinite(pt)&&Number.isFinite(Wt)?(pt+Wt)/2:null;return Hn.map(vt=>({price:vt.price,side:Zt==null?null:Number(vt.price)>=Zt?"sell":"buy"}))},[Hn,c,d]);m.useEffect(()=>{typeof a=="function"&&a($n)},[$n,a]);const Jn=pt=>{const Wt=Number(pt);if(!(Wt>0))return;const Zt=Wt*.01;u((Wt-Zt).toFixed(2)),f((Wt+Zt).toFixed(2))},Nn=m.useMemo(()=>{if(It>0)return It;const pt=Number(t||0);if(pt>0)return pt;const Wt=Number(n||0);if(Wt>0)return Wt;const Zt=Number(c),vt=Number(d);return Number.isFinite(Zt)&&Number.isFinite(vt)&&vt>Zt?(Zt+vt)/2:0},[It,t,n,c,d]),ln=Nn,Oe=vn*kn,sn=Hn.length,fn=m.useMemo(()=>{if(!Hn.length)return 0;let pt=0,Wt=0;for(const Zt of Hn){const vt=Number(Zt==null?void 0:Zt.qty);Number.isFinite(vt)&&(pt+=vt,Wt+=1)}return Wt?pt/Wt:0},[Hn]),Et=Number(Nt==null?void 0:Nt.collateralAssetPrecision),Kn=Number(Nt==null?void 0:Nt.assetPrecision),Cn=(yn=Nt==null?void 0:Nt.tradingConfig)==null?void 0:yn.minOrderSizeChange,Bt=(()=>{const pt=Number(Cn);if(!Number.isFinite(pt))return null;const[,Wt=""]=String(Cn).split(".");return Math.max(0,Wt.length)})(),an=Number.isFinite(Et)?Et:Number.isFinite(Kn)?Kn:4,Pn=Bt!=null&&Number.isFinite(Bt)?Bt:an,qn=Number((hn=Nt==null?void 0:Nt.tradingConfig)==null?void 0:hn.minPriceChange),nr=m.useMemo(()=>Number.isFinite(qn)&&qn>0?qn>=1?0:Math.min(8,Math.max(0,-Math.floor(Math.log10(qn)))):e0n(Nn),[qn,Nn]),tr=nr,Qt=Number(((br=Nt==null?void 0:Nt.tradingConfig)==null?void 0:br.minOrderSize)??0),zn=0,Yn=fn>0?Number(fn.toFixed(Pn)):0,Lt=m.useMemo(()=>Hn.some(pt=>Number(pt==null?void 0:pt.qty)>0),[Hn]),Fn=Lt&&Qt>0&&Hn.some(pt=>{const Wt=Number(pt==null?void 0:pt.qty);return Number.isFinite(Wt)?Wt<Qt:!1}),Ee=Lt&&zn>0,p=m.useMemo(()=>{if(!Lt||Hn.length===0)return 0;let pt=1/0;for(const Wt of Hn){const Zt=Number(Wt==null?void 0:Wt.price),vt=Number(Wt==null?void 0:Wt.qty);if(!Number.isFinite(Zt)||!Number.isFinite(vt))continue;if(Zt<=0||vt<=0){pt=0;break}const Ot=Zt*vt;Ot<pt&&(pt=Ot)}return pt===1/0?0:pt},[Lt,Hn]),h=!Lt||p<Xmn,S=Nn>0&&Oe>0&&vn>0?FSe({entry:Nn,side:"buy",notionalUSD:Oe,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:vn,isolatedMarginUSD:vn}):null,_=Nn>0&&Oe>0&&vn>0?FSe({entry:Nn,side:"sell",notionalUSD:Oe,maintenanceFrac:.01,marginMode:"Cross",accountValueUSD:vn,isolatedMarginUSD:vn}):null,k=m.useMemo(()=>{if(!c&&!d)return"";const pt=Number(c),Wt=Number(d);if(!Number.isFinite(pt)||!Number.isFinite(Wt))return"";if(!(Wt>pt))return"Upper price must be greater than lower price.";if(ln>0){if(pt>ln)return`Lower price cannot be above mark price (${ln.toFixed(nr)}).`;if(Wt<ln)return`Upper price cannot be below mark price (${ln.toFixed(nr)}).`}return""},[c,d,ln,nr]),T=m.useMemo(()=>{const pt=Number(c),Wt=Number(d);return!(!Number.isFinite(pt)||!Number.isFinite(Wt)||!(Wt>pt)||ln>0&&(pt>ln||Wt<ln))},[c,d,ln]),B=Number(c),q=Number(d),te=Number(Re),ue=Number(Be),de=Number(tt),xe=Number(dt),we=Ut&&(Re===""||!Number.isFinite(te)||!(te>q)),ke=tn&&(Be===""||!Number.isFinite(ue)||!(ue<B));m.useEffect(()=>{Ut||Qe(""),tn||it("")},[Ut,tn]),m.useEffect(()=>{un||at(""),Pt||ct("")},[un,Pt]);const Me=un&&(tt===""||!Number.isFinite(de)||!Ut&&Number.isFinite(q)&&!(de>q)||Ut&&Number.isFinite(te)&&!(de>te)),Ye=Pt&&(dt===""||!Number.isFinite(xe)||!tn&&Number.isFinite(B)&&!(xe<B)||tn&&Number.isFinite(ue)&&!(xe<ue)),Fe=sn>1&&T&&vn>0&&kn>0&&(ce==null?void 0:ce.id)&&(ce==null?void 0:ce.address),rt=G>0,se=!!C,Ce=Fn||Ee,De=we||ke||Me||Ye,Le=Fe&&!Z&&!he&&!xt&&!rt&&!se&&!Ce&&!h&&!De,_e=he||Z||xt||se||Ce||h||rt||De?!1:ne?!0:Fe,nt=ne||he||Z||xt;m.useEffect(()=>{if(!G)return;const pt=setInterval(()=>V(Wt=>Wt>1?Wt-1:0),1e3);return()=>clearInterval(pt)},[G]);const ot=()=>{if(nt)return;const pt=It>0?It:Nn>0?Nn:Number(t||n||0);!Number.isFinite(pt)||pt<=0||Jn(pt)},gt=pt=>{if(nt)return;Ke.current=!1;const Wt=Math.max(0,Math.min(100,Number(pt)||0));if(L(Wt),!Mn||Mn<=0){Wt===0&&F("");return}const Zt=Mn*Wt/100,{str:vt}=ft(Zt);F(vt)},Jt=pt=>{if(nt)return;Ke.current=!1;const{num:Wt,str:Zt}=ft(pt);F(Zt);const vt=Wt;if(!Mn||!Number.isFinite(vt)||vt<=0||Mn<=0){L(0);return}const Ot=vt/Mn*100;L(Math.max(0,Math.min(100,Ot)))},Ge=async()=>{if(!Le||typeof window>"u"||!(ce!=null&&ce.address)||!(ce!=null&&ce.id))return;const pt=Hn.filter(nn=>Number.isFinite(nn==null?void 0:nn.price));if(pt.length<2)return;const Wt=pt[0],Zt=pt[pt.length-1],vt=(Wt.price+Zt.price)/2,Ot=pt.length,wn=window.localStorage.getItem("hyperToken");if(!wn)return;if(Ut&&we){on.error("Trailing Up is invalid.");return}if(tn&&ke){on.error("Trailing Down is invalid.");return}if(un&&Me){const nn=Ut?"SL Up must be greater than Trailing Up.":"SL Up must be greater than Upper price.";on.error(nn);return}if(Pt&&Ye){const nn=tn?"SL Down must be less than Trailing Down.":"SL Down must be less than Lower price.";on.error(nn);return}const Gn=Yn,fr=VX(e),ur={symbol:String(e||"").toUpperCase(),dex:fr,gridType:I==="geometric"?"geometric":"arithmetic",direction:l,priceRange:{lower:Number(Wt.price.toFixed(tr)),upper:Number(Zt.price.toFixed(tr)),middle:Number(vt.toFixed(tr))},gridCount:Ot,gridPrices:pt.map(nn=>({price:Number(nn.price.toFixed(tr)),qty:Number(Number(nn.qty||0).toFixed(Pn))})),investment:{collateral:Qn,collateralUsed:vn,percentChosen:U,leverage:kn,totalInvestment:Oe,qtyPerOrder:Gn},liquidationPrices:{long:S?Number(S.toFixed(2)):null,short:_?Number(_.toFixed(2)):null},trailing_up:Ut&&!we?Number(te.toFixed(tr)):null,trailing_down:tn&&!ke?Number(ue.toFixed(tr)):null,sl_up:un&&!Me?Number(de.toFixed(tr)):null,sl_down:Pt&&!Ye?Number(xe.toFixed(tr)):null,marginMode:"Cross",currentPrice:Nn||null,timestamp:new Date().toISOString()},$t={address:window.localStorage.getItem("hyperAddress"),token:wn,wallet_id:Number(ce.id),source_market:"extended",bot_params:ur,coin:String(e||"").toUpperCase()};Y(!0);try{const Vn=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/extended_bot/save/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($t)})).json().catch(()=>null);if(!(Vn&&(Vn.success===!0||Vn.status==="ok"||Vn.status==="success"))){const er=Vn&&(Vn.error_message||Vn.message||Vn.detail)||"Grid bot failed to start.";on.error(er);return}J(!0),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"extended"}})),on.success("Grid bot started.")}catch{on.error("An error occurred while starting the grid bot.")}finally{Y(!1)}},et=async()=>{if(typeof window>"u"||!(ce!=null&&ce.address)||!(ce!=null&&ce.id))return;const pt=window.localStorage.getItem("hyperToken");if(!pt)return;VX(e);const Wt={address:window.localStorage.getItem("hyperAddress"),token:pt,wallet_id:Number(ce.id),source_market:"extended",coin:String(e||"").toUpperCase()};Y(!0);try{const vt=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/extended_bot/stop/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Wt)})).json().catch(()=>null);if(!(vt&&(vt.success===!0||vt.status==="ok"||vt.status==="success"))){const wn=vt&&(vt.error_message||vt.message||vt.detail)||"Grid bot could not be stopped.";on.error(wn);return}J(!1),V(10),typeof window<"u"&&window.dispatchEvent(new CustomEvent("gridbotUpdated",{detail:{sourceMarket:"extended"}})),on.success("Grid bot has been stopped.")}catch{on.error("An error occurred while stopping the grid bot.")}finally{Y(!1)}},We=()=>{_e&&(ne?et():Ae(!0))},wt=async()=>{Le&&(Ae(!1),await Ge())},St=he?ne?"Stopping...":"Starting...":ne?"Stop":rt?`Stopping ${G}s`:"Start",Kt=["xyz","vntl","flx"].includes(VX(e))?"Isolated":"Cross",gn=!1;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"h-full w-full flex flex-col text-[13px]",children:[i.jsx("div",{className:"px-3 pb-2 flex items-center justify-between border-b border-[#292929]"}),i.jsxs("div",{className:"flex-1 overflow-y-auto px-3 pb-3 space-y-4 mt-2",children:[i.jsxs("section",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Perps Wallet"}),i.jsx(bT,{wallets:Je,mode:"extended",value:ce&&ce.id?String(ce.id):"",onChange:pt=>{const Wt=(Je||[]).find(Zt=>String(Zt.wallet_id)===String(pt))||null;if(Wt){const Zt={id:Wt.wallet_id,address:Wt.wallet_address,apiKey:Wt.wallet_api_key};ye(Zt),typeof s=="function"&&s({id:String(Zt.id),address:Zt.address,apiKey:Zt.apiKey})}},selectedBalance:Mn})]}),i.jsxs("section",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center justify-between mt-2",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Price Range"}),i.jsx("button",{type:"button",onClick:ot,disabled:nt,className:"text-[11px] px-2 py-0.5 rounded-md bg-[#161616] border border-[#292929] text-white/60 hover:text-white disabled:opacity-60 disabled:cursor-not-allowed",children:"Autofill"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"text-[11px] text-white/40",children:"Lower"}),i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex items-center",children:i.jsx("input",{value:c,onChange:pt=>{nt||u(pt.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:nt})})]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"text-[11px] text-white/40",children:"Upper"}),i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex items-center",children:i.jsx("input",{value:d,onChange:pt=>{nt||f(pt.target.value)},className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"0",inputMode:"decimal",disabled:nt})})]})]}),ln>0&&i.jsxs("div",{className:"text-[11px] text-white/40",children:["Mark Price: ",ln.toFixed(nr)]}),k&&i.jsx("div",{className:"text-[11px] text-[#FF7173]",children:k})]}),i.jsxs("section",{className:"space-y-1",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("span",{className:"text-xs text-white/70",children:"Number of Grids (Even only)"})}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex-1 flex items-center",children:i.jsx("input",{value:v,onChange:pt=>{if(nt)return;const Wt=pt.target.value.replace(/[^\d]/g,"");if(w(Wt),N(""),Wt==="")return;const Zt=Number(Wt);if(Number.isFinite(Zt)){if(Zt<2){N("The minimum number of grids must be 2.");return}if(Zt>200){N("The maximum number of grids is 200.");return}if(Zt%2!==0){N("The number of grids must be even.");return}g(Zt)}},className:"bg-transparent outline-none flex-1 text-[13px]",inputMode:"numeric",disabled:nt})}),i.jsx("div",{className:"relative",children:i.jsx("select",{value:I,onChange:pt=>{nt||P(pt.target.value)},className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 text-[12px] outline-none",disabled:nt,children:Ymn.map(pt=>i.jsx("option",{value:pt,className:"bg-[#101010]",children:pt[0].toUpperCase()+pt.slice(1)},pt))})})]}),i.jsx("div",{className:"text-[11px] text-white/40",children:C&&i.jsx("div",{className:"text-[11px] text-[#FF7173] mt-1",children:C})})]}),gn,i.jsxs("section",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs text-white/70",children:"Investment"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("div",{className:"bg-[#161616] border border-[#292929] rounded-lg px-2 py-1.5 flex-1 flex items-center",children:[i.jsx("input",{value:R,onChange:pt=>Jt(pt.target.value),className:"bg-transparent outline-none flex-1 text-[13px]",placeholder:"USDC",inputMode:"decimal",disabled:nt}),i.jsx("span",{className:"text-[11px] text-white/40 ml-1",children:"USDC"})]}),i.jsx("div",{className:"flex flex-col gap-1 w-[120px]",children:i.jsx(g4,{onClick:ie&&ie>0&&!nt?()=>ae(!0):void 0,children:ie&&ie>0?`${kn}x`:"--"})})]}),i.jsxs("div",{className:"flex items-center gap-3 !mt-4 pb-6",children:[i.jsx(KN,{value:U,onChange:pt=>gt(pt),accent:"#67FFBD"}),i.jsxs("div",{className:"h-[30px] rounded-lg flex items-center px-2",style:{width:84,background:jo,border:`1px solid ${ka}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-xs",inputMode:"numeric",value:U,onChange:pt=>gt(Math.max(0,Math.min(100,Number(pt.target.value)||0))),style:{color:Vi,fontFeatureSettings:'"tnum"'},disabled:nt}),i.jsx("span",{style:{color:Oi},className:"ml-1",children:"%"})]})]}),i.jsxs("div",{className:"text-[11px] text-white/40 flex justify-between mt-2  border-t border-[#292929] pt-4 font-semibold",children:[i.jsxs("span",{children:["Max ",e,": ",`${ie}x`]}),i.jsxs("span",{children:["Total:"," ",Oe>0?`${Oe.toFixed(2)} USDC`:"--"]})]}),i.jsxs("div",{className:"text-[11px] text-white/40 flex justify-between font-semibold",children:[i.jsxs("span",{children:["Qty per order:"," ",Yn>0?`${Yn} ${e}`:"--"]}),i.jsxs("span",{children:["Margin Mode: ",Kt]})]})]}),i.jsxs("section",{className:"pt-2 border-t border-[#292929]",children:[i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-white/40 mb-2",children:[i.jsx("span",{children:"Est. Liq Long"}),i.jsx("span",{children:S?`$${S.toLocaleString(void 0,{maximumFractionDigits:2})}`:"--"})]}),i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-white/40 mb-3",children:[i.jsx("span",{children:"Est. Liq Short"}),i.jsx("span",{children:_?`$${_.toLocaleString(void 0,{maximumFractionDigits:2})}`:"--"})]}),i.jsx("button",{type:"button",onClick:We,disabled:!_e,className:`w-full h-[32px] rounded-xl font-bold text-[13px] flex items-center justify-center transition-opacity ${_e?ne?"bg-[#FF7173] text-black hover:opacity-90":"bg-[#67FFBD] text-black hover:opacity-90":"bg-[#303030] text-white/40 cursor-not-allowed opacity-70"}`,children:St}),Fn&&i.jsxs("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:["Quantity per order is below min size (",Qt," ",e,")."]}),Ee,h&&i.jsx("div",{className:"mt-2 text-[11px] text-[#FF7173] text-center",children:"Each grid order must be at least $10 notional. Increase your investment, reduce the number of grids, or lower leverage."}),gn]})]})]}),i.jsx(qh,{open:ee,onClose:()=>ae(!1),children:i.jsxs(nm,{title:"Adjust Leverage",children:[i.jsxs("div",{className:"text-[12px] leading-5 mb-3",style:{color:Oi},children:["Control the leverage used for ",e," grid bot positions. The maximum leverage is ",ie,"x."]}),i.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[i.jsx("input",{type:"range",min:1,max:ie||1,step:1,value:z,onChange:pt=>X(Math.max(1,Math.min(ie||1,Number(pt.target.value)))),className:"flex-1",style:{accentColor:"#67FFBD"}}),i.jsxs("div",{className:"h-[36px] rounded-lg flex items-center px-2",style:{width:84,background:jo,border:`1px solid ${ka}`},children:[i.jsx("input",{className:"w-full bg-transparent outline-none text-right text-white",inputMode:"numeric",value:z,onChange:pt=>{const Wt=Number(pt.target.value)||1,Zt=Math.max(1,Math.min(ie||1,Wt));X(Zt)}}),i.jsx("span",{className:"text-[11px] text-white/40 ml-1",children:"x"})]})]}),i.jsx(E0,{onClick:()=>ae(!1),children:"Confirm"})]})}),i.jsx(qh,{open:fe,onClose:()=>Ae(!1),children:i.jsxs(nm,{title:`${e} Grid Bot`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-4 text-[10px]",children:[i.jsx("span",{className:"px-2 py-0.5 rounded-full bg-[#151b23] text-[#9CA3AF]",children:Kt}),i.jsxs("span",{className:"px-2 py-0.5 rounded-full bg-[#FF71731a] text-[#FF7173]",children:["Leverage ",kn,"x"]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-y-2 gap-x-6 text-[12px] mb-4",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Oi},children:"Price Range"}),i.jsx("div",{className:"font-medium",style:{color:Vi},children:Number.isFinite(Number(c))&&Number.isFinite(Number(d))?`${Number(c).toFixed(tr)} - ${Number(d).toFixed(tr)} USDC`:"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Oi},children:"Number of Grids"}),i.jsx("div",{className:"font-medium",style:{color:Vi},children:sn||"--"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Oi},children:"Mode"}),i.jsx("div",{className:"font-medium",style:{color:Vi},children:I==="geometric"?"Geometric":"Arithmetic"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-[11px]",style:{color:Oi},children:"Qty Per Order"}),i.jsx("div",{className:"font-medium",style:{color:Vi},children:Yn>0?`${Yn} ${e}`:"--"})]}),gn,gn,gn,gn]}),i.jsx("div",{className:"mt-2 pt-3 border-t border-[#292929]",children:i.jsxs("div",{className:"flex items-center justify-between text-[12px]",children:[i.jsx("span",{className:"font-medium",style:{color:Vi},children:"Total Investment"}),i.jsx("span",{className:"font-semibold text-[#67FFBD]",children:Oe>0?`${Oe.toFixed(2)} USDC`:"--"})]})}),i.jsx("div",{className:"mt-4",children:i.jsx(E0,{onClick:wt,disabled:he,children:he?"Starting...":"Confirm"})})]})})]})}const YN="/assets/fee-animation-Cvx53PQy.mp4",t0n="wss://mainnet.zklighter.elliot.ai/stream",n0n="https://api.hyperliquid.xyz/info",eD=e=>e==null?0:Number(e),tD=(e,t=6)=>isNaN(e)?"--":e.toLocaleString(void 0,{maximumFractionDigits:t}),r0n=(e,t)=>{if(isNaN(e))return"--";const n=Number(t);let r=0;return n>0&&n<1&&(r=Math.min(8,Math.max(0,-Math.floor(Math.log10(n))))),e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:r})},s0n=e=>{if(e>=1)return e.toLocaleString();const t=Math.min(8,Math.max(0,-Math.floor(Math.log10(e))));return e.toFixed(t)},i0n={BTC:{1:{value:1},10:{value:2},20:{value:5},50:{value:10},100:{value:100},1e3:{value:1e3}},ETH:{.1:{value:.1},.2:{value:.2},.5:{value:.5},1:{value:1},10:{value:10},100:{value:100}}},a0n=e=>{if(!e)return null;const t=String(e).toUpperCase(),n=i0n[t];return n?Object.values(n).map(s=>s.value).filter(s=>Number.isFinite(s)&&s>0).sort((s,a)=>s-a):null};async function o0n(e){var o;const n=await fetch(n0n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"l2Book",coin:e})});if(!n.ok)throw new Error("info request failed");const r=await n.json(),s=(r==null?void 0:r.levels)||((o=r==null?void 0:r.data)==null?void 0:o.levels),a=Array.isArray(s==null?void 0:s[0])&&s[0]||(s==null?void 0:s.bs)||(s==null?void 0:s.bids)||[];if(!Array.isArray(a)||!a.length)throw new Error("orderbook empty or bad format");return a}function l0n(e){const t=e.slice(0,10).map(o=>Number(o.px??(Array.isArray(o)?o[0]:void 0))).filter(o=>Number.isFinite(o)),n=[];for(let o=0;o<t.length-1;o++){const l=t[o]-t[o+1];l>0&&n.push(l)}if(!n.length)return 0;const s=Math.min(...n).toFixed(18).replace(/0+$/g,"").replace(/\.$/,""),a=Number(s);return Number.isFinite(a)?a:0}function c0n(e){const t=e.toFixed(18).replace(/0+$/g,"").replace(/\.$/,""),n=Number(t);return Number.isFinite(n)?n:0}function u0n(e,t){if(!e||e<=0)return[];const n=Math.floor(Math.log10(e)),r=[];t>0&&r.push(t);const s=n-4,a=Math.pow(10,s);[1,2,5].forEach(g=>r.push(g*a));const o=n-3;r.push(Math.pow(10,o));const l=n-2;r.push(Math.pow(10,l));const c=n-1;r.push(Math.pow(10,c));const u=r.filter(g=>g>0&&Number.isFinite(g)).map(c0n),d=Array.from(new Set(u)).sort((g,v)=>g-v),f=t>0?t:0;return d.filter(g=>g>=f&&g>0)}function MSe(e){const n=(e||"").toUpperCase()==="BTC"?[1,10,20,50,100,1e3,1e4]:[.001,.01,.1,10,100];return Array.from(new Set(n)).sort((r,s)=>r-s)}async function d0n(e){if(!e)return[];const t=String(e).trim(),n=a0n(t);if(n&&n.length)return n;const r=t.toUpperCase();try{const s=await o0n(t),a=s[0],o=Number((a==null?void 0:a.px)??(Array.isArray(a)?a[0]:void 0));if(!Number.isFinite(o)||o<=0)throw new Error("bad bestBid");const l=l0n(s);let c=u0n(o,l);return r!=="BTC"?c=c.filter(u=>u!==1):c.includes(1)||c.push(1),c=Array.from(new Set(c.filter(u=>Number.isFinite(u)&&u>0))).sort((u,d)=>u-d),c.length?c:MSe(t)}catch(s){return console.error("getUiStepsForCoin error",t,s),MSe(t)}}function RSe(e,t,n){const r=new Map;for(const s of e||[]){const a=eD(s.px),o=eD(s.sz);if(!a||!o||!t)continue;const l=n==="bid"?Math.floor(a/t)*t:Math.ceil(a/t)*t,c=Number(l.toFixed(12));r.set(c,(r.get(c)||0)+o)}return[...r.entries()].map(([s,a])=>({price:s,size:a}))}function f0n({marketId:e,baseSymbol:t,rows:n=16,onSelectPrice:r,onBest:s}){const a=m.useRef(null),o=m.useRef(null),l=m.useRef(0),c=m.useRef({bids:new Map,asks:new Map}),u=m.useRef(!1),d=m.useRef(!0),[f,x]=m.useState({bids:[],asks:[]}),[g,v]=m.useState("COIN"),[w,C]=m.useState(null),[N,I]=m.useState([]),P=(oe,G)=>g==="USD"?oe*G:oe,R=g==="USD"?"USD":t?String(t):"COIN";m.useEffect(()=>(d.current=!0,()=>{d.current=!1}),[]);const F=()=>{u.current||(u.current=!0,requestAnimationFrame(()=>{if(u.current=!1,!d.current)return;const oe=c.current;if(!((oe==null?void 0:oe.bids)instanceof Map)||!((oe==null?void 0:oe.asks)instanceof Map))return;const G=512,V=Array.from(oe.bids.entries()).map(([ae,fe])=>({px:ae,sz:fe})).sort((ae,fe)=>fe.px-ae.px).slice(0,G),ee=Array.from(oe.asks.entries()).map(([ae,fe])=>({px:ae,sz:fe})).sort((ae,fe)=>ae.px-fe.px).slice(0,G);x({bids:V,asks:ee})}))},U=oe=>{if(oe==null)return;const G=a.current;if(G&&(G.readyState===WebSocket.OPEN||G.readyState===WebSocket.CONNECTING))return;const V=new WebSocket(t0n);a.current=V,V.onopen=()=>{l.current=0;const ee={type:"subscribe",channel:`order_book/${String(oe)}`};try{V.send(JSON.stringify(ee))}catch{}},V.onmessage=ee=>{let ae;try{ae=JSON.parse(ee.data||"{}")}catch{return}if((ae==null?void 0:ae.type)!=="update/order_book")return;const fe=`order_book:${String(oe)}`;if(ae.channel!==fe)return;const Ae=ae.order_book;if(!Ae)return;let ce=c.current;(!ce||typeof ce!="object")&&(ce={bids:new Map,asks:new Map},c.current=ce),ce.bids instanceof Map||(ce.bids=new Map),ce.asks instanceof Map||(ce.asks=new Map);const ye=(Ne,be)=>{const je=Array.isArray(Ae[Ne])?Ae[Ne]:[];if(je.length)for(const Ie of je){const Re=Number(Ie.price),Qe=Number(Ie.size);Number.isFinite(Re)&&(!Number.isFinite(Qe)||Qe<=0?be.delete(Re):be.set(Re,Qe))}};ye("bids",ce.bids),ye("asks",ce.asks),F()},V.onclose=()=>{l.current=Math.min(l.current+1,6),!o.current&&(o.current=setTimeout(()=>{o.current=null,U(oe)},500*Math.pow(2,l.current)))},V.onerror=()=>{try{V.close()}catch{}}};m.useEffect(()=>{if(a.current)try{a.current.onmessage=null,a.current.onopen=null,a.current.onclose=null,a.current.onerror=null,a.current.close()}catch{}if(a.current=null,o.current&&(clearTimeout(o.current),o.current=null),l.current=0,c.current={bids:new Map,asks:new Map},x({bids:[],asks:[]}),I([]),C(null),e==null)return;U(e);let oe=!1;return(async()=>{const G=await d0n(t||"");oe||(I(G),C(G[0]??null))})(),()=>{oe=!0}},[e,t]);const L=m.useMemo(()=>(f.bids||[]).map(oe=>eD(oe.px)).filter(oe=>Number.isFinite(oe)&&oe>0),[f]),z=m.useMemo(()=>(f.asks||[]).map(oe=>eD(oe.px)).filter(oe=>Number.isFinite(oe)&&oe>0),[f]),X=L.length?Math.max(...L):null,ne=z.length?Math.min(...z):null;m.useEffect(()=>{X!=null&&ne!=null&&(s==null||s({bestBid:X,bestAsk:ne,mid:(X+ne)/2}))},[X,ne,s]);const J=m.useMemo(()=>{const oe=Number(w)||1,G=RSe(f.bids,oe,"bid").sort((ee,ae)=>ae.price-ee.price),V=RSe(f.asks,oe,"ask").sort((ee,ae)=>ee.price-ae.price);return{bids:G,asksAsc:V}},[f,w]),Z=m.useMemo(()=>{const oe=J.asksAsc.slice(0,n);let G=0;return oe.map(ee=>(G+=P(ee.size,ee.price),{...ee,total:G})).reverse()},[J,n,g]),re=m.useMemo(()=>{const oe=J.bids.slice(0,n);let G=0;return oe.map(V=>(G+=P(V.size,V.price),{...V,total:G}))},[J,n,g]),he=m.useMemo(()=>{if(X==null||ne==null)return null;const oe=Math.abs(ne-X),G=(ne+X)/2;return{diff:oe,pct:G?oe/G*100:0}},[X,ne]),Y=Math.max(Z.reduce((oe,G)=>Math.max(oe,G.total||0),0),1e-9),ie=Math.max(re.reduce((oe,G)=>Math.max(oe,G.total||0),0),1e-9);return i.jsxs("div",{className:"flex flex-col h-full w-full font-semibold font-inter",children:[i.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-[#292929]",children:[i.jsx(DSe,{value:String(w??""),onChange:oe=>C(Number(oe)),items:(N||[]).map(oe=>({key:String(oe),label:s0n(oe)}))}),i.jsx(DSe,{value:g,onChange:v,items:[{key:"USD",label:"USD"},{key:"COIN",label:t||"COIN"}],align:"right"})]}),i.jsxs("div",{className:"grid grid-cols-[84px_1fr_1fr] px-3 py-2 text-[11px] text-[#9b9b9b] w-full",children:[i.jsx("span",{className:"uppercase",children:"Price"}),i.jsxs("span",{className:"uppercase text-center",children:["Size (",R,")"]}),i.jsxs("span",{className:"uppercase text-right",children:["Total (",R,")"]})]}),i.jsx("div",{className:"flex-1 overflow-hidden w-full",children:i.jsxs("div",{className:"overflow-auto w-full",children:[Z.map((oe,G)=>i.jsx(LSe,{side:"ask",step:Number(w)||1,price:oe.price,size:oe.size!=null?P(oe.size,oe.price):null,total:oe.total,widthPct:oe.total?Math.min(100,oe.total/Y*100):0,onClick:()=>oe.price!=null&&(r==null?void 0:r(oe.price)),unit:g},`ask-${G}`)),i.jsxs("div",{className:"grid grid-cols-[84px_1fr_1fr] px-3 py-2 text-[11px] text-[#9b9b9b] border-y border-[#292929] my-1 w-full",children:[i.jsx("span",{className:"uppercase",children:"Spread"}),i.jsx("span",{className:"text-right",children:he?tD(he.diff,4):"--"}),i.jsx("span",{className:"text-right",children:he?`${tD(he.pct,4)}%`:"--"})]}),re.map((oe,G)=>i.jsx(LSe,{side:"bid",step:Number(w)||1,price:oe.price,size:oe.size!=null?P(oe.size,oe.price):null,total:oe.total,widthPct:oe.total?Math.min(100,oe.total/ie*100):0,onClick:()=>oe.price!=null&&(r==null?void 0:r(oe.price)),unit:g},`bid-${G}`))]})})]})}function LSe({side:e,price:t,size:n,total:r,widthPct:s,onClick:a,step:o,unit:l}){const c=t==null,u=e==="bid"?"from-transparent to-[#67ffbd]/30":"from-transparent to-[#FF7272]/30",d=e==="bid"?"text-[#67FFBD]":"text-[#FF797C]",f=l==="USD";return i.jsxs("div",{className:"relative w-full font-semibold",children:[!c&&i.jsx("div",{className:`absolute left-0 top-px bottom-px bg-gradient-to-r ${u} transition-all duration-300 ease-[cubic-bezier(0.42,0,0.58,1)]`,style:{width:`${Math.max(0,s-2)}%`}}),i.jsxs("div",{className:`grid grid-cols-[84px_1fr_1fr] px-3 py-1 text-xs relative w-full ${c?"":"cursor-pointer"}`,onClick:c?void 0:a,children:[i.jsx("span",{className:`${c?"text-[#555]":d} hover:text-white`,children:c?"—":r0n(t,o)}),i.jsx("span",{className:"text-center text-[#dcdada] hover:text-white",children:c?"—":tD(n,f?0:6)}),i.jsx("span",{className:"text-right text-[#a8a8a8] hover:text-white",children:c?"—":tD(r,f?0:6)})]})]})}function DSe({value:e,onChange:t,items:n,align:r="left"}){var l,c;const[s,a]=m.useState(!1),o=m.useRef(null);return m.useEffect(()=>{if(!s)return;const u=d=>{o.current&&(o.current.contains(d.target)||a(!1))};return window.addEventListener("mousedown",u),window.addEventListener("touchstart",u),()=>{window.removeEventListener("mousedown",u),window.removeEventListener("touchstart",u)}},[s]),i.jsxs("div",{className:"relative",ref:o,children:[i.jsxs("button",{className:"h-7 px-2 text-xs rounded-md border border-[#292929] bg-[#101010] text-[#dcdada] flex items-center gap-1",onClick:()=>a(u=>!u),children:[((l=n.find(u=>u.key===e))==null?void 0:l.label)??((c=n.find(u=>String(u.key)===String(e)))==null?void 0:c.label)??e,i.jsx("span",{className:"text-[#8b8b8b]",children:"▾"})]}),s&&i.jsx("div",{className:`absolute z-10 mt-1 min-w-[80px] rounded-md border border-[#292929] bg-[#101010] p-1 ${r==="right"?"right-0":"left-0"}`,children:n.map(u=>i.jsx("div",{className:`px-2 py-1 text-xs rounded cursor-pointer ${String(u.key)===String(e)?"bg-[#262626] text-white":"text-[#dcdada] hover:bg-[#262626]"}`,onClick:()=>{t(u.key),a(!1)},children:u.label},u.key))})]})}const qu=e=>{const t=Number(e);return Number.isFinite(t)?t:0},BSe=(e,t)=>{if(!Number.isFinite(e))return"--";const n=Math.abs(e),r=Math.pow(10,-t);return n>0&&n<r?"0":e.toLocaleString(void 0,{maximumFractionDigits:t})},$Se=(e,t=6)=>isNaN(e)?"--":e.toLocaleString(void 0,{maximumFractionDigits:t}),h0n=(e,t)=>{if(isNaN(e))return"--";const n=Number(t);let r=0;return n>0&&n<1&&(r=Math.min(8,Math.max(0,-Math.floor(Math.log10(n))))),e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:r})},p0n=e=>{if(e>=1)return e.toLocaleString();const t=Math.min(8,Math.max(0,-Math.floor(Math.log10(e))));return e.toFixed(t)},m0n={BTC:{1:{value:1},10:{value:2},20:{value:5},50:{value:10},100:{value:100},1e3:{value:1e3}},ETH:{.1:{value:.1},.2:{value:.2},.5:{value:.5},1:{value:1},10:{value:10},100:{value:100}}},x0n=e=>{if(!e)return null;const t=String(e).toUpperCase(),n=m0n[t];return n?Object.values(n).map(s=>s.value).filter(s=>Number.isFinite(s)&&s>0).sort((s,a)=>s-a):null};function g0n(e){const t=e.toFixed(18).replace(/0+$/g,"").replace(/\.$/,""),n=Number(t);return Number.isFinite(n)?n:0}function b0n(e,t){if(!e||e<=0)return[];const n=Math.floor(Math.log10(e)),r=[];t>0&&r.push(t);const s=n-4,a=Math.pow(10,s);[1,2,5].forEach(g=>r.push(g*a));const o=n-3;r.push(Math.pow(10,o));const l=n-2;r.push(Math.pow(10,l));const c=n-1;r.push(Math.pow(10,c));const u=n;r.push(Math.pow(10,u));const d=r.filter(g=>g>0&&Number.isFinite(g)).map(g0n),f=Array.from(new Set(d)).sort((g,v)=>g-v),x=t>0?t:0;return f.filter(g=>g>=x&&g>0)}function USe(e){const t=(e||"").toUpperCase();return t==="BTC"?[1,10,20,50,100,1e3,1e4]:t==="ETH"?[.1,.2,.5,1,5,10,50,100]:[1e-4,.001,.01,.1,1,10,100]}async function y0n(e,t){const n=`${e}/info/markets?market=${encodeURIComponent(t)}`,r=await fetch(n);if(!r.ok)throw new Error("markets info request failed");const s=await r.json();return(Array.isArray(s==null?void 0:s.data)?s.data:[])[0]||null}async function v0n(e,t){const n=`${e}/info/markets/${encodeURIComponent(t)}/orderbook`,r=await fetch(n);if(!r.ok)throw new Error("orderbook request failed");const s=await r.json(),a=s==null?void 0:s.data,o=Array.isArray(a==null?void 0:a.bid)?a.bid:[],l=Array.isArray(a==null?void 0:a.ask)?a.ask:[];return{bids:o,asks:l}}async function w0n({apiBaseUrl:e,market:t,baseSymbol:n}){var s,a,o,l;const r=x0n(n);if(r&&r.length)return r;try{const c=await y0n(e,t),u=qu((s=c==null?void 0:c.tradingConfig)==null?void 0:s.minPriceChange),d=qu((a=c==null?void 0:c.marketStats)==null?void 0:a.lastPrice)||qu((o=c==null?void 0:c.marketStats)==null?void 0:o.askPrice)||qu((l=c==null?void 0:c.marketStats)==null?void 0:l.bidPrice);let f=b0n(d,u);return f=Array.from(new Set(f.filter(x=>Number.isFinite(x)&&x>0))).sort((x,g)=>x-g),f.length?f:USe(n)}catch{return USe(n)}}function zSe(e,t,n){const r=new Map;for(const s of e||[]){const a=qu(s.px),o=qu(s.sz);if(!a||!o||!t)continue;const l=n==="bid"?Math.floor(a/t)*t:Math.ceil(a/t)*t,c=Number(l.toFixed(12));r.set(c,(r.get(c)||0)+o)}return[...r.entries()].map(([s,a])=>({price:s,size:a}))}function C0n({market:e,baseSymbol:t,rows:n=16,onSelectPrice:r,onBest:s,apiBaseUrl:a="https://express-proxy-delta.vercel.app/proxy?url=https://api.starknet.extended.exchange/api/v1",wsBaseUrl:o="wss://api.starknet.extended.exchange"}){var Ae;const c=m.useRef(null),u=m.useRef(null),d=m.useRef(0),f=m.useRef(null),x=m.useRef({bids:new Map,asks:new Map}),g=m.useRef(!1),v=m.useRef(!0),[w,C]=m.useState({bids:[],asks:[]}),[N,I]=m.useState("COIN"),[P,R]=m.useState(null),[F,U]=m.useState([]),L=(ce,ye)=>N==="USD"?ce*ye:ce,z=N==="USD"?"USD":t?String(t):"COIN";m.useEffect(()=>(v.current=!0,()=>{v.current=!1}),[]);const X=()=>{g.current||(g.current=!0,requestAnimationFrame(()=>{if(g.current=!1,!v.current)return;const ce=x.current;if(!((ce==null?void 0:ce.bids)instanceof Map)||!((ce==null?void 0:ce.asks)instanceof Map))return;const ye=1024,Ne=Array.from(ce.bids.entries()).map(([je,Ie])=>({px:je,sz:Ie})).sort((je,Ie)=>Ie.px-je.px).slice(0,ye),be=Array.from(ce.asks.entries()).map(([je,Ie])=>({px:je,sz:Ie})).sort((je,Ie)=>je.px-Ie.px).slice(0,ye);C({bids:Ne,asks:be})}))},ne=(ce,ye)=>{const Ne=x.current||{bids:new Map,asks:new Map};Ne.bids=new Map,Ne.asks=new Map,x.current=Ne;for(const be of ce||[]){const je=qu((be==null?void 0:be.p)??(be==null?void 0:be.price)),Ie=qu((be==null?void 0:be.q)??(be==null?void 0:be.qty));if(!je||!Number.isFinite(Ie)||Ie<=1e-8)continue;const Re=Number(Ie.toFixed(12));Re>1e-8&&Ne.bids.set(je,Re)}for(const be of ye||[]){const je=qu((be==null?void 0:be.p)??(be==null?void 0:be.price)),Ie=qu((be==null?void 0:be.q)??(be==null?void 0:be.qty));if(!je||!Number.isFinite(Ie)||Ie<=1e-8)continue;const Re=Number(Ie.toFixed(12));Re>1e-8&&Ne.asks.set(je,Re)}},J=(ce,ye)=>{for(const Ne of ce||[]){const be=qu(Ne==null?void 0:Ne.p),je=qu(Ne==null?void 0:Ne.q);if(!be||!Number.isFinite(je)||je===0)continue;const Re=qu(ye.get(be)||0)+je;if(Math.abs(Re)<=1e-8)ye.delete(be);else{const Qe=Number(Re.toFixed(12));Qe<=0?ye.delete(be):ye.set(be,Qe)}}},Z=ce=>{if(!ce)return;const ye=c.current;if(ye&&(ye.readyState===WebSocket.OPEN||ye.readyState===WebSocket.CONNECTING))return;const Ne=`${o}/stream.extended.exchange/v1/orderbooks/${encodeURIComponent(ce)}`,be=new WebSocket(Ne);c.current=be,be.onopen=()=>{d.current=0,f.current=null},be.onmessage=je=>{let Ie;try{Ie=JSON.parse(je.data||"{}")}catch{return}const Re=Number(Ie==null?void 0:Ie.seq);if(Number.isFinite(Re)){const ct=f.current;if(ct!=null&&Re!==ct+1){try{be.close()}catch{}return}f.current=Re}const Qe=String((Ie==null?void 0:Ie.type)||"").toUpperCase(),Be=Ie==null?void 0:Ie.data;if(!Be)return;const it=Array.isArray(Be)?Be.find(ct=>String(ct==null?void 0:ct.m)===String(ce)):Be;if(!it||String(it==null?void 0:it.m)!==String(ce))return;const tt=String((it==null?void 0:it.t)||Qe).toUpperCase(),at=(it==null?void 0:it.b)||[],dt=(it==null?void 0:it.a)||[];if(tt==="SNAPSHOT")ne(at,dt);else if(tt==="DELTA"){const ct=x.current;ct!=null&&ct.bids||(ct.bids=new Map),ct!=null&&ct.asks||(ct.asks=new Map),J(at,ct.bids),J(dt,ct.asks)}else return;X()},be.onclose=()=>{d.current=Math.min(d.current+1,6),!u.current&&(u.current=setTimeout(()=>{u.current=null,Z(ce)},500*Math.pow(2,d.current)))},be.onerror=()=>{try{be.close()}catch{}}};m.useEffect(()=>{if(c.current)try{c.current.onmessage=null,c.current.onopen=null,c.current.onclose=null,c.current.onerror=null,c.current.close()}catch{}if(c.current=null,u.current&&(clearTimeout(u.current),u.current=null),d.current=0,f.current=null,x.current={bids:new Map,asks:new Map},C({bids:[],asks:[]}),U([]),R(null),!e)return;let ce=!1;return(async()=>{try{const ye=await v0n(a,e);if(ce)return;ne(((ye==null?void 0:ye.bids)||[]).map(Ne=>({price:Ne.price,qty:Ne.qty})),((ye==null?void 0:ye.asks)||[]).map(Ne=>({price:Ne.price,qty:Ne.qty}))),X()}catch{}})(),Z(e),(async()=>{const ye=await w0n({apiBaseUrl:a,market:e,baseSymbol:t||e.split("-")[0]});ce||(U(ye),R(ye[0]??null))})(),()=>{ce=!0}},[e,t,a,o]);const re=m.useMemo(()=>(w.bids||[]).map(ce=>qu(ce.px)).filter(ce=>Number.isFinite(ce)&&ce>0),[w]),he=m.useMemo(()=>(w.asks||[]).map(ce=>qu(ce.px)).filter(ce=>Number.isFinite(ce)&&ce>0),[w]),Y=re.length?Math.max(...re):null,ie=he.length?Math.min(...he):null;m.useEffect(()=>{Y!=null&&ie!=null&&(s==null||s({bestBid:Y,bestAsk:ie,mid:(Y+ie)/2}))},[Y,ie,s]);const oe=m.useMemo(()=>{const ce=Number(P)||1,ye=zSe(w.bids,ce,"bid").sort((be,je)=>je.price-be.price),Ne=zSe(w.asks,ce,"ask").sort((be,je)=>be.price-je.price);return{bids:ye,asksAsc:Ne}},[w,P]),G=m.useMemo(()=>{const ce=oe.asksAsc.slice(0,n);let ye=0;return ce.map(be=>(ye+=L(be.size,be.price),{...be,total:ye})).reverse()},[oe,n,N]),V=m.useMemo(()=>{const ce=oe.bids.slice(0,n);let ye=0;return ce.map(Ne=>(ye+=L(Ne.size,Ne.price),{...Ne,total:ye}))},[oe,n,N]),ee=m.useMemo(()=>{if(Y==null||ie==null)return null;const ce=Math.abs(ie-Y),ye=(ie+Y)/2;return{diff:ce,pct:ye?ce/ye*100:0}},[Y,ie]),ae=Math.max(G.reduce((ce,ye)=>Math.max(ce,ye.total||0),0),1e-9),fe=Math.max(V.reduce((ce,ye)=>Math.max(ce,ye.total||0),0),1e-9);return i.jsxs("div",{className:"flex flex-col h-full w-full font-semibold font-inter",children:[i.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-[#292929]",children:[i.jsx(VSe,{value:String(P??""),onChange:ce=>R(Number(ce)),items:(F||[]).map(ce=>({key:String(ce),label:p0n(ce)}))}),i.jsx(VSe,{value:N,onChange:I,items:[{key:"USD",label:"USD"},{key:"COIN",label:t||((Ae=e==null?void 0:e.split("-"))==null?void 0:Ae[0])||"COIN"}],align:"right"})]}),i.jsxs("div",{className:"grid grid-cols-[84px_1fr_1fr] px-3 py-2 text-[11px] text-[#9b9b9b] w-full",children:[i.jsx("span",{className:"uppercase",children:"Price"}),i.jsxs("span",{className:"uppercase text-center",children:["Size (",z,")"]}),i.jsxs("span",{className:"uppercase text-right",children:["Total (",z,")"]})]}),i.jsx("div",{className:"flex-1 overflow-hidden w-full",children:i.jsxs("div",{className:"overflow-auto w-full",children:[G.map((ce,ye)=>i.jsx(HSe,{side:"ask",step:Number(P)||1,price:ce.price,size:ce.size!=null?L(ce.size,ce.price):null,total:ce.total,widthPct:ce.total?Math.min(100,ce.total/ae*100):0,onClick:()=>ce.price!=null&&(r==null?void 0:r(ce.price)),unit:N},`ask-${ye}`)),i.jsxs("div",{className:"grid grid-cols-[84px_1fr_1fr] px-3 py-2 text-[11px] text-[#9b9b9b] border-y border-[#292929] my-1 w-full",children:[i.jsx("span",{className:"uppercase",children:"Spread"}),i.jsx("span",{className:"text-right",children:ee?$Se(ee.diff,4):"--"}),i.jsx("span",{className:"text-right",children:ee?`${$Se(ee.pct,4)}%`:"--"})]}),V.map((ce,ye)=>i.jsx(HSe,{side:"bid",step:Number(P)||1,price:ce.price,size:ce.size!=null?L(ce.size,ce.price):null,total:ce.total,widthPct:ce.total?Math.min(100,ce.total/fe*100):0,onClick:()=>ce.price!=null&&(r==null?void 0:r(ce.price)),unit:N},`bid-${ye}`))]})})]})}function HSe({side:e,price:t,size:n,total:r,widthPct:s,onClick:a,step:o,unit:l}){const c=t==null,u=e==="bid"?"from-transparent to-[#67ffbd]/30":"from-transparent to-[#FF7272]/30",d=e==="bid"?"text-[#67FFBD]":"text-[#FF797C]",x=l==="USD"?2:8;return i.jsxs("div",{className:"relative w-full font-semibold",children:[!c&&i.jsx("div",{className:`absolute left-0 top-px bottom-px bg-gradient-to-r ${u} transition-all duration-300 ease-[cubic-bezier(0.42,0,0.58,1)]`,style:{width:`${Math.max(0,s-2)}%`}}),i.jsxs("div",{className:`grid grid-cols-[84px_1fr_1fr] px-3 py-1 text-xs relative w-full ${c?"":"cursor-pointer"}`,onClick:c?void 0:a,children:[i.jsx("span",{className:`${c?"text-[#555]":d} hover:text-white`,children:c?"—":h0n(t,o)}),i.jsx("span",{className:"text-center text-[#dcdada] hover:text-white",children:c?"—":BSe(n,x)}),i.jsx("span",{className:"text-right text-[#a8a8a8] hover:text-white",children:c?"—":BSe(r,x)})]})]})}function VSe({value:e,onChange:t,items:n,align:r="left"}){var l,c;const[s,a]=m.useState(!1),o=m.useRef(null);return m.useEffect(()=>{if(!s)return;const u=d=>{o.current&&(o.current.contains(d.target)||a(!1))};return window.addEventListener("mousedown",u),window.addEventListener("touchstart",u),()=>{window.removeEventListener("mousedown",u),window.removeEventListener("touchstart",u)}},[s]),i.jsxs("div",{className:"relative",ref:o,children:[i.jsxs("button",{className:"h-7 px-2 text-xs rounded-md border border-[#292929] bg-[#101010] text-[#dcdada] flex items-center gap-1",onClick:()=>a(u=>!u),children:[((l=n.find(u=>u.key===e))==null?void 0:l.label)??((c=n.find(u=>String(u.key)===String(e)))==null?void 0:c.label)??e,i.jsx("span",{className:"text-[#8b8b8b]",children:"▾"})]}),s&&i.jsx("div",{className:`absolute z-10 mt-1 min-w-[80px] rounded-md border border-[#292929] bg-[#101010] p-1 ${r==="right"?"right-0":"left-0"}`,children:n.map(u=>i.jsx("div",{className:`px-2 py-1 text-xs rounded cursor-pointer ${String(u.key)===String(e)?"bg-[#262626] text-white":"text-[#dcdada] hover:bg-[#262626]"}`,onClick:()=>{t(u.key),a(!1)},children:u.label},u.key))})]})}const sF="#67FFBD",S0n={type:"spring",stiffness:260,damping:26,mass:1},KHe=e=>{const t=Number(e);return Number.isFinite(t)?t:null},Yx=(...e)=>{for(const t of e){const n=KHe(t);if(n!=null)return n}return null},N0n=e=>{const t=KHe(e);return t==null?null:Math.abs(t)>1?t/100:t};function rj({title:e,subtitle:t}){return i.jsx("div",{className:"w-full h-full flex items-center justify-center px-4",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-sm text-white font-semibold mb-1",children:e}),i.jsx("div",{className:"text-xs text-white/50",children:t})]})})}function iF({code:e,onCodeChange:t,onSubmit:n,loading:r,checking:s,message:a}){const o=r||s||!e.trim();return i.jsxs("div",{className:"relative h-full w-full flex  justify-center overflow-hidden rounded-[16px] bg-black",children:[i.jsx(go.div,{className:"pointer-events-none absolute -inset-[40%] opacity-80 blur-3xl",style:{background:"radial-gradient(circle at 15% 0%, rgba(103,255,189,0.32), transparent 55%), radial-gradient(circle at 85% 100%, rgba(103,255,189,0.24), transparent 60%)"},initial:{x:"-4%",y:"-8%"},animate:{x:["-4%","4%","-2%","-4%"],y:["-8%","6%","2%","-8%"]},transition:{duration:24,repeat:1/0,ease:"easeInOut"}}),i.jsxs(go.div,{initial:{opacity:0,y:16,scale:.96},animate:{opacity:1,y:0,scale:1},transition:{duration:.5,ease:[.16,1,.3,1]},className:"relative z-10 w-full max-w-[460px] rounded-2xl border border-[#17211b] bg-[#050505] shadow-[0_30px_90px_rgba(0,0,0,0.9)] overflow-hidden",children:[i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-50",children:i.jsx("div",{className:"w-full h-full",style:{background:"radial-gradient(900px 500px at 50% -10%, rgba(103,255,189,0.45), transparent 70%)"}})}),i.jsx("video",{src:YN,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",className:"w-full h-[260px] object-cover bg-black"},YN)]}),i.jsxs("div",{className:"px-5 pb-5 pt-4 space-y-4",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("div",{className:"text-[11px] font-medium tracking-[0.18em] uppercase",style:{color:sF},children:"Early Access"}),i.jsxs("div",{className:"text-lg font-semibold",children:["Enter ",i.jsx("span",{style:{color:sF},children:"Alpha Code"})]}),i.jsx("p",{className:"text-[12px] text-white/60",children:"Grid Bot is currently in private alpha. Enter your invitation code to unlock this feature in your account."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-[11px] text-white/45",children:"Alpha Code"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"text",value:e,onChange:l=>t(l.target.value.toUpperCase()),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),n())},placeholder:"DXTR-XXXXX",autoComplete:"off",spellCheck:!1,className:"flex-1 h-10 px-3 rounded-md bg-[#050505] border border-[#1e2e27] text-[13px] tracking-[0.18em] font-mono text-white placeholder:text-white/20 focus:outline-none focus:border-[#67FFBD]"}),i.jsx("button",{type:"button",onClick:n,disabled:o,className:`h-10 px-4 rounded-md text-[13px] font-semibold transition-colors ${o?"bg-[#101613] text-white/40 cursor-not-allowed":"text-black hover:opacity-90"}`,style:o?void 0:{backgroundColor:sF},children:r?"Checking…":"Access"})]})]}),(s||a)&&i.jsxs("div",{className:"text-[11px] min-h-[16px]",children:[s&&!a&&i.jsx("span",{className:"text-white/40",children:"Checking your eligibility…"}),a&&i.jsx("span",{style:{color:sF},children:a})]})]})]})]})}function A0n({data:e,loading:t,error:n,coin:r,setCoin:s,period:a,periods:o,handlePeriodChange:l}){var qn,nr,tr,Qt,zn,Yn;const c=nl(),u=Ic(),{exchange:d,coin:f}=Z3(),{address:x,isConnected:g}=Yr(),{setSignInConnectButtonOpen:v}=m.useContext(Gr),[w,C]=m.useState("single"),[N,I]=m.useState("BTC/ETH"),[P,R]=m.useState([]),[F,U]=m.useState(2),[L,z]=m.useState("1m"),[X,ne]=m.useState(null),[J,Z]=m.useState(null),[re,he]=m.useState({}),[Y,ie]=m.useState({id:null,address:null}),[oe,G]=m.useState(!1),[V,ee]=m.useState(!1),[ae,fe]=m.useState(()=>typeof window>"u"||window.location.hash==="#gridbot"?"grid":window.location.hash==="#trade"?"trade":"grid"),[Ae,ce]=m.useState([]),[ye,Ne]=m.useState(()=>d==="lighter"?"lighter":d==="extended"?"extended":"hyperliquid"),[be,je]=m.useState(()=>r||f||"BTC"),[Ie,Re]=m.useState(()=>d==="lighter"&&f||"BTC"),[Qe,Be]=m.useState(()=>d==="extended"&&f||"BTC"),[it,tt]=m.useState(null),[at,dt]=m.useState(!1),[ct,Ut]=m.useState(null),[kt,tn]=m.useState(!1),[jt,un]=m.useState(null),[cn,Pt]=m.useState(!1),[Xe,Vt]=m.useState({address:null,token:null}),[Yt,Ve]=m.useState(!1),[Ke,ft]=m.useState(!1),[en,Dt]=m.useState(!1),[At,Je]=m.useState(!1),[He,Rt]=m.useState(""),[qe,lt]=m.useState(!1),[xt,Nt]=m.useState(""),It=m.useRef(null),xn=m.useRef(null),dn=typeof window<"u"&&window.matchMedia("(max-width: 768px)").matches,Mn=Lt=>z(Lt),_n=xU(),kn=Nue(),vn=Aue(),Qn=ye==="hyperliquid"?_n:ye==="lighter"?kn:vn,Hn=ye==="hyperliquid"?!_n.length:ye==="lighter"?!kn.length:!vn.length,$n=ye==="hyperliquid"?be:ye==="lighter"?Ie:Qe,Jn=ye==="hyperliquid"&&w==="pair"?N:$n,Nn=ye==="hyperliquid"&&w==="pair"&&N.split("/")[0]||be,ln=m.useMemo(()=>ye==="lighter"&&$n?kn.find(Lt=>Lt.symbol===$n):null,[ye,kn,$n]),Oe=(ln==null?void 0:ln.marketIndex)??(ln==null?void 0:ln.market_id)??(ln==null?void 0:ln.id)??((qn=ln==null?void 0:ln.raw)==null?void 0:qn.marketIndex)??((nr=ln==null?void 0:ln.raw)==null?void 0:nr.market_id)??((tr=ln==null?void 0:ln.raw)==null?void 0:tr.id)??null,sn=m.useMemo(()=>{if(!$n)return null;const Lt=String($n||"").toUpperCase(),Fn=Lt.replace(/-USD$/,"");return vn.find(Ee=>{const p=String((Ee==null?void 0:Ee.symbol)||"").toUpperCase(),h=String((Ee==null?void 0:Ee.rawSymbol)||"").toUpperCase();return p===Lt||h===Lt||p===Fn||h===Fn})||null},[vn,$n]),fn=m.useMemo(()=>{if(sn!=null&&sn.rawSymbol)return sn.rawSymbol;if(!$n)return"";const Lt=String($n||"").toUpperCase();return Lt.includes("-")?Lt:`${Lt}-USD`},[sn,$n]),Et=m.useMemo(()=>sn!=null&&sn.symbol?sn.symbol:$n?String($n||"").toUpperCase().replace(/-USD$/,"").replace(/\/USD$/,""):"",[sn,$n]),Kn=m.useMemo(()=>{const Lt=(sn==null?void 0:sn.lastPrice)??(sn==null?void 0:sn.last);if(Lt!=null&&Number.isFinite(Number(Lt)))return Number(Lt);const Fn=sn==null?void 0:sn.marketStats,Ee=(Fn==null?void 0:Fn.lastPrice)??(Fn==null?void 0:Fn.markPrice)??(sn==null?void 0:sn.markPrice)??null;return Ee!=null&&Number.isFinite(Number(Ee))?Number(Ee):null},[sn]);m.useEffect(()=>{u.hash==="#gridbot"?fe("grid"):u.hash==="#trade"?fe("trade"):u.hash||fe("grid")},[u.hash]),m.useEffect(()=>{d==="lighter"&&ye!=="lighter"?Ne("lighter"):d==="hyperliquid"&&ye!=="hyperliquid"?Ne("hyperliquid"):d==="extended"&&ye!=="extended"&&Ne("extended")},[d,ye]),m.useEffect(()=>{d==="hyperliquid"?f&&f!==be&&(je(f),s(f)):d==="lighter"?f&&f!==Ie&&Re(f):d==="extended"&&f&&f!==Qe&&Be(f)},[d,f,be,Ie,Qe,s]),m.useEffect(()=>{const Lt=()=>{if(typeof window>"u")return;const Fn=window.localStorage.getItem("hyperAddress"),Ee=window.localStorage.getItem("hyperToken");Vt({address:Fn,token:Ee})};return Lt(),window.addEventListener("localStorageUpdated",Lt),window.addEventListener("storage",Lt),()=>{window.removeEventListener("localStorageUpdated",Lt),window.removeEventListener("storage",Lt)}},[]);const Cn=m.useMemo(()=>!Xe.address||!Xe.token?!1:dn?!0:x?Xe.address.toLowerCase()===x.toLowerCase():!1,[Xe.address,Xe.token,x,dn]);m.useEffect(()=>{if(!Cn){Ve(!1),ft(!1),Dt(!1),Je(!1),Rt(""),Nt("");return}if(Yt)return;let Lt=!1;return(async()=>{if(typeof window>"u")return;const Ee=window.localStorage.getItem("hyperToken"),p=window.localStorage.getItem("hyperAddress");if(!Ee||!p){Lt||(Ve(!0),ft(!1),Dt(!1));return}Je(!0);try{const h=await Si(p.toLowerCase(),Ee);if(Lt)return;const S=(h==null?void 0:h.data)||h||{},_=(S==null?void 0:S.data)||S||{},k=_.grid_hyper_alpha_code??S.grid_hyper_alpha_code??!1,T=_.grid_lighter_alpha_code??S.grid_lighter_alpha_code??!1;ft(!k),Dt(!T),Ve(!0)}catch{Lt||(ft(!1),Dt(!1),Ve(!0))}finally{Lt||Je(!1)}})(),()=>{Lt=!0}},[Cn,Yt]),m.useEffect(()=>{Cn&&Ve(!1)},[ye,Cn]),m.useEffect(()=>{(ye!=="lighter"||ae!=="grid")&&(Rt(""),Nt(""))},[ye,ae]);const Bt=async()=>{var Lt,Fn,Ee,p;if(!He.trim()){on.error("Please enter your alpha code");return}if(!Xe.address||!Xe.token){on.error("Please sign in again");return}lt(!0),Nt("");try{const h={address:Xe.address.toLowerCase(),token:Xe.token,alpha_code:He.trim(),source_market:ye==="hyperliquid"?"hyper":"lighter",app_type:"grid_bot"},_=(await ls.post("https://dextrabothypev2.nftinit.io/api/subscriber/alpha_code/set/",h)).data||{};if(_.success){const k=_.message||"Alpha code added successfully";on.success(k),Nt(k),ye==="hyperliquid"?ft(!1):ye==="lighter"&&Dt(!1),Ve(!0)}else{const k=_.error_message||_.message||"This alpha code is invalid";on.error(k),Nt(k)}}catch(h){const S=((Fn=(Lt=h==null?void 0:h.response)==null?void 0:Lt.data)==null?void 0:Fn.error_message)||((p=(Ee=h==null?void 0:h.response)==null?void 0:Ee.data)==null?void 0:p.message)||h.message||"Failed to validate alpha code";on.error(S),Nt(S)}finally{lt(!1)}};m.useEffect(()=>{ye==="hyperliquid"?s(be):ye==="lighter"?!Ie&&kn.length>0&&Re(kn[0].symbol):ye==="extended"&&!Qe&&vn.length>0&&Be(vn[0].symbol)},[ye,be,Ie,Qe,kn,vn,s]),m.useEffect(()=>{if(ye!=="extended"||!vn.length)return;const Lt=vn.some(Fn=>Fn.symbol===Qe);(!Qe||!Lt)&&Be(vn[0].symbol)},[ye,Qe,vn]),m.useEffect(()=>{if(!x){if(dn&&Xe.address){ie(Lt=>Lt.address&&Lt.address.toLowerCase()===Xe.address.toLowerCase()?Lt:{id:null,address:Xe.address});return}ie(Lt=>Lt.address?{id:null,address:null}:Lt);return}ie(Lt=>Lt.address&&Lt.address.toLowerCase()===x.toLowerCase()?Lt:{id:null,address:x})},[x,Xe.address,dn]),m.useEffect(()=>{if(ye!=="hyperliquid"){if(It.current){try{It.current.close()}catch{}It.current=null}R([]),xn.current=null;return}if(!Nn)return;const Lt=(Fn,Ee)=>{if(Fn)try{Fn.readyState===WebSocket.OPEN&&Fn.send(JSON.stringify(Ee))}catch(p){console.error("activeAssetCtx ws send error",p)}};if(It.current){const Fn=It.current;xn.current&&xn.current!==Nn&&Lt(Fn,{method:"unsubscribe",subscription:{type:"activeAssetCtx",coin:xn.current}}),Lt(Fn,{method:"subscribe",subscription:{type:"activeAssetCtx",coin:Nn}})}else{const Fn=new WebSocket("wss://api-ui.hyperliquid.xyz/ws");It.current=Fn,Fn.onopen=()=>{Lt(Fn,{method:"subscribe",subscription:{type:"activeAssetCtx",coin:Nn}})},Fn.onmessage=Ee=>{var h;let p;try{p=JSON.parse(Ee.data)}catch(S){console.error("activeAssetCtx ws parse error",S);return}(h=p==null?void 0:p.data)!=null&&h.ctx&&R({...p.data.ctx,source:"hyperliquid"})},Fn.onclose=()=>{It.current===Fn&&(It.current=null)},Fn.onerror=Ee=>{console.error("activeAssetCtx ws error",Ee)}}xn.current=Nn},[Nn,ye]),m.useEffect(()=>()=>{It.current&&(It.current.close(),It.current=null)},[]),m.useEffect(()=>{if(ye!=="lighter")return;if(!$n){R([]);return}const Lt=kn.find(k=>k.symbol===$n);if(!Lt||!Lt.raw){R([]);return}const Fn=Lt.raw,Ee=Number(Fn.last_trade_price??0)||0,p=Number(Fn.daily_price_change??0)||0,h=Number(Fn.daily_quote_token_volume??0)||0,S=Number(Fn.open_interest??0)||0,_=p&&Ee?Ee/(1+p/100):Ee;R({markPx:Ee,oraclePx:Ee,prevDayPx:_,dayNtlVlm:h,openInterest:S,funding:0,source:"lighter"})},[ye,$n,kn]),m.useEffect(()=>{if(ye!=="extended")return;if(!sn){R([]);return}const Lt=sn.marketStats||{},Fn=Yx(Lt.markPrice,Lt.lastPrice,Lt.indexPrice,sn.markPrice,sn.lastPrice,sn.last),Ee=Yx(Lt.indexPrice,Lt.markPrice,Lt.lastPrice,sn.indexPrice,Fn),p=Yx(Lt.dailyPriceChange,sn.dailyPriceChange),h=Yx(Lt.dailyPriceChangePercentage,sn.dailyPriceChangePercentage,sn.change24hPct,sn.chg24),S=N0n(h);let _=null;if(Fn!=null){if(p!=null){const de=Fn-p;Number.isFinite(de)&&de>0&&(_=de)}if(_==null&&S!=null){const de=1+S;if(Number.isFinite(de)&&de!==0){const xe=Fn/de;Number.isFinite(xe)&&xe>0&&(_=xe)}}}const k=Yx(Lt.dailyVolume,sn.volume,sn.vol),T=Yx(Lt.openInterestBase,sn.openInterestBase),B=Yx(Lt.openInterest,sn.openInterestUsd,sn.openInterest);let q=T;q==null&&B!=null&&Ee!=null&&Ee>0&&(q=B/Ee);const te=Yx(Lt.fundingRate,sn.fundingRate,sn.funding),ue=Yx(Lt.nextFundingRate,sn.nextFundingRate);R({markPx:Fn,oraclePx:Ee,prevDayPx:_,dayNtlVlm:k,openInterest:q,funding:te,nextFundingTime:ue,source:"extended"})},[ye,sn]),m.useEffect(()=>{ye==="hyperliquid"&&ce([])},[ye]),m.useEffect(()=>{ye==="lighter"&&(ne(null),Z(null))},[ye]),m.useEffect(()=>{if(ye!=="lighter"){tt(null);return}if(!g||!x){tt(null);return}let Lt=!1;return(async()=>{if(typeof window>"u")return;const Ee=Xe.address,p=Xe.token;if(!Ee||!p){Lt||tt(null);return}if(Ee.toLowerCase()!==x.toLowerCase()){Lt||tt(null);return}dt(!0);try{const h=await ls.post("https://dextrabothypev2.nftinit.io/api/wallet/list-lighter",{address:Ee,token:p});if(Lt)return;const S=h.data;let _=[];if(Array.isArray(S)?_=S:S&&Array.isArray(S.data)?_=S.data:S&&S.wallet_id!=null&&(_=[S]),!_.length)tt(null);else{const k=_[0],T={id:k.wallet_id,address:k.wallet_address,name:k.wallet_name};tt(T),ie({id:T.id,address:T.address})}}catch{Lt||tt(null)}finally{Lt||dt(!1)}})(),()=>{Lt=!0}},[ye,g,x,Xe.address,Xe.token]),m.useEffect(()=>{if(ye!=="extended"){Ut(null);return}const Lt=Xe.address,Fn=Xe.token;if(!Lt||!Fn){Ut(null);return}if(!dn&&x&&Lt.toLowerCase()!==x.toLowerCase()){Ut(null);return}let Ee=!1;return(async()=>{tn(!0);try{const h=await ls.post("https://dextrabothypev2.nftinit.io/api/wallet/list-extended",{address:Lt,token:Fn});if(Ee)return;const S=h.data;let _=[];if(Array.isArray(S)?_=S:S&&Array.isArray(S.data)?_=S.data:S&&S.wallet_id!=null&&(_=[S]),!_.length)Ut(null);else{const k=_[0],T={id:k.wallet_id,address:k.wallet_address,name:k.wallet_name};Ut(T),ie({id:T.id,address:T.address})}}catch{Ee||Ut(null)}finally{Ee||tn(!1)}})(),()=>{Ee=!0}},[ye,Xe.address,Xe.token,x,dn]),m.useEffect(()=>{if(ye!=="hyperliquid"){un(null);return}if(!g||!x){un(null);return}let Lt=!1;return(async()=>{if(typeof window>"u")return;const Ee=Xe.address,p=Xe.token;if(!Ee||!p){Lt||un(null);return}if(Ee.toLowerCase()!==x.toLowerCase()){Lt||un(null);return}Pt(!0);try{const h=await ls.post("https://dextrabothypev2.nftinit.io/api/wallet/confirmed-list",{address:Ee,token:p});if(Lt)return;const S=h.data;let _=!1;Array.isArray(S)?_=S.length>0:S&&Array.isArray(S.data)?_=S.data.length>0:S&&S.wallet_id!=null&&(_=!0),un(_)}catch{Lt||un(null)}finally{Lt||Pt(!1)}})(),()=>{Lt=!0}},[ye,g,x,Xe.address,Xe.token]);const an=Lt=>{if(w==="pair")return;const Fn=ae==="grid"?"#gridbot":"#trade";ye==="hyperliquid"?(je(Lt),s(Lt),c(`/terminal/hyperliquid/${Lt}${Fn}`)):ye==="lighter"?(Re(Lt),c(`/terminal/lighter/${Lt}${Fn}`)):(Be(Lt),c(`/terminal/extended/${Lt}${Fn}`))},Pn=()=>{typeof window>"u"||window.open("/dca-bot","_blank","noopener,noreferrer")};return i.jsxs("div",{className:"w-full min-h-screen bg-[#050505] text-white font-manrope p-2 mb-6",children:[i.jsx("div",{className:"flex items-center gap-2 mb-4",children:i.jsxs("div",{className:"inline-flex bg-[#161616] rounded-full p-1 text-[11px]",children:[i.jsxs("div",{className:"flex justify-center items-center",children:[i.jsx("img",{src:"https://i.imgflip.com/7zho2e.png",className:"w-4 h-4 mr-1 ml-2",alt:""}),i.jsx("button",{onClick:()=>{const Lt=be||r||"BTC";fe("grid"),Ne("hyperliquid"),c(`/terminal/hyperliquid/${Lt}#gridbot`)},className:`px-3 py-1 rounded-full transition mr-2 ${ye==="hyperliquid"?"bg-white text-black":"text:white/60 text-white/60 hover:text-white"}`,children:"Hyperliquid"})]}),i.jsxs("div",{className:"flex justify-center items-center mr-2",children:[i.jsx(Hf,{className:"w-4 h-4 text-[#fff] mr-1"}),i.jsx("button",{onClick:()=>{const Lt=Ie||"BTC";fe("grid"),Ne("lighter"),c(`/terminal/lighter/${Lt}#gridbot`)},className:`px-3 py-1 rounded-full transition ${ye==="lighter"?"bg:white bg-white text-black":"text:white/60 text-white/60 hover:text-white"}`,children:"Lighter"})]}),i.jsxs("div",{className:"flex justify-center items-center",children:[i.jsx("img",{src:"https://app.extended.exchange/assets/favicon/favicon-32x32.png",className:"w-4 h-4 mr-1",alt:""}),i.jsx("button",{onClick:()=>{const Lt=Qe||"BTC";fe("grid"),Ne("extended"),c(`/terminal/extended/${Lt}#gridbot`)},className:`px-3 py-1 rounded-full transition ${ye==="extended"?"bg-white text-black":"text:white/60 text-white/60 hover:text-white"}`,children:"Extended"})]})]})}),i.jsx(go.div,{className:"fixed inset-0 pointer-events-none z-10",initial:{opacity:.14},animate:{opacity:0},transition:{duration:.9,ease:[.16,1,.3,1]},style:{background:"radial-gradient(1200px 600px at 50% 8%, rgba(255,255,255,0.08), rgba(0,0,0,0) 60%)"}}),i.jsx(i.Fragment,{children:i.jsxs("div",{className:"flex flex-col gap-1 xl:flex-row w-full min-w-0",children:[i.jsxs("div",{className:"flex flex-col gap-1 w-full min-w-0 xl:flex-1",children:[i.jsx(go.div,{className:"xl:hidden bg-[#101010] border border-[#292929] px-2 rounded-[16px]",children:i.jsx("div",{className:"flex items-center justify-between w-full",children:i.jsx(kfn,{coin:$n,data:(Qt=e.position_info)==null?void 0:Qt[0],setIsDigits:U,headerData:P,active:L,onCoinChange:an,markets:Qn,marketsLoading:Hn,mode:w,pairKey:N,onPairChange:I})})}),i.jsxs("div",{className:"flex flex-col gap-1 xl:grid xl:h-[600px] rounded-[16px]",style:{gridTemplateColumns:oe?"minmax(0,1fr) 24px":"minmax(0,1fr) 300px"},children:[i.jsxs(go.div,{className:"relative bg-[#101010] border border-[#292929] overflow-hidden min-w-0 h-[420px] sm:h-[500px] xl:h-full rounded-[16px] flex flex-col",children:[i.jsx("div",{className:"hidden xl:flex h-[56px] w-full items-center justify-between px-2 border-b border-[#292929]",children:i.jsx(qdn,{coin:$n,data:(zn=e.position_info)==null?void 0:zn[0],setIsDigits:U,headerData:P,handleClick:Mn,active:L,onCoinChange:an,mode:w,pairKey:N,onPairChange:I,markets:Qn,market:ye})}),i.jsx("div",{className:"flex-1 min-h-0",children:ye==="hyperliquid"?i.jsx(AX,{coin:Jn,interval:L,walletAddress:Y==null?void 0:Y.address,gridLines:ae==="grid"?Ae:[],market:"hyperliquid"},`hl-${Jn}-${L}`):ye==="lighter"?i.jsx(AX,{coin:$n,interval:"1h",walletAddress:Y==null?void 0:Y.address,gridLines:ae==="grid"?Ae:[],market:"lighter",lighterMarketId:Oe},`lighter-${$n}-${L}-${Oe||"x"}`):i.jsx(AX,{coin:$n,interval:L,walletAddress:Y==null?void 0:Y.address,gridLines:ae==="grid"?Ae:[],market:"extended",extendedMarket:fn,extendedLastPrice:Kn},`extended-${$n}-${L}-${fn||"x"}`)})]}),i.jsxs(go.div,{className:"hidden sm:flex w-full xl:h-full xl:min-h-0 relative rounded-[16px]",children:[!oe&&i.jsxs("div",{className:"group relative w-full h-full bg-[#101010] border border-[#292929] rounded-[16px] overflow-hidden",children:[i.jsx("button",{onClick:()=>G(!0),className:"hidden xl:flex absolute left-0 top-1/2 -translate-y-1/2 -translate-x-1/2 z-20 opacity-0 pointer-events-none group-hover:opacity-100 group-hover:pointer-events-auto transition-opacity bg-transparent",children:i.jsx("div",{className:"w-6 h-6 rounded-full bg-[#161616] border border-r-0 border-[#292929] flex items-center justify-center shadow",children:i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:i.jsx("path",{d:"M9 6l6 6-6 6",stroke:"#CFCFCF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),ye==="hyperliquid"?i.jsx(Zfn,{className:"w-full xl:h-full xl:min-h-0 overflow-y-auto",coin:r,data:t?[]:(Yn=e.position_info)==null?void 0:Yn[0],loading:t,period:a,periods:o,handlePeriodChange:l,onBookPrice:Lt=>ne(Lt),onBest:({mid:Lt})=>Z(Lt)}):ye==="lighter"?Oe!=null?i.jsx(f0n,{marketId:Oe,baseSymbol:$n,rows:10,onSelectPrice:Lt=>ne(Lt),onBest:({mid:Lt})=>Z(Lt)}):i.jsx(rj,{title:"Lighter Order Book",subtitle:"Select a market to see the order book"}):i.jsx(C0n,{market:fn,baseSymbol:Et||$n,rows:10,onSelectPrice:Lt=>ne(Lt),onBest:({mid:Lt})=>Z(Lt)})]}),oe&&i.jsxs("div",{className:"group relative w-[24px] h-full bg-[#101010] border border-[#292929] rounded-[16px] flex items-center justify-center",children:[i.jsx("button",{onClick:()=>G(!1),className:"hidden xl:flex absolute left-0 top-1/2 -translate-y-1/2 -translate-x-1/2 z-20 opacity-0 pointer-events-none group-hover:opacity-100 group-hover:pointer-events-auto transition-opacity bg-transparent",children:i.jsx("div",{className:"w-6 h-6 rounded-full bg-[#161616] border border-r-0 border-[#292929] flex items-center justify-center shadow",children:i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",className:"rotate-180",children:i.jsx("path",{d:"M9 6l6 6-6 6",stroke:"#CFCFCF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),i.jsx("div",{className:"-rotate-90 whitespace-nowrap text-[11px] tracking-wide text-[#BFBFBF]",children:"Position / Order Book / Trades"})]})]})]}),i.jsxs(go.div,{className:"xl:hidden bg-[#101010] border border-[#292929] rounded-[16px]",children:[i.jsx("div",{className:"flex items-center justify-center pt-3 pb-2",children:i.jsxs("div",{className:"inline-flex bg-[#161616] rounded-full p-1 text-xs",children:[i.jsx("button",{onClick:()=>{const Lt=ye==="hyperliquid"?be||r||"BTC":ye==="lighter"?Ie||"BTC":Qe||"BTC";ce([]),fe("trade"),c(`/terminal/${ye}/${Lt}#trade`)},className:`px-3 py-1 rounded-full transition ${ae==="trade"?"bg-white text-black":"text-white/60 hover:text-white"}`,children:"Trade"}),i.jsx("button",{onClick:()=>{const Lt=ye==="hyperliquid"?be||r||"BTC":ye==="lighter"?Ie||"BTC":Qe||"BTC";fe("grid"),c(`/terminal/${ye}/${Lt}#gridbot`)},className:`px-3 py-1 rounded-full transition ${ae==="grid"?"bg-white text-black":"text-white/60 hover:text-white"}`,children:ye==="hyperliquid"?"HL Grid Bot":ye==="lighter"?"Lighter Grid Bot":"Extended Grid Bot"}),ye==="extended"&&i.jsx("button",{onClick:Pn,className:"px-3 py-1 rounded-full transition text-white/60 hover:text-white",children:"DCA Bot"})]})}),i.jsx("div",{className:"min-h-[260px]",children:ae==="trade"?ye==="hyperliquid"?i.jsx(xSe,{coin:r,midPrice:J,selectedPrice:X,maxLeverage:re[r]||25,wallet:Y,onWalletChange:ie,uiMode:w,pairKey:N},`trade-${Y.address}`):ye==="lighter"?i.jsx("div",{className:"h-[260px]",children:i.jsx(rj,{title:"Lighter Perp Trading",subtitle:"Coming Soon"})}):i.jsx("div",{className:"h-[260px]",children:i.jsx(rj,{title:"Extended Perp Trading",subtitle:"Coming Soon"})}):ye==="hyperliquid"?cn||At?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60",children:"Loading Hyperliquid account…"}):Cn?Ke?i.jsx(iF,{code:He,onCodeChange:Rt,onSubmit:Bt,loading:qe,checking:At,message:xt}):jt===!1?i.jsx("div",{className:"w-full h-full flex items-center justify-center py-6",children:i.jsx("button",{onClick:()=>window.open("/wallet-management#hyperliquid","_blank","noopener,noreferrer"),className:"px-4 py-2 rounded-full bg-white text-black text-xs font-semibold",children:"Create HL Account"})}):i.jsx(PSe,{coin:$n,midPrice:J,selectedPrice:X,wallet:Y,onWalletChange:ie,onLevelsChange:ce}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-3 px-4 py-6",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6] text-center",children:"Connect your wallet to use Hyperliquid Grid Bot"}),i.jsx("div",{className:"w-[220px]",children:i.jsx(Zm,{onClick:()=>v(!0)})})]}):ye==="lighter"?at||At?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60 py-6",children:"Loading Lighter account…"}):Cn?en?i.jsx(iF,{code:He,onCodeChange:Rt,onSubmit:Bt,loading:qe,checking:At,message:xt}):it?i.jsx(TSe,{coin:$n,midPrice:J,selectedPrice:X,wallet:Y,onLevelsChange:ce}):i.jsx("div",{className:"w-full h-full flex items-center justify-center py-6",children:i.jsx("button",{onClick:()=>window.open("/wallet-management#lighter","_blank","noopener,noreferrer"),className:"px-4 py-2 rounded-full bg-white text-black text-xs font-semibold",children:"Create Lighter Account"})}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-3 px-4 py-6",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6] text-center",children:"Connect your wallet to use Lighter Grid Bot"}),i.jsx("div",{className:"w-[220px]",children:i.jsx(Zm,{onClick:()=>v(!0)})})]}):kt?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60 py-6",children:"Loading Extended account…"}):Cn?ct?i.jsx(OSe,{coin:$n,midPrice:J,selectedPrice:X,wallet:Y,onLevelsChange:ce}):i.jsx("div",{className:"w-full h-full flex items-center justify-center py-6",children:i.jsx("button",{onClick:()=>window.open("/wallet-management#extended","_blank","noopener,noreferrer"),className:"px-4 py-2 rounded-full bg-white text-black text-xs font-semibold",children:"Create Extended Account"})}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-3 px-4 py-6",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6] text-center",children:"Connect your wallet to use Extended Grid Bot"}),i.jsx("div",{className:"w-[220px]",children:i.jsx(Zm,{onClick:()=>v(!0)})})]})})]}),ye==="lighter"&&Cn&&i.jsx(go.div,{className:"xl:hidden bg-[#101010] border border-[#292929] rounded-[16px] overflow-hidden",children:i.jsx(TO,{walletAddress:Y==null?void 0:Y.address,sourceMarket:"lighter"})}),i.jsx(go.div,{className:"h-[500px] bg-[#101010] border border-[#292929] overflow-hidden rounded-[16px]",children:ye==="hyperliquid"?i.jsx(kmn,{data:e.positions_list,loading:t,error:n,isDigits:F,period:a,periods:o,handlePeriodChange:l,className:"h-full",minHeight:"min-h-0",walletAddress:Y==null?void 0:Y.address,coin:r,sourceMarket:"hyper"},`tabs-${Y.address}`):ye==="lighter"?Cn?i.jsx(TO,{walletAddress:Y==null?void 0:Y.address,sourceMarket:"lighter"}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-3 px-4",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6] text-center",children:"Connect your wallet to manage Lighter grid bots"}),i.jsx("div",{className:"w-[220px]",children:i.jsx(Zm,{onClick:()=>v(!0)})})]}):i.jsx(TO,{walletAddress:Y==null?void 0:Y.address,sourceMarket:"extended"})})]}),i.jsxs(go.div,{animate:{width:V?28:350},transition:S0n,className:"hidden xl:flex flex-col gap-1 rounded-[16px] overflow-visible",style:{minWidth:V?28:350},children:[!V&&i.jsxs("div",{className:"group relative bg-[#101010] border border-[#292929] flex-1 rounded-[16px] flex flex-col",children:[i.jsx("button",{onClick:()=>ee(!0),className:"hidden xl:flex absolute left-0 top-1/2 -translate-y-1/2 -translate-x-1/2 z-20 opacity-0 pointer-events-none group-hover:opacity-100 group-hover:pointer-events-auto transition-opacity bg-transparent",children:i.jsx("div",{className:"w-6 h-6 rounded-full bg-[#161616] border border-r-0 border-[#292929] flex items-center justify-center shadow",children:i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:i.jsx("path",{d:"M9 6l6 6-6 6",stroke:"#CFCFCF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),i.jsx("div",{className:"px-3 pt-3 pb-2 items-center justify-center flex",children:i.jsxs("div",{className:"inline-flex bg-[#161616] rounded-full p-1 text-xs",children:[i.jsx("button",{onClick:()=>{const Lt=ye==="hyperliquid"?be||r||"BTC":ye==="lighter"?Ie||"BTC":Qe||"BTC";fe("trade"),ce([]),c(`/terminal/${ye}/${Lt}#trade`)},className:`px-3 py-1 rounded-full transition ${ae==="trade"?"bg-white text-black":"text-white/60 hover:text-white"}`,children:"Trade"}),i.jsx("button",{onClick:()=>{const Lt=ye==="hyperliquid"?be||r||"BTC":ye==="lighter"?Ie||"BTC":Qe||"BTC";fe("grid"),c(`/terminal/${ye}/${Lt}#gridbot`)},className:`px-3 py-1 rounded-full transition ${ae==="grid"?"bg-white text-black":"text-white/60 hover:text-white"}`,children:"Grid Bot"}),ye==="extended"&&i.jsx("button",{onClick:Pn,className:"px-3 py-1 rounded-full transition text-white/60 hover:text-white",children:"DCA Bot"})]})}),i.jsx("div",{className:"flex-1 overflow-hidden",children:ae==="trade"?ye==="hyperliquid"?i.jsx(xSe,{coin:r,midPrice:J,selectedPrice:X,maxLeverage:re[r]||25,wallet:Y,onWalletChange:ie,uiMode:w,pairKey:N}):ye==="lighter"?i.jsx(rj,{title:"Lighter Perp Trading",subtitle:"Coming Soon"}):i.jsx(rj,{title:"Extended Perp Trading",subtitle:"Coming Soon"}):ye==="hyperliquid"?cn||At?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60",children:"Loading Hyperliquid account…"}):Cn?Ke?i.jsx(iF,{code:He,onCodeChange:Rt,onSubmit:Bt,loading:qe,checking:At,message:xt}):jt===!1?i.jsx("div",{className:"w-full h-full flex items-center justify-center",children:i.jsx("button",{onClick:()=>window.open("/wallet-management#hyperliquid","_blank","noopener,noreferrer"),className:"px-4 py-2 rounded-full bg-white text-black text-xs font-semibold",children:"Create HL Account"})}):i.jsx(PSe,{coin:$n,midPrice:J,selectedPrice:X,wallet:Y,onWalletChange:ie,onLevelsChange:ce}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-3 px-4",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6] text-center",children:"Connect your wallet to use Hyperliquid Grid Bot"}),i.jsx("div",{className:"w-[220px]",children:i.jsx(Zm,{onClick:()=>v(!0)})})]}):ye==="lighter"?at||At?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60",children:"Loading Lighter account…"}):Cn?en?i.jsx(iF,{code:He,onCodeChange:Rt,onSubmit:Bt,loading:qe,checking:At,message:xt}):it?i.jsx(TSe,{coin:$n,midPrice:J,selectedPrice:X,wallet:Y,onLevelsChange:ce}):i.jsx("div",{className:"w-full h-full flex items-center justify-center",children:i.jsx("button",{onClick:()=>window.open("/wallet-management#lighter","_blank","noopener,noreferrer"),className:"px-4 py-2 rounded-full bg-white text-black text-xs font-semibold",children:"Create Lighter Account"})}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-3 px-4",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6] text-center",children:"Connect your wallet to use Lighter Grid Bot"}),i.jsx("div",{className:"w-[220px]",children:i.jsx(Zm,{onClick:()=>v(!0)})})]}):kt?i.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-white/60",children:"Loading Extended account…"}):Cn?ct?i.jsx(OSe,{coin:$n,midPrice:J,selectedPrice:X,wallet:Y,onLevelsChange:ce}):i.jsx("div",{className:"w-full h-full flex items-center justify-center",children:i.jsx("button",{onClick:()=>window.open("/wallet-management#extended","_blank","noopener,noreferrer"),className:"px-4 py-2 rounded-full bg-white text-black text-xs font-semibold",children:"Create Extended Account"})}):i.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-3 px-4",children:[i.jsx("p",{className:"text-[13px] text-[#9BA1A6] text-center",children:"Connect your wallet to use Extended Grid Bot"}),i.jsx("div",{className:"w-[220px]",children:i.jsx(Zm,{onClick:()=>v(!0)})})]})})]}),V&&i.jsxs("div",{className:"group relative h-full min-h-[505px] bg-[#101010] border border-[#292929] rounded-[16px] flex items-center justify-center",children:[i.jsx("button",{onClick:()=>ee(!1),className:"hidden xl:flex absolute left-0 top-1/2 -translate-y-1/2 -translate-x-1/2 opacity-0 pointer-events-none group-hover:opacity-100 group-hover:pointer-events-auto transition-opacity bg-transparent z-10",children:i.jsx("div",{className:"w-6 h-6 rounded-full bg-[#161616] border border-r-0 border-[#292929] flex items-center justify-center shadow z-10",children:i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:i.jsx("path",{d:"M15 6L9 12l6 6",stroke:"#CFCFCF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),i.jsx("div",{className:"-rotate-90 whitespace-nowrap text-[11px] tracking-wide text-[#BFBFBF] z-0",children:ae==="trade"?"Trade Panel":"Grid Bot"})]})]})]})})]})}const j0n=()=>{Yr();const{setTelegramChatId:e,setSubscriberRole:t,setSubsExpireDay:n,setMushboomerETH:r,setIsWhitelist:s,setMushboomerSOL:a,setIsReferralCode:o,setIsReferralCodeName:l,setHyperToken:c,setHyperAddress:u,getCopyTradeWatchList:d,getTrackedWatchList:f}=m.useContext(Gr),{coin:x}=Z3(),[g,v]=m.useState(x||"BTC"),w=xU();function C(ee){return ee?ee.includes(":")?ee.split(":")[1]:ee:""}function N(ee){if(!ee)return"";if(ee.includes(":")){const[ae,fe]=ee.split(":");return`${fe} (${ae})`}return ee}const I=C(g),P=w.find(ee=>ee.symbol===`${I}-USD`||ee.symbol===`${I}-USDH`||ee.symbol===`${I}-USDC`),R=(P==null?void 0:P.last)??(P==null?void 0:P.coin),U=`${R?(ee=>{if(ee==null||!isFinite(ee))return"";const ae=Number(ee),fe=Math.abs(ae),Ae=fe>=1e3?0:fe>=1?2:fe>=.1?6:7,ce=ae.toFixed(Ae);return Number(ce).toLocaleString(void 0,{maximumFractionDigits:Ae})})(R):""} | ${N(g)}  | Dextrabot | Top Hyperliquid Wallets`;m.useEffect(()=>{U&&(document.title=U)},[U]);const[L,z]=m.useState([]),[X,ne]=m.useState(!1),[J,Z]=m.useState(null);m.useEffect(()=>{const ee=document.querySelector("main > div");return ee&&(ee.style.background="#050505"),()=>{ee&&(ee.style.background="")}},[]);const re=[{index:0,name:"1D",value:1},{index:1,name:"7D",value:7},{index:2,name:"30D",value:30},{index:3,name:"90D",value:90}],he=parseInt(localStorage.getItem("ticker_period")),Y=!isNaN(he)&&re[he]?re[he].value:re[1].value,[ie,oe]=m.useState(Y),G=ee=>{oe(Number(ee)),localStorage.setItem("ticker_period",re.findIndex(ae=>ae.value===Number(ee)).toFixed(0))},V=async({coin:ee,period:ae})=>{try{ne(!0);const fe=`https://dextradata.nftinit.io/api/hyper/terminal/v2/${ee}/${ae}`,Ae=await fetch(fe);if(!Ae.ok)throw z([]),new Error("Network response was not ok");const ce=await Ae.json();ce!=null&&ce.success?(z(ce),ne(!1),window.localStorage.getItem("hyperToken")&&(d(),f())):(z([]),ne(!1),Z(ce==null?void 0:ce.error_message))}catch(fe){Z(fe.message),ne(!1)}};return m.useEffect(()=>{g&&ie&&V({coin:g,period:ie})},[g,ie]),m.useEffect(()=>{(async()=>{var Ae,ce;const ae=window.localStorage.getItem("hyperToken"),fe=window.localStorage.getItem("hyperAddress");if(!(!ae||!fe))try{const ye=await Si(fe.toLowerCase(),ae);ye!=null&&ye.success?(e(ye==null?void 0:ye.telegram_chat_id),t(ye==null?void 0:ye.subscriber_role),n(ye==null?void 0:ye.subs_expire_day),r((Ae=ye==null?void 0:ye.mushboomer_counts)==null?void 0:Ae.eth),a((ce=ye==null?void 0:ye.mushboomer_counts)==null?void 0:ce.sol),o(ye==null?void 0:ye.referral_code),l(ye==null?void 0:ye.refcode),s(ye==null?void 0:ye.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),c(""),u(""))}catch(ye){console.error("Token verification error:",ye)}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(Io,{children:i.jsxs($o,{children:[i.jsx("meta",{name:"description",content:`View real-time ${g} positions of top Hyperliquid traders wallet by wallet. Track entry prices, unrealized PnL, position sizes, and copy trade profitable Bitcoin strategies instantly.`}),i.jsx("meta",{property:"og:title",content:`${g} Terminal | Top Hyperliquid Wallets | Real-time Positions | Dextrabot`}),i.jsx("meta",{property:"og:description",content:`View real-time ${g} positions of top Hyperliquid traders wallet by wallet. Track entry prices, unrealized PnL, position sizes, and copy trade profitable Bitcoin strategies instantly.`}),i.jsx("meta",{property:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{property:"og:url",content:`https://app.dextrabot.com/terminal/${g}`})]})}),i.jsx("div",{className:"flex justify-center w-full min-h-screen px-1 pt-1 sm:px-3 sm:pt-3 bg-[#161616]",children:i.jsx("div",{className:"flex flex-col items-stretch justify-center h-full gap-[26px] w-full flex-grow xl:flex-grow-0",children:i.jsx(A0n,{data:L,loading:X,error:J,coin:g,setCoin:v,period:ie,periods:re,handlePeriodChange:G})})})]})},E0n="https://dextradata.nftinit.io/api/hyper/whale_stats/v2/",yh=e=>{if(e==null)return"-";const t=Number(e),n=t<0?"-":"",r=Math.abs(t);return r>=1e9?`${n}$${(r/1e9).toFixed(2)}B`:r>=1e6?`${n}$${(r/1e6).toFixed(2)}M`:r>=1e3?`${n}$${(r/1e3).toFixed(2)}K`:`${n}$${r.toFixed(2)}`},Xx=e=>e==null?"-":`${Number(e).toFixed(1)}%`,aF=e=>`calc(${e}%)`;function _0n({onData:e}){const[t,n]=m.useState(null);if(m.useEffect(()=>{let l=null;const c=()=>ls.get(E0n).then(d=>{var x,g,v,w;const f=(w=(v=(g=(x=d.data)==null?void 0:x.results)==null?void 0:g.other)==null?void 0:v.tracker)==null?void 0:w[0];if(f){n(f);const C=f.total_position;C!==l&&(l=C,e==null||e(f))}}).catch(d=>{console.error("fetch error",d)});c();const u=setInterval(c,3e4);return()=>clearInterval(u)},[]),!t)return i.jsx("div",{className:"rounded-[16px] border border-[#1E1E1E] bg-[#101010] p-4 space-y-6",children:[...Array(3)].map((l,c)=>i.jsxs("div",{className:"space-y-3",children:[i.jsx("div",{className:"h-[32px] w-[160px] bg-[#202020] rounded-md animate-pulse"}),i.jsx("div",{className:"h-[24px] w-full max-w-[170px] bg-[#202020] rounded-md animate-pulse"}),i.jsx("div",{className:"h-[10px] w-[80%] bg-[#202020] rounded-md animate-pulse"}),i.jsx("div",{className:"h-[1px] w-full bg-[#262626]"})]},c))});const r=t.long.position_ratio,s=100-r,a=t.long.margin_ratio,o=100-a;return i.jsxs("div",{className:"font-inter w-full text-white space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-[6px]",children:[i.jsx("img",{src:kyt,alt:"Dextrabot - Whale Trades"}),i.jsx("h2",{className:"text-[16px] leading-[21px] tracking-[-0.32px] font-medium",children:"Overview"}),i.jsxs("div",{className:"flex items-center gap-1 bg-[#262626] p-1 rounded-full w-fit ml-[2px]",children:[i.jsxs("div",{className:"relative w-2 h-2 flex justify-center items-center",children:[i.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-[#67FFBD]/[0.32] animate-ping"}),i.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-[#67FFBD]"})]}),i.jsx("span",{className:"text-white text-[10px] leading-[10px] font-medium",children:"LIVE"})]})]}),i.jsxs("div",{className:"rounded-[16px] border border-[#1E1E1E] bg-[#101010] p-4 space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(fi,{content:"Total value of whale positions opened in the last 24 hours.",children:i.jsxs("div",{className:"flex items-center gap-[6px] w-fit",children:[i.jsx("span",{className:"text-[#929292] text-[14px] tracking-[-0.14px]",children:"Open Positions"}),i.jsx("span",{className:"inline-flex items-center justify-center h-[18px] px-[6px] py-[3px] bg-[#202020] text-[10px] leading-[10px] font-medium rounded-full",children:"LAST 24H"}),i.jsx("img",{src:C0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("div",{className:"text-[20px] leading-[21px] tracking-[-0.2px] font-semibold",children:yh(t.total_position)}),i.jsxs("div",{className:"flex gap-1 h-[16px] w-full max-w-[170px]",children:[i.jsx("span",{className:"flex items-center justify-center bg-[#67FFBD] rounded-[4px] text-[#12450F] text-[10px] leading-[10px] font-semibold px-6",style:{width:aF(r)},children:Xx(r)}),i.jsx("span",{className:"flex items-center justify-center bg-[#FF797C] rounded-[4px] text-[#5E2425] text-[10px] leading-[10px] font-semibold px-6",style:{width:aF(s)},children:Xx(s)})]}),i.jsxs("div",{className:"flex items-center text-[10px] leading-[10px] font-medium gap-2",children:[i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#67FFBD]"}),i.jsx("span",{children:"Long"}),i.jsx("span",{children:yh(t.long.position)}),i.jsxs("span",{className:"text-[#909090]",children:["(",Xx(r),")"]})]}),i.jsx("span",{className:"h-[10px] w-px bg-[#262626]"}),i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#FF797C]"}),i.jsx("span",{children:"Short"}),i.jsx("span",{children:yh(t.short.position)}),i.jsxs("span",{className:"text-[#909090]",children:["(",Xx(s),")"]})]})]})]}),i.jsx("div",{className:"h-px w-full bg-[#262626]"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(fi,{content:"Total margin whales are currently using across all positions.",children:i.jsxs("div",{className:"flex items-center gap-[6px] mt-2 w-fit",children:[i.jsx("span",{className:"text-[#929292] text-[14px] tracking-[-0.14px]",children:"Whale Margin Usage"}),i.jsx("img",{className:"mt-[2px]",src:C0,alt:"Dextrabot - Whale Trades"})]})}),i.jsxs("div",{className:"flex items-end gap-2",children:[i.jsx("span",{className:"text-[20px] leading-[21px] tracking-[-0.2px] font-semibold",children:yh(t.total_margin)}),i.jsx(fi,{content:"(Total Margin / Total Perp. Equity) * 100",children:i.jsxs("span",{className:"text-[#929292] font-inter text-[20px] not-italic font-semibold leading-[21px] tracking-[-0.2px]",children:["(",Xx(t.total_margin/t.total_perp_equity*100),")"]})}),t.long.margin>t.short.margin?i.jsx("span",{className:"bg-[rgba(103,255,189,0.16)] p-[2px] rounded-full",children:i.jsx(nse,{className:"w-4 h-4 text-[#67FFBD]"})}):i.jsx("span",{className:"bg-[rgba(255,121,124,0.16)] p-[2px] rounded-full",children:i.jsx(Pl,{className:"w-4 h-4 text-[#FF797C]"})})]}),i.jsxs("div",{className:"flex gap-1 h-[16px] w-full max-w-[170px]",children:[i.jsx("span",{className:"flex items-center justify-center bg-[#67FFBD] rounded-[4px] text-[#12450F] text-[10px] leading-[10px] font-semibold px-6",style:{width:aF(a)},children:Xx(a)}),i.jsx("span",{className:"flex items-center justify-center bg-[#FF797C] rounded-[4px] text-[#5E2425] text-[10px] leading-[10px] font-semibold px-6",style:{width:aF(o)},children:Xx(o)})]}),i.jsxs("div",{className:"flex items-center text-[10px] leading-[10px] font-medium gap-2",children:[i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#67FFBD]"}),i.jsx("span",{children:"Long"}),i.jsx("span",{className:"text-[#909090]",children:yh(t.long.margin)}),i.jsxs("span",{children:["(",Xx(a),")"]})]}),i.jsx("span",{className:"h-[10px] w-px bg-[#262626]"}),i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#FF797C]"}),i.jsx("span",{children:"Short"}),i.jsx("span",{className:"text-[#909090]",children:yh(t.short.margin)}),i.jsxs("span",{children:["(",Xx(o),")"]})]})]})]}),i.jsx("div",{className:"h-px w-full bg-[#262626]"}),i.jsxs("div",{className:"flex gap-16",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(fi,{content:"Whales’ unrealized profit and loss from open positions in the last 24 hours.",children:i.jsxs("div",{className:"flex items-center gap-[6px]",children:[i.jsx("div",{className:"text-[#929292] text-[14px] tracking-[-0.14px]",children:"PnL"}),i.jsx("img",{className:"mt-[2px]",src:C0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("div",{className:"text-[20px] leading-[21px] tracking-[-0.2px] font-semibold",children:yh(t.total_pnl)}),i.jsxs("div",{className:"flex items-center text-[10px] font-medium gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#67FFBD]"})," Long"," ",yh(t.long.pnl)]})]}),i.jsxs("div",{className:"flex items-center text-[10px] font-medium gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#FF797C]"})," Short"," ",yh(t.short.pnl)]})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(fi,{content:"Funding fees paid or received by whales based on their open positions.",children:i.jsxs("div",{className:"flex items-center gap-[6px]",children:[i.jsx("div",{className:"text-[#929292] text-[14px] tracking-[-0.14px]",children:"Funding"}),i.jsx("img",{className:"mt-[2px]",src:C0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("div",{className:"text-[20px] leading-[21px] tracking-[-0.2px] font-semibold",children:yh(t.total_funding)}),i.jsxs("div",{className:"flex items-center text-[10px] font-medium gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#67FFBD]"})," Long"," ",yh(t.long.funding)]})]}),i.jsxs("div",{className:"flex items-center text-[10px] font-medium gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-[#FF797C]"})," Short"," ",yh(t.short.funding)]})]})]})]})]})}const Gu={1:{label:"Shrimp",emoji:"🦐",bg:"bg-[rgba(255,144,0,0.16)]",txt:"text-[#FF9000]"},2:{label:"Fish",emoji:"🐟",bg:"bg-[rgba(121,156,232,0.16)]",txt:"text-[#97B8FF]"},3:{label:"Dolphin",emoji:"🐬",bg:"bg-[rgba(103,255,245,0.16)]",txt:"text-[#4DDCDE]"},4:{label:"Apex Predator",emoji:"🦈",bg:"bg-[rgba(81,180,255,0.16)]",txt:"text-[#51B4FF]"},5:{label:"Small Whale",emoji:"🐋",bg:"bg-[rgba(255,121,173,0.16)]",txt:"text-[#FF79AD]"},6:{label:"Whale",emoji:"🐳",bg:"bg-[rgba(198,121,255,0.16)]",txt:"text-[#C679FF]"},7:{label:"Tidal Whale",emoji:"🌊",bg:"bg-[rgba(255,121,137,0.16)]",txt:"text-[#FF7989]"},8:{label:"Leviathan",emoji:"🐉",bg:"bg-[rgba(73,242,73,0.16)]",txt:"text-[#49F249]"}},H_=[{id:1,...Gu[1],description:"$0 – $250 — Low-value frequent trader"},{id:2,...Gu[2],description:"$250 – $10K — Small but active trader"},{id:3,...Gu[3],description:"$10K – $50K — Consistent mid-size trader"},{id:4,...Gu[4],description:"$50K – $100K — Aggressive high-leverage trader"},{id:5,...Gu[5],description:"$100K – $500K — Influential swing trader"},{id:6,...Gu[6],description:"$500K – $1M — Market-moving whale"},{id:7,...Gu[7],description:"$1M – $5M — Mega whale, highly impactful"},{id:8,...Gu[8],description:"≥ $5M — Rare leviathan with massive positions"}],jue=e=>{if(e==null)return Gu[6];const t=Number(e);if(!isNaN(t)&&Gu[t])return Gu[t];const n=Object.values(Gu).find(a=>String(a.label).toLowerCase()===String(e).toLowerCase());if(n)return n;const r=a=>String(a).replace(/[\s_]+/g,"").toLowerCase();return Object.values(Gu).find(a=>r(a.label)===r(e))||Gu[6]},k0n="https://dextradata.nftinit.io/api/hyper/trade/highVolumeTrades/",T0n=e=>{const t=Date.now()-e,n=Math.floor(t/6e4);if(n<1)return"now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`},fC=e=>{if(e==null)return"-";const t=Number(e),n=t<0?"-":"",r=Math.abs(t);return r>=1e9?`${n}$${(r/1e9).toFixed(2)}B`:r>=1e6?`${n}$${(r/1e6).toFixed(2)}M`:r>=1e3?`${n}$${(r/1e3).toFixed(2)}K`:`${n}$${r.toFixed(2)}`},I0n=e=>e<250?1:e<1e4?2:e<5e4?3:e<1e5?4:e<5e5?5:e<1e6?6:e<5e6?7:8,WSe=e=>jue(I0n(e)),qSe=()=>{const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,a]=m.useState(Date.now()),[o,l]=m.useState(""),c=m.useCallback(async(x=!1)=>{x&&r(!0);try{const g=await ls.post(k0n,{limit:1e3,offset:0});if(g.data.success){const v=g.data.data.filter(w=>{var C;return!((C=w==null?void 0:w.typeDetail)!=null&&C.includes("Top100Wallet"))});t(v),a(Date.now())}}finally{x&&r(!1)}},[]);m.useEffect(()=>{c(!0);const x=setInterval(c,3e4);return()=>clearInterval(x)},[c]);const u=m.useMemo(()=>o?e.filter(x=>{var v;if(!o)return!0;const g=WSe((x==null?void 0:x.global_account_value)??0);return o===((v=H_.find(w=>w.label===g.label))==null?void 0:v.id)}):e,[e,o]),d=[{key:"rank",label:"#",width:"45px",render:(x,g,v)=>i.jsx("span",{className:"text-[#9B9B9B]",children:v+1})},{key:"wallet",label:"Address",width:"235px",render:(x,g)=>{const v=(g==null?void 0:g.global_account_value)??0,w=WSe(v);return i.jsxs("div",{className:"flex items-center gap-1.5 text-[14px] tracking-[0.24px]",children:[i.jsx("span",{className:"text-[18px] leading-none",children:w.emoji}),i.jsxs("span",{className:"max-w-20 mr-2",children:[g.wallet.slice(0,5),"...",g.wallet.slice(-4)]}),i.jsx("span",{className:`flex justify-center items-center px-1 h-6 rounded-[6px] text-[11px] font-medium ml-[10px] ${w.bg} ${w.txt}`,children:w.label})]})}},{key:"coin",label:"Symbol",sortable:!0,width:"90px",render:(x,g)=>i.jsxs("div",{className:"flex items-center gap-2 text-[14px]",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${g.coin}.svg`,onError:ea,className:"w-5 h-5"}),g.coin]})},{key:"activity",label:"Activity",width:"140px",render:(x,g)=>{var R,F,U,L;const v=(R=g==null?void 0:g.position_details)==null?void 0:R.direction,w=v==="Long",C=v==="Short",N=(L=(U=(F=g==null?void 0:g.position_details)==null?void 0:F.position)==null?void 0:U.leverage)==null?void 0:L.value,I=g.side==="Change Position"?w?"Short > Long":"Long > Short":v??"Position Close",P=v==="Long"||v==="Short";return i.jsxs("div",{className:"flex items-center gap-[10px]",children:[i.jsxs("div",{className:`inline-flex justify-center items-center gap-1 px-2 py-1 h-6 rounded-[6px] text-[11px] uppercase font-medium ${w?"text-[#67ffbd] bg-[rgba(103,255,189,0.16)]":C?"text-[#ff787b] bg-[rgba(255,131,117,0.16)]":"text-[#8B8B8B] bg-transparent"}`,children:[P&&i.jsx(Es,{className:`w-3 h-3 ${w?"rotate-180 text-[#67ffbd]":"text-[#ff787b]"}`}),I]}),N&&i.jsxs("div",{className:"inline-flex justify-center items-center px-2 py-1 h-6 rounded-[6px] text-[11px] font-medium text-[#67ffbd] bg-[rgba(103,255,189,0.16)]",children:[N,"X"]})]})}},{key:"current_trade_value",label:"Trade",width:"80px",sortable:!0,render:x=>fC(x)},{key:"position_value",label:"Position",width:"90px",sortable:!0,sortValue:x=>{var g,v;return Number((v=(g=x==null?void 0:x.position_details)==null?void 0:g.position)==null?void 0:v.positionValue)},render:(x,g)=>{var v,w;return(w=(v=g==null?void 0:g.position_details)==null?void 0:v.position)!=null&&w.positionValue?fC(g.position_details.position.positionValue):"-"}},{key:"price",label:"Price",width:"80px",sortable:!0,sortValue:x=>{var g,v;return Number((v=(g=x==null?void 0:x.position_details)==null?void 0:g.position)==null?void 0:v.entryPx)},render:(x,g)=>{var v,w;return(w=(v=g==null?void 0:g.position_details)==null?void 0:v.position)!=null&&w.entryPx?fC(g.position_details.position.entryPx):"-"}},{key:"side",label:"Side",width:"120px",sortable:!0,sortValue:x=>(x==null?void 0:x.side)||"",render:x=>i.jsx("div",{className:`h-5 pl-1 pr-1.5 py-1 rounded-md inline-flex items-center gap-0.5 text-[11px] font-semibold font-manrope leading-[8px] tracking-wide uppercase ${x==="Increase"||x==="Change Position"?"text-[#67ffbd] bg-[#67ffbd]/20":x==="Decrease"||x==="Position Close"?"text-[#ff787b] bg-[#ff797c]/20":"text-white"}`,children:x||"-"})},{key:"position_details.position.size",label:"Size",sortable:!0,width:"110px",sortValue:x=>{var g,v;return Math.abs(Number((v=(g=x==null?void 0:x.position_details)==null?void 0:g.position)==null?void 0:v.szi))||0},render:(x,g)=>{var N,I;const v=(I=(N=g==null?void 0:g.position_details)==null?void 0:N.position)==null?void 0:I.szi,w=v>0,C=w?"text-[#3DB380]":v<0?"text-[#FF797C]":"text-white";return i.jsxs("span",{className:`font-semibold ${C} inline-flex items-center`,children:[isNaN(v)?"-":fC(Math.abs(v)),!isNaN(v)&&i.jsx("img",{src:w?iE:aE,className:"ml-[6px] w-[9px] h-[8px]",alt:""})]})}},{key:"position_details.position.entryPx",label:"Entry",sortable:!0,sortValue:x=>{var g,v;return Number((v=(g=x==null?void 0:x.position_details)==null?void 0:g.position)==null?void 0:v.entryPx)||0},width:"80px",render:(x,g)=>{var w,C;const v=(C=(w=g==null?void 0:g.position_details)==null?void 0:w.position)==null?void 0:C.entryPx;return v?`${fC(v)}`:"-"}},{key:"position_details.position.unrealizedPnl",label:"uPnL",sortable:!0,width:"100px",sortValue:x=>{var g,v;return Math.abs(Number((v=(g=x==null?void 0:x.position_details)==null?void 0:g.position)==null?void 0:v.unrealizedPnl))||0},render:(x,g)=>{var N,I;const v=parseFloat((I=(N=g==null?void 0:g.position_details)==null?void 0:N.position)==null?void 0:I.unrealizedPnl),w=v>0,C=w?"text-[#3DB380]":v<0?"text-[#FF797C]":"text-white";return i.jsxs("span",{className:`font-semibold ${C} inline-flex items-center`,children:[isNaN(v)?"-":`${fC(Math.abs(v))}`,!isNaN(v)&&i.jsx("img",{src:w?iE:aE,className:"ml-[6px] w-[9px] h-[8px]",alt:""})]})}},{key:"flags",label:i.jsx(fi,{content:"Quick view of this whale’s recent trading performance.",children:i.jsx("span",{children:"Last 5 T."})}),width:"90px",render:(x,g)=>{const v=g.last5Trade??[];return i.jsx("div",{className:"inline-flex h-[18px] px-[2px] py-[4px] justify-center items-center rounded-[6px] overflow-visible",children:v.slice(0,5).map((w,C)=>{let N="",I=null;return w===null?(N="bg-[#747474]",I=u8e):w===!0?(N="bg-[#67FFBD]",I=c8e):(N="bg-[#FF9C9C]",I=d8e),i.jsx("div",{className:`relative z[${C}] w-[18px] h-[18px] flex-shrink-0 flex items-center justify-center rounded-full border-2 border-[#101010] ${N} ${C!==0?"-ml-[6px]":""}`,children:i.jsx(I,{className:"w-3 h-3 text-black"})},C)})})}},{key:"insert_date",label:"Time",width:"80px",sortable:!0,sortValue:x=>{var g;return(g=x.insert_date)==null?void 0:g.$date},render:(x,g)=>{var v;return i.jsx("div",{className:"text-gray-400",children:T0n(new Date((v=g.insert_date)==null?void 0:v.$date).getTime())})}}],f=(x,g)=>{var R;const w=((R=x==null?void 0:x.position_details)==null?void 0:R.direction)==="Long",C=x.current_trade_value>=5e6,N=C?w?"before:bg-[#67FFBD] before:shadow-[0_0_12px_#67FFBD] before:h-[24px] before:top-1/2 before:-translate-y-1/2":"before:bg-[#FF797C] before:shadow-[0_0_12px_#FF797C] before:h-[24px] before:top-1/2 before:-translate-y-1/2":"before:bg-transparent";return`
    relative before:content-[''] before:absolute before:left-[8px] before:w-[2px] before:rounded-full
    ${C?w?"bg-[rgba(103,255,189,0.16)]":"bg-[rgba(255,131,117,0.16)]":g%2===0?"bg-[#191919]":"bg-transparent"} ${N} ${C?w?"hover:bg-[rgba(14,70,53,0.32)]":"hover:bg-[rgba(74,16,18,0.32)]":"hover:bg-[rgba(39,39,39,0.32)]"} cursor-pointer mb-4 py-5 transition-colors duration-300
  `};return n?i.jsx("div",{className:"rounded-[16px] bg-[#101010] p-4 space-y-4 mt-6",children:i.jsx("div",{className:"space-y-3",children:[...Array(32)].map((x,g)=>i.jsx("div",{className:"h-[42px] w-full bg-[#202020] rounded-md animate-pulse"},g))})}):i.jsx(i.Fragment,{children:i.jsxs("div",{className:"font-manrope font-medium relative p-1 mt-4 sm:w-[1440px] sm:mx-auto",children:[i.jsxs("div",{className:"flex-col items-center space-y-2 sm:pl-[60px]",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx(fi,{content:"Displays real-time executed trades from top whales.",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-white text-[16px] leading-[21px] font-medium tracking-[-0.32px] pl-[5px] font-inter",children:"Hot Whale Trades"}),i.jsxs("div",{className:"flex items-center gap-1 bg-[#262626] p-1 rounded-full w-fit",children:[i.jsxs("div",{className:"relative w-2 h-2 flex justify-center items-center",children:[i.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full [#4DFF43]/[0.32] animate-ping"}),i.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-[#4DFF43]"})]}),i.jsx("span",{className:"text-white text-[10px] leading-[10px] font-medium",children:"LIVE"})]}),i.jsx("img",{className:"-ml-[4px]",src:C0,alt:"Dextrabot - Hyperliquid Whale Trades"})]})})}),i.jsx("div",{className:"flex items-center",children:i.jsx("div",{className:"inline-flex items-center h-8 px-1.5 py-[18px] rounded-[8px] border border-[#262626] flex-shrink-0 gap-[12px]",children:i.jsxs("div",{className:"flex items-center gap-[12px]",children:[i.jsx("div",{onClick:()=>l(""),className:`flex items-center justify-center h-7 w-7 px-4 rounded-[8px] text-white text-[14px] font-inter leading-[16px] cursor-pointer transition-colors ${o===""?"bg-[#262626]":"hover:bg-[#262626]"}`,children:"All"}),H_.map(({id:x,label:g,emoji:v,description:w})=>{const C=o===g;return i.jsx("div",{onClick:()=>l(C?"":x),className:`h-7 w-7 flex items-center justify-center rounded-[8px] text-[18px] transition-colors cursor-pointer ${C?"bg-[#262626]":"hover:bg-[#262626]"}`,children:i.jsx(fi,{content:w,children:v})},x)})]})})})]}),i.jsx("div",{className:"pt-2 bg-[#101010] rounded-[16px]",children:i.jsx(Pu,{data:u,columns:d,tableClassName:"text-[14px] flex justify-center",theadClassName:"text-[13px] font-inter !text-[#9B9B9B] bg-transparent font-normal",tbodyClassName:"text-[14px]",cellClassName:"text-[14px]  font-medium",rowClassName:f,rowHeight:42,listHeight:window.screen.height,rowKey:x=>{var g,v;return((g=x._id)==null?void 0:g.$oid)||((v=x.insert_date)==null?void 0:v.$date)},onVisibleRows:()=>{},onRowClick:x=>window.open(`/wallet-details/${x.wallet}`,"_blank")})})]})})},o8=e=>{let t=0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r,t=t&t}return Math.abs(t)},YHe=(e,t)=>Math.floor(e/Math.pow(10,t)%10),pre=(e,t)=>!(YHe(e,t)%2),vu=(e,t,n)=>{const r=e%t;return n&&YHe(e,n)%2===0?-r:r},X3=(e,t,n)=>t[e%n],P0n=e=>{e.slice(0,1)==="#"&&(e=e.slice(1));const t=parseInt(e.substr(0,2),16),n=parseInt(e.substr(2,2),16),r=parseInt(e.substr(4,2),16);return(t*299+n*587+r*114)/1e3>=128?"#000000":"#FFFFFF"},F0n=4,Ja=80;function O0n(e,t){const n=o8(e),r=t&&t.length;return Array.from({length:F0n},(s,a)=>({color:X3(n+a,t,r),translateX:vu(n*(a+1),Ja/2-(a+17),1),translateY:vu(n*(a+1),Ja/2-(a+17),2),rotate:vu(n*(a+1),360),isSquare:pre(n,2)}))}const GSe=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=O0n(e,t),l=m.useId();return i.jsxs("svg",{viewBox:"0 0 "+Ja+" "+Ja,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[n&&i.jsx("title",{children:e}),i.jsx("mask",{id:l,maskUnits:"userSpaceOnUse",x:0,y:0,width:Ja,height:Ja,children:i.jsx("rect",{width:Ja,height:Ja,rx:r?void 0:Ja*2,fill:"#FFFFFF"})}),i.jsxs("g",{mask:`url(#${l})`,children:[i.jsx("rect",{width:Ja,height:Ja,fill:o[0].color}),i.jsx("rect",{x:(Ja-60)/2,y:(Ja-20)/2,width:Ja,height:o[1].isSquare?Ja:Ja/8,fill:o[1].color,transform:"translate("+o[1].translateX+" "+o[1].translateY+") rotate("+o[1].rotate+" "+Ja/2+" "+Ja/2+")"}),i.jsx("circle",{cx:Ja/2,cy:Ja/2,fill:o[2].color,r:Ja/5,transform:"translate("+o[2].translateX+" "+o[2].translateY+")"}),i.jsx("line",{x1:0,y1:Ja/2,x2:Ja,y2:Ja/2,strokeWidth:2,stroke:o[3].color,transform:"translate("+o[3].translateX+" "+o[3].translateY+") rotate("+o[3].rotate+" "+Ja/2+" "+Ja/2+")"})]})]})},gv=90,M0n=5;function R0n(e,t){const n=o8(e),r=t&&t.length,s=Array.from({length:M0n},(o,l)=>X3(n+l,t,r)),a=[];return a[0]=s[0],a[1]=s[1],a[2]=s[1],a[3]=s[2],a[4]=s[2],a[5]=s[3],a[6]=s[3],a[7]=s[0],a[8]=s[4],a}const L0n=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=R0n(e,t),l=Se.useId();return i.jsxs("svg",{viewBox:"0 0 "+gv+" "+gv,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[n&&i.jsx("title",{children:e}),i.jsx("mask",{id:l,maskUnits:"userSpaceOnUse",x:0,y:0,width:gv,height:gv,children:i.jsx("rect",{width:gv,height:gv,rx:r?void 0:gv*2,fill:"#FFFFFF"})}),i.jsxs("g",{mask:`url(#${l})`,children:[i.jsx("path",{d:"M0 0h90v45H0z",fill:o[0]}),i.jsx("path",{d:"M0 45h90v45H0z",fill:o[1]}),i.jsx("path",{d:"M83 45a38 38 0 00-76 0h76z",fill:o[2]}),i.jsx("path",{d:"M83 45a38 38 0 01-76 0h76z",fill:o[3]}),i.jsx("path",{d:"M77 45a32 32 0 10-64 0h64z",fill:o[4]}),i.jsx("path",{d:"M77 45a32 32 0 11-64 0h64z",fill:o[5]}),i.jsx("path",{d:"M71 45a26 26 0 00-52 0h52z",fill:o[6]}),i.jsx("path",{d:"M71 45a26 26 0 01-52 0h52z",fill:o[7]}),i.jsx("circle",{cx:45,cy:45,r:23,fill:o[8]})]})]})},D0n=64,bv=80;function B0n(e,t){const n=o8(e),r=t&&t.length;return Array.from({length:D0n},(s,a)=>X3(n%(a+1),t,r))}const $0n=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=B0n(e,t),l=m.useId();return i.jsxs("svg",{viewBox:"0 0 "+bv+" "+bv,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[n&&i.jsx("title",{children:e}),i.jsx("mask",{id:l,"mask-type":"alpha",maskUnits:"userSpaceOnUse",x:0,y:0,width:bv,height:bv,children:i.jsx("rect",{width:bv,height:bv,rx:r?void 0:bv*2,fill:"#FFFFFF"})}),i.jsxs("g",{mask:`url(#${l})`,children:[i.jsx("rect",{width:10,height:10,fill:o[0]}),i.jsx("rect",{x:20,width:10,height:10,fill:o[1]}),i.jsx("rect",{x:40,width:10,height:10,fill:o[2]}),i.jsx("rect",{x:60,width:10,height:10,fill:o[3]}),i.jsx("rect",{x:10,width:10,height:10,fill:o[4]}),i.jsx("rect",{x:30,width:10,height:10,fill:o[5]}),i.jsx("rect",{x:50,width:10,height:10,fill:o[6]}),i.jsx("rect",{x:70,width:10,height:10,fill:o[7]}),i.jsx("rect",{y:10,width:10,height:10,fill:o[8]}),i.jsx("rect",{y:20,width:10,height:10,fill:o[9]}),i.jsx("rect",{y:30,width:10,height:10,fill:o[10]}),i.jsx("rect",{y:40,width:10,height:10,fill:o[11]}),i.jsx("rect",{y:50,width:10,height:10,fill:o[12]}),i.jsx("rect",{y:60,width:10,height:10,fill:o[13]}),i.jsx("rect",{y:70,width:10,height:10,fill:o[14]}),i.jsx("rect",{x:20,y:10,width:10,height:10,fill:o[15]}),i.jsx("rect",{x:20,y:20,width:10,height:10,fill:o[16]}),i.jsx("rect",{x:20,y:30,width:10,height:10,fill:o[17]}),i.jsx("rect",{x:20,y:40,width:10,height:10,fill:o[18]}),i.jsx("rect",{x:20,y:50,width:10,height:10,fill:o[19]}),i.jsx("rect",{x:20,y:60,width:10,height:10,fill:o[20]}),i.jsx("rect",{x:20,y:70,width:10,height:10,fill:o[21]}),i.jsx("rect",{x:40,y:10,width:10,height:10,fill:o[22]}),i.jsx("rect",{x:40,y:20,width:10,height:10,fill:o[23]}),i.jsx("rect",{x:40,y:30,width:10,height:10,fill:o[24]}),i.jsx("rect",{x:40,y:40,width:10,height:10,fill:o[25]}),i.jsx("rect",{x:40,y:50,width:10,height:10,fill:o[26]}),i.jsx("rect",{x:40,y:60,width:10,height:10,fill:o[27]}),i.jsx("rect",{x:40,y:70,width:10,height:10,fill:o[28]}),i.jsx("rect",{x:60,y:10,width:10,height:10,fill:o[29]}),i.jsx("rect",{x:60,y:20,width:10,height:10,fill:o[30]}),i.jsx("rect",{x:60,y:30,width:10,height:10,fill:o[31]}),i.jsx("rect",{x:60,y:40,width:10,height:10,fill:o[32]}),i.jsx("rect",{x:60,y:50,width:10,height:10,fill:o[33]}),i.jsx("rect",{x:60,y:60,width:10,height:10,fill:o[34]}),i.jsx("rect",{x:60,y:70,width:10,height:10,fill:o[35]}),i.jsx("rect",{x:10,y:10,width:10,height:10,fill:o[36]}),i.jsx("rect",{x:10,y:20,width:10,height:10,fill:o[37]}),i.jsx("rect",{x:10,y:30,width:10,height:10,fill:o[38]}),i.jsx("rect",{x:10,y:40,width:10,height:10,fill:o[39]}),i.jsx("rect",{x:10,y:50,width:10,height:10,fill:o[40]}),i.jsx("rect",{x:10,y:60,width:10,height:10,fill:o[41]}),i.jsx("rect",{x:10,y:70,width:10,height:10,fill:o[42]}),i.jsx("rect",{x:30,y:10,width:10,height:10,fill:o[43]}),i.jsx("rect",{x:30,y:20,width:10,height:10,fill:o[44]}),i.jsx("rect",{x:30,y:30,width:10,height:10,fill:o[45]}),i.jsx("rect",{x:30,y:40,width:10,height:10,fill:o[46]}),i.jsx("rect",{x:30,y:50,width:10,height:10,fill:o[47]}),i.jsx("rect",{x:30,y:60,width:10,height:10,fill:o[48]}),i.jsx("rect",{x:30,y:70,width:10,height:10,fill:o[49]}),i.jsx("rect",{x:50,y:10,width:10,height:10,fill:o[50]}),i.jsx("rect",{x:50,y:20,width:10,height:10,fill:o[51]}),i.jsx("rect",{x:50,y:30,width:10,height:10,fill:o[52]}),i.jsx("rect",{x:50,y:40,width:10,height:10,fill:o[53]}),i.jsx("rect",{x:50,y:50,width:10,height:10,fill:o[54]}),i.jsx("rect",{x:50,y:60,width:10,height:10,fill:o[55]}),i.jsx("rect",{x:50,y:70,width:10,height:10,fill:o[56]}),i.jsx("rect",{x:70,y:10,width:10,height:10,fill:o[57]}),i.jsx("rect",{x:70,y:20,width:10,height:10,fill:o[58]}),i.jsx("rect",{x:70,y:30,width:10,height:10,fill:o[59]}),i.jsx("rect",{x:70,y:40,width:10,height:10,fill:o[60]}),i.jsx("rect",{x:70,y:50,width:10,height:10,fill:o[61]}),i.jsx("rect",{x:70,y:60,width:10,height:10,fill:o[62]}),i.jsx("rect",{x:70,y:70,width:10,height:10,fill:o[63]})]})]})},Go=36;function U0n(e,t){const n=o8(e),r=t&&t.length,s=X3(n,t,r),a=vu(n,10,1),o=a<5?a+Go/9:a,l=vu(n,10,2),c=l<5?l+Go/9:l;return{wrapperColor:s,faceColor:P0n(s),backgroundColor:X3(n+13,t,r),wrapperTranslateX:o,wrapperTranslateY:c,wrapperRotate:vu(n,360),wrapperScale:1+vu(n,Go/12)/10,isMouthOpen:pre(n,2),isCircle:pre(n,1),eyeSpread:vu(n,5),mouthSpread:vu(n,3),faceRotate:vu(n,10,3),faceTranslateX:o>Go/6?o/2:vu(n,8,1),faceTranslateY:c>Go/6?c/2:vu(n,7,2)}}const KSe=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=U0n(e,t),l=m.useId();return i.jsxs("svg",{viewBox:"0 0 "+Go+" "+Go,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[n&&i.jsx("title",{children:e}),i.jsx("mask",{id:l,maskUnits:"userSpaceOnUse",x:0,y:0,width:Go,height:Go,children:i.jsx("rect",{width:Go,height:Go,rx:r?void 0:Go*2,fill:"#FFFFFF"})}),i.jsxs("g",{mask:`url(#${l})`,children:[i.jsx("rect",{width:Go,height:Go,fill:o.backgroundColor}),i.jsx("rect",{x:"0",y:"0",width:Go,height:Go,transform:"translate("+o.wrapperTranslateX+" "+o.wrapperTranslateY+") rotate("+o.wrapperRotate+" "+Go/2+" "+Go/2+") scale("+o.wrapperScale+")",fill:o.wrapperColor,rx:o.isCircle?Go:Go/6}),i.jsxs("g",{transform:"translate("+o.faceTranslateX+" "+o.faceTranslateY+") rotate("+o.faceRotate+" "+Go/2+" "+Go/2+")",children:[o.isMouthOpen?i.jsx("path",{d:"M15 "+(19+o.mouthSpread)+"c2 1 4 1 6 0",stroke:o.faceColor,fill:"none",strokeLinecap:"round"}):i.jsx("path",{d:"M13,"+(19+o.mouthSpread)+" a1,0.75 0 0,0 10,0",fill:o.faceColor}),i.jsx("rect",{x:14-o.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:o.faceColor}),i.jsx("rect",{x:20+o.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:o.faceColor})]})]})]})},z0n=4,kd=80;function H0n(e,t){const n=o8(e),r=t&&t.length;return Array.from({length:z0n},(s,a)=>X3(n+a,t,r))}const V0n=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=H0n(e,t),l=e.replace(/\s/g,""),c=m.useId();return i.jsxs("svg",{viewBox:"0 0 "+kd+" "+kd,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[n&&i.jsx("title",{children:e}),i.jsx("mask",{id:c,maskUnits:"userSpaceOnUse",x:0,y:0,width:kd,height:kd,children:i.jsx("rect",{width:kd,height:kd,rx:r?void 0:kd*2,fill:"#FFFFFF"})}),i.jsxs("g",{mask:`url(#${c})`,children:[i.jsx("path",{fill:"url(#gradient_paint0_linear_"+l+")",d:"M0 0h80v40H0z"}),i.jsx("path",{fill:"url(#gradient_paint1_linear_"+l+")",d:"M0 40h80v40H0z"})]}),i.jsxs("defs",{children:[i.jsxs("linearGradient",{id:"gradient_paint0_linear_"+l,x1:kd/2,y1:0,x2:kd/2,y2:kd/2,gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{stopColor:o[0]}),i.jsx("stop",{offset:1,stopColor:o[1]})]}),i.jsxs("linearGradient",{id:"gradient_paint1_linear_"+l,x1:kd/2,y1:kd/2,x2:kd/2,y2:kd,gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{stopColor:o[2]}),i.jsx("stop",{offset:1,stopColor:o[3]})]})]})]})},W0n=3,hu=80;function q0n(e,t){const n=o8(e),r=t&&t.length;return Array.from({length:W0n},(s,a)=>({color:X3(n+a,t,r),translateX:vu(n*(a+1),hu/10,1),translateY:vu(n*(a+1),hu/10,2),scale:1.2+vu(n*(a+1),hu/20)/10,rotate:vu(n*(a+1),360,1)}))}const XHe=({name:e,colors:t,title:n,square:r,size:s,...a})=>{const o=q0n(e,t),l=m.useId();return i.jsxs("svg",{viewBox:"0 0 "+hu+" "+hu,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:s,height:s,...a,children:[n&&i.jsx("title",{children:e}),i.jsx("mask",{id:l,maskUnits:"userSpaceOnUse",x:0,y:0,width:hu,height:hu,children:i.jsx("rect",{width:hu,height:hu,rx:r?void 0:hu*2,fill:"#FFFFFF"})}),i.jsxs("g",{mask:`url(#${l})`,children:[i.jsx("rect",{width:hu,height:hu,fill:o[0].color}),i.jsx("path",{filter:`url(#filter_${l})`,d:"M32.414 59.35L50.376 70.5H72.5v-71H33.728L26.5 13.381l19.057 27.08L32.414 59.35z",fill:o[1].color,transform:"translate("+o[1].translateX+" "+o[1].translateY+") rotate("+o[1].rotate+" "+hu/2+" "+hu/2+") scale("+o[2].scale+")"}),i.jsx("path",{filter:`url(#filter_${l})`,style:{mixBlendMode:"overlay"},d:"M22.216 24L0 46.75l14.108 38.129L78 86l-3.081-59.276-22.378 4.005 12.972 20.186-23.35 27.395L22.215 24z",fill:o[2].color,transform:"translate("+o[2].translateX+" "+o[2].translateY+") rotate("+o[2].rotate+" "+hu/2+" "+hu/2+") scale("+o[2].scale+")"})]}),i.jsx("defs",{children:i.jsxs("filter",{id:`filter_${l}`,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[i.jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),i.jsx("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),i.jsx("feGaussianBlur",{stdDeviation:7,result:"effect1_foregroundBlur"})]})})]})},G0n={pixel:$0n,bauhaus:GSe,ring:L0n,beam:KSe,sunset:V0n,marble:XHe,geometric:KSe,abstract:GSe},QHe=({variant:e="marble",colors:t=["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"],name:n="Clara Barton",title:r=!1,size:s,square:a=!1,...o})=>{const l=G0n[e]||XHe;return i.jsx(l,{colors:t,name:n,title:r,size:s,square:a,...o})},oF="rgba(155,155,155,0.16)";function K0n({row:e}){var f,x,g,v,w,C,N,I,P,R,F,U;const t=(f=e==null?void 0:e.position_details)==null?void 0:f.direction,n=(v=(g=(x=e==null?void 0:e.position_details)==null?void 0:x.position)==null?void 0:g.leverage)==null?void 0:v.value,r=t==="Long",s=t==="Short",a=(C=(w=e==null?void 0:e.position_details)==null?void 0:w.position)==null?void 0:C.szi,o=(I=(N=e==null?void 0:e.position_details)==null?void 0:N.position)==null?void 0:I.entryPx,l=parseFloat((R=(P=e==null?void 0:e.position_details)==null?void 0:P.position)==null?void 0:R.unrealizedPnl),c=e.side==="Change Position"?r?"Short > Long":"Long > Short":t??"Position Close",u=t==="Long"||t==="Short",d=({label:L,value:z,extraClass:X=""})=>i.jsxs("div",{className:"flex flex-col flex-1 px-2",children:[i.jsx("span",{className:"text-white/64 text-[12px] font-medium leading-[13px] tracking-[0.24px]",children:L}),i.jsx("span",{className:`text-[12px] font-semibold leading-[13px] tracking-[0.24px] ${X}`,children:z})]});return i.jsxs("div",{className:"z-[80] w-[362px] h-[204px] rounded-[16px] bg-white/10 backdrop-blur-[43px] p-3 flex flex-col gap-3",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(QHe,{size:20,name:e.wallet}),i.jsxs("span",{className:"text-white font-manrope text-[14px] font-semibold leading-[13px] tracking-[0.28px]",children:[e.wallet.slice(0,6),"...",e.wallet.slice(-4)]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${e.coin}.svg`,onError:ea,className:"w-8 h-8"}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-white text-[14px] font-semibold leading-[13px] tracking-[0.28px]",children:e.coin}),i.jsx("span",{className:"text-white/40 text-[12px] font-medium leading-[13px] tracking-[0.24px]",children:e.coin_name||""})]}),i.jsxs("div",{className:"ml-[10px] flex gap-[8px]",children:[i.jsxs("div",{className:`inline-flex items-center gap-1 px-1 py-1 h-6 rounded-[6px] text-[11px] uppercase font-medium ${r?"text-[#67ffbd] bg-[rgba(103,255,189,0.16)]":s?"text-[#ff787b] bg-[rgba(255,131,117,0.16)]":"text-[#8B8B8B] bg-transparent"}`,children:[u&&i.jsx(Es,{className:`w-3 h-3 ${r?"rotate-180 text-[#67ffbd]":"text-[#ff787b]"}`}),c]}),n&&i.jsxs("div",{className:"inline-flex items-center px-2 py-1 h-6 rounded-[6px] text-[11px] font-medium text-[#67ffbd] bg-[rgba(103,255,189,0.16)]",children:[n,"X"]})]})]}),i.jsx("div",{style:{background:oF},className:"h-px w-full"}),i.jsxs("div",{className:"flex divide-x",style:{divideColor:oF},children:[i.jsx(d,{label:"Trade Value",value:`$${Er(e.current_trade_value)}`,extraClass:"text-[#67FFBD]"}),i.jsx(d,{label:"Side",value:e.side}),i.jsx(d,{label:"Entry",value:isNaN(o)?"-":i.jsx("span",{className:"inline-flex items-center",children:Er(Math.abs(o))})})]}),i.jsx("div",{style:{background:oF},className:"h-px w-full"}),i.jsxs("div",{className:"flex divide-x",style:{divideColor:oF},children:[i.jsx(d,{label:"Size",value:isNaN(a)?"-":Er(Math.abs(a))}),i.jsx(d,{label:"Entry Price",value:`$${Er(((U=(F=e==null?void 0:e.position_details)==null?void 0:F.position)==null?void 0:U.entryPx)||0)}`}),i.jsx(d,{label:"uPnL",value:isNaN(l)?"-":i.jsxs("span",{className:`inline-flex items-center ${l>0?"text-[#67FFBD]":l<0?"text-[#FF797C]":"text-white"}`,children:[`${l<0?"-":""}$${Er(Math.abs(l))}`,i.jsx("img",{src:l>0?iE:aE,className:"ml-[6px] w-[9px] h-[8px]"})]})})]})]})}function Y0n(){const[e,t]=m.useState(!1);return m.useEffect(()=>{const n=()=>t(window.innerWidth<640);return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e}const X0n="https://dextradata.nftinit.io/api/hyper/trade/highVolumeTrades/",YSe=e=>{const t=Date.now()-e,n=Math.floor(t/6e4);if(n<1)return"now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`},WX=e=>{if(e==null)return"-";const t=Number(e),n=t<0?"-":"",r=Math.abs(t);return r>=1e9?`${n}$${(r/1e9).toFixed(2)}B`:r>=1e6?`${n}$${(r/1e6).toFixed(2)}M`:r>=1e3?`${n}$${(r/1e3).toFixed(2)}K`:`${n}$${r.toFixed(2)}`},Q0n=e=>e<250?1:e<1e4?2:e<5e4?3:e<1e5?4:e<5e5?5:e<1e6?6:e<5e6?7:8,XSe=e=>jue(Q0n(e)),Z0n=()=>{const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,a]=m.useState(!1),[o,l]=m.useState(Date.now()),[c,u]=m.useState(""),d=Y0n(),f=m.useCallback(async(C=!1)=>{C&&r(!0);try{const N=await ls.post(X0n,{limit:1e3,offset:0});if(N.data.success){const I=N.data.data.filter(P=>{var R;return!((R=P==null?void 0:P.typeDetail)!=null&&R.includes("Top100Wallet"))});t(I),l(Date.now())}}finally{C&&r(!1)}},[]);m.useEffect(()=>{f(!0);const C=setInterval(f,3e4);return()=>clearInterval(C)},[f]);const x=m.useMemo(()=>c?e.filter(C=>{var I;if(!c)return!0;const N=XSe((C==null?void 0:C.global_account_value)??0);return c===((I=H_.find(P=>P.label===N.label))==null?void 0:I.id)}):e,[e,c]),g=[{key:"wallet",label:"Address",width:"235px",render:(C,N)=>{const I=(N==null?void 0:N.global_account_value)??0,P=XSe(I);return i.jsx(fi,{content:i.jsx(K0n,{row:N}),children:i.jsxs("div",{className:"flex items-center gap-1.5 text-[14px] tracking-[0.24px] cursor-pointer",children:[i.jsx("span",{className:"text-[18px] leading-none",children:P.emoji}),i.jsxs("span",{className:"max-w-20 mr-2",children:[N.wallet.slice(0,5),"...",N.wallet.slice(-4)]}),i.jsx("span",{className:`flex justify-center items-center px-1 h-6 rounded-[6px] text-[11px] font-medium ml-[10px] ${P.bg} ${P.txt}`,children:P.label})]})})}},{key:"coin",label:"Symbol",width:"114px",sortable:!0,render:(C,N)=>i.jsxs("div",{className:"flex items-center gap-2 text-[14px]",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${N.coin}.svg`,onError:ea,className:"w-5 h-5"}),N.coin]})},{key:"activity",label:"Activity",width:"130px",render:(C,N)=>{var z,X,ne,J;const I=(z=N==null?void 0:N.position_details)==null?void 0:z.direction,P=I==="Long",R=I==="Short",F=(J=(ne=(X=N==null?void 0:N.position_details)==null?void 0:X.position)==null?void 0:ne.leverage)==null?void 0:J.value,U=N.side==="Change Position"?P?"Short > Long":"Long > Short":I??"Position Close",L=I==="Long"||I==="Short";return i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsxs("div",{className:`inline-flex justify-center items-center gap-1 px-2 py-1 h-6 rounded-[6px] text-[11px] uppercase font-medium ${P?"text-[#67ffbd] bg-[rgba(103,255,189,0.16)]":R?"text-[#ff787b] bg-[rgba(255,131,117,0.16)]":"text-[#8B8B8B] bg-transparent"}`,children:[L&&i.jsx(Es,{className:`w-3 h-3 ${P?"rotate-180 text-[#67ffbd]":"text-[#ff787b]"}`}),U]}),F&&i.jsxs("div",{className:`inline-flex justify-center items-center px-2 py-1 h-6 rounded-[6px] text-[11px] font-medium
                ${P?"text-[#67ffbd] bg-[rgba(103,255,189,0.16)]":R?"text-[#ff787b] bg-[rgba(255,131,117,0.16)]":"text-[#8B8B8B] bg-transparent"}`,children:[F,"X"]})]})}},{key:"current_trade_value",label:"Trade",width:"70px",sortable:!0,render:C=>WX(C)},{key:"position_value",label:"Position",sortable:!0,width:"85px",sortValue:C=>{var N,I;return Number((I=(N=C==null?void 0:C.position_details)==null?void 0:N.position)==null?void 0:I.positionValue)},render:(C,N)=>{var I,P;return(P=(I=N==null?void 0:N.position_details)==null?void 0:I.position)!=null&&P.positionValue?WX(N.position_details.position.positionValue):"-"}},{key:"price",label:"Price",width:"80px",sortable:!0,sortValue:C=>{var N,I;return Number((I=(N=C==null?void 0:C.position_details)==null?void 0:N.position)==null?void 0:I.entryPx)},render:(C,N)=>{var I,P;return(P=(I=N==null?void 0:N.position_details)==null?void 0:I.position)!=null&&P.entryPx?WX(N.position_details.position.entryPx):"-"}},{key:"flags",label:i.jsx(fi,{content:"Quick view of this whale’s recent trading performance.",children:i.jsx("span",{children:"Last 5 T."})}),width:"90px",render:(C,N)=>{const I=N.last5Trade??[];return i.jsx("div",{className:"inline-flex h-[18px] px-[2px] py-[4px] justify-center items-center rounded-[6px] overflow-visible",children:I.slice(0,5).map((P,R)=>{let F="",U=null;return P===null?(F="bg-[#747474]",U=u8e):P===!0?(F="bg-[#67FFBD]",U=c8e):(F="bg-[#FF9C9C]",U=d8e),i.jsx("div",{className:`relative z[${R}] w-[18px] h-[18px] flex-shrink-0 flex items-center justify-center rounded-full border-2 border-[#101010] ${F} ${R!==0?"-ml-[6px]":""}`,children:i.jsx(U,{className:"w-3 h-3 text-black"})},R)})})}},{key:"insert_date",label:"Time",sortable:!0,width:"80px",sortValue:C=>{var N;return(N=C.insert_date)==null?void 0:N.$date},render:(C,N)=>{var I;return i.jsx("div",{className:"text-gray-400",children:YSe(new Date((I=N.insert_date)==null?void 0:I.$date).getTime())})}}],v=m.useMemo(()=>d?g.slice(1):g,[g,d]),w=(C,N)=>{var z;const P=((z=C==null?void 0:C.position_details)==null?void 0:z.direction)==="Long",R=C.current_trade_value>=5e6,F=R?P?"before:bg-[#67FFBD] before:shadow-[0_0_12px_#67FFBD] before:h-[24px] before:top-1/2 before:-translate-y-1/2":"before:bg-[#FF797C] before:shadow-[0_0_12px_#FF797C] before:h-[24px] before:top-1/2 before:-translate-y-1/2":"before:bg-transparent";return`
    relative before:content-[''] before:absolute before:left-[8px] before:w-[2px] before:rounded-full
    ${R?P?"bg-[rgba(103,255,189,0.16)]":"bg-[rgba(255,131,117,0.16)]":N%2===0?"bg-[#191919]":"bg-transparent"} ${F} ${R?P?"hover:bg-[rgba(14,70,53,0.32)]":"hover:bg-[rgba(74,16,18,0.32)]":"hover:bg-[rgba(39,39,39,0.32)]"} cursor-pointer mb-4 py-5 transition-colors duration-300
  `};return n?i.jsxs("div",{className:"rounded-[16px] border border-[#1E1E1E] bg-[#101010] p-4 space-y-4",children:[i.jsx("div",{className:"flex justify-end",children:i.jsx("div",{className:"h-8 w-24 bg-[#202020] rounded-[8px] animate-pulse"})}),i.jsx("div",{className:"space-y-3",children:[...Array(7)].map((C,N)=>i.jsx("div",{className:"h-[34px] w-full bg-[#202020] rounded-md animate-pulse"},N))})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"w-full font-manrope font-medium relative mt-1",children:[i.jsxs("div",{className:"flex items-center justify-between pb-2",children:[i.jsx(fi,{content:"Real-time view of whales’ largest open positions.",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-white text-[16px] leading-[21px] font-medium tracking-[-0.32px] pl-[5px] font-inter",children:"Hot Whale Trades"}),i.jsxs("div",{className:"flex items-center gap-1 bg-[#262626] p-1 rounded-full w-fit",children:[i.jsxs("div",{className:"relative w-2 h-2 flex justify-center items-center",children:[i.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-[#4DFF43]/[0.32] animate-ping"}),i.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-[#4DFF43]"})]}),i.jsx("span",{className:"text-white text-[10px] leading-[10px] font-medium",children:"LIVE"})]}),i.jsx("img",{className:"-ml-[4px]",src:C0,alt:"Dextrabot - Whale Trades"})]})}),i.jsxs("span",{className:"text-[#929292] text-[12px] font-medium",children:["Last updated ",YSe(o)]})]}),i.jsxs("div",{className:"laser-frame",children:[i.jsx("span",{className:"laser-beam"}),i.jsxs("div",{className:"pt-3 pl-3 pr-3 border border-[#1E1E1E] bg-[#101010] rounded-[16px]",children:[i.jsxs("div",{className:"w-full flex items-center justify-between mb-3",children:[i.jsx("div",{className:"flex items-center gap-[12px]",children:i.jsx("div",{className:"sm:w-auto w-[260px] overflow-x-auto whitespace-nowrap flex items-center gap-[12px] scrollbar-thin scrollbar-thumb-[#444] scrollbar-track-transparent",children:i.jsxs("div",{className:"flex items-center gap-[12px]",children:[i.jsx("div",{onClick:()=>u(""),className:`flex items-center justify-center h-7 w-7 px-4 rounded-[8px] text-white text-[14px] font-inter leading-[16px] cursor-pointer transition-colors ${c===""?"bg-[#262626]":"hover:bg-[#262626]"}`,children:"All"}),H_.map(({id:C,label:N,emoji:I,description:P})=>{const R=c===C;return i.jsx("div",{onClick:()=>u(R?"":C),className:`h-7 w-7 flex items-center justify-center rounded-[8px] text-[18px] transition-colors cursor-pointer ${R?"bg-[#262626]":"hover:bg-[#262626]"}`,children:i.jsx(fi,{content:P,children:I})},C)})]})})}),i.jsxs("div",{className:"flex items-center justify-center w-12 sm:w-40 font-medium text-[#929292] text-[14px] leading-[18px] gap-2 px-4 py-2 cursor-pointer bg-[#262626] rounded-[8px] hover:scale-105 hover:bg-[#585858] hover:text-white transition-all",onClick:()=>a(!0),children:[i.jsx("span",{className:"hidden sm:inline",children:"View Full Activity"}),i.jsx("img",{src:Tyt,alt:"Expand",className:"w-5 h-5 sm:hidden"})]})]}),x.length===0?i.jsx("div",{className:"h-[312px] flex items-center justify-center text-[#9B9B9B] text-sm",children:"No data available for this filter."}):i.jsx(Pu,{data:x,columns:v,tableClassName:"text-[14px]",theadClassName:"text-[13px] font-inter !text-[#9B9B9B] bg-transparent font-normal",tbodyClassName:"text-[14px]",cellClassName:"text-[14px] text-right font-medium",rowClassName:w,rowHeight:42,listHeight:285,rowKey:C=>{var N,I;return((N=C._id)==null?void 0:N.$oid)||((I=C.insert_date)==null?void 0:I.$date)},onVisibleRows:()=>{},onRowClick:C=>window.open(`/wallet-details/${C.wallet}`,"_blank")})]})]})]}),s&&i.jsxs(rp,{isOpen:s,onClose:()=>a(!1),fullscreen:d,children:[i.jsx("div",{className:"hidden sm:flex w-[95vw] max-h-[95vh] bg-[#101010] rounded-lg flex-col",children:i.jsx("div",{className:"px-4 py-2 overflow-x-auto",children:i.jsx("div",{className:"min-w-[1000px]",children:i.jsx(qSe,{})})})}),i.jsx("div",{className:" w-screen h-screen bg-[#101010] flex flex-col overflow-x-auto overflow-y-auto z-[9999]",children:i.jsx(qSe,{})})]})]})};function si(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function QSe(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function gU(...e){return t=>{let n=!1;const r=e.map(s=>{const a=QSe(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<r.length;s++){const a=r[s];typeof a=="function"?a():QSe(e[s],null)}}}}function nu(...e){return m.useCallback(gU(...e),e)}function N5(e,t=[]){let n=[];function r(a,o){const l=m.createContext(o),c=n.length;n=[...n,o];const u=f=>{var N;const{scope:x,children:g,...v}=f,w=((N=x==null?void 0:x[e])==null?void 0:N[c])||l,C=m.useMemo(()=>v,Object.values(v));return i.jsx(w.Provider,{value:C,children:g})};u.displayName=a+"Provider";function d(f,x){var w;const g=((w=x==null?void 0:x[e])==null?void 0:w[c])||l,v=m.useContext(g);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[u,d]}const s=()=>{const a=n.map(o=>m.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return m.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,J0n(s,...t)]}function J0n(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const f=c(a)[`__scope${u}`];return{...l,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Ky=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},exn=Ey[" useInsertionEffect ".trim().toString()]||Ky;function bU({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,a,o]=txn({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:s;{const d=m.useRef(e!==void 0);m.useEffect(()=>{const f=d.current;f!==l&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${l?"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.`),d.current=l},[l,r])}const u=m.useCallback(d=>{var f;if(l){const x=nxn(d)?d(e):d;x!==e&&((f=o.current)==null||f.call(o,x))}else a(d)},[l,e,a,o]);return[c,u]}function txn({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),s=m.useRef(n),a=m.useRef(t);return exn(()=>{a.current=t},[t]),m.useEffect(()=>{var o;s.current!==n&&((o=a.current)==null||o.call(a,n),s.current=n)},[n,s]),[n,r,a]}function nxn(e){return typeof e=="function"}function V_(e){const t=rxn(e),n=m.forwardRef((r,s)=>{const{children:a,...o}=r,l=m.Children.toArray(a),c=l.find(ixn);if(c){const u=c.props.children,d=l.map(f=>f===c?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:f);return i.jsx(t,{...o,ref:s,children:m.isValidElement(u)?m.cloneElement(u,void 0,d):null})}return i.jsx(t,{...o,ref:s,children:a})});return n.displayName=`${e}.Slot`,n}function rxn(e){const t=m.forwardRef((n,r)=>{const{children:s,...a}=n;if(m.isValidElement(s)){const o=oxn(s),l=axn(a,s.props);return s.type!==m.Fragment&&(l.ref=r?gU(r,o):o),m.cloneElement(s,l)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sxn=Symbol("radix.slottable");function ixn(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sxn}function axn(e,t){const n={...t};for(const r in t){const s=e[r],a=t[r];/^on[A-Z]/.test(r)?s&&a?n[r]=(...l)=>{const c=a(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...a}:r==="className"&&(n[r]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}function oxn(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lxn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Fc=lxn.reduce((e,t)=>{const n=V_(`Primitive.${t}`),r=m.forwardRef((s,a)=>{const{asChild:o,...l}=s,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...l,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ZHe(e,t){e&&Ia.flushSync(()=>e.dispatchEvent(t))}function JHe(e){const t=e+"CollectionProvider",[n,r]=N5(t),[s,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=w=>{const{scope:C,children:N}=w,I=Se.useRef(null),P=Se.useRef(new Map).current;return i.jsx(s,{scope:C,itemMap:P,collectionRef:I,children:N})};o.displayName=t;const l=e+"CollectionSlot",c=V_(l),u=Se.forwardRef((w,C)=>{const{scope:N,children:I}=w,P=a(l,N),R=nu(C,P.collectionRef);return i.jsx(c,{ref:R,children:I})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",x=V_(d),g=Se.forwardRef((w,C)=>{const{scope:N,children:I,...P}=w,R=Se.useRef(null),F=nu(C,R),U=a(d,N);return Se.useEffect(()=>(U.itemMap.set(R,{ref:R,...P}),()=>void U.itemMap.delete(R))),i.jsx(x,{[f]:"",ref:F,children:I})});g.displayName=d;function v(w){const C=a(e+"CollectionConsumer",w);return Se.useCallback(()=>{const I=C.collectionRef.current;if(!I)return[];const P=Array.from(I.querySelectorAll(`[${f}]`));return Array.from(C.itemMap.values()).sort((U,L)=>P.indexOf(U.ref.current)-P.indexOf(L.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:o,Slot:u,ItemSlot:g},v,r]}var cxn=m.createContext(void 0);function eVe(e){const t=m.useContext(cxn);return e||t||"ltr"}function h1(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function uxn(e,t=globalThis==null?void 0:globalThis.document){const n=h1(e);m.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var dxn="DismissableLayer",mre="dismissableLayer.update",fxn="dismissableLayer.pointerDownOutside",hxn="dismissableLayer.focusOutside",ZSe,tVe=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yU=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,u=m.useContext(tVe),[d,f]=m.useState(null),x=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=m.useState({}),v=nu(t,L=>f(L)),w=Array.from(u.layers),[C]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),N=w.indexOf(C),I=d?w.indexOf(d):-1,P=u.layersWithOutsidePointerEventsDisabled.size>0,R=I>=N,F=xxn(L=>{const z=L.target,X=[...u.branches].some(ne=>ne.contains(z));!R||X||(s==null||s(L),o==null||o(L),L.defaultPrevented||l==null||l())},x),U=gxn(L=>{const z=L.target;[...u.branches].some(ne=>ne.contains(z))||(a==null||a(L),o==null||o(L),L.defaultPrevented||l==null||l())},x);return uxn(L=>{I===u.layers.size-1&&(r==null||r(L),!L.defaultPrevented&&l&&(L.preventDefault(),l()))},x),m.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(ZSe=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),JSe(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=ZSe)}},[d,x,n,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),JSe())},[d,u]),m.useEffect(()=>{const L=()=>g({});return document.addEventListener(mre,L),()=>document.removeEventListener(mre,L)},[]),i.jsx(Fc.div,{...c,ref:v,style:{pointerEvents:P?R?"auto":"none":void 0,...e.style},onFocusCapture:si(e.onFocusCapture,U.onFocusCapture),onBlurCapture:si(e.onBlurCapture,U.onBlurCapture),onPointerDownCapture:si(e.onPointerDownCapture,F.onPointerDownCapture)})});yU.displayName=dxn;var pxn="DismissableLayerBranch",mxn=m.forwardRef((e,t)=>{const n=m.useContext(tVe),r=m.useRef(null),s=nu(t,r);return m.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),i.jsx(Fc.div,{...e,ref:s})});mxn.displayName=pxn;function xxn(e,t=globalThis==null?void 0:globalThis.document){const n=h1(e),r=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){nVe(fxn,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function gxn(e,t=globalThis==null?void 0:globalThis.document){const n=h1(e),r=m.useRef(!1);return m.useEffect(()=>{const s=a=>{a.target&&!r.current&&nVe(hxn,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function JSe(){const e=new CustomEvent(mre);document.dispatchEvent(e)}function nVe(e,t,n,{discrete:r}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?ZHe(s,a):s.dispatchEvent(a)}var qX=0;function rVe(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??eNe()),document.body.insertAdjacentElement("beforeend",e[1]??eNe()),qX++,()=>{qX===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),qX--}},[])}function eNe(){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 GX="focusScope.autoFocusOnMount",KX="focusScope.autoFocusOnUnmount",tNe={bubbles:!1,cancelable:!0},bxn="FocusScope",Eue=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...o}=e,[l,c]=m.useState(null),u=h1(s),d=h1(a),f=m.useRef(null),x=nu(t,w=>c(w)),g=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let w=function(P){if(g.paused||!l)return;const R=P.target;l.contains(R)?f.current=R:Sb(f.current,{select:!0})},C=function(P){if(g.paused||!l)return;const R=P.relatedTarget;R!==null&&(l.contains(R)||Sb(f.current,{select:!0}))},N=function(P){if(document.activeElement===document.body)for(const F of P)F.removedNodes.length>0&&Sb(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const I=new MutationObserver(N);return l&&I.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),I.disconnect()}}},[r,l,g.paused]),m.useEffect(()=>{if(l){rNe.add(g);const w=document.activeElement;if(!l.contains(w)){const N=new CustomEvent(GX,tNe);l.addEventListener(GX,u),l.dispatchEvent(N),N.defaultPrevented||(yxn(Nxn(sVe(l)),{select:!0}),document.activeElement===w&&Sb(l))}return()=>{l.removeEventListener(GX,u),setTimeout(()=>{const N=new CustomEvent(KX,tNe);l.addEventListener(KX,d),l.dispatchEvent(N),N.defaultPrevented||Sb(w??document.body,{select:!0}),l.removeEventListener(KX,d),rNe.remove(g)},0)}}},[l,u,d,g]);const v=m.useCallback(w=>{if(!n&&!r||g.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,N=document.activeElement;if(C&&N){const I=w.currentTarget,[P,R]=vxn(I);P&&R?!w.shiftKey&&N===R?(w.preventDefault(),n&&Sb(P,{select:!0})):w.shiftKey&&N===P&&(w.preventDefault(),n&&Sb(R,{select:!0})):N===I&&w.preventDefault()}},[n,r,g.paused]);return i.jsx(Fc.div,{tabIndex:-1,...o,ref:x,onKeyDown:v})});Eue.displayName=bxn;function yxn(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Sb(r,{select:t}),document.activeElement!==n)return}function vxn(e){const t=sVe(e),n=nNe(t,e),r=nNe(t.reverse(),e);return[n,r]}function sVe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function nNe(e,t){for(const n of e)if(!wxn(n,{upTo:t}))return n}function wxn(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 Cxn(e){return e instanceof HTMLInputElement&&"select"in e}function Sb(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Cxn(e)&&t&&e.select()}}var rNe=Sxn();function Sxn(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=sNe(e,t),e.unshift(t)},remove(t){var n;e=sNe(e,t),(n=e[0])==null||n.resume()}}}function sNe(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Nxn(e){return e.filter(t=>t.tagName!=="A")}var Axn=Ey[" useId ".trim().toString()]||(()=>{}),jxn=0;function nD(e){const[t,n]=m.useState(Axn());return Ky(()=>{e||n(r=>r??String(jxn++))},[e]),e||(t?`radix-${t}`:"")}var Exn=typeof document<"u",_xn=function(){},IO=Exn?m.useLayoutEffect:_xn;function rD(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!rD(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!rD(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function iVe(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function iNe(e,t){const n=iVe(e);return Math.round(t*n)/n}function YX(e){const t=m.useRef(e);return IO(()=>{t.current=e}),t}function kxn(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,g]=m.useState(r);rD(x,r)||g(r);const[v,w]=m.useState(null),[C,N]=m.useState(null),I=m.useCallback(G=>{G!==U.current&&(U.current=G,w(G))},[]),P=m.useCallback(G=>{G!==L.current&&(L.current=G,N(G))},[]),R=a||v,F=o||C,U=m.useRef(null),L=m.useRef(null),z=m.useRef(d),X=c!=null,ne=YX(c),J=YX(s),Z=YX(u),re=m.useCallback(()=>{if(!U.current||!L.current)return;const G={placement:t,strategy:n,middleware:x};J.current&&(G.platform=J.current),DAe(U.current,L.current,G).then(V=>{const ee={...V,isPositioned:Z.current!==!1};he.current&&!rD(z.current,ee)&&(z.current=ee,Ia.flushSync(()=>{f(ee)}))})},[x,t,n,J,Z]);IO(()=>{u===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,f(G=>({...G,isPositioned:!1})))},[u]);const he=m.useRef(!1);IO(()=>(he.current=!0,()=>{he.current=!1}),[]),IO(()=>{if(R&&(U.current=R),F&&(L.current=F),R&&F){if(ne.current)return ne.current(R,F,re);re()}},[R,F,re,ne,X]);const Y=m.useMemo(()=>({reference:U,floating:L,setReference:I,setFloating:P}),[I,P]),ie=m.useMemo(()=>({reference:R,floating:F}),[R,F]),oe=m.useMemo(()=>{const G={position:n,left:0,top:0};if(!ie.floating)return G;const V=iNe(ie.floating,d.x),ee=iNe(ie.floating,d.y);return l?{...G,transform:"translate("+V+"px, "+ee+"px)",...iVe(ie.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:ee}},[n,l,ie.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:re,refs:Y,elements:ie,floatingStyles:oe}),[d,re,Y,ie,oe])}const Txn=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?qde({element:r.current,padding:s}).fn(n):{}:r?qde({element:r,padding:s}).fn(n):{}}}},Ixn=(e,t)=>({...OAe(e),options:[e,t]}),Pxn=(e,t)=>({...MAe(e),options:[e,t]}),Fxn=(e,t)=>({...qQe(e),options:[e,t]}),Oxn=(e,t)=>({...RAe(e),options:[e,t]}),Mxn=(e,t)=>({...LAe(e),options:[e,t]}),Rxn=(e,t)=>({...WQe(e),options:[e,t]}),Lxn=(e,t)=>({...Txn(e),options:[e,t]});var Dxn="Arrow",aVe=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...a}=e;return i.jsx(Fc.svg,{...a,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});aVe.displayName=Dxn;var Bxn=aVe;function $xn(e){const[t,n]=m.useState(void 0);return Ky(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let o,l;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var _ue="Popper",[oVe,l8]=N5(_ue),[Uxn,lVe]=oVe(_ue),cVe=e=>{const{__scopePopper:t,children:n}=e,[r,s]=m.useState(null);return i.jsx(Uxn,{scope:t,anchor:r,onAnchorChange:s,children:n})};cVe.displayName=_ue;var uVe="PopperAnchor",dVe=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,a=lVe(uVe,n),o=m.useRef(null),l=nu(t,o);return m.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:i.jsx(Fc.div,{...s,ref:l})});dVe.displayName=uVe;var kue="PopperContent",[zxn,Hxn]=oVe(kue),fVe=m.forwardRef((e,t)=>{var be,je,Ie,Re,Qe,Be;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:x=!1,updatePositionStrategy:g="optimized",onPlaced:v,...w}=e,C=lVe(kue,n),[N,I]=m.useState(null),P=nu(t,it=>I(it)),[R,F]=m.useState(null),U=$xn(R),L=(U==null?void 0:U.width)??0,z=(U==null?void 0:U.height)??0,X=r+(a!=="center"?"-"+a:""),ne=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},J=Array.isArray(u)?u:[u],Z=J.length>0,re={padding:ne,boundary:J.filter(Wxn),altBoundary:Z},{refs:he,floatingStyles:Y,placement:ie,isPositioned:oe,middlewareData:G}=kxn({strategy:"fixed",placement:X,whileElementsMounted:(...it)=>FAe(...it,{animationFrame:g==="always"}),elements:{reference:C.anchor},middleware:[Ixn({mainAxis:s+z,alignmentAxis:o}),c&&Pxn({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Fxn():void 0,...re}),c&&Oxn({...re}),Mxn({...re,apply:({elements:it,rects:tt,availableWidth:at,availableHeight:dt})=>{const{width:ct,height:Ut}=tt.reference,kt=it.floating.style;kt.setProperty("--radix-popper-available-width",`${at}px`),kt.setProperty("--radix-popper-available-height",`${dt}px`),kt.setProperty("--radix-popper-anchor-width",`${ct}px`),kt.setProperty("--radix-popper-anchor-height",`${Ut}px`)}}),R&&Lxn({element:R,padding:l}),qxn({arrowWidth:L,arrowHeight:z}),x&&Rxn({strategy:"referenceHidden",...re})]}),[V,ee]=mVe(ie),ae=h1(v);Ky(()=>{oe&&(ae==null||ae())},[oe,ae]);const fe=(be=G.arrow)==null?void 0:be.x,Ae=(je=G.arrow)==null?void 0:je.y,ce=((Ie=G.arrow)==null?void 0:Ie.centerOffset)!==0,[ye,Ne]=m.useState();return Ky(()=>{N&&Ne(window.getComputedStyle(N).zIndex)},[N]),i.jsx("div",{ref:he.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:oe?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ye,"--radix-popper-transform-origin":[(Re=G.transformOrigin)==null?void 0:Re.x,(Qe=G.transformOrigin)==null?void 0:Qe.y].join(" "),...((Be=G.hide)==null?void 0:Be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(zxn,{scope:n,placedSide:V,onArrowChange:F,arrowX:fe,arrowY:Ae,shouldHideArrow:ce,children:i.jsx(Fc.div,{"data-side":V,"data-align":ee,...w,ref:P,style:{...w.style,animation:oe?void 0:"none"}})})})});fVe.displayName=kue;var hVe="PopperArrow",Vxn={top:"bottom",right:"left",bottom:"top",left:"right"},pVe=m.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,a=Hxn(hVe,r),o=Vxn[a.placedSide];return i.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:i.jsx(Bxn,{...s,ref:n,style:{...s.style,display:"block"}})})});pVe.displayName=hVe;function Wxn(e){return e!==null}var qxn=e=>({name:"transformOrigin",options:e,fn(t){var C,N,I;const{placement:n,rects:r,middlewareData:s}=t,o=((C=s.arrow)==null?void 0:C.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=mVe(n),f={start:"0%",center:"50%",end:"100%"}[d],x=(((N=s.arrow)==null?void 0:N.x)??0)+l/2,g=(((I=s.arrow)==null?void 0:I.y)??0)+c/2;let v="",w="";return u==="bottom"?(v=o?f:`${x}px`,w=`${-c}px`):u==="top"?(v=o?f:`${x}px`,w=`${r.floating.height+c}px`):u==="right"?(v=`${-c}px`,w=o?f:`${g}px`):u==="left"&&(v=`${r.floating.width+c}px`,w=o?f:`${g}px`),{data:{x:v,y:w}}}});function mVe(e){const[t,n="center"]=e.split("-");return[t,n]}var Tue=cVe,vU=dVe,Iue=fVe,Pue=pVe,Gxn="Portal",Fue=m.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,a]=m.useState(!1);Ky(()=>a(!0),[]);const o=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?yre.createPortal(i.jsx(Fc.div,{...r,ref:t}),o):null});Fue.displayName=Gxn;function Kxn(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var g2=e=>{const{present:t,children:n}=e,r=Yxn(t),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),a=nu(r.ref,Xxn(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:a}):null};g2.displayName="Presence";function Yxn(e){const[t,n]=m.useState(),r=m.useRef(null),s=m.useRef(e),a=m.useRef("none"),o=e?"mounted":"unmounted",[l,c]=Kxn(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=lF(r.current);a.current=l==="mounted"?u:"none"},[l]),Ky(()=>{const u=r.current,d=s.current;if(d!==e){const x=a.current,g=lF(u);e?c("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&x!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Ky(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=g=>{const w=lF(r.current).includes(g.animationName);if(g.target===t&&w&&(c("ANIMATION_END"),!s.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},x=g=>{g.target===t&&(a.current=lF(r.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:m.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function lF(e){return(e==null?void 0:e.animationName)||"none"}function Xxn(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var XX="rovingFocusGroup.onEntryFocus",Qxn={bubbles:!1,cancelable:!0},vT="RovingFocusGroup",[xre,xVe,Zxn]=JHe(vT),[Jxn,gVe]=N5(vT,[Zxn]),[egn,tgn]=Jxn(vT),bVe=m.forwardRef((e,t)=>i.jsx(xre.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(xre.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(ngn,{...e,ref:t})})}));bVe.displayName=vT;var ngn=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,x=m.useRef(null),g=nu(t,x),v=eVe(a),[w,C]=bU({prop:o,defaultProp:l??null,onChange:c,caller:vT}),[N,I]=m.useState(!1),P=h1(u),R=xVe(n),F=m.useRef(!1),[U,L]=m.useState(0);return m.useEffect(()=>{const z=x.current;if(z)return z.addEventListener(XX,P),()=>z.removeEventListener(XX,P)},[P]),i.jsx(egn,{scope:n,orientation:r,dir:v,loop:s,currentTabStopId:w,onItemFocus:m.useCallback(z=>C(z),[C]),onItemShiftTab:m.useCallback(()=>I(!0),[]),onFocusableItemAdd:m.useCallback(()=>L(z=>z+1),[]),onFocusableItemRemove:m.useCallback(()=>L(z=>z-1),[]),children:i.jsx(Fc.div,{tabIndex:N||U===0?-1:0,"data-orientation":r,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:si(e.onMouseDown,()=>{F.current=!0}),onFocus:si(e.onFocus,z=>{const X=!F.current;if(z.target===z.currentTarget&&X&&!N){const ne=new CustomEvent(XX,Qxn);if(z.currentTarget.dispatchEvent(ne),!ne.defaultPrevented){const J=R().filter(ie=>ie.focusable),Z=J.find(ie=>ie.active),re=J.find(ie=>ie.id===w),Y=[Z,re,...J].filter(Boolean).map(ie=>ie.ref.current);wVe(Y,d)}}F.current=!1}),onBlur:si(e.onBlur,()=>I(!1))})})}),yVe="RovingFocusGroupItem",vVe=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:a,children:o,...l}=e,c=nD(),u=a||c,d=tgn(yVe,n),f=d.currentTabStopId===u,x=xVe(n),{onFocusableItemAdd:g,onFocusableItemRemove:v,currentTabStopId:w}=d;return m.useEffect(()=>{if(r)return g(),()=>v()},[r,g,v]),i.jsx(xre.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:i.jsx(Fc.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:si(e.onMouseDown,C=>{r?d.onItemFocus(u):C.preventDefault()}),onFocus:si(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:si(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){d.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const N=ign(C,d.orientation,d.dir);if(N!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let P=x().filter(R=>R.focusable).map(R=>R.ref.current);if(N==="last")P.reverse();else if(N==="prev"||N==="next"){N==="prev"&&P.reverse();const R=P.indexOf(C.currentTarget);P=d.loop?agn(P,R+1):P.slice(R+1)}setTimeout(()=>wVe(P))}}),children:typeof o=="function"?o({isCurrentTabStop:f,hasTabStop:w!=null}):o})})});vVe.displayName=yVe;var rgn={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function sgn(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ign(e,t,n){const r=sgn(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return rgn[r]}function wVe(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function agn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ogn=bVe,lgn=vVe,cgn=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},hC=new WeakMap,cF=new WeakMap,uF={},QX=0,CVe=function(e){return e&&(e.host||CVe(e.parentNode))},ugn=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=CVe(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},dgn=function(e,t,n,r){var s=ugn(t,Array.isArray(e)?e:[e]);uF[n]||(uF[n]=new WeakMap);var a=uF[n],o=[],l=new Set,c=new Set(s),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};s.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(x){if(l.has(x))d(x);else try{var g=x.getAttribute(r),v=g!==null&&g!=="false",w=(hC.get(x)||0)+1,C=(a.get(x)||0)+1;hC.set(x,w),a.set(x,C),o.push(x),w===1&&v&&cF.set(x,!0),C===1&&x.setAttribute(n,"true"),v||x.setAttribute(r,"true")}catch(N){console.error("aria-hidden: cannot operate on ",x,N)}})};return d(t),l.clear(),QX++,function(){o.forEach(function(f){var x=hC.get(f)-1,g=a.get(f)-1;hC.set(f,x),a.set(f,g),x||(cF.has(f)||f.removeAttribute(r),cF.delete(f)),g||f.removeAttribute(n)}),QX--,QX||(hC=new WeakMap,hC=new WeakMap,cF=new WeakMap,uF={})}},SVe=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=cgn(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),dgn(r,s,n,"aria-hidden")):function(){return null}},Ib=function(){return Ib=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Ib.apply(this,arguments)};function fgn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function hgn(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var NVe=iRe(),ZX=function(){},wU=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:ZX,onWheelCapture:ZX,onTouchMoveCapture:ZX}),s=r[0],a=r[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,x=e.sideCar,g=e.noRelative,v=e.noIsolation,w=e.inert,C=e.allowPinchZoom,N=e.as,I=N===void 0?"div":N,P=e.gapMode,R=fgn(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),F=x,U=PMe([n,t]),L=Ib(Ib({},R),s);return m.createElement(m.Fragment,null,d&&m.createElement(F,{sideCar:NVe,removeScrollBar:u,shards:f,noRelative:g,noIsolation:v,inert:w,setCallbacks:a,allowPinchZoom:!!C,lockRef:n,gapMode:P}),o?m.cloneElement(m.Children.only(l),Ib(Ib({},L),{ref:U})):m.createElement(I,Ib({},L,{className:c,ref:U}),l))});wU.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};wU.classNames={fullWidth:n9,zeroRight:t9};var gre=!1;if(typeof window<"u")try{var dF=Object.defineProperty({},"passive",{get:function(){return gre=!0,!0}});window.addEventListener("test",dF,dF),window.removeEventListener("test",dF,dF)}catch{gre=!1}var pC=gre?{passive:!1}:!1,pgn=function(e){return e.tagName==="TEXTAREA"},AVe=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!pgn(e)&&n[t]==="visible")},mgn=function(e){return AVe(e,"overflowY")},xgn=function(e){return AVe(e,"overflowX")},aNe=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=jVe(e,r);if(s){var a=EVe(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ggn=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},bgn=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},jVe=function(e,t){return e==="v"?mgn(t):xgn(t)},EVe=function(e,t){return e==="v"?ggn(t):bgn(t)},ygn=function(e,t){return e==="h"&&t==="rtl"?-1:1},vgn=function(e,t,n,r,s){var a=ygn(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),u=!1,d=o>0,f=0,x=0;do{if(!l)break;var g=EVe(e,l),v=g[0],w=g[1],C=g[2],N=w-C-a*v;(v||N)&&jVe(e,l)&&(f+=N,x+=v);var I=l.parentNode;l=I&&I.nodeType===Node.DOCUMENT_FRAGMENT_NODE?I.host:I}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&Math.abs(f)<1||!d&&Math.abs(x)<1)&&(u=!0),u},fF=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},oNe=function(e){return[e.deltaX,e.deltaY]},lNe=function(e){return e&&"current"in e?e.current:e},wgn=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Cgn=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},Sgn=0,mC=[];function Ngn(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(Sgn++)[0],a=m.useState(Zoe)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=hgn([e.lockRef.current],(e.shards||[]).map(lNe),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var N=fF(w),I=n.current,P="deltaX"in w?w.deltaX:I[0]-N[0],R="deltaY"in w?w.deltaY:I[1]-N[1],F,U=w.target,L=Math.abs(P)>Math.abs(R)?"h":"v";if("touches"in w&&L==="h"&&U.type==="range")return!1;var z=aNe(L,U);if(!z)return!0;if(z?F=L:(F=L==="v"?"h":"v",z=aNe(L,U)),!z)return!1;if(!r.current&&"changedTouches"in w&&(P||R)&&(r.current=F),!F)return!0;var X=r.current||F;return vgn(X,C,w,X==="h"?P:R)},[]),c=m.useCallback(function(w){var C=w;if(!(!mC.length||mC[mC.length-1]!==a)){var N="deltaY"in C?oNe(C):fF(C),I=t.current.filter(function(F){return F.name===C.type&&(F.target===C.target||C.target===F.shadowParent)&&wgn(F.delta,N)})[0];if(I&&I.should){C.cancelable&&C.preventDefault();return}if(!I){var P=(o.current.shards||[]).map(lNe).filter(Boolean).filter(function(F){return F.contains(C.target)}),R=P.length>0?l(C,P[0]):!o.current.noIsolation;R&&C.cancelable&&C.preventDefault()}}},[]),u=m.useCallback(function(w,C,N,I){var P={name:w,delta:C,target:N,should:I,shadowParent:Agn(N)};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(R){return R!==P})},1)},[]),d=m.useCallback(function(w){n.current=fF(w),r.current=void 0},[]),f=m.useCallback(function(w){u(w.type,oNe(w),w.target,l(w,e.lockRef.current))},[]),x=m.useCallback(function(w){u(w.type,fF(w),w.target,l(w,e.lockRef.current))},[]);m.useEffect(function(){return mC.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:x}),document.addEventListener("wheel",c,pC),document.addEventListener("touchmove",c,pC),document.addEventListener("touchstart",d,pC),function(){mC=mC.filter(function(w){return w!==a}),document.removeEventListener("wheel",c,pC),document.removeEventListener("touchmove",c,pC),document.removeEventListener("touchstart",d,pC)}},[]);var g=e.removeScrollBar,v=e.inert;return m.createElement(m.Fragment,null,v?m.createElement(a,{styles:Cgn(s)}):null,g?m.createElement(cRe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Agn(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const jgn=oRe(NVe,Ngn);var Oue=m.forwardRef(function(e,t){return m.createElement(wU,Ib({},e,{ref:t,sideCar:jgn}))});Oue.classNames=wU.classNames;var bre=["Enter"," "],Egn=["ArrowDown","PageUp","Home"],_Ve=["ArrowUp","PageDown","End"],_gn=[...Egn,..._Ve],kgn={ltr:[...bre,"ArrowRight"],rtl:[...bre,"ArrowLeft"]},Tgn={ltr:["ArrowLeft"],rtl:["ArrowRight"]},wT="Menu",[W_,Ign,Pgn]=JHe(wT),[A5,kVe]=N5(wT,[Pgn,l8,gVe]),CU=l8(),TVe=gVe(),[Fgn,c8]=A5(wT),[Ogn,CT]=A5(wT),IVe=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:a,modal:o=!0}=e,l=CU(t),[c,u]=m.useState(null),d=m.useRef(!1),f=h1(a),x=eVe(s);return m.useEffect(()=>{const g=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),i.jsx(Tue,{...l,children:i.jsx(Fgn,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:i.jsx(Ogn,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:x,modal:o,children:r})})})};IVe.displayName=wT;var Mgn="MenuAnchor",Mue=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=CU(n);return i.jsx(vU,{...s,...r,ref:t})});Mue.displayName=Mgn;var Rgn="MenuPortal",[yvn,PVe]=A5(Rgn,{forceMount:void 0}),Xh="MenuContent",[Lgn,Rue]=A5(Xh),FVe=m.forwardRef((e,t)=>{const n=PVe(Xh,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=c8(Xh,e.__scopeMenu),o=CT(Xh,e.__scopeMenu);return i.jsx(W_.Provider,{scope:e.__scopeMenu,children:i.jsx(g2,{present:r||a.open,children:i.jsx(W_.Slot,{scope:e.__scopeMenu,children:o.modal?i.jsx(Dgn,{...s,ref:t}):i.jsx(Bgn,{...s,ref:t})})})})}),Dgn=m.forwardRef((e,t)=>{const n=c8(Xh,e.__scopeMenu),r=m.useRef(null),s=nu(t,r);return m.useEffect(()=>{const a=r.current;if(a)return SVe(a)},[]),i.jsx(Lue,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:si(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Bgn=m.forwardRef((e,t)=>{const n=c8(Xh,e.__scopeMenu);return i.jsx(Lue,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),$gn=V_("MenuContent.ScrollLock"),Lue=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:x,onDismiss:g,disableOutsideScroll:v,...w}=e,C=c8(Xh,n),N=CT(Xh,n),I=CU(n),P=TVe(n),R=Ign(n),[F,U]=m.useState(null),L=m.useRef(null),z=nu(t,L,C.onContentChange),X=m.useRef(0),ne=m.useRef(""),J=m.useRef(0),Z=m.useRef(null),re=m.useRef("right"),he=m.useRef(0),Y=v?Oue:m.Fragment,ie=v?{as:$gn,allowPinchZoom:!0}:void 0,oe=V=>{var be,je;const ee=ne.current+V,ae=R().filter(Ie=>!Ie.disabled),fe=document.activeElement,Ae=(be=ae.find(Ie=>Ie.ref.current===fe))==null?void 0:be.textValue,ce=ae.map(Ie=>Ie.textValue),ye=Zgn(ce,ee,Ae),Ne=(je=ae.find(Ie=>Ie.textValue===ye))==null?void 0:je.ref.current;(function Ie(Re){ne.current=Re,window.clearTimeout(X.current),Re!==""&&(X.current=window.setTimeout(()=>Ie(""),1e3))})(ee),Ne&&setTimeout(()=>Ne.focus())};m.useEffect(()=>()=>window.clearTimeout(X.current),[]),rVe();const G=m.useCallback(V=>{var ae,fe;return re.current===((ae=Z.current)==null?void 0:ae.side)&&e1n(V,(fe=Z.current)==null?void 0:fe.area)},[]);return i.jsx(Lgn,{scope:n,searchRef:ne,onItemEnter:m.useCallback(V=>{G(V)&&V.preventDefault()},[G]),onItemLeave:m.useCallback(V=>{var ee;G(V)||((ee=L.current)==null||ee.focus(),U(null))},[G]),onTriggerLeave:m.useCallback(V=>{G(V)&&V.preventDefault()},[G]),pointerGraceTimerRef:J,onPointerGraceIntentChange:m.useCallback(V=>{Z.current=V},[]),children:i.jsx(Y,{...ie,children:i.jsx(Eue,{asChild:!0,trapped:s,onMountAutoFocus:si(a,V=>{var ee;V.preventDefault(),(ee=L.current)==null||ee.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:i.jsx(yU,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:x,onDismiss:g,children:i.jsx(ogn,{asChild:!0,...P,dir:N.dir,orientation:"vertical",loop:r,currentTabStopId:F,onCurrentTabStopIdChange:U,onEntryFocus:si(c,V=>{N.isUsingKeyboardRef.current||V.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(Iue,{role:"menu","aria-orientation":"vertical","data-state":YVe(C.open),"data-radix-menu-content":"",dir:N.dir,...I,...w,ref:z,style:{outline:"none",...w.style},onKeyDown:si(w.onKeyDown,V=>{const ae=V.target.closest("[data-radix-menu-content]")===V.currentTarget,fe=V.ctrlKey||V.altKey||V.metaKey,Ae=V.key.length===1;ae&&(V.key==="Tab"&&V.preventDefault(),!fe&&Ae&&oe(V.key));const ce=L.current;if(V.target!==ce||!_gn.includes(V.key))return;V.preventDefault();const Ne=R().filter(be=>!be.disabled).map(be=>be.ref.current);_Ve.includes(V.key)&&Ne.reverse(),Xgn(Ne)}),onBlur:si(e.onBlur,V=>{V.currentTarget.contains(V.target)||(window.clearTimeout(X.current),ne.current="")}),onPointerMove:si(e.onPointerMove,q_(V=>{const ee=V.target,ae=he.current!==V.clientX;if(V.currentTarget.contains(ee)&&ae){const fe=V.clientX>he.current?"right":"left";re.current=fe,he.current=V.clientX}}))})})})})})})});FVe.displayName=Xh;var Ugn="MenuGroup",Due=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Fc.div,{role:"group",...r,ref:t})});Due.displayName=Ugn;var zgn="MenuLabel",OVe=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Fc.div,{...r,ref:t})});OVe.displayName=zgn;var sD="MenuItem",cNe="menu.itemSelect",SU=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,a=m.useRef(null),o=CT(sD,e.__scopeMenu),l=Rue(sD,e.__scopeMenu),c=nu(t,a),u=m.useRef(!1),d=()=>{const f=a.current;if(!n&&f){const x=new CustomEvent(cNe,{bubbles:!0,cancelable:!0});f.addEventListener(cNe,g=>r==null?void 0:r(g),{once:!0}),ZHe(f,x),x.defaultPrevented?u.current=!1:o.onClose()}};return i.jsx(MVe,{...s,ref:c,disabled:n,onClick:si(e.onClick,d),onPointerDown:f=>{var x;(x=e.onPointerDown)==null||x.call(e,f),u.current=!0},onPointerUp:si(e.onPointerUp,f=>{var x;u.current||(x=f.currentTarget)==null||x.click()}),onKeyDown:si(e.onKeyDown,f=>{const x=l.searchRef.current!=="";n||x&&f.key===" "||bre.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});SU.displayName=sD;var MVe=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...a}=e,o=Rue(sD,n),l=TVe(n),c=m.useRef(null),u=nu(t,c),[d,f]=m.useState(!1),[x,g]=m.useState("");return m.useEffect(()=>{const v=c.current;v&&g((v.textContent??"").trim())},[a.children]),i.jsx(W_.ItemSlot,{scope:n,disabled:r,textValue:s??x,children:i.jsx(lgn,{asChild:!0,...l,focusable:!r,children:i.jsx(Fc.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:u,onPointerMove:si(e.onPointerMove,q_(v=>{r?o.onItemLeave(v):(o.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:si(e.onPointerLeave,q_(v=>o.onItemLeave(v))),onFocus:si(e.onFocus,()=>f(!0)),onBlur:si(e.onBlur,()=>f(!1))})})})}),Hgn="MenuCheckboxItem",RVe=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return i.jsx(UVe,{scope:e.__scopeMenu,checked:n,children:i.jsx(SU,{role:"menuitemcheckbox","aria-checked":iD(n)?"mixed":n,...s,ref:t,"data-state":$ue(n),onSelect:si(s.onSelect,()=>r==null?void 0:r(iD(n)?!0:!n),{checkForDefaultPrevented:!1})})})});RVe.displayName=Hgn;var LVe="MenuRadioGroup",[Vgn,Wgn]=A5(LVe,{value:void 0,onValueChange:()=>{}}),DVe=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,a=h1(r);return i.jsx(Vgn,{scope:e.__scopeMenu,value:n,onValueChange:a,children:i.jsx(Due,{...s,ref:t})})});DVe.displayName=LVe;var BVe="MenuRadioItem",$Ve=m.forwardRef((e,t)=>{const{value:n,...r}=e,s=Wgn(BVe,e.__scopeMenu),a=n===s.value;return i.jsx(UVe,{scope:e.__scopeMenu,checked:a,children:i.jsx(SU,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":$ue(a),onSelect:si(r.onSelect,()=>{var o;return(o=s.onValueChange)==null?void 0:o.call(s,n)},{checkForDefaultPrevented:!1})})})});$Ve.displayName=BVe;var Bue="MenuItemIndicator",[UVe,qgn]=A5(Bue,{checked:!1}),zVe=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,a=qgn(Bue,n);return i.jsx(g2,{present:r||iD(a.checked)||a.checked===!0,children:i.jsx(Fc.span,{...s,ref:t,"data-state":$ue(a.checked)})})});zVe.displayName=Bue;var Ggn="MenuSeparator",HVe=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(Fc.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});HVe.displayName=Ggn;var Kgn="MenuArrow",VVe=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=CU(n);return i.jsx(Pue,{...s,...r,ref:t})});VVe.displayName=Kgn;var Ygn="MenuSub",[vvn,WVe]=A5(Ygn),Oj="MenuSubTrigger",qVe=m.forwardRef((e,t)=>{const n=c8(Oj,e.__scopeMenu),r=CT(Oj,e.__scopeMenu),s=WVe(Oj,e.__scopeMenu),a=Rue(Oj,e.__scopeMenu),o=m.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=a,u={__scopeMenu:e.__scopeMenu},d=m.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return m.useEffect(()=>d,[d]),m.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),c(null)}},[l,c]),i.jsx(Mue,{asChild:!0,...u,children:i.jsx(MVe,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":YVe(n.open),...e,ref:gU(t,s.onTriggerChange),onClick:f=>{var x;(x=e.onClick)==null||x.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:si(e.onPointerMove,q_(f=>{a.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:si(e.onPointerLeave,q_(f=>{var g,v;d();const x=(g=n.content)==null?void 0:g.getBoundingClientRect();if(x){const w=(v=n.content)==null?void 0:v.dataset.side,C=w==="right",N=C?-5:5,I=x[C?"left":"right"],P=x[C?"right":"left"];a.onPointerGraceIntentChange({area:[{x:f.clientX+N,y:f.clientY},{x:I,y:x.top},{x:P,y:x.top},{x:P,y:x.bottom},{x:I,y:x.bottom}],side:w}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(f),f.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:si(e.onKeyDown,f=>{var g;const x=a.searchRef.current!=="";e.disabled||x&&f.key===" "||kgn[r.dir].includes(f.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),f.preventDefault())})})})});qVe.displayName=Oj;var GVe="MenuSubContent",KVe=m.forwardRef((e,t)=>{const n=PVe(Xh,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=c8(Xh,e.__scopeMenu),o=CT(Xh,e.__scopeMenu),l=WVe(GVe,e.__scopeMenu),c=m.useRef(null),u=nu(t,c);return i.jsx(W_.Provider,{scope:e.__scopeMenu,children:i.jsx(g2,{present:r||a.open,children:i.jsx(W_.Slot,{scope:e.__scopeMenu,children:i.jsx(Lue,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;o.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:si(e.onFocusOutside,d=>{d.target!==l.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:si(e.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:si(e.onKeyDown,d=>{var g;const f=d.currentTarget.contains(d.target),x=Tgn[o.dir].includes(d.key);f&&x&&(a.onOpenChange(!1),(g=l.trigger)==null||g.focus(),d.preventDefault())})})})})})});KVe.displayName=GVe;function YVe(e){return e?"open":"closed"}function iD(e){return e==="indeterminate"}function $ue(e){return iD(e)?"indeterminate":e?"checked":"unchecked"}function Xgn(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Qgn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Zgn(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=Qgn(e,Math.max(a,0));s.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function Jgn(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const l=t[a],c=t[o],u=l.x,d=l.y,f=c.x,x=c.y;d>r!=x>r&&n<(f-u)*(r-d)/(x-d)+u&&(s=!s)}return s}function e1n(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Jgn(n,t)}function q_(e){return t=>t.pointerType==="mouse"?e(t):void 0}var t1n=IVe,n1n=Mue,r1n=FVe,s1n=Due,i1n=OVe,a1n=SU,o1n=RVe,l1n=DVe,c1n=$Ve,u1n=zVe,d1n=HVe,f1n=VVe,h1n=qVe,p1n=KVe,NU="DropdownMenu",[m1n,wvn]=N5(NU,[kVe]),sf=kVe(),[x1n,XVe]=m1n(NU),QVe=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,c=sf(t),u=m.useRef(null),[d,f]=bU({prop:s,defaultProp:a??!1,onChange:o,caller:NU});return i.jsx(x1n,{scope:t,triggerId:nD(),triggerRef:u,contentId:nD(),open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(x=>!x),[f]),modal:l,children:i.jsx(t1n,{...c,open:d,onOpenChange:f,dir:r,modal:l,children:n})})};QVe.displayName=NU;var ZVe="DropdownMenuTrigger",JVe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,a=XVe(ZVe,n),o=sf(n);return i.jsx(n1n,{asChild:!0,...o,children:i.jsx(Fc.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:gU(t,a.triggerRef),onPointerDown:si(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(a.onOpenToggle(),a.open||l.preventDefault())}),onKeyDown:si(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&a.onOpenToggle(),l.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});JVe.displayName=ZVe;var eWe="DropdownMenuContent",tWe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=XVe(eWe,n),a=sf(n),o=m.useRef(!1);return i.jsx(r1n,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...r,ref:t,onCloseAutoFocus:si(e.onCloseAutoFocus,l=>{var c;o.current||(c=s.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:si(e.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!s.modal||d)&&(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)"}})});tWe.displayName=eWe;var g1n="DropdownMenuGroup",b1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=sf(n);return i.jsx(s1n,{...s,...r,ref:t})});b1n.displayName=g1n;var y1n="DropdownMenuLabel",v1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=sf(n);return i.jsx(i1n,{...s,...r,ref:t})});v1n.displayName=y1n;var w1n="DropdownMenuItem",nWe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=sf(n);return i.jsx(a1n,{...s,...r,ref:t})});nWe.displayName=w1n;var C1n="DropdownMenuCheckboxItem",S1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=sf(n);return i.jsx(o1n,{...s,...r,ref:t})});S1n.displayName=C1n;var N1n="DropdownMenuRadioGroup",A1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=sf(n);return i.jsx(l1n,{...s,...r,ref:t})});A1n.displayName=N1n;var j1n="DropdownMenuRadioItem",E1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=sf(n);return i.jsx(c1n,{...s,...r,ref:t})});E1n.displayName=j1n;var _1n="DropdownMenuItemIndicator",k1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=sf(n);return i.jsx(u1n,{...s,...r,ref:t})});k1n.displayName=_1n;var T1n="DropdownMenuSeparator",I1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=sf(n);return i.jsx(d1n,{...s,...r,ref:t})});I1n.displayName=T1n;var P1n="DropdownMenuArrow",F1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=sf(n);return i.jsx(f1n,{...s,...r,ref:t})});F1n.displayName=P1n;var O1n="DropdownMenuSubTrigger",M1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=sf(n);return i.jsx(h1n,{...s,...r,ref:t})});M1n.displayName=O1n;var R1n="DropdownMenuSubContent",L1n=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=sf(n);return i.jsx(p1n,{...s,...r,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)"}})});L1n.displayName=R1n;var JX=QVe,D1n=JVe,eQ=tWe,tQ=nWe,AU="Popover",[rWe,Cvn]=N5(AU,[l8]),ST=l8(),[B1n,b2]=rWe(AU),sWe=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:o=!1}=e,l=ST(t),c=m.useRef(null),[u,d]=m.useState(!1),[f,x]=bU({prop:r,defaultProp:s??!1,onChange:a,caller:AU});return i.jsx(Tue,{...l,children:i.jsx(B1n,{scope:t,contentId:nD(),triggerRef:c,open:f,onOpenChange:x,onOpenToggle:m.useCallback(()=>x(g=>!g),[x]),hasCustomAnchor:u,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:o,children:n})})};sWe.displayName=AU;var iWe="PopoverAnchor",$1n=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=b2(iWe,n),a=ST(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=s;return m.useEffect(()=>(o(),()=>l()),[o,l]),i.jsx(vU,{...a,...r,ref:t})});$1n.displayName=iWe;var aWe="PopoverTrigger",oWe=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=b2(aWe,n),a=ST(n),o=nu(t,s.triggerRef),l=i.jsx(Fc.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":fWe(s.open),...r,ref:o,onClick:si(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:i.jsx(vU,{asChild:!0,...a,children:l})});oWe.displayName=aWe;var Uue="PopoverPortal",[U1n,z1n]=rWe(Uue,{forceMount:void 0}),lWe=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,a=b2(Uue,t);return i.jsx(U1n,{scope:t,forceMount:n,children:i.jsx(g2,{present:n||a.open,children:i.jsx(Fue,{asChild:!0,container:s,children:r})})})};lWe.displayName=Uue;var XN="PopoverContent",cWe=m.forwardRef((e,t)=>{const n=z1n(XN,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,a=b2(XN,e.__scopePopover);return i.jsx(g2,{present:r||a.open,children:a.modal?i.jsx(V1n,{...s,ref:t}):i.jsx(W1n,{...s,ref:t})})});cWe.displayName=XN;var H1n=V_("PopoverContent.RemoveScroll"),V1n=m.forwardRef((e,t)=>{const n=b2(XN,e.__scopePopover),r=m.useRef(null),s=nu(t,r),a=m.useRef(!1);return m.useEffect(()=>{const o=r.current;if(o)return SVe(o)},[]),i.jsx(Oue,{as:H1n,allowPinchZoom:!0,children:i.jsx(uWe,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:si(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),a.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:si(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:si(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),W1n=m.forwardRef((e,t)=>{const n=b2(XN,e.__scopePopover),r=m.useRef(!1),s=m.useRef(!1);return i.jsx(uWe,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),uWe=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=e,x=b2(XN,n),g=ST(n);return rVe(),i.jsx(Eue,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:i.jsx(yU,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>x.onOpenChange(!1),children:i.jsx(Iue,{"data-state":fWe(x.open),role:"dialog",id:x.contentId,...g,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),dWe="PopoverClose",q1n=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=b2(dWe,n);return i.jsx(Fc.button,{type:"button",...r,ref:t,onClick:si(e.onClick,()=>s.onOpenChange(!1))})});q1n.displayName=dWe;var G1n="PopoverArrow",K1n=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=ST(n);return i.jsx(Pue,{...s,...r,ref:t})});K1n.displayName=G1n;function fWe(e){return e?"open":"closed"}var Y1n=sWe,X1n=oWe,Q1n=lWe,Z1n=cWe;const J1n=e=>`${e.slice(0,5)}...${e.slice(-4)}`,ebn=[{label:"$0 - $100,000",min:0,max:1e5},{label:"$100,000 - $500,000",min:1e5,max:5e5},{label:"$500,000 - $1,000,000",min:5e5,max:1e6},{label:"$1,000,000 - $5,000,000",min:1e6,max:5e6},{label:">$5,000,000",min:5e6,max:1/0},{label:"$0 - -$100,000",min:-1e5,max:0},{label:"-$100,000 - -$500,000",min:-5e5,max:-1e5},{label:"-$500,000 - -$1,000,000",min:-1e6,max:-5e5},{label:"-$1,000,000 - -$5,000,000",min:-5e6,max:-1e6},{label:"< -$5,000,000",min:-1/0,max:-5e6}];function tbn(){const[e,t]=m.useState([]),[n,r]=m.useState("All"),[s,a]=m.useState("All"),[o,l]=m.useState(null),[c,u]=m.useState("All"),[d,f]=m.useState("All"),[x,g]=m.useState(!1),[v,w]=m.useState(!1),[C,N]=m.useState(null),[I,P]=m.useState(null),[R,F]=m.useState(""),{setSignModalOpen:U,copyTradeWatchList:L,getCopyTradeWatchList:z,getTrackedWatchList:X,setIsWhitelist:ne,setMushboomerETH:J,setMushboomerSOL:Z}=m.useContext(Gr);m.useEffect(()=>{const G=()=>{const ee="https://dextradata.nftinit.io/api/hyper/top_whales/",ae=d==="All"?ee:`${ee}?user_tier=${d}`;ls.get(ae).then(fe=>{var Ae;return t(((Ae=fe.data)==null?void 0:Ae.positions_list)||[])})};G();const V=setInterval(G,3e4);return()=>clearInterval(V)},[d]),m.useEffect(()=>{const G=localStorage.getItem("hyperToken"),V=localStorage.getItem("hyperAddress");!G||!V||(async()=>{var ee,ae;try{const fe=await Si(V.toLowerCase(),G);fe!=null&&fe.success&&(ne(fe.whitelist),J(((ee=fe.mushboomer_counts)==null?void 0:ee.eth)||0),Z(((ae=fe.mushboomer_counts)==null?void 0:ae.sol)||0))}catch{}})()},[]),m.useEffect(()=>{localStorage.getItem("hyperToken")&&(z(),X())},[]);const re=async({walletAddress:G,isFollow:V,isScalper:ee})=>{try{const ae=localStorage.getItem("hyperToken"),fe=localStorage.getItem("hyperAddress");if(!ae){U(!0);return}const Ae=V?"https://dextrabothypev2.nftinit.io/api/test_app/following/info/":"https://dextrabothypev2.nftinit.io/api/hyper/following/get_setting/",ce=V?{address:fe?fe.toLowerCase():localAddress,token:ae,follow_address:G.toLowerCase()}:{address:fe?fe.toLowerCase():localAddress,token:ae},Ne=await(await fetch(Ae,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(ce)})).json();if(!Ne.success){on.error(Ne.error_message||"Something went wrong");return}z(),X(),P(Array.isArray(Ne==null?void 0:Ne.data)?[...Ne.data].sort((be,je)=>new Date(je.created_at||0)-new Date(be.created_at||0)):Ne==null?void 0:Ne.data),F(G),N(ee),w(!0)}catch(ae){on.error(ae.message||"Something went wrong")}},he=m.useMemo(()=>[...new Set(e.map(G=>G.coin))],[e]),Y=m.useMemo(()=>e.filter(G=>{if(n!=="All"&&G.coin!==n||s!=="All"&&G.direction!==s.toLowerCase()||d!=="All"&&![String(d),Gu[d].label].includes(String(G.user_tier)))return!1;if(o){const V=Number(G.unrealized_pnl),ee=Math.min(o.min,o.max),ae=Math.max(o.min,o.max);if(V<ee||V>ae)return!1}return!(c==="Profit"&&Number(G.funding_paid)<=0||c==="Loss"&&Number(G.funding_paid)>=0)}),[e,n,s,o,c,d]),ie=G=>{if(G==null)return"-";const V=Number(G),ee=V<0?"-":"",ae=Math.abs(V);return ae>=1e9?`${ee}$${(ae/1e9).toFixed(2)}B`:ae>=1e6?`${ee}$${(ae/1e6).toFixed(2)}M`:ae>=1e3?`${ee}$${(ae/1e3).toFixed(2)}K`:`${ee}$${ae.toFixed(2)}`},oe=[{key:"rank",label:"#",width:"46px",render:(G,V,ee)=>i.jsx("span",{className:"text-[#9B9B9B]",children:ee+1})},{key:"wallet",label:"Wallet",width:"210px",render:(G,V)=>{const ee=jue(V.user_tier);return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[18px] leading-none",children:ee.emoji}),i.jsx("a",{href:`/wallet-details/${V.address}`,target:"_blank",onClick:ae=>ae.stopPropagation(),className:"text-white font-medium hover:text-white w-24",children:J1n(V.address)}),i.jsx("span",{className:`flex justify-center items-center px-1 h-6 rounded-[6px] text-[11px] font-medium ${ee.bg} ${ee.txt}`,children:ee.label})]})}},{key:"coin",label:"Coin",sortable:!0,width:"95px",render:(G,V)=>i.jsxs("a",{href:`/terminal/${V.coin}`,target:"_blank",rel:"noreferrer",className:"flex items-center text-white hover:text-gray-400 font-medium",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${V.coin}.svg`,onError:ea,className:"w-5 h-5 mr-2"}),V.coin]})},{key:"direction",label:"Direction",width:"150px ",sortable:!0,render:(G,V)=>{const ee=V.direction==="long",ae=ee?"LONG":"SHORT",fe=ee?"#67FFBD":"#FF797C",Ae=ee?"bg-[#67ffbd]/20":"bg-[#ff797c]/20";return i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsxs("div",{className:`inline-flex items-center gap-1 px-2 py-1 h-6 rounded-[6px] text-[11px] uppercase font-medium ${Ae}`,style:{color:fe},children:[i.jsx(Es,{className:`w-3 h-3 ${ee?"rotate-180":""}`,style:{color:fe}}),ae]}),i.jsxs("div",{className:`inline-flex items-center px-2 py-1 h-6 rounded-[6px] text-[11px] font-medium ${Ae}`,style:{color:fe},children:[V.max_leverage,"X"]})]})}},{key:"notional",label:"Position",sortable:!0,width:"130px",sortValue:G=>Number(G.notional),render:(G,V)=>ie(Number(V.notional))},{key:"szi",label:"Size",sortable:!0,sortValue:G=>Number(G.szi),render:G=>ie(G)},{key:"entry_price",label:"Entry",sortable:!0,sortValue:G=>Number(G.entry_price),render:G=>ie(G)},{key:"market_price",label:"Market",sortable:!0,sortValue:G=>Number(G.market_price),render:G=>ie(G)},{key:"unrealized_pnl",label:"PnL",sortable:!0,sortValue:G=>Math.abs(Number(G.unrealized_pnl)),render:G=>{const V=Number(G)>=0;return i.jsxs("span",{className:`flex items-center ${V?"text-[#3DB380]":"text-[#FF797C]"}`,children:[ie(Math.abs(G)),i.jsx("img",{src:V?iE:aE,className:"ml-[6px] w-[9px] h-[8px]"})]})}},{key:"liq_price",label:"Liq. Price",sortable:!0,sortValue:G=>Number(G.liq_price),render:G=>ie(G)},{key:"funding_paid",label:"Fee",sortable:!0,sortValue:G=>Number(G.funding_paid),render:G=>{const V=Number(G)>=0;return i.jsxs("span",{className:`flex items-center ${V?"text-[#3DB380]":"text-[#FF797C]"}`,children:[ie(Math.abs(G)),i.jsx("img",{src:V?iE:aE,className:"ml-[6px] w-[9px] h-[8px]"})]})}},{key:"action",label:"Action",width:"100px",render:(G,V)=>{const ee=L.some(ae=>ae.wallet_address===V.address);return i.jsx("div",{onClick:ae=>{ae.preventDefault(),ae.stopPropagation(),re({walletAddress:V.address,isFollow:ee})},className:"flex w-[81px] py-2 px-4 justify-center items-center gap-2 flex-shrink-0 rounded-[8px] bg-[#262626] text-[#929292] font-inter text-[12px] font-normal leading-[8px] tracking-[-0.12px] cursor-pointer hover:bg-[#585858] hover:text-white transition-all",children:"Copy Trade"})}}];return i.jsxs(i.Fragment,{children:[i.jsx(g5,{open:v,setOpen:w,copyTradeData:I,copyTradeWallet:R,setCopyTradeWallet:F,isScalper:C,setCopyTradeData:P}),i.jsx(fi,{content:"Displays real-time executed trades from top whales.",children:i.jsxs("div",{className:"flex items-center gap-2 mb-4 mt-8 w-fit",children:[i.jsx("h2",{className:"text-white text-[16px] leading-[21px] font-medium tracking-[-0.32px] pl-[5px] font-inter",children:"Whale Positions"}),i.jsxs("div",{className:"flex items-center gap-1 bg-[#262626] p-1 rounded-full w-fit",children:[i.jsxs("div",{className:"relative w-2 h-2 flex justify-center items-center",children:[i.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-[#4DFF43]/[0.32]  animate-ping"}),i.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-[#4DFF43]"})]}),i.jsx("span",{className:"text-white text-[10px] leading-[10px] font-medium",children:"LIVE"})]}),i.jsx("img",{className:"-ml-[4px]",src:C0,alt:"Dextrabot - Whale Trades"})]})}),i.jsxs("div",{className:"w-full opacity-0 animate-fadeInUp",children:[i.jsxs("div",{className:"md:hidden mt-4",children:[i.jsxs("button",{onClick:()=>g(G=>!G),className:"w-[110px] h-[32px] rounded-[8px] flex items-center justify-center px-[8px] py-[12px] bg-[rgba(103,255,189,0.16)] text-[#67FFBD] font-manrope text-[14px] font-medium",children:[i.jsx("img",{src:Eyt,className:"w-[21px] h-[21px] mr-2"}),"Filters"]}),i.jsx("div",{className:`overflow-hidden transition-all duration-300 ${x?"max-h-[640px] mt-4":"max-h-0"}`,children:i.jsx(uNe,{mobile:!0,symbols:he,symbol:n,setSymbol:r,side:s,setSide:a,pnl:o,setPnl:l,fund:c,setFund:u,tier:d,setTier:f})})]}),i.jsx("div",{className:"hidden md:block",children:i.jsx(uNe,{symbols:he,symbol:n,setSymbol:r,side:s,setSide:a,pnl:o,setPnl:l,fund:c,setFund:u,tier:d,setTier:f})}),e.length===0?i.jsx("div",{className:"space-y-2",children:Array.from({length:34}).map((G,V)=>i.jsx("div",{className:"animate-pulse bg-[#202020] h-[24px] w-full rounded-md"},V))}):i.jsx(Pu,{data:Y,columns:oe,rowKey:G=>G.id,rowHeight:42,listHeight:window.innerHeight-180,tableClassName:"text-[14px]",theadClassName:"text-[13px] font-inter !text-[#9B9B9B] bg-transparent font-normal ",tbodyClassName:"text-[14px]",cellClassName:"text-[14px] font-medium",rowClassName:"bg-transparent border-b border-[#1E1E1E] last:border-0 py-5"})]})]})}function nQ({children:e,value:t}){return i.jsx(D1n,{asChild:!0,children:i.jsxs("button",{className:"h-8 px-3 rounded-lg flex items-center gap-2 text-[13px] bg-transparent text-[#fff] border border-[#2A2A2A]",children:[e,i.jsx(N9,{className:"w-4 h-4 shrink-0"})]})})}function uNe({mobile:e=!1,symbols:t,symbol:n,setSymbol:r,side:s,setSide:a,pnl:o,setPnl:l,fund:c,setFund:u,tier:d,setTier:f}){const[x,g]=m.useState(""),[v,w]=m.useState("");m.useEffect(()=>{if(x===""&&v===""){l(null);return}const N=x===""?null:Number(x),I=v===""?null:Number(v),P=N??I??0,R=I??N??1/0;l({min:P,max:R,label:`${P<0?"-":""}$${Math.abs(P)} - ${R===1/0?"∞":`${R<0?"-":""}$${Math.abs(R)}`}`})},[x,v]);const C=e?"flex flex-wrap gap-2 px-4 py-4 bg-[#1B1B1B] rounded-[16px]":"flex items-center gap-[8px] py-3 overflow-x-auto";return i.jsxs("div",{className:C,children:[!e&&i.jsxs("div",{className:"flex items-center gap-[8px] text-white font-medium pr-[8px]",children:[i.jsx("img",{src:jyt,className:"w-[21px] h-[21px]"}),i.jsx("span",{className:"font-manrope text-[14px] font-medium",children:"Filters"})]}),i.jsxs(JX,{children:[i.jsxs(nQ,{value:n!=="All",children:["Symbol"," ",i.jsxs("span",{className:"ml-1 px-1.5 py-0.5 flex items-center gap-1 text-white",children:[n!=="All"&&i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${n}.svg`,onError:ea,className:"w-4 h-4"}),n]})]}),i.jsx(eQ,{sideOffset:6,className:"z-50 min-w-[140px] max-h-[280px] overflow-y-auto rounded-md bg-[#242424] p-2",children:["All",...t].map(N=>i.jsxs(tQ,{onSelect:()=>r(N),className:`h-8 px-2 flex items-center gap-2 rounded cursor-pointer text-[#A8A8A8] font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px] hover:bg-[#353535] hover:text-white ${n===N?"bg-[#2F2F2F]":""}`,children:[N!=="All"&&i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${N}.svg`,onError:ea,className:"w-4 h-4"}),N]},N))})]}),i.jsxs(JX,{children:[i.jsxs(nQ,{value:s!=="All",children:["Side ",i.jsx("span",{className:"ml-1 px-1.5 py-0.5 text-white",children:s})]}),i.jsx(eQ,{sideOffset:6,className:"z-50 rounded-md bg-[#242424] p-2 text-[#A8A8A8]",children:["All","Long","Short"].map(N=>i.jsx(tQ,{onSelect:()=>a(N),className:`h-8 px-2 flex items-center gap-2 rounded cursor-pointer text-[#A8A8A8] font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px] hover:bg-[#353535] hover:text-white ${s===N?"bg-[#2F2F2F]":""}`,children:N},N))})]}),i.jsxs(JX,{children:[i.jsxs(nQ,{value:c!=="All",children:["Fee ",i.jsx("span",{className:"ml-1 px-1.5 py-0.5 text-white",children:c})]}),i.jsx(eQ,{sideOffset:6,className:"z-50 rounded-md bg-[#242424] p-2 text-[#A8A8A8]",children:["All","Profit","Loss"].map(N=>i.jsx(tQ,{onSelect:()=>u(N),className:`h-8 px-2 flex items-center gap-2 rounded cursor-pointer text-[#A8A8A8] font-inter text-[13px] font-medium leading-[8px] tracking-[-0.26px] hover:bg-[#353535] hover:text-white ${c===N?"bg-[#2F2F2F]":""}`,children:N},N))})]}),i.jsxs(Y1n,{children:[i.jsx(X1n,{asChild:!0,children:i.jsxs("button",{className:"h-8 px-3 rounded-lg flex items-center gap-2 text-[13px] bg-transparent text-[#fff] border border-[#2A2A2A]",children:["Unrealized PnL",i.jsx("span",{className:"ml-1 px-1.5 py-0.5 text-white",children:o?o.label:"All"}),i.jsx(N9,{className:"w-4 h-4"})]})}),i.jsx(Q1n,{children:i.jsxs(Z1n,{sideOffset:6,align:"start",className:"z-50 w-64 rounded-lg bg-[#242424] p-4 space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsx("span",{className:"text-white font-manrope text-[13px] font-medium leading-[8px] pl-[15px]",children:"Unrealized PnL"}),i.jsx("button",{onClick:()=>{g(""),w("")},className:"rounded-[6px] border border-[#353535] px-2 py-[6px] text-[#CECECE] font-manrope text-[11px] font-medium leading-[8px] bg-transparent",children:"Clear"})]}),i.jsx("div",{className:"space-y-3",children:["Min","Max"].map((N,I)=>{const P=I===0?x:v,R=I===0?g:w,F=P!=="";return i.jsxs("div",{children:[i.jsx("label",{className:"block mb-1 text-[#A8A8A8] text-[13px] leading-[8px] tracking-[-0.26px] font-normal pl-[15px] pb-[9px]",children:N}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-[#67FFBD] text-sm",children:"$"}),i.jsx("input",{type:"number",value:P,onChange:U=>R(U.target.value),placeholder:"..",className:`w-full h-[32px] pl-7 pr-3 rounded-md outline-none text-[14px] leading-[8px] tracking-[-0.28px] font-medium ${F?"bg-[rgba(103,255,189,0.16)] text-[#67FFBD]":"bg-[#353535] text-[#A8A8A8]"}`})]})]},N)})}),i.jsx("div",{className:"h-px bg-[#363636]"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-white font-inter text-[13px] font-medium leading-[8px] pl-[15px] pb-[13px] pt-1",children:"Presets"}),ebn.map(N=>i.jsx("button",{onClick:()=>{N.label==="All"?(g(""),w("")):(g(N.min.toString()),w(N.max===1/0?"":N.max.toString()))},className:`w-full text-left px-3 py-2 rounded-md text-[13px] leading-[8px] tracking-[-0.26px] font-medium bg-transparent ${(o==null?void 0:o.label)===N.label?"bg-[#2F2F2F] text-white":"text-[#A8A8A8]"} hover:bg-[#2A2A2A] hover:rounded-[6px] hover:p-[9px] hover:text-white hover:border-none`,children:N.label},N.label))]})]})})]}),i.jsx("div",{className:"h-5 w-px bg-[#262626] mx-3"}),i.jsx("div",{className:"inline-flex items-center h-8 px-1.5 py-[18px] rounded-[8px] border border-[#262626] flex-shrink-0 gap-[12px]",children:i.jsxs("div",{className:"flex items-center gap-[12px]",children:[i.jsx("div",{onClick:()=>f("All"),className:`flex items-center justify-center h-7 w-7 px-4 rounded-[8px] text-white text-[14px] font-inter leading-[16px] cursor-pointer transition-colors ${d==="All"?"bg-[#262626]":"hover:bg-[#262626]"}`,children:"All"}),H_.map(({id:N,emoji:I,description:P})=>{const R=d===N;return i.jsx("div",{onClick:()=>f(R?"All":N),className:`h-7 w-7 flex items-center justify-center rounded-[8px] text-[18px] cursor-pointer transition-colors ${R?"bg-[#262626]":"hover:bg-[#262626]"}`,children:i.jsx(fi,{content:P,children:I})},N)})]})})]})}function nbn({data:e}){var d,f;if(!e)return i.jsxs("div",{className:"rounded-[16px] border border-[#1E1E1E] bg-[#101010] p-4 flex justify-between items-center h-[128px] animate-pulse",children:[i.jsxs("div",{className:"space-y-3 max-w-[220px] flex-1",children:[i.jsx("div",{className:"h-[16px] w-[80px] rounded bg-[#262626]"}),i.jsx("div",{className:"h-[16px] w-[60px] rounded bg-[#262626]"}),i.jsx("div",{className:"h-[32px] w-full rounded bg-[#262626]"})]}),i.jsx("div",{className:"flex flex-col items-center gap-3",children:i.jsx("div",{className:"h-[96px] w-[96px] rounded-full bg-[#262626]"})})]});const t=((d=e.long)==null?void 0:d.position)??0,n=((f=e.short)==null?void 0:f.position)??0,r=t+n,s=t>=n,a=r?Math.round(Math.max(t,n)/r*100):0,o=s?"#67FFBD":"#FF797C",l=s?"#FF797C":"#67FFBD",c=s?"#1B4734":"#5E2425",u={chart:{type:"radialBar",sparkline:{enabled:!0}},plotOptions:{radialBar:{startAngle:-90,endAngle:90,hollow:{size:"60%"},track:{background:l,strokeWidth:"100%",margin:0},dataLabels:{show:!1}}},stroke:{lineCap:"round"},fill:{colors:[o]}};return i.jsxs("div",{className:"rounded-[16px] border border-[#1E1E1E] bg-[#101010] p-4 flex justify-between items-center h-[128px] opacity-0 animate-fadeInUp",children:[i.jsxs("div",{className:"space-y-2 max-w-[220px]",children:[i.jsx("div",{className:"text-[#929292] text-[14px] leading-[16px] tracking-[-0.14px]",children:"Direction"}),i.jsx("div",{className:"text-white text-[14px] font-semibold leading-[16px] tracking-[-0.14px]",children:s?"Long":"Short"}),i.jsxs("p",{className:"text-[#9C9C9C] text-[14px] leading-[16px] tracking-[-0.12px]",children:["The least loss and funding load in the last 24 hours is on the"," ",s?"Long":"Short"," side."]})]}),i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsxs("div",{className:"relative w-[96px] h-[48px]",children:[i.jsx(HL,{options:u,series:[a],height:96,width:96,type:"radialBar"}),i.jsx("div",{className:"absolute inset-0 flex items-center justify-center translate-y-[10px]",children:i.jsxs("span",{className:"text-white font-semibold font-manrope text-[18px] leading-[21px] mt-5",children:["%",a]})})]}),i.jsxs("div",{className:`mt-3 rounded-[6px] px-1.5 py-1 flex items-center gap-1 ${s?"bg-[#67FFBD]":"bg-[#FF797C]"}`,children:[s?i.jsx(nse,{className:"w-[10px] h-[10px]",style:{color:c}}):i.jsx(Pl,{className:"w-[10px] h-[10px]",style:{color:c}}),i.jsx("span",{className:"text-[11px] font-semibold leading-[8px] tracking-[0.66px] font-[Manrope]",style:{color:c},children:s?"LONG":"SHORT"})]})]})]})}var rQ,jU="HoverCard",[hWe,Svn]=N5(jU,[l8]),EU=l8(),[rbn,_U]=hWe(jU),pWe=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:s,onOpenChange:a,openDelay:o=700,closeDelay:l=300}=e,c=EU(t),u=m.useRef(0),d=m.useRef(0),f=m.useRef(!1),x=m.useRef(!1),[g,v]=bU({prop:r,defaultProp:s??!1,onChange:a,caller:jU}),w=m.useCallback(()=>{clearTimeout(d.current),u.current=window.setTimeout(()=>v(!0),o)},[o,v]),C=m.useCallback(()=>{clearTimeout(u.current),!f.current&&!x.current&&(d.current=window.setTimeout(()=>v(!1),l))},[l,v]),N=m.useCallback(()=>v(!1),[v]);return m.useEffect(()=>()=>{clearTimeout(u.current),clearTimeout(d.current)},[]),i.jsx(rbn,{scope:t,open:g,onOpenChange:v,onOpen:w,onClose:C,onDismiss:N,hasSelectionRef:f,isPointerDownOnContentRef:x,children:i.jsx(Tue,{...c,children:n})})};pWe.displayName=jU;var mWe="HoverCardTrigger",xWe=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=_U(mWe,n),a=EU(n);return i.jsx(vU,{asChild:!0,...a,children:i.jsx(Fc.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:si(e.onPointerEnter,oD(s.onOpen)),onPointerLeave:si(e.onPointerLeave,oD(s.onClose)),onFocus:si(e.onFocus,s.onOpen),onBlur:si(e.onBlur,s.onClose),onTouchStart:si(e.onTouchStart,o=>o.preventDefault())})})});xWe.displayName=mWe;var zue="HoverCardPortal",[sbn,ibn]=hWe(zue,{forceMount:void 0}),gWe=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:s}=e,a=_U(zue,t);return i.jsx(sbn,{scope:t,forceMount:n,children:i.jsx(g2,{present:n||a.open,children:i.jsx(Fue,{asChild:!0,container:s,children:r})})})};gWe.displayName=zue;var aD="HoverCardContent",bWe=m.forwardRef((e,t)=>{const n=ibn(aD,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,a=_U(aD,e.__scopeHoverCard);return i.jsx(g2,{present:r||a.open,children:i.jsx(abn,{"data-state":a.open?"open":"closed",...s,onPointerEnter:si(e.onPointerEnter,oD(a.onOpen)),onPointerLeave:si(e.onPointerLeave,oD(a.onClose)),ref:t})})});bWe.displayName=aD;var abn=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,...l}=e,c=_U(aD,n),u=EU(n),d=m.useRef(null),f=nu(t,d),[x,g]=m.useState(!1);return m.useEffect(()=>{if(x){const v=document.body;return rQ=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=rQ,v.style.webkitUserSelect=rQ}}},[x]),m.useEffect(()=>{if(d.current){const v=()=>{g(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var C;((C=document.getSelection())==null?void 0:C.toString())!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",v),()=>{document.removeEventListener("pointerup",v),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),m.useEffect(()=>{d.current&&cbn(d.current).forEach(w=>w.setAttribute("tabindex","-1"))}),i.jsx(yU,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:o,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:si(a,v=>{v.preventDefault()}),onDismiss:c.onDismiss,children:i.jsx(Iue,{...u,...l,onPointerDown:si(l.onPointerDown,v=>{v.currentTarget.contains(v.target)&&g(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:f,style:{...l.style,userSelect:x?"text":void 0,WebkitUserSelect:x?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),obn="HoverCardArrow",lbn=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=EU(n);return i.jsx(Pue,{...s,...r,ref:t})});lbn.displayName=obn;function oD(e){return t=>t.pointerType==="touch"?void 0:e()}function cbn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var ubn=pWe,dbn=xWe,fbn=gWe,hbn=bWe;const pbn="#67FFBD",mbn="#FF797C",sQ=e=>{const t=Math.abs(Number(e));return t>=1e9?`$${(t/1e9).toFixed(2)}B`:t>=1e6?`$${(t/1e6).toFixed(2)}M`:t>=1e3?`$${(t/1e3).toFixed(1)}K`:`$${t.toFixed(0)}`};function xbn({data:e=[],title:t=""}){const n=m.useMemo(()=>e.map(r=>({...r,total:r.total??r.long+r.short})).sort((r,s)=>s.total-r.total).slice(0,10),[e]);return i.jsxs("div",{className:"flex w-96 min-w-[240px] flex-col gap-[12px] rounded-[12px] border-[0.8px] border-[rgba(133,133,133,0.32)] bg-[rgba(255,255,255,0.08)] p-[12px] shadow-[0_4px_4px_0_#050505] backdrop-blur-[43px]",children:[i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("span",{className:"text-[14px] font-medium leading-[14px] tracking-[-0.14px] text-white",children:t})}),n.map(r=>{const s=(r.long/r.total*100).toFixed(1),a=(100-s).toFixed(1),o=i.jsxs("div",{className:"flex flex-col gap-[2px] rounded-[8px] border-[0.8px] border-[rgba(133,133,133,0.32)] bg-[rgba(255,255,255,0.08)] shadow-[0_2px_2px_0_rgba(5,5,5,0.48)] backdrop-blur-[43px] p-2 space-y-[2px]",children:[i.jsxs("div",{className:"flex items-center gap-[6px]",children:[i.jsx("span",{className:"inline-block h-[6px] w-[6px] rounded-full",style:{backgroundColor:pbn}}),i.jsx("span",{className:"text-[10px] font-medium leading-[10px] text-white",children:"Long"}),i.jsx("span",{className:"text-[10px] font-medium leading-[10px] text-white",children:sQ(r.long)}),i.jsxs("span",{className:"text-[10px] font-medium leading-[10px] text-[#909090]",children:["(",s,"%)"]})]}),i.jsxs("div",{className:"flex items-center gap-[6px]",children:[i.jsx("span",{className:"inline-block h-[6px] w-[6px] rounded-full",style:{backgroundColor:mbn}}),i.jsx("span",{className:"text-[10px] font-medium leading-[10px] text-white",children:"Short"}),i.jsx("span",{className:"text-[10px] font-medium leading-[10px] text-white",children:sQ(r.short)}),i.jsxs("span",{className:"text-[10px] font-medium leading-[10px] text-[#909090]",children:["(",a,"%)"]})]})]});return i.jsx(fi,{content:o,children:i.jsxs("div",{className:"flex items-center gap-[8px] w-full",children:[i.jsxs("div",{className:"flex w-[100px] items-center gap-[4px] mt-[2px]",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${r.coin}.svg`,alt:r.coin,className:"h-[18px] w-[18px] rounded-full",onError:l=>{l.currentTarget.onerror=null,l.currentTarget.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Ccircle cx='9' cy='9' r='9' fill='%23575757'/%3E%3C/svg%3E"}}),i.jsx("span",{className:"text-[12px] font-normal leading-[14px] tracking-[-0.12px] text-white",children:r.coin})]}),i.jsxs("div",{className:"flex h-[16px] w-full gap-[2px] overflow-hidden ml-3",children:[i.jsx("div",{className:"flex rounded-[4px] items-center justify-center bg-[rgba(103,255,189,0.16)] text-[10px] font-semibold leading-[10px] tracking-[-0.1px] text-[#67FFBD]",style:{flexGrow:r.long,flexBasis:0},children:s>=15?`${s}%`:""}),i.jsx("div",{className:"flex rounded-[4px] items-center justify-center bg-[rgba(255,121,124,0.16)] text-[10px] font-semibold leading-[10px] tracking-[-0.1px] text-[#FF797C]",style:{flexGrow:r.short,flexBasis:0},children:a>=15?`${a}%`:""})]}),i.jsx("span",{className:"w-[48px] text-right text-[12px] font-medium leading-[14px] tracking-[-0.12px] text-white mt-[2px]",children:sQ(r.total)})]})},r.coin)})]})}const gbn="https://dextradata.nftinit.io/api/hyper/wallet/whale/open_interest/?period=1d",bbn="https://dextradata.nftinit.io/api/hyper/wallet/whale/tx_summary/?period=1d",ybn={BTC:"Bitcoin",ETH:"Ethereum",HYPE:"Hyperliquid",SOL:"Solana",XRP:"XRP",PUMP:"Pump",FARTCOIN:"Fartcoin"},vbn=e=>{if(e==null)return"-";const t=Number(e),n=t<0?"-":"",r=Math.abs(t);return r>=1e9?`${n}$${(r/1e9).toFixed(2)}B`:r>=1e6?`${n}$${(r/1e6).toFixed(2)}M`:r>=1e3?`${n}$${(r/1e3).toFixed(0)}K`:`${n}$${r.toFixed(0)}`};function wbn(){const[e,t]=m.useState(null),[n,r]=m.useState([]),[s,a]=m.useState([]);return m.useEffect(()=>{const o=async()=>{var c,u,d,f,x,g;try{const[v,w]=await Promise.all([ls.get(gbn),ls.get(bbn)]),C=((u=(c=v.data)==null?void 0:c.position_summary)==null?void 0:u.slice(0,10).map(R=>({coin:R.coin,long:Number(R.long),short:Number(R.short),total:Number(R.total)})))||[],N=((f=(d=w.data)==null?void 0:d.whale_summary)==null?void 0:f.slice(0,10).map(R=>({coin:R.coin,long:Number(R.long_tx_count),short:Number(R.short_tx_count),total:Number(R.total_tx_count)})))||[];r(C),a(N);const I=C[0]||{},P=((g=(x=w.data)==null?void 0:x.whale_summary)==null?void 0:g[0])||{};t([{type:"position",title:"Highest OI",coin:I.coin||"",name:ybn[I.coin]||I.coin,value:vbn(I.total)},{type:"trader",title:"Most Traded",coin:P.coin||"",name:"Top Trader",value:`${P.whale_count??"-"} Whales | TX: ${P.total_tx_count??"-"}`}])}catch{t([])}};o();const l=setInterval(o,3e4);return()=>clearInterval(l)},[]),e?i.jsx("div",{className:"border border-[#1E1E1E] bg-[#101010] rounded-[16px] p-2 flex gap-2 h-[128px]",children:e.map(o=>i.jsxs(ubn,{openDelay:0,closeDelay:0,children:[i.jsx(dbn,{asChild:!0,children:i.jsxs("div",{className:"flex-1 bg-[#1B1B1B] rounded-[12px] p-[10px] flex flex-col gap-1 hover:bg-[#2A2A2A] transition cursor-pointer",children:[i.jsxs("div",{className:"flex gap-1 justify-between items-center",children:[i.jsx("span",{className:"text-[#929292] text-[14px] leading-[16px] tracking-[-0.14px]",children:o.title}),i.jsxs("div",{className:"relative w-3 h-3 flex justify-center items-center mt-[4px]",children:[i.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-[#4DFF43]/[0.32] animate-ping"}),i.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-[#4DFF43]"})]})]}),i.jsxs("div",{children:[i.jsx("img",{src:o.coin!=="wallet"?`https://app.hyperliquid.xyz/coins/${o.coin}.svg`:"https://app.hyperliquid.xyz/coins/BTC.svg",alt:o.coin,className:"w-[24px] h-[24px] mt-[5px]"}),i.jsxs("div",{className:"flex items-center gap-1 mt-[5px]",children:[i.jsx("div",{className:"text-white text-[14px] font-semibold leading-[16px] tracking-[-0.14px]",children:o.coin}),i.jsx("span",{className:"text-[#B7B7B7] text-[12px] leading-[11px]",children:o.name})]})]}),i.jsx("div",{className:"text-white font-inter text-[13px] font-medium leading-[14px] tracking-[-0.14px] mt-[6px] break-words whitespace-normal",children:o.value})]})}),i.jsx(fbn,{children:i.jsx(hbn,{side:"right",align:"start",sideOffset:0,collisionPadding:8,children:i.jsx(xbn,{title:o.type==="position"?"Top 10 Open OI":"Top 5 Most Trades",data:o.type==="position"?n:s})})})]},o.title))}):i.jsx("div",{className:"border border-[#1E1E1E] bg-[#101010] rounded-[16px] p-2 flex gap-2 h-[128px]",children:Array.from({length:2}).map((o,l)=>i.jsxs("div",{className:"flex-1 bg-[#1B1B1B] rounded-[12px] p-[10px] flex flex-col gap-3 animate-pulse",children:[i.jsx("div",{className:"h-[16px] w-24 rounded bg-[#262626]"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"h-6 w-6 rounded-full bg-[#262626]"}),i.jsx("div",{className:"h-[14px] w-24 rounded bg-[#262626]"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"h-[14px] w-24 rounded bg-[#262626]"}),i.jsx("div",{className:"h-[14px] w-14 rounded bg-[#262626]"})]})]},l))})}const Cbn="https://dextradata.nftinit.io/api/hyper/wallet/whale/top_user_pnl/?period=1d",Sbn="https://dextradata.nftinit.io/api/hyper/wallet/whale/high_risk_traders/?period=1d",Nbn=e=>`${e.slice(0,5)}...${e.slice(-4)}`,Abn=e=>{const t=Math.abs(Number(e));return t>=1e9?`$${(t/1e9).toFixed(2)}B`:t>=1e6?`$${(t/1e6).toFixed(2)}M`:t>=1e3?`$${(t/1e3).toFixed(2)}K`:`$${t.toFixed(2)}`};function jbn(){const[e,t]=m.useState(null);return m.useEffect(()=>{const n=async()=>{var s,a,o,l;try{const[c,u]=await Promise.all([ls.get(Cbn),ls.get(Sbn)]),d=(a=(s=c.data)==null?void 0:s.top_users)==null?void 0:a[0],f=(l=(o=u.data)==null?void 0:o.high_risk_traders)==null?void 0:l[0],x=(g,v,w="growth_rate")=>({title:v,address:Nbn(g.user_token),wallet:g.user_token,amount:`${Number(g.pnl)>=0?"+":"-"}${Abn(g.pnl)}`,percent:`${Number(g[w]||0).toFixed(1)}%`});t([x(d,"Today's Trader","growth_rate"),x(f,"Low Risk Trader","total_win_rate")])}catch(c){console.error("Error loading Highlighted Whales",c),t([])}};n();const r=setInterval(n,3e4);return()=>clearInterval(r)},[]),e?i.jsx("div",{className:"flex gap-2 rounded-[16px] border border-[#1E1E1E] bg-[#101010] p-2 ",children:e.map(({title:n,address:r,amount:s,percent:a,wallet:o},l)=>i.jsx("div",{className:"flex-1",children:i.jsx("a",{href:`/wallet-details/${o}`,target:"_blank",rel:"noopener noreferrer",className:"flex-1 cursor-pointer",children:i.jsxs("div",{className:"flex flex-col gap-4 rounded-[12px] bg-[#1B1B1B] p-[10px] hover:bg-[#2A2A2A] transition",children:[i.jsx("h3",{className:"text-[#929292] font-inter text-[14px] leading-[16px] tracking-[-0.14px]",children:n}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(QHe,{size:24,name:r}),i.jsx("span",{className:"text-white font-inter font-medium text-[14px] leading-[13px] tracking-[-0.14px]",children:r})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"text-white font-inter font-medium text-[14px] leading-[13px] tracking-[-0.14px]",children:s}),i.jsx(fi,{content:n==="Today's Trader"?"Growth Rate":"Win Rate",children:i.jsx("div",{className:"flex h-[18px] w-[48px] items-center justify-center gap-[2px] rounded-[4px] bg-[#67FFBD]/20 pl-[4px] pr-[6px] py-[4px]",children:i.jsx("span",{className:"font-manrope text-[11px] font-semibold leading-[8px] text-[#67FFBD]",children:a})})})]})]})})},l))}):i.jsx("div",{className:"flex gap-4 rounded-[16px] border border-[#1E1E1E] bg-[#101010] p-2",children:Array.from({length:2}).map((n,r)=>i.jsx("div",{className:"flex-1 animate-pulse",children:i.jsxs("div",{className:"flex flex-col gap-4 rounded-[12px] bg-[#1B1B1B] p-[10px]",children:[i.jsx("div",{className:"h-[16px] w-24 rounded bg-[#262626]"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"h-6 w-6 rounded-full bg-[#262626]"}),i.jsx("div",{className:"h-[14px] w-32 rounded bg-[#262626]"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"h-[14px] w-20 rounded bg-[#262626]"}),i.jsx("div",{className:"h-[18px] w-12 rounded bg-[#262626]"})]})]})},r))})}function iQ(e){if(!e)return"-";const t=Math.floor((Date.now()-e.getTime())/1e3);return t<60?`Last updated ${t} sec ago`:`Last updated ${Math.floor(t/60)} min ago`}function Ebn({data:e,lastUpdated:t}){const[n,r]=m.useState(0);return m.useEffect(()=>{const s=setInterval(()=>{r(a=>a+1)},1e3);return()=>clearInterval(s)},[]),i.jsxs("div",{className:"w-full flex flex-col xl:flex-row gap-4 mt-10",children:[i.jsxs("div",{className:"flex-1 min-w-[300px] bg-transparent space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(fi,{content:`Shows overall market direction from whale positions in the last 24 hours.
                    Covers all coins on Hyperliquid.
                    Note: Only includes whales with PERP equity > $1M.`,children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-white font-inter text-[16px] not-italic font-medium leading-[21px] tracking-[-0.32px]",children:"Market Insights"}),i.jsx("span",{className:"inline-flex items-center justify-center h-[18px] px-[6px] py-[3px] bg-[#202020] text-[10px] leading-[10px] font-medium rounded-full text-white",children:"LAST 24H"}),i.jsx("img",{className:"-ml-1",src:C0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("span",{className:"text-[#8B8B8B] font-inter text-[12px] not-italic font-normal leading-[14px] tracking-[0.12px]",children:iQ(t)})]}),i.jsx(nbn,{data:e})]}),i.jsxs("div",{className:"flex-1 min-w-[300px] bg-transparent space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(fi,{content:"Highlights the most active assets by whale positions and trading volume.",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-white font-inter text-[16px] not-italic font-medium leading-[21px] tracking-[-0.32px]",children:"Asset Insights"}),i.jsx("span",{className:"inline-flex items-center justify-center h-[18px] px-[6px] py-[3px] bg-[#202020] text-[10px] leading-[10px] font-medium rounded-full text-white",children:"LAST 24H"}),i.jsx("img",{className:"-ml-1",src:C0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("span",{className:"text-[#8B8B8B] font-inter text-[12px] not-italic font-normal leading-[14px] tracking-[0.12px]",children:iQ(t)})]}),i.jsx(wbn,{})]}),i.jsxs("div",{className:"flex-1 min-w-[300px] bg-transparent space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(fi,{content:"Spotlights standout whale traders based on daily performance and risk profile.",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-white font-inter text-[16px] not-italic font-medium leading-[21px] tracking-[-0.32px]",children:"Highlighted Whales"}),i.jsx("span",{className:"inline-flex items-center justify-center h-[18px] px-[6px] py-[3px] bg-[#202020] text-[10px] leading-[10px] font-medium rounded-full text-white",children:"LAST 24H"}),i.jsx("img",{className:"-ml-1",src:C0,alt:"Dextrabot - Whale Trades"})]})}),i.jsx("span",{className:"text-[#8B8B8B] font-inter text-[12px] not-italic font-normal leading-[14px] tracking-[0.12px]",children:iQ(t)})]}),i.jsx(jbn,{})]})]})}function _bn(){const[e,t]=m.useState(null),[n,r]=m.useState(null);return m.useEffect(()=>{const s=document.querySelector("main");return s&&(s.style.background="#050505"),()=>{s&&(s.style.background="")}},[]),i.jsxs(i.Fragment,{children:[i.jsx(Io,{children:i.jsxs($o,{children:[i.jsx("title",{children:"High Volume Trades on Hyperliquid"}),i.jsx("meta",{name:"description",content:"Track Hyperliquid high volume trades and whale activity in real-time."}),i.jsx("meta",{name:"og:title",content:"Hyperliquid High Volume Trades Tracker | DextraBot"}),i.jsx("meta",{name:"og:description",content:"Track Hyperliquid high volume trades and whale activity in real-time."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/hyperliquid-whale-trades"})]})}),i.jsxs("div",{className:"max-w-[1440px] w-full mx-auto px-4 font-manrope relative mt-4",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsxs("h1",{className:"flex items-center gap-[6px] py-4 text-[18px] leading-[21px] tracking-[-0.36px] font-normal",children:[i.jsx("span",{className:"text-[#929292] font-normal",children:"Dextrabot"}),i.jsx("span",{className:"text-[#929292] font-normal",children:"/"}),i.jsx("img",{className:"w-6 h-6",src:Iyt,alt:"Dextrabot - Hyperliquid Whale Trades"}),i.jsx("span",{className:"hidden sm:block text-white font-bold text-[16px]",children:"Hyperliquid Whale Trades"}),i.jsx("span",{className:"block sm:hidden text-white font-bold text-[16px]",children:"Whale Trades"})]}),i.jsx(fi,{content:"Join our Telegram for Hyperliquid whale alerts.",children:i.jsxs("a",{href:"https://t.me/+bYnGEvP0fB41M2I0",target:"_blank",rel:"noopener noreferrer",className:"rounded-[10px] border border-[#242424] inline-flex h-8 px-2 py-3 justify-center items-center gap-[10px] shrink-0 text-white font-manrope text-[13px] font-semibold leading-[8px] hover:text-white",children:[i.jsx("img",{src:Dbt,alt:"Dextrabot Whale Trades - Join Telegram"}),"Join Telegram"]})})]}),i.jsxs("div",{className:"flex flex-col space-y-4 sm:flex-row sm:space-y-0 sm:space-x-4",children:[i.jsx("div",{className:"w-full sm:w-1/3",children:i.jsx(_0n,{onData:s=>{t(s),r(new Date)}})}),i.jsx("div",{className:"w-full sm:w-2/3",children:i.jsx(Z0n,{})})]}),i.jsx("div",{className:"mt-4",children:i.jsx(Ebn,{data:e,lastUpdated:n})}),i.jsx("div",{className:"mt-4",children:i.jsx(tbn,{})})]})]})}const kbn=()=>{const{setSignModalOpen:e}=m.useContext(Gr),{address:t}=Yr(),[n,r]=m.useState(Array(6).fill("")),[s,a]=m.useState(""),[o,l]=m.useState(!1),[c,u]=m.useState(!1),[d,f]=m.useState(!1),x=async()=>{try{const N=window.localStorage.getItem("hyperToken"),I=window.localStorage.getItem("hyperAddress");if(!N||n.join("")===""||n.join("").length<6){N?n.join("")===""?a("Please enter the verification code."):n.join("").length<6&&a("The verification code must be 6 characters long."):e(!0);return}l(!0),a("");const P="https://dextrabothypev2.nftinit.io/api/telegram/sign_with_telegram/",R={address:t?t.toLowerCase():I,token:N,temp_password:n.join("")},U=await(await fetch(P,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(R)})).json();U!=null&&U.success?(U!=null&&U.telegram_chat_id&&u(!0),r(Array(6).fill("")),on.success(i.jsx(i.Fragment,{children:i.jsx("span",{style:{color:"#67ffbd",paddingLeft:"5px"},children:"Verified successfully."})}),{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.32)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}}),l(!1)):(console.log(U.error_message),a("Invalid code. Please request a new code from Telegram and try again."),f(!0),l(!1))}catch(N){console.error("Error in telegram verify:",N),on.error(N.message||"Something went wrong!"),a(N.message||"Something went wrong!"),f(!0),l(!1)}},g=(N,I)=>{f(!1);const P=[...n];P[I]=N.target.value.toUpperCase().slice(0,1),r(P),N.target.value.length===1&&I<5&&document.getElementById(`code-input-${I+1}`).focus()},v=N=>{f(!1);const I=N.clipboardData.getData("Text").slice(0,6),P=[...n];for(let F=0;F<I.length;F++)P[F]=I[F].toUpperCase();r(P);const R=document.getElementById(`code-input-${(I==null?void 0:I.length)-1}`);R==null||R.focus(),R==null||R.select()},w=(N,I)=>{var P,R;if(f(!1),N.key==="Backspace"){if(n[I]){const F=[...n];F[I]="",r(F)}else if(I>0){const F=document.getElementById(`code-input-${I-1}`),U=[...n];U[I-1]="",r(U),F==null||F.focus()}}else N.key==="ArrowLeft"&&I>0?(P=document.getElementById(`code-input-${I-1}`))==null||P.focus():N.key==="ArrowRight"&&I<5&&((R=document.getElementById(`code-input-${I+1}`))==null||R.focus())},C=()=>{r(Array(6).fill("")),f(!1)};return i.jsxs("div",{className:"flex flex-col items-center justify-center px-2 pb-2 gap-6 w-max h-max bg-[#212121]/90 rounded-2xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#2a2a2a] relative pt-10",onPaste:v,children:[s&&i.jsxs("div",{style:{backdropFilter:"blur(16px)"},className:"w-full max-w-[345px] px-3 py-2 bg-[#ff7171]/20 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-start items-center gap-2.5 absolute top-2 ",children:[i.jsx("img",{src:vc,alt:"",className:"mb-[2.5px]"}),i.jsx("div",{className:"flex justify-start text-[#ff7171] text-[13px] font-normal font-['Inter'] leading-4 tracking-[-0.26px]",children:s})]}),c?i.jsxs("div",{className:"flex flex-col items-center text-white text-base font-medium font-['Inter'] text-center gap-2",children:[i.jsx("img",{src:ike,alt:""}),i.jsx("div",{className:"text-center text-white text-sm font-medium font-['Inter'] leading-4 tracking-[-0.28px]",children:"Successfully"}),i.jsx("div",{className:" w-[186px] text-center text-white text-[13px] font-normal font-['Inter'] leading-4",children:"Your Telegram account is now synced with your wallet."}),i.jsx("div",{className:"flex flex-col items-center gap-6 mt-[33px]",children:i.jsxs("div",{onClick:()=>window.open("https://t.me/Dextrabot_CopyTrade_bot","_blank"),className:"w-[345px] h-10 px-6 py-3 bg-white hover:bg-[#E5E5E5] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] inline-flex justify-center items-center gap-2.5 cursor-pointer",children:[i.jsx("img",{src:ake,alt:""}),i.jsx("div",{className:"justify-start text-black text-sm font-semibold font-['Inter'] leading-none",children:"Open Telegram App"})]})})]}):i.jsxs(i.Fragment,{children:[i.jsx("img",{src:Fyt,alt:"",className:"w-auto h-[40px]"}),i.jsx("h1",{className:"text-center text-white text-sm font-medium font-['Inter'] leading-4 tracking-[-0.28px]",children:"Verify Your Telegram Account"}),i.jsx("p",{className:"mb-2 -mt-4 text-center text-[#929292] text-[13px] font-normal font-['Inter'] leading-4 max-w-[240px]",children:"Enter the 6-character verification code sent to your Telegram account."}),i.jsx("div",{className:"flex gap-2",children:n.map((N,I)=>i.jsx("input",{id:`code-input-${I}`,type:"text",maxLength:"1",value:N,autoComplete:"off",onChange:P=>g(P,I),onKeyDown:P=>w(P,I),className:`${d?"border-[#ff787b]":"border-white/20"} w-10 h-12 text-center text-white text-[32px] font-medium font-['Inter'] leading-10 bg-transparent shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border-[0.60px] rounded-[10px] focus:bg-[#353535]  outline-none`},I))}),i.jsxs("div",{className:"text-center",children:[i.jsxs("span",{class:"text-[#929292] text-[11px] font-normal font-['Inter'] leading-none",children:["Didn’t get a code?"," "]}),i.jsx("span",{onClick:()=>window.open("https://t.me/Dextrabot_CopyTrade_bot","_blank"),class:"text-[#929292] hover:text-white text-[11px] font-medium font-['Inter'] leading-4 cursor-pointer",children:"Open Telegram App"})]}),i.jsxs("div",{className:"flex items-center justify-center gap-2 relative",children:[i.jsx("div",{onClick:C,className:"w-[140px] h-10 px-6 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] outline outline-1 outline-offset-[-1px] outline-[#424242] flex justify-center items-center gap-2.5 cursor-pointer group",children:i.jsx("div",{className:"text-[#b7b7b7] group-hover:text-white text-sm font-semibold font-['Inter'] leading-4 tracking-[-0.28px]",children:"Clear"})}),i.jsx("div",{onClick:N=>{N.preventDefault(),o||x()},className:"w-[196px] h-10 px-6 py-3 bg-white hover:bg-[#E5E5E5] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] flex justify-center items-center gap-2.5 cursor-pointer",children:o?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[72px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{className:"justify-start text-black text-sm font-semibold font-['Inter'] leading-[8px]",children:"Authorize Wallet"})})]})]})]})},Tbn=()=>{const{isConnected:e,address:t}=Yr(),{hyperToken:n,hyperAddress:r,setSignModalOpen:s,setTelegramChatId:a,setSubscriberRole:o,setSubsExpireDay:l,setMushboomerETH:c,setMushboomerSOL:u,setIsReferralCode:d,setIsReferralCodeName:f,setIsWhitelist:x,setHyperToken:g,setHyperAddress:v}=m.useContext(Gr),[w,C]=m.useState(!!window.localStorage.getItem("hyperToken"));return m.useEffect(()=>{const N=window.localStorage.getItem("hyperToken");C(!!N)},[t,e,n,r]),m.useEffect(()=>{(async()=>{var R,F;const I=window.localStorage.getItem("hyperToken"),P=window.localStorage.getItem("hyperAddress");if(!(!I||!P))try{const U=await Si(P.toLowerCase(),I);U!=null&&U.success?(a(U==null?void 0:U.telegram_chat_id),o(U==null?void 0:U.subscriber_role),l(U==null?void 0:U.subs_expire_day),c((R=U==null?void 0:U.mushboomer_counts)==null?void 0:R.eth),u((F=U==null?void 0:U.mushboomer_counts)==null?void 0:F.sol),d(U==null?void 0:U.referral_code),f(U==null?void 0:U.refcode),x(U==null?void 0:U.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),g(""),v(""))}catch(U){console.error("Token verification error:",U),console.error(U.message||"An unknown error occurred.")}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(Io,{children:i.jsxs($o,{children:[i.jsx("title",{children:"Telegram Verify – DextraBot"}),i.jsx("meta",{name:"description",content:"Verify your Telegram account to start earning with DextraBot's referral program. Follow the steps to confirm your Telegram identity and gain access to exclusive rewards."}),i.jsx("meta",{name:"og:title",content:"Telegram Verify – DextraBot"}),i.jsx("meta",{name:"og:description",content:"Verify your Telegram account to start earning with DextraBot's referral program. Follow the steps to confirm your Telegram identity and gain access to exclusive rewards."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/telegram-verify"})]})}),i.jsx("div",{style:{background:"linear-gradient(135deg, #0d0d0d 0%, #1c1c1c 50%, #0d0d0d 100%)"},className:"flex justify-center items-center w-full h-[calc(100vh-6rem)] sm:h-[calc(100vh-5rem)] min-h-max max-h-[calc(100vh-6rem)] sm:max-h-[calc(100vh-5rem)] px-4 pt-16 sm:pt-4 pb-10 bg-[#161616]",children:w?i.jsx(kbn,{}):i.jsx("div",{className:"flex justify-center items-center w-full",children:i.jsx(dU,{})})})]})};function Ibn({onRun:e}){const[t,n]=m.useState({wallet:"",pairs:[],equity:"",scale:"",period:"30D",method:"3"}),[r,s]=m.useState([]);m.useEffect(()=>{fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_coins/").then(u=>u.json()).then(u=>s(u.coins.filter(d=>!d.startsWith("@")).map(d=>({value:d,label:d,icon:`https://app.hyperliquid.xyz/coins/${d}.svg`}))))},[]);const a=[{value:"All",label:"All"},...r],o=({label:u,icon:d})=>i.jsxs("div",{className:"flex items-center gap-2",children:[u!=="All"&&i.jsx("img",{src:d,alt:u,className:"w-4 h-4",onError:f=>f.currentTarget.style.display="none"}),i.jsx("span",{children:u})]}),l={control:(u,d)=>({...u,backgroundColor:"#1B1B1B",borderColor:"#303030",height:"32px",minHeight:"32px",borderRadius:"6px",boxShadow:"none",fontSize:"14px",alignItems:"center"}),valueContainer:u=>({...u,height:"32px",padding:"0 8px",display:"flex",alignItems:"center"}),input:u=>({...u,margin:0,padding:0,color:"#C9C9C9",fontSize:"14px",display:"flex",alignItems:"center"}),indicatorsContainer:u=>({...u,height:"32px"}),indicatorSeparator:u=>({...u,height:"16px",alignSelf:"center",backgroundColor:"#444"}),placeholder:u=>({...u,color:"#7F7F7F",fontSize:"14px",display:"flex",alignItems:"center"}),singleValue:u=>({...u,color:"#7F7F7F",fontSize:"14px",display:"flex",alignItems:"center"}),menu:u=>({...u,backgroundColor:"#1B1B1B",fontSize:"14px"}),option:(u,d)=>({...u,backgroundColor:d.isFocused?"#292929":"#1B1B1B",color:"#C9C9C9",fontSize:"14px",paddingTop:"8px",paddingBottom:"8px",display:"flex",alignItems:"center",":active":{backgroundColor:"#292929"}}),multiValue:u=>({...u,backgroundColor:"#292929"}),multiValueLabel:u=>({...u,color:"#fff",fontSize:"14px"}),multiValueRemove:u=>({...u,color:"#fff",":hover":{backgroundColor:"#555",color:"#fff"}})},c=u=>d=>n({...t,[u]:d.target.value});return i.jsxs("div",{className:"w-[388px] h-auto rounded-[16px] bg-[rgba(30,30,30,0.64)] backdrop-blur-[64px] p-6 flex flex-col gap-4",children:[i.jsx("h2",{className:"text-white font-inter text-[18px] font-semibold tracking-[-0.36px]",children:"Start your backtest"}),i.jsx("p",{className:"text-[#8E8E8E] text-[14px] leading-[16px] tracking-[-0.28px] w-[277px]",children:"Test how profitable it would be to copy any trader’s strategy"}),i.jsxs("label",{className:"flex flex-col gap-2",children:[i.jsx("span",{className:"text-[#C9C9C9] text-[13px] font-manrope font-medium tracking-[0.26px]",children:"Wallet Address"}),i.jsx("input",{className:"w-full h-[32px] rounded-[6px] border border-[#303030] bg-[#1B1B1B] px-3 text-[#7F7F7F] text-[14px] placeholder:text-[#7F7F7F] outline-none",placeholder:"Enter trader’s wallet address",value:t.wallet,onChange:c("wallet")})]}),i.jsxs("label",{className:"flex flex-col gap-2",children:[i.jsx("span",{className:"text-[#C9C9C9] text-[13px] font-manrope font-medium tracking-[0.26px]",children:"Method"}),i.jsxs("select",{value:t.method,onChange:c("method"),className:"w-full h-[32px] rounded-[6px] border border-[#303030] bg-[#1B1B1B] px-2 text-[14px] text-[#7F7F7F] outline-none",children:[i.jsx("option",{value:"1",disabled:!0,children:"Method I (coming soon)"}),i.jsx("option",{value:"2",disabled:!0,children:"Method II (coming soon)"}),i.jsx("option",{value:"3",children:"Method III"})]})]}),i.jsxs("label",{className:"flex flex-col gap-2",children:[i.jsx("span",{className:"text-[#C9C9C9] text-[13px] font-manrope font-medium tracking-[0.26px]",children:"Trading Pairs"}),i.jsx(Zl,{options:a,isMulti:!0,placeholder:"All",closeMenuOnSelect:!1,hideSelectedOptions:!1,formatOptionLabel:o,styles:l,value:t.pairs.length?a.filter(u=>t.pairs.includes(u.value)):null,onChange:u=>{u!=null&&u.some(d=>d.value==="All")?n({...t,pairs:[]}):n({...t,pairs:u?u.map(d=>d.value):[]})}})]}),i.jsxs("label",{className:"flex flex-col gap-2",children:[i.jsx("span",{className:"text-[#C9C9C9] text-[13px] font-manrope font-medium tracking-[0.26px]",children:"Initial Equity"}),i.jsx("input",{type:"number",placeholder:"1000",className:"w-full h-[32px] rounded-[6px] border border-[#303030] bg-[#1B1B1B] px-3 text-[#7F7F7F] text-[14px] placeholder:text-[#7F7F7F] outline-none",value:t.equity,onChange:c("equity")})]}),i.jsxs("label",{className:"flex flex-col gap-2",children:[i.jsx("span",{className:"text-[#C9C9C9] text-[13px] font-manrope font-medium tracking-[0.26px]",children:"Scaling Factor (%)"}),i.jsx("input",{type:"number",placeholder:"50",className:"w-full h-[32px] rounded-[6px] border border-[#303030] bg-[#1B1B1B] px-3 text-[#7F7F7F] text-[14px] placeholder:text-[#7F7F7F] outline-none",value:t.scale,onChange:c("scale")})]}),i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx("span",{className:"text-[#C9C9C9] text-[13px] font-manrope font-medium tracking-[0.26px]",children:"Time Period"}),i.jsx("div",{className:"flex gap-2",children:["7D","30D","90D"].map(u=>i.jsx("button",{onClick:()=>n({...t,period:u}),className:`w-[40px] h-[32px] rounded-[6px] bg-transparent border border-[#303030] flex justify-center items-center text-[12px] ${t.period===u?"text-white":"text-[#7F7F7F]"}`,children:u},u))})]}),i.jsx("button",{onClick:()=>e(t),className:"h-[32px] mt-auto flex py-[12px] px-[24px] justify-center items-center gap-[10px] rounded-[10px] bg-[#1DE674] text-[#0B331C] text-[13px] font-inter font-semibold tracking-[-0.13px]",children:"Run Backtest"})]})}function Pbn(){const[e,t]=m.useState(0);return m.useEffect(()=>{const n=setInterval(()=>{t(r=>(r+1)%3)},600);return()=>clearInterval(n)},[]),i.jsxs("div",{className:"flex flex-col items-center justify-center h-full bg-transparent text-white text-[13px] font-inter space-y-2",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("span",{className:"font-semibold leading-[14px] tracking-[-0.26px]",children:"Backtest Engine"})," ",i.jsx("span",{className:"font-normal leading-[14px] tracking-[-0.26px]",children:"is running..."})]}),i.jsx("div",{className:"text-[#7F7F7F] text-[13px] leading-[14px] tracking-[-0.26px] text-center font-normal",children:"Your strategy is being tested, the results will be here shortly...."}),i.jsx("div",{className:"flex gap-2 pt-1",children:[0,1,2].map(n=>i.jsx("div",{className:`w-[8px] h-[8px] rounded-full transition-all duration-300 ${n===e?"bg-[#1DE674]":"bg-[#404040]"}`},n))})]})}var Hue={};(function e(t,n,r,s){var a=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),o=typeof Path2D=="function"&&typeof DOMMatrix=="function",l=function(){if(!t.OffscreenCanvas)return!1;var ee=new OffscreenCanvas(1,1),ae=ee.getContext("2d");ae.fillRect(0,0,1,1);var fe=ee.transferToImageBitmap();try{ae.createPattern(fe,"no-repeat")}catch{return!1}return!0}();function c(){}function u(ee){var ae=n.exports.Promise,fe=ae!==void 0?ae:t.Promise;return typeof fe=="function"?new fe(ee):(ee(c,c),null)}var d=function(ee,ae){return{transform:function(fe){if(ee)return fe;if(ae.has(fe))return ae.get(fe);var Ae=new OffscreenCanvas(fe.width,fe.height),ce=Ae.getContext("2d");return ce.drawImage(fe,0,0),ae.set(fe,Ae),Ae},clear:function(){ae.clear()}}}(l,new Map),f=function(){var ee=Math.floor(16.666666666666668),ae,fe,Ae={},ce=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(ae=function(ye){var Ne=Math.random();return Ae[Ne]=requestAnimationFrame(function be(je){ce===je||ce+ee-1<je?(ce=je,delete Ae[Ne],ye()):Ae[Ne]=requestAnimationFrame(be)}),Ne},fe=function(ye){Ae[ye]&&cancelAnimationFrame(Ae[ye])}):(ae=function(ye){return setTimeout(ye,ee)},fe=function(ye){return clearTimeout(ye)}),{frame:ae,cancel:fe}}(),x=function(){var ee,ae,fe={};function Ae(ce){function ye(Ne,be){ce.postMessage({options:Ne||{},callback:be})}ce.init=function(be){var je=be.transferControlToOffscreen();ce.postMessage({canvas:je},[je])},ce.fire=function(be,je,Ie){if(ae)return ye(be,null),ae;var Re=Math.random().toString(36).slice(2);return ae=u(function(Qe){function Be(it){it.data.callback===Re&&(delete fe[Re],ce.removeEventListener("message",Be),ae=null,d.clear(),Ie(),Qe())}ce.addEventListener("message",Be),ye(be,Re),fe[Re]=Be.bind(null,{data:{callback:Re}})}),ae},ce.reset=function(){ce.postMessage({reset:!0});for(var be in fe)fe[be](),delete fe[be]}}return function(){if(ee)return ee;if(!r&&a){var ce=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {","  if (msg.data.options) {","    CONFETTI(msg.data.options).then(function () {","      if (msg.data.callback) {","        postMessage({ callback: msg.data.callback });","      }","    });","  } else if (msg.data.reset) {","    CONFETTI && CONFETTI.reset();","  } else if (msg.data.resize) {","    SIZE.width = msg.data.resize.width;","    SIZE.height = msg.data.resize.height;","  } else if (msg.data.canvas) {","    SIZE.width = msg.data.canvas.width;","    SIZE.height = msg.data.canvas.height;","    CONFETTI = module.exports.create(msg.data.canvas);","  }","}"].join(`
`);try{ee=new Worker(URL.createObjectURL(new Blob([ce])))}catch(ye){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",ye),null}Ae(ee)}return ee}}(),g={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function v(ee,ae){return ae?ae(ee):ee}function w(ee){return ee!=null}function C(ee,ae,fe){return v(ee&&w(ee[ae])?ee[ae]:g[ae],fe)}function N(ee){return ee<0?0:Math.floor(ee)}function I(ee,ae){return Math.floor(Math.random()*(ae-ee))+ee}function P(ee){return parseInt(ee,16)}function R(ee){return ee.map(F)}function F(ee){var ae=String(ee).replace(/[^0-9a-f]/gi,"");return ae.length<6&&(ae=ae[0]+ae[0]+ae[1]+ae[1]+ae[2]+ae[2]),{r:P(ae.substring(0,2)),g:P(ae.substring(2,4)),b:P(ae.substring(4,6))}}function U(ee){var ae=C(ee,"origin",Object);return ae.x=C(ae,"x",Number),ae.y=C(ae,"y",Number),ae}function L(ee){ee.width=document.documentElement.clientWidth,ee.height=document.documentElement.clientHeight}function z(ee){var ae=ee.getBoundingClientRect();ee.width=ae.width,ee.height=ae.height}function X(ee){var ae=document.createElement("canvas");return ae.style.position="fixed",ae.style.top="0px",ae.style.left="0px",ae.style.pointerEvents="none",ae.style.zIndex=ee,ae}function ne(ee,ae,fe,Ae,ce,ye,Ne,be,je){ee.save(),ee.translate(ae,fe),ee.rotate(ye),ee.scale(Ae,ce),ee.arc(0,0,1,Ne,be,je),ee.restore()}function J(ee){var ae=ee.angle*(Math.PI/180),fe=ee.spread*(Math.PI/180);return{x:ee.x,y:ee.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:ee.startVelocity*.5+Math.random()*ee.startVelocity,angle2D:-ae+(.5*fe-Math.random()*fe),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:ee.color,shape:ee.shape,tick:0,totalTicks:ee.ticks,decay:ee.decay,drift:ee.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:ee.gravity*3,ovalScalar:.6,scalar:ee.scalar,flat:ee.flat}}function Z(ee,ae){ae.x+=Math.cos(ae.angle2D)*ae.velocity+ae.drift,ae.y+=Math.sin(ae.angle2D)*ae.velocity+ae.gravity,ae.velocity*=ae.decay,ae.flat?(ae.wobble=0,ae.wobbleX=ae.x+10*ae.scalar,ae.wobbleY=ae.y+10*ae.scalar,ae.tiltSin=0,ae.tiltCos=0,ae.random=1):(ae.wobble+=ae.wobbleSpeed,ae.wobbleX=ae.x+10*ae.scalar*Math.cos(ae.wobble),ae.wobbleY=ae.y+10*ae.scalar*Math.sin(ae.wobble),ae.tiltAngle+=.1,ae.tiltSin=Math.sin(ae.tiltAngle),ae.tiltCos=Math.cos(ae.tiltAngle),ae.random=Math.random()+2);var fe=ae.tick++/ae.totalTicks,Ae=ae.x+ae.random*ae.tiltCos,ce=ae.y+ae.random*ae.tiltSin,ye=ae.wobbleX+ae.random*ae.tiltCos,Ne=ae.wobbleY+ae.random*ae.tiltSin;if(ee.fillStyle="rgba("+ae.color.r+", "+ae.color.g+", "+ae.color.b+", "+(1-fe)+")",ee.beginPath(),o&&ae.shape.type==="path"&&typeof ae.shape.path=="string"&&Array.isArray(ae.shape.matrix))ee.fill(oe(ae.shape.path,ae.shape.matrix,ae.x,ae.y,Math.abs(ye-Ae)*.1,Math.abs(Ne-ce)*.1,Math.PI/10*ae.wobble));else if(ae.shape.type==="bitmap"){var be=Math.PI/10*ae.wobble,je=Math.abs(ye-Ae)*.1,Ie=Math.abs(Ne-ce)*.1,Re=ae.shape.bitmap.width*ae.scalar,Qe=ae.shape.bitmap.height*ae.scalar,Be=new DOMMatrix([Math.cos(be)*je,Math.sin(be)*je,-Math.sin(be)*Ie,Math.cos(be)*Ie,ae.x,ae.y]);Be.multiplySelf(new DOMMatrix(ae.shape.matrix));var it=ee.createPattern(d.transform(ae.shape.bitmap),"no-repeat");it.setTransform(Be),ee.globalAlpha=1-fe,ee.fillStyle=it,ee.fillRect(ae.x-Re/2,ae.y-Qe/2,Re,Qe),ee.globalAlpha=1}else if(ae.shape==="circle")ee.ellipse?ee.ellipse(ae.x,ae.y,Math.abs(ye-Ae)*ae.ovalScalar,Math.abs(Ne-ce)*ae.ovalScalar,Math.PI/10*ae.wobble,0,2*Math.PI):ne(ee,ae.x,ae.y,Math.abs(ye-Ae)*ae.ovalScalar,Math.abs(Ne-ce)*ae.ovalScalar,Math.PI/10*ae.wobble,0,2*Math.PI);else if(ae.shape==="star")for(var tt=Math.PI/2*3,at=4*ae.scalar,dt=8*ae.scalar,ct=ae.x,Ut=ae.y,kt=5,tn=Math.PI/kt;kt--;)ct=ae.x+Math.cos(tt)*dt,Ut=ae.y+Math.sin(tt)*dt,ee.lineTo(ct,Ut),tt+=tn,ct=ae.x+Math.cos(tt)*at,Ut=ae.y+Math.sin(tt)*at,ee.lineTo(ct,Ut),tt+=tn;else ee.moveTo(Math.floor(ae.x),Math.floor(ae.y)),ee.lineTo(Math.floor(ae.wobbleX),Math.floor(ce)),ee.lineTo(Math.floor(ye),Math.floor(Ne)),ee.lineTo(Math.floor(Ae),Math.floor(ae.wobbleY));return ee.closePath(),ee.fill(),ae.tick<ae.totalTicks}function re(ee,ae,fe,Ae,ce){var ye=ae.slice(),Ne=ee.getContext("2d"),be,je,Ie=u(function(Re){function Qe(){be=je=null,Ne.clearRect(0,0,Ae.width,Ae.height),d.clear(),ce(),Re()}function Be(){r&&!(Ae.width===s.width&&Ae.height===s.height)&&(Ae.width=ee.width=s.width,Ae.height=ee.height=s.height),!Ae.width&&!Ae.height&&(fe(ee),Ae.width=ee.width,Ae.height=ee.height),Ne.clearRect(0,0,Ae.width,Ae.height),ye=ye.filter(function(it){return Z(Ne,it)}),ye.length?be=f.frame(Be):Qe()}be=f.frame(Be),je=Qe});return{addFettis:function(Re){return ye=ye.concat(Re),Ie},canvas:ee,promise:Ie,reset:function(){be&&f.cancel(be),je&&je()}}}function he(ee,ae){var fe=!ee,Ae=!!C(ae||{},"resize"),ce=!1,ye=C(ae,"disableForReducedMotion",Boolean),Ne=a&&!!C(ae||{},"useWorker"),be=Ne?x():null,je=fe?L:z,Ie=ee&&be?!!ee.__confetti_initialized:!1,Re=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,Qe;function Be(tt,at,dt){for(var ct=C(tt,"particleCount",N),Ut=C(tt,"angle",Number),kt=C(tt,"spread",Number),tn=C(tt,"startVelocity",Number),jt=C(tt,"decay",Number),un=C(tt,"gravity",Number),cn=C(tt,"drift",Number),Pt=C(tt,"colors",R),Xe=C(tt,"ticks",Number),Vt=C(tt,"shapes"),Yt=C(tt,"scalar"),Ve=!!C(tt,"flat"),Ke=U(tt),ft=ct,en=[],Dt=ee.width*Ke.x,At=ee.height*Ke.y;ft--;)en.push(J({x:Dt,y:At,angle:Ut,spread:kt,startVelocity:tn,color:Pt[ft%Pt.length],shape:Vt[I(0,Vt.length)],ticks:Xe,decay:jt,gravity:un,drift:cn,scalar:Yt,flat:Ve}));return Qe?Qe.addFettis(en):(Qe=re(ee,en,je,at,dt),Qe.promise)}function it(tt){var at=ye||C(tt,"disableForReducedMotion",Boolean),dt=C(tt,"zIndex",Number);if(at&&Re)return u(function(tn){tn()});fe&&Qe?ee=Qe.canvas:fe&&!ee&&(ee=X(dt),document.body.appendChild(ee)),Ae&&!Ie&&je(ee);var ct={width:ee.width,height:ee.height};be&&!Ie&&be.init(ee),Ie=!0,be&&(ee.__confetti_initialized=!0);function Ut(){if(be){var tn={getBoundingClientRect:function(){if(!fe)return ee.getBoundingClientRect()}};je(tn),be.postMessage({resize:{width:tn.width,height:tn.height}});return}ct.width=ct.height=null}function kt(){Qe=null,Ae&&(ce=!1,t.removeEventListener("resize",Ut)),fe&&ee&&(document.body.contains(ee)&&document.body.removeChild(ee),ee=null,Ie=!1)}return Ae&&!ce&&(ce=!0,t.addEventListener("resize",Ut,!1)),be?be.fire(tt,ct,kt):Be(tt,ct,kt)}return it.reset=function(){be&&be.reset(),Qe&&Qe.reset()},it}var Y;function ie(){return Y||(Y=he(null,{useWorker:!0,resize:!0})),Y}function oe(ee,ae,fe,Ae,ce,ye,Ne){var be=new Path2D(ee),je=new Path2D;je.addPath(be,new DOMMatrix(ae));var Ie=new Path2D;return Ie.addPath(je,new DOMMatrix([Math.cos(Ne)*ce,Math.sin(Ne)*ce,-Math.sin(Ne)*ye,Math.cos(Ne)*ye,fe,Ae])),Ie}function G(ee){if(!o)throw new Error("path confetti are not supported in this browser");var ae,fe;typeof ee=="string"?ae=ee:(ae=ee.path,fe=ee.matrix);var Ae=new Path2D(ae),ce=document.createElement("canvas"),ye=ce.getContext("2d");if(!fe){for(var Ne=1e3,be=Ne,je=Ne,Ie=0,Re=0,Qe,Be,it=0;it<Ne;it+=2)for(var tt=0;tt<Ne;tt+=2)ye.isPointInPath(Ae,it,tt,"nonzero")&&(be=Math.min(be,it),je=Math.min(je,tt),Ie=Math.max(Ie,it),Re=Math.max(Re,tt));Qe=Ie-be,Be=Re-je;var at=10,dt=Math.min(at/Qe,at/Be);fe=[dt,0,0,dt,-Math.round(Qe/2+be)*dt,-Math.round(Be/2+je)*dt]}return{type:"path",path:ae,matrix:fe}}function V(ee){var ae,fe=1,Ae="#000000",ce='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof ee=="string"?ae=ee:(ae=ee.text,fe="scalar"in ee?ee.scalar:fe,ce="fontFamily"in ee?ee.fontFamily:ce,Ae="color"in ee?ee.color:Ae);var ye=10*fe,Ne=""+ye+"px "+ce,be=new OffscreenCanvas(ye,ye),je=be.getContext("2d");je.font=Ne;var Ie=je.measureText(ae),Re=Math.ceil(Ie.actualBoundingBoxRight+Ie.actualBoundingBoxLeft),Qe=Math.ceil(Ie.actualBoundingBoxAscent+Ie.actualBoundingBoxDescent),Be=2,it=Ie.actualBoundingBoxLeft+Be,tt=Ie.actualBoundingBoxAscent+Be;Re+=Be+Be,Qe+=Be+Be,be=new OffscreenCanvas(Re,Qe),je=be.getContext("2d"),je.font=Ne,je.fillStyle=Ae,je.fillText(ae,it,tt);var at=1/fe;return{type:"bitmap",bitmap:be.transferToImageBitmap(),matrix:[at,0,0,at,-Re*at/2,-Qe*at/2]}}n.exports=function(){return ie().apply(this,arguments)},n.exports.reset=function(){ie().reset()},n.exports.create=he,n.exports.shapeFromPath=G,n.exports.shapeFromText=V})(function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}(),Hue,!1);const Fbn=Hue.exports;Hue.exports.create;const Obn=200,Mbn={origin:{y:.7}};function sj(e,t){Fbn({...Mbn,...t,particleCount:Math.floor(Obn*e)})}function Rbn(){sj(.25,{spread:26,startVelocity:55}),sj(.2,{spread:60}),sj(.35,{spread:100,decay:.91,scalar:.8}),sj(.1,{spread:120,startVelocity:25,decay:.92,scalar:1.2}),sj(.1,{spread:120,startVelocity:45})}function Lbn({result:e,period:t,onBack:n}){const[r,s]=m.useState(!1),[a,o]=m.useState(!1),[l,c]=m.useState({}),u="#00FF91",d="#252525",f=`PnL (${t})`,x=ce=>{navigator.clipboard.writeText(ce),on.success("Successfully copied.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})},g=ce=>ce>=1e9?`${(ce/1e9).toFixed(0)}B`:ce>=1e6?`${(ce/1e6).toFixed(0)}M`:ce>=1e3?`${(ce/1e3).toFixed(0)}K`:ce.toFixed(0),{main:v,steps:w}=e,C=Object.values(e.steps).flat().map(ce=>({...ce,timestamp:new Date(ce.timestamp).getTime()})).sort((ce,ye)=>ce.timestamp-ye.timestamp),N={};C.forEach(ce=>{N[ce.timestamp]=(N[ce.timestamp]||0)+ce.pnl_this_step});let I=e.main.initial_equity;const P=Object.entries(N).sort((ce,ye)=>ce[0]-ye[0]).map(([ce,ye])=>(I+=ye,[Number(ce),+I.toFixed(2)])),R=P.map(([,ce])=>ce);let F=R[0],U=0;R.forEach(ce=>{ce>F&&(F=ce);const ye=(F-ce)/F;ye>U&&(U=ye)});const L=(U*100).toFixed(2),z=C.filter(ce=>ce.pnl_this_step>0).length,X=C.filter(ce=>ce.pnl_this_step<0).length,ne=`${(z/C.length*100).toFixed(2)}%`,J=P.slice(1).map(([,ce],ye)=>{const Ne=P[ye][1];return(ce-Ne)/Ne}),Z=ce=>ce.length?ce.reduce((ye,Ne)=>ye+Ne,0)/ce.length:0,re=ce=>{const ye=Z(ce),Ne=Z(ce.map(be=>(be-ye)**2));return Math.sqrt(Ne)},he=(re(J)?Z(J)/re(J):0).toFixed(2),Y=((v.my_total_equity/v.initial_equity-1)*100).toFixed(2),ie={},oe=ce=>{var ye;return{time:new Date(ce.timestamp).toLocaleTimeString(),pnl:ce.pnl_this_step,coin:ce.coin,activity:{direction:((ye=ce.trader_direction)==null?void 0:ye.toLowerCase())==="long"?"Long":"Short",leverage:ce.trader_leverage},size:ce.trader_szi,posValue:ce.our_target_value,entry:ce.our_pos_entry_price,close:ce.market_price}};C.forEach(ce=>{const ye=new Date(ce.timestamp).toLocaleDateString();ie[ye]=ie[ye]||{rows:[],totalPnl:0},ie[ye].rows.push(oe(ce)),ie[ye].totalPnl+=ce.pnl_this_step});const G=Object.entries(ie).sort((ce,ye)=>new Date(ce[0])-new Date(ye[0]));let V=v.initial_equity;const ee=G.map(([ce,{rows:ye,totalPnl:Ne}])=>(V+=Ne,{date:ce,rows:ye,totalPnl:Ne,equity:V}));m.useEffect(()=>{var ce;if(((ce=e==null?void 0:e.main)==null?void 0:ce.final_pnl)>0){Rbn(),o(!0);const ye=setTimeout(()=>o(!1),3e3);return()=>clearTimeout(ye)}},[e]);const ae={chart:{type:"area",toolbar:{show:!1},background:"transparent",animations:{enabled:!1}},stroke:{width:2,curve:"straight",colors:[u]},fill:{type:"gradient",gradient:{shade:"dark",shadeIntensity:1,opacityFrom:.45,opacityTo:0,stops:[0,100],colorStops:[{offset:0,color:u,opacity:.45},{offset:100,color:u,opacity:0}]}},grid:{show:!0,borderColor:d,strokeDashArray:6,xaxis:{lines:{show:!0}},yaxis:{lines:{show:!0}}},xaxis:{type:"datetime",labels:{style:{colors:"#9B9B9B",fontSize:"12px",fontFamily:"Manrope",fontWeight:500},datetimeUTC:!1,format:"dd/MM"}},yaxis:{labels:{style:{colors:"#9B9B9B",fontSize:"12px",fontFamily:"Manrope",fontWeight:500},formatter:ce=>g(ce)}},dataLabels:{enabled:!1},tooltip:{theme:"dark",x:{format:"dd/MM HH:mm"},y:{formatter:ce=>`$${ce.toFixed(2)}`},marker:{fillColors:[u]}},zoom:{enabled:!1},markers:{size:0,colors:[u]}},fe=[{key:"time",label:"Time",width:"0.7fr"},{key:"pnl",label:"PnL",width:"0.7fr",headerClassName:"flex justify-end",render:ce=>i.jsxs("span",{className:`flex justify-end ${ce<0?"text-[#FF797C]":"text-[#67FFBD]"}`,children:[ce<0?"- $":"$",Math.abs(ce).toFixed(2)]})},{key:"coin",label:"Symbol",sortable:!0,width:"0.7fr",render:(ce,ye)=>i.jsxs("div",{className:"flex items-center gap-2 text-[12px]",children:[i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${ye.coin}.svg`,onError:ea,className:"w-5 h-5"}),ye.coin]})},{key:"activity",label:"Direction",width:"1.3fr",render:(ce,ye)=>{const Ne=ye.activity.direction==="Long";return i.jsxs("div",{className:`inline-flex justify-center items-center gap-1 px-2 py-1 h-6 rounded-[6px] w-[115px] text-[11px] uppercase font-semibold ${Ne?"text-[#67ffbd] bg-[rgba(103,255,189,0.16)]":"text-[#ff787b] bg-[rgba(255,131,117,0.16)]"}`,children:[i.jsx(Es,{className:`w-3 h-3 ${Ne?"rotate-180 text-[#67ffbd]":"text-[#ff787b]"}`}),`${ye.activity.direction} - ${ye.activity.leverage}x`]})}},{key:"size",label:"Size",width:"0.8fr"},{key:"posValue",label:"Position Value",width:"1fr",render:ce=>`$${ce.toFixed(2)}`},{key:"entry",label:"Entry Price",width:"0.9fr",render:ce=>`$${ce.toLocaleString()}`},{key:"close",label:"Close Price",width:"0.9fr",render:ce=>`$${ce.toLocaleString()}`}],Ae=Object.values(l).some(Boolean);return i.jsxs(i.Fragment,{children:[a&&i.jsx("div",{className:"fixed inset-0 top-24 flex items-start justify-center z-50 pointer-events-none font-manrope",children:i.jsx("div",{className:"text-4xl font-bold text-white px-6 py-4 rounded-xl animate-pulse",children:"🎉 You are the winner! 🥳"})}),i.jsxs(rp,{isOpen:r,onClose:()=>s(!1),children:[i.jsx("h2",{className:"text-white text-lg mb-4",children:"Perp Equity Chart"}),i.jsx(HL,{options:{...ae,chart:{...ae.chart,sparkline:{enabled:!1}}},series:[{name:"Equity",data:P}],type:"area",height:320,width:"100%"})]}),i.jsxs("div",{className:["animate-slide-in text-white font-inter p-4 sm:p-6 mx-auto","rounded-[24px] border border-[#343434] backdrop-blur-[64px]","mt-0 sm:mt-20 transition-[max-width] duration-300",Ae?"max-w-96 sm:max-w-5xl":"max-w-96 sm:max-w-xl"].join(" "),children:[i.jsxs("div",{className:"flex items-center justify-between mb-[19px]",children:[i.jsx("div",{className:"flex items-center gap-1",children:i.jsx("span",{className:"text-[18px] font-semibold",children:"My Backtest Results"})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:"px-6 py-3 text-[#0B331C] text-[13px] font-semibold rounded-[10px] bg-[#1DE674] h-[32px] flex justify-center items-center",onClick:n,children:"New Backtest"}),i.jsx("button",{className:"px-6 py-3 text-[#67FFBD] text-[13px] font-semibold rounded-[10px] bg-[rgba(103,255,189,0.16)] h-[32px] flex items-center gap-2",onClick:()=>x(window.location.href),children:"Share"})]})]}),i.jsx("div",{className:"grid grid-cols-4 gap-4",children:[["Initial Perp Equity",v.initial_equity,"white"],["Final Perp Equity",v.my_total_equity,v.my_total_equity<v.initial_equity?"#FF797C":"#67FFBD"],[f,v.final_pnl,v.final_pnl<0?"#FF797C":"#67FFBD"],["Max Drawdown",`${L}%`,"#FF797C"],["Win Rate",ne,"white"],["Win / Loss",i.jsxs("div",{className:"flex gap-0 sm:gap-1",children:[i.jsxs("span",{className:"flex gap-1 items-center",children:[i.jsx("span",{className:"text-[#67FFBD]",children:"●"}),z]})," ",i.jsxs("span",{className:"flex gap-1 items-center",children:[i.jsx("span",{className:"text-[#FF797C]",children:"●"}),X]})]}),"white"],["Growth Rate",`${Y}%`,Y<0?"#FF797C":"#67FFBD"],["Sharpe",he,"white"]].map(([ce,ye,Ne])=>i.jsxs("div",{children:[i.jsx("div",{className:"text-[#8E8E8E] text-[14px] pb-1",children:ce}),i.jsx("div",{style:{color:Ne},className:"text-[14px] font-semibold whitespace-nowrap",children:typeof ye=="number"?`$${ye.toFixed(2)}`:ye})]},ce))}),i.jsxs("div",{className:"bg-[#1B1B1B] rounded-xl mt-4 mb-4",children:[i.jsxs("div",{className:"flex px-3 pt-3 justify-between items-center text-[#8E8E8E] text-[14px] mb-2",children:["Perp Equity Chart",i.jsx("img",{src:Pyt,alt:"expand",className:"cursor-pointer",onClick:()=>s(!0)})]}),i.jsx(HL,{options:ae,series:[{name:"Equity",data:P}],type:"area",height:150,width:"100%"})]}),i.jsx("div",{className:"bg-[#1B1B1B] rounded-xl divide-y divide-[#2A2A2A] max-h-[320px] overflow-y-auto overflow-x-hidden",children:ee.map(({date:ce,rows:ye,totalPnl:Ne,equity:be})=>{const je=Ne>=0,Ie=l[ce];return i.jsxs("div",{children:[i.jsxs("button",{className:"w-full grid grid-cols-3 items-center px-4 py-[10px] text-[13px] font-semibold bg-transparent",onClick:()=>c(Re=>({...Re,[ce]:!Ie})),children:[i.jsx("span",{className:"text-left text-white",children:ce}),i.jsxs("span",{className:"text-center text-white",children:["$",be.toFixed(2)]}),i.jsxs("span",{className:`text-right ${je?"text-[#67FFBD]":"text-[#FF797C]"}`,children:[je?"+":"-","$",Math.abs(Ne).toFixed(2)]})]}),Ie&&i.jsx("div",{className:"overflow-x-auto",children:i.jsx(Pu,{columns:fe,data:ye,listHeight:Math.min(ye.length*36,180),rowClassName:"border-t border-[#2A2A2A] text-white !text-[13px] font-inter",tableClassName:"min-w-[900px] bg-[#1B1B1B] rounded-xl overflow-hidden",theadClassName:"bg-[#1B1B1B] !text-[#9B9B9B] font-manrope !text-[13px] font-semibold",tbodyClassName:"divide-y divide-[#2A2A2A]",cellClassName:"px-4 py-[10px]",rowHeight:36})})]},ce)})})]})]})}const Dbn=e=>{const t=new URLSearchParams;return t.set("wallet",e.wallet),e.pairs.length&&t.set("pairs",e.pairs.join(",")),t.set("equity",e.equity),t.set("scale",e.scale),t.set("period",e.period),t.set("method",e.method),t.toString()},Bbn=()=>{const e=new URLSearchParams(window.location.search);return{wallet:e.get("wallet")||"",pairs:e.get("pairs")?e.get("pairs").split(","):[],equity:e.get("equity")||"",scale:e.get("scale")||"",period:e.get("period")||"30D",method:e.get("method")||"3"}};function $bn(){const[e,t]=m.useState("starter"),[n,r]=m.useState(null),[s,a]=m.useState("30D"),o=m.useCallback(async l=>{t("loading");const c={"7D":7,"30D":30,"90D":90},u=l.pairs.length?{coin:{$in:l.pairs}}:{},d={period:c[l.period]||1,filters:{user_wallet:l.wallet,...u},method:Number(l.method),initial_equity:Number(l.equity),scaling_factor:Number(l.scale),steps:!0};try{const x=await(await fetch("https://dextradata.nftinit.io/api/hyper/backtest/fills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)})).json();if(x.error_message){on.error(x.error_message),t("starter");return}window.history.replaceState(null,"","?"+Dbn(l)),a(l.period),r(x),t("result")}catch(f){console.error(f),t("starter"),on.error("Backtest failed. Please try again.")}},[]);return m.useEffect(()=>{const l=Bbn();l.wallet&&o(l)},[o]),i.jsxs("div",{className:"flex items-start sm:items-center justify-center w-screen h-screen mt-4 sm:mt-0 mb-32 sm:mb-0",children:[e==="starter"&&i.jsx(Ibn,{onRun:o}),e==="loading"&&i.jsx(Pbn,{}),e==="result"&&i.jsx(Lbn,{result:n,period:s,onBack:()=>{window.history.replaceState(null,"",window.location.pathname),t("starter")}})]})}const Ubn=({tg:e})=>{const{address:t}=Yr(),[n,r]=m.useState(!1);return m.useEffect(()=>{if(!e||isNaN(Number(e)))return;(async()=>{try{const a=window.localStorage.getItem("hyperToken"),o=window.localStorage.getItem("hyperAddress"),l=await fetch("https://dextrabothypev2.nftinit.io/api/telegram/sign_api_wallet_telegram/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:t?t.toLowerCase():o,token:a,telegram_id:e})});if(!l.ok)throw new Error(`Request failed with status ${l.status}`);const c=await l.json();c!=null&&c.success&&r(!0)}catch(a){console.error("Error sending data:",a)}})()},[e]),i.jsxs(i.Fragment,{children:[i.jsx(FA,{open:n,setOpen:r,handleListRequest:()=>{},handlePageChange:()=>{}}),i.jsx("div",{className:"flex flex-col items-center justify-center px-6 sm:px-16 pb-10 gap-6 w-max h-max bg-[#212121]/90 rounded-2xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#2a2a2a] relative pt-10",children:i.jsxs("div",{className:"flex flex-col items-center text-white text-base font-medium font-['Inter'] text-center gap-4",children:[i.jsx("img",{src:Hi,alt:"",className:"w-8 h-8"}),i.jsx("div",{className:"text-center text-white text-base font-medium font-['Inter'] leading-4 tracking-[-0.28px]",children:"Dextrabot Wallet Setup"}),i.jsx("div",{className:"max-w-[240px] text-center text-white text-[13px] font-normal font-['Inter'] leading-4",children:"Add an account to start your copy trading journey on Telegram. Choose between creating an API Wallet or a Generate Wallet."}),i.jsxs("div",{className:"flex flex-col items-center gap-6 mt-[33px]",children:[i.jsxs("div",{onClick:()=>{r(!0)},className:"w-full h-10 px-6 py-3 bg-[#7445ff] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#8860ff] flex justify-center items-center gap-1  cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsxs("svg",{width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M5 9H14",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.5 13.5V4.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px] min-w-max -mb-[1px]",children:"Add Account"})]}),i.jsxs("div",{onClick:()=>window.open("https://t.me/Dextrabot_CopyTrade_bot","_blank"),className:"w-full h-10 px-6 py-3 bg-white hover:bg-[#E5E5E5] rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] inline-flex justify-center items-center gap-2.5 cursor-pointer",children:[i.jsx("img",{src:ake,alt:""}),i.jsx("div",{className:"justify-start text-black text-sm font-semibold font-['Inter'] leading-none min-w-max",children:"Open Telegram App"})]})]})]})})]})},zbn=()=>{const[e]=VNe(),t=e==null?void 0:e.get("tg"),{isConnected:n,address:r}=Yr(),{hyperToken:s,hyperAddress:a,setSignModalOpen:o,setTelegramChatId:l,setSubscriberRole:c,setSubsExpireDay:u,setMushboomerETH:d,setMushboomerSOL:f,setIsReferralCode:x,setIsReferralCodeName:g,setIsWhitelist:v,setHyperToken:w,setHyperAddress:C}=m.useContext(Gr),[N,I]=m.useState(!!window.localStorage.getItem("hyperToken"));return m.useEffect(()=>{const P=window.localStorage.getItem("hyperToken");I(!!P)},[r,n,s,a]),m.useEffect(()=>{(async()=>{var U,L;const R=window.localStorage.getItem("hyperToken"),F=window.localStorage.getItem("hyperAddress");if(!(!R||!F))try{const z=await Si(F.toLowerCase(),R);z!=null&&z.success?(l(z==null?void 0:z.telegram_chat_id),c(z==null?void 0:z.subscriber_role),u(z==null?void 0:z.subs_expire_day),d((U=z==null?void 0:z.mushboomer_counts)==null?void 0:U.eth),f((L=z==null?void 0:z.mushboomer_counts)==null?void 0:L.sol),x(z==null?void 0:z.referral_code),g(z==null?void 0:z.refcode),v(z==null?void 0:z.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),w(""),C(""))}catch(z){console.error("Token verification error:",z),console.error(z.message||"An unknown error occurred.")}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(Io,{children:i.jsxs($o,{children:[i.jsx("title",{children:"Dextrabot Telegram Wallet Setup – Create API or Generated Wallet"}),i.jsx("meta",{name:"description",content:"Easily set up your Telegram copy trading wallet on Dextrabot. Create an API Wallet with your own account or generate a new wallet instantly, then connect to Telegram to start trading."}),i.jsx("meta",{name:"og:title",content:"Dextrabot Telegram Wallet Setup – Create API or Generated Wallet"}),i.jsx("meta",{name:"og:description",content:"Easily set up your Telegram copy trading wallet on Dextrabot. Create an API Wallet with your own account or generate a new wallet instantly, then connect to Telegram to start trading."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/telegram-api-wallet"})]})}),i.jsx("div",{style:{background:"linear-gradient(135deg, #0d0d0d 0%, #1c1c1c 50%, #0d0d0d 100%)"},className:"flex justify-center items-center w-full h-[calc(100vh-6rem)] sm:h-[calc(100vh-5rem)] min-h-max max-h-[calc(100vh-6rem)] sm:max-h-[calc(100vh-5rem)] px-4 pt-16 sm:pt-4 pb-10 bg-[#161616]",children:N?i.jsx(Ubn,{tg:t}):i.jsx("div",{className:"flex justify-center items-center w-full",children:i.jsx(dU,{})})})]})},dNe="/assets/share1-C-zw_JWP.jpg",Hbn="/assets/share2-DdEku457.jpg",Vbn="/assets/share3-CNxpeTYT.jpg",Wbn="/assets/share4-DJuI_ZiE.jpg",qbn="/assets/share5-T6uiFcTh.jpg",Gbn="/assets/share6-DjS5fdAF.jpg",Kbn="/assets/share7-BaMtg3x6.jpg",Ybn="/assets/share8-xyCgNFII.jpg",Xbn="/assets/share9-BLclkV1L.jpg",Qbn="/assets/share10-C9sVwYdl.jpg",Zbn="/assets/share11-_FKzaoRV.jpg",Jbn="/assets/share12-DHiXk6_m.jpg",eyn="/assets/share13-0mVBxTxA.jpg",tyn="/assets/share14-B6N7agx8.jpg",nyn="/assets/share15-D46qu5xc.jpg",ryn="/assets/share16-B06pZYlo.jpg",syn="/assets/share17-C9ObNWuI.jpg",iyn="/assets/share18-DafUfIIP.jpg",ayn="/assets/share19-DdeHQJDd.jpg",oyn="/assets/share20-Cx0LCWyZ.jpg",lyn="/assets/lighter-banner-B9jyiBZ3.png",cyn="#67FFBD",uyn="https://dextrabothypev2.nftinit.io/api/hyper/fee_calculator_save/";function dyn({initialWalletAddress:e}){const t=nl(),[n,r]=m.useState(e||""),[s,a]=m.useState(!1),[o,l]=m.useState(null),[c,u]=m.useState(null),[d,f]=m.useState(e||""),[x,g]=m.useState(!1),[v,w]=m.useState(0),[C,N]=m.useState(!1),[I,P]=m.useState(dNe),[R,F]=m.useState(""),[U,L]=m.useState(""),z=m.useRef(!1),X=m.useRef(null),ne=m.useRef(null),J=m.useRef(0),Z=[dNe,Hbn,Vbn,Wbn,qbn,Gbn,Kbn,Ybn,Xbn,Qbn,Zbn,Jbn,eyn,tyn,nyn,ryn,syn,iyn,ayn,oyn];m.useEffect(()=>{const Re=document.querySelector("main");Re&&(Re.style.background="#0b0b0b"),F(`${window.location.origin}${window.location.pathname}`);const Qe=decodeURIComponent((window.location.hash||"").replace(/^#/,"")),Be=window.location.pathname.split("/").filter(Boolean),it=Be[Be.length-1]||"",at=it&&it.toLowerCase()!=="hyperliquid-fee-calculator"?decodeURIComponent(it):"",dt=Qe||at;if(dt){f(dt),r(dt);const ct=`${window.location.pathname}#${encodeURIComponent(dt)}`;window.history.replaceState(null,"",ct),L(`${window.location.origin}${ct}`),oe(dt)}return()=>{Re&&(Re.style.background="")}},[]),m.useEffect(()=>{e&&e.trim()&&oe(e)},[e]);const re=Re=>{const Qe=Number(Re||0);return Math.abs(Qe)>=1e6?`$${(Qe/1e6).toFixed(2)}M`:Math.abs(Qe)>=1e3?`$${(Qe/1e3).toFixed(2)}K`:`$${Qe.toFixed(2)}`},he=Re=>`$${Number(Re||0).toFixed(2)}`,Y=()=>new Date().toLocaleDateString("en-US",{month:"short",day:"numeric"}),ie=async Re=>{if(z.current)return;z.current=!0;const Qe=window.localStorage.getItem("hyperAddress")||"",Be={wallet_address:n||null,calculator_logs:{total_fee_spent:he(((Re==null?void 0:Re.totalFee)||0)+((Re==null?void 0:Re.totalBuilderFee)||0)),trading_fees:he((Re==null?void 0:Re.totalFee)||0),builder_fees:he((Re==null?void 0:Re.totalBuilderFee)||0),total_fills:Number((Re==null?void 0:Re.totalFills)||0),created_at:Y()}};Qe&&(Be.address=Qe);try{await fetch(uyn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Be)})}catch{}},oe=async Re=>{if(!Re){on.error("Please enter a wallet address");return}z.current=!1,a(!0),l(null),u(null),g(!1),w(0),N(!1),t(`/hyperliquid-fee-calculator/${Re}`,{replace:!0}),L(`${window.location.origin}/hyperliquid-fee-calculator/${Re}`);try{await ain(Re,Qe=>{Qe.totalFills>=2e3&&g(!0),u({...Qe,isPartial:!Qe.isComplete}),w(Math.min(Qe.requestCount/12*100,100)),Qe.isComplete&&(g(!1),w(100),a(!1),N(!0),ie(Qe),t(`/hyperliquid-fee-calculator/${Re}`,{replace:!0}))})}catch(Qe){l(Qe.message||"Failed to calculate fees"),on.error("Failed to calculate fees"),g(!1),a(!1)}},G=Re=>{f(Re),Re.trim()&&r(Re.trim())},V=(()=>{const Re=((c==null?void 0:c.totalFee)||0)+((c==null?void 0:c.totalBuilderFee)||0);return`I paid ${re(Re)} in total fees on Hyperliquid.
Generate your own fee report and see potential savings with 0% builder fees.`})(),ee=async()=>{if(X.current)try{await document.fonts.ready;const Re=await j1(X.current,{cacheBust:!0,backgroundColor:"#0b0b0b",useCORS:!0,pixelRatio:2}),Qe=document.createElement("a");Qe.href=Re,Qe.download="dextrabot-fee-card.png",document.body.appendChild(Qe),Qe.click(),document.body.removeChild(Qe)}catch{on.error("Failed to download PNG.")}},ae=U||R||"https://app.dextrabot.com/hyperliquid-fee-calculator",fe=`https://x.com/intent/post?text=${encodeURIComponent(V)}&url=${encodeURIComponent(ae)}`,[Ae,ce]=m.useState({rx:0,ry:0,gx:50,gy:50}),ye=12,Ne=Re=>{ne.current&&(cancelAnimationFrame(J.current),J.current=requestAnimationFrame(()=>{const Qe=ne.current.getBoundingClientRect(),Be=(Re.clientX-Qe.left)/Qe.width,it=(Re.clientY-Qe.top)/Qe.height,tt=(Be-.5)*(ye*2),at=(.5-it)*(ye*2);ce({rx:Math.max(-12,Math.min(ye,at)),ry:Math.max(-12,Math.min(ye,tt)),gx:Be*100,gy:it*100})}))},be=()=>{cancelAnimationFrame(J.current),ce({rx:0,ry:0,gx:50,gy:50})},je=s,Ie=!n.trim();return i.jsxs(Io,{children:[i.jsxs($o,{children:[i.jsx("title",{children:"Hyperliquid Fee Spent Report — Dextrabot"}),i.jsx("meta",{name:"description",content:"Hyperliquid Fee Spent Report"})]}),i.jsxs("div",{className:"relative text-white overflow-hidden overscroll-none",style:{fontFamily:"Manrope, ui-sans-serif"},children:[i.jsx("div",{className:"pointer-events-none fixed inset-x-0 top-16 bottom-0 opacity-40 ",style:{background:"radial-gradient(800px 800px at 10% 0%, rgba(103,255,189,0.12) 0%, transparent 60%), radial-gradient(900px 900px at 90% 100%, rgba(103,255,189,0.08) 0%, transparent 55%)"}}),i.jsx("div",{className:"pointer-events-none fixed inset-x-0 top-16 bottom-0 opacity-[0.06] ",style:{background:"repeating-linear-gradient(0deg, #fff 0, #fff 1px, transparent 1px, transparent 3px)"}}),i.jsxs("div",{className:" mx-auto pt-4 pb-4 gap-4 flex justify-center ",children:[!C&&i.jsxs(go.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"relative overflow-hidden rounded-2xl border border-[#17211b] bg-[#0a0c0c]",children:[i.jsx("div",{className:"absolute inset-0 opacity-60",style:{background:"radial-gradient(1000px 300px at 0% 0%, rgba(103,255,189,0.22) 0%, transparent 60%)"}}),i.jsx("div",{className:"absolute -inset-[1px] rounded-2xl",style:{background:"linear-gradient(120deg, rgba(103,255,189,0.35), transparent 25% 75%, rgba(103,255,189,0.2))",filter:"blur(10px)",opacity:.35}}),i.jsxs("div",{className:"relative grid grid-cols-1 lg:grid-cols-2 gap-10 p-8",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"inline-flex items-center gap-3 bg-[#0b1511] border border-[#1e2e27] rounded-xl px-3 py-2 shadow-[0_0_24px_rgba(103,255,189,0.12)]",children:[i.jsx("img",{src:i5,alt:"Dextrabot",className:"w-7 h-7 rounded-md"}),i.jsx("span",{className:"text-[#d7ffe9] font-semibold tracking-wide",children:"Hyperliquid Fee Spent Report"})]}),i.jsxs("h2",{className:"mt-4 text-[28px] leading-tight font-extrabold tracking-tight",children:["Calculate Your Hyperliquid Trading Fees",i.jsx("br",{}),i.jsx("span",{style:{color:cyn},children:"Fee Report Generator"})]}),i.jsx("p",{className:"mt-3 text-[#a6b6b0] max-w-xl",children:"Discover how much you've paid in Hyperliquid trading fees. Free calculator generates your complete fee report."}),i.jsxs("div",{className:"mt-6",children:[i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:i.jsx(Uan,{className:"h-5 w-5 text-[#88a296]"})}),i.jsx("input",{type:"text",value:d,onChange:Re=>G(Re.target.value),placeholder:"Paste wallet address…",className:"w-full pl-10 pr-12 py-3 rounded-xl bg-[#060808] border border-[#1c2a24] text-white placeholder-[#6e857d] focus:outline-none focus:border-[#67FFBD] focus:ring-1 focus:ring-[#67FFBD]"}),d?i.jsx("button",{onClick:()=>{f(""),r(""),window.history.replaceState(null,"",window.location.pathname),L("")},className:"absolute inset-y-0 right-2 flex justify-center items-center h-10 top-[5px]",children:i.jsx(XUe,{className:"h-6 w-6 text-[#8ea79e] hover:text-white transition-colors"})}):null]}),i.jsxs(go.button,{whileTap:{scale:.98},onClick:()=>oe(n),disabled:je||Ie,className:`mt-3 relative overflow-hidden rounded-xl font-semibold py-3 px-5 transition-colors shadow-[0_0_24px_rgba(103,255,189,0.24)] ${je?"bg-[rgba(103,255,189,0.95)] text-[#0b0b0b]":Ie?"bg-[#16211b] text-[#7ea391] cursor-not-allowed border border-[#1e2e27]":"bg[rgba(103,255,189,0.95)]"}`,style:!je&&!Ie?{backgroundColor:"rgba(103,255,189,0.95)",color:"#0b0b0b"}:void 0,children:[i.jsx(mT,{initial:!1,children:je&&i.jsx(go.span,{initial:{width:0,opacity:0},animate:{width:`${v}%`,opacity:1},exit:{width:0,opacity:0},transition:{ease:"easeOut",duration:.3},className:"absolute top-0 left-0 h-full bg-[#2bb584]"})}),i.jsx("span",{className:"relative z-10",children:je?"Calculating…":"Generate Report"})]})]})]}),i.jsx("div",{className:"relative",children:i.jsxs("div",{className:"rounded-2xl border border-[#1e2e27] bg-[#050707] overflow-hidden shadow-[0_0_60px_rgba(103,255,189,0.15)]",children:[i.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.06] rounded-2xl overflow-hidden",style:{background:"repeating-linear-gradient(180deg, #fff 0, #fff 1px, transparent 1px, transparent 3px)"}}),i.jsx("video",{src:YN,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",className:"w-full h-[320px] lg:h-[380px] object-cover"},YN)]})})]})]}),C&&c&&i.jsx(go.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},children:i.jsxs("div",{className:"flex flex-col lg:flex-row items-start gap-4",children:[i.jsx("div",{className:"shrink-0",children:i.jsxs("button",{onClick:()=>{N(!1),t("/hyperliquid-fee-calculator",{replace:!0})},className:"inline-flex items-center gap-2 rounded-lg px-3 py-2 border border-[#23372e] bg-[#0c1210] hover:bg-[#0f1714] text-[#d7ffe9]",children:[i.jsx(Ran,{className:"w-5 h-5"}),"Back"]})}),i.jsxs("div",{className:"shrink-0",children:[i.jsx(fyn,{refCard:X,refWrap:ne,tilt:Ae,onMove:Ne,onLeave:be,feeData:c,selectedImage:I}),i.jsxs("div",{className:"rounded-2xl border border-[#1e2e27] bg-[#0a0c0c] overflow-hidden shadow-[0_0_30px_rgba(103,255,189,0.12)] p-4 mt-3",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-8 h-8 rounded-full grid place-items-center bg-[#67FFBD22] text-[#67FFBD]",children:i.jsx(_6t,{})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"text-[15px] font-semibold",children:"Share"}),i.jsx("div",{className:"text-xs text-[#a6b6b0]",children:"Share your card on X and show off your stats!"})]}),i.jsx(XY,{className:"w-5 h-5 text-[#7a8c86]"})]}),i.jsx("div",{className:"mt-3 grid grid-cols-1 gap-2",children:i.jsx("a",{href:fe,target:"_blank",className:"h-10 grid place-items-center rounded-lg bg-white text-[#111] hover:bg-[#eaeaea] transition-colors text-sm font-medium",children:"Share on X"})})]})]}),i.jsxs("div",{className:"w-full lg:w[420px] space-y-3",style:{width:"100%",maxWidth:"420px"},children:[i.jsx("a",{href:"https://t.me/Dextrabot_CopyTrade_bot",target:"_blank",className:"block rounded-2xl border border-[#1e2e27] bg-[#0a0c0c] hover:border-[#67FFBD66] hover:bg-[#0d120f] transition-colors",children:i.jsxs("div",{className:"flex items-center gap-3 p-4",children:[i.jsx("div",{className:"w-9 h-9 rounded-full grid place-items-center bg-[#67FFBD22]  font-bold text-[#67FFBD]",children:i.jsx(C6t,{})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"text-[15px] font-semibold text-[#67FFBD]",children:"Zero Builder Fee on HL"}),i.jsx("div",{className:"text-xs text-[#a6b6b0]",children:"Trade with Zero Builder Fees on HL via Telegram."})]}),i.jsx(XY,{className:"w-5 h-5 text-[#7a8c86]"})]})}),i.jsx("div",{className:"rounded-2xl border border-[#1e2e27] bg-[#0a0c0c] overflow-hidden shadow-[0_0_30px_rgba(103,255,189,0.12)]",children:i.jsxs("div",{className:"p-4 pb-[18px]",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-8 h-8 rounded-full grid place-items-center bg-[#67FFBD22] text-[#67FFBD]",children:i.jsx(A6t,{})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"text-[15px] font-semibold",children:"Choose an Image"}),i.jsx("div",{className:"text-xs text-[#a6b6b0]",children:"Pick a meme background and download your card."})]}),i.jsx(XY,{className:"w-5 h-5 text-[#7a8c86]"})]}),i.jsxs("div",{className:"mt-8",children:[i.jsx("div",{className:"grid grid-cols-4 gap-2 pb-4",children:Z.map((Re,Qe)=>i.jsx(go.button,{whileHover:{y:-2},whileTap:{scale:.98},onClick:()=>P(Re),className:`rounded-md overflow-hidden border ${I===Re?"border-[#67FFBD]":"border-[#2b2b2b]"}`,children:i.jsx("img",{src:Re,alt:`bg-${Qe}`,className:"w-full h-16 object-cover"})},Qe))}),i.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[i.jsx("button",{onClick:ee,className:"h-8 flex justify-center items-center rounded-lg border border-[#1e2e27] bg-[#0e1211] hover:border-[#67FFBD66] hover:bg-[#111716] transition-colors text-sm font-medium",children:"Download Image"}),i.jsx("button",{onClick:()=>window.open(`/wallet-details/${n}`,"_blank","noopener,noreferrer"),className:"h-8 flex justify-center items-center rounded-lg border border-[#1e2e27] bg-[#0e1211] hover:border-[#67FFBD66] hover:bg-[#111716] transition-colors text-sm font-medium",children:"Go to Wallet Details"})]})]})]})})]})]})}),C&&i.jsx("div",{className:"rounded-2xl border border-[#1e2e27] bg-[#0a0c0c] overflow-hidden shadow-[0_0_30px_rgba(103,255,189,0.12)]",children:i.jsx("img",{src:lyn,alt:"Lighter — Zero Fee",className:"h-full w-full cursor-pointer",loading:"eager",decoding:"async",draggable:!1,onClick:()=>{window.location.hash="lighter-farming"}})})]})]})]})}function fyn({refCard:e,refWrap:t,tilt:n,onMove:r,onLeave:s,feeData:a,selectedImage:o}){const l=((a==null?void 0:a.totalFee)||0)+((a==null?void 0:a.totalBuilderFee)||0),c=f=>{const x=Number(f||0);return Math.abs(x)>=1e6?`$${(x/1e6).toFixed(2)}M`:Math.abs(x)>=1e3?`$${(x/1e3).toFixed(2)}K`:`$${x.toFixed(2)}`},d=m.useRef(new Date).current.toLocaleDateString("en-US",{month:"short",day:"numeric"});return a!=null&&a.isPartial,i.jsx("div",{ref:t,onMouseMove:r,onMouseLeave:s,className:"relative",style:{perspective:"1200px"},children:i.jsxs("div",{ref:e,className:"relative will-change-transform rounded-2xl overflow-hidden bg-[#0a0d0c] shadow-[0_30px_80px_rgba(0,0,0,0.45),0_0_60px_rgba(103,255,189,0.16)] border border-[#1c2d26]",style:{width:"clamp(280px, 450px, 520px)",aspectRatio:"3/4",transform:`rotateX(${n.rx}deg) rotateY(${n.ry}deg)`,transition:"transform 180ms ease-out"},children:[i.jsx("div",{className:"absolute -inset-[1px] rounded-[30px] pointer-events-none",style:{background:"linear-gradient(130deg, rgba(103,255,189,0.35), transparent 25% 75%, rgba(103,255,189,0.2))",filter:"blur(10px)",opacity:.35}}),i.jsxs("div",{className:"h-14 px-5 flex items-center justify-between bg-[#1b2622] border-b border-[#253730]",children:[i.jsx("div",{className:"text-sm tracking-wide text-[#cfeee0] font-semibold",children:"Hyperliquid Fee Spent Report"}),i.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-white/10 bg-black/60 backdrop-blur px-3 py-1.5",children:[i.jsx("img",{src:Hi,alt:"",className:"w-5 h-5"}),i.jsx("span",{className:"text-[12px] tracking-wide font-semibold",children:"DEXTRABOT"})]})]}),i.jsx("div",{className:"px-5 pt-4",children:i.jsxs("div",{className:"relative h-64 rounded-xl overflow-hidden border border-[#2a3c35]",children:[i.jsx("img",{src:o,alt:"","aria-hidden":"true",className:"absolute inset-0 w-full h-full object-cover blur-md scale-110"}),i.jsx("div",{className:"absolute inset-0 bg-black/25"}),i.jsx("img",{src:o,alt:"Dextrabot - Hyperliquid Fee Calculator",className:"relative z-10 w-full h-full object-contain select-none",loading:"eager",decoding:"async",draggable:!1,style:{imageRendering:"-webkit-optimize-contrast"}})]})}),i.jsx("div",{className:"px-5 pb-5 pt-4",children:i.jsxs("div",{className:"relative rounded-2xl border border-[#21342c] bg-gradient-to-b from-[#0d1211] to-[#0a0e0d] p-6",children:[i.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-2xl",style:{boxShadow:"inset 0 0 0 1px rgba(103,255,189,0.08)"}}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-[22px] leading-6 font-extrabold text-white/95",children:"TOTAL FEE SPENT"}),i.jsx("div",{className:"mt-2 font-extrabold leading-none",style:{color:"#67FFBD",fontSize:"clamp(32px, 4.4vw, 48px)"},children:c(l)})]}),i.jsxs("div",{className:"mt-5 grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-xs tracking-wide text-white/70",children:"TRADING FEES"}),i.jsx("div",{className:"text-[20px] font-bold text-white",children:c((a==null?void 0:a.totalFee)||0)})]}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-xs tracking-wide text-white/70",children:"BUILDER FEES"}),i.jsx("div",{className:"text-[20px] font-bold text-white",children:c((a==null?void 0:a.totalBuilderFee)||0)})]})]}),i.jsxs("div",{className:"mt-5 flex items-center justify-center gap-6 text-[11px] text-white/70 px-2",children:[i.jsxs("div",{className:"whitespace-nowrap",style:{fontStyle:"italic"},children:["Shows Last ",((a==null?void 0:a.totalFills)||0).toLocaleString()," Fills"]}),i.jsxs("div",{className:"flex items-center gap-1 text-white/60 whitespace-nowrap",children:[i.jsx("img",{src:Hi,alt:"",className:"w-3 h-3"}),"Generated by Dextrabot"]}),i.jsxs("div",{className:"whitespace-nowrap",children:["Created on ",d]})]})]})}),i.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-[28px] opacity-60 mix-blend-screen",style:{background:`radial-gradient(220px 220px at ${n.gx}% ${n.gy}%, rgba(103,255,189,0.25), transparent 60%)`}})]})})}const fNe=()=>{const{walletAddress:e}=Z3(),{setTelegramChatId:t,setSubscriberRole:n,setSubsExpireDay:r,setMushboomerETH:s,setIsWhitelist:a,setMushboomerSOL:o,setIsReferralCode:l,setIsReferralCodeName:c,setHyperToken:u,setHyperAddress:d}=m.useContext(Gr);return m.useEffect(()=>{(async()=>{var v,w;const x=window.localStorage.getItem("hyperToken"),g=window.localStorage.getItem("hyperAddress");if(!(!x||!g))try{const C=await Si(g.toLowerCase(),x);C!=null&&C.success?(t(C==null?void 0:C.telegram_chat_id),n(C==null?void 0:C.subscriber_role),r(C==null?void 0:C.subs_expire_day),s((v=C==null?void 0:C.mushboomer_counts)==null?void 0:v.eth),o((w=C==null?void 0:C.mushboomer_counts)==null?void 0:w.sol),l(C==null?void 0:C.referral_code),c(C==null?void 0:C.refcode),a(C==null?void 0:C.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),u(""),d(""))}catch(C){console.error("Token verification error:",C)}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(Io,{children:i.jsxs($o,{children:[i.jsx("title",{children:"Copy Trade on Hyperliquid | Mirror Top Traders with Dextrabot"}),i.jsx("meta",{name:"description",content:"Automatically copy trade top-performing Hyperliquid traders with customizable risk parameters. Set position sizing, stop-loss levels, and take-profit targets with Dextrabot's copy trade system."}),i.jsx("meta",{property:"og:title",content:"Copy Trade on Hyperliquid | Mirror Top Traders with Dextrabot"}),i.jsx("meta",{property:"og:description",content:"Automatically copy trade top-performing Hyperliquid traders with customizable risk parameters. Set position sizing, stop-loss levels, and take-profit targets with Dextrabot's copy trade system."}),i.jsx("meta",{property:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{property:"og:url",content:"https://app.dextrabot.com/hyperliquid-fee-calculator "})]})}),i.jsx("div",{style:{minHeight:"calc(100vh - 5rem)"},className:"flex justify-center items-start w-full h-full px-4 pt-6 pb-6 sm:px-6 sm:pt-6 sm:pb-6 bg-[#161616] overflow-auto",children:i.jsx("div",{className:"flex flex-col items-stretch justify-start gap-[26px] w-full flex-grow xl:flex-grow-0",children:i.jsx(dyn,{initialWalletAddress:e})})})]})};function hyn(e){return Cl({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M1.72 5.47a.75.75 0 0 1 1.06 0L9 11.69l3.756-3.756a.75.75 0 0 1 .985-.066 12.698 12.698 0 0 1 4.575 6.832l.308 1.149 2.277-3.943a.75.75 0 1 1 1.299.75l-3.182 5.51a.75.75 0 0 1-1.025.275l-5.511-3.181a.75.75 0 0 1 .75-1.3l3.943 2.277-.308-1.149a11.194 11.194 0 0 0-3.528-5.617l-3.809 3.81a.75.75 0 0 1-1.06 0L1.72 6.53a.75.75 0 0 1 0-1.061Z",clipRule:"evenodd"},child:[]}]})(e)}function hNe(e){return Cl({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M15.22 6.268a.75.75 0 0 1 .968-.431l5.942 2.28a.75.75 0 0 1 .431.97l-2.28 5.94a.75.75 0 1 1-1.4-.537l1.63-4.251-1.086.484a11.2 11.2 0 0 0-5.45 5.173.75.75 0 0 1-1.199.19L9 12.312l-6.22 6.22a.75.75 0 0 1-1.06-1.061l6.75-6.75a.75.75 0 0 1 1.06 0l3.606 3.606a12.695 12.695 0 0 1 5.68-4.974l1.086-.483-4.251-1.632a.75.75 0 0 1-.432-.97Z",clipRule:"evenodd"},child:[]}]})(e)}function pNe(e){return Cl({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M15.97 2.47a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 1 1-1.06-1.06l3.22-3.22H7.5a.75.75 0 0 1 0-1.5h11.69l-3.22-3.22a.75.75 0 0 1 0-1.06Zm-7.94 9a.75.75 0 0 1 0 1.06l-3.22 3.22H16.5a.75.75 0 0 1 0 1.5H4.81l3.22 3.22a.75.75 0 1 1-1.06 1.06l-4.5-4.5a.75.75 0 0 1 0-1.06l4.5-4.5a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"},child:[]}]})(e)}function mNe(e){return Cl({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 0 1 .67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 1 1-.671-1.34l.041-.022ZM12 9a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z",clipRule:"evenodd"},child:[]}]})(e)}function pyn(e){return Cl({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M12 .75a8.25 8.25 0 0 0-4.135 15.39c.686.398 1.115 1.008 1.134 1.623a.75.75 0 0 0 .577.706c.352.083.71.148 1.074.195.323.041.6-.218.6-.544v-4.661a6.714 6.714 0 0 1-.937-.171.75.75 0 1 1 .374-1.453 5.261 5.261 0 0 0 2.626 0 .75.75 0 1 1 .374 1.452 6.712 6.712 0 0 1-.937.172v4.66c0 .327.277.586.6.545.364-.047.722-.112 1.074-.195a.75.75 0 0 0 .577-.706c.02-.615.448-1.225 1.134-1.623A8.25 8.25 0 0 0 12 .75Z"},child:[]},{tag:"path",attr:{fillRule:"evenodd",d:"M9.013 19.9a.75.75 0 0 1 .877-.597 11.319 11.319 0 0 0 4.22 0 .75.75 0 1 1 .28 1.473 12.819 12.819 0 0 1-4.78 0 .75.75 0 0 1-.597-.876ZM9.754 22.344a.75.75 0 0 1 .824-.668 13.682 13.682 0 0 0 2.844 0 .75.75 0 1 1 .156 1.492 15.156 15.156 0 0 1-3.156 0 .75.75 0 0 1-.668-.824Z",clipRule:"evenodd"},child:[]}]})(e)}function myn({value:e,onChange:t,options:n=[{value:"extended",label:"Extended"}],activeTextColor:r="#1de674",chevronColor:s="#1de674"}){const[a,o]=m.useState(!1),l=m.useRef(null);m.useEffect(()=>{const u=f=>{l.current&&(l.current.contains(f.target)||o(!1))},d=f=>{f.key==="Escape"&&o(!1)};return document.addEventListener("pointerdown",u,!0),document.addEventListener("keydown",d),()=>{document.removeEventListener("pointerdown",u,!0),document.removeEventListener("keydown",d)}},[]);const c=m.useMemo(()=>n.find(u=>String(u.value)===String(e))||n[0]||null,[n,e]);return i.jsxs("div",{className:"relative",ref:l,children:[i.jsxs("div",{onClick:()=>o(u=>!u),className:"h-[32px] px-3 rounded-md flex justify-between items-center cursor-pointer",style:{background:jo,border:`1px solid ${ka}`,color:Vi},children:[i.jsx("span",{className:"truncate text-xs font-medium",style:{color:Vi},children:(c==null?void 0:c.label)||"Select"}),i.jsx("span",{className:"ml-2 flex items-center",children:i.jsx("span",{className:"ml-2",children:"▾"})})]}),a&&i.jsx("div",{className:"absolute z-50 mt-1 w-full max-h-[240px] overflow-auto rounded-md p-1",style:{background:jo,border:`1px solid ${ka}`},children:n.map(u=>{const d=String(u.value)===String(e);return i.jsx("div",{className:"px-3 py-2 rounded cursor-pointer text-xs font-medium",style:{background:d?"#26313b":"transparent",color:d?"#ffffff":Vi},onClick:()=>{t==null||t(u.value),o(!1)},children:u.label},u.value)})})]})}const Nb="#67FFBD",PO="#ff7073",hF="#60A5FA",xNe="#A78BFA",xyn="#F97316",gyn={KBONK:"BONK",KPEPE:"PEPE",KSHIB:"SHIB",KFLOKI:"FLOKI",KNEIRO:"NEIRO",KDOGS:"DOGS",KLUNC:"LUNC"},byn=new Set(["KBONK","KPEPE","KSHIB"]),yyn="https://app.hyperliquid.xyz/coins",gNe={SAFE:{icon:"✅",color:Nb,label:"Safe",tooltip:"Order can be safely executed with sufficient collateral buffer"},WARNING:{icon:"⚠️",color:xyn,label:"Warning",tooltip:"Position is approaching liquidation risk, consider reducing leverage or adding collateral"},STOPPED:{icon:"🛑",color:PO,label:"Stopped",tooltip:"Stop loss will trigger before this DCA order executes"},LIQUIDATED:{icon:"💀",color:"#991B1B",label:"Liquidated",tooltip:"Position will be liquidated at this price level"},CANCELLED:{icon:"❌",color:"#6B7280",label:"Cancelled",tooltip:"Order will not execute - position was already closed"},EXCEEDED:{icon:"⛔",color:"#6B7280",label:"Exceeded",tooltip:"Price deviation exceeds 100% - reduce deviation multiplier or number of orders"}},Nh=({children:e,content:t})=>{const[n,r]=m.useState(!1),[s,a]=m.useState({x:0,y:0}),o=m.useRef(null),l=u=>{const d=u.currentTarget.getBoundingClientRect();a({x:d.left+d.width/2,y:d.top}),r(!0)},c=e==null||typeof e=="string"&&e.trim()==="?"?i.jsx("div",{className:"flex items-center has-tooltip relative",children:i.jsx(vi,{className:"text-[#7C7C7C] w-3.5 min-w-3.5 min-h-3.5 h-3.5"})}):e;return i.jsxs("span",{className:"relative inline-flex",children:[i.jsx("span",{ref:o,onMouseEnter:l,onMouseLeave:()=>r(!1),className:"cursor-help transition-colors ml-1 inline-flex",children:c}),n&&i.jsxs("div",{className:"fixed z-50 px-3 py-2 text-xs bg-[#1a1a1a] border border-[#333] rounded-lg shadow-xl max-w-xs text-[#ccc] whitespace-normal",style:{left:s.x,top:s.y-8,transform:"translate(-50%, -100%)"},children:[t,i.jsx("div",{className:"absolute left-1/2 -translate-x-1/2 top-full w-0 h-0",style:{borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderTop:"6px solid #333"}})]})]})},Qx=({label:e,value:t,onChange:n,min:r,max:s,step:a,suffix:o,tooltip:l,placeholder:c,helperText:u,validate:d,readOnly:f=!1,forceError:x=!1,forceErrorMessage:g=null})=>{const[v,w]=m.useState(!1),C=F=>{const U=parseFloat(F);return d?d(U,F):r!==void 0&&!isNaN(U)&&U<parseFloat(r)?`Minimum value is ${r}`:s!==void 0&&!isNaN(U)&&U>parseFloat(s)?`Maximum value is ${s}`:null},N=F=>{let U=F.target.value;const L=parseFloat(U);U!==""&&r!==void 0&&!Number.isNaN(L)&&!Number.isNaN(parseFloat(r))&&L<parseFloat(r)&&(U=String(parseFloat(r))),U!==""&&s!==void 0&&!Number.isNaN(L)&&!Number.isNaN(parseFloat(s))&&L>parseFloat(s)&&(U=String(parseFloat(s))),n(U)},I=()=>{w(!0)},P=C(t),R=x&&(g||P)?g||P:v&&P?P:null;return i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs text-[#9b9b9b] flex items-center",children:[e,l&&i.jsx(Nh,{content:l,children:"?"})]}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{type:"number",value:t,onChange:N,onBlur:I,onWheel:F=>F.currentTarget.blur(),min:r,max:s,step:a,readOnly:f,placeholder:c,className:`w-full px-3 py-2 rounded-lg ${f?"bg-[#101010]":"bg-[#161616]"} border text-white text-sm focus:outline-none transition-colors ${R?"border-[#ff7073] focus:border-[#ff7073]":f?"border-[#1c2a24] focus:border-[#1c2a24] cursor-not-allowed":"border-[#1c2a24] focus:border-[#67FFBD]"}`}),o&&i.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-[#6e857d] text-sm",children:o})]}),R&&i.jsx("p",{className:"text-[10px] text-[#ff7073] px-1",children:R}),u&&!R&&i.jsx("p",{className:"text-[10px] text-[#666] px-1",children:u})]})},vyn=e=>{const t=String(e||"").toUpperCase();return byn.has(t)?`1000${t.slice(1)}`:t},Co=(e,t=2)=>{if(e==null||isNaN(e))return"-";const n=Math.abs(e);return n>=1e9?`${(e/1e9).toFixed(2)}B`:n>=1e6?`${(e/1e6).toFixed(2)}M`:n>=1e3?`${(e/1e3).toFixed(2)}K`:e.toFixed(t)},gb=(e,t=!1)=>e==null||isNaN(e)?"-":e<=0?t?"Safe ✓":"N/A":e>=1e4?`$${e.toFixed(1)}`:e>=1e3?`$${e.toFixed(2)}`:e>=100?`$${e.toFixed(3)}`:e>=10?`$${e.toFixed(4)}`:`$${e.toFixed(5)}`,wyn=e=>e==null||isNaN(e)?"-":`${e.toFixed(2)}%`,Cyn=(e,t)=>{const n=Number(e),r=!Number.isFinite(n)||n<=0?2:n<1e-4?8:n<.01?6:n<1?5:n<10?4:2,s=Number(t);return Math.max(r,Number.isFinite(s)&&s>0?s:0)},xc=e=>String(e||"").toUpperCase().replace(/-USD(T)?$/,"").replace(/\/USD(T)?$/,"").replace(/USD(T)?$/,""),Syn=(e,t=[])=>{const n=xc(e),r=t.find(s=>{var o;const a=xc(s.symbol||s.rawSymbol||((o=s.raw)==null?void 0:o.symbol)||s.market||"");return a===n||a===`${n}USDT`||a===`${n}USD`||a===n.replace(/USD$/,"")});return r?r.market_index??r.marketIndex??r.market_id??r.marketId??r.id??null:null},Nyn=(e,t=[])=>{const n=xc(e);return t.find(r=>{var a;const s=xc(r.symbol||r.rawSymbol||((a=r.raw)==null?void 0:a.symbol)||r.market||"");return s===n||s===`${n}USDT`||s===`${n}USD`||s===n.replace(/USD$/,"")})||null},Ayn=({value:e,onChange:t,min:n=1,max:r=100,tooltip:s})=>{const a=(e-n)/(r-n)*100,o=l=>{const c=l.target.value;if(c===""){t("1");return}const u=parseInt(c);isNaN(u)||t(String(Math.min(r,Math.max(n,u))))};return i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs text-[#9b9b9b] flex items-center",children:["Leverage",s&&i.jsx(Nh,{content:s,children:"?"})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{className:"flex-1 relative",children:[i.jsx("div",{className:"h-1.5 bg-[#1c2a24] rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-[#67FFBD] rounded-full transition-all",style:{width:`${a}%`}})}),i.jsx("input",{type:"range",min:n,max:r,value:e,onChange:l=>t(l.target.value),className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer"}),i.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 w-3.5 h-3.5 bg-[#67FFBD] rounded-full border-2 border-[#101010] pointer-events-none transition-all",style:{left:`calc(${a}% - 7px)`}})]}),i.jsxs("div",{className:"flex items-center bg-[#161616] border border-[#1c2a24] rounded-lg overflow-hidden",children:[i.jsx("input",{type:"number",value:e,onChange:o,onWheel:l=>l.currentTarget.blur(),min:n,max:r,className:"w-12 px-2 py-1.5 bg-transparent text-white text-sm text-center focus:outline-none [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"}),i.jsx("span",{className:"pr-2 text-[#6e857d] text-sm",children:"x"})]})]})]})},bNe=({className:e="",entryPrice:t,onEntryPriceChange:n,maxBudget:r,onBudgetChange:s})=>i.jsxs("div",{className:`bg-[#0f0f0f] border border-[#2b3640] rounded-lg px-3 py-2 flex items-center gap-3 text-xs text-[#cfd4db] whitespace-nowrap overflow-x-auto ${e}`,children:[i.jsxs("div",{className:"flex items-center gap-2 text-white font-semibold",children:[i.jsx("span",{className:"inline-flex items-center justify-center w-5 h-5 rounded-full bg-[#1b2630] text-[#67FFBD]",children:"i"}),i.jsx("span",{children:"Preview Mode"})]}),i.jsxs("div",{className:"flex-1 flex justify-center items-center gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[#cfd4db] text-xs",children:"Entry Price:"}),i.jsx("input",{type:"number",value:t,onChange:a=>n==null?void 0:n(a.target.value.replace(",",".")),step:"0.000001",inputMode:"decimal",className:"h-8 px-3 rounded-lg bg-[#161616] border border-[#1c2a24] text-white text-xs focus:outline-none focus:border-[#67FFBD] w-28",placeholder:"0.000000"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[#cfd4db] text-xs",children:"Budget:"}),i.jsx("input",{type:"number",value:r,onChange:a=>s==null?void 0:s(a.target.value.replace(",",".")),step:"1",inputMode:"decimal",className:"h-8 px-3 rounded-lg bg-[#161616] border border-[#1c2a24] text-white text-xs focus:outline-none focus:border-[#67FFBD] w-28",placeholder:"0"})]})]}),i.jsxs("div",{className:"flex items-center gap-2 text-[#facc15] ml-auto",children:[i.jsx("span",{children:"⚠️"}),i.jsx("span",{className:"text-[11px] text-[#cfd4db]",children:"Calculator only (preview)"})]})]});function jyn(){var et;const e=Nue(),t=e.length===0,n=Aue(),r=n.length===0,[s,a]=m.useState("extended"),[o,l]=m.useState([]),[c,u]=m.useState(50),[d,f]=m.useState({}),[x,g]=m.useState("extended"),[v,w]=m.useState("BTC"),[C,N]=m.useState(""),[I,P]=m.useState("long"),[R,F]=m.useState("10"),[U,L]=m.useState("5"),[z,X]=m.useState("10"),[ne,J]=m.useState("10"),[Z,re]=m.useState("1500"),[he,Y]=m.useState(!1),[ie,oe]=m.useState("1"),[G,V]=m.useState(""),[ee,ae]=m.useState(!0),[fe,Ae]=m.useState("0.50"),[ce,ye]=m.useState("1.1"),[Ne,be]=m.useState("1"),[je,Ie]=m.useState(!0),[Re,Qe]=m.useState(!0),[Be,it]=m.useState(!0),[tt,at]=m.useState(!0),[dt,ct]=m.useState("details"),[Ut,kt]=m.useState([]),[tn,jt]=m.useState(!1),[un,cn]=m.useState([]),[Pt,Xe]=m.useState(!1),[Vt,Yt]=m.useState(null),[Ve,Ke]=m.useState(!1),[ft,en]=m.useState({}),[Dt,At]=m.useState({}),[Je,He]=m.useState(null),Rt=m.useRef(!1),qe=m.useRef(!0),lt=m.useRef(0),xt=s==="extended"?n:e,Nt=s==="extended"?r:t,It=s==="extended"?"extended_selected_wallet_id":"lighter_selected_wallet_id",xn=m.useMemo(()=>`dca_last_coin_${s}`,[s]),dn=m.useMemo(()=>`dca_settings_${s}`,[s]),Mn=m.useMemo(()=>({baseOrderMargin:"5",dcaOrderMargin:"10",maxDcaOrders:"10",tpTarget:"1",stopLoss:"",priceDeviation:"0.50",dcaSizeMultiplier:"1.1",priceDevMultiplier:"1"}),[]);m.useEffect(()=>{if(typeof window>"u")return;const We=window.localStorage.getItem(dn),wt={...Mn};if(We)try{const St=JSON.parse(We)||{};Object.keys(Mn).forEach(Kt=>{St[Kt]!==void 0&&St[Kt]!==null&&(wt[Kt]=String(St[Kt]))})}catch{}L(wt.baseOrderMargin),X(wt.dcaOrderMargin),J(wt.maxDcaOrders),oe(wt.tpTarget),V(wt.stopLoss),Ae(wt.priceDeviation),ye(wt.dcaSizeMultiplier),be(wt.priceDevMultiplier)},[dn,Mn]),m.useEffect(()=>{if(typeof window>"u")return;const We={baseOrderMargin:U,dcaOrderMargin:z,maxDcaOrders:ne,tpTarget:ie,stopLoss:G,priceDeviation:fe,dcaSizeMultiplier:ce,priceDevMultiplier:Ne};try{window.localStorage.setItem(dn,JSON.stringify(We))}catch{}},[dn,U,z,ne,ie,G,fe,ce,Ne]);const _n=m.useMemo(()=>{const We=new Map;return o.forEach(wt=>{const St=xc(wt.value||wt.label||wt.symbol||wt.coin);if(!St)return;const Kt=wt.maxLeverage??wt.max_leverage??wt.leverage??null,gn=Number(Kt);We.set(St,Number.isFinite(gn)?gn:null)}),We},[o]),kn=m.useMemo(()=>xt.map(We=>{var gn,yn,hn;const wt=xc(We.symbol||We.rawSymbol||((gn=We.raw)==null?void 0:gn.symbol)||We.market||We.coin),St=We.leverage??We.maxLeverage??We.max_leverage??(wt?_n.get(wt):null),Kt=Number.isFinite(Number(St))&&Number(St)>0?Number(St):null;return{...We,symbol:We.symbol||((yn=We.raw)==null?void 0:yn.symbol)||We.rawSymbol||We.market||"",rawSymbol:We.rawSymbol||((hn=We.raw)==null?void 0:hn.symbol)||We.symbol,leverage:Kt,maxLeverage:We.maxLeverage??We.max_leverage??Kt}}),[xt,_n]),vn="https://dextrabothypev2.nftinit.io/api/hyper/dca_bot",{setSignModalOpen:Qn,hyperToken:Hn,hyperAddress:$n}=m.useContext(Gr),[Jn,Nn]=m.useState({address:null,token:null}),ln=m.useCallback(()=>Jn,[Jn]),[Oe,sn]=m.useState(!1),fn=We=>{if(!We)return null;const wt=String(We);return wt==="null"||wt==="undefined"?null:wt};m.useEffect(()=>{const We=()=>{if(typeof window>"u")return;const St=fn($n||window.localStorage.getItem("hyperAddress")),Kt=fn(Hn||window.localStorage.getItem("hyperToken"));Nn({address:St,token:Kt}),(!St||!Kt)&&(sn(!1),cn([]),Yt(null),lt.current=0)};We(),window.addEventListener("localStorageUpdated",We),window.addEventListener("storage",We);const wt=setInterval(()=>{if(typeof window>"u")return;const St=fn($n||window.localStorage.getItem("hyperAddress")),Kt=fn(Hn||window.localStorage.getItem("hyperToken"));Nn(gn=>gn.address===St&&gn.token===Kt?gn:{address:St,token:Kt}),(!St||!Kt)&&(sn(!1),cn([]),Yt(null),lt.current=0)},1500);return()=>{window.removeEventListener("localStorageUpdated",We),window.removeEventListener("storage",We),clearInterval(wt)}},[Hn,$n]),m.useEffect(()=>{const We=!!Jn.token,wt=!!Jn.address;sn(We&&wt)},[Jn]),m.useEffect(()=>()=>{qe.current=!1},[]);const Et=m.useCallback(async()=>{if(Rt.current)return;const We=Jn.address,wt=Jn.token;if(!We||!wt){Rt.current=!1,Xe(!1);return}const St=Date.now();if(!(St-lt.current<4500)){lt.current=St,Rt.current=!0,Xe(!0);try{let Kt=[];const yn=await(await fetch("https://dextrabothypev2.nftinit.io/api/wallet/list-extended",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:We.toLowerCase(),token:wt,balance:"true"})})).json().catch(()=>null);if(!qe.current||!yn){Rt.current=!1,Xe(!1);return}let hn=[];if(Array.isArray(yn)?hn=yn:Array.isArray(yn==null?void 0:yn.data)&&(hn=yn.data),Kt=await Promise.all(hn.map(async(pt,Wt)=>{var Gn,fr,ur;let Zt=null;const vt=Number(pt.available_balance??pt.availableForTrade??pt.available_for_trade??pt.balance??pt.available??null);Number.isFinite(vt)&&(Zt=vt);const Ot=pt.wallet_id??pt.id??Wt,wn=pt.wallet_api_key||pt.api_key||null;if(wn&&Zt==null)try{const $t=`https://express-proxy-delta.vercel.app/proxy?url==${encodeURIComponent("https://api.starknet.extended.exchange/api/v1/user/balance")}`,Vn=await(await fetch($t,{headers:{"X-Api-Key":wn}})).json().catch(()=>null),lr=((Gn=Vn==null?void 0:Vn.data)==null?void 0:Gn.availableForTrade)??(Vn==null?void 0:Vn.availableForTrade)??((fr=Vn==null?void 0:Vn.data)==null?void 0:fr.available_balance)??(Vn==null?void 0:Vn.available_balance)??((ur=Vn==null?void 0:Vn.data)==null?void 0:ur.available)??(Vn==null?void 0:Vn.available),er=Number(lr);Number.isFinite(er)&&er>=0&&(Zt=er)}catch{}return{wallet_id:Ot,wallet_address:pt.wallet_address||pt.address||"",wallet_name:pt.wallet_name||pt.name||`Extended Wallet ${Wt+1}`,available_balance:Zt,wallet_api_key:wn}})),!qe.current)return;cn(Kt),Kt.length>0?Yt(pt=>{const Wt=typeof window<"u"?window.localStorage.getItem(It):null,Zt=(pt==null?void 0:pt.id)??Wt,vt=Zt&&Kt.find(Ot=>String(Ot.wallet_id)===String(Zt))||Kt[0];return vt?{id:vt.wallet_id,address:vt.wallet_address,apiKey:vt.wallet_api_key}:null}):Yt(null)}catch(Kt){console.error("Error loading wallets:",Kt),qe.current&&cn([])}finally{Rt.current=!1,qe.current&&Xe(!1)}}},[Jn.address,Jn.token,s,It]);m.useEffect(()=>{Oe&&Et()},[Oe,Et]),m.useEffect(()=>{Jn.address&&Jn.token?(sn(!0),Et()):(sn(!1),cn([]),Yt(null),lt.current=0)},[Jn.address,Jn.token,Et]),m.useEffect(()=>{const We=()=>Et();return window.addEventListener("localStorageUpdated",We),window.addEventListener("storage",We),()=>{window.removeEventListener("localStorageUpdated",We),window.removeEventListener("storage",We)}},[Et]),m.useEffect(()=>{lt.current=0,cn([]),Yt(null),He(null)},[s]),m.useEffect(()=>{Y(!1)},[Vt==null?void 0:Vt.id,s]);const Kn=m.useMemo(()=>{if(!Vt||!Vt.id)return null;const We=un.find(St=>String(St.wallet_id)===String(Vt.id));if(!We)return null;if(s==="extended"&&Vt.apiKey){const St=Number(Je==null?void 0:Je.availableForTrade);if(Number.isFinite(St))return St}const wt=Number(We.available_balance??We.availableForTrade??We.available_for_trade??We.balance??We.available??null);return Number.isFinite(wt)?wt:null},[un,Vt,s,Je]),Cn=m.useCallback(async()=>{const We=Jn.address,wt=Jn.token;if(!We||!wt){kt([]);return}jt(!0);try{const Kt=await(await fetch(`${vn}/info/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:We.toLowerCase(),token:wt,source_market:s})})).json().catch(()=>null),yn=(Array.isArray(Kt==null?void 0:Kt.data)?Kt.data:Kt!=null&&Kt.data?[Kt.data]:[]).filter(hn=>hn?s?String(hn.source_market||"").toLowerCase()===String(s||"").toLowerCase()?!0:s==="hyper"&&!hn.source_market:!0:!1);kt(yn)}catch(St){console.error("Error loading bots:",St),kt([])}finally{jt(!1)}},[ln,vn,s]);m.useEffect(()=>{Cn()},[Cn,Jn.address,Jn.token,s]);const Bt=m.useCallback(async()=>{var St,Kt;const{address:We,token:wt}=ln();if(!We||!wt||!Vt||!Vt.id){on.error("Please connect your wallet and select a wallet.");return}Ke(!0);try{const gn=(St=v==null?void 0:v.toUpperCase())==null?void 0:St.trim(),yn=vyn(gn);let hn=null;if(s==="lighter")try{const gr=await(await fetch("https://mainnet.zklighter.elliot.ai/api/v1/funding-rates")).json().catch(()=>null);if(gr!=null&&gr.funding_rates&&Array.isArray(gr.funding_rates)){const dr=gr.funding_rates.find(Fs=>String(Fs.symbol||"").toUpperCase().trim()===gn);console.log("coinRate",dr),dr&&dr.market_id!=null?(hn=dr.market_id,console.log(`✅ Found market_id ${hn} for coin ${gn} from funding-rates API (exchange: ${dr.exchange})`)):(console.warn(`❌ Coin ${gn} not found in funding-rates API`),console.log("Sample available symbols:",gr.funding_rates.slice(0,20).map(Fs=>Fs.symbol)))}else console.warn("No funding_rates array in API response")}catch(er){console.error("Error fetching funding-rates API:",er),hn=d[gn]||null,hn&&console.log(`Using cached market_id ${hn} for coin ${gn}`)}if(hn===null){if(s==="extended"&&(!xt||!xt.length)){on.error("Extended markets are loading. Please try again in a moment."),Ke(!1);return}hn=Syn(v,xt)}if(hn===null&&s!=="extended"){console.error("Market not found for coin:",gn),on.error(`Unable to find market index for ${gn}. Please make sure the coin is available on ${s}.`),Ke(!1);return}hn!=null&&console.log(`Using market_index: ${hn} for coin: ${gn}`);const br=un.find(er=>String(er.wallet_id)===String(Vt.id));if(!br||!br.wallet_id){on.error("Unable to find selected wallet. Please select a wallet again."),Ke(!1);return}const pt=Math.max(1,Math.min(Number(c)||100,Number(R)||1)),Wt=Nyn(v,xt),Zt=String(v||"").toUpperCase(),vt=Number((Wt==null?void 0:Wt.maxLeverage)??(Wt==null?void 0:Wt.leverage)??(Wt==null?void 0:Wt.max_leverage)??c??0),Ot=s==="extended"&&vt>0?Math.min(vt,pt||vt):pt,wn=parseFloat(ie)||0,Gn=Number(C)||Number(Wt==null?void 0:Wt.markPrice)||Number(Wt==null?void 0:Wt.lastPrice)||Number(Wt==null?void 0:Wt.last)||null,fr=Number(((Kt=Wt==null?void 0:Wt.tradingConfig)==null?void 0:Kt.minOrderSize)??(Wt==null?void 0:Wt.minOrderSize)),ur=Number.isFinite(fr)&&fr>0&&Number.isFinite(Gn)&&Gn>0?fr*Gn:null;if(s==="extended"&&ur!=null){const er=parseFloat(U)||0,gr=parseFloat(z)||0,dr=er*Ot,Fs=gr*Ot;if(dr<ur||Fs<ur){const us=[];dr<ur&&us.push("Base Order"),Fs<ur&&us.push("DCA Order");const xr=us.length===1?` (${us[0]})`:us.length===2?" (Base Order & DCA Order)":"";on.error(`Minimum order size for ${Zt} is $${ur.toFixed(2)}${xr}. Increase order size or leverage.`),Ke(!1);return}}const $t={direction:I,leverage:Ot,base_amount_usd:parseFloat(U)||0,safety_amount_usd:parseFloat(z)||0,max_safety_orders:parseInt(ne)||0,price_deviation:parseFloat(fe)||.5,step_scale:parseFloat(Ne)||1,volume_scale:parseFloat(ce)||1.5,tp_percent:wn,stop_loss_percent:G?parseFloat(G):0};s!=="extended"&&hn!=null&&($t.market_index=Number.isFinite(Number(hn))?Number(hn):hn);const nn={address:We.toLowerCase(),token:wt,wallet_id:br.wallet_id,source_market:s,bot_params:$t,coin:yn};console.log("DCA Bot API Request:",JSON.stringify(nn,null,2));const lr=await(await fetch(`${vn}/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(nn)})).json().catch(()=>null);lr!=null&&lr.success?(on.success("DCA Bot started successfully!"),await Cn(),ct("bots")):on.error((lr==null?void 0:lr.error_message)||"Failed to start bot. Please try again.")}catch(gn){console.error("Error starting bot:",gn),on.error("Error starting bot. Please try again.")}finally{Ke(!1)}},[ln,Vt,s,v,xt,d,un,I,R,U,z,ne,fe,ce,Ne,ie,G,Cn,vn]);m.useCallback(async We=>{const{address:wt,token:St}=ln();if(!wt||!St||!Vt||!Vt.id){on.error("Please connect your wallet and select a wallet.");return}const Kt=un.find(gn=>String(gn.wallet_id)===String(Vt.id));if(!Kt||!Kt.wallet_id){on.error("Unable to find selected wallet. Please select a wallet again.");return}en(gn=>({...gn,[We]:!0}));try{const yn=await(await fetch(`${vn}/stop/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:wt.toLowerCase(),token:St,wallet_id:Kt.wallet_id,source_market:s,coin:v})})).json().catch(()=>null);yn!=null&&yn.success?await Cn():on.error((yn==null?void 0:yn.error_message)||"Failed to stop bot. Please try again.")}catch(gn){console.error("Error stopping bot:",gn),on.error("Error stopping bot. Please try again.")}finally{en(gn=>({...gn,[We]:!1}))}},[ln,Vt,s,v,un,Cn,vn]);const an=m.useCallback(async(We,wt,St={})=>{const{address:Kt,token:gn}=ln();if(!Kt||!gn){on.error("Please connect your wallet.");return}en(yn=>({...yn,[We]:!0})),kt(yn=>yn.map(hn=>hn.id===We||hn.bot_id===We?{...hn,is_deleted:wt,...St}:hn));try{const hn=await(await fetch(`${vn}/update/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:Kt.toLowerCase(),token:gn,bot_id:We,update_params:{is_deleted:wt,...St}})})).json().catch(()=>null);if(hn!=null&&hn.success)await Cn(),wt&&on.success("DCA Bot has been stopped.");else{await Cn();const br=(hn==null?void 0:hn.error_message)||(hn==null?void 0:hn.message)||(hn==null?void 0:hn.detail)||(hn==null?void 0:hn.error),pt=wt?"Failed to stop bot. Please try again.":"Cannot start this bot. Another bot for this coin may already be active. Stop it first or choose a different coin.";on.error(br||pt)}}catch(yn){console.error("Error updating bot:",yn),await Cn(),on.error(wt?"Failed to stop bot. Please try again.":"Cannot start this bot. Another bot for this coin may already be active. Stop it first or choose a different coin.")}finally{en(yn=>({...yn,[We]:!1}))}},[ln,Cn,vn]);m.useCallback(async We=>{const{address:wt,token:St}=ln();if(!wt||!St){on.error("Please connect your wallet.");return}if(confirm("Are you sure you want to delete this bot? This action cannot be undone.")){At(Kt=>({...Kt,[We]:!0})),kt(Kt=>Kt.filter(gn=>gn.id!==We&&gn.bot_id!==We));try{const Kt=await fetch(`${vn}/update/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:wt.toLowerCase(),token:St,bot_id:We,update_params:{permanent_delete:!0,is_deleted:!0}})}),gn=await Kt.json().catch(()=>null);if(console.log("Delete bot response:",gn),console.log("Response status:",Kt.status),gn!=null&&gn.success)await Cn();else{console.log("Trying delete endpoint as fallback...");const yn=await fetch(`${vn}/delete/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:wt.toLowerCase(),token:St,bot_id:We})}),hn=await yn.json().catch(()=>null);if(console.log("Delete endpoint response:",hn),hn!=null&&hn.success)await Cn();else{await Cn();const br=(hn==null?void 0:hn.error_message)||(gn==null?void 0:gn.error_message)||(hn==null?void 0:hn.message)||(gn==null?void 0:gn.message)||(hn==null?void 0:hn.detail)||(gn==null?void 0:gn.detail)||`Failed to delete bot. Status: ${yn.status||Kt.status}`;console.error("Delete bot error:",br,{data:gn,deleteData:hn}),on.error(br)}}}catch(Kt){console.error("Error deleting bot:",Kt),await Cn(),on.error(`Error deleting bot: ${Kt.message||"Please try again."}`)}finally{At(Kt=>({...Kt,[We]:!1}))}}},[ln,Cn,vn]),m.useEffect(()=>{let We=!1;async function wt(){try{const Kt=await(await fetch("https://mainnet.zklighter.elliot.ai/api/v1/funding-rates")).json().catch(()=>null);if(We||!(Kt!=null&&Kt.funding_rates))return;const gn={};Kt.funding_rates.filter(yn=>yn.exchange==="lighter").forEach(yn=>{if(yn.symbol&&yn.market_id!=null){const hn=String(yn.symbol).toUpperCase().trim();gn[hn]=yn.market_id}}),We||(f(gn),console.log(`✅ Loaded ${Object.keys(gn).length} market IDs from funding-rates API for lighter exchange`))}catch(St){console.error("Error loading market IDs from funding-rates API:",St),We||f({})}}return wt(),()=>{We=!0}},[]),m.useEffect(()=>{let We=!1;async function wt(){try{const Kt=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=lighter_fr")).json().catch(()=>null);if(We)return;let gn=[];Array.isArray(Kt)?gn=Kt:Array.isArray(Kt==null?void 0:Kt.data)?gn=Kt.data:Array.isArray(Kt==null?void 0:Kt.coins)&&(gn=Kt.coins);const yn=gn.map(hn=>({value:String(hn.value||hn.label||hn.symbol||hn.coin||"").toUpperCase(),label:hn.label||hn.value||hn.symbol||hn.coin,maxLeverage:hn.maxLeverage||50}));We||l(yn)}catch{We||l([])}}return wt(),()=>{We=!0}},[]),m.useEffect(()=>{var br;if(!xt.length)return;const We=xc(v);if(We?xt.some(pt=>xc(pt.symbol)===We):!1)return;const St=typeof window<"u"?window.localStorage.getItem(xn):null,Kt=xc(St),gn=St&&Kt?xt.some(pt=>xc(pt.symbol)===Kt):!1,yn=xt[0],hn=gn?Kt:xc((yn==null?void 0:yn.symbol)||((br=yn==null?void 0:yn.raw)==null?void 0:br.symbol)||(yn==null?void 0:yn.rawSymbol));w(hn||"BTC")},[xt,v,xn]);const Pn=m.useMemo(()=>{const We=xc(v);return We&&(xt.find(wt=>xc(wt.symbol)===We)||xt.find(wt=>{var St;return xc(((St=wt.raw)==null?void 0:St.symbol)||wt.rawSymbol)===We}))||null},[xt,v]),qn=m.useMemo(()=>{const We=xc(v);if(!We)return null;const wt=gyn[We]||We;return(Pn==null?void 0:Pn.kind)==="hip3"&&(Pn!=null&&Pn.builder)?`${Pn.builder}:${wt}`:wt},[v,Pn]),nr=m.useMemo(()=>{const We=xc(v);return We&&Ut.find(wt=>{var Kt,gn;const St=xc(wt.coin||wt.symbol||((Kt=wt.bot_params)==null?void 0:Kt.coin)||((gn=wt.bot_params)==null?void 0:gn.symbol));return!wt.is_deleted&&St===We})||null},[Ut,v]),tr=m.useMemo(()=>{const We=Ut.filter(St=>!St.is_deleted),wt=Ut.filter(St=>St.is_deleted);return[...We,...wt]},[Ut]),Qt=Number(C)||Number(Pn==null?void 0:Pn.markPrice)||Number(Pn==null?void 0:Pn.lastPrice)||Number(Pn==null?void 0:Pn.last)||null,zn=Number(((et=Pn==null?void 0:Pn.tradingConfig)==null?void 0:et.minOrderSize)??(Pn==null?void 0:Pn.minOrderSize)),Yn=s==="extended"&&Number.isFinite(zn)&&zn>0&&Number.isFinite(Qt)&&Qt>0?zn*Qt:null,Lt=Math.max(1,Number(R)||1),Fn=parseFloat(U)||0,Ee=parseFloat(z)||0,p=Fn*Lt,h=Ee*Lt,S=s==="extended"&&Yn!=null&&p<Yn,_=s==="extended"&&Yn!=null&&h<Yn,k=S||_,T=We=>{if(Yn==null||!Number.isFinite(Lt)||Lt<=0)return"Minimum order size not met";const wt=Yn/Lt,St=Math.abs(Lt-Math.round(Lt))<1e-6?Math.round(Lt):Number(Lt.toFixed(2));return`${We} must be at least $${wt.toFixed(2)} (min. $${Yn.toFixed(2)} notional ÷ ${St}x leverage)`};m.useEffect(()=>{const We=o.find(Kt=>Kt.value===v),wt=s==="extended"?(Pn==null?void 0:Pn.maxLeverage)??(Pn==null?void 0:Pn.leverage)??(Pn==null?void 0:Pn.max_leverage)??50:We==null?void 0:We.maxLeverage,St=Number(wt);Number.isFinite(St)&&St>0&&(u(St),F(Kt=>{const gn=parseInt(Kt)||1;return String(Math.min(St,Math.max(1,gn)))}))},[v,o,Pn,s]),m.useEffect(()=>{if(s!=="extended"||!(Vt!=null&&Vt.apiKey)){He(null);return}let We=!1;const wt=async()=>{var Kt,gn,yn,hn;try{const br=`https://express-proxy-delta.vercel.app/proxy?url=${encodeURIComponent("https://api.starknet.extended.exchange/api/v1/user/balance")}`,Wt=await(await fetch(br,{headers:{"X-Api-Key":Vt.apiKey}})).json().catch(()=>null);if(We)return;const Zt=((Kt=Wt==null?void 0:Wt.data)==null?void 0:Kt.availableForTrade)??(Wt==null?void 0:Wt.availableForTrade)??((gn=Wt==null?void 0:Wt.data)==null?void 0:gn.available_balance)??(Wt==null?void 0:Wt.available_balance)??((yn=Wt==null?void 0:Wt.data)==null?void 0:yn.available)??(Wt==null?void 0:Wt.available),vt=Number(Zt),Ot=((hn=Wt==null?void 0:Wt.data)==null?void 0:hn.equity)??(Wt==null?void 0:Wt.equity),wn=Number(Ot);He({availableForTrade:Number.isFinite(vt)&&vt>=0?vt:null,equity:Number.isFinite(wn)?wn:null,raw:Wt})}catch{We||He(null)}};wt();const St=setInterval(wt,2e4);return()=>{We=!0,clearInterval(St)}},[s,Vt==null?void 0:Vt.apiKey]),m.useEffect(()=>{if(s!=="extended")return;const We=Je==null?void 0:Je.equity;Number.isFinite(We)&&!he&&re(String(We))},[Je==null?void 0:Je.equity,s,he]);const B=m.useRef(v),q=m.useRef(!1);m.useEffect(()=>{const We=B.current!==v,wt=!q.current&&!C;if((We||wt)&&(Pn!=null&&Pn.last)&&Pn.last>0){B.current=v,q.current=!0;const St=Cyn(Pn.last,Pn.priceDecimals);N(Number(Pn.last).toFixed(St))}},[v,Pn==null?void 0:Pn.last,C]);const te=m.useCallback(We=>{const wt=xc(We);w(wt),typeof window<"u"&&window.localStorage.setItem(xn,wt)},[xn]),ue=m.useCallback(We=>{Y(!0),re(We)},[]),de=m.useCallback(We=>{N(We)},[]),xe=Nt,we=I==="smart",ke=m.useCallback(We=>{const wt=parseFloat(R)||10,St=.6/wt,Kt=parseFloat(C)||0,gn=parseFloat(U)||0,yn=parseFloat(z)||0,hn=parseInt(ne)||0,br=parseFloat(Z)||1/0,pt=parseFloat(fe)||0,Wt=parseFloat(ce)||1.1,Zt=parseFloat(Ne)||1,vt=parseFloat(ie)||0,Ot=parseFloat(G)||100,wn=We==="smart",Gn=We==="long";if(wn)return{orders:[],metrics:null};if(Kt<=0||gn<=0)return{orders:[],metrics:null};let fr=gn;for(let pn=1;pn<=hn;pn++)fr+=yn*Math.pow(Wt,pn-1);const ur=[];let $t=0,nn=0,Vn=0,lr=0,er=0,gr=0,dr=!1,Fs=null;const us=br,xr=gn*wt,vr=xr/Kt;$t=gn,nn=xr,Vn=vr,$t>br&&(dr=!0,Fs=0);const rs=Gn?(Kt*Vn-us)/(Vn*(1-St)):(us+Kt*Vn)/(Vn*(1+St)),Zr=Gn?Kt*(1+vt/100):Kt*(1-vt/100);let gi="SAFE";rs<=0||(Gn&&rs>=Kt||!Gn&&rs<=Kt)&&(gi="LIQUIDATED"),dr&&(gi="WARNING",gr++);const oi=vr*Kt*St,la=us/oi,jr=Gn?(Zr-Kt)*vr:(Kt-Zr)*vr;ur.push({label:"Base",deviation:0,price:Kt,margin:gn,positionValue:xr,coins:vr,totalCoins:vr,totalMargin:$t,avgEntry:Kt,tpPrice:Zr,tpProfit:jr,liqPrice:rs,healthRatio:la,status:gi});let Xt=!1,pe=rs,st=Kt,Ft=Zr;for(let pn=1;pn<=hn;pn++){pn===1?lr=pt:lr+=pt*Math.pow(Zt,pn-1);const An=Gn?Kt*(1-lr/100):Kt*(1+lr/100);if(Xt){ur.push({label:`DCA ${pn}`,deviation:lr,price:An,margin:null,positionValue:null,coins:null,totalCoins:null,totalMargin:null,avgEntry:null,tpPrice:null,tpProfit:null,liqPrice:null,healthRatio:null,status:"CANCELLED"});continue}if(An<=0){Xt=!0,ur.push({label:`DCA ${pn}-${hn}`,deviation:lr,price:null,margin:null,positionValue:null,coins:null,totalCoins:null,totalMargin:null,avgEntry:null,tpPrice:null,tpProfit:null,liqPrice:null,healthRatio:null,status:"EXCEEDED",exceededCount:hn-pn+1,isLong:Gn});break}const or=yn*Math.pow(Wt,pn-1),_r=or*wt,wr=_r/An,pr=$t+or;pr>br&&!dr&&(dr=!0,Fs=pn),$t=pr,nn+=_r,Vn+=wr;const es=nn/Vn,ts=Gn?(es*Vn-us)/(Vn*(1-St)):(us+es*Vn)/(Vn*(1+St));if(Gn?ts>0&&An<=ts:ts>0&&An>=ts){Xt=!0,ur.push({label:"💀 Liq",deviation:null,price:pe,margin:null,positionValue:null,coins:null,totalCoins:null,totalMargin:null,avgEntry:st,tpPrice:Ft,tpProfit:null,liqPrice:pe,healthRatio:null,status:"LIQUIDATED"});for(let Nr=pn;Nr<=hn;Nr++){let Mr=0;for(let Kr=1;Kr<=Nr;Kr++)Kr===1?Mr=pt:Mr+=pt*Math.pow(Zt,Kr-1);const cr=Gn?Kt*(1-Mr/100):Kt*(1+Mr/100),bs=cr>0;ur.push({label:`DCA ${Nr}`,deviation:Mr,price:bs?cr:null,margin:null,positionValue:null,coins:null,totalCoins:null,totalMargin:null,avgEntry:null,tpPrice:null,tpProfit:null,liqPrice:null,healthRatio:null,status:bs?"CANCELLED":"EXCEEDED"})}break}const Qr=Gn?ts>=es:ts<=es,Ir=Gn?es*(1+vt/100):es*(1-vt/100),Ss=Ot>=100?null:Gn?es*(1-Ot/100):es*(1+Ot/100),hi=Gn?(An-es)*Vn:(es-An)*Vn,li=us+hi,Pr=Vn*An*St,En=li/Pr;let Rn="SAFE";if(Qr){Xt=!0,ur.push({label:`DCA ${pn}`,deviation:lr,price:An,margin:or,positionValue:_r,coins:wr,totalCoins:Vn,totalMargin:$t,avgEntry:es,tpPrice:null,tpProfit:null,liqPrice:ts,healthRatio:null,status:"LIQUIDATED"});for(let Nr=pn+1;Nr<=hn;Nr++){let Mr=0;for(let Kr=1;Kr<=Nr;Kr++)Kr===1?Mr=pt:Mr+=pt*Math.pow(Zt,Kr-1);const cr=Gn?Kt*(1-Mr/100):Kt*(1+Mr/100),bs=cr>0;ur.push({label:`DCA ${Nr}`,deviation:Mr,price:bs?cr:null,margin:null,positionValue:null,coins:null,totalCoins:null,totalMargin:null,avgEntry:null,tpPrice:null,tpProfit:null,liqPrice:null,healthRatio:null,status:bs?"CANCELLED":"EXCEEDED"})}break}else Ss!==null&&(Gn&&An<=Ss||!Gn&&An>=Ss)?(Rn="STOPPED",Xt=!0):En<1.5?(Rn="WARNING",gr++):er++;const Dn=Gn?(Ir-es)*Vn:(es-Ir)*Vn;pe=ts,st=es,Ft=Ir,ur.push({label:`DCA ${pn}`,deviation:lr,price:An,margin:or,positionValue:_r,coins:wr,totalCoins:Vn,totalMargin:$t,avgEntry:es,tpPrice:Ir,tpProfit:Dn,liqPrice:ts,healthRatio:En,status:Rn})}const yt=[...ur].reverse().find(pn=>pn.status!=="CANCELLED")||ur[ur.length-1];return{orders:ur,metrics:{totalMargin:$t,totalPositionValue:nn,liquidationPrice:yt.liqPrice,breakEvenPrice:yt.avgEntry,safeCount:er,warningCount:gr,budgetOk:!dr,budgetExceededAt:Fs,leverage:wt,requiredBudget:fr}}},[C,R,U,z,ne,Z,fe,ce,Ne,ie,G]),Me=m.useMemo(()=>ke(I),[ke,I]),Ye=m.useMemo(()=>Me.orders.filter(We=>We.status!=="CANCELLED").map(We=>({name:We.label,orderPrice:je&&We.price!=null&&We.price>0?We.price:null,avgEntry:Re&&We.avgEntry!=null&&We.avgEntry>0?We.avgEntry:null,tpPrice:Be&&We.tpPrice!=null&&We.tpPrice>0?We.tpPrice:null,liqPrice:tt&&We.liqPrice!=null&&We.liqPrice>0?We.liqPrice:null,status:We.status})),[Me.orders,je,Re,Be,tt]),Fe=m.useMemo(()=>{const We=[];if(Ye.forEach(gn=>{gn.orderPrice!=null&&We.push(gn.orderPrice),gn.avgEntry!=null&&We.push(gn.avgEntry),gn.tpPrice!=null&&We.push(gn.tpPrice)}),We.length===0)return["auto","auto"];const wt=Math.min(...We),St=Math.max(...We),Kt=(St-wt)*.1;return[Math.max(0,wt-Kt),St+Kt]},[Ye]),rt=We=>{const{cx:wt,cy:St,payload:Kt}=We;return Kt.status==="LIQUIDATED"&&wt&&St?i.jsx("text",{x:wt,y:St,textAnchor:"middle",dominantBaseline:"middle",fontSize:14,children:"💀"}):null},se=We=>{switch(We){case"orderPrice":Ie(!je);break;case"avgEntry":Qe(!Re);break;case"tpPrice":it(!Be);break;case"liqPrice":at(!tt);break}},Ce=We=>{const{payload:wt}=We;return i.jsx("div",{className:"flex flex-wrap justify-center gap-2 sm:gap-4 mt-2",children:wt.map((St,Kt)=>{const gn=St.dataKey==="orderPrice"?je:St.dataKey==="avgEntry"?Re:St.dataKey==="tpPrice"?Be:St.dataKey==="liqPrice"?tt:!0;return i.jsxs("button",{onClick:()=>se(St.dataKey),className:`flex items-center gap-1.5 text-xs px-2 py-1 rounded transition-all ${gn?"opacity-100":"opacity-40"}`,style:{color:St.color},children:[i.jsx("span",{className:"w-3 h-0.5",style:{backgroundColor:St.color}}),St.value]},Kt)})})},{orders:De,metrics:Le}=Me,_e=De.filter(We=>We.status!=="CANCELLED"),nt=m.useMemo(()=>{var pt,Wt;if(!we)return null;const We=ke("long"),wt=ke("short"),St=(pt=We.metrics)==null?void 0:pt.safeCount,Kt=(Wt=wt.metrics)==null?void 0:Wt.safeCount,gn=We.orders.some(Zt=>Zt.status==="LIQUIDATED"),yn=wt.orders.some(Zt=>Zt.status==="LIQUIDATED"),hn=Number.isFinite(St)&&Number.isFinite(Kt)?Math.max(St,Kt):null;let br=!1;return Number.isFinite(St)&&Number.isFinite(Kt)?St>Kt?br=gn:Kt>St?br=yn:br=gn&&yn:br=gn||yn,{safeOrders:hn,hasLiquidation:br}},[ke,we]),ot=m.useMemo(()=>we?!!(nt!=null&&nt.hasLiquidation):_e.some(We=>We.status==="LIQUIDATED"),[we,_e,nt==null?void 0:nt.hasLiquidation]),gt=m.useMemo(()=>{if(!ot)return null;const We=we?nt==null?void 0:nt.safeOrders:Le==null?void 0:Le.safeCount,wt=Number.isFinite(We)?We:0,St=parseInt(ne)||0;return`Liquidation occurs before completing all DCA orders. Safe orders: ${wt} of ${St}. Reduce leverage, widen spacing, or lower max DCA orders.`},[ot,we,nt==null?void 0:nt.safeOrders,Le==null?void 0:Le.safeCount,ne]),Jt=m.useMemo(()=>{const We=we?nt==null?void 0:nt.safeOrders:Le==null?void 0:Le.safeCount,wt=parseInt(ne);return!Number.isFinite(We)||!Number.isFinite(wt)?null:wt>We?`Only ${We} of ${wt} DCA orders are currently safe. Increase budget, reduce leverage, or lower Max DCA Orders.`:null},[we,nt==null?void 0:nt.safeOrders,Le==null?void 0:Le.safeCount,ne]),Ge=({variant:We="desktop"})=>{const wt=We==="desktop"?"px-4 py-5":"p-3";return i.jsxs("div",{className:`${wt} space-y-3`,children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full bg-[#a78bfa]/15 text-[#d7c8ff]",children:i.jsx(pNe,{className:"w-4 h-4"})}),i.jsxs("div",{children:[i.jsx("div",{className:"text-sm font-semibold text-white",children:"Smart Direction Mode"}),i.jsx("p",{className:"text-[12px] text-[#9b9b9b]",children:"When Smart mode is enabled, the bot checks the Extended 24h price change before each trade:"})]})]}),i.jsx("div",{className:"rounded-lg border border-[#1c2a24] bg-[#0b1511] p-4 space-y-3",children:i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(mNe,{className:"w-5 h-5 text-[#67FFBD] mt-0.5"}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-sm font-semibold text-white",children:"How it works"}),i.jsxs("div",{className:"space-y-2 text-sm text-[#cfd4db]",children:[i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(hNe,{className:"w-4 h-4 mt-0.5 text-[#67FFBD]"}),i.jsx("span",{children:"If 24h change is positive (+%) → Opens a Long position."})]}),i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(hyn,{className:"w-4 h-4 mt-0.5 text-[#ff7073]"}),i.jsxs("span",{children:[" ","If 24h change is negative (-%) → Opens a Short position."]})]}),i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(mNe,{className:"w-4 h-4 mt-0.5 text-[#a78bfa]"}),i.jsx("span",{children:"Order details and calculations are not available in Smart mode since the direction is dynamic."})]})]})]})]})}),i.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-[#1c2a24] bg-[#111] p-3",children:[i.jsx(pyn,{className:"w-5 h-5 text-[#facc15] mt-0.5"}),i.jsxs("p",{className:"text-[13px] text-[#e5e7eb]",children:[i.jsx("span",{className:"font-semibold text-white",children:"Tip:"})," To preview the DCA order table for Long or Short scenarios, switch the Direction selector to the desired mode."]})]})]})};return i.jsx("div",{className:"text-white",style:{fontFamily:"Manrope, sans-serif"},children:i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-5",children:[i.jsxs("div",{className:"lg:col-span-1 space-y-4",children:[i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] p-4",children:[i.jsxs("h3",{className:"text-sm font-semibold mb-4 text-[#d7ffe9] flex items-center gap-2",children:[i.jsx("span",{className:"w-5 h-5 rounded-full bg-[#67FFBD]/20 text-[#67FFBD] flex items-center justify-center text-xs",children:"1"}),"Market & Coin"]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsx("div",{className:"col-span-2",children:i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs text-[#9b9b9b] flex items-center",children:["Market",i.jsx(Nh,{content:"Extended is temporarily the only available market.",children:"?"})]}),i.jsx(myn,{value:x,onChange:g})]})}),i.jsx("div",{className:"col-span-2",children:i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs text-[#9b9b9b] flex items-center",children:[s==="extended"?"Extended Wallet":"Lighter Wallet",i.jsx(Nh,{content:"Select the wallet to use for this DCA bot. The bot will execute trades using this wallet.",children:"?"})]}),Oe?Pt?i.jsx("div",{className:"w-full px-3 py-2 rounded-lg bg-[#161616] border border-[#1c2a24] text-white text-sm flex items-center justify-center",children:i.jsxs("svg",{className:"animate-spin h-4 w-4 text-[#67FFBD]",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}):i.jsx(bT,{wallets:un,value:Vt&&Vt.id?String(Vt.id):"",onChange:We=>{const wt=un.find(St=>String(St.wallet_id)===String(We));wt&&(Yt({id:wt.wallet_id,address:wt.wallet_address,apiKey:wt.wallet_api_key}),typeof window<"u"&&window.localStorage.setItem(It,String(wt.wallet_id)))},selectedBalance:Kn,mode:s}):i.jsx("div",{className:"w-full",children:i.jsx(Zm,{onClick:()=>Qn(!0)})})]})}),i.jsx("div",{className:"col-span-2",children:i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs text-[#9b9b9b] flex items-center",children:["Coin",i.jsx(Nh,{content:"Select the trading pair. Price and max leverage will update automatically.",children:"?"})]}),i.jsxs("div",{className:"relative rounded-lg border border-[#1c2a24] bg-[#161616] px-2 py-1.5 flex items-center gap-2 h-8",children:[i.jsx("img",{src:`${yyn}/${qn||"BTC"}.svg`,alt:v||"coin",className:"w-6 h-6 rounded-full bg-[#161616] border border-[#1c2a24]",loading:"lazy",onError:We=>sm(We)}),i.jsx("div",{className:"flex-1 min-w-0",children:i.jsx(gue,{markets:kn,value:v,onChange:te,loading:xe,showIcon:!0})})]})]})})]})]}),i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] p-4",children:[i.jsxs("h3",{className:"text-sm font-semibold mb-4 text-[#d7ffe9] flex items-center gap-2",children:[i.jsx("span",{className:"w-5 h-5 rounded-full bg-[#67FFBD]/20 text-[#67FFBD] flex items-center justify-center text-xs",children:"2"}),"Position Setup"]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{className:"col-span-2 space-y-1.5",children:[i.jsxs("label",{className:"text-xs text-[#9b9b9b] flex items-center",children:["Direction",i.jsx(Nh,{content:"Long: Profit when price rises. Short: Profit when price falls.",children:"?"})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[i.jsx("button",{type:"button",onClick:()=>P("short"),className:`py-2 px-3 rounded-lg text-sm font-medium transition-all border flex items-center justify-center gap-1 ${I==="short"?"bg-[#ff7073]/20 border-[#ff7073] text-[#ff7073]":"bg-[#161616] border-[#1c2a24] text-[#6e857d] hover:border-[#ff7073]/50"}`,children:"Short"}),i.jsx("button",{type:"button",onClick:()=>P("long"),className:`py-2 px-3 rounded-lg text-sm font-medium transition-all border flex items-center justify-center gap-1 ${I==="long"?"bg-[#67FFBD]/20 border-[#67FFBD] text-[#67FFBD]":"bg-[#161616] border-[#1c2a24] text-[#6e857d] hover:border-[#67FFBD]/50"}`,children:"Long"}),i.jsxs("button",{type:"button",onClick:()=>P("smart"),className:`py-2 px-3 rounded-lg text-sm font-medium transition-all border flex items-center justify-center gap-1 ${I==="smart"?"bg-[#a78bfa]/20 border-[#a78bfa] text-[#d7c8ff]":"bg-[#161616] border-[#1c2a24] text-[#7f7b9f] hover:border-[#a78bfa]/50"}`,children:[i.jsx(pNe,{className:"w-4 h-4"}),"Smart"]})]})]}),i.jsx("div",{className:"col-span-2",children:i.jsx(Ayn,{value:R,onChange:F,min:1,max:c,tooltip:`Position multiplier. 10x leverage means $100 margin controls $1,000 position. Max leverage for ${v}: ${c}x`})})]})]}),i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] p-4",children:[i.jsxs("h3",{className:"text-sm font-semibold mb-4 text-[#d7ffe9] flex items-center gap-2",children:[i.jsx("span",{className:"w-5 h-5 rounded-full bg-[#67FFBD]/20 text-[#67FFBD] flex items-center justify-center text-xs",children:"3"}),"Order Sizing"]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsx(Qx,{label:"Base Order Margin",value:U,onChange:L,step:"1",min:"1",suffix:"$",tooltip:"Initial margin for the first position opened at Entry Price.",validate:(We,wt)=>!wt||isNaN(We)?"Required":We<1?"Must be at least 1":s==="extended"&&Yn!=null&&We*Lt<Yn?T("Base Order Margin"):null}),i.jsx(Qx,{label:"DCA Order Margin",value:z,onChange:X,step:"1",min:"1",suffix:"$",tooltip:"Starting margin for DCA orders.",validate:(We,wt)=>!wt||isNaN(We)?"Required":We<1?"Must be at least 1":s==="extended"&&Yn!=null&&We*Lt<Yn?T("DCA Order Margin"):null}),i.jsx(Qx,{label:"Max DCA Orders",value:ne,onChange:J,step:"1",max:"50",tooltip:"Maximum number of DCA orders to place after the Base Order.",validate:(We,wt)=>!wt||isNaN(We)?"Required":We<1?"Minimum 1":We>50?"Maximum 50":null,forceError:ot||!!Jt,forceErrorMessage:gt||Jt}),i.jsx(Qx,{label:"Available to Trade",value:Kn!=null?String(Kn):"",onChange:()=>{},step:"100",suffix:"$",readOnly:!0,tooltip:"Wallet balance available for trading. Read only."})]})]}),i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] p-4",children:[i.jsxs("h3",{className:"text-sm font-semibold mb-4 text-[#d7ffe9] flex items-center gap-2",children:[i.jsx("span",{className:"w-5 h-5 rounded-full bg-[#67FFBD]/20 text-[#67FFBD] flex items-center justify-center text-xs",children:"4"}),"Exit Strategy"]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsx(Qx,{label:"Take Profit",value:ie,onChange:oe,step:"0.1",suffix:"%",tooltip:"Target profit % calculated from the weighted average entry price."}),i.jsx(Qx,{label:"Stop Loss",value:G,onChange:V,step:"1",suffix:"%",tooltip:"Maximum loss % from average entry before position closes. Leave empty to disable stop loss and rely only on liquidation"})]})]}),i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] overflow-hidden",children:[i.jsxs("button",{onClick:()=>ae(!ee),className:"w-full flex items-center justify-between p-4 hover:bg-[#111] transition-colors",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm font-semibold text-[#d7ffe9]",children:"Advanced Settings"}),i.jsxs("span",{className:"text-xs text-[#666]",children:["Dev: ",fe,"% • Dev Mult: ",Ne,"x • Size: ",ce,"x"]})]}),ee?i.jsx(Ban,{className:"w-4 h-4 text-[#67FFBD]"}):i.jsx(Oan,{className:"w-4 h-4 text-[#67FFBD]"})]}),i.jsx(mT,{children:ee&&i.jsx(go.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},children:i.jsxs("div",{className:"px-4 pb-4 grid grid-cols-2 gap-3 border-t border-[#1c2a24] pt-3",children:[i.jsx(Qx,{label:"Price Deviation",value:fe,onChange:Ae,step:"0.1",suffix:"%",tooltip:"Initial price change % from Entry Price to trigger DCA."}),i.jsx(Qx,{label:"DCA Order Size Multiplier",value:ce,onChange:ye,step:"0.1",suffix:"x",tooltip:"Multiplier for each DCA order's margin."}),i.jsx(Qx,{label:"Price Deviation Multiplier",value:Ne,onChange:be,step:"0.05",suffix:"x",tooltip:"Multiplier for price gaps between DCA orders."})]})})})]}),(()=>{const We=C&&!isNaN(parseFloat(C))&&parseFloat(C)>0,wt=U&&!isNaN(parseFloat(U))&&parseFloat(U)>=1,St=z&&!isNaN(parseFloat(z))&&parseFloat(z)>=1,Kt=ne&&!isNaN(parseInt(ne))&&parseInt(ne)>=1,gn=Z&&!isNaN(parseFloat(Z))&&parseFloat(Z)>0,yn=We&&wt&&St&&Kt&&gn,hn=k,br=Ot=>{const wn=parseFloat(C)||0,Gn=parseFloat(U)||0,fr=parseFloat(z)||0,ur=parseInt(ne)||0,$t=parseFloat(Z)||1/0,nn=parseFloat(ce)||1.1;if(wn<=0||Gn<=0)return null;let Vn=Gn,lr=0,er=Vn>$t;er||(lr+=1);for(let dr=1;dr<=ur;dr++){const Fs=fr*Math.pow(nn,dr-1);Vn+=Fs,!er&&Vn>$t&&(er=!0),er||(lr+=1)}return{budgetOk:Vn<=$t,safeCount:lr}},pt=we?{long:br(),short:br()}:null,Wt=we&&(pt==null?void 0:pt.long)&&(pt==null?void 0:pt.short)&&pt.long.budgetOk&&pt.short.budgetOk&&pt.long.safeCount>0&&pt.short.safeCount>0&&!hn,Zt=we?yn&&Wt:yn&&Le&&Le.budgetOk&&Le.safeCount>0&&!hn;let vt=null;if(!yn)vt="Please fill in all required fields";else if(hn&&Yn!=null){const Ot=[];S&&Ot.push("Base Order"),_&&Ot.push("DCA Order");const wn=Ot.length===1?` (${Ot[0]})`:Ot.length===2?" (Base Order & DCA Order)":"";vt=`Minimum order size for ${String(v||"").toUpperCase()} is $${Yn.toFixed(2)}${wn}. Increase order size or leverage.`}else!we&&Le&&!Le.budgetOk?vt="Budget exceeded - increase budget or reduce orders":!we&&Le&&Le.safeCount===0?vt="No safe orders - reduce leverage or increase budget":we&&(!(pt!=null&&pt.long)||!(pt!=null&&pt.short)||!pt.long.budgetOk||!pt.short.budgetOk)?vt="Budget exceeded in Smart mode - adjust margin or orders":we&&(pt!=null&&pt.long)&&(pt!=null&&pt.short)&&(pt.long.safeCount===0||pt.short.safeCount===0)&&(vt="No safe orders in Smart mode - reduce leverage or increase budget");return i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] p-4",children:[(()=>{const Ot=(nr==null?void 0:nr.id)||(nr==null?void 0:nr.bot_id),wn=Ot&&ft[Ot]===!0,Gn=Ot&&Dt[Ot]===!0,fr=!!nr,ur=fr?wn||Gn:!Zt||Ve||!Vt||!Vt.id,$t=()=>{fr&&Ot?an(Ot,!0):Bt()};return i.jsx("button",{onClick:$t,disabled:ur,className:`w-full py-2.5 rounded-lg text-sm font-semibold transition-all flex items-center justify-center gap-2 ${fr?"bg-[#ff7073] text-black hover:bg-[#ff8a8d]":Zt&&Vt&&Vt.id&&!Ve?"bg-[#67FFBD] text-[#101010] hover:bg-[#9FFFDA]":"bg-[#333] text-[#666] cursor-not-allowed"} disabled:opacity-60 disabled:cursor-not-allowed`,children:fr?wn?i.jsxs(i.Fragment,{children:[i.jsxs("svg",{className:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Stopping..."]}):i.jsxs(i.Fragment,{children:[i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Stop DCA Bot"]}):Ve?i.jsxs(i.Fragment,{children:[i.jsxs("svg",{className:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Starting..."]}):i.jsxs(i.Fragment,{children:[i.jsxs("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]}),"Start DCA Bot"]})})})(),vt&&i.jsx("p",{className:"text-xs text-[#ff7073] text-center mt-2",children:vt}),(!Vt||!Vt.id)&&i.jsx("p",{className:"text-xs text-[#ff7073] text-center mt-2",children:"Please select a Extended wallet first"}),i.jsx("p",{className:"text-xs text-[#555] text-center mt-2",children:"Bot will execute orders on Extended exchange"})]})})(),i.jsx("div",{className:"h-4"})]}),i.jsxs("div",{className:"lg:col-span-2 space-y-4 pb-6",children:[i.jsx("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] p-4 mb-4",children:i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-lg bg-[#0b1511] border border-[#1e2e27] flex items-center justify-center",children:i.jsx(hNe,{className:"w-5 h-5 text-[#67FFBD]"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-base font-semibold text-[#d7ffe9]",children:"DCA Bot and Calculator"}),i.jsx("p",{className:"text-xs text-[#666] mt-1",children:"Plan your strategy and start DCAing"}),i.jsx("div",{className:"flex items-center mt-1 text-sm text-[#67FFBD]",children:i.jsxs("a",{href:"https://docs.dextrabot.com/dca-bot/extended-dca-bot",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 rounded-lg bg-[#101010]/70 hover:bg-[#111] transition-colors",children:[i.jsx("span",{className:"text-xs text-white",children:"New to DCA? Learn how it works"}),i.jsx("span",{children:"📚"})]})})]})]}),Le&&i.jsxs("div",{className:"flex flex-wrap gap-4 sm:gap-6",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"text-xs text-[#888] flex items-center mb-1",children:["Total Margin",i.jsx(Nh,{content:"Total margin required for Base Order + all DCA orders",children:"?"})]}),i.jsxs("div",{className:"text-lg sm:text-xl font-bold text-white",children:["$",Co(Le.totalMargin)]})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"text-xs text-[#888] flex items-center mb-1",children:["Position Value",i.jsx(Nh,{content:"Combined notional value of all positions. Total Margin × Leverage",children:"?"})]}),i.jsxs("div",{className:"text-lg sm:text-xl font-bold text-white",children:["$",Co(Le.totalPositionValue)]}),i.jsxs("div",{className:"text-xs text-[#555]",children:[Le.leverage,"x leverage"]})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"text-xs text-[#888] flex items-center mb-1",children:["Safe Orders",i.jsx(Nh,{content:"DCA orders that can be executed safely.",children:"?"})]}),i.jsxs("div",{className:"text-lg sm:text-xl font-bold",style:{color:Nb},children:[Le.safeCount,"/",parseInt(ne)||0]})]})]})]})}),!we&&i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] p-4",children:[i.jsx("h3",{className:"text-sm font-semibold text-[#d7ffe9] mb-3",children:"Price Chart"}),i.jsx("div",{className:"h-[280px] sm:h-[320px]",children:i.jsx(sBe,{width:"100%",height:"100%",children:i.jsxs(orn,{data:Ye.length>0?Ye:[{name:"No Data",orderPrice:null,avgEntry:null,tpPrice:null,liqPrice:null}],margin:{top:10,right:20,left:10,bottom:5},children:[i.jsx(X$e,{strokeDasharray:"3 3",stroke:"#1c2a24"}),i.jsx(n8,{dataKey:"name",stroke:"#666",fontSize:10,interval:0,angle:Ye.length>6?-45:0,textAnchor:Ye.length>6?"end":"middle",height:Ye.length>6?50:30,tickFormatter:We=>We==="Base"?"B":We.startsWith("DCA")?`D${We.split(" ")[1]}`:We.includes("Liq")?"💀":We}),i.jsx(r8,{stroke:"#666",fontSize:10,tickFormatter:We=>`$${Co(We)}`,domain:Fe,allowDataOverflow:!0}),i.jsx(zp,{contentStyle:{backgroundColor:"#101010",border:"1px solid #333",borderRadius:"6px",fontSize:"11px"},formatter:(We,wt)=>[gb(We),wt],labelFormatter:We=>We==="B"?"Base Order":We.startsWith("D")?`DCA ${We.slice(1)}`:We}),i.jsx(n3,{content:Ce}),i.jsx(A0,{type:"monotone",dataKey:"orderPrice",name:"Order Price",stroke:Nb,strokeWidth:2,dot:{fill:Nb,r:3},connectNulls:!0}),i.jsx(A0,{type:"monotone",dataKey:"avgEntry",name:"Avg Entry",stroke:hF,strokeWidth:2,dot:{fill:hF,r:2},connectNulls:!0}),i.jsx(A0,{type:"monotone",dataKey:"tpPrice",name:"TP",stroke:xNe,strokeWidth:1.5,strokeDasharray:"4 4",dot:!1,connectNulls:!0}),i.jsx(A0,{type:"monotone",dataKey:"liqPrice",name:"Liq",stroke:PO,strokeWidth:1.5,strokeDasharray:"4 4",dot:rt,connectNulls:!0})]})})}),i.jsxs("div",{className:"text-xs text-[#555] text-center mt-2",children:["B = Base Order • D1-D",ne," = DCA Orders • 💀 = Liquidation Point"]})]}),i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] overflow-hidden hidden md:block",children:[i.jsxs("div",{className:"flex border-b border-[#1c2a24]",children:[i.jsx("button",{onClick:()=>ct("details"),className:`flex-1 px-4 py-3 text-sm font-medium transition-colors relative first:rounded-tl-xl last:rounded-tr-xl border ${dt==="details"?"text-[#67FFBD] bg-[#0b1511] border-[#67FFBD] shadow-[0_0_0_1px_rgba(103,255,189,0.35)]":"text-[#888] hover:text-white hover:bg-[#111] border-transparent"}`,children:"Order Details"}),i.jsx("button",{onClick:()=>ct("bots"),className:`flex-1 px-4 py-3 text-sm font-medium transition-colors relative first:rounded-tl-xl last:rounded-tr-xl border ${dt==="bots"?"text-[#67FFBD] bg-[#0b1511] border-[#67FFBD] shadow-[0_0_0_1px_rgba(103,255,189,0.35)]":"text-[#888] hover:text-white hover:bg-[#111] border-transparent"}`,children:"DCA Bots"})]}),dt==="details"&&(we?i.jsx(Ge,{variant:"desktop"}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"px-4 py-3",children:i.jsx(bNe,{entryPrice:C,onEntryPriceChange:de,maxBudget:Z,onBudgetChange:ue})}),i.jsxs("div",{className:"overflow-x-auto",children:[i.jsxs("table",{className:"w-full text-xs",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-[#161616] text-[#888]",children:[i.jsx("th",{className:"px-3 py-2 text-left",children:"#"}),i.jsx("th",{className:"px-3 py-2 text-right",children:"Dev %"}),i.jsx("th",{className:"px-3 py-2 text-right",children:"Price"}),i.jsx("th",{className:"px-3 py-2 text-right hidden lg:table-cell",children:"Margin"}),i.jsx("th",{className:"px-3 py-2 text-right hidden xl:table-cell",children:"Pos. Value"}),i.jsxs("th",{className:"px-3 py-2 text-right",children:["Size (",v,")"]}),i.jsx("th",{className:"px-3 py-2 text-right hidden lg:table-cell",children:"Total Margin"}),i.jsx("th",{className:"px-3 py-2 text-right",children:"Avg Entry"}),i.jsx("th",{className:"px-3 py-2 text-right hidden lg:table-cell",children:"TP"}),i.jsx("th",{className:"px-3 py-2 text-right",children:i.jsxs("span",{className:"flex items-center justify-end gap-1",children:["TP Profit",i.jsx(Nh,{content:"Profit if price reaches Take Profit level after this order executes.",children:i.jsx("span",{className:"text-[#666]",children:"?"})})]})}),i.jsx("th",{className:"px-3 py-2 text-right",children:"Liq"}),i.jsx("th",{className:"px-3 py-2 text-center",children:"Status"})]})}),i.jsx("tbody",{children:_e.map((We,wt)=>{const St=gNe[We.status];if(We.status==="EXCEEDED"){const Kt=We.isLong?"Price would drop below $0 (impossible). Reduce deviation multiplier or fewer DCA orders.":"Price deviation exceeds 100%. Reduce deviation multiplier or fewer DCA orders.";return i.jsx("tr",{className:"border-t border-[#1c2a24] bg-[#1a1a1a]",children:i.jsx("td",{colSpan:12,className:"px-3 py-3",children:i.jsxs("div",{className:"flex items-center gap-2 text-[#6B7280]",children:[i.jsx("span",{children:St.icon}),i.jsxs("span",{className:"text-sm",children:[i.jsx("span",{className:"font-medium",children:We.label})," ","— ",Kt]})]})})},wt)}return i.jsxs("tr",{className:"border-t border-[#1c2a24] hover:bg-[#111]",children:[i.jsx("td",{className:"px-3 py-2 font-medium whitespace-nowrap",children:We.label}),i.jsx("td",{className:"px-3 py-2 text-right",children:We.deviation!=null?wyn(We.deviation):"-"}),i.jsx("td",{className:"px-3 py-2 text-right",children:gb(We.price)}),i.jsx("td",{className:"px-3 py-2 text-right hidden lg:table-cell",children:We.margin!=null?`$${Co(We.margin)}`:"-"}),i.jsx("td",{className:"px-3 py-2 text-right hidden xl:table-cell",children:We.positionValue!=null?`$${Co(We.positionValue)}`:"-"}),i.jsx("td",{className:"px-3 py-2 text-right",children:We.coins!=null?Co(We.coins,4):"-"}),i.jsx("td",{className:"px-3 py-2 text-right hidden lg:table-cell",children:We.totalMargin!=null?`$${Co(We.totalMargin)}`:"-"}),i.jsx("td",{className:"px-3 py-2 text-right",style:{color:hF},children:gb(We.avgEntry)}),i.jsx("td",{className:"px-3 py-2 text-right hidden lg:table-cell",style:{color:xNe},children:gb(We.tpPrice)}),i.jsx("td",{className:"px-3 py-2 text-right",style:{color:Nb},children:We.tpProfit!=null?`$${Co(We.tpProfit)}`:"-"}),i.jsx("td",{className:"px-3 py-2 text-right",style:{color:We.liqPrice<=0?Nb:PO},children:gb(We.liqPrice,!0)}),i.jsx("td",{className:"px-3 py-2 text-center",children:i.jsx(Nh,{content:St.tooltip,children:i.jsx("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium cursor-help",style:{backgroundColor:`${St.color}15`,color:St.color},children:St.icon})})})]},wt)})})]}),_e.length===0&&i.jsxs("div",{className:"p-8 text-center text-[#666] text-sm",children:[i.jsx("p",{children:"No orders to display"}),i.jsx("p",{className:"text-xs text-[#555] mt-1",children:"Enter entry price and base order margin to see order details"})]})]})]})),dt==="bots"&&i.jsx("div",{className:"p-4",children:tn?i.jsxs("div",{className:"text-center py-8",children:[i.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-[#0b1511] border border-[#1c2a24] flex items-center justify-center",children:i.jsxs("svg",{className:"animate-spin h-8 w-8 text-[#67FFBD]",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),i.jsx("p",{className:"text-sm text-[#666]",children:"Loading bots..."})]}):tr.length===0?i.jsxs("div",{className:"text-center py-8",children:[i.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-[#0b1511] border border-[#1c2a24] flex items-center justify-center",children:i.jsx("svg",{className:"w-8 h-8 text-[#67FFBD]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),i.jsx("h4",{className:"text-sm font-medium text-[#d7ffe9] mb-2",children:"No Active DCA Bots"}),i.jsx("p",{className:"text-xs text-[#666] mb-4",children:'Configure your DCA strategy and click "Start Bot" to create your first bot.'}),i.jsx("p",{className:"text-xs text-[#555]",children:"Your active bots will appear here."})]}):i.jsx("div",{className:"space-y-3 max-h-[845px] overflow-y-auto pr-1",children:tr.map(We=>{const wt=!We.is_deleted,St=We.bot_params||{},Kt=We.created_at?new Date(We.created_at):null,gn=Kt?(()=>{const vt=Date.now()-Kt.getTime(),Ot=Math.floor(vt/(1e3*60*60)),wn=Math.floor(Ot/24);return wn>0?`${wn}d ago`:Ot>0?`${Ot}h ago`:`${Math.floor(vt/(1e3*60))}m ago`})():null,yn=St.direction==="long"?"Long":St.direction==="short"?"Short":"Smart",hn=St.price_deviation??St.priceDeviation??0,br=St.step_scale??St.price_dev_multiplier??St.priceDevMultiplier??0,pt=St.volume_scale??St.dca_size_multiplier??St.dcaSizeMultiplier??0,Wt=St.tp_percent??St.tp_target??St.take_profit_percent??0,Zt=St.stop_loss_percent??St.stop_loss??0;return St.market_index??St.marketIndex,St.coin_idx??St.coinIndex,i.jsxs("div",{className:"bg-[#111] rounded-lg p-4 border border-[#1c2a24]",children:[i.jsxs("div",{className:"flex justify-between items-start mb-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:"text-sm font-medium",children:[We.coin||v," DCA Bot"]}),wt?i.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-[#67FFBD]/20 text-[#67FFBD]",children:"Active"}):i.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-[#666]/20 text-[#666]",children:"Stopped"})]}),gn&&i.jsx("span",{className:"text-[11px] text-[#7c7c7c]",children:gn})]}),i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-2 text-xs mb-3",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Direction:"}),i.jsx("span",{className:`ml-1 ${St.direction==="long"?"text-[#67FFBD]":St.direction==="short"?"text-[#ff7073]":"text-[#A78BFA]"}`,children:yn})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Leverage:"}),i.jsxs("span",{className:"ml-1 text-white",children:[St.leverage||0,"x"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Base Order Margin:"}),i.jsxs("span",{className:"ml-1 text-white",children:["$",Co(St.base_amount_usd||St.base_order_margin||0)]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"DCA Order Margin:"}),i.jsxs("span",{className:"ml-1 text-white",children:["$",Co(St.safety_amount_usd||St.dca_order_margin||0)]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Max DCA Orders:"}),i.jsx("span",{className:"ml-1 text-white",children:St.max_safety_orders||St.max_dca_orders||0})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Price Deviation:"}),i.jsxs("span",{className:"ml-1 text-white",children:[Co(hn),"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Price Deviation Multiplier:"}),i.jsxs("span",{className:"ml-1 text-white",children:[Co(br),"x"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"DCA Order Size Multiplier:"}),i.jsxs("span",{className:"ml-1 text-white",children:[Co(pt),"x"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Take Profit:"}),i.jsxs("span",{className:"ml-1 text-[#67FFBD]",children:[Co(Wt),"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Stop Loss:"}),i.jsxs("span",{className:"ml-1 text-[#ff7073]",children:[Co(Zt),"%"]})]}),gn&&i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Created:"}),i.jsx("span",{className:"ml-1 text-white",children:gn})]})]}),i.jsx("div",{className:"mt-4",children:i.jsx("button",{onClick:()=>an(We.id||We.bot_id,wt),disabled:ft[We.id||We.bot_id]||Dt[We.id||We.bot_id],className:`w-full py-2 rounded-lg text-sm font-semibold transition-colors ${wt?"bg-[#ff7073] text-black hover:bg-[#ff8a8d]":"bg-[#67FFBD] text-black hover:bg-[#8bffd0]"} disabled:opacity-60 disabled:cursor-not-allowed`,children:ft[We.id||We.bot_id]?wt?"Stopping...":"Starting...":wt?"Stop Bot":"Start Bot"})})]},We.id||We.bot_id)})})})]}),i.jsx("div",{className:"md:hidden space-y-2",children:i.jsxs("div",{className:"bg-[#101010] rounded-xl border border-[#1c2a24] overflow-hidden",children:[i.jsxs("div",{className:"flex border-b border-[#1c2a24]",children:[i.jsx("button",{onClick:()=>ct("details"),className:`flex-1 px-3 py-2 text-xs font-medium transition-colors relative first:rounded-tl-xl last:rounded-tr-xl border ${dt==="details"?"text-[#67FFBD] bg-[#0b1511] border-[#67FFBD] shadow-[0_0_0_1px_rgba(103,255,189,0.35)]":"text-[#888] hover:text-white border-transparent"}`,children:"Order Details"}),i.jsx("button",{onClick:()=>ct("bots"),className:`flex-1 px-3 py-2 text-xs font-medium transition-colors relative first:rounded-tl-xl last:rounded-tr-xl border ${dt==="bots"?"text-[#67FFBD] bg-[#0b1511] border-[#67FFBD] shadow-[0_0_0_1px_rgba(103,255,189,0.35)]":"text-[#888] hover:text-white border-transparent"}`,children:"DCA Bots"})]}),dt==="details"&&(we?i.jsx(Ge,{variant:"mobile"}):i.jsxs("div",{className:"p-3 space-y-2",children:[i.jsx(bNe,{className:"w-full",entryPrice:C,onEntryPriceChange:de,maxBudget:Z,onBudgetChange:ue}),_e.map((We,wt)=>{const St=gNe[We.status];if(We.status==="EXCEEDED"){const Kt=We.isLong?"Price would drop below $0":"Price deviation exceeds 100%";return i.jsx("div",{className:"bg-[#1a1a1a] rounded-lg p-3 border border-[#333]",children:i.jsxs("div",{className:"flex items-center gap-2 text-[#6B7280]",children:[i.jsx("span",{children:St.icon}),i.jsxs("span",{className:"text-sm",children:[i.jsx("span",{className:"font-medium",children:We.label})," ","— ",Kt]})]})},wt)}return i.jsxs("div",{className:"bg-[#111] rounded-lg p-3 border border-[#1c2a24]",children:[i.jsxs("div",{className:"flex justify-between items-center mb-2",children:[i.jsx("span",{className:"font-medium text-sm",children:We.label}),i.jsx(Nh,{content:St.tooltip,children:i.jsx("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium cursor-help",style:{backgroundColor:`${St.color}15`,color:St.color},children:St.icon})})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs",children:[i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-[#666]",children:"Price:"}),i.jsx("span",{children:gb(We.price)})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-[#666]",children:"Size:"}),i.jsx("span",{children:We.coins!=null?`${Co(We.coins,4)} ${v}`:"-"})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-[#666]",children:"Avg Entry:"}),i.jsx("span",{style:{color:hF},children:gb(We.avgEntry)})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-[#666]",children:"Liq:"}),i.jsx("span",{style:{color:We.liqPrice<=0?Nb:PO},children:gb(We.liqPrice,!0)})]}),i.jsxs("div",{className:"flex justify-between col-span-2 pt-1 border-t border-[#1c2a24] mt-1",children:[i.jsx("span",{className:"text-[#666]",children:"TP Profit:"}),i.jsx("span",{style:{color:Nb},className:"font-medium",children:We.tpProfit!=null?`$${Co(We.tpProfit)}`:"-"})]})]})]},wt)})]})),dt==="bots"&&i.jsx("div",{className:"p-3",children:tn?i.jsxs("div",{className:"text-center py-6",children:[i.jsx("div",{className:"w-12 h-12 mx-auto mb-3 rounded-full bg-[#0b1511] border border-[#1c2a24] flex items-center justify-center",children:i.jsxs("svg",{className:"animate-spin h-6 w-6 text-[#67FFBD]",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),i.jsx("p",{className:"text-[10px] text-[#666]",children:"Loading bots..."})]}):tr.length===0?i.jsxs("div",{className:"text-center py-6",children:[i.jsx("div",{className:"w-12 h-12 mx-auto mb-3 rounded-full bg-[#0b1511] border border-[#1c2a24] flex items-center justify-center",children:i.jsx("svg",{className:"w-6 h-6 text-[#67FFBD]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),i.jsx("h4",{className:"text-xs font-medium text-[#d7ffe9] mb-1",children:"No Active DCA Bots"}),i.jsx("p",{className:"text-[10px] text-[#666]",children:"Your bots will appear here."})]}):i.jsx("div",{className:"space-y-2 max-h-[360px] overflow-y-auto pr-1",children:tr.map(We=>{const wt=!We.is_deleted,St=We.bot_params||{},Kt=We.created_at?new Date(We.created_at):null,gn=Kt?(()=>{const wn=Date.now()-Kt.getTime(),Gn=Math.floor(wn/(1e3*60*60)),fr=Math.floor(Gn/24);return fr>0?`${fr}d ago`:Gn>0?`${Gn}h ago`:`${Math.floor(wn/(1e3*60))}m ago`})():null,yn=St.direction==="long"?"Long":St.direction==="short"?"Short":"Smart",hn=St.price_deviation??St.priceDeviation??0,br=St.step_scale??St.price_dev_multiplier??St.priceDevMultiplier??0,pt=St.volume_scale??St.dca_size_multiplier??St.dcaSizeMultiplier??0,Wt=St.tp_percent??St.tp_target??St.take_profit_percent??0,Zt=St.stop_loss_percent??St.stop_loss??0,vt=St.market_index??St.marketIndex,Ot=St.coin_idx??St.coinIndex;return i.jsxs("div",{className:"bg-[#111] rounded-lg p-3 border border-[#1c2a24]",children:[i.jsxs("div",{className:"flex justify-between items-start mb-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:"text-xs font-medium",children:[We.coin||v," DCA"]}),wt?i.jsx("span",{className:"px-1.5 py-0.5 text-[10px] rounded bg-[#67FFBD]/20 text-[#67FFBD]",children:"Active"}):i.jsx("span",{className:"px-1.5 py-0.5 text-[10px] rounded bg-[#666]/20 text-[#666]",children:"Stopped"})]}),gn&&i.jsx("span",{className:"text-[10px] text-[#7c7c7c]",children:gn})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-x-3 gap-y-1 text-[10px]",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Direction:"}),i.jsx("span",{className:`ml-1 ${St.direction==="long"?"text-[#67FFBD]":St.direction==="short"?"text-[#ff7073]":"text-[#A78BFA]"}`,children:yn})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Leverage:"}),i.jsxs("span",{className:"ml-1 text-white",children:[St.leverage||0,"x"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Base Order Margin:"}),i.jsxs("span",{className:"ml-1 text-white",children:["$",Co(St.base_amount_usd||St.base_order_margin||0)]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"DCA Order Margin:"}),i.jsxs("span",{className:"ml-1 text-white",children:["$",Co(St.safety_amount_usd||St.dca_order_margin||0)]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Max DCA Orders:"}),i.jsx("span",{className:"ml-1 text-white",children:St.max_safety_orders||St.max_dca_orders||0})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Price Deviation:"}),i.jsxs("span",{className:"ml-1 text-white",children:[Co(hn),"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Price Deviation Multiplier:"}),i.jsxs("span",{className:"ml-1 text-white",children:[Co(br),"x"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"DCA Order Size Multiplier:"}),i.jsxs("span",{className:"ml-1 text-white",children:[Co(pt),"x"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"TP:"}),i.jsxs("span",{className:"ml-1 text-[#67FFBD]",children:[Co(Wt),"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"SL:"}),i.jsxs("span",{className:"ml-1 text-[#ff7073]",children:[Co(Zt),"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Market:"}),i.jsx("span",{className:"ml-1 text-white",children:vt??"-"})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Coin Idx:"}),i.jsx("span",{className:"ml-1 text-white",children:Ot??"-"})]}),gn&&i.jsxs("div",{children:[i.jsx("span",{className:"text-[#666]",children:"Created:"}),i.jsx("span",{className:"ml-1 text-white",children:gn})]})]}),i.jsx("div",{className:"mt-3",children:i.jsx("button",{onClick:()=>an(We.id||We.bot_id,wt),disabled:ft[We.id||We.bot_id]||Dt[We.id||We.bot_id],className:`w-full py-1.5 rounded-lg text-[11px] font-semibold transition-colors ${wt?"bg-[#ff7073] text-black hover:bg-[#ff8a8d]":"bg-[#67FFBD] text-black hover:bg-[#8bffd0]"} disabled:opacity-60 disabled:cursor-not-allowed`,children:ft[We.id||We.bot_id]?"...":wt?"Stop Bot":"Start Bot"})})]},We.id||We.bot_id)})})})]})})]})]})})}const Eyn=()=>{const{setTelegramChatId:e,setSubscriberRole:t,setSubsExpireDay:n,setMushboomerETH:r,setIsWhitelist:s,setMushboomerSOL:a,setIsReferralCode:o,setIsReferralCodeName:l,setHyperToken:c,setHyperAddress:u}=m.useContext(Gr);return m.useEffect(()=>{(async()=>{var g,v;const f=window.localStorage.getItem("hyperToken"),x=window.localStorage.getItem("hyperAddress");if(!(!f||!x))try{const w=await Si(x.toLowerCase(),f);w!=null&&w.success?(e(w==null?void 0:w.telegram_chat_id),t(w==null?void 0:w.subscriber_role),n(w==null?void 0:w.subs_expire_day),r((g=w==null?void 0:w.mushboomer_counts)==null?void 0:g.eth),a((v=w==null?void 0:w.mushboomer_counts)==null?void 0:v.sol),o(w==null?void 0:w.referral_code),l(w==null?void 0:w.refcode),s(w==null?void 0:w.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),c(""),u(""))}catch(w){console.error("Token verification error:",w)}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(Io,{children:i.jsxs($o,{children:[i.jsx("title",{children:"DCA Bot Calculator | Dollar Cost Averaging Strategy | Dextrabot"}),i.jsx("meta",{name:"description",content:"Calculate your DCA bot strategy for perpetual futures. Plan safety orders, visualize liquidation prices, and optimize your dollar cost averaging strategy."}),i.jsx("meta",{property:"og:title",content:"DCA Bot Calculator | Dollar Cost Averaging Strategy | Dextrabot"}),i.jsx("meta",{property:"og:description",content:"Calculate your DCA bot strategy for perpetual futures. Plan safety orders, visualize liquidation prices, and optimize your dollar cost averaging strategy."}),i.jsx("meta",{property:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{property:"og:url",content:"https://app.dextrabot.com/dca-bot"})]})}),i.jsx("div",{style:{minHeight:"calc(100vh - 5rem)"},className:"flex justify-center items-start w-full h-full px-4 pt-6 pb-6 sm:px-6 sm:pt-6 sm:pb-6 bg-[#050505] overflow-auto",children:i.jsx("div",{className:"flex flex-col items-stretch justify-start gap-[26px] w-full max-w-[1400px]",children:i.jsx(jyn,{})})})]})},ij=({size:e})=>i.jsxs("div",{role:"status",className:"flex justify-center items-center min-h-5 w-[54px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:`${e} inline text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]
          `,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}),lD="/assets/subscribeAnimation-oYDBxlRF.mp4",_yn=()=>{const{setSignModalOpen:e,setTelegramChatId:t,setSubscriberRole:n,setSubsExpireDay:r,setMushboomerETH:s,setMushboomerSOL:a,setIsReferralCode:o,setIsReferralCodeName:l,setIsWhitelist:c,setHyperToken:u,setHyperAddress:d}=m.useContext(Gr),{address:f}=Yr(),[x,g]=m.useState(1),[v,w]=m.useState(""),[C,N]=m.useState(""),[I,P]=m.useState(!1),[R,F]=m.useState(!1),[U,L]=m.useState(""),[z,X]=m.useState(0),[ne,J]=m.useState(0),[Z,re]=m.useState(!1),he=Ne=>/^\d*$/.test(Ne),Y=Ne=>{["e","E","+","-"].includes(Ne.key)&&Ne.preventDefault()},ie=m.useMemo(()=>{if(x==="")return!1;const Ne=Number(x);return Number.isInteger(Ne)&&Ne>=1},[x]),V=(Ne=>{const[be,je]=Ne.split(" "),[Ie,Re,Qe]=be.split("-").map(Number),[Be,it]=je.split(":").map(Number);return new Date(Date.UTC(Qe,Re-1,Ie,Be-3,it))})("29-11-2025 23:59");m.useState(()=>new Date().getTime()>=V.getTime());const ee=m.useRef(z);m.useEffect(()=>{ee.current=z},[z]);const ae=m.useRef(0);m.useEffect(()=>{ae.current=ne},[ne]);const fe=async()=>{var je,Ie;const Ne=window.localStorage.getItem("hyperToken"),be=window.localStorage.getItem("hyperAddress");if(!(!Ne||!be))try{const Re=await Si(be.toLowerCase(),Ne);Re!=null&&Re.success?(t(Re==null?void 0:Re.telegram_chat_id),n(Re==null?void 0:Re.subscriber_role),r(Re==null?void 0:Re.subs_expire_day),s((je=Re==null?void 0:Re.mushboomer_counts)==null?void 0:je.eth),a((Ie=Re==null?void 0:Re.mushboomer_counts)==null?void 0:Ie.sol),o(Re==null?void 0:Re.referral_code),l(Re==null?void 0:Re.refcode),c(Re==null?void 0:Re.whitelist),u(Ne),d(be),w(Re==null?void 0:Re.farming_tools),X(Number((Re==null?void 0:Re.subs_expire_day)||0))):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),u(""),d(""))}catch(Re){console.error("Token verification error:",Re),console.error(Re.message||"An unknown error occurred.")}};m.useEffect(()=>{Z&&fe()},[Z]),m.useEffect(()=>{const Ne=localStorage.getItem("hyperToken"),be=localStorage.getItem("hyperAddress");re(!!(Ne&&be));const je=setInterval(()=>{const Ie=localStorage.getItem("hyperToken"),Re=localStorage.getItem("hyperAddress");re(!!(Ie&&Re))},800);return()=>clearInterval(je)},[]);const Ae=async()=>new yl(window.ethereum).eth.getAccounts(be=>be),ce=async(Ne="subscribe",be=24,je=5e3)=>{be<=0||(await new Promise(Ie=>setTimeout(Ie,je)),await fe(),Ne==="subscribe"&&ee.current===ae.current?ce(Ne,be-1,je):fe())},ye=async Ne=>{const be=window.localStorage.getItem("hyperToken"),je=window.localStorage.getItem("hyperAddress");if(!be||!f){e(!0);return}N(""),J(ee.current),ae.current=ee.current,F(!0),P(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(Qe){console.error("Failed to switch network",Qe),P(!1);return}const Ie=new yl(window.ethereum);var Re=await Ae();if(Re.length>0?Re=Re[0]:Re=void 0,Re){const Be=Ne*.12,it=Ie.utils.toWei(Be.toString(),"ether"),tt={from:Re,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:it};await Ie.eth.sendTransaction(tt).then(at=>{console.log("txHash :>> ",at),P(!1),L(at.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:f?f.toLowerCase():je,token:be,payment_tx:at.transactionHash,payment_role:"farming_tools",tx_qty:Number(x)})}),fe(),ce("subscribe")}).catch(at=>{console.log(at),at.code===-32003||at.message.includes("insufficient funds")?N("Insufficient funds."):at.message==="MetaMask Tx Signature: User denied transaction signature."&&F(!1)})}else await Ie.eth.requestAccounts()};return window.localStorage.getItem("hyperToken"),i.jsxs(i.Fragment,{children:[i.jsx(fd,{open:R,setOpen:F,transactionHash:U,transactionLoading:I,paymentPresaleRole:!(z<=ne),errorFunds:C,activeMethod:2}),i.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-start md:justify-center md:items-start gap-8 w-full h-screen md:h-full mb-72 md:mb-0",children:[i.jsx("div",{className:"flex justify-center items-start md:items-center w-full h-max md:h-full pl-0 sm:pl-4 md:pl-2",children:i.jsx("div",{className:"flex flex-col gap-2 pt-0 md:pt-7 lg:pt-0",children:i.jsx("div",{className:"flex flex-col items-start justify-start gap-4 md:mb-10 lg:mb-16",children:i.jsxs("div",{className:"flex flex-col gap-3 text-gray-200 text-sm leading-relaxed mt-2 max-w-[600px]",children:[i.jsxs("ul",{className:"space-y-2.5",children:[i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-lg",children:"🌾"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-base font-semibold text-white",children:"Farm Bot"}),i.jsxs("ul",{className:"text-sm text-gray-400",children:[i.jsx("li",{children:"• Generate volume, earn rewards."}),i.jsx("li",{children:"• Delta neutral = zero directional risk."}),i.jsx("li",{children:"• Safe automated farming."})]})]})]}),i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-lg",children:"🎯"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-base font-semibold text-white",children:"Grid Bot"}),i.jsxs("ul",{className:"text-sm text-gray-400",children:[i.jsx("li",{children:"• Auto-trade price ranges."}),i.jsx("li",{children:"• Profit from volatility."}),i.jsx("li",{children:"• Built-in risk management."})]})]})]}),i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-lg",children:"🔄"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-base font-semibold text-white",children:"Copy Trade"}),i.jsxs("ul",{className:"text-sm text-gray-400",children:[i.jsx("li",{children:"• Hyperliquid → Lighter copy trading."}),i.jsx("li",{children:"• Follow top traders automatically."}),i.jsx("li",{children:"• Scale positions to your size."})]})]})]})]}),i.jsx("p",{className:"mt-4 text-gray-300 text-base",children:"👉 Get Dextrabot's complete suite."})]})})})}),i.jsxs("div",{className:"relative mx-1 h-full py-10 hidden md:block",children:[i.jsx("div",{className:"w-[2px] h-full bg-[linear-gradient(to_bottom,rgba(255,140,0,0)_0%,rgba(255,140,0,0.8)_15%,rgba(255,50,150,0.8)_85%,rgba(255,50,150,0)_100%)]"}),i.jsx("div",{className:"absolute inset-0 w-[8px] h-full bg-[linear-gradient(to_bottom,rgba(255,140,0,0)_0%,rgba(255,140,0,0.4)_15%,rgba(255,50,150,0.4)_85%,rgba(255,50,150,0)_100%)] blur-md mx-auto"})]}),i.jsx("div",{className:"flex justify-center items-start md:items-center w-full h-full",children:i.jsxs("div",{className:"flex flex-col items-center gap-4 border border-[#404040] bg-[#141414] rounded-xl px-3  py-7 shadow-[0_0_25px_rgba(255,120,50,0.25)] min-w-[362px]",children:[i.jsx("div",{className:"rounded-lg overflow-hidden",children:i.jsx("video",{src:lD,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",className:"w-full h-[284px] lg:h-[284px] object-cover"},lD)}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-center gap-2",children:[i.jsx("button",{onClick:()=>g(Ne=>{const be=Number(Ne||0);return be>1?String(be-1):"1"}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"–"}),i.jsx("input",{value:x,onChange:Ne=>{const be=Ne.target.value.trim();if(be==="")return g("");he(be)&&g(be)},onKeyDown:Y,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10",className:"w-full h-8 text-center rounded-md bg-[#242424] border border-[#353535] text-white text-[13px] font-semibold outline-none placeholder:text-[#7F7F7F]"}),i.jsx("button",{onClick:()=>g(Ne=>{const be=Number(Ne||0);return String(be+1)}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"+"})]}),x!==""&&!ie&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer that is at least 1."})]}),ie&&i.jsxs("div",{className:"text-[12px] font-semibold text-green-400",children:[" ",x," months will be added to your subscription."]}),i.jsx("div",{className:"relative flex items-center justify-center gap-3 px-4 py-2 rounded-xl shadow-[0_0_25px_rgba(255,140,0,0.15)] backdrop-blur-md bg-white/5 border border-white/10",children:i.jsxs("span",{className:"text-2xl font-bold bg-gradient-to-r from-orange-400 to-pink-500 bg-clip-text text-transparent",children:[(x*.12).toFixed(2)," ETH"]})}),i.jsx("div",{onClick:Ne=>{Ne.preventDefault(),ie&&ye(x)},className:`text-[10px] sm:text-xs xl:text-[13px] font-semibold text-gray-200 select-none border  rounded-md px-4 py-2  ${ie?"border-[#8861FF] bg-[#7446FF] cursor-pointer":"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed"}`,children:"Buy Now"})]})})]})]})},kyn=()=>{Yr();const{setTelegramChatId:e,setSubscriberRole:t,setSubsExpireDay:n,setMushboomerETH:r,setMushboomerSOL:s,setIsReferralCode:a,setIsReferralCodeName:o,setIsWhitelist:l,setHyperToken:c,setHyperAddress:u}=m.useContext(Gr);return m.useEffect(()=>{(async()=>{var g,v;const f=window.localStorage.getItem("hyperToken"),x=window.localStorage.getItem("hyperAddress");if(!(!f||!x))try{const w=await Si(x.toLowerCase(),f);w!=null&&w.success?(e(w==null?void 0:w.telegram_chat_id),t(w==null?void 0:w.subscriber_role),n(w==null?void 0:w.subs_expire_day),r((g=w==null?void 0:w.mushboomer_counts)==null?void 0:g.eth),s((v=w==null?void 0:w.mushboomer_counts)==null?void 0:v.sol),a(w==null?void 0:w.referral_code),o(w==null?void 0:w.refcode),l(w==null?void 0:w.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),c(""),u(""))}catch(w){console.error("Token verification error:",w),console.error(w.message||"An unknown error occurred.")}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(Io,{children:i.jsxs($o,{children:[i.jsx("title",{children:"Dextrabot Subscription"}),i.jsx("meta",{name:"description",content:"Subscribe to Dextrabot and unlock automated trading bots including Farm Bot, Grid Bot, Market Maker and Copy Trade. Smart automation for Hyperliquid & Lighter."}),i.jsx("meta",{name:"og:title",content:"Dextrabot Subscription"}),i.jsx("meta",{name:"og:description",content:"Subscribe to Dextrabot and unlock automated trading bots including Farm Bot, Grid Bot, Market Maker and Copy Trade. Smart automation for Hyperliquid & Lighter."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/subscribe"})]})}),i.jsx("div",{className:"flex justify-center items-start w-full h-[calc(100vh-5rem)] min-h-max px-4 pt-4 pb-10 bg-[#161616] md:bg-gradient-to-b from-[#0d0d0d] via-[#1a1a1a] to-[#0d0d0d]",children:i.jsx(_yn,{})})]})},yWe=({open:e,setOpen:t,makerStatus:n,isStatusWallet:r,info:s,modalLoading:a})=>i.jsxs(ga,{open:e,onClose:t,className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative transform overflow-hidden bg-[#101010] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsx("div",{className:"flex flex-col justify-start items-center gap-8 w-[400px] h-max relative bg-[#252525] rounded-3xl pt-4 pb-6",children:i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>{t(!1)},className:"cursor-pointer flex w-full items-center justify-end absolute right-2 top-1",children:i.jsx("span",{className:"absolute top-2 right-2 w-9 h-9 rounded-full p-1 flex justify-center items-center hover:bg-[#7535FE]",children:i.jsx("img",{className:"p-1",src:Oa})})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Hi,alt:"",className:"w-[86px h-[86px]"})}),i.jsxs("div",{className:"flex flex-col justify-start items-center gap-2",children:[i.jsx("div",{className:"w-80 text-center text-white text-2xl font-semibold font-manropeleading-7",children:"Are you sure?"}),i.jsx("div",{className:"w-[348px] text-center text-white/60 text-[16px] font-medium font-manrope leading-5",children:s==="settings"||s==="table"&&(r!=null&&r.isDeleted)?"Do you want to start this Market Maker operation?":"Do you want to stop this Market Maker operation?"})]}),i.jsxs("div",{className:"flex  items-center justify-center gap-4",children:[i.jsx("div",{onClick:()=>{t(!1)},className:"h-8 px-4 py-3 rounded-xl shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-white justify-center items-center gap-2.5 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-white text-[13px] font-medium font-inter leading-[8px]",children:"Cancel"})}),i.jsx("div",{onClick:o=>{a||(o.preventDefault(),s==="settings"?n():n(r))},className:`h-8 px-4 rounded-[10px] shadow border flex items-center justify-center cursor-pointer ${a?"bg-[#444] border-[#666] cursor-not-allowed":s==="settings"||s==="table"&&(r!=null&&r.isDeleted)?"bg-[#7445ff] border-[#8860ff]":"bg-[#ff4444] border-[#ff6666]"}`,children:a?i.jsx("span",{className:"text-white text-[13px] animate-pulse",children:"Loading..."}):i.jsx("span",{className:"text-white text-[13px]",children:s==="settings"||s==="table"&&(r!=null&&r.isDeleted)?"Start":"Stop"})})]})]})})})})})]}),Tyn=({fetchInfoOnOpen:e,setIsFilterWallet:t})=>{const[n,r]=m.useState([]),[s,a]=m.useState(""),[o,l]=m.useState(""),[c,u]=m.useState(""),[d,f]=m.useState([]),[x,g]=m.useState([]),[v,w]=m.useState(!1),[C,N]=m.useState(!1),[I,P]=m.useState(!1);m.useState(!1);const[R,F]=m.useState(""),[U,L]=m.useState(!1),[z,X]=m.useState(null),[ne,J]=m.useState(""),[Z,re]=m.useState(!1);m.useState(!1);const[he,Y]=m.useState([]),[ie,oe]=m.useState("");m.useState("");const[G,V]=m.useState(100),[ee,ae]=m.useState("NEUTRAL"),[fe,Ae]=m.useState("AGGRESSIVE"),[ce,ye]=m.useState("");m.useState(""),m.useState("");const[Ne,be]=m.useState(!1),[je,Ie]=m.useState(!1),[Re,Qe]=m.useState(!1),{setSignModalOpen:Be,setTelegramChatId:it,setSubscriberRole:tt,setMushboomerETH:at,setMushboomerSOL:dt,setIsReferralCode:ct,setIsReferralCodeName:Ut,setIsWhitelist:kt,setHyperToken:tn,setHyperAddress:jt}=m.useContext(Gr),un="https://dextrabothypev2.nftinit.io",cn="https://api.hyperliquid.xyz/info",Pt={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};m.useEffect(()=>{async function Bt(){var an;if(open)try{const qn=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/get_farming_coins/?app=hyper")).json();if(qn!=null&&qn.coins){const nr=(an=qn==null?void 0:qn.coins)==null?void 0:an.map(Qt=>{const zn=(Qt==null?void 0:Qt.value)||"",Yn=Pt[zn]||zn,Lt=Yn==="xyz:MSTR"?"":`https://app.hyperliquid.xyz/coins/${Yn}.svg`;return{...Qt,icon:Lt}}),tr=qn.coins.filter(Qt=>Qt.value.includes(":")).map(Qt=>{const[zn,Yn]=Qt.value.split(":");return Yn});f(nr),g(tr)}}catch(Pn){console.error("Failed to fetch coin list:",Pn)}}Bt()},[]);const Xe=Bt=>{var an;return((an=d.find(Pn=>Pn.label===Bt))==null?void 0:an.maxLeverage)??100},Vt=Bt=>({HL_FEE:15e-5,BUILDER_FEE:2e-4,GROW_RATE:(x==null?void 0:x.includes(Bt))?.1:1}),Yt=(Bt,an)=>{if(!Bt||!an)return"";const{HL_FEE:Pn,BUILDER_FEE:qn,GROW_RATE:nr}=Vt(an);return(Number(Bt)*(Pn+qn*nr)).toFixed(0)},Ve=(Bt,an)=>{if(!Bt||!an)return"";const{HL_FEE:Pn,BUILDER_FEE:qn,GROW_RATE:nr}=Vt(an);return(Number(Bt)/(Pn+qn*nr)).toFixed(0)},Ke=Bt=>Bt===""||Bt===null?"":Number(Bt).toLocaleString("en-US"),ft=Bt=>Bt?Bt.replace(/,/g,""):"",en=Bt=>{if(Bt==null||Bt==="")return"0.00";const an=Number(Bt);return Number.isNaN(an)?"0.00":an.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})},Dt=Bt=>/^\d*$/.test(Bt),At=Bt=>/^\d*\.?\d{0,6}$/.test(Bt),Je=Bt=>{["e","E","+","-"].includes(Bt.key)&&Bt.preventDefault()};m.useEffect(()=>{if(!o)return;const Bt=Xe(o),an=Number(ie);!Number.isNaN(an)&&an>Bt&&oe(String(Bt)),!Number.isNaN(an)&&an<1&&ie!==""&&oe("1")},[o]);const He=m.useMemo(()=>{if(!z||!ie||!ce)return"";const Bt=fe==="NORMAL"?.02:fe==="PASSIVE"?.05:.1,an=Number(z)*Number(ie),Pn=Number(ce)*Bt;return an>Pn?"":"Insufficient margin to create order, please increase your margin."},[z,ie,ce,fe]),Rt=m.useMemo(()=>{if(ie==="")return!1;const Bt=Number(ie),an=Xe(o);return Number.isInteger(Bt)&&Bt>=1&&Bt<=an},[ie,o,d]);m.useEffect(()=>{if(!o)return;const Bt=Xe(o),an=Number(ie);!Number.isNaN(an)&&an>Bt&&oe(String(Bt)),!Number.isNaN(an)&&an<1&&ie!==""&&oe("1")},[o]);const qe=m.useMemo(()=>{if(G==="")return!1;const Bt=Number(G);return Number.isNaN(Bt)?!1:Bt===0?!0:Bt>=0},[G]),lt=m.useMemo(()=>{if(ce==="")return!1;const Bt=Number(ce);return!Number.isNaN(Bt)&&Bt>0},[ce]),xt=m.useMemo(()=>n.map(Bt=>{const an=(Bt==null?void 0:Bt.wallet_name)??(Bt==null?void 0:Bt.name)??(Bt==null?void 0:Bt.label)??String(Bt==null?void 0:Bt.wallet_id),Pn=(Bt==null?void 0:Bt.version)===3?`${an} - (API-AGENT) Wallet`:an;return{value:(Bt==null?void 0:Bt.wallet_id)??(Bt==null?void 0:Bt.id)??(Bt==null?void 0:Bt.value)??"",label:Pn,raw:Bt}}),[n]),Nt=m.useMemo(()=>{var Bt;return(Bt=xt.find(an=>String(an.value)===String(s)))==null?void 0:Bt.raw},[xt,s]),It=m.useMemo(()=>{const Bt=Nt||{};return Bt.address||Bt.evm_address||Bt.wallet_address||Bt.public_address||Bt.eth_address||Bt.addr||null},[Nt]),xn=s!==""&&o!==""&&Z&&Rt&&lt&&!He&&(ee==="LONG"||ee==="SHORT"||ee==="NEUTRAL")&&(fe==="AGGRESSIVE"||fe==="NORMAL"||fe==="PASSIVE");m.useEffect(()=>{const Bt=localStorage.getItem("hyperToken"),an=localStorage.getItem("hyperAddress");re(!!(Bt&&an));const Pn=setInterval(()=>{const qn=localStorage.getItem("hyperToken"),nr=localStorage.getItem("hyperAddress");re(!!(qn&&nr))},800);return()=>clearInterval(Pn)},[]),m.useEffect(()=>{F(""),Z&&_n()},[Z]),m.useEffect(()=>{It?dn(It):(X(null),J(""),Y([]))},[It]),m.useEffect(()=>{Z&&(e(),sn())},[Z]);async function dn(Bt){var an;try{J(""),L(!0),X(null);const qn=await(await fetch(cn,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"clearinghouseState",user:Bt})})).json();X((an=qn==null?void 0:qn.marginSummary)==null?void 0:an.accountValue)}catch(Pn){J(Pn.message||"Failed to load USDC balance.")}finally{L(!1)}}function Mn(){const Bt=It||window.localStorage.getItem("hyperAddress");Bt&&dn(Bt)}async function _n(){try{w(!0);const Bt=window.localStorage.getItem("hyperToken"),an=window.localStorage.getItem("hyperAddress");if(!Bt||!an){re(!1),Be(!0);return}const qn=await(await fetch(`${un}/api/wallet/confirmed-list`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:an.toLowerCase(),token:Bt})})).json();qn!=null&&qn.success?r((qn==null?void 0:qn.data)||[]):F((qn==null?void 0:qn.error_message)||"Failed to load wallets.")}catch(Bt){F(Bt.message||"Wallet list error.")}finally{w(!1)}}async function kn(){if(!Z){Be(!0);return}if(xn)try{P(!0),F(""),Qe(!0);const Bt=window.localStorage.getItem("hyperToken"),an=window.localStorage.getItem("hyperAddress");if(!Bt||!an){re(!1),Be(!0);return}const Pn={coin:c,leverage:Number(ie),volume:Number(ce),orderBookDepth:1,perOrderPosValue:fe==="PASSIVE"?2:fe==="NORMAL"?5:10,direction:ee,executionMode:fe,budget:Number(G)},qn={address:an.toLowerCase(),token:Bt,wallet_id:Number(s),source_market:"hyper",bot_params:Pn,coin:o},tr=await(await fetch(`${un}/api/hyper/mmbot/save/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qn)})).json();tr!=null&&tr.success?(e(),on.success("Successfully saved.",{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(103, 255, 189, 0.16)",width:"280px",minWidth:"280px",height:"40px",backdropFilter:"blur(16px)"},iconTheme:{primary:"#67FFBD",secondary:"#276047"}})):(F((tr==null?void 0:tr.error_message)||"Start failed."),on.error((tr==null?void 0:tr.error_message)||"Save failed."))}catch(Bt){F(Bt.message||"An error occurred while saving.")}finally{P(!1),Ie(!1),Qe(!1)}}const vn=32,Qn={control:(Bt,an)=>({...Bt,backgroundColor:"#242424",borderColor:an.isFocused?"#67FFBD":"#353535",minHeight:vn,height:vn,boxShadow:"none",cursor:"pointer",alignItems:"center",minWidth:"max-content"}),valueContainer:Bt=>({...Bt,height:vn,paddingTop:0,paddingBottom:0,display:"flex",alignItems:"center"}),indicatorsContainer:Bt=>({...Bt,height:vn}),input:Bt=>({...Bt,color:"#FFFFFF",margin:0,padding:0}),singleValue:Bt=>({...Bt,color:"#FFFFFF",margin:0,lineHeight:"normal",fontSize:"12px",display:"flex",alignItems:"center"}),placeholder:Bt=>({...Bt,color:"#7F7F7F",fontSize:"12px"}),menu:Bt=>({...Bt,backgroundColor:"#242424",border:"1px solid #353535",zIndex:9999}),menuList:Bt=>({...Bt,paddingTop:0,paddingBottom:0,maxHeight:180}),option:(Bt,an)=>({...Bt,backgroundColor:an.isFocused?"#2e2e2e":"#242424",color:"#FFFFFF",cursor:"pointer",minHeight:vn,display:"flex",alignItems:"center",fontSize:"12px"}),dropdownIndicator:Bt=>({...Bt,color:"#9B9B9B",paddingTop:4,paddingBottom:4}),indicatorSeparator:Bt=>({...Bt,backgroundColor:"#353535"})},Hn=({max:Bt})=>i.jsxs("span",{className:"inline-flex items-center h-4 px-1.5 py-2 rounded bg-black/40 border border-[#2A2A2A] text-[10px] text-[#CECECE] font-bold",children:[Bt,"x"]}),$n=()=>i.jsx("div",{className:"px-2 py-0.5 rounded-md bg-[#0f1b1b] text-[#67ffbd] text-[10px] font-semibold",children:"xyz"}),Jn=Bt=>{var Pn;const an=x==null?void 0:x.includes(Bt.data.label);return i.jsx($a.Option,{...Bt,children:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[(Pn=Bt.data)!=null&&Pn.icon?i.jsx("img",{src:Bt.data.icon,alt:Bt.data.label,className:"w-4 h-4",onError:qn=>qn.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F]"}),i.jsx("span",{className:"text-white text-[13px]",children:Bt.data.label}),an&&i.jsx($n,{}),i.jsx(Hn,{max:Bt.data.maxLeverage})]})})},Nn=Bt=>{var Pn;const an=x==null?void 0:x.includes(Bt.data.label);return i.jsx($a.SingleValue,{...Bt,children:i.jsxs("div",{className:"flex items-center gap-2",children:[(Pn=Bt.data)!=null&&Pn.icon?i.jsx("img",{src:Bt.data.icon,alt:Bt.data.label,className:"w-4 h-4",onError:qn=>qn.currentTarget.style.display="none"}):i.jsx("div",{className:"rounded-full w-4 h-4 min-w-4 min-h-4 bg-[#4F4F4F]"}),i.jsx("span",{className:"text-white text-[13px]",children:Bt.data.label}),an&&i.jsx($n,{}),i.jsx(Hn,{max:Bt.data.maxLeverage})]})})},ln=(Bt,an)=>{if(l(Bt),u(an),G===""&&ce===""){V(100),ye(Ve(100,Bt));return}if(G===""&&ce!==""){V(Yt(ce,Bt));return}if(G!==""&&ce===""){ye(Ve(G,Bt));return}V(Yt(ce,Bt))},Oe=d,sn=async()=>{var Pn,qn;const Bt=window.localStorage.getItem("hyperToken"),an=window.localStorage.getItem("hyperAddress");if(!(!Bt||!an))try{N(!0);const nr=await Si(an.toLowerCase(),Bt);nr!=null&&nr.success?(it(nr==null?void 0:nr.telegram_chat_id),tt(nr==null?void 0:nr.subscriber_role),at((Pn=nr==null?void 0:nr.mushboomer_counts)==null?void 0:Pn.eth),dt((qn=nr==null?void 0:nr.mushboomer_counts)==null?void 0:qn.sol),ct(nr==null?void 0:nr.referral_code),Ut(nr==null?void 0:nr.refcode),kt(nr==null?void 0:nr.whitelist),tn(Bt),jt(an),N(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),tn(""),jt(""),N(!1))}catch(nr){console.error("Token verification error:",nr),console.error(nr.message||"An unknown error occurred."),N(!1)}},fn=Bt=>i.jsxs($a.MenuList,{...Bt,children:[i.jsxs("div",{onClick:()=>{Bt.selectProps.setIsGenWalletModal(!0)},className:"mx-2 mt-2 mb-1 px-3 py-2 bg-[#7445ff] hover:bg-[#5834C3] rounded-md text-white text-[13px] font-medium cursor-pointer flex items-center gap-2",children:[i.jsx("span",{className:"text-[18px] leading-none",children:"+"}),"Add Account"]}),i.jsx("div",{className:"h-px bg-[#353535] my-1 mx-2"}),Bt.children]}),Et=v||I,Kn=!1,Cn=Xe(o);return i.jsxs(i.Fragment,{children:[Ne&&Ia.createPortal(i.jsx("div",{className:"fixed inset-0 z-[999999999]",children:i.jsx(FA,{open:Ne,setOpen:be,handleListRequest:_n,handlePageChange:()=>{}})}),document.body),i.jsx(yWe,{open:je,setOpen:Ie,makerStatus:kn,isStatusWallet:"",info:"settings",modalLoading:Re}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4 w-full",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Select Wallet"}),i.jsxs("div",{className:"relative",children:[i.jsx(Zl,{styles:Qn,isDisabled:Et||v||Kn,isLoading:v,options:xt,components:{MenuList:fn},setIsGenWalletModal:be,value:xt.find(Bt=>String(Bt.value)===String(s))||null,onChange:Bt=>{a((Bt==null?void 0:Bt.value)??""),t((Bt==null?void 0:Bt.value)??"")},placeholder:Z?v?"Loading...":"Select":"Connect to select",isSearchable:!0,onMenuOpen:()=>{Z||Be(!0)},menuIsOpen:Z?void 0:!1}),!Z&&i.jsx("button",{type:"button",onClick:()=>Be(!0),className:"absolute inset-0 rounded-md cursor-pointer bg-transparent","aria-label":"Connect to select",title:"Connect"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Select Coin"}),i.jsx(Zl,{styles:Qn,components:{Option:Jn,SingleValue:Nn},isDisabled:Et||Kn,options:Oe,value:Oe.find(Bt=>Bt.label===o)||null,onChange:Bt=>ln((Bt==null?void 0:Bt.label)??"",(Bt==null?void 0:Bt.value)??""),placeholder:"Select",isSearchable:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Leverage"}),i.jsx("input",{value:ie,onChange:Bt=>{const an=Bt.target.value.trim();if(an==="")return oe("");Dt(an)&&oe(an)},onKeyDown:Je,inputMode:"numeric",autoComplete:"off",placeholder:o?`1–${Cn}x`:"e.g. 3",className:`w-full h-8 px-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ie===""?"border-[#353535]":Rt?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Et||Kn})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Budget"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"$"}),i.jsx("input",{value:Ke(G),onChange:Bt=>{let an=ft(Bt.target.value);if(an===""){V(""),ye("");return}if(At(an)){V(an);const Pn=Ve(an,o);ye(Pn)}},onKeyDown:Je,inputMode:"decimal",autoComplete:"off",placeholder:"e.g. 5",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${G===""?"border-[#353535]":qe?"border-[#353535] focus:border-[#67FFBD]":"border-[#FF797C]"}`,disabled:Et||Kn})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Volume"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-[#7F7F7F] font-semibold",children:"$"}),i.jsx("input",{value:Ke(ce),onChange:Bt=>{let an=ft(Bt.target.value);if(an===""){ye(""),V("");return}if(At(an)){ye(an);const Pn=Yt(an,o);V(Pn)}},onKeyDown:Je,inputMode:"decimal",autoComplete:"off",placeholder:"VOLUME",className:`w-full h-8 pl-7 pr-3 rounded-md bg-[#242424] border text-[13px] outline-none placeholder:text-[#7F7F7F] ${ce===""?"border-[#353535]":"border-[#353535] focus:border-[#67FFBD]"}`,disabled:Et||Kn})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Directional Bias"}),i.jsxs("div",{className:"flex items-center gap-2 md:pr-6 xl:pt-1",children:[i.jsx("div",{"aria-pressed":ee==="SHORT",onClick:()=>ae("SHORT"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Et||Kn?"cursor-not-allowed":"cursor-pointer",ee==="SHORT"?"bg-[#FF797C] text-black border-[#FF797C] shadow-[0_0_0_3px_rgba(255,121,124,0.25)]":"text-[#FF787B] bg-[#FF797C]/20 border-[#2A2A2A] hover:bg-[#FF797C]/30"].join(" "),children:i.jsx("span",{className:"min-w-max",children:"SHORT"})}),i.jsx("div",{"aria-pressed":ee==="NEUTRAL",onClick:()=>ae("NEUTRAL"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Et||Kn?"cursor-not-allowed":"cursor-pointer",ee==="NEUTRAL"?"bg-[#3b82f6] text-[#ffffff] border-[#93c5fd] shadow-[0_0_0_3px_rgba(59,130,246,0.3)]":"text-[#3b82f6] bg-[rgba(59,130,246,0.15)] border-[rgba(59,130,246,0.15)] hover:bg-[#2563eb] hover:text-white"].join(" "),children:i.jsx("span",{className:"min-w-max",children:"NEUTRAL"})}),i.jsx("div",{"aria-pressed":ee==="LONG",onClick:()=>ae("LONG"),className:["inline-flex justify-center items-center gap-1.5 h-6 rounded-[8px] uppercase tracking-wide font-semibold transition-all border w-1/2","text-[8.5px] px-1",Et||Kn?"cursor-not-allowed":"cursor-pointer",ee==="LONG"?"bg-[#67FFBD] text-black border-[#67FFBD] shadow-[0_0_0_3px_rgba(103,255,189,0.25)]":"text-[#67FFBD] bg-[#67FFBD]/15 border-[#2A2A2A] hover:bg-[#67FFBD]/25"].join(" "),children:i.jsx("span",{className:"min-w-max",children:"LONG"})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-[13px] text-[#7C7C7C] font-manrope font-semibold leading-[8px]",children:"Execution Mode"}),i.jsxs("div",{className:"flex items-center gap-3 xl:pt-1",children:[i.jsx("button",{"aria-pressed":fe==="AGGRESSIVE",onClick:()=>Ae("AGGRESSIVE"),className:["inline-flex justify-center items-center gap-1.5 h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",Et||Kn?"cursor-not-allowed":"cursor-pointer",fe==="AGGRESSIVE"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["AGGRESSIVE ",fe==="AGGRESSIVE"?" ✓":""]})}),i.jsx("button",{"aria-pressed":fe==="NORMAL",onClick:()=>Ae("NORMAL"),className:["inline-flex justify-center items-center gap-1.5 h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",Et||Kn?"cursor-not-allowed":"cursor-pointer",fe==="NORMAL"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["NORMAL ",fe==="NORMAL"?" ✓":""]})}),i.jsx("button",{"aria-pressed":fe==="PASSIVE",onClick:()=>Ae("PASSIVE"),className:["inline-flex justify-center items-center gap-1.5 h-6 px-2 rounded-[8px] uppercase tracking-wide text-[8.5px] font-semibold transition-all border w-1/2",Et||Kn?"cursor-not-allowed":"cursor-pointer",fe==="PASSIVE"?"bg-[#8e643a] text-white border-[#44382C]":"text-[#7C7C7C] bg-transparent border-[#404040] hover:bg-[#404040]/25 hover:text-white"].join(" "),children:i.jsxs("span",{children:["PASSIVE ",fe==="PASSIVE"?" ✓":""]})})]})]})]}),i.jsxs("div",{className:"flex items-start gap-3 mt-3 pt-3 border-t border-[#353535] bg[rgba(27,27,27,0.32)] rounded-b-3xl w-full",children:[i.jsxs("div",{className:"flex basis-1/2 flex-col gap-1",children:[Z&&i.jsxs("div",{className:"text-[12px] text-[#9B9B9B] flex items-center gap-2",children:["Available Perp Balance (USDC):",i.jsx("span",{className:"text-white",children:U?"Loading...":ne?"—":en(z??"0")}),i.jsx("div",{onClick:Mn,className:"flex justify-center items-center cursor-pointer",title:"Refresh balance",children:i.jsx(NS,{className:`w-4 h-4 ${U?"animate-spin":""}`})})]}),He&&i.jsxs("div",{className:"flex justify-start items-center gap-2 text-[12px] text-[#FF797C] bg-[#3b2626] border border-[#ff797c]/30 rounded-md px-3 py-1.5 max-w-[470px]",children:[i.jsx("img",{src:vc,alt:"Dextrabot",className:"w-3.5 min-w-3.5 min-h-3.5 h-3.5"}),i.jsxs("div",{className:"text-[#FF797C] text-[11px] leading-[14px]",children:[He+" ",i.jsxs("span",{onClick:()=>window.open("https://docs.dextrabot.com/market-maker-bot/hyperliquid-market-maker-bot#margin-requirements","_blank"),className:"underline cursor-pointer text-[#FF797C] hover:text-white inline-flex items-center gap-1",children:["How it works",i.jsx("img",{src:cm,alt:"Dextrabot",className:"w-2.5 h-2.5"})]})]})]})]}),i.jsx("div",{className:"flex flex-col items-end  sm:flex-row sm:justify-end gap-2 sm:gap-4 w-full basis-1/2",children:i.jsx("div",{className:"flex justify-end items-center",children:i.jsx("button",{onClick:()=>{Ie(!0)},disabled:!xn||Et,className:`flex items-center justify-center h-8 px-6 rounded-[10px] text-[13px] border ${!xn||Et?"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed":"bg-[#7446FF] border-[#8861FF] hover:bg-[#5834C3] cursor-pointer"}`,children:I?"Loading...":"Start"})})})]})]})},Iyn=({isOpen:e,onClose:t,children:n,fullscreen:r=!1,blurBackground:s=!1})=>{const[a,o]=m.useState(e),[l,c]=m.useState(!1);m.useEffect(()=>{if(e)o(!0),requestAnimationFrame(()=>c(!0));else{c(!1);const d=setTimeout(()=>o(!1),300);return()=>clearTimeout(d)}},[e]),m.useEffect(()=>{const d=f=>{f.key==="Escape"&&u()};return a&&(document.body.style.overflow="hidden",document.addEventListener("keydown",d)),()=>{document.body.style.overflow="",document.removeEventListener("keydown",d)}},[a]);const u=()=>{c(!1),setTimeout(()=>{t()},300)};return a?Ia.createPortal(i.jsxs("div",{className:`fixed inset-0 z-[100] transition-opacity duration-300 ${l?"opacity-100":"opacity-0"} flex items-center justify-center`,children:[i.jsx("div",{className:`absolute inset-0 ${s?"backdrop-blur-md bg-black/50":"bg-black/50"}`,onClick:u}),i.jsxs("div",{className:`relative bg-[#101010] shadow-lg transform transition-transform duration-300 ${l?"translate-y-0":"translate-y-full"} ${r?"w-screen h-[100dvh] rounded-none p-0":"w-auto max-w-[95vw] max-h-[95vh] rounded-t-[24px] p-2"}`,onClick:d=>d.stopPropagation(),children:[n,i.jsx("div",{className:`absolute ${r?"top-4 right-4 text-white":"top-2 right-4 text-gray-400 hover:text-white"} text-2xl cursor-pointer z-50`,onClick:u,children:"×"})]})]}),document.body):null},Pyn=({data:e,shareModalOpen:t,setShareModalOpen:n})=>{var C,N,I,P,R;const{isReferralCodeName:r}=m.useContext(Gr),[s,a]=m.useState(Ua),[o,l]=m.useState(!0),c=m.useRef(null),u=async()=>{if(c.current)try{await document.fonts.ready,await new Promise(L=>setTimeout(L,500));const F=await j1(c.current,{cacheBust:!0,backgroundColor:null,useCORS:!0,style:{transform:"scale(1)",transformOrigin:"top left"}}),U=document.createElement("a");U.href=F,U.download="dextrabot-market-maker.png",document.body.appendChild(U),U.click(),document.body.removeChild(U),on.success("PNG successfully downloaded!")}catch(F){console.error("Error generating PNG:",F),on.error("Failed to download PNG.")}},d=async F=>{l(!0);try{const L=await(await fetch(`https://api.allorigins.win/raw?url=${encodeURIComponent(F)}`)).blob();return new Promise((z,X)=>{const ne=new FileReader;ne.onloadend=()=>z(ne.result),ne.onerror=X,ne.readAsDataURL(L)})}catch(U){throw console.error("Image conversion failed:",U),U}finally{l(!1)}};m.useEffect(()=>{e!=null&&e.coin&&d(`https://app.hyperliquid.xyz/coins/${e==null?void 0:e.coin}.svg`).then(F=>a(F)).catch(()=>a(Ua))},[e]);const f=r||window.localStorage.getItem("refcode")||"",x=f?`https://app.dextrabot.com/referral/${f}`:"",g=e?`I’m market making #${e==null?void 0:e.coin} with Dextrabot on Hyperliquid HIP-3
Low risk. High XP.
Watch me farm the airdrop while everyone sleep.
Volume: $${((N=(C=e==null?void 0:e.bot_params)==null?void 0:C.volume)==null?void 0:N.toLocaleString("en-US"))||0}`:`I’m market making with Dextrabot on Hyperliquid HIP-3
Low risk. High XP.
Watch me farm the airdrop while everyone sleep.`,v=x||"https://app.dextrabot.com/market-maker",w=`https://x.com/intent/post?text=${encodeURIComponent(g)}&url=${encodeURIComponent(v)}`;return i.jsx(i.Fragment,{children:i.jsx(Iyn,{isOpen:t,onClose:()=>n(!1),blurBackground:!0,children:i.jsxs("div",{className:"w-[340px] sm:w-[460px] bg-[#101010] rounded-3xl p-6 text-white",children:[i.jsxs("div",{ref:c,className:"bg-gradient-to-b from-[#0c1414] via-[#040707] to-[#040505] rounded-[32px] border border-emerald-500/10 p-5 shadow-[0_0_60px_rgba(0,255,200,0.08)]",children:[i.jsxs("div",{className:"flex items-center justify-between mb-5",children:[i.jsx("p",{className:"text-sm uppercase tracking-[0.3em] text-white/70",children:"Market Maker"}),i.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 rounded-full bg-white/5 border border-white/10",children:[i.jsx("img",{src:i5,alt:"Dextrabot",className:"w-5 h-5 rounded-full"}),i.jsx("span",{className:"text-xs font-semibold tracking-wide",children:"DEXTRABOT"})]})]}),i.jsxs("div",{className:"mt-5 bg-[#05090a] rounded-3xl p-5 text-center border border-white/5",children:[i.jsx("p",{className:"text-xs uppercase tracking-[0.4em] text-white/50",children:"VOLUME"}),i.jsxs("p",{className:"text-4xl font-bold text-[#67FFBD] mt-2",children:["$",(I=e==null?void 0:e.bot_params)!=null&&I.volume?_s((P=e==null?void 0:e.bot_params)==null?void 0:P.volume):"--"]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 mt-6 text-left",children:[i.jsxs("div",{className:"bg-white/3 rounded-2xl p-3 border border-white/5",children:[i.jsx("p",{className:"text-[11px] uppercase tracking-wide text-white/50",children:"Coin"}),i.jsxs("p",{className:"text-lg font-semibold text-white mt-1 flex items-center gap-2",children:[o?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[34px] px-0.5 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("img",{src:s||Ua,alt:"",className:"rounded-full w-8 h-8",onError:F=>ea(F)}),(e==null?void 0:e.coin)||"--"]})]}),i.jsxs("div",{className:"bg-white/3 rounded-2xl p-3 border border-white/5",children:[i.jsx("p",{className:"text-[11px] uppercase tracking-wide text-white/50",children:"Directional Bias"}),i.jsx("p",{className:"text-lg font-semibold text-white mt-1",children:((R=e==null?void 0:e.bot_params)==null?void 0:R.direction)||"--"})]})]})]}),i.jsxs("div",{className:"mt-4 flex items-center justify-between text-[11px] text-white/50",children:[i.jsx("span",{children:"Generated by Dextrabot"}),i.jsx("span",{children:new Date().toLocaleDateString("en-US",{month:"short",day:"numeric"})})]})]}),!e&&i.jsx("p",{className:"text-xs text-white/60 mt-4",children:"An unknown error has occurred."}),i.jsxs("div",{className:"mt-6 space-y-3",children:[i.jsx("button",{onClick:F=>{F.preventDefault(),o||u()},disabled:!e,className:`${o?"cursor-not-allowed":"cursor-pointer"} w-full border border-emerald-400/60 rounded-2xl py-3 
              text-emerald-300 font-semibold hover:bg-emerald-400/10 
              transition disabled:opacity-40 disabled:cursor-not-allowed`,children:"Download image"}),i.jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:`w-full block text-center bg-white text-black 
              font-semibold rounded-2xl py-3 hover:bg-gray-100 transition`,children:"Share on X"})]})]})})})},Fyn=({data:e,setData:t,loading:n,error:r,fetchInfoOnOpen:s,isFilterWallet:a})=>{var Yt,Ve;m.useContext(Gr);const{isConnected:o,address:l}=Yr(),[c,u]=m.useState([]),[d,f]=m.useState(null),[x,g]=m.useState(!1);m.useState(!1);const[v,w]=m.useState(!1),[C,N]=m.useState(!1),[I,P]=m.useState({}),[R,F]=m.useState(!1),[U,L]=m.useState({id:"",walletAddress:"",isDeleted:!1}),[z,X]=m.useState(!1),[ne,J]=m.useState(""),[Z,re]=m.useState([]),[he,Y]=m.useState([]),[ie,oe]=m.useState([]),[G,V]=m.useState(!1),[ee,ae]=m.useState(!1),[fe,Ae]=m.useState(!1),[ce,ye]=m.useState(!1),Ne=m.useRef(null),be=m.useRef(null),je=m.useRef(null),Ie=m.useRef(null),[Re,Qe]=m.useState(!1),Be="tag",[it,tt]=m.useState(Be),at=Ke=>{if(!v){let ft=e;a&&(ft=ft==null?void 0:ft.filter(Dt=>String(Dt==null?void 0:Dt.wallet_id)===String(a)));const en=ft==null?void 0:ft.filter(Dt=>{var At,Je,He,Rt,qe,lt,xt,Nt;if(Z.length>0){const It=Z.includes("HyperLiquid")&&(Dt==null?void 0:Dt.source_market)==="hyper",xn=Z.includes("Lighter")&&(Dt==null?void 0:Dt.source_market)==="lighter";if(!It&&!xn)return!1}if(he.length>0){const It=he.includes("Short")&&((At=Dt==null?void 0:Dt.bot_params)==null?void 0:At.direction)==="SHORT",xn=he.includes("Neutral")&&((Je=Dt==null?void 0:Dt.bot_params)==null?void 0:Je.direction)==="NEUTRAL",dn=he.includes("Long")&&((He=Dt==null?void 0:Dt.bot_params)==null?void 0:He.direction)==="LONG";if(!It&&!xn&&!dn)return!1}if(ie.length>0){const It=ie.includes("Aggressive")&&((Rt=Dt==null?void 0:Dt.bot_params)==null?void 0:Rt.executionMode)==="AGGRESSIVE",xn=ie.includes("Normal")&&((qe=Dt==null?void 0:Dt.bot_params)==null?void 0:qe.executionMode)==="NORMAL",dn=ie.includes("Passive")&&((lt=Dt==null?void 0:Dt.bot_params)==null?void 0:lt.executionMode)==="PASSIVE";if(!It&&!xn&&!dn)return!1}return!(Re&&(Dt!=null&&Dt.is_deleted)||ne&&!((Nt=(xt=Dt==null?void 0:Dt.bot_params)==null?void 0:xt.coin)!=null&&Nt.toLowerCase().includes(ne.toLowerCase())))});return en==null?void 0:en.sort((Dt,At)=>{var Qn,Hn,$n,Jn,Nn,ln,Oe,sn,fn,Et,Kn,Cn,Bt,an;const Je=((Hn=(Qn=Dt==null?void 0:Dt.bot_params)==null?void 0:Qn.coin)==null?void 0:Hn.toUpperCase())||"",He=((Jn=($n=At==null?void 0:At.bot_params)==null?void 0:$n.coin)==null?void 0:Jn.toUpperCase())||"",Rt=(Dt==null?void 0:Dt.wallet_id)||0,qe=(At==null?void 0:At.wallet_id)||0,lt=Number(((Nn=Dt==null?void 0:Dt.bot_params)==null?void 0:Nn.volume)||0),xt=Number(((ln=At==null?void 0:At.bot_params)==null?void 0:ln.volume)||0),Nt=Number(((Oe=Dt==null?void 0:Dt.bot_params)==null?void 0:Oe.volume)||0),It=Number(((sn=At==null?void 0:At.bot_params)==null?void 0:sn.volume)||0),xn=Number(((fn=Dt==null?void 0:Dt.bot_params)==null?void 0:fn.volume)||0),dn=Number(((Et=At==null?void 0:At.bot_params)==null?void 0:Et.volume)||0),Mn=Number(((Kn=Dt==null?void 0:Dt.bot_params)==null?void 0:Kn.leverage)||0),_n=Number(((Cn=At==null?void 0:At.bot_params)==null?void 0:Cn.leverage)||0),kn=Number(((Bt=Dt==null?void 0:Dt.bot_params)==null?void 0:Bt.budget)||0),vn=Number(((an=At==null?void 0:At.bot_params)==null?void 0:an.budget)||0);return Ke==="coin"?Je<He?-1:Je>He?1:0:Ke==="-coin"?Je>He?-1:Je<He?1:0:Ke==="account"?Rt>qe?-1:Rt<qe?1:0:Ke==="-account"?Rt<qe?-1:Rt>qe?1:0:Ke==="volume"?lt-xt:Ke==="-volume"?xt-lt:Ke==="order"?Nt-It:Ke==="-order"?It-Nt:Ke==="perOrder"?xn-dn:Ke==="-perOrder"?dn-xn:Ke==="leverage"?Mn-_n:Ke==="-leverage"?_n-Mn:Ke==="budget"?kn-vn:Ke==="-budget"?vn-kn:0})}return e},dt=m.useRef(null),ct=["Short","Neutral","Long"],Ut=["Aggressive","Normal","Passive"],kt=Ke=>{Y(ft=>ft.includes(Ke)?ft.filter(en=>en!==Ke):[...ft,Ke])},tn=Ke=>{oe(ft=>ft.includes(Ke)?ft.filter(en=>en!==Ke):[...ft,Ke])};m.useEffect(()=>{function Ke(ft){Ne.current&&!Ne.current.contains(ft.target)&&ae(!1),be.current&&!be.current.contains(ft.target)&&Ae(!1),Ie.current&&!Ie.current.contains(ft.target)&&ye(!1),je.current&&!je.current.contains(ft.target)&&V(!1)}return document.addEventListener("mousedown",Ke),()=>document.removeEventListener("mousedown",Ke)},[]);const jt=async({id:Ke,walletAddress:ft,isDeleted:en})=>{try{const Dt=window.localStorage.getItem("hyperToken"),At=window.localStorage.getItem("hyperAddress");if(!Dt||!At||!Ke){on.error("Something went wrong!");return}X(!0),ft&&P(lt=>({...lt,[ft]:!0}));const Je="https://dextrabothypev2.nftinit.io/api/hyper/mmbot/update/",He={is_deleted:!en},qe=await(await fetch(Je,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:l?l.toLowerCase():At,token:Dt,bot_id:Number(Ke),update_params:He})})).json();qe.success?(t((qe==null?void 0:qe.data)||[]),on.success("Action completed successfully.")):on.error(qe.error_message),F(!1)}catch{on.error("Something went wrong")}finally{X(!1),P(Dt=>({...Dt,[ft]:!1}))}},un=async()=>{try{const Ke=window.localStorage.getItem("hyperToken"),ft=window.localStorage.getItem("hyperAddress");if(!Ke||!ft)return;const At=await(await fetch("https://dextrabothypev2.nftinit.io/api/hyper/mmbot/feed/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:l?l.toLowerCase():ft,token:Ke})})).json();At.success&&u((At==null?void 0:At.data)||[])}catch(Ke){on.error(Ke.message||"Something went wrong")}finally{}};m.useEffect(()=>{un();const Ke=setInterval(()=>{un()},15e3);return()=>clearInterval(Ke)},[e]);const cn=m.useMemo(()=>{const Ke={};return c==null||c.forEach(ft=>{ft!=null&&ft.id&&(Ke[ft.id]=ft.bot_params)}),Ke},[c]);m.useEffect(()=>{const Ke=localStorage.getItem("hyperToken"),ft=localStorage.getItem("hyperAddress");N(!!(Ke&&ft));const en=setInterval(()=>{const Dt=localStorage.getItem("hyperToken"),At=localStorage.getItem("hyperAddress");N(!!(Dt&&At))},800);return()=>clearInterval(en)},[]);const Pt={started:{label:"Started",color:"text-[#67FFBD]"},stopped:{label:"Stopped",color:"text-[#FF7173]"},completed:{label:"Completed",color:"text-[#F5D97A]"},forced_stopped:{label:"Stopped",color:"text-[#FF9E57]"}},Xe=()=>i.jsx(NS,{className:"w-4 h-4 text-yellow-400"}),Vt={kBONK:"BONK",kPEPE:"PEPE",kSHIB:"SHIB",kFLOKI:"FLOKI",kNEIRO:"NEIRO",kDOGS:"DOGS",kLUNC:"LUNC"};return i.jsxs(i.Fragment,{children:[i.jsx(yWe,{open:R,setOpen:F,makerStatus:jt,isStatusWallet:U,info:"table",modalLoading:z}),i.jsx(Pyn,{data:d,shareModalOpen:x,setShareModalOpen:g}),i.jsxs("div",{className:"flex flex-col items-stretch justify-start gap-[17px] text-white w-full font-manrope",children:[i.jsx("div",{className:"flex flex-col items-start justify-start gap-2 font-manrope max-w-full w-full pl-2 sm:pl-0 pt-2",children:i.jsxs("div",{className:"flex items-center justify-between gap-4 w-full px-2 sm:px-3",children:[i.jsx("div",{className:"text-white text-lg font-medium font-manrope leading-[21px]",children:"History"}),i.jsxs("label",{onClick:()=>Qe(!Re),className:"flex items-center gap-2 p-[3px] px-1 h-6 relative rounded cursor-pointer text-white text-[13px] font-semibold font-manrope",children:[i.jsx("div",{className:`w-[18px] h-[18px] flex items-center justify-center border ${Re?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} rounded`,children:Re&&i.jsx("img",{src:Wc,alt:"",className:"w-[8.5px] h-[5.6px] ml-[1px]"})}),"Active Only"]})]})}),i.jsx("div",{className:"relative w-full h-full",children:i.jsx("div",{className:"w-full h-full max-h-[540px] overflow-x-scroll relative overflow-y-scroll flex-grow",ref:dt,children:i.jsxs("table",{className:"w-full relative mb-20",children:[i.jsx("thead",{className:"sticky top-0 z-[3] bg-[#090909] whitespace-nowrap",children:i.jsxs("tr",{className:"w-full z-[4] text-[#9b9b9b] text-[13px] font-semibold font-manrope leading-[13px] tracking-tight",children:[i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#090909] sm:left-0 h-8 pl-3 min-w-[120px] sm:min-w-[120px] z-[8] relative",children:i.jsxs("div",{className:"flex items-center justify-start w-full min-w-max sticky left-0 h-8",children:[i.jsx(ci,{title:"Coin",sortKey:"coin",sortOption:it,setSortOption:tt,isFilterIcon:!1}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>V(!G),className:`${ne?"bg-gray-900":"bg-[#555555]"} inline-flex items-center p-1 rounded hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx(Ff,{className:`w-4 h-4 ${ne?"text-blue-500":"text-white"}`})}),G&&i.jsxs("div",{ref:je,className:"absolute left-[58px] mt-32 w-[208px] bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10",children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>J(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),i.jsx("input",{type:"text",value:ne,onChange:Ke=>J(Ke.target.value),className:"bg-[#333] rounded text-white py-1 px-2 text-sm outline-none mt-2  placeholder:text-sm placeholder:font-semibold placeholder:font-manrope placeholder:text-[#7c7c7c]",placeholder:"Coin"})]})]})]})}),i.jsx("th",{scope:"col",className:"font-medium sm:sticky bg-[#090909] left-[120px] h-8 px-1 min-w-[130px] z-[8] relative",children:i.jsx("div",{className:"flex items-center justify-start w-full min-w-max h-8",children:i.jsx("div",{className:"flex items-center justify-start",children:"Account"})})}),i.jsx("th",{scope:"col",className:"font-medium bg-[#090909] h-8 px-1 min-w-[100px] z-[7]",children:i.jsx("div",{className:"flex items-center justify-start w-full min-w-max h-8",children:i.jsx(ci,{title:"Leverage",sortKey:"leverage",sortOption:it,setSortOption:tt,isFilterIcon:!1})})}),i.jsx("th",{scope:"col",className:"bg-[#090909] h-10 px-1 min-w-[110px] z-[7]",children:i.jsx(ci,{title:"Volume",sortKey:"volume",sortOption:it,setSortOption:tt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#090909] h-10 px-1 min-w-[120px] z-[8]",children:i.jsx(ci,{title:"Budget",sortKey:"budget",sortOption:it,setSortOption:tt,isFilterIcon:!1})}),i.jsx("th",{scope:"col",className:"bg-[#090909] h-10 px-1 min-w-[120px] z-[7] relative",children:i.jsxs("div",{className:"flex items-center justify-start w-full min-w-max h-8",children:[i.jsx("div",{className:"flex items-center justify-start",children:"Direction"}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>Ae(!fe),className:`${he.length>0?"bg-gray-900":"bg-[#555555]"} ml-2 inline-flex items-center p-1 rounded  hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx(Ff,{className:`w-4 h-4 ${he.length>0?"text-blue-500":"text-white"}`})}),fe&&i.jsxs("div",{ref:be,className:`absolute left-[58px] mt-44 w-[208px]
                                 bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>Y(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),ct==null?void 0:ct.map(Ke=>i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-6 relative rounded hover:bg-[#464646] cursor-pointer text-white text-[13px] font-semibold font-manrope leading-[8px] mt-2",children:[i.jsx("input",{type:"checkbox",checked:he.includes(Ke),onChange:()=>kt(Ke),className:"mr-2 bg-[#3b3b3b] hidden "}),i.jsx("div",{className:`w-4 h-4 max-w-4 max-h-4 flex items-center justify-center border ${he.includes(Ke)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:he.includes(Ke)&&i.jsx("img",{src:Wc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[1px]"})}),Ke]},Ke))]})]})]})}),i.jsx("th",{scope:"col",className:"bg-[#090909] h-10 px-1 min-w-[150px] z-[6] relative",children:i.jsxs("div",{className:"flex items-center justify-start w-full min-w-max h-8",children:[i.jsx("div",{className:"flex items-center justify-start",children:"Execution Mode"}),i.jsxs("div",{className:"flex items-center justify-start",children:[i.jsx("button",{onClick:()=>ye(!ce),className:`${ie.length>0?"bg-gray-900":"bg-[#555555]"} ml-2 inline-flex items-center p-1 rounded  hover:bg-gray-700 focus:outline-none focus:ring-0 border-none`,children:i.jsx(Ff,{className:`w-4 h-4 ${ie.length>0?"text-blue-500":"text-white"}`})}),ce&&i.jsxs("div",{ref:Ie,className:`absolute left-[58px] mt-44 w-[208px]
                                   bg-[#222] border border-gray-700 rounded shadow-lg p-2 z-10`,children:[i.jsxs("div",{className:"flex justify-between items-center px-2 pb-2 border-b border-gray-600",children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:"Filter"}),i.jsx("div",{onClick:()=>oe(""),className:"h-5 px-2 py-1.5 bg-[#3d3d3d] rounded-md justify-start items-center gap-2 inline-flex cursor-pointer",children:i.jsx("div",{className:"text-[#cdcdcd] text-[11px] font-semibold font-manrope leading-[8px] pointer-events-none",children:"Clear All"})})]}),Ut==null?void 0:Ut.map(Ke=>i.jsxs("label",{className:"flex items-center gap-2 p-[7px] h-6 relative rounded hover:bg-[#464646] cursor-pointer text-white text-[13px] font-semibold font-manrope leading-[8px] mt-2",children:[i.jsx("input",{type:"checkbox",checked:ie.includes(Ke),onChange:()=>tn(Ke),className:"mr-2 bg-[#3b3b3b] hidden "}),i.jsx("div",{className:`w-4 h-4 max-w-4 max-h-4 flex items-center justify-center border ${ie.includes(Ke)?"bg-[#3ec78c] border-[#3ec78c]":"border-[#9d9d9d]"} w-[18px] h-[18px] relative rounded border`,children:ie.includes(Ke)&&i.jsx("img",{src:Wc,alt:"",className:"w-[8.50px] h-[5.66px] ml-[1px]"})}),Ke]},Ke))]})]})]})}),i.jsx("th",{scope:"col",className:"min-w-[90px] px-1",children:i.jsx("div",{className:"flex items-center justify-start gap-1 min-w-max font-manrope",children:i.jsx("div",{className:"flex items-center justify-start group",children:"Process"})})}),i.jsx("th",{scope:"col",className:"min-w-[90px] px-1",children:i.jsx("div",{className:"flex items-center justify-start gap-1 min-w-max font-manrope",children:i.jsx("div",{className:"flex items-center justify-start group",children:"Status"})})}),i.jsx("th",{scope:"col",className:"min-w-[60px] px-1",children:i.jsx("div",{className:"flex items-center justify-center gap-1 min-w-max font-manrope",children:i.jsx("div",{className:"flex items-center justify-end group",children:"Actions"})})}),i.jsx("th",{scope:"col",className:"min-w-[60px] pl-1 pr-4",children:i.jsx("div",{className:"flex items-center justify-center gap-1 min-w-max font-manrope",children:i.jsx("div",{className:"flex items-center justify-end group"})})})]})}),i.jsx("tbody",{children:C?!e||n?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:10,children:i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center -mt-16 ml-[45%] w-max",children:i.jsx(Ma,{})})})}):r&&!e?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:10,children:i.jsx("div",{className:"flex min-h-[66vh] flex-col justify-center items-center ml-[33%] w-max",children:i.jsx(Ml,{})})})}):((Yt=at(it))==null?void 0:Yt.length)==0?i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:10,children:i.jsx("div",{className:`${(e==null?void 0:e.length)==0?"ml-[33%]":"ml-[40%]"} flex min-h-[44vh] h-66 flex-col justify-center items-center w-max`,children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 -ml-16 md:-ml-0",children:[i.jsx("img",{src:ec,alt:""}),(e==null?void 0:e.length)==0?i.jsx("div",{className:"flex flex-col items-center h-max gap-3",children:i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"You do not have any recorded transactions yet."})}):i.jsx("div",{className:"flex flex-col items-center h-max gap-3",children:i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"No results match your filters."})})]})})})})}):(Ve=at(it))==null?void 0:Ve.map((Ke,ft)=>{var Nt,It,xn,dn,Mn,_n,kn,vn,Qn,Hn,$n,Jn,Nn,ln;const en=!!(Ke!=null&&Ke.is_deleted),Dt=en?"bg-[#3c1518]/70 border-[#ff6b6b]/60 text-[#ffd4d1] hover:bg-[#571f24]/80":"bg-[#123424]/70 border-[#2bd27c]/50 text-[#9cf7cb] hover:bg-[#185134]/80",At=cn[Ke==null?void 0:Ke.id]||{},Je=(At==null?void 0:At.status)||(Ke!=null&&Ke.is_deleted?"completed":"started"),He=Pt[Je],Rt=Je==="completed",qe=Rt?"↻":en?"▶":"⏹",lt=At!=null&&At.volume_usd?At.current_volume/At.volume_usd*100:0,xt=Math.min(100,Math.max(0,lt));return i.jsxs("tr",{className:`relative group hover:bg-[#151515] h-[56px] border-b border-white/5 text-white transition-opacity ${en?"opacity-60":"opacity-100"}`,children:[i.jsx("td",{scope:"row",className:`${ft%2==0,"bg-[#151515]"} sm:sticky sm:left-0 z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2.5 pl-2 h-14 max-h-14",children:i.jsx("div",{onClick:()=>{window.open(`/terminal/${Ke==null?void 0:Ke.coin}`,"_blank")},className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-1.5 sm:pl-1.5 h-8 max-h-14 rounded-2xl cursor-pointer",children:i.jsxs("div",{className:"flex justify-start items-center gap-1.5",children:[i.jsx("div",{className:"w-5 h-5 rounded-full",children:i.jsx("img",{src:`https://app.hyperliquid.xyz/coins/${Vt[(Nt=Ke==null?void 0:Ke.bot_params)==null?void 0:Nt.coin]||((xn=(It=Ke==null?void 0:Ke.bot_params)==null?void 0:It.coin)==null?void 0:xn.split("/")[0])}.svg`||Ua,alt:(dn=Ke==null?void 0:Ke.bot_params)==null?void 0:dn.coin,className:"rounded-full w-5 h-5 min-w-5 min-h-5",loading:"lazy",onError:Oe=>ea(Oe)})}),i.jsx("div",{className:"text-white text-sm font-semibold font-manrope leading-[13px] tracking-[0.18px]",children:i.jsx("div",{className:"flex justify-start items-center gap-1",children:(()=>{var Kn;const Oe=((Kn=Ke==null?void 0:Ke.bot_params)==null?void 0:Kn.coin)||"",sn=Oe.includes(":"),fn=sn?Oe.split(":")[1]:Oe,Et=sn?Oe.split(":")[0]:null;return i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-white text-sm font-semibold",children:fn}),Et&&i.jsx("span",{className:"text-[8px] bg-[#233] text-[#67FFBD] px-1 py-[0.5px] rounded-md w-fit mt-[1px]",children:Et})]})})()})})]})})})}),i.jsx("td",{scope:"row",className:`${ft%2==0,"bg-[#151515]"} sm:sticky left-[120px] z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-0.5 h-14 max-h-14",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5 text-sm font-semibold font-manrope leading-[13px] tracking-[0.28px]",children:(Ke==null?void 0:Ke.source_market)==="lighter"?i.jsx(fi,{content:"Lighter",children:i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx(Hf,{className:"w-4 h-4 text-[#fff]"}),i.jsx("p",{children:Ke==null?void 0:Ke.wm_name})]})}):(Ke==null?void 0:Ke.source_market)==="hyper"?i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(fi,{content:"Hyperliquid",children:i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("img",{src:ax,alt:"",className:"w-4 h-4 text-[#fff]"}),i.jsx("p",{children:Ke==null?void 0:Ke.wm_name})]})})}):i.jsx("div",{className:"flex justify-start items-center gap-1",children:i.jsx(fi,{content:"Dextrabot",children:i.jsxs("div",{className:"flex justify-start items-center gap-1",children:[i.jsx("img",{src:Hi,alt:"",className:"w-4 h-4 text-[#fff]"}),i.jsx("p",{children:Ke==null?void 0:Ke.wm_name})]})})})})})}),i.jsx("td",{scope:"row",className:`${ft%2==0,"bg-[#151515]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 pl-5 h-14 max-h-14",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5",children:i.jsx(ra,{info1:(Mn=Ke==null?void 0:Ke.bot_params)!=null&&Mn.leverage?`${(_n=Ke==null?void 0:Ke.bot_params)==null?void 0:_n.leverage}x`:"--",info1_Color:"text-white",rowTwo:!1})})})}),i.jsx("td",{scope:"row",className:`${ft%2==0,"bg-[#161616]"} z-[1] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5 has-tooltip relative",children:i.jsx(ra,{info1:(kn=Ke==null?void 0:Ke.bot_params)!=null&&kn.volume?`$${(Qn=(vn=Ke==null?void 0:Ke.bot_params)==null?void 0:vn.volume)==null?void 0:Qn.toLocaleString("en-US")}`:"--",info1_Color:"text-white",rowTwo:!1})})})})}),i.jsx("td",{scope:"row",className:`${ft%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4  min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5",children:i.jsx(ra,{info1:(Hn=Ke==null?void 0:Ke.bot_params)!=null&&Hn.budget?`$${(Jn=($n=Ke==null?void 0:Ke.bot_params)==null?void 0:$n.budget)==null?void 0:Jn.toLocaleString("en-US")}`:"--",info1_Color:"text-white",rowTwo:!1})})})})}),i.jsx("td",{scope:"row",className:`${ft%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4  min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5",children:i.jsx(ra,{info1:(Nn=Ke==null?void 0:Ke.bot_params)==null?void 0:Nn.direction,info1_Color:"text-white",rowTwo:!1})})})})}),i.jsx("td",{scope:"row",className:`${ft%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4  min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5",children:i.jsx(ra,{info1:(ln=Ke==null?void 0:Ke.bot_params)==null?void 0:ln.executionMode,info1_Color:"text-white",rowTwo:!1})})})})}),i.jsx("td",{scope:"row",className:`${ft%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4  min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5",children:i.jsx("div",{className:"w-16",children:i.jsxs("div",{className:"w-full h-5 rounded-md relative overflow-hidden",style:{backgroundColor:xt>=100?"rgba(40, 180, 40, 0.25)":"rgba(255, 170, 60, 0.15)"},children:[i.jsx("div",{className:"h-full transition-all duration-300",style:{width:`${xt||0}%`,backgroundColor:xt>=100?"#3ec78c":"#d68b38"}}),i.jsxs("div",{className:"absolute inset-0 flex items-center justify-center text-[10px] font-bold",style:{color:xt>=100?"#d0ffd9":"#ffcb8a"},children:[xt?xt.toFixed(0):"0","%"]})]})})})})})}),i.jsx("td",{scope:"row",className:`${ft%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-4 min-h-[56px]",children:i.jsx("div",{className:"group-hover:bg-[#222222] flex justify-start items-center gap-2 h-16 max-h-16",children:i.jsx("div",{className:"flex justify-start items-center gap-1.5",children:i.jsx(ra,{info1:He==null?void 0:He.label,info1_Color:He==null?void 0:He.color,rowTwo:!1})})})})}),i.jsx("td",{className:`${ft%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222]`,children:i.jsx("div",{className:"pl-1 flex flex-col items-end gap-2 font-manrope",children:I[Ke.wallet_address]?i.jsxs("div",{role:"status",className:"flex justify-center items-center h-5 min-h-5 w-[54px] px-2 py-1.5 rounded-md",children:[i.jsxs("svg",{"aria-hidden":"true",className:"inline w-4 h-4 text-gray-200 animate-spin dark:text-gray-600 fill-[#67FFBD]",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),i.jsx("span",{className:"sr-only",children:"Loading..."})]}):i.jsx("div",{onClick:()=>{L({id:Number(Ke==null?void 0:Ke.id),walletAddress:Ke==null?void 0:Ke.wm_address,isDeleted:Rt?!0:Ke==null?void 0:Ke.is_deleted}),F(!0)},className:`h-7 px-3 w-[42px] rounded-md border justify-center items-center gap-2 inline-flex cursor-pointer transition ${Rt?"bg-[#2d2d2d] border-[#444]":Dt}`,title:qe,children:i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:Rt?i.jsx(Xe,{}):i.jsx("div",{className:"text-[11px] font-semibold font-manrope leading-[8px] tracking-tight",children:qe})})})})}),i.jsx("td",{className:`${ft%2==0,"bg-[#161616]"} z-[2] group-hover:bg-[#222222] pr-4`,children:i.jsx("div",{onClick:()=>{f(Ke),g(!0)},className:"pl-1 flex flex-col items-end gap-2 font-manrope cursor-pointer",children:i.jsx(jet,{className:"w-5 h-5 text-white"})})})]},ft)}):i.jsx("tr",{className:"text-center w-full h-full",children:i.jsx("td",{colSpan:10,children:i.jsx("div",{className:"flex min-h-[44vh] h-66 flex-col justify-center items-center  ml-[33%] w-max",children:i.jsx("div",{className:"flex items-center justify-center gap-4 px-4 py-2 flex-col",children:i.jsxs("div",{className:"flex flex-col justify-center items-center gap-3 -ml-16 md:-ml-0",children:[i.jsx("img",{src:ec,alt:""}),i.jsx("div",{className:"flex flex-col items-center h-max gap-3",children:i.jsx("div",{className:"text-[#d3d3d3] text-sm font-semibold font-manrope leading-[8px] pt-3",children:"View your recorded transactions by connecting your wallet."})})]})})})})})})]})})})]})]})},Oyn="https://dextrabothypev2.nftinit.io",Myn=()=>{const[e,t]=m.useState(!1),[n,r]=m.useState([]),[s,a]=m.useState(""),[o,l]=m.useState("");async function c(){try{t(!0);const u=window.localStorage.getItem("hyperToken"),d=window.localStorage.getItem("hyperAddress");if(!u||!d)return;const x=await(await fetch(`${Oyn}/api/hyper/mmbot/list/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:d.toLowerCase(),token:u})})).json();x!=null&&x.success?r((x==null?void 0:x.data)||[]):(r([]),a((x==null?void 0:x.error_message)||"Failed to load info."))}catch(u){a(u.message||"Wallet list error.")}finally{t(!1)}}return i.jsxs("div",{className:"relative text-white overflow-hidden overscroll-none bg-[#050505]",children:[i.jsxs("div",{className:"pointer-events-none absolute inset-0",children:[i.jsx("div",{className:"absolute inset-0 opacity-60",style:{background:"radial-gradient(1200px 800px at 10% 0%, rgba(103,255,189,0.12), transparent 55%), radial-gradient(900px 900px at 90% 100%, rgba(96,93,255,0.12), transparent 55%)"}}),i.jsx("div",{className:"absolute inset-0 opacity-[0.08]",style:{background:"repeating-linear-gradient(90deg, rgba(255,255,255,0.08) 0, rgba(255,255,255,0.08) 1px, transparent 1px, transparent 120px)"}})]}),i.jsxs("div",{className:"relative mx-auto flex w-full flex-col gap-10 px-4 pb-16 pt-10 sm:px-6 lg:px-0",style:{fontFamily:"Manrope, ui-sans-serif"},children:[i.jsxs("div",{className:"relative mx-auto flex w-full flex-col gap-10 max-w-6xl",children:[i.jsx("div",{className:"absolute right-2 -top-11 text-xs font-semibold text-[#7C7C7C] mt-2",children:i.jsxs("div",{className:"flex justify-start items-center gap-2",children:[i.jsxs("div",{onClick:()=>window.open("https://www.youtube.com/watch?v=QJHZwcKMSI0","_blank"),className:"h-6 sm:h-7 w-[130px] py-2 bg-[#FF0000] rounded-[10px] shadow-[0px_2px_4px_0px_rgba(0,0,0,0.16)] border border-[#ff4d4d] inline-flex justify-center items-center gap-1 cursor-pointer",children:[i.jsx("div",{"data-svg-wrapper":!0,children:i.jsx(Wk,{className:"w-4 h-4 text-white"})}),i.jsx("div",{className:"text-white text-[13px] font-medium leading-[8px]",children:"YouTube"})]}),i.jsxs("div",{onClick:()=>window.open("https://docs.dextrabot.com/market-maker-bot/hyperliquid-market-maker-bot","_blank"),className:"h-6 sm:h-7 w-max py-[5px] rounded-[256px] flex justify-start items-center gap-2 cursor-pointer border border-[#353535] px-4 bg-[#242424] hover:bg-[#2e2e2e]",children:[i.jsx("img",{src:s5,className:"w-[14px] h-[14px]"}),i.jsx("div",{className:"min-w-max text-white text-xs font-medium font-manrope leading-none pointer-events-none",children:"Docs"})]})]})}),i.jsxs(go.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4},className:"relative overflow-hidden rounded-[28px] border border-white/10 bg-[#050606]/90 px-4 pb-6 pt-8 shadow-[0_25px_80px_rgba(0,0,0,0.65)] backdrop-blur-xl sm:px-10",children:[i.jsx("div",{className:"absolute inset-0 opacity-40",children:i.jsx("div",{className:"absolute inset-y-0 left-0 w-1/3",style:{background:"radial-gradient(450px 200px at 0% 0%, rgba(103,255,189,0.3), transparent 75%)"}})}),i.jsx("div",{className:"relative z-10",children:i.jsx(Tyn,{fetchInfoOnOpen:c,setIsFilterWallet:l})})]})]}),i.jsx("section",{className:"relative w-full rounded-[32px] border border-white/10 bg-[#050606]/90 px-3 pb-4 pt-6 shadow-[0_25px_80px_rgba(0,0,0,0.65)] backdrop-blur-2xl sm:px-6",children:i.jsx("div",{className:"rounded-[28px] border border-white/5 bg-[#090909]/90 p-3 shadow-inner",children:i.jsx(Fyn,{data:n,setData:r,loading:e,error:s,fetchInfoOnOpen:c,isFilterWallet:o})})})]})]})},pF="#67FFBD",Ryn=({code:e,onCodeChange:t,onSubmit:n,loading:r,loadingCheckAccount:s,message:a})=>{const o=r||s||!e.trim();return i.jsx("div",{className:"h-[calc(100vh-10rem)]",children:s?i.jsxs("div",{className:"absolute mx-auto z-50 h-full w-full flex justify-center items-center overflow-hidden rounded-[16px] bg-transparent",children:[i.jsx(go.div,{className:"pointer-events-none absolute -inset-[40%] opacity-80 blur-3xl h-full",style:{background:"radial-gradient(circle at 15% 0%, rgba(103,255,189,0.32), transparent 55%), radial-gradient(circle at 85% 100%, rgba(103,255,189,0.24), transparent 60%)"},initial:{x:"-4%",y:"-8%"},animate:{x:["-4%","4%","-2%","-4%"],y:["-8%","6%","2%","-8%"]},transition:{duration:24,repeat:1/0,ease:"easeInOut"}}),i.jsx(Ma,{})]}):i.jsxs("div",{className:"relative  h-full w-full flex justify-center items-center overflow-hidden rounded-[16px] bg-black",children:[i.jsx(go.div,{className:"pointer-events-none absolute -inset-[40%] opacity-80 blur-3xl h-full",style:{background:"radial-gradient(circle at 15% 0%, rgba(103,255,189,0.32), transparent 55%), radial-gradient(circle at 85% 100%, rgba(103,255,189,0.24), transparent 60%)"},initial:{x:"-4%",y:"-8%"},animate:{x:["-4%","4%","-2%","-4%"],y:["-8%","6%","2%","-8%"]},transition:{duration:24,repeat:1/0,ease:"easeInOut"}}),i.jsxs(go.div,{initial:{opacity:0,y:16,scale:.96},animate:{opacity:1,y:0,scale:1},transition:{duration:.5,ease:[.16,1,.3,1]},className:"relative z-10 w-full max-w-[460px] rounded-2xl border border-[#17211b] bg-[#050505] shadow-[0_30px_90px_rgba(0,0,0,0.9)] overflow-hidden",children:[i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-50",children:i.jsx("div",{className:"w-full h-full",style:{background:"radial-gradient(900px 500px at 50% -10%, rgba(103,255,189,0.45), transparent 70%)"}})}),i.jsx("video",{src:YN,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",className:"w-full h-[260px] object-cover bg-black"},YN)]}),i.jsxs("div",{className:"px-5 pb-5 pt-4 space-y-4",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("div",{className:"text-[11px] font-medium tracking-[0.18em] uppercase",style:{color:pF},children:"Early Access"}),i.jsxs("div",{className:"text-lg font-semibold",children:["Enter ",i.jsx("span",{style:{color:pF},children:"Alpha Code"})]}),i.jsx("p",{className:"text-[12px] text-white/60",children:"Market Maker is currently in private alpha. Enter your invitation code to unlock this feature in your account."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-[11px] text-white/45",children:"Alpha Code"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"text",value:e,onChange:l=>t(l.target.value.toUpperCase()),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),n())},placeholder:"DXTR-XXXXX",autoComplete:"off",spellCheck:!1,className:"flex-1 h-10 px-3 rounded-md bg-[#050505] border border-[#1e2e27] text-[13px] tracking-[0.18em] font-mono text-white placeholder:text-white/20 focus:outline-none focus:border-[#67FFBD]"}),i.jsx("button",{type:"button",onClick:n,disabled:o,className:`h-10 px-4 rounded-md text-[13px] font-semibold transition-colors ${o?"bg-[#101613] text-white/40 cursor-not-allowed":"text-black hover:opacity-90"}`,style:o?void 0:{backgroundColor:pF},children:r?"Checking…":"Access"})]})]}),(s||a)&&i.jsxs("div",{className:"text-[11px] min-h-[16px]",children:[s&&!a&&i.jsx("span",{className:"text-white/40",children:"Checking your eligibility…"}),a&&i.jsx("span",{style:{color:pF},children:a})]})]})]})]})})},Lyn=()=>{const{setSignModalOpen:e}=m.useContext(Gr);return i.jsxs("div",{className:"relative h-[calc(100vh-10rem)]",children:[i.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-80",style:{background:"radial-gradient(900px 600px at 0% 0%, rgba(103,255,189,0.16), transparent 65%), radial-gradient(700px 500px at 100% 100%, rgba(96,93,255,0.14), transparent 65%)"}}),i.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.08]",style:{background:"repeating-linear-gradient(135deg, rgba(255,255,255,0.06) 0, rgba(255,255,255,0.06) 1px, transparent 1px, transparent 10px)"}}),i.jsx("div",{className:"relative mx-auto z-10 flex h-full w-full max-w-4xl items-center justify-center px-4",children:i.jsxs("div",{className:"relative flex w-full max-w-xl flex-col items-center justify-center gap-4 rounded-[24px] border border-white/10 bg-[#050505]/95 px-6 py-7 shadow-[0_20px_60px_rgba(0,0,0,0.65)] backdrop-blur-xl",children:[i.jsx("div",{className:"absolute inset-x-10 -top-10 h-24 bg-gradient-to-br from-[#67ffbd]/40 via-transparent to-[#8570ff]/30 opacity-60 blur-2xl"}),i.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-4",children:[i.jsx("div",{className:"inline-flex items-center rounded-full border border-[#1c2b25] bg-[#07130d] px-3 py-1 text-[11px] font-semibold uppercase tracking-[0.25em] text-[#67ffbd]",children:"Market Maker"}),i.jsx("p",{className:"text-sm font-semibold text-white sm:text-base",children:"Connect your wallet to use Market Maker"}),i.jsx("p",{className:"text-[12px] text-[#9BA1A6] text-center max-w-md",children:"To start and manage your market maker bots on Hyperliquid, you need to connect your wallet first."}),i.jsx("div",{className:"w-[220px] pt-1",children:i.jsx("button",{onClick:()=>e(!0),className:"w-full h-[36px] rounded-xl font-bold text-[12px] transition-opacity mb-2 flex items-center justify-center bg-[#67FFBD] text-black",children:"Connect"})})]})]})})]})},Dyn=()=>{const{setTelegramChatId:e,setSubscriberRole:t,setMushboomerETH:n,setIsWhitelist:r,setMushboomerSOL:s,setIsReferralCode:a,setIsReferralCodeName:o,setHyperToken:l,setHyperAddress:c,setSignModalOpen:u}=m.useContext(Gr),[d,f]=m.useState(!1),[x,g]=m.useState(!1),[v,w]=m.useState(""),[C,N]=m.useState(!1),[I,P]=m.useState(""),[R,F]=m.useState(!1);m.useEffect(()=>{const L=localStorage.getItem("hyperToken"),z=localStorage.getItem("hyperAddress");f(!!(L&&z));const X=setInterval(()=>{const ne=localStorage.getItem("hyperToken"),J=localStorage.getItem("hyperAddress");f(!!(ne&&J))},800);return()=>clearInterval(X)},[]),m.useEffect(()=>{(async()=>{var ne,J;const z=window.localStorage.getItem("hyperToken"),X=window.localStorage.getItem("hyperAddress");if(!(!z||!X))try{F(!0);const Z=await Si(X.toLowerCase(),z);Z!=null&&Z.success?(e(Z==null?void 0:Z.telegram_chat_id),t(Z==null?void 0:Z.subscriber_role),n((ne=Z==null?void 0:Z.mushboomer_counts)==null?void 0:ne.eth),s((J=Z==null?void 0:Z.mushboomer_counts)==null?void 0:J.sol),a(Z==null?void 0:Z.referral_code),o(Z==null?void 0:Z.refcode),r(Z==null?void 0:Z.whitelist),g(Z==null?void 0:Z.mm_hyper_alpha_code),F(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),l(""),c(""),F(!1))}catch(Z){console.error("Token verification error:",Z),F(!1)}})()},[d]);const U=async()=>{var X,ne,J,Z;const L=window.localStorage.getItem("hyperToken"),z=window.localStorage.getItem("hyperAddress");if(!v.trim()){on.error("Please enter your alpha code");return}if(!L||!z){u(!0);return}N(!0),P("");try{const re={address:z==null?void 0:z.toLowerCase(),token:L,alpha_code:v.trim(),source_market:"hyper",app_type:"mm_bot"},Y=(await ls.post("https://dextrabothypev2.nftinit.io/api/subscriber/alpha_code/set/",re)).data||{};if(Y.success){const ie=Y.message||"Alpha code added successfully";on.success(`${ie}`,{style:{border:"1px solid #22c55e",padding:"16px",color:"#fff",borderRadius:"999px",background:"#14532d",height:"60px"},iconTheme:{primary:"#22c55e",secondary:"#FFFAEE"}}),P(ie),g(!0)}else{const ie=Y.error_message||Y.message||"This alpha code is invalid";on.success(`${ie}.`,{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"400px",minWidth:"400px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}}),P(ie)}}catch(re){const he=((ne=(X=re==null?void 0:re.response)==null?void 0:X.data)==null?void 0:ne.error_message)||((Z=(J=re==null?void 0:re.response)==null?void 0:J.data)==null?void 0:Z.message)||re.message||"Failed to validate alpha code";on.success(`${he}.`,{style:{padding:"12px",color:"#e2e2e2",borderRadius:"256px",background:"rgba(255, 121, 124, 0.32)",width:"300px",minWidth:"300px",height:"40px",backdropFilter:"blur(48px)"},iconTheme:{primary:"#ff797c",secondary:"#7d3031"}}),P(he)}finally{N(!1)}};return i.jsxs(i.Fragment,{children:[i.jsx(Io,{children:i.jsxs($o,{children:[i.jsx("title",{children:"Market Maker Bot (Hyperliquid) | Dextrabot"}),i.jsx("meta",{name:"description",content:"Automate market making on Hyperliquid. Generate trading volume and provide liquidity 24/7."}),i.jsx("meta",{property:"og:title",content:"Market Maker Bot (Hyperliquid) | Dextrabot"}),i.jsx("meta",{property:"og:description",content:"Automate market making on Hyperliquid. Generate trading volume and provide liquidity 24/7."}),i.jsx("meta",{property:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{property:"og:url",content:"https://app.dextrabot.com/market-maker "})]})}),i.jsx("div",{style:{minHeight:"calc(100vh - 5rem)"},className:"flex justify-center items-start w-full h-full px-4 pt-6 pb-6 sm:px-6 sm:pt-6 sm:pb-6 bg-[#050505] overflow-auto",children:i.jsx("div",{className:"flex flex-col items-stretch justify-start gap-[26px] w-full flex-grow xl:flex-grow-0",children:d?x&&d?i.jsx(Myn,{}):i.jsx(Ryn,{code:v,onCodeChange:w,onSubmit:U,loading:C,loadingCheckAccount:R,message:I}):i.jsx(Lyn,{})})})]})},Byn=({data:e,refreshAgent:t,loadingCheckAccount:n,slotCount:r})=>{var Y,ie,oe;const s=e==null?void 0:e.subs_expire_date,[a,o]=m.useState(!1),[l,c]=m.useState(!1),[u,d]=m.useState(!1),[f,x]=m.useState(null),g=s?new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):null,v={extended:{name:"Extended",type:"img",src:"https://app.extended.exchange/assets/logo/extended-long.svg"},lighter:{name:"Lighter",type:"component",component:i.jsx(Hf,{className:"w-6 h-6 text-white"})},pacifica:{name:"Pacifica",type:"img",src:"https://app.pacifica.fi/imgs/logo.svg"},paradex:{name:"Paradex",type:"component",component:i.jsx(nMe,{className:"h-2.5 text-white -ml-6"})},variational:{name:"Variational",type:"img",src:"https://omni.variational.io/_app/immutable/assets/full_omni_wordmark.DwlcSpMk.svg"},aster:{name:"Aster",type:"img",src:"https://static.asterdex.com/cloud-futures/static/images/aster/logo.svg"},basedapp:{name:"BasedApp",type:"img",src:oke},apex:{name:"Apex",type:"img",src:"https://omni.apex.exchange/assets/logo_content-CY9uyFbz.svg"}},w={lighter:{name:"Lighter",type:"component",src:i.jsx(Hf,{className:"w-6 h-6 text-white"})}},C=["aster","basedapp","apex","extended"],N=(e==null?void 0:e.slots_info)||{},I=Object.fromEntries(Object.entries(N).filter(([G])=>!C.includes(G))),P=Object.values(I).reduce((G,V)=>G+V.total_qty,0),R=Object.values(I).reduce((G,V)=>G+V.active_qty,0),F=(((Y=e==null?void 0:e.copy_trade_slots_info)==null?void 0:Y.using_slot_count)||0)+(((ie=e==null?void 0:e.copy_trade_slots_info)==null?void 0:ie.total_slot_count)||0),U=((oe=e==null?void 0:e.copy_trade_slots_info)==null?void 0:oe.using_slot_count)||0,L=((e==null?void 0:e.bot_slots_info)||[]).find(G=>String((G==null?void 0:G.bot_type)||"").toLowerCase()==="grid_bot"&&String((G==null?void 0:G.source_market)||"").toLowerCase()==="lighter")||{},z=(L==null?void 0:L.total_slot_count)||0,X=(L==null?void 0:L.using_subs_slot_count)||0,ne=(L==null?void 0:L.using_extra_slot_count)||0,J=X+ne,Z=J+z,re=()=>{navigator.clipboard.writeText(`https://app.dextrabot.com/referral/${e.refcode}`),o(!0),setTimeout(()=>o(!1),2e3)},he=!!window.localStorage.getItem("hyperToken");return i.jsxs(i.Fragment,{children:[l&&Ia.createPortal(i.jsx(Ale,{open:l,setOpen:c,oldSlotCount:f,checkAccountTrade:n,tradeMarket:"copyTrade"}),document.body),u&&Ia.createPortal(i.jsx(d5,{open:u,setOpen:d,oldSlotCount:J,checkAccountLighter:t,product:"grid_bot"}),document.body),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-orange-500 to-red-600 flex items-center justify-center text-2xl font-bold shadow-lg shadow-orange-500/30",children:i.jsx("img",{src:i5,alt:"",className:"w-7 h-7"})}),i.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Profile"}),i.jsx("div",{onClick:()=>{t()},className:"flex justify-center items-center cursor-pointer",children:i.jsx(NS,{className:"w-4 h-4 text-[#929292] hover:text-white"})})]}),he?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:`${(e==null?void 0:e.subs_expire_day)===null?"flex":"hidden"} flex-col items-start gap-4 bg-gradient-to-br from-[#141414] to-[#0c0c0c] border border-white/5 rounded-2xl p-6 max-w-[480px] shadow-[0_0_40px_-15px_rgba(255,140,0,0.3)]`,children:[i.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-orange-500 to-red-600 flex items-center justify-center text-xl font-bold text-white shadow-lg shadow-orange-500/40",children:"!"}),i.jsx("h2",{className:"text-xl font-semibold text-white/90",children:"No Active Subscription"}),i.jsx("p",{className:"text-base text-white/70 leading-relaxed",children:"You don't have an active subscription yet. Subscribe now to unlock trading bots, copy trading, and farming tools across multiple DEXs."})]}),i.jsxs("div",{className:`${(e==null?void 0:e.subs_expire_day)===null||!(e!=null&&e.subs_expire_day)?"hidden":""} bg-gradient-to-br from-[#141414] to-[#0c0c0c] rounded-2xl p-6 border border-white/5 relative overflow-hidden w-full`,children:[i.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-orange-500/10 to-transparent rounded-bl-full"}),i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx("span",{className:"text-orange-400",children:"⏱"}),i.jsx("h2",{className:"text-lg font-semibold text-white/90",children:"Subscription Status"}),n&&i.jsx("span",{className:"-ml-1",children:i.jsx(ij,{size:"w-3.5 h-3.5"})})]}),i.jsxs("div",{className:"flex flex-wrap items-baseline gap-2 mb-2",children:[i.jsx("span",{className:"text-4xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-orange-400 to-red-500",children:e==null?void 0:e.subs_expire_day}),i.jsx("span",{className:"text-white/60 text-lg",children:"days remaining"})]}),i.jsxs("p",{className:"text-white/40 text-sm",children:["Expires on"," ",i.jsx("span",{className:"text-white/60",children:g||"-"})]})]}),i.jsxs("div",{className:`${(e==null?void 0:e.copy_trade_slots_info)===null?"hidden":""}  bg-gradient-to-br from-[#141414] to-[#0c0c0c] rounded-2xl p-6 border border-white/5 relative overflow-hidden w-full`,children:[i.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-orange-500/10 to-transparent rounded-bl-full"}),i.jsxs("div",{className:"flex justify-between items-center mb-2.5 gap-2",children:[i.jsxs("div",{className:"flex items-center gap-1 mb-3",children:[i.jsx("h2",{className:"text-lg font-semibold text-white/90",children:"Copy Trade Slots"}),n&&i.jsx("span",{className:"-ml-1",children:i.jsx(ij,{size:"w-3.5 h-3.5"})})]}),i.jsxs("div",{className:"px-3 py-1 bg-orange-500/10 rounded-lg text-orange-400 text-sm font-medium -mt-2.5",children:[U,"/",F," Active"]})]}),i.jsxs("div",{className:`flex items-center justify-between py-3 px-4 rounded-xl 
               bg-white/[0.02] hover:bg-white/[0.04] transition-colors 
               border border-white/5`,children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:"h-5 flex items-center justify-center",children:w.lighter.src}),i.jsx("span",{className:"font-medium text-white/80",children:w.lighter.name})]}),i.jsxs("div",{className:"flex justify-end items-center gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:`w-2 h-2 rounded-full ${U>0?"bg-green-400 shadow-green-400/50 shadow-sm":"bg-white/20"}`}),i.jsx("span",{className:U>0?"text-green-400 font-semibold":"text-white/40",children:U}),i.jsx("span",{className:"text-white/30",children:"/"}),i.jsx("span",{className:"text-white/60",children:F})]}),i.jsx("div",{className:"w-24 h-1.5 bg-white/5 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-gradient-to-r from-orange-500 to-red-500 rounded-full transition-all",style:{width:`${F>0?U/F*100:0}%`}})})]})]}),i.jsx("div",{className:"flex justify-end items-center w-full mt-4",children:i.jsx("button",{onClick:()=>{x(r),c(!0)},className:"px-4 py-1.5 rounded-lg text-sm font-semibold bg-gradient-to-r from-orange-500 to-red-500 text-white shadow-[0_0_12px_rgba(255,100,0,0.4)]hover:shadow-[0_0_18px_rgba(255,120,0,0.6)] transition-all",children:"Get More Slots"})})]}),i.jsxs("div",{className:`${Z===0?"hidden":""} bg-gradient-to-br from-[#141414] to-[#0c0c0c] rounded-2xl p-6 border border-white/5 relative overflow-hidden w-full`,children:[i.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-orange-500/10 to-transparent rounded-bl-full"}),i.jsxs("div",{className:"flex justify-between items-center mb-2.5 gap-2",children:[i.jsxs("div",{className:"flex items-center gap-1 mb-3",children:[i.jsx("h2",{className:"text-lg font-semibold text-white/90",children:"Grid Bot Slots"}),n&&i.jsx("span",{className:"-ml-1",children:i.jsx(ij,{size:"w-3.5 h-3.5"})})]}),i.jsxs("div",{className:"px-3 py-1 bg-orange-500/10 rounded-lg text-orange-400 text-sm font-medium -mt-2.5",children:[J,"/",Z," Active"]})]}),i.jsxs("div",{className:`flex items-center justify-between py-3 px-4 rounded-xl 
               bg-white/[0.02] hover:bg-white/[0.04] transition-colors 
               border border-white/5`,children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:"h-5 flex items-center justify-center",children:w.lighter.src}),i.jsx("span",{className:"font-medium text-white/80",children:"Lighter"})]}),i.jsxs("div",{className:"flex justify-end items-center gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:`w-2 h-2 rounded-full ${J>0?"bg-green-400 shadow-green-400/50 shadow-sm":"bg-white/20"}`}),i.jsx("span",{className:J>0?"text-green-400 font-semibold":"text-white/40",children:J}),i.jsx("span",{className:"text-white/30",children:"/"}),i.jsx("span",{className:"text-white/60",children:Z})]}),i.jsx("div",{className:"w-24 h-1.5 bg-white/5 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-gradient-to-r from-orange-500 to-red-500 rounded-full transition-all",style:{width:`${Z>0?J/Z*100:0}%`}})})]})]}),i.jsx("div",{className:"flex justify-end items-center w-full mt-4",children:i.jsx("button",{onClick:()=>{d(!0)},className:"px-4 py-1.5 rounded-lg text-sm font-semibold bg-gradient-to-r from-orange-500 to-red-500 text-white shadow-[0_0_12px_rgba(255,100,0,0.4)]hover:shadow-[0_0_18px_rgba(255,120,0,0.6)] transition-all",children:"Get More Slots"})})]}),i.jsxs("div",{className:`${Object.keys((e==null?void 0:e.slots_info)||{}).length===0?"hidden":""} bg-gradient-to-br from-[#141414] to-[#0c0c0c] rounded-2xl p-6 border border-white/5 w-full`,children:[i.jsxs("div",{className:"flex items-center justify-between mb-5",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-lg font-semibold text-white/90",children:"Slots Overview"}),n&&i.jsx("span",{className:"-ml-1",children:i.jsx(ij,{size:"w-3.5 h-3.5"})})]}),i.jsxs("div",{className:"px-3 py-1 bg-orange-500/10 rounded-lg text-orange-400 text-sm font-medium",children:[R,"/",P," Active"]})]}),i.jsx("div",{className:"space-y-2",children:Object.entries(I).filter(([G])=>!C.includes(G)).map(([G,V])=>{var ee,ae,fe;return i.jsxs("div",{className:"flex items-center justify-between py-3 px-4 rounded-xl bg-white/[0.02] hover:bg-white/[0.04] transition-colors border border-transparent hover:border-white/5",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("span",{className:`${G==="apex"?"h-6":G==="basedapp"?"h-3.5":G==="pacifica"?"h-5":G==="variational"?"h-3":"h-3.5"}  flex items-center justify-center`,children:[((ee=v[G])==null?void 0:ee.type)==="img"&&i.jsx("img",{src:v[G].src,alt:v[G].name,className:"w-full h-full"}),((ae=v[G])==null?void 0:ae.type)==="component"&&v[G].component]}),G==="lighter"&&i.jsx("span",{className:"font-medium text-white/80 -ml-3",children:((fe=v[G])==null?void 0:fe.name)||G})]}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:`w-2 h-2 rounded-full ${V.active_qty>0?"bg-green-400 shadow-lg shadow-green-400/50":"bg-white/20"}`}),i.jsx("span",{className:V.active_qty>0?"text-green-400 font-semibold":"text-white/40",children:V.active_qty}),i.jsx("span",{className:"text-white/30",children:"/"}),i.jsx("span",{className:"text-white/60",children:V.total_qty})]}),i.jsx("div",{className:"w-24 h-1.5 bg-white/5 rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-gradient-to-r from-orange-500 to-red-500 rounded-full transition-all",style:{width:`${V.active_qty/V.total_qty*100}%`}})})]})]},G)})})]}),i.jsxs("div",{className:`${e!=null&&e.referral_code&&(e==null?void 0:e.refcode)!==null?"":"hidden"} bg-gradient-to-br from-[#141414] to-[#0c0c0c] rounded-2xl p-6 border border-white/5 w-full`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[i.jsx("span",{className:"text-orange-400",children:"🎁"}),i.jsx("h2",{className:"text-lg font-semibold text-white/90",children:"Referral Code"}),n&&i.jsx("span",{className:"-ml-1",children:i.jsx(ij,{size:"w-3.5 h-3.5"})})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"flex-1 px-4 py-3 bg-black/30 rounded-xl border border-white/10 font-mono text-lg text-orange-400 tracking-wider",children:e==null?void 0:e.refcode}),i.jsx("button",{onClick:re,className:"px-4 py-3 bg-white/5 border border-white/10 rounded-xl hover:bg-orange-500/10 hover:border-orange-500/30 transition-all group",children:a?i.jsx("span",{className:"text-green-400",children:"✓"}):i.jsx("span",{className:"text-white/60 group-hover:text-orange-400 transition-colors",children:"📋"})})]}),i.jsx("p",{className:"text-white/40 text-sm mt-3",children:"Share your code and earn rewards for each referral"})]})]}):i.jsxs("div",{className:"flex flex-col items-start gap-4 bg-gradient-to-br from-[#141414] to-[#0c0c0c] border border-white/5 rounded-2xl p-6 max-w-[480px] shadow-[0_0_40px_-15px_rgba(255,140,0,0.3)]",children:[i.jsx("div",{className:`w-12 h-12 rounded-xl bg-gradient-to-br from-orange-500 to-red-600
      flex items-center justify-center text-xl font-bold text-white shadow-lg shadow-orange-500/40`,children:"!"}),i.jsx("h2",{className:"text-xl font-semibold text-white/90",children:"Wallet Not Connected"}),i.jsx("p",{className:"text-base text-white/70 leading-relaxed",children:"Connect your wallet to access your profile, manage subscriptions, and view your active trading slots."})]})]})},$yn=()=>{const{setSignModalOpen:e,setTelegramChatId:t,setSubscriberRole:n,setSubsExpireDay:r,setMushboomerETH:s,setMushboomerSOL:a,setIsReferralCode:o,setIsReferralCodeName:l,setIsWhitelist:c,setHyperToken:u,setHyperAddress:d}=m.useContext(Gr),{address:f}=Yr(),[x,g]=m.useState(1),[v,w]=m.useState({}),[C,N]=m.useState(""),[I,P]=m.useState(""),[R,F]=m.useState(!1),[U,L]=m.useState(!1),[z,X]=m.useState(""),[ne,J]=m.useState(0),[Z,re]=m.useState(0),[he,Y]=m.useState(!1),[ie,oe]=m.useState(0),[G,V]=m.useState(!1),ee=it=>/^\d*$/.test(it),ae=it=>{["e","E","+","-"].includes(it.key)&&it.preventDefault()},fe=m.useMemo(()=>{if(x==="")return!1;const it=Number(x);return Number.isInteger(it)&&it>=1},[x]),ye=(it=>{const[tt,at]=it.split(" "),[dt,ct,Ut]=tt.split("-").map(Number),[kt,tn]=at.split(":").map(Number);return new Date(Date.UTC(Ut,ct-1,dt,kt-3,tn))})("29-11-2025 23:59");m.useState(()=>new Date().getTime()>=ye.getTime());const Ne=m.useRef(ne);m.useEffect(()=>{Ne.current=ne},[ne]);const be=m.useRef(0);m.useEffect(()=>{be.current=Z},[Z]);const je=async()=>{var at,dt,ct;const it=window.localStorage.getItem("hyperToken"),tt=window.localStorage.getItem("hyperAddress");if(!(!it||!tt))try{V(!0);const Ut=await Si(tt.toLowerCase(),it);Ut!=null&&Ut.success?(t(Ut==null?void 0:Ut.telegram_chat_id),n(Ut==null?void 0:Ut.subscriber_role),r(Ut==null?void 0:Ut.subs_expire_day),s((at=Ut==null?void 0:Ut.mushboomer_counts)==null?void 0:at.eth),a((dt=Ut==null?void 0:Ut.mushboomer_counts)==null?void 0:dt.sol),o(Ut==null?void 0:Ut.referral_code),l(Ut==null?void 0:Ut.refcode),c(Ut==null?void 0:Ut.whitelist),u(it),d(tt),N(Ut==null?void 0:Ut.farming_tools),J(Number((Ut==null?void 0:Ut.subs_expire_day)||0)),w(Ut),V(!1),oe(((ct=Ut==null?void 0:Ut.copy_trade_slots_info)==null?void 0:ct.extra_slot_count)||0)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),u(""),d(""),V(!1))}catch(Ut){console.error("Token verification error:",Ut),console.error(Ut.message||"An unknown error occurred."),V(!1)}};m.useEffect(()=>{he&&je()},[he]),m.useEffect(()=>{const it=localStorage.getItem("hyperToken"),tt=localStorage.getItem("hyperAddress");Y(!!(it&&tt));const at=setInterval(()=>{const dt=localStorage.getItem("hyperToken"),ct=localStorage.getItem("hyperAddress");Y(!!(dt&&ct))},800);return()=>clearInterval(at)},[]);const Ie=async()=>new yl(window.ethereum).eth.getAccounts(tt=>tt),Re=async(it="subscribe",tt=24,at=5e3)=>{tt<=0||(await new Promise(dt=>setTimeout(dt,at)),await je(),it==="subscribe"&&Ne.current===be.current?Re(it,tt-1,at):je())},Qe=async it=>{const tt=window.localStorage.getItem("hyperToken"),at=window.localStorage.getItem("hyperAddress");if(!tt||!f){e(!0);return}P(""),re(Ne.current),be.current=Ne.current,L(!0),F(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(Ut){console.error("Failed to switch network",Ut),F(!1);return}const dt=new yl(window.ethereum);var ct=await Ie();if(ct.length>0?ct=ct[0]:ct=void 0,ct){const kt=it*.12,tn=dt.utils.toWei(kt.toString(),"ether"),jt={from:ct,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:tn};await dt.eth.sendTransaction(jt).then(un=>{console.log("txHash :>> ",un),F(!1),X(un.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:f?f.toLowerCase():at,token:tt,payment_tx:un.transactionHash,payment_role:"farming_tools",tx_qty:Number(x)})}),je(),Re("subscribe")}).catch(un=>{console.log(un),un.code===-32003||un.message.includes("insufficient funds")?P("Insufficient funds."):un.message==="MetaMask Tx Signature: User denied transaction signature."&&L(!1)})}else await dt.eth.requestAccounts()},Be=()=>{je()};return window.localStorage.getItem("hyperToken"),i.jsxs(i.Fragment,{children:[i.jsx(fd,{open:U,setOpen:L,transactionHash:z,transactionLoading:R,paymentPresaleRole:!(ne<=Z),errorFunds:I,activeMethod:2}),i.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-start md:justify-center md:items-start gap-8 w-full h-full bg-[#161616]",children:[i.jsx("div",{className:"flex justify-center items-start md:items-center w-full pl-0 sm:pl-4 md:pl-2",children:i.jsx("div",{className:"flex flex-col gap-2 pt-0 md:pt-7 lg:pt-0",children:i.jsx("div",{className:"flex flex-col items-start justify-start gap-4 md:mb-10 lg:mb-16 overflow-scroll h-full",children:i.jsx(Byn,{data:v,refreshAgent:Be,loadingCheckAccount:G,slotCount:ie})})})}),i.jsxs("div",{className:"relative mx-1 h-full py-10 hidden md:block",children:[i.jsx("div",{className:"w-[2px] h-full bg-[linear-gradient(to_bottom,rgba(255,140,0,0)_0%,rgba(255,140,0,0.8)_15%,rgba(255,50,150,0.8)_85%,rgba(255,50,150,0)_100%)]"}),i.jsx("div",{className:"absolute inset-0 w-[8px] h-full bg-[linear-gradient(to_bottom,rgba(255,140,0,0)_0%,rgba(255,140,0,0.4)_15%,rgba(255,50,150,0.4)_85%,rgba(255,50,150,0)_100%)] blur-md mx-auto"})]}),i.jsx("div",{className:"flex flex-col justify-center items-center md:items-center w-full h-full gap-4 pb-10 mb:pb-0",children:i.jsxs("div",{className:"flex flex-col items-center gap-4 border border-[#404040] bg-[#141414] rounded-xl px-3  py-7 shadow-[0_0_25px_rgba(255,120,50,0.25)] min-w-[362px]",children:[i.jsx("div",{className:"rounded-lg overflow-hidden",children:i.jsx("video",{src:lD,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",className:"w-full h-[284px] lg:h-[284px] object-cover"},lD)}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-center gap-2",children:[i.jsx("button",{onClick:()=>g(it=>{const tt=Number(it||0);return tt>1?String(tt-1):"1"}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"–"}),i.jsx("input",{value:x,onChange:it=>{const tt=it.target.value.trim();if(tt==="")return g("");ee(tt)&&g(tt)},onKeyDown:ae,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10",className:"w-full h-8 text-center rounded-md bg-[#242424] border border-[#353535] text-white text-[13px] font-semibold outline-none placeholder:text-[#7F7F7F]"}),i.jsx("button",{onClick:()=>g(it=>{const tt=Number(it||0);return String(tt+1)}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"+"})]}),x!==""&&!fe&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer that is at least 1."})]}),fe&&i.jsxs("div",{className:"text-[12px] font-semibold text-green-400",children:[" ",x," months will be added to your subscription."]}),i.jsx("div",{className:"relative flex items-center justify-center gap-3 px-4 py-2 rounded-xl shadow-[0_0_25px_rgba(255,140,0,0.15)] backdrop-blur-md bg-white/5 border border-white/10",children:i.jsxs("span",{className:"text-2xl font-bold bg-gradient-to-r from-orange-400 to-pink-500 bg-clip-text text-transparent",children:[(x*.12).toFixed(2)," ETH"]})}),i.jsx("div",{onClick:it=>{it.preventDefault(),fe&&Qe(x)},className:`text-[10px] sm:text-xs xl:text-[13px] font-semibold text-gray-200 select-none border  rounded-md px-4 py-2  ${fe?"border-[#8861FF] bg-[#7446FF] cursor-pointer":"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed"}`,children:"Buy Now"})]})})]})]})},Uyn=()=>{Yr();const{setTelegramChatId:e,setSubscriberRole:t,setSubsExpireDay:n,setMushboomerETH:r,setMushboomerSOL:s,setIsReferralCode:a,setIsReferralCodeName:o,setIsWhitelist:l,setHyperToken:c,setHyperAddress:u}=m.useContext(Gr);return m.useEffect(()=>{(async()=>{var g,v;const f=window.localStorage.getItem("hyperToken"),x=window.localStorage.getItem("hyperAddress");if(!(!f||!x))try{const w=await Si(x.toLowerCase(),f);w!=null&&w.success?(e(w==null?void 0:w.telegram_chat_id),t(w==null?void 0:w.subscriber_role),n(w==null?void 0:w.subs_expire_day),r((g=w==null?void 0:w.mushboomer_counts)==null?void 0:g.eth),s((v=w==null?void 0:w.mushboomer_counts)==null?void 0:v.sol),a(w==null?void 0:w.referral_code),o(w==null?void 0:w.refcode),l(w==null?void 0:w.whitelist)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),c(""),u(""))}catch(w){console.error("Token verification error:",w),console.error(w.message||"An unknown error occurred.")}})()},[]),i.jsxs(i.Fragment,{children:[i.jsx(Io,{children:i.jsxs($o,{children:[i.jsx("title",{children:"My Profile - Dextrabot | Manage Your Trading Bots & Subscriptions"}),i.jsx("link",{rel:"canonical",href:"https://app.dextrabot.com/my-profile"}),i.jsx("meta",{name:"description",content:"View and manage your Dextrabot profile. Track your subscription status, active trading slots across multiple DEXs, referral rewards, and account features. Optimize your automated trading experience."}),i.jsx("meta",{name:"og:title",content:"My Profile - Dextrabot | Manage Your Trading Bots & Subscriptions"}),i.jsx("meta",{name:"og:description",content:"View and manage your Dextrabot profile. Track your subscription status, active trading slots across multiple DEXs, referral rewards, and account features. Optimize your automated trading experience."}),i.jsx("meta",{name:"og:image",content:"https://app.dextrabot.com/dextrabotIcon.png"}),i.jsx("meta",{name:"og:url",content:"https://app.dextrabot.com/my-profile"})]})}),i.jsx("div",{className:"flex justify-center items-start w-full h-[calc(100vh-5rem)] min-h-max px-4 pt-4 pb-10 bg-[#161616]",children:i.jsx("div",{className:"flex flex-col items-stretch justify-center h-full gap-[26px] w-full flex-grow xl:flex-grow-0",children:i.jsx($yn,{})})})]})},zyn=()=>{const{setSignModalOpen:e,setTelegramChatId:t,setSubscriberRole:n,setSubsExpireDay:r,setMushboomerETH:s,setMushboomerSOL:a,setIsReferralCode:o,setIsReferralCodeName:l,setIsWhitelist:c,setHyperToken:u,setHyperAddress:d}=m.useContext(Gr),{address:f}=Yr(),[x,g]=m.useState(1),[v,w]=m.useState(""),[C,N]=m.useState(!1),[I,P]=m.useState(!1),[R,F]=m.useState(""),[U,L]=m.useState(0),[z,X]=m.useState(0),[ne,J]=m.useState(!1),[Z,re]=m.useState(!1),he=Ae=>/^\d*$/.test(Ae),Y=Ae=>{["e","E","+","-"].includes(Ae.key)&&Ae.preventDefault()},ie=m.useMemo(()=>{if(x==="")return!1;const Ae=Number(x);return Number.isInteger(Ae)&&Ae>=1},[x]),oe=m.useRef(U);m.useEffect(()=>{oe.current=U},[U]);const G=m.useRef(0);m.useEffect(()=>{G.current=z},[z]);const V=async()=>{var ye,Ne;const Ae=window.localStorage.getItem("hyperToken"),ce=window.localStorage.getItem("hyperAddress");if(!(!Ae||!ce))try{re(!0);const be=await Si(ce.toLowerCase(),Ae);be!=null&&be.success?(t(be==null?void 0:be.telegram_chat_id),n(be==null?void 0:be.subscriber_role),r(be==null?void 0:be.subs_expire_day),s((ye=be==null?void 0:be.mushboomer_counts)==null?void 0:ye.eth),a((Ne=be==null?void 0:be.mushboomer_counts)==null?void 0:Ne.sol),o(be==null?void 0:be.referral_code),l(be==null?void 0:be.refcode),c(be==null?void 0:be.whitelist),u(Ae),d(ce),L(Number((be==null?void 0:be.subs_expire_day)||0)),re(!1)):(window.localStorage.removeItem("hyperToken"),window.localStorage.removeItem("hyperAddress"),u(""),d(""),re(!1))}catch(be){console.error("Token verification error:",be),console.error(be.message||"An unknown error occurred."),re(!1)}};m.useEffect(()=>{ne&&V()},[ne]),m.useEffect(()=>{const Ae=localStorage.getItem("hyperToken"),ce=localStorage.getItem("hyperAddress");J(!!(Ae&&ce));const ye=setInterval(()=>{const Ne=localStorage.getItem("hyperToken"),be=localStorage.getItem("hyperAddress");J(!!(Ne&&be))},800);return()=>clearInterval(ye)},[]);const ee=async()=>new yl(window.ethereum).eth.getAccounts(ce=>ce),ae=async(Ae="subscribe",ce=24,ye=5e3)=>{ce<=0||(await new Promise(Ne=>setTimeout(Ne,ye)),await V(),Ae==="subscribe"&&oe.current===G.current?ae(Ae,ce-1,ye):V())},fe=async Ae=>{const ce=window.localStorage.getItem("hyperToken"),ye=window.localStorage.getItem("hyperAddress");if(!ce||!f){e(!0);return}w(""),X(oe.current),G.current=oe.current,P(!0),N(!0);try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0x1"}]})}catch(je){console.error("Failed to switch network",je),N(!1);return}const Ne=new yl(window.ethereum);var be=await ee();if(be.length>0?be=be[0]:be=void 0,be){const Ie=Ae*.09,Re=Ne.utils.toWei(Ie.toString(),"ether"),Qe={from:be,to:"0xdEAe8586eD227A5096EBae47342fFc1ED99f13F9",value:Re};await Ne.eth.sendTransaction(Qe).then(Be=>{console.log("txHash :>> ",Be),N(!1),F(Be.transactionHash),fetch("https://dextrabothypev2.nftinit.io/api/hyper/payment/save/",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({address:f?f.toLowerCase():ye,token:ce,payment_tx:Be.transactionHash,payment_role:"farming_tools",tx_qty:Number(x)})}),V(),ae("subscribe")}).catch(Be=>{console.log(Be),Be.code===-32003||Be.message.includes("insufficient funds")?w("Insufficient funds."):Be.message==="MetaMask Tx Signature: User denied transaction signature."&&P(!1)})}else await Ne.eth.requestAccounts()};return i.jsxs(i.Fragment,{children:[I&&Ia.createPortal(i.jsx(fd,{open:I,setOpen:P,transactionHash:R,transactionLoading:C,paymentPresaleRole:!(U<=z),errorFunds:v,activeMethod:2}),document.body),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-center gap-2",children:[i.jsx("button",{onClick:()=>g(Ae=>{const ce=Number(Ae||0);return ce>1?String(ce-1):"1"}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"–"}),i.jsx("input",{value:x,onChange:Ae=>{const ce=Ae.target.value.trim();if(ce==="")return g("");he(ce)&&g(ce)},onKeyDown:Y,inputMode:"numeric",autoComplete:"off",placeholder:"e.g. 10",className:"w-full h-8 text-center rounded-md bg-[#242424] border border-[#353535] text-white text-[13px] font-semibold outline-none placeholder:text-[#7F7F7F]"}),i.jsx("button",{onClick:()=>g(Ae=>{const ce=Number(Ae||0);return String(ce+1)}),className:"w-8 h-8 flex items-center justify-center rounded-md bg-[#242424] border border-[#353535] text-[#bbb] hover:text-white hover:border-[#555] transition-all",children:"+"})]}),x!==""&&!ie&&i.jsx("div",{className:"text-[#FF797C] text-[12px]",children:"Enter an integer that is at least 1."})]}),ie&&i.jsxs("div",{className:"text-[12px] font-semibold text-green-400",children:[" ",x," months will be added to your subscription."]}),i.jsxs("div",{className:"relative flex items-center justify-center gap-3 px-4 py-2 rounded-xl shadow-[0_0_25px_rgba(255,140,0,0.15)] backdrop-blur-md bg-white/5 border border-white/10",children:[i.jsxs("span",{className:"line-through text-gray-400/70 text-xl",children:[(x*.12).toFixed(2)," ETH"]}),i.jsxs("span",{className:"text-2xl font-bold bg-gradient-to-r from-orange-400 to-pink-500 bg-clip-text text-transparent",children:[(x*.09).toFixed(2)," ETH"]})]}),i.jsx("div",{onClick:Ae=>{Ae.preventDefault(),ie&&fe(x)},className:`text-[10px] sm:text-xs xl:text-[13px] font-semibold text-gray-200 select-none border  rounded-md px-4 py-2  ${ie?"border-[#8861FF] bg-[#7446FF] cursor-pointer":"bg-[#2a2a2a] border-[#3a3a3a] opacity-60 cursor-not-allowed"}`,children:"Buy Now"})]})},Hyn=({open:e,setOpen:t})=>{const{subsExpireDay:n}=m.useContext(Gr),r=()=>{const s=Date.now(),a=localStorage.getItem("hyperAddress");localStorage.setItem(`lighterCopyTradeDismissedAt_${a}`,s.toString()),t(!1)};return i.jsxs(ga,{open:e,onClose:()=>{},className:"relative z-50 font-manrope",children:[i.jsx(xa,{transition:!0,style:{backgroundColor:"rgba(0, 0, 0, 0.48)"},className:"fixed inset-0 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in"}),i.jsx("div",{className:"fixed inset-0 z-50 w-screen overflow-y-auto",children:i.jsx("div",{className:"flex min-h-full items-center justify-center p-4 text-center sm:p-0",children:i.jsx(da,{transition:!0,className:"relative transform overflow-hidden bg-[#161616] text-left shadow-xl transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95 rounded-3xl",children:i.jsxs("div",{className:"relative flex flex-col justify-start items-center gap-6 w-full min-h-[420px] p-4 sm:p-12 rounded-3xl max-w-[600px]",children:[i.jsx("button",{onClick:r,className:"cursor-pointer flex w-9 h-9 absolute right-3 top-3 rounded-full p-1 justify-center items-center hover:bg-[#7535FE]/70",children:i.jsx("img",{className:"p-1",src:Oa,alt:"close"})}),i.jsx("div",{className:"pt-4",children:i.jsx("img",{src:Hi,alt:"",className:"w-[86px h-[86px]"})}),i.jsx("div",{className:"flex justify-center items-center w-full",children:i.jsxs("div",{className:"flex flex-col items-center w-full gap-3 sm:gap-5",children:[i.jsxs("div",{className:"text-white font-manrope text-[20px] sm:text-[22px] font-extrabold leading-none",children:["Your subscription is ending in"," ",n||0," days"]}),i.jsxs("div",{className:"text-[13px] sm:text-[14px] text-center text-white/90 font-manrope font-semibold leading-[18px] max-w-[70ch]",children:["Renew now to keep access to Copy Trading, bots, and all premium features.",i.jsx("br",{}),i.jsx("br",{}),i.jsx("span",{className:"text-[#67FFBD] font-bold",children:"Renew now and get 25% off your subscription."})]}),i.jsx(zyn,{})]})})]})})})})]})},Vyn=({open:e,setOpen:t})=>{const n=()=>{localStorage.setItem("strategySelectorModalDismissedAt",Date.now().toString()),t(!1)},r=()=>{localStorage.setItem("strategySelectorModalDismissedAt",Date.now().toString())},s=[{key:"hyperGrid",title:"Hyperliquid Grid Bot",desc:"Automated grid trading on Hyperliquid futures.",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg",url:"/terminal/hyperliquid/BTC#gridbot"},{key:"hlMaker",title:"Hyperliquid Market Maker Bot",desc:"Liquidity-providing market making with dynamic spreads.",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg",url:"/market-maker"},{key:"lighterMaker",title:"Lighter DCA Bot",desc:"Automate your DCA entries on Lighter. Coming soon.",icon:i.jsx(oy,{className:"w-4 h-4 text-white"}),comingSoon:!0},{key:"extendedMaker",title:"Extended DCA Bot",desc:"Advanced market making strategies.",icon:"https://app.extended.exchange/assets/logo/extended.svg",badge:"New",highlighted:!0,url:"/dca-bot"},{key:"lighterGrid",title:"Lighter Grid Bot",desc:"Automated grid trading on Lighter futures.",icon:i.jsx(oy,{className:"w-4 h-4 text-white"}),url:"/terminal/lighter/BTC#gridbot"},{key:"extendedGrid",title:"Extended Grid Bot",desc:"Advanced grid logic with dynamic rebalancing.",icon:"https://app.extended.exchange/assets/logo/extended.svg",url:"/terminal/extended/BTC#gridbot",badge:"New",highlighted:!0},{key:"hlCopyTrade",title:"Hyperliquid Copy Trade",desc:"Automatically copy trade best Hyperliquid wallets.",icon:"https://app.hyperliquid.xyz/coins/HYPE.svg",url:"/discover-wallets"},{key:"lgCopyTrade",title:"Lighter Copy Trade",desc:"Automatically copy trade best Hyperliquid wallets on Lighter.",icon:i.jsx(oy,{className:"w-4 h-4 text-white"}),url:"/discover-wallets"},{key:"lgDelta",title:"Lighter Delta Neutral",desc:"Delta-neutral farming on Lighter.",icon:i.jsx(oy,{className:"w-4 h-4 text-white"}),url:"/discover-wallets#lighter-farming"},{key:"asterBot",title:"Aster Farming Bot",desc:"Farm points on Aster exchange.",icon:i.jsx(tMe,{className:"w-4 h-4"}),url:"/discover-wallets#aster-farming"},{key:"extendedBot",title:"Extended Farming Bot",desc:"Farm points on Extended exchange.",icon:"https://app.extended.exchange/assets/logo/extended.svg",url:"/discover-wallets#extended-farming"},{key:"variationalBot",title:"Variational Farming Bot",desc:"Farm points on Variational exchange.",icon:Oyt,url:"/discover-wallets#variational-farming"},{key:"paradexBot",title:"Paradex Farming Bot",desc:"Farm points on Paradex exchange.",icon:Ryt,url:"/discover-wallets#paradex-farming"},{key:"pacificaBot",title:"Pacifica Farming Bot",desc:"Farm points on Pacifica exchange.",icon:"https://app.pacifica.fi/imgs/icon.svg",url:"/discover-wallets#pacifica-farming"},{key:"apexBot",title:"Apex Farming Bot",desc:"Farm points on Apex exchange.",icon:Myt,url:"/discover-wallets#apex-farming"}],a=o=>{if(!o)return null;if(Se.isValidElement(o))return o;if(typeof o=="function"){const l=o;return i.jsx(l,{className:"w-6 h-6"})}return typeof o=="string"&&(o.startsWith("/")||o.startsWith("http"))?i.jsx("img",{src:o,alt:"",className:"w-6 h-6 object-contain",draggable:!1}):i.jsx("span",{className:"text-2xl leading-none",children:o})};return i.jsxs(ga,{open:e,onClose:n,className:"relative z-50",children:[i.jsx(xa,{className:"fixed inset-0 bg-black/50 backdrop-blur-sm"}),i.jsx("div",{className:"fixed inset-0 flex items-center justify-center px-3 pb-4 pt-10 sm:p-0",children:i.jsxs(da,{className:"relative w-full max-w-[780px] max-h-[76vh] sm:max-h-[96vh] rounded-t-[28px] sm:rounded-[28px] border border-white/5 bg-gradient-to-b from-[#191919] via-[#141414] to-[#111111] p-4 sm:py-3 sm:px-6 shadow-[0_22px_60px_rgba(0,0,0,0.9)] overflow-y-auto",children:[i.jsx("button",{onClick:n,className:"cursor-pointer flex w-9 h-9 absolute right-3 top-3 rounded-full p-1 justify-center items-center hover:bg-[#7535FE]/70",children:i.jsx("img",{src:Oa,alt:"close",className:"w-4 h-4"})}),i.jsx("h2",{className:"text-white text-[20px] sm:text-[26px] font-extrabold text-center mb-3 sm:mb-4 tracking-tight",children:"What brings you here?"}),i.jsx("div",{className:"space-y-4",children:i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2.5",children:s==null?void 0:s.map(o=>i.jsxs("div",{onClick:()=>{o.url&&(o.url.startsWith("/"),window.open(o.url,"_blank"),r())},className:`relative rounded-2xl p-2.5 transition ${o.highlighted&&!o.comingSoon?"bg-[#111827] border border-[#1c2741] hover:bg-[#202020]":o.highlighted&&o.comingSoon?"bg-[#6B5CFF14] border border-[#6B5CFF59]":"bg-[#181818] border border-[#2a2a2a] hover:bg-[#202020]"} ${o.comingSoon?"cursor-not-allowed":"cursor-pointer"}`,children:[o.badge&&!o.comingSoon&&i.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 z-10",children:i.jsx("div",{className:"px-1 sm:px-2.5 py-0.5 rounded-md text-[9px] sm:text-[10px] font-bold bg-[#3b82f6] text-white shadow-md min-w-max",children:o.badge})}),o.badge&&o.comingSoon&&i.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 z-10",children:i.jsx("div",{className:"px-1.5 sm:px-2.5 py-0.5 rounded-md text-[9px] sm:text-[10px] font-bold bg-[#6B5CFF] text-white shadow-md min-w-max",children:o.badge})}),i.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[i.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-black/20 text-2xl",children:a(o.icon)}),i.jsx("div",{className:"text-white font-semibold text-sm",children:o.title}),o.desc&&i.jsx("div",{className:"text-[#9b9b9b] text-[11px] leading-tight",children:o.desc})]})]},o.key))})})]})})]})},Wyn=({open:e,setOpen:t})=>{const n=()=>{localStorage.setItem("lighterReportModalDismissed","true"),t(!1)};return i.jsxs(ga,{open:e,onClose:n,className:"relative z-50",children:[i.jsx(xa,{className:"fixed inset-0 bg-black/50 backdrop-blur-sm"}),i.jsx("div",{className:"fixed inset-0 flex items-center justify-center px-3 pb-4 pt-4 sm:p-0",children:i.jsxs(da,{className:"relative w-full rounded-[28px] sm:rounded-[28px] border border-white/5 bg-gradient-to-b from-[#191919] via-[#141414] to-[#111111] p-4 sm:p-12 shadow-[0_22px_60px_rgba(0,0,0,0.9)] overflow-y-auto  max-w-[500px]",children:[i.jsx("button",{onClick:n,className:"cursor-pointer flex w-9 h-9 absolute right-3 top-3 rounded-full p-1 justify-center items-center hover:bg-[#7535FE]/70",children:i.jsx("img",{src:Oa,alt:"close",className:"w-4 h-4"})}),i.jsx("div",{className:"w-fulll flex justify-center items-center",children:i.jsx("img",{src:i5,alt:""})}),i.jsx("div",{className:"flex flex-col justify-center items-center gap-4 mt-4 pl-3",children:i.jsx("div",{className:"text-[#fff] text-[13px] leading-5 font-semibold font-manrope",children:"Lighter discontinued all the existing APIs. In order to continue Grid Bot, Copy Trading etc.. you need to re-generate your keys and renew them."})}),i.jsx("img",{src:Lyt,alt:"",className:"mt-4 rounded-md"})]})})]})},mF="#basedapp-farming",xF="#aster-farming",gF="#lighter-farming",bF="#apex-farming",yF="#variational-farming",vF="#extended-farming",wF="#paradex-farming",CF="#pacifica-farming";function qyn(){const e=[{from:"/feed",to:"/tracker"},{from:"/wallet-activities",to:"/tracker"},{from:"/favorite-wallets",to:"/tracked-wallets"},{from:"/high-volume-trades",to:"/hyperliquid-whale-trades"}],{hyperToken:t,subsExpireDay:n}=m.useContext(Gr),r=Ic(),s=nl(),[a,o]=m.useState(!1),[l,c]=m.useState(!1),[u,d]=m.useState(!1),[f,x]=m.useState(!1),g=r.hash===mF,v=r.hash===xF,w=r.hash===gF,C=r.hash===bF,N=r.hash===yF,I=r.hash===vF,P=r.hash===wF,R=r.hash===CF,F=Se.useCallback(re=>{re?r.hash!==mF&&s(r.pathname+r.search+mF,{replace:!0}):r.hash===mF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]),U=Se.useCallback(re=>{re?r.hash!==xF&&s(r.pathname+r.search+xF,{replace:!0}):r.hash===xF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]),L=Se.useCallback(re=>{re?r.hash!==gF&&s(r.pathname+r.search+gF,{replace:!0}):r.hash===gF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]),z=Se.useCallback(re=>{re?r.hash!==bF&&s(r.pathname+r.search+bF,{replace:!0}):r.hash===bF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]),X=Se.useCallback(re=>{re?r.hash!==yF&&s(r.pathname+r.search+yF,{replace:!0}):r.hash===yF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]),ne=Se.useCallback(re=>{re?r.hash!==vF&&s(r.pathname+r.search+vF,{replace:!0}):r.hash===vF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]),J=Se.useCallback(re=>{re?r.hash!==wF&&s(r.pathname+r.search+wF,{replace:!0}):r.hash===wF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]),Z=Se.useCallback(re=>{re?r.hash!==CF&&s(r.pathname+r.search+CF,{replace:!0}):r.hash===CF&&s(r.pathname+r.search,{replace:!0})},[r.pathname,r.search,r.hash,s]);return m.useEffect(()=>{const re=localStorage.getItem("dailyPicksDismissedAt"),he=localStorage.getItem("dailyPicksBlockedUntil"),Y=Date.now();if(he&&Y<parseInt(he)){o(!1);return}if(re){const ie=new Date(parseInt(re)).toDateString(),oe=new Date().toDateString();if(ie===oe){o(!1);return}}o(!0)},[r.pathname,t]),m.useEffect(()=>{const re=window.localStorage.getItem("hyperToken"),he=localStorage.getItem("hyperAddress");if(!re||!he)return;if(n===null||n===0||Number(n)>7){c(!1);return}const Y=localStorage.getItem(`lighterCopyTradeDismissedAt_${he}`);if(Y){const ie=new Date(parseInt(Y)).toDateString(),oe=new Date().toDateString();if(ie===oe){window.location.pathname==="/my-profile"?c(!0):c(!1);return}}c(!0)},[r.pathname,t,n]),m.useEffect(()=>{const re=localStorage.getItem("strategySelectorModalDismissedAt");if(re){const he=new Date(parseInt(re)).toDateString(),Y=new Date().toDateString();if(he===Y){d(!1);return}}d(!0)},[r.pathname,t]),m.useEffect(()=>{if(localStorage.getItem("lighterReportModalDismissed")==="true"){x(!1);return}x(!0)},[r.pathname]),i.jsxs(i.Fragment,{children:[i.jsx("div",{children:i.jsx(WYe,{})}),i.jsxs("div",{children:[i.jsx(Lin,{}),i.jsxs(zKe,{children:[i.jsx(ba,{path:"/",element:i.jsx(Qan,{})}),i.jsx(ba,{path:"/sitemap",element:i.jsx(non,{})}),i.jsx(ba,{path:"/videos",element:i.jsx(ron,{})}),e.map(({from:re,to:he})=>i.jsx(ba,{path:re,element:i.jsx(Ede,{to:he,replace:!0})},re)),i.jsxs(ba,{element:i.jsx(prn,{}),children:[i.jsx(ba,{path:"/mobile-auth",element:i.jsx(ton,{})}),i.jsx(ba,{path:"discover-wallets",element:i.jsx(qsn,{})}),i.jsx(ba,{path:"/hyperliquid-vaults",element:i.jsx(son,{})}),i.jsx(ba,{path:"/back-testing",element:i.jsx($bn,{})}),i.jsx(ba,{path:"/hyperliquid-whale-trades",element:i.jsx(_bn,{})}),i.jsx(ba,{path:"wallet-details/:walletAddress",element:i.jsx(Min,{})}),i.jsx(ba,{path:"tracked-wallets",element:i.jsx(Bin,{})}),i.jsx(ba,{path:"tracker",element:i.jsx(ran,{})}),i.jsx(ba,{path:"referral/:code?",element:i.jsx(can,{})}),i.jsx(ba,{path:"wallet-management",element:i.jsx(wan,{})}),i.jsx(ba,{path:"copy-trade",element:i.jsx(Nan,{})}),i.jsx(ba,{path:"leaderboard",element:i.jsx(Tan,{})}),i.jsx(ba,{path:"ticker",element:i.jsx(lon,{})}),i.jsx(ba,{path:"terminal",element:i.jsx(Ede,{to:"/terminal/hyperliquid/BTC",replace:!0})}),i.jsx(ba,{path:"terminal/:coin",element:i.jsx(Gyn,{})}),i.jsx(ba,{path:"terminal/:exchange/:coin",element:i.jsx(j0n,{})}),i.jsx(ba,{path:"telegram-verify",element:i.jsx(Tbn,{})}),i.jsx(ba,{path:"telegram-api-wallet",element:i.jsx(zbn,{})}),i.jsx(ba,{path:"subscribe",element:i.jsx(kyn,{})}),i.jsx(ba,{path:"my-profile",element:i.jsx(Uyn,{})}),i.jsx(ba,{path:"hyperliquid-fee-calculator",element:i.jsx(fNe,{})}),i.jsx(ba,{path:"hyperliquid-fee-calculator/:walletAddress",element:i.jsx(fNe,{})}),i.jsx(ba,{path:"market-maker",element:i.jsx(Dyn,{})}),i.jsx(ba,{path:"dca-bot",element:i.jsx(Eyn,{})})]}),i.jsx(ba,{path:"*",element:i.jsx(Kyn,{url:"https://dextrabot.com/"})})]}),i.jsx($oe,{open:g,setOpen:F}),i.jsx(Hyn,{open:l,setOpen:c}),i.jsx(Vyn,{open:u,setOpen:d}),i.jsx(Wyn,{open:f,setOpen:x}),i.jsx(Uoe,{open:v,setOpen:U}),i.jsx(zoe,{open:w,setOpen:L}),i.jsx(Hoe,{open:C,setOpen:z}),i.jsx(Voe,{open:N,setOpen:X}),i.jsx(v$,{open:I,setOpen:ne}),i.jsx(Woe,{open:P,setOpen:J}),i.jsx(qoe,{open:R,setOpen:Z})]})]})}function Gyn(){const{coin:e}=Z3(),t=nl();return m.useEffect(()=>{const n=e||"BTC",r=typeof window<"u"&&window.location.hash||"";t(`/terminal/hyperliquid/${n}${r}`,{replace:!0})},[e,t]),null}function Kyn({url:e}){return Se.useEffect(()=>{window.location.replace(e)},[e]),null}const Yyn="4953aed406a7fd4457496250b7e4efbc",Xyn=_Rt({appName:"Dextrabot",projectId:Yyn,chains:[QE,i1e,s1e,r1e],transports:{[QE.id]:cj(),[i1e.id]:cj(),[s1e.id]:cj(),[r1e.id]:cj()},ssr:!1}),Qyn=new yxt,Zyn=document.getElementById("root"),Jyn=FNe.createRoot(Zyn);Jyn.render(i.jsx(QKe,{children:i.jsx(G0t,{config:Xyn,children:i.jsx(Uxt,{client:Qyn,children:i.jsx(YOt,{modalSize:"compact",theme:lMe({borderRadius:"large",fontStack:"rounded",overlayBlur:"large"}),children:i.jsx(Lbt,{children:i.jsx(qyn,{})})})})})}));const yNe=Object.freeze(Object.defineProperty({__proto__:null,default:Vee},Symbol.toStringTag,{value:"Module"}));export{Or as B,Die as E,zj as H,Jr as _,q2n as a,Zg as b,lB as c,sft as d,e2 as e,V0 as f,tie as g,ji as h,yie as i,t2n as j,ju as k,O9e as l,F0t as m,tFt as r,jc as s,mvn as t};